mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 04:05:49 +00:00
NFToken -> NFT
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
html: authorize-minter.html
|
html: authorize-minter.html
|
||||||
parent: quickstart-javascript.html
|
parent: quickstart-javascript.html
|
||||||
blurb: Authorize another account to mint NFTokens for you.
|
blurb: Authorize another account to mint NFTs for you.
|
||||||
labels:
|
labels:
|
||||||
- Accounts
|
- Accounts
|
||||||
- Quickstart
|
- Quickstart
|
||||||
@@ -11,12 +11,12 @@ labels:
|
|||||||
|
|
||||||
# Assign an Authorized Minter
|
# Assign an Authorized Minter
|
||||||
|
|
||||||
You can assign another account permission to mint NFTokens for you.
|
You can assign another account permission to mint NFTs for you.
|
||||||
|
|
||||||
This example shows how to:
|
This example shows how to:
|
||||||
|
|
||||||
1. Authorize an account to create NFTokens for your account.
|
1. Authorize an account to create NFTs for your account.
|
||||||
2. Mint a NFToken for another account, when authorized.
|
2. Mint an NFT for another account, when authorized.
|
||||||
|
|
||||||
[](img/quickstart28.png)
|
[](img/quickstart28.png)
|
||||||
|
|
||||||
@@ -35,9 +35,9 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
1. Click **Get New Standby Account**.
|
1. Click **Get New Standby Account**.
|
||||||
2. Click **Get New Operational Account**.
|
2. Click **Get New Operational Account**.
|
||||||
|
|
||||||
## Authorize an Account to Create NFTokens
|
## Authorize an Account to Create NFTs
|
||||||
|
|
||||||
To authorize another account to create NFTokens for your account:
|
To authorize another account to create NFTs for your account:
|
||||||
|
|
||||||
1. Copy the **Operational Account** value.
|
1. Copy the **Operational Account** value.
|
||||||
2. Paste the **Operational Account** value in the **Authorized Minter** field.
|
2. Paste the **Operational Account** value in the **Authorized Minter** field.
|
||||||
@@ -45,45 +45,45 @@ To authorize another account to create NFTokens for your account:
|
|||||||
|
|
||||||
[](img/quickstart29.png)
|
[](img/quickstart29.png)
|
||||||
|
|
||||||
## Mint a NFToken for Another Account
|
## Mint an NFT for Another Account
|
||||||
|
|
||||||
This example uses the Operational account, which was authorized in the previous step, to mint a token on behalf of the Standby account.
|
This example uses the Operational account, which was authorized in the previous step, to mint a token on behalf of the Standby account.
|
||||||
|
|
||||||
To mint a non-fungible token for another account:
|
To mint a non-fungible token for another account:
|
||||||
|
|
||||||
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_.
|
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_.
|
||||||
2. Enter the **NFToken URL**. This is a URI that points to the data or metadata associated with the NFToken object. You can use the sample URI provided if you do not have one of your own.
|
2. Enter the **NFT URL**. This is a URI that points to the data or metadata associated with the NFT object. You can use the sample URI provided if you do not have one of your own.
|
||||||
3. Enter the **Transfer Fee**, a percentage of the proceeds that the original creator receives from future sales of the NFToken. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFToken to be transferrable, set this field to 0.
|
3. Enter the **Transfer Fee**, a percentage of the proceeds that the original creator receives from future sales of the NFT. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFT to be transferrable, set this field to 0.
|
||||||
4. Copy the **Standby Account** value.
|
4. Copy the **Standby Account** value.
|
||||||
5. Paste the **Standby Account** value in the Operational account **Issuer** field.
|
5. Paste the **Standby Account** value in the Operational account **Issuer** field.
|
||||||
6. Click the Operational account **Mint Other** button.
|
6. Click the Operational account **Mint Other** button.
|
||||||
|
|
||||||
[](img/quickstart30.png)
|
[](img/quickstart30.png)
|
||||||
|
|
||||||
Once the item is minted, the authorized minter can sell the NFToken normally. The proceeds go to the authorized minter, less the transfer fee. The minter and the issuer can settle up on a division of the price separately.
|
Once the item is minted, the authorized minter can sell the NFT normally. The proceeds go to the authorized minter, less the transfer fee. The minter and the issuer can settle up on a division of the price separately.
|
||||||
|
|
||||||
## Create a Sell Offer
|
## Create a Sell Offer
|
||||||
|
|
||||||
To create a NFToken sell offer:
|
To create an NFT sell offer:
|
||||||
|
|
||||||
1. On the Operational account side, enter the **Amount** of the sell offer in drops (millionths of an XRP), for example 100000000 (100 XRP
|
1. On the Operational account side, enter the **Amount** of the sell offer in drops (millionths of an XRP), for example 100000000 (100 XRP
|
||||||
2. Set the **Flags** field to _1_.
|
2. Set the **Flags** field to _1_.
|
||||||
3. Enter the **NFToken ID** of the minted NFToken you want to sell.
|
3. Enter the **NFT ID** of the minted NFT you want to sell.
|
||||||
4. Optionally, enter a number of days until **Expiration**.
|
4. Optionally, enter a number of days until **Expiration**.
|
||||||
5. Click **Create Sell Offer**.
|
5. Click **Create Sell Offer**.
|
||||||
|
|
||||||
The important piece of information in the response is the NFToken Offer Index, labeled as `nft_offer_index`, which is used to accept the sell offer.
|
The important piece of information in the response is the NFT Offer Index, labeled as `nft_offer_index`, which is used to accept the sell offer.
|
||||||
|
|
||||||
[](img/quickstart31.png)
|
[](img/quickstart31.png)
|
||||||
|
|
||||||
## Accept Sell Offer
|
## Accept Sell Offer
|
||||||
|
|
||||||
Once a sell offer is available, you can create a new account to accept the offer and buy the NFToken.
|
Once a sell offer is available, you can create a new account to accept the offer and buy the NFT.
|
||||||
|
|
||||||
To accept an available sell offer:
|
To accept an available sell offer:
|
||||||
|
|
||||||
1. Click **Get New Standby Account**.
|
1. Click **Get New Standby Account**.
|
||||||
1. Enter the **NFToken Offer Index** (labeled as `nft_offer_index` in the NFToken offer results. This is different from the `nft_id`).
|
1. Enter the **NFT Offer Index** (labeled as `nft_offer_index` in the NFT offer results. This is different from the `nft_id`).
|
||||||
2. Click **Accept Sell Offer**.
|
2. Click **Accept Sell Offer**.
|
||||||
|
|
||||||
The results show that the Issuer account has been credited 25 XRP. The Buyer account was debited the 100 XRP price plus 12 drops as the transaction cost. The Seller (Authorized Minter) account is credited 75 XRP. the Issuer and the Seller can divide the proceeds per their agreement in a separate transaction.
|
The results show that the Issuer account has been credited 25 XRP. The Buyer account was debited the 100 XRP price plus 12 drops as the transaction cost. The Seller (Authorized Minter) account is credited 75 XRP. the Issuer and the Seller can divide the proceeds per their agreement in a separate transaction.
|
||||||
@@ -95,7 +95,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Set Minter
|
## Set Minter
|
||||||
|
|
||||||
This function sets the authorized minter for an account. Each account can have 0 or 1 authorized minter that can mint NFTokens in its stead.
|
This function sets the authorized minter for an account. Each account can have 0 or 1 authorized minter that can mint NFTs in its stead.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
@@ -201,7 +201,7 @@ Connect to the ledger and get the account.
|
|||||||
Report success
|
Report success
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
results += '\nConnected. Minting NFToken.'
|
results += '\nConnected. Minting NFT.'
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -213,13 +213,13 @@ This transaction blob is the same as the one used for the previous [`mintToken()
|
|||||||
"Account": standby_wallet.classicAddress,
|
"Account": standby_wallet.classicAddress,
|
||||||
```
|
```
|
||||||
|
|
||||||
The URI is a link to a data file represented by the NFToken.
|
The URI is a link to a data file represented by the NFT.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
"URI": xrpl.convertStringToHex(standbyTokenUrlField.value),
|
"URI": xrpl.convertStringToHex(standbyTokenUrlField.value),
|
||||||
```
|
```
|
||||||
|
|
||||||
At a minimum, we recommend that you set the `tfTransferable` flag (8) to enable accounts to sell and resell the NFToken for testing purposes.
|
At a minimum, we recommend that you set the `tfTransferable` flag (8) to enable accounts to sell and resell the NFT for testing purposes.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
"Flags": parseInt(standbyFlagsField.value),
|
"Flags": parseInt(standbyFlagsField.value),
|
||||||
@@ -231,7 +231,7 @@ Transfer fee is a value 0-50000 representing .001% of the price for a resale to
|
|||||||
"TransferFee": parseInt(standbyTransferFeeField.value),
|
"TransferFee": parseInt(standbyTransferFeeField.value),
|
||||||
```
|
```
|
||||||
|
|
||||||
The **Issuer** is the original creator of the object represented by the NFToken.
|
The **Issuer** is the original creator of the object represented by the NFT.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
"Issuer": standbyIssuerField.value,
|
"Issuer": standbyIssuerField.value,
|
||||||
@@ -328,7 +328,7 @@ async function oPmintOther() {
|
|||||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||||
const client = new xrpl.Client(net)
|
const client = new xrpl.Client(net)
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Minting NFToken.'
|
results += '\nConnected. Minting NFT.'
|
||||||
operationalResultField.value = results
|
operationalResultField.value = results
|
||||||
|
|
||||||
// This version adds the "Issuer" field.
|
// This version adds the "Issuer" field.
|
||||||
@@ -489,7 +489,7 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="standbyTokenUrlField"
|
<td><input type="text" id="standbyTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -499,11 +499,11 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
<td><input type="text" id="standbyFlagsField" value="1" size="10"/></td>
|
<td><input type="text" id="standbyFlagsField" value="1" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken Offer Index</td>
|
<td align="right">NFT Offer Index</td>
|
||||||
<td><input type="text" id="standbyTokenOfferIndexField" value="" size="80"/></td>
|
<td><input type="text" id="standbyTokenOfferIndexField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -548,11 +548,11 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBalances()">Get Balances</button>
|
<button type="button" onClick="getBalances()">Get Balances</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="mintToken()">Mint NFToken</button>
|
<button type="button" onClick="mintToken()">Mint NFT</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getTokens()">Get NFTokens</button>
|
<button type="button" onClick="getTokens()">Get NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="burnToken()">Burn NFToken</button>
|
<button type="button" onClick="burnToken()">Burn NFT</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="setMinter('standby')">Set Minter</button>
|
<button type="button" onClick="setMinter('standby')">Set Minter</button>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -594,11 +594,11 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBalances()">Get Balances</button>
|
<button type="button" onClick="getBalances()">Get Balances</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="oPmintToken()">Mint NFToken</button>
|
<button type="button" onClick="oPmintToken()">Mint NFT</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="oPgetTokens()">Get NFTokens</button>
|
<button type="button" onClick="oPgetTokens()">Get NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="oPburnToken()">Burn NFToken</button>
|
<button type="button" onClick="oPburnToken()">Burn NFT</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="oPsetMinter()">Set Minter</button>
|
<button type="button" onClick="oPsetMinter()">Set Minter</button>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -690,7 +690,7 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="operationalTokenUrlField"
|
<td><input type="text" id="operationalTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -700,11 +700,11 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
<td><input type="text" id="operationalFlagsField" value="1" size="10"/></td>
|
<td><input type="text" id="operationalFlagsField" value="1" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="operationalTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="operationalTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken Offer Index</td>
|
<td align="right">NFT Offer Index</td>
|
||||||
<td><input type="text" id="operationalTokenOfferIndexField" value="" size="80"/></td>
|
<td><input type="text" id="operationalTokenOfferIndexField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ labels:
|
|||||||
- XRP
|
- XRP
|
||||||
---
|
---
|
||||||
|
|
||||||
# Batch Mint NFTokens
|
# Batch Mint NFTs
|
||||||
|
|
||||||
You can create an application that mints multiple NFTokens at one time. You can use a `for` loop to send one transaction after another.
|
You can create an application that mints multiple NFTs at one time. You can use a `for` loop to send one transaction after another.
|
||||||
|
|
||||||
A best practice is to use `Tickets` to reserve the transaction sequence numbers. If you create an application that creates NFTokens without using tickets, if any transaction fails for any reason, the application stops with an error. If you use tickets, the application continues to send transactions, and you can look into the reason for the failure afterward.
|
A best practice is to use `Tickets` to reserve the transaction sequence numbers. If you create an application that creates NFTs without using tickets, if any transaction fails for any reason, the application stops with an error. If you use tickets, the application continues to send transactions, and you can look into the reason for the failure afterward.
|
||||||
|
|
||||||
[](img/quickstart33-batch-mint.png)
|
[](img/quickstart33-batch-mint.png)
|
||||||
|
|
||||||
@@ -32,21 +32,21 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
**Note:** Running this command throws an error in the JavaScript console because the `getAccountsFromSeeds` function in `ripplex1-send-xrp.js` looks for the operational seed field, which is not included in this form. You can ignore the error (or fix it in your own implementation).
|
**Note:** Running this command throws an error in the JavaScript console because the `getAccountsFromSeeds` function in `ripplex1-send-xrp.js` looks for the operational seed field, which is not included in this form. You can ignore the error (or fix it in your own implementation).
|
||||||
|
|
||||||
## Batch Mint NFTokens
|
## Batch Mint NFTs
|
||||||
|
|
||||||
This example lets you mint multiple NFTokens for a single unique item. The NFToken might represent "prints" of an original artwork, tickets to an event, or another limited set of unique items.
|
This example lets you mint multiple NFTs for a single unique item. The NFT might represent "prints" of an original artwork, tickets to an event, or another limited set of unique items.
|
||||||
|
|
||||||
To batch mint a non-fungible token objects:
|
To batch mint a non-fungible token objects:
|
||||||
|
|
||||||
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFToken object can be transferred to another account. Otherwise, the NFToken object can only be transferred back to the issuing account. See [NFTokenMint](nftokenmint.html) for information about all of the available flags for minting NFTokens.
|
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT object can be transferred to another account. Otherwise, the NFT object can only be transferred back to the issuing account. See [NFTokenMint](nftokenmint.html) for information about all of the available flags for minting NFTs.
|
||||||
2. Enter the **Token URL**. This is a URI that points to the data or metadata associated with the NFToken object. You can use the sample URI provided if you do not have one of your own.
|
2. Enter the **Token URL**. This is a URI that points to the data or metadata associated with the NFT object. You can use the sample URI provided if you do not have one of your own.
|
||||||
3. Enter a **Token Count** of up to 200 NFTokens to create in one batch.
|
3. Enter a **Token Count** of up to 200 NFTs to create in one batch.
|
||||||
4. Enter the **Transfer Fee**, a percentage of the proceeds that the original creator receives from future sales of the NFToken. This is a value of 0-50000 inclusive, allowing transfer fees between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFToken to be transferrable, set this field to 0.
|
4. Enter the **Transfer Fee**, a percentage of the proceeds that the original creator receives from future sales of the NFT. This is a value of 0-50000 inclusive, allowing transfer fees between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFT to be transferrable, set this field to 0.
|
||||||
5. Click **Batch Mint**.
|
5. Click **Batch Mint**.
|
||||||
|
|
||||||
## Get Batch NFTokens
|
## Get Batch NFTs
|
||||||
|
|
||||||
Click **Get Batch NFTokens** to get the current list of NFTokens for your account.
|
Click **Get Batch NFTs** to get the current list of NFTs for your account.
|
||||||
|
|
||||||
The difference between this function and the `getTokens()` function used earlier is that it allows for larger lists of tokens, and sends multiple requests if the tokens exceed the number of objects allowed in a single request.
|
The difference between this function and the `getTokens()` function used earlier is that it allows for larger lists of tokens, and sends multiple requests if the tokens exceed the number of objects allowed in a single request.
|
||||||
|
|
||||||
@@ -104,16 +104,16 @@ Disconnect from the XRP Ledger.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Get Batch NFTokens
|
## Get Batch NFTs
|
||||||
|
|
||||||
This version of `getTokens()` allows for a larger set of NFTokens by watching for a `marker` at the end of each batch of NFTokens.
|
This version of `getTokens()` allows for a larger set of NFTs by watching for a `marker` at the end of each batch of NFTs.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
// **************** Get Batch Tokens *********************
|
// **************** Get Batch Tokens *********************
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
|
|
||||||
async function getBatchNFTokens() {
|
async function getBatchNFTs() {
|
||||||
```
|
```
|
||||||
|
|
||||||
Connect to the XRP Ledger and get the account.
|
Connect to the XRP Ledger and get the account.
|
||||||
@@ -125,7 +125,7 @@ Connect to the XRP Ledger and get the account.
|
|||||||
results = 'Connecting to ' + net + '...'
|
results = 'Connecting to ' + net + '...'
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Getting NFTokens...'
|
results += '\nConnected. Getting NFTs...'
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ Request the `account_nfts`. Set the `limit` to 400, the maximum amount, to retri
|
|||||||
results += JSON.stringify(nfts,null,2)
|
results += JSON.stringify(nfts,null,2)
|
||||||
```
|
```
|
||||||
|
|
||||||
If the list of `NFTokens` exceeds your limit, the result includes a `marker` field that you can use as a parameter for the next `account_nfts` request. The `marker` indicates where the next batch of records starts. While the `marker` field is present, continue to request another batch of NFToken records.
|
If the list of `NFTs` exceeds your limit, the result includes a `marker` field that you can use as a parameter for the next `account_nfts` request. The `marker` indicates where the next batch of records starts. While the `marker` field is present, continue to request another batch of NFT records.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
while (nfts.result.marker)
|
while (nfts.result.marker)
|
||||||
@@ -171,7 +171,7 @@ Disconnect from the XRP Ledger.
|
|||||||
|
|
||||||
## Batch Mint
|
## Batch Mint
|
||||||
|
|
||||||
This script mints multiple copies of the same NFToken.
|
This script mints multiple copies of the same NFT.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
@@ -210,10 +210,10 @@ Get the account information, particularly the `Sequence` number.
|
|||||||
|
|
||||||
Next, create ticket numbers for the batch. Without tickets, if one transaction fails, all others in the batch fail. With tickets, there can be failures, but the rest can still succeed, and you can investigate any problems afterward.
|
Next, create ticket numbers for the batch. Without tickets, if one transaction fails, all others in the batch fail. With tickets, there can be failures, but the rest can still succeed, and you can investigate any problems afterward.
|
||||||
|
|
||||||
Parse the NFToken Count field value to an integer.
|
Parse the NFT Count field value to an integer.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const nftokenCount = parseInt(standbyNFTokenCountField.value)
|
const nftCount = parseInt(standbyNFTCountField.value)
|
||||||
```
|
```
|
||||||
|
|
||||||
Create the `TicketCreate` transaction hash, automatically filling default values. Provide the `Sequence` number to indicate a starting point for the XRP Ledger.
|
Create the `TicketCreate` transaction hash, automatically filling default values. Provide the `Sequence` number to indicate a starting point for the XRP Ledger.
|
||||||
@@ -222,7 +222,7 @@ Create the `TicketCreate` transaction hash, automatically filling default values
|
|||||||
const ticketTransaction = await client.autofill({
|
const ticketTransaction = await client.autofill({
|
||||||
"TransactionType": "TicketCreate",
|
"TransactionType": "TicketCreate",
|
||||||
"Account": standby_wallet.address,
|
"Account": standby_wallet.address,
|
||||||
"TicketCount": nftokenCount,
|
"TicketCount": nftCount,
|
||||||
"Sequence": my_sequence
|
"Sequence": my_sequence
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
@@ -249,7 +249,7 @@ Populate the `tickets` array variable.
|
|||||||
```javascript
|
```javascript
|
||||||
let tickets = []
|
let tickets = []
|
||||||
|
|
||||||
for (let i=0; i < nftokenCount; i++) {
|
for (let i=0; i < nftCount; i++) {
|
||||||
tickets[i] = response.result.account_objects[i].TicketSequence
|
tickets[i] = response.result.account_objects[i].TicketSequence
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -257,14 +257,14 @@ Populate the `tickets` array variable.
|
|||||||
Report the function progress.
|
Report the function progress.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
results += "Tickets generated, minting NFTokens.\n\n"
|
results += "Tickets generated, minting NFTs.\n\n"
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
```
|
```
|
||||||
|
|
||||||
Use a `for` loop to create the NFTokens one at a time, up to the number you specified.
|
Use a `for` loop to create the NFTs one at a time, up to the number you specified.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
for (let i=0; i < nftokenCount; i++) {
|
for (let i=0; i < nftCount; i++) {
|
||||||
const transactionBlob = {
|
const transactionBlob = {
|
||||||
"TransactionType": "NFTokenMint",
|
"TransactionType": "NFTokenMint",
|
||||||
"Account": standby_wallet.classicAddress,
|
"Account": standby_wallet.classicAddress,
|
||||||
@@ -290,7 +290,7 @@ Submit the signed transaction hash.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Use the same logic as `getBatchNFTokens`, above, to get the list of current NFTokens.
|
Use the same logic as `getBatchNFTs`, above, to get the list of current NFTs.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
results += "\n\nNFTs:\n"
|
results += "\n\nNFTs:\n"
|
||||||
@@ -317,7 +317,7 @@ Report the results.
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
results += '\n\nTransaction result: '+ tx.result.meta.TransactionResult
|
results += '\n\nTransaction result: '+ tx.result.meta.TransactionResult
|
||||||
results += '\n\nnftokens: ' + JSON.stringify(nfts, null, 2)
|
results += '\n\nnfts: ' + JSON.stringify(nfts, null, 2)
|
||||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
```
|
```
|
||||||
@@ -447,7 +447,7 @@ For this form:
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="standbyTokenUrlField"
|
<td><input type="text" id="standbyTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -457,15 +457,15 @@ For this form:
|
|||||||
<td><input type="text" id="standbyFlagsField" value="8" size="10"/></td>
|
<td><input type="text" id="standbyFlagsField" value="8" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
NFToken Count
|
NFT Count
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="standbyNFTokenCountField" size="40"></input>
|
<input type="text" id="standbyNFTCountField" size="40"></input>
|
||||||
<br>
|
<br>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -480,11 +480,11 @@ For this form:
|
|||||||
<td align="left" valign="top">
|
<td align="left" valign="top">
|
||||||
<button type="button" onClick="batchMint()">Batch Mint</button>
|
<button type="button" onClick="batchMint()">Batch Mint</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBatchNFTokens()">Get Batch NFTokens</button>
|
<button type="button" onClick="getBatchNFTs()">Get Batch NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<p align="left">
|
<p align="left">
|
||||||
|
|
||||||
<!-- Note the increased maxlength to hold the most possible NFToken info. -->
|
<!-- Note the increased maxlength to hold the most possible NFT info. -->
|
||||||
|
|
||||||
<textarea id="standbyResultField" cols="80" rows="20" maxlength="524288"></textarea>
|
<textarea id="standbyResultField" cols="80" rows="20" maxlength="524288"></textarea>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ labels:
|
|||||||
- XRP
|
- XRP
|
||||||
---
|
---
|
||||||
|
|
||||||
# Broker a NFToken Sale
|
# Broker an NFT Sale
|
||||||
|
|
||||||
Earlier examples showed how to make buy and sell offers directly between two accounts. Another option is to use a third account as a broker for the sale. The broker acts on behalf of the NFToken owner. The seller creates an offer with the broker account as its destination. The broker gathers and evaluates buy offers and chooses which one to accept, adding an agreed-upon fee for arranging the sale. When the broker account accepts a sell offer with a buy offer, the funds and ownership of the NFToken are transferred simultaneously, completing the deal. This allows an account to act as a marketplace or personal agent for NFToken creators and traders.
|
Earlier examples showed how to make buy and sell offers directly between two accounts. Another option is to use a third account as a broker for the sale. The broker acts on behalf of the NFT owner. The seller creates an offer with the broker account as its destination. The broker gathers and evaluates buy offers and chooses which one to accept, adding an agreed-upon fee for arranging the sale. When the broker account accepts a sell offer with a buy offer, the funds and ownership of the NFT are transferred simultaneously, completing the deal. This allows an account to act as a marketplace or personal agent for NFT creators and traders.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
@@ -42,10 +42,10 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Prepare a Brokered Transaction
|
## Prepare a Brokered Transaction
|
||||||
|
|
||||||
1. Use the Standby account to create a NFToken Sell Offer with the Broker account as the destination.
|
1. Use the Standby account to create an NFT Sell Offer with the Broker account as the destination.
|
||||||
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
||||||
2. Set the **Flags** field to _1_.
|
2. Set the **Flags** field to _1_.
|
||||||
3. Enter the **NFToken ID** of the NFToken you want to sell.
|
3. Enter the **NFT ID** of the NFT you want to sell.
|
||||||
4. Optionally, enter a number of days until **Expiration**.
|
4. Optionally, enter a number of days until **Expiration**.
|
||||||
5. Enter the Broker account number as the **Destination**.
|
5. Enter the Broker account number as the **Destination**.
|
||||||
6. Click **Create Sell Offer**.
|
6. Click **Create Sell Offer**.
|
||||||
@@ -53,9 +53,9 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
[](img/quickstart23.png)
|
[](img/quickstart23.png)
|
||||||
|
|
||||||
2. Use the Operational account to create a NFToken Buy Offer.
|
2. Use the Operational account to create an NFT Buy Offer.
|
||||||
1. Enter the **Amount** of your offer.
|
1. Enter the **Amount** of your offer.
|
||||||
2. Enter the **NFToken ID**.
|
2. Enter the **NFT ID**.
|
||||||
3. Enter the owner’s account string in the **Owner** field.
|
3. Enter the owner’s account string in the **Owner** field.
|
||||||
4. Optionally enter the number of days until **Expiration**.
|
4. Optionally enter the number of days until **Expiration**.
|
||||||
5. Click **Create Buy Offer**.
|
5. Click **Create Buy Offer**.
|
||||||
@@ -64,15 +64,15 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Get Offers
|
## Get Offers
|
||||||
|
|
||||||
1. Enter the **NFToken ID**.
|
1. Enter the **NFT ID**.
|
||||||
2. Click **Get Offers**.
|
2. Click **Get Offers**.
|
||||||
|
|
||||||
[](img/quickstart25.png)
|
[](img/quickstart25.png)
|
||||||
|
|
||||||
## Broker the Sale
|
## Broker the Sale
|
||||||
|
|
||||||
1. Copy the _nft_offer_index_ of the sell offer and paste it in the **Sell NFToken Offer Index** field.
|
1. Copy the _nft_offer_index_ of the sell offer and paste it in the **Sell NFT Offer Index** field.
|
||||||
2. Copy the _nft_offer_index_ of the buy offer and paste it in the **Buy NFToken Offer Index** field.
|
2. Copy the _nft_offer_index_ of the buy offer and paste it in the **Buy NFT Offer Index** field.
|
||||||
3. Enter a **Broker Fee**, in drops.
|
3. Enter a **Broker Fee**, in drops.
|
||||||
4. Click **Broker Sale**.
|
4. Click **Broker Sale**.
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
After accepting a buy offer, a best practice for the broker is to cancel all other offers, if the broker has permissions to do so. Use **Get Offers** to get the full list of buy offers. To cancel an offer:
|
After accepting a buy offer, a best practice for the broker is to cancel all other offers, if the broker has permissions to do so. Use **Get Offers** to get the full list of buy offers. To cancel an offer:
|
||||||
|
|
||||||
1. Enter the _nft_offer_index_ of the buy offer you want to cancel in the **Buy NFToken Offer Index** field.
|
1. Enter the _nft_offer_index_ of the buy offer you want to cancel in the **Buy NFT Offer Index** field.
|
||||||
2. Click **Cancel Offer**.
|
2. Click **Cancel Offer**.
|
||||||
|
|
||||||
[](img/quickstart27.png)
|
[](img/quickstart27.png)
|
||||||
@@ -724,15 +724,15 @@ Revise the HTML form to add a new Broker section at the top.
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="brokerTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="brokerTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">Sell NFToken Offer Index</td>
|
<td align="right">Sell NFT Offer Index</td>
|
||||||
<td><input type="text" id="brokerTokenSellOfferIndexField" value="" size="80"/></td>
|
<td><input type="text" id="brokerTokenSellOfferIndexField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">Buy NFToken Offer Index</td>
|
<td align="right">Buy NFT Offer Index</td>
|
||||||
<td><input type="text" id="brokerTokenBuyOfferIndexField" value="" size="80"/></td>
|
<td><input type="text" id="brokerTokenBuyOfferIndexField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -824,7 +824,7 @@ Revise the HTML form to add a new Broker section at the top.
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="standbyTokenUrlField"
|
<td><input type="text" id="standbyTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -834,11 +834,11 @@ Revise the HTML form to add a new Broker section at the top.
|
|||||||
<td><input type="text" id="standbyFlagsField" value="1" size="10"/></td>
|
<td><input type="text" id="standbyFlagsField" value="1" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken Offer Index</td>
|
<td align="right">NFT Offer Index</td>
|
||||||
<td><input type="text" id="standbyTokenOfferIndexField" value="" size="80"/></td>
|
<td><input type="text" id="standbyTokenOfferIndexField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -875,11 +875,11 @@ Revise the HTML form to add a new Broker section at the top.
|
|||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBalances()">Get Balances</button>
|
<button type="button" onClick="getBalances()">Get Balances</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="mintToken()">Mint NFToken</button>
|
<button type="button" onClick="mintToken()">Mint NFT</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getTokens()">Get NFTokens</button>
|
<button type="button" onClick="getTokens()">Get NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="burnToken()">Burn NFToken</button>
|
<button type="button" onClick="burnToken()">Burn NFT</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="createSellOffer()">Create Sell Offer</button>
|
<button type="button" onClick="createSellOffer()">Create Sell Offer</button>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -917,11 +917,11 @@ Revise the HTML form to add a new Broker section at the top.
|
|||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBalances()">Get Balances</button>
|
<button type="button" onClick="getBalances()">Get Balances</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="oPmintToken()">Mint NFToken</button>
|
<button type="button" onClick="oPmintToken()">Mint NFT</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="oPgetTokens()">Get NFTokens</button>
|
<button type="button" onClick="oPgetTokens()">Get NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="oPburnToken()">Burn NFToken</button>
|
<button type="button" onClick="oPburnToken()">Burn NFT</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="oPcreateSellOffer()">Create Sell Offer</button>
|
<button type="button" onClick="oPcreateSellOffer()">Create Sell Offer</button>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -1009,7 +1009,7 @@ Revise the HTML form to add a new Broker section at the top.
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="operationalTokenUrlField"
|
<td><input type="text" id="operationalTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -1019,11 +1019,11 @@ Revise the HTML form to add a new Broker section at the top.
|
|||||||
<td><input type="text" id="operationalFlagsField" value="1" size="10"/></td>
|
<td><input type="text" id="operationalFlagsField" value="1" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="operationalTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="operationalTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken Offer Index</td>
|
<td align="right">NFT Offer Index</td>
|
||||||
<td><input type="text" id="operationalTokenOfferIndexField" value="" size="80"/></td>
|
<td><input type="text" id="operationalTokenOfferIndexField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
---
|
---
|
||||||
html: mint-and-burn-nftokens.html
|
html: mint-and-burn-nfts.html
|
||||||
parent: quickstart-javascript.html
|
parent: quickstart-javascript.html
|
||||||
blurb: Quickstart step 3, mint and burn NFTokens.
|
blurb: Quickstart step 3, mint and burn NFTs.
|
||||||
labels:
|
labels:
|
||||||
- Quickstart
|
- Quickstart
|
||||||
- Tokens
|
- Tokens
|
||||||
- Non-fungible tokens, NFTs
|
- Non-fungible tokens, NFTs
|
||||||
---
|
---
|
||||||
|
|
||||||
# 3. Mint and Burn NFTokens
|
# 3. Mint and Burn NFTs
|
||||||
|
|
||||||
This example shows how to:
|
This example shows how to:
|
||||||
|
|
||||||
1. Mint new Non-fungible Tokens (NFTokens).
|
1. Mint new Non-fungible Tokens (NFTs).
|
||||||
2. Get a list of existing NFTokens.
|
2. Get a list of existing NFTs.
|
||||||
3. Delete (Burn) a NFToken.
|
3. Delete (Burn) an NFT.
|
||||||
|
|
||||||
[](img/quickstart8.png)
|
[](img/quickstart8.png)
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
@@ -35,34 +35,34 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
[](img/quickstart9.png)
|
[](img/quickstart9.png)
|
||||||
|
|
||||||
## Mint a NFToken
|
## Mint an NFT
|
||||||
|
|
||||||
To mint a non-fungible token object:
|
To mint a non-fungible token object:
|
||||||
|
|
||||||
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFToken object can be transferred to another account. Otherwise, the NFToken object can only be transferred back to the issuing account. See [NFToken Mint](https://xrpl.org/nftokenmint.html#:~:text=Example%20NFTokenMint%20JSON-,NFTokenMint%20Fields,-NFTokenMint%20Flags) for information about all of the available flags for minting NFTokens.
|
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT object can be transferred to another account. Otherwise, the NFT object can only be transferred back to the issuing account. See [NFToken Mint](https://xrpl.org/nftokenmint.html#:~:text=Example%20NFTokenMint%20JSON-,NFTokenMint%20Fields,-NFTokenMint%20Flags) for information about all of the available flags for minting NFTs.
|
||||||
2. Enter the **Token URL**. This is a URI that points to the data or metadata associated with the NFToken object. You can use the sample URI provided if you do not have one of your own.
|
2. Enter the **Token URL**. This is a URI that points to the data or metadata associated with the NFT object. You can use the sample URI provided if you do not have one of your own.
|
||||||
3. Enter the **Transfer Fee**, a percentage of the proceeds from future sales of the NFToken that will be returned to the original creator. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFToken to be transferrable, set this field to 0.
|
3. Enter the **Transfer Fee**, a percentage of the proceeds from future sales of the NFT that will be returned to the original creator. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFT to be transferrable, set this field to 0.
|
||||||
4. Click **Mint NFToken**.
|
4. Click **Mint NFT**.
|
||||||
|
|
||||||
[](img/quickstart10.png)
|
[](img/quickstart10.png)
|
||||||
|
|
||||||
|
|
||||||
## Get Tokens
|
## Get Tokens
|
||||||
|
|
||||||
Click **Get NFTokens** to get a list of NFTokens owned by the account.
|
Click **Get NFTs** to get a list of NFTs owned by the account.
|
||||||
|
|
||||||
[](img/quickstart11.png)
|
[](img/quickstart11.png)
|
||||||
|
|
||||||
## Burn a Token
|
## Burn a Token
|
||||||
|
|
||||||
The current owner of a NFToken can always destroy (or _burn_) a NFToken object.
|
The current owner of an NFT can always destroy (or _burn_) an NFT object.
|
||||||
|
|
||||||
To permanently destroy a NFToken:
|
To permanently destroy an NFT:
|
||||||
|
|
||||||
1. Enter the **Token ID**.
|
1. Enter the **Token ID**.
|
||||||
2. Click **Burn NFToken**.
|
2. Click **Burn NFT**.
|
||||||
|
|
||||||
[](img/quickstart12.png)
|
[](img/quickstart12.png)
|
||||||
|
|
||||||
# Code Walkthrough
|
# Code Walkthrough
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ Connect to the ledger and get the account wallets.
|
|||||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||||
const client = new xrpl.Client(net)
|
const client = new xrpl.Client(net)
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Minting NFToken.'
|
results += '\nConnected. Minting NFT.'
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ Note that the URI field expects a hexadecimal value rather than the literal URI
|
|||||||
"URI": xrpl.convertStringToHex(standbyTokenUrlField.value),
|
"URI": xrpl.convertStringToHex(standbyTokenUrlField.value),
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want the NFToken to be transferable to third parties, set the **Flags** field to _8_.
|
If you want the NFT to be transferable to third parties, set the **Flags** field to _8_.
|
||||||
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
@@ -182,7 +182,7 @@ Connect to the ledger and get the account.
|
|||||||
results = 'Connecting to ' + net + '...'
|
results = 'Connecting to ' + net + '...'
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Getting NFTokens...'
|
results += '\nConnected. Getting NFTs...'
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ Connect to the ledger and get the account wallets.
|
|||||||
results = 'Connecting to ' + net + '...'
|
results = 'Connecting to ' + net + '...'
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Burning NFToken...'
|
results += '\nConnected. Burning NFT...'
|
||||||
standbyResultField.value = results
|
standbyResultField.value = results
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ Submit the transaction and wait for the results.
|
|||||||
const tx = await client.submitAndWait(transactionBlob,{wallet: standby_wallet})
|
const tx = await client.submitAndWait(transactionBlob,{wallet: standby_wallet})
|
||||||
```
|
```
|
||||||
|
|
||||||
Request a list of NFTokens owned by the client.
|
Request a list of NFTs owned by the client.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const nfts = await client.request({
|
const nfts = await client.request({
|
||||||
@@ -289,7 +289,7 @@ async function oPmintToken() {
|
|||||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||||
const client = new xrpl.Client(net)
|
const client = new xrpl.Client(net)
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Minting NFToken.'
|
results += '\nConnected. Minting NFT.'
|
||||||
operationalResultField.value = results
|
operationalResultField.value = results
|
||||||
|
|
||||||
// Note that you must convert the token URL to a hexadecimal
|
// Note that you must convert the token URL to a hexadecimal
|
||||||
@@ -330,7 +330,7 @@ async function oPgetTokens() {
|
|||||||
results = 'Connecting to ' + getNet() + '...'
|
results = 'Connecting to ' + getNet() + '...'
|
||||||
operationalResultField.value = results
|
operationalResultField.value = results
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Getting NFTokens...'
|
results += '\nConnected. Getting NFTs...'
|
||||||
operationalResultField.value = results
|
operationalResultField.value = results
|
||||||
const nfts = await client.request({
|
const nfts = await client.request({
|
||||||
method: "account_nfts",
|
method: "account_nfts",
|
||||||
@@ -352,7 +352,7 @@ async function oPburnToken() {
|
|||||||
results = 'Connecting to ' + getNet() + '...'
|
results = 'Connecting to ' + getNet() + '...'
|
||||||
operationalResultField.value = results
|
operationalResultField.value = results
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Burning NFToken...'
|
results += '\nConnected. Burning NFT...'
|
||||||
operationalResultField.value = results
|
operationalResultField.value = results
|
||||||
|
|
||||||
// ------------------------------------------------------- Prepare transaction
|
// ------------------------------------------------------- Prepare transaction
|
||||||
@@ -515,7 +515,7 @@ async function oPburnToken() {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="standbyTokenUrlField"
|
<td><input type="text" id="standbyTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -525,7 +525,7 @@ async function oPburnToken() {
|
|||||||
<td><input type="text" id="standbyFlagsField" value="1" size="10"/></td>
|
<td><input type="text" id="standbyFlagsField" value="1" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -550,11 +550,11 @@ async function oPburnToken() {
|
|||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBalances()">Get Balances</button>
|
<button type="button" onClick="getBalances()">Get Balances</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="mintToken()">Mint NFToken</button>
|
<button type="button" onClick="mintToken()">Mint NFT</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getTokens()">Get NFTokens</button>
|
<button type="button" onClick="getTokens()">Get NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="burnToken()">Burn NFToken</button>
|
<button type="button" onClick="burnToken()">Burn NFT</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</td>
|
</td>
|
||||||
@@ -580,11 +580,11 @@ async function oPburnToken() {
|
|||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBalances()">Get Balances</button>
|
<button type="button" onClick="getBalances()">Get Balances</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="oPmintToken()">Mint NFToken</button>
|
<button type="button" onClick="oPmintToken()">Mint NFT</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="oPgetTokens()">Get NFTokens</button>
|
<button type="button" onClick="oPgetTokens()">Get NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="oPburnToken()">Burn NFToken</button>
|
<button type="button" onClick="oPburnToken()">Burn NFT</button>
|
||||||
<td valign="top" align="right">
|
<td valign="top" align="right">
|
||||||
<button type="button" onClick="getAccount('operational')">Get New Operational Account</button>
|
<button type="button" onClick="getAccount('operational')">Get New Operational Account</button>
|
||||||
<table>
|
<table>
|
||||||
@@ -668,7 +668,7 @@ async function oPburnToken() {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="operationalTokenUrlField"
|
<td><input type="text" id="operationalTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -678,7 +678,7 @@ async function oPburnToken() {
|
|||||||
<td><input type="text" id="operationalFlagsField" value="1" size="10"/></td>
|
<td><input type="text" id="operationalFlagsField" value="1" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="operationalTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="operationalTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
html: py-authorize-minter.html
|
html: py-authorize-minter.html
|
||||||
parent: quickstart-python.html
|
parent: quickstart-python.html
|
||||||
blurb: Authorize another account to mint NFTokens for you.
|
blurb: Authorize another account to mint NFTs for you.
|
||||||
labels:
|
labels:
|
||||||
- Accounts
|
- Accounts
|
||||||
- Quickstart
|
- Quickstart
|
||||||
@@ -11,12 +11,12 @@ labels:
|
|||||||
|
|
||||||
# Assign an Authorized Minter (Python)
|
# Assign an Authorized Minter (Python)
|
||||||
|
|
||||||
You can assign another account permission to mint NFTokens for you.
|
You can assign another account permission to mint NFTs for you.
|
||||||
|
|
||||||
This example shows how to:
|
This example shows how to:
|
||||||
|
|
||||||
1. Authorize an account to create NFTokens for your account.
|
1. Authorize an account to create NFTs for your account.
|
||||||
2. Mint a NFToken for another account, when authorized.
|
2. Mint an NFT for another account, when authorized.
|
||||||
|
|
||||||
[](img/quickstart-py30.png)
|
[](img/quickstart-py30.png)
|
||||||
|
|
||||||
@@ -41,9 +41,9 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
3. Click **Get Operational Account**.
|
3. Click **Get Operational Account**.
|
||||||
4. Click **Get Operational Account Info**.
|
4. Click **Get Operational Account Info**.
|
||||||
|
|
||||||
## Authorize an Account to Create NFTokens
|
## Authorize an Account to Create NFTs
|
||||||
|
|
||||||
To authorize another account to create NFTokens for your account (for example, allow the operational account to mint NFTs for the standby account):
|
To authorize another account to create NFTs for your account (for example, allow the operational account to mint NFTs for the standby account):
|
||||||
|
|
||||||
1. Copy the **Operational Account** value.
|
1. Copy the **Operational Account** value.
|
||||||
2. Paste the **Operational Account** value in the standby **Authorized Minter** field.
|
2. Paste the **Operational Account** value in the standby **Authorized Minter** field.
|
||||||
@@ -51,7 +51,7 @@ To authorize another account to create NFTokens for your account (for example, a
|
|||||||
|
|
||||||
[](img/quickstart-py31.png)
|
[](img/quickstart-py31.png)
|
||||||
|
|
||||||
## Mint a NFToken for Another Account
|
## Mint an NFT for Another Account
|
||||||
|
|
||||||
This example uses the Operational account, which was authorized in the previous step, to mint a token on behalf of the Standby account.
|
This example uses the Operational account, which was authorized in the previous step, to mint a token on behalf of the Standby account.
|
||||||
|
|
||||||
@@ -59,40 +59,40 @@ To mint a non-fungible token for another account:
|
|||||||
|
|
||||||
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_.
|
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_.
|
||||||
2. Enter the **NFT URI**. This is a URI that points to the data or metadata associated with the NFT. You can use the sample URI provided if you do not have one of your own.
|
2. Enter the **NFT URI**. This is a URI that points to the data or metadata associated with the NFT. You can use the sample URI provided if you do not have one of your own.
|
||||||
3. Enter the **Transfer Fee**, a percentage of the proceeds that the original creator receives from future sales of the NFToken. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFToken to be transferrable, set this field to 0.
|
3. Enter the **Transfer Fee**, a percentage of the proceeds that the original creator receives from future sales of the NFT. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFT to be transferrable, set this field to 0.
|
||||||
4. Enter a **Taxon** for the NFT. If you don't have a use for the field, set it to _0_.
|
4. Enter a **Taxon** for the NFT. If you don't have a use for the field, set it to _0_.
|
||||||
4. Copy the **Standby Account** value.
|
4. Copy the **Standby Account** value.
|
||||||
5. Paste the **Standby Account** value in the Operational account **Issuer** field.
|
5. Paste the **Standby Account** value in the Operational account **Issuer** field.
|
||||||
6. Click the Operational account **Mint Other** button.
|
6. Click the Operational account **Mint Other** button.
|
||||||
|
|
||||||
[](img/quickstart-py32.png)
|
[](img/quickstart-py32.png)
|
||||||
|
|
||||||
Once the item is minted, the authorized minter can sell the NFToken normally. The proceeds go to the authorized minter, less the transfer fee. The minter and the issuer can settle up on a division of the price separately.
|
Once the item is minted, the authorized minter can sell the NFT normally. The proceeds go to the authorized minter, less the transfer fee. The minter and the issuer can settle up on a division of the price separately.
|
||||||
|
|
||||||
## Create a Sell Offer
|
## Create a Sell Offer
|
||||||
|
|
||||||
To create a NFToken sell offer:
|
To create a NFT sell offer:
|
||||||
|
|
||||||
1. On the Operational account side, enter the **Amount** of the sell offer in drops (millionths of an XRP), for example 100000000 (100 XRP).
|
1. On the Operational account side, enter the **Amount** of the sell offer in drops (millionths of an XRP), for example 100000000 (100 XRP).
|
||||||
2. Set the **Flags** field to _1_.
|
2. Set the **Flags** field to _1_.
|
||||||
3. Enter the **NFToken ID** of the minted NFToken you want to sell.
|
3. Enter the **NFT ID** of the minted NFT you want to sell.
|
||||||
4. Optionally, enter a number of seconds until **Expiration**.
|
4. Optionally, enter a number of seconds until **Expiration**.
|
||||||
5. Click **Create Sell Offer**.
|
5. Click **Create Sell Offer**.
|
||||||
|
|
||||||
The important piece of information in the response is the NFToken Offer Index, labeled as `nft_offer_index`, which is used to accept the sell offer.
|
The important piece of information in the response is the NFT Offer Index, labeled as `nft_offer_index`, which is used to accept the sell offer.
|
||||||
|
|
||||||
[](img/quickstart-py33.png)
|
[](img/quickstart-py33.png)
|
||||||
|
|
||||||
## Accept Sell Offer
|
## Accept Sell Offer
|
||||||
|
|
||||||
Once a sell offer is available, you can create a new account to accept the offer and buy the NFToken.
|
Once a sell offer is available, you can create a new account to accept the offer and buy the NFT.
|
||||||
|
|
||||||
To accept an available sell offer:
|
To accept an available sell offer:
|
||||||
|
|
||||||
1. Clear the **Standby Seed** field.
|
1. Clear the **Standby Seed** field.
|
||||||
2. Click **Get Standby Account**.
|
2. Click **Get Standby Account**.
|
||||||
3. Click **Get Standby Account Info**.
|
3. Click **Get Standby Account Info**.
|
||||||
4. Enter the **NFToken Offer Index** (labeled as `nft_offer_index` in the NFToken offer results. This is different from the `nft_id`).
|
4. Enter the **NFT Offer Index** (labeled as `nft_offer_index` in the NFT offer results. This is different from the `nft_id`).
|
||||||
5. Click **Accept Sell Offer**.
|
5. Click **Accept Sell Offer**.
|
||||||
|
|
||||||
[](img/quickstart-py34.png)
|
[](img/quickstart-py34.png)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ labels:
|
|||||||
|
|
||||||
# Broker an NFT Sale (Python)
|
# Broker an NFT Sale (Python)
|
||||||
|
|
||||||
Earlier examples showed how to make buy and sell offers directly between two accounts. Another option is to use a third account as a broker for the sale. The broker acts on behalf of the NFT owner. The seller creates an offer with the broker account as its destination. The broker gathers and evaluates buy offers and chooses which one to accept, adding an agreed-upon fee for arranging the sale. When the broker account accepts a sell offer with a buy offer, the funds and ownership of the NFToken are transferred simultaneously, completing the deal. This allows an account to act as a marketplace or personal agent for NFToken creators and traders.
|
Earlier examples showed how to make buy and sell offers directly between two accounts. Another option is to use a third account as a broker for the sale. The broker acts on behalf of the NFT owner. The seller creates an offer with the broker account as its destination. The broker gathers and evaluates buy offers and chooses which one to accept, adding an agreed-upon fee for arranging the sale. When the broker account accepts a sell offer with a buy offer, the funds and ownership of the NFT are transferred simultaneously, completing the deal. This allows an account to act as a marketplace or personal agent for NFT creators and traders.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
@@ -48,9 +48,9 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Prepare a Brokered Transaction
|
## Prepare a Brokered Transaction
|
||||||
|
|
||||||
1. Use the Standby account to create a NFToken Sell Offer with the Broker account as the destination.
|
1. Use the Standby account to create an NFT Sell Offer with the Broker account as the destination.
|
||||||
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
||||||
2. Enter the **NFToken ID** of the NFToken you want to sell.
|
2. Enter the **NFT ID** of the NFT you want to sell.
|
||||||
3. Optionally, enter a number of seconds until **Expiration**.
|
3. Optionally, enter a number of seconds until **Expiration**.
|
||||||
4. Enter the Broker account number as the **Destination**.
|
4. Enter the Broker account number as the **Destination**.
|
||||||
5. Click **Create Sell Offer**.
|
5. Click **Create Sell Offer**.
|
||||||
@@ -59,9 +59,9 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
[](img/quickstart25.png)
|
[](img/quickstart25.png)
|
||||||
|
|
||||||
2. Use the Operational account to create a NFToken Buy Offer.
|
2. Use the Operational account to create a NFT Buy Offer.
|
||||||
1. Enter the **Amount** of your offer.
|
1. Enter the **Amount** of your offer.
|
||||||
2. Enter the **NFToken ID**.
|
2. Enter the **NFT ID**.
|
||||||
3. Enter the owner’s account string in the **Owner** field.
|
3. Enter the owner’s account string in the **Owner** field.
|
||||||
4. Optionally enter the number of seconds until **Expiration**.
|
4. Optionally enter the number of seconds until **Expiration**.
|
||||||
5. Click **Create Buy Offer**.
|
5. Click **Create Buy Offer**.
|
||||||
@@ -70,15 +70,15 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Get Offers
|
## Get Offers
|
||||||
|
|
||||||
1. Enter the **NFToken ID**.
|
1. Enter the **NFT ID**.
|
||||||
2. Click **Get Offers**.
|
2. Click **Get Offers**.
|
||||||
|
|
||||||
[](img/quickstart27.png)
|
[](img/quickstart27.png)
|
||||||
|
|
||||||
## Broker the Sale
|
## Broker the Sale
|
||||||
|
|
||||||
1. Copy the _nft_offer_index_ of the sell offer and paste it in the **Sell NFToken Offer Index** field.
|
1. Copy the _nft_offer_index_ of the sell offer and paste it in the **Sell NFT Offer Index** field.
|
||||||
2. Copy the _nft_offer_index_ of the buy offer and paste it in the **Buy NFToken Offer Index** field.
|
2. Copy the _nft_offer_index_ of the buy offer and paste it in the **Buy NFT Offer Index** field.
|
||||||
3. Enter a **Broker Fee**, in drops.
|
3. Enter a **Broker Fee**, in drops.
|
||||||
4. Click **Broker Sale**.
|
4. Click **Broker Sale**.
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
After accepting a buy offer, a best practice for the broker is to cancel all other offers, if the broker has permissions to do so. Use **Get Offers** to get the full list of buy offers. To cancel an offer:
|
After accepting a buy offer, a best practice for the broker is to cancel all other offers, if the broker has permissions to do so. Use **Get Offers** to get the full list of buy offers. To cancel an offer:
|
||||||
|
|
||||||
1. Enter the _nft_offer_index_ of the buy offer you want to cancel in the **Buy NFToken Offer Index** field.
|
1. Enter the _nft_offer_index_ of the buy offer you want to cancel in the **Buy NFT Offer Index** field.
|
||||||
2. Click **Cancel Offer**.
|
2. Click **Cancel Offer**.
|
||||||
|
|
||||||
[](img/quickstart29.png)
|
[](img/quickstart29.png)
|
||||||
@@ -499,11 +499,11 @@ lbl_broker_balance = tk.Label(master=frm_broker, text="XRP Balance")
|
|||||||
ent_broker_balance = tk.Entry(master=frm_broker, width=50)
|
ent_broker_balance = tk.Entry(master=frm_broker, width=50)
|
||||||
lbl_broker_amount = tk.Label(master=frm_broker, text="Amount")
|
lbl_broker_amount = tk.Label(master=frm_broker, text="Amount")
|
||||||
ent_broker_amount = tk.Entry(master=frm_broker, width=50)
|
ent_broker_amount = tk.Entry(master=frm_broker, width=50)
|
||||||
lbl_broker_nft_id = tk.Label(master=frm_broker, text="NFToken ID")
|
lbl_broker_nft_id = tk.Label(master=frm_broker, text="NFT ID")
|
||||||
ent_broker_nft_id = tk.Entry(master=frm_broker, width=50)
|
ent_broker_nft_id = tk.Entry(master=frm_broker, width=50)
|
||||||
lbl_broker_sell_nft_idx = tk.Label(master=frm_broker, text="Sell NFToken Offer Index")
|
lbl_broker_sell_nft_idx = tk.Label(master=frm_broker, text="Sell NFT Offer Index")
|
||||||
ent_broker_sell_nft_idx = tk.Entry(master=frm_broker, width=50)
|
ent_broker_sell_nft_idx = tk.Entry(master=frm_broker, width=50)
|
||||||
lbl_broker_buy_nft_idx = tk.Label(master=frm_broker, text="Buy NFToken Offer Index")
|
lbl_broker_buy_nft_idx = tk.Label(master=frm_broker, text="Buy NFT Offer Index")
|
||||||
ent_broker_buy_nft_idx = tk.Entry(master=frm_broker, width=50)
|
ent_broker_buy_nft_idx = tk.Entry(master=frm_broker, width=50)
|
||||||
lbl_broker_owner = tk.Label(master=frm_broker, text="Owner")
|
lbl_broker_owner = tk.Label(master=frm_broker, text="Owner")
|
||||||
ent_broker_owner = tk.Entry(master=frm_broker, width=50)
|
ent_broker_owner = tk.Entry(master=frm_broker, width=50)
|
||||||
@@ -583,9 +583,9 @@ lbl_standby_transfer_fee = tk.Label(master=frm_form, text="Transfer Fee")
|
|||||||
ent_standby_transfer_fee = tk.Entry(master=frm_form, width="50")
|
ent_standby_transfer_fee = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_taxon = tk.Label(master=frm_form, text="Taxon")
|
lbl_standby_taxon = tk.Label(master=frm_form, text="Taxon")
|
||||||
ent_standby_taxon = tk.Entry(master=frm_form, width="50")
|
ent_standby_taxon = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_nft_id = tk.Label(master=frm_form, text="NFToken ID")
|
lbl_standby_nft_id = tk.Label(master=frm_form, text="NFT ID")
|
||||||
ent_standby_nft_id = tk.Entry(master=frm_form, width="50")
|
ent_standby_nft_id = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_nft_offer_index = tk.Label(master=frm_form, text="NFToken Offer Index")
|
lbl_standby_nft_offer_index = tk.Label(master=frm_form, text="NFT Offer Index")
|
||||||
ent_standby_nft_offer_index = tk.Entry(master=frm_form, width="50")
|
ent_standby_nft_offer_index = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_owner = tk.Label(master=frm_form, text="Owner")
|
lbl_standby_owner = tk.Label(master=frm_form, text="Owner")
|
||||||
ent_standby_owner = tk.Entry(master=frm_form, width="50")
|
ent_standby_owner = tk.Entry(master=frm_form, width="50")
|
||||||
@@ -657,9 +657,9 @@ lbl_operational_transfer_fee = tk.Label(master=frm_form, text="Transfer Fee")
|
|||||||
ent_operational_transfer_fee = tk.Entry(master=frm_form, width="50")
|
ent_operational_transfer_fee = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_taxon = tk.Label(master=frm_form, text="Taxon")
|
lbl_operational_taxon = tk.Label(master=frm_form, text="Taxon")
|
||||||
ent_operational_taxon = tk.Entry(master=frm_form, width="50")
|
ent_operational_taxon = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_nft_id = tk.Label(master=frm_form, text="NFToken ID")
|
lbl_operational_nft_id = tk.Label(master=frm_form, text="NFT ID")
|
||||||
ent_operational_nft_id = tk.Entry(master=frm_form, width="50")
|
ent_operational_nft_id = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_nft_offer_index = tk.Label(master=frm_form, text="NFToken Offer Index")
|
lbl_operational_nft_offer_index = tk.Label(master=frm_form, text="NFT Offer Index")
|
||||||
ent_operational_nft_offer_index = tk.Entry(master=frm_form, width="50")
|
ent_operational_nft_offer_index = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_owner = tk.Label(master=frm_form, text="Owner")
|
lbl_operational_owner = tk.Label(master=frm_form, text="Owner")
|
||||||
ent_operational_owner = tk.Entry(master=frm_form, width="50")
|
ent_operational_owner = tk.Entry(master=frm_form, width="50")
|
||||||
@@ -734,13 +734,13 @@ btn_standby_configure_account = tk.Button(master=frm_form,
|
|||||||
text="Configure Account",
|
text="Configure Account",
|
||||||
command = standby_configure_account)
|
command = standby_configure_account)
|
||||||
btn_standby_configure_account.grid(row=7,column=0, sticky = "nsew")
|
btn_standby_configure_account.grid(row=7,column=0, sticky = "nsew")
|
||||||
btn_standby_mint_token = tk.Button(master=frm_form, text="Mint NFToken",
|
btn_standby_mint_token = tk.Button(master=frm_form, text="Mint NFT",
|
||||||
command = standby_mint_token)
|
command = standby_mint_token)
|
||||||
btn_standby_mint_token.grid(row=8, column=2, sticky="nsew")
|
btn_standby_mint_token.grid(row=8, column=2, sticky="nsew")
|
||||||
btn_standby_get_tokens = tk.Button(master=frm_form, text="Get NFTokens",
|
btn_standby_get_tokens = tk.Button(master=frm_form, text="Get NFTs",
|
||||||
command = standby_get_tokens)
|
command = standby_get_tokens)
|
||||||
btn_standby_get_tokens.grid(row=9, column=2, sticky="nsew")
|
btn_standby_get_tokens.grid(row=9, column=2, sticky="nsew")
|
||||||
btn_standby_burn_token = tk.Button(master=frm_form, text="Burn NFToken",
|
btn_standby_burn_token = tk.Button(master=frm_form, text="Burn NFT",
|
||||||
command = standby_burn_token)
|
command = standby_burn_token)
|
||||||
btn_standby_burn_token.grid(row=10, column=2, sticky="nsew")
|
btn_standby_burn_token.grid(row=10, column=2, sticky="nsew")
|
||||||
btn_standby_create_sell_offer = tk.Button(master=frm_form, text="Create Sell Offer",
|
btn_standby_create_sell_offer = tk.Button(master=frm_form, text="Create Sell Offer",
|
||||||
@@ -787,13 +787,13 @@ btn_op_get_balances.grid(row=6, column=3, sticky = "nsew")
|
|||||||
btn_op_configure_account = tk.Button(master=frm_form, text="Configure Account",
|
btn_op_configure_account = tk.Button(master=frm_form, text="Configure Account",
|
||||||
command = operational_configure_account)
|
command = operational_configure_account)
|
||||||
btn_op_configure_account.grid(row=7,column=4, sticky = "nsew")
|
btn_op_configure_account.grid(row=7,column=4, sticky = "nsew")
|
||||||
btn_op_mint_token = tk.Button(master=frm_form, text="Mint NFToken",
|
btn_op_mint_token = tk.Button(master=frm_form, text="Mint NFT",
|
||||||
command = operational_mint_token)
|
command = operational_mint_token)
|
||||||
btn_op_mint_token.grid(row=8, column=3, sticky="nsew")
|
btn_op_mint_token.grid(row=8, column=3, sticky="nsew")
|
||||||
btn_op_get_tokens = tk.Button(master=frm_form, text="Get NFTokens",
|
btn_op_get_tokens = tk.Button(master=frm_form, text="Get NFTs",
|
||||||
command = operational_get_tokens)
|
command = operational_get_tokens)
|
||||||
btn_op_get_tokens.grid(row=9, column=3, sticky="nsew")
|
btn_op_get_tokens.grid(row=9, column=3, sticky="nsew")
|
||||||
btn_op_burn_token = tk.Button(master=frm_form, text="Burn NFToken",
|
btn_op_burn_token = tk.Button(master=frm_form, text="Burn NFT",
|
||||||
command = operational_burn_token)
|
command = operational_burn_token)
|
||||||
btn_op_burn_token.grid(row=10, column=3, sticky="nsew")
|
btn_op_burn_token.grid(row=10, column=3, sticky="nsew")
|
||||||
btn_op_create_sell_offer = tk.Button(master=frm_form, text="Create Sell Offer",
|
btn_op_create_sell_offer = tk.Button(master=frm_form, text="Create Sell Offer",
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
---
|
---
|
||||||
html: py-mint-and-burn-nftokens.html
|
html: py-mint-and-burn-nftokens.html
|
||||||
parent: quickstart-python.html
|
parent: quickstart-python.html
|
||||||
blurb: Quickstart step 3, mint and burn NFTokens.
|
blurb: Quickstart step 3, mint and burn NFTs.
|
||||||
labels:
|
labels:
|
||||||
- Quickstart
|
- Quickstart
|
||||||
- Tokens
|
- Tokens
|
||||||
- Non-fungible tokens, NFTs
|
- Non-fungible tokens, NFTs
|
||||||
---
|
---
|
||||||
|
|
||||||
# 3. Mint and Burn NFTokens (Python)
|
# 3. Mint and Burn NFTs (Python)
|
||||||
|
|
||||||
This example shows how to:
|
This example shows how to:
|
||||||
|
|
||||||
@@ -42,20 +42,20 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
To mint a non-fungible token object:
|
To mint a non-fungible token object:
|
||||||
|
|
||||||
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT can be transferred to another account. Otherwise, the NFT can only be transferred back to the issuing account. See [NFToken Mint](https://xrpl.org/nftokenmint.html#:~:text=Example%20NFTokenMint%20JSON-,NFTokenMint%20Fields,-NFTokenMint%20Flags) for information about all of the available flags for minting NFTokens.
|
1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT can be transferred to another account. Otherwise, the NFT can only be transferred back to the issuing account. See [NFToken Mint](https://xrpl.org/nftokenmint.html#:~:text=Example%20NFTokenMint%20JSON-,NFTokenMint%20Fields,-NFTokenMint%20Flags) for information about all of the available flags for minting NFTs.
|
||||||
2. Enter the **NFT URI**. This is a URI that points to the data or metadata associated with the NFT. You can use the sample URI provided if you do not have one of your own.
|
2. Enter the **NFT URI**. This is a URI that points to the data or metadata associated with the NFT. You can use the sample URI provided if you do not have one of your own.
|
||||||
3. Enter the **Transfer Fee**, a percentage of the proceeds from future sales of the NFToken that will be returned to the original creator. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFToken to be transferrable, set this field to 0.
|
3. Enter the **Transfer Fee**, a percentage of the proceeds from future sales of the NFT that will be returned to the original creator. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFT to be transferrable, set this field to 0.
|
||||||
4. Optionally a **Taxon** value as an integer. If you choose not to use a taxon, enter _0_.
|
4. Optionally a **Taxon** value as an integer. If you choose not to use a taxon, enter _0_.
|
||||||
4. Click **Mint NFToken**.
|
4. Click **Mint NFT**.
|
||||||
|
|
||||||
[](img/quickstart-py12.png)
|
[](img/quickstart-py12.png)
|
||||||
|
|
||||||
|
|
||||||
## Get Tokens
|
## Get Tokens
|
||||||
|
|
||||||
Click **Get NFTokens** to get a list of NFTokens owned by the account.
|
Click **Get NFTs** to get a list of NFTs owned by the account.
|
||||||
|
|
||||||
[](img/quickstart-py13.png)
|
[](img/quickstart-py13.png)
|
||||||
|
|
||||||
## Burn a Token
|
## Burn a Token
|
||||||
|
|
||||||
@@ -64,9 +64,9 @@ The current owner of an NFT can always destroy (or _burn_) an NFT.
|
|||||||
To permanently destroy an NFT:
|
To permanently destroy an NFT:
|
||||||
|
|
||||||
1. Enter the **Token ID**.
|
1. Enter the **Token ID**.
|
||||||
2. Click **Burn NFToken**.
|
2. Click **Burn NFT**.
|
||||||
|
|
||||||
[](img/quickstart-py14.png)
|
[](img/quickstart-py14.png)
|
||||||
|
|
||||||
# Code Walkthrough
|
# Code Walkthrough
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ ent_standby_currency = tk.Entry(master=frm_form, width=50)
|
|||||||
cb_standby_allow_rippling = tk.Checkbutton(master=frm_form, text="Allow Rippling", variable=standbyRippling, onvalue=True, offvalue=False)
|
cb_standby_allow_rippling = tk.Checkbutton(master=frm_form, text="Allow Rippling", variable=standbyRippling, onvalue=True, offvalue=False)
|
||||||
```
|
```
|
||||||
|
|
||||||
Add **NFT URI**, **Flags**, **Transfer Fee**, **Taxon**, **NFToken ID** fields.
|
Add **NFT URI**, **Flags**, **Transfer Fee**, **Taxon**, **NFT ID** fields.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
lbl_standby_uri = tk.Label(master=frm_form, text="NFT URI")
|
lbl_standby_uri = tk.Label(master=frm_form, text="NFT URI")
|
||||||
@@ -413,7 +413,7 @@ lbl_standby_transfer_fee = tk.Label(master=frm_form, text="Transfer Fee")
|
|||||||
ent_standby_transfer_fee = tk.Entry(master=frm_form, width="50")
|
ent_standby_transfer_fee = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_taxon = tk.Label(master=frm_form, text="Taxon")
|
lbl_standby_taxon = tk.Label(master=frm_form, text="Taxon")
|
||||||
ent_standby_taxon = tk.Entry(master=frm_form, width="50")
|
ent_standby_taxon = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_nft_id = tk.Label(master=frm_form, text="NFToken ID")
|
lbl_standby_nft_id = tk.Label(master=frm_form, text="NFT ID")
|
||||||
ent_standby_nft_id = tk.Entry(master=frm_form, width="50")
|
ent_standby_nft_id = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_results = tk.Label(master=frm_form,text='Results')
|
lbl_standby_results = tk.Label(master=frm_form,text='Results')
|
||||||
text_standby_results = tk.Text(master=frm_form, height = 20, width = 65)
|
text_standby_results = tk.Text(master=frm_form, height = 20, width = 65)
|
||||||
@@ -471,7 +471,7 @@ ent_operational_currency = tk.Entry(master=frm_form, width=50)
|
|||||||
cb_operational_allow_rippling = tk.Checkbutton(master=frm_form, text="Allow Rippling", variable=operationalRippling, onvalue=True, offvalue=False)
|
cb_operational_allow_rippling = tk.Checkbutton(master=frm_form, text="Allow Rippling", variable=operationalRippling, onvalue=True, offvalue=False)
|
||||||
```
|
```
|
||||||
|
|
||||||
Add fields for **NFT URI**, **Flags**, **Transfer Fee**, **Taxon**, and **NFToken ID**.
|
Add fields for **NFT URI**, **Flags**, **Transfer Fee**, **Taxon**, and **NFT ID**.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
lbl_operational_uri = tk.Label(master=frm_form, text="NFT URI")
|
lbl_operational_uri = tk.Label(master=frm_form, text="NFT URI")
|
||||||
@@ -482,7 +482,7 @@ lbl_operational_transfer_fee = tk.Label(master=frm_form, text="Transfer Fee")
|
|||||||
ent_operational_transfer_fee = tk.Entry(master=frm_form, width="50")
|
ent_operational_transfer_fee = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_taxon = tk.Label(master=frm_form, text="Taxon")
|
lbl_operational_taxon = tk.Label(master=frm_form, text="Taxon")
|
||||||
ent_operational_taxon = tk.Entry(master=frm_form, width="50")
|
ent_operational_taxon = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_nft_id = tk.Label(master=frm_form, text="NFToken ID")
|
lbl_operational_nft_id = tk.Label(master=frm_form, text="NFT ID")
|
||||||
ent_operational_nft_id = tk.Entry(master=frm_form, width="50")
|
ent_operational_nft_id = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_results = tk.Label(master=frm_form,text='Results')
|
lbl_operational_results = tk.Label(master=frm_form,text='Results')
|
||||||
text_operational_results = tk.Text(master=frm_form, height = 20, width = 65)
|
text_operational_results = tk.Text(master=frm_form, height = 20, width = 65)
|
||||||
@@ -551,16 +551,16 @@ btn_standby_configure_account = tk.Button(master=frm_form,
|
|||||||
command = standby_configure_account)
|
command = standby_configure_account)
|
||||||
```
|
```
|
||||||
|
|
||||||
Add buttons for **Mint NFToken**, **Get NFTokens**, and **Burn NFToken**.
|
Add buttons for **Mint NFT**, **Get NFTs**, and **Burn NFT**.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
btn_standby_mint_token = tk.Button(master=frm_form, text="Mint NFToken",
|
btn_standby_mint_token = tk.Button(master=frm_form, text="Mint NFT",
|
||||||
command = standby_mint_token)
|
command = standby_mint_token)
|
||||||
btn_standby_mint_token.grid(row=8, column=2, sticky="nsew")
|
btn_standby_mint_token.grid(row=8, column=2, sticky="nsew")
|
||||||
btn_standby_get_tokens = tk.Button(master=frm_form, text="Get NFTokens",
|
btn_standby_get_tokens = tk.Button(master=frm_form, text="Get NFTs",
|
||||||
command = standby_get_tokens)
|
command = standby_get_tokens)
|
||||||
btn_standby_get_tokens.grid(row=9, column=2, sticky="nsew")
|
btn_standby_get_tokens.grid(row=9, column=2, sticky="nsew")
|
||||||
btn_standby_burn_token = tk.Button(master=frm_form, text="Burn NFToken",
|
btn_standby_burn_token = tk.Button(master=frm_form, text="Burn NFT",
|
||||||
command = standby_burn_token)
|
command = standby_burn_token)
|
||||||
btn_standby_burn_token.grid(row=10, column=2, sticky="nsew")
|
btn_standby_burn_token.grid(row=10, column=2, sticky="nsew")
|
||||||
|
|
||||||
@@ -589,16 +589,16 @@ btn_op_configure_account = tk.Button(master=frm_form, text="Configure Account",
|
|||||||
command = operational_configure_account)
|
command = operational_configure_account)
|
||||||
btn_op_configure_account.grid(row=7,column=4, sticky = "nsew")
|
btn_op_configure_account.grid(row=7,column=4, sticky = "nsew")
|
||||||
```
|
```
|
||||||
Add buttons for **Mint NFToken**, **Get NFTokens**, and **Burn NFToken**.
|
Add buttons for **Mint NFT**, **Get NFTs**, and **Burn NFT**.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
btn_op_mint_token = tk.Button(master=frm_form, text="Mint NFToken",
|
btn_op_mint_token = tk.Button(master=frm_form, text="Mint NFT",
|
||||||
command = operational_mint_token)
|
command = operational_mint_token)
|
||||||
btn_op_mint_token.grid(row=8, column=3, sticky="nsew")
|
btn_op_mint_token.grid(row=8, column=3, sticky="nsew")
|
||||||
btn_op_get_tokens = tk.Button(master=frm_form, text="Get NFTokens",
|
btn_op_get_tokens = tk.Button(master=frm_form, text="Get NFTs",
|
||||||
command = operational_get_tokens)
|
command = operational_get_tokens)
|
||||||
btn_op_get_tokens.grid(row=9, column=3, sticky="nsew")
|
btn_op_get_tokens.grid(row=9, column=3, sticky="nsew")
|
||||||
btn_op_burn_token = tk.Button(master=frm_form, text="Burn NFToken",
|
btn_op_burn_token = tk.Button(master=frm_form, text="Burn NFT",
|
||||||
command = operational_burn_token)
|
command = operational_burn_token)
|
||||||
btn_op_burn_token.grid(row=10, column=3, sticky="nsew")
|
btn_op_burn_token.grid(row=10, column=3, sticky="nsew")
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
html: py-quickstart-intro.html
|
html: py-quickstart-intro.html
|
||||||
parent: quickstart-python.html
|
parent: quickstart-python.html
|
||||||
blurb: Use a Python test harness to send XRP, trade currencies, and mint and trade NFTokens.
|
blurb: Use a Python test harness to send XRP, trade currencies, and mint and trade NFTs.
|
||||||
labels:
|
labels:
|
||||||
- Accounts
|
- Accounts
|
||||||
- Cross-Currency
|
- Cross-Currency
|
||||||
@@ -38,10 +38,10 @@ In this quickstart, you can:
|
|||||||
|
|
||||||
1. [Create Accounts and Send XRP](py-create-accounts-send-xrp.html)
|
1. [Create Accounts and Send XRP](py-create-accounts-send-xrp.html)
|
||||||
2. [Create Trust Line and Send Currency](py-create-trustline-send-currency.html).
|
2. [Create Trust Line and Send Currency](py-create-trustline-send-currency.html).
|
||||||
3. [Mint and Burn NFTokens](py-mint-and-burn-nftokens.html).
|
3. [Mint and Burn NFTs](py-mint-and-burn-nfts.html).
|
||||||
4. [Transfer NFTokens](py-transfer-nftokens.html).
|
4. [Transfer NFTs](py-transfer-nfts.html).
|
||||||
|
|
||||||
There are also expanded lessons demonstrating how to [Broker a NFToken Sale](py-broker-sale.html) and [Assign an Authorized Minter](py-authorize-minter.html).
|
There are also expanded lessons demonstrating how to [Broker an NFT Sale](py-broker-sale.html) and [Assign an Authorized Minter](py-authorize-minter.html).
|
||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
html: py-transfer-nftokens.html
|
html: py-transfer-nfts.html
|
||||||
parent: quickstart-python.html
|
parent: quickstart-python.html
|
||||||
blurb: Use a Python test harness to create and accept NFT buy and sell offers.
|
blurb: Use a Python test harness to create and accept NFT buy and sell offers.
|
||||||
labels:
|
labels:
|
||||||
@@ -8,18 +8,18 @@ labels:
|
|||||||
- Non-fungible Tokens, NFTs
|
- Non-fungible Tokens, NFTs
|
||||||
---
|
---
|
||||||
|
|
||||||
# 4. Transfer NFTokens (Python)
|
# 4. Transfer NFTs (Python)
|
||||||
|
|
||||||
This example shows how to:
|
This example shows how to:
|
||||||
|
|
||||||
1. Create NFToken Sell Offers.
|
1. Create NFT Sell Offers.
|
||||||
2. Create NFToken Buy Offers.
|
2. Create NFT Buy Offers.
|
||||||
3. Accept NFToken Sell Offers.
|
3. Accept NFT Sell Offers.
|
||||||
4. Accept NFToken Buy Offers.
|
4. Accept NFT Buy Offers.
|
||||||
5. Get a list of offers for a particular NFToken.
|
5. Get a list of offers for a particular NFT.
|
||||||
6. Cancel an offer.
|
6. Cancel an offer.
|
||||||
|
|
||||||
[](img/quickstart-py15.png)
|
[](img/quickstart-py15.png)
|
||||||
|
|
||||||
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/quickstart.zip){.github-code-download} archive to try each of the samples in your own browser.
|
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/quickstart.zip){.github-code-download} archive to try each of the samples in your own browser.
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Get Accounts
|
## Get Accounts
|
||||||
|
|
||||||
1. Open `4.transfer-nftokens.html` in a browser.
|
1. Open `4.transfer-nfts.html` in a browser.
|
||||||
2. Choose your ledger instance (**Testnet** or **Devnet**).
|
2. Choose your ledger instance (**Testnet** or **Devnet**).
|
||||||
3. Get test accounts.
|
3. Get test accounts.
|
||||||
1. If you have existing test account seeds
|
1. If you have existing test account seeds
|
||||||
@@ -47,29 +47,29 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Create a Sell Offer
|
## Create a Sell Offer
|
||||||
|
|
||||||
To create a NFToken sell offer:
|
To create a NFT sell offer:
|
||||||
|
|
||||||
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
||||||
2. Enter the **NFToken ID** of the NFToken you want to sell.
|
2. Enter the **NFT ID** of the NFT you want to sell.
|
||||||
3. Optionally, enter a **Destination** account, the only account that can accept the offer.
|
3. Optionally, enter a **Destination** account, the only account that can accept the offer.
|
||||||
4. Optionally, enter a number of seconds until **Expiration**.
|
4. Optionally, enter a number of seconds until **Expiration**.
|
||||||
5. Click **Create Sell Offer**.
|
5. Click **Create Sell Offer**.
|
||||||
6. Click **Get Offers**.
|
6. Click **Get Offers**.
|
||||||
|
|
||||||
The important piece of information in the response is the NFToken Offer Index, labeled as `nft_offer_index`, which you use to accept the sell offer.
|
The important piece of information in the response is the NFT Offer Index, labeled as `nft_offer_index`, which you use to accept the sell offer.
|
||||||
|
|
||||||
[](img/quickstart-py17.png)
|
[](img/quickstart-py17.png)
|
||||||
|
|
||||||
## Accept Sell Offer
|
## Accept Sell Offer
|
||||||
|
|
||||||
Once a sell offer is available, another account can opt to accept the offer and buy the NFToken.
|
Once a sell offer is available, another account can opt to accept the offer and buy the NFT.
|
||||||
|
|
||||||
To accept an available sell offer:
|
To accept an available sell offer:
|
||||||
|
|
||||||
1. Enter the **NFToken Offer Index** (labeled as `nft_offer_index` in the token offer results. This is different from the `NFTokenID`.)
|
1. Enter the **NFT Offer Index** (labeled as `nft_offer_index` in the token offer results. This is different from the `NFTokenID`.)
|
||||||
2. Click **Accept Sell Offer**.
|
2. Click **Accept Sell Offer**.
|
||||||
3. Click **Get Standby Account Info** and **Get Op Account Info** to update the XRP balances.
|
3. Click **Get Standby Account Info** and **Get Op Account Info** to update the XRP balances.
|
||||||
4. Click **Get NFTokens** for each account to see that the NFT has moved from the Standby account to the Operational account.
|
4. Click **Get NFTs** for each account to see that the NFT has moved from the Standby account to the Operational account.
|
||||||
|
|
||||||
[](img/quickstart-py18.png)
|
[](img/quickstart-py18.png)
|
||||||
|
|
||||||
@@ -80,30 +80,30 @@ You can offer to buy an NFT from another account.
|
|||||||
To create an offer to buy an NFT:
|
To create an offer to buy an NFT:
|
||||||
|
|
||||||
1. Enter the **Amount** of your offer.
|
1. Enter the **Amount** of your offer.
|
||||||
2. Enter the **NFToken ID**.
|
2. Enter the **NFT ID**.
|
||||||
3. Enter the owner’s account string in the **Owner** field.
|
3. Enter the owner’s account string in the **Owner** field.
|
||||||
4. Optionally enter the number of seconds until **Expiration**.
|
4. Optionally enter the number of seconds until **Expiration**.
|
||||||
5. Click **Create Buy Offer**.
|
5. Click **Create Buy Offer**.
|
||||||
6. On the Operational side, enter the **NFToken ID**.
|
6. On the Operational side, enter the **NFT ID**.
|
||||||
7. Click **Get Offers** to view the offer and copy the `nft_offer_index`.
|
7. Click **Get Offers** to view the offer and copy the `nft_offer_index`.
|
||||||
|
|
||||||
[](img/quickstart-py19.png)
|
[](img/quickstart-py19.png)
|
||||||
|
|
||||||
## Accept a Buy Offer
|
## Accept a Buy Offer
|
||||||
|
|
||||||
To accept an offer to buy an NFT:
|
To accept an offer to buy an NFT:
|
||||||
|
|
||||||
1. Enter the **NFToken Offer Index** (the `nft_offer_index` of the NFT buy offer).
|
1. Enter the **NFT Offer Index** (the `nft_offer_index` of the NFT buy offer).
|
||||||
2. Click **Accept Buy Offer**.
|
2. Click **Accept Buy Offer**.
|
||||||
3. Click **Get Standby Account Info** and **Get Op Account Info** to update the XRP balances.
|
3. Click **Get Standby Account Info** and **Get Op Account Info** to update the XRP balances.
|
||||||
4. Click **Get NFTokens** for both accounts to see that the NFT has moved from the Operational account to the Standby account.
|
4. Click **Get NFTs** for both accounts to see that the NFT has moved from the Operational account to the Standby account.
|
||||||
|
|
||||||
[](img/quickstart-py20.png)
|
[](img/quickstart-py20.png)
|
||||||
|
|
||||||
## Get Offers
|
## Get Offers
|
||||||
|
|
||||||
To list the buy and sell offers associated with an NFT:
|
To list the buy and sell offers associated with an NFT:
|
||||||
1. Enter the **NFToken ID**.
|
1. Enter the **NFT ID**.
|
||||||
2. Click **Get Offers**.
|
2. Click **Get Offers**.
|
||||||
|
|
||||||
[](img/quickstart21.png)
|
[](img/quickstart21.png)
|
||||||
@@ -112,7 +112,7 @@ To list the buy and sell offers associated with an NFT:
|
|||||||
|
|
||||||
To cancel a buy or sell offer that you have created:
|
To cancel a buy or sell offer that you have created:
|
||||||
|
|
||||||
1. Enter the **NFToken Offer Index**.
|
1. Enter the **NFT Offer Index**.
|
||||||
2. Click **Cancel Offer**.
|
2. Click **Cancel Offer**.
|
||||||
|
|
||||||
[](img/quickstart22.png)
|
[](img/quickstart22.png)
|
||||||
@@ -144,7 +144,7 @@ testnet_url = "https://s.altnet.rippletest.net:51234"
|
|||||||
Pass the arguments _seed_, _amount_, _NFT ID_, _expiration_ (in seconds, optional), and _destination_ (optional).
|
Pass the arguments _seed_, _amount_, _NFT ID_, _expiration_ (in seconds, optional), and _destination_ (optional).
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def create_sell_offer(_seed, _amount, _nftoken_id, _expiration, _destination):
|
def create_sell_offer(_seed, _amount, _nft_id, _expiration, _destination):
|
||||||
```
|
```
|
||||||
|
|
||||||
Get the owner wallet and create a client connection.
|
Get the owner wallet and create a client connection.
|
||||||
@@ -168,7 +168,7 @@ Define the sell offer transaction.
|
|||||||
```python
|
```python
|
||||||
sell_offer_tx = xrpl.models.transactions.NFTokenCreateOffer(
|
sell_offer_tx = xrpl.models.transactions.NFTokenCreateOffer(
|
||||||
account = owner_wallet.classic_address,
|
account = owner_wallet.classic_address,
|
||||||
nftoken_id = _nftoken_id,
|
nftoken_id = _nft_id,
|
||||||
amount = _amount,
|
amount = _amount,
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -428,7 +428,7 @@ The creator of an offer can cancel it at any time before it is accepted. Anyone
|
|||||||
Pass the seed and the NFT Offer ID to be canceled.
|
Pass the seed and the NFT Offer ID to be canceled.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
def cancel_offer(_seed, _nftoken_offer_ids):
|
def cancel_offer(_seed, _nft_offer_ids):
|
||||||
```
|
```
|
||||||
|
|
||||||
Get the wallet and a client instance.
|
Get the wallet and a client instance.
|
||||||
@@ -441,7 +441,7 @@ Get the wallet and a client instance.
|
|||||||
The `nftoken_offers` parameter is an array, rather than a single ID. You can revise the code to accept several offer IDs at one time. Here, the value is added to a new array variable.
|
The `nftoken_offers` parameter is an array, rather than a single ID. You can revise the code to accept several offer IDs at one time. Here, the value is added to a new array variable.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
tokenOfferIDs = [_nftoken_offer_ids]
|
tokenOfferIDs = [_nft_offer_ids]
|
||||||
```
|
```
|
||||||
|
|
||||||
Define the cancel offer transaction.
|
Define the cancel offer transaction.
|
||||||
@@ -775,14 +775,14 @@ lbl_standby_transfer_fee = tk.Label(master=frm_form, text="Transfer Fee")
|
|||||||
ent_standby_transfer_fee = tk.Entry(master=frm_form, width="50")
|
ent_standby_transfer_fee = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_taxon = tk.Label(master=frm_form, text="Taxon")
|
lbl_standby_taxon = tk.Label(master=frm_form, text="Taxon")
|
||||||
ent_standby_taxon = tk.Entry(master=frm_form, width="50")
|
ent_standby_taxon = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_nft_id = tk.Label(master=frm_form, text="NFToken ID")
|
lbl_standby_nft_id = tk.Label(master=frm_form, text="NFT ID")
|
||||||
ent_standby_nft_id = tk.Entry(master=frm_form, width="50")
|
ent_standby_nft_id = tk.Entry(master=frm_form, width="50")
|
||||||
```
|
```
|
||||||
|
|
||||||
Add fields for the *NFT Offer Index*, *Owner*, *Expiration*, and *Transfer Fee*.
|
Add fields for the *NFT Offer Index*, *Owner*, *Expiration*, and *Transfer Fee*.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
lbl_standby_nft_offer_index = tk.Label(master=frm_form, text="NFToken Offer Index")
|
lbl_standby_nft_offer_index = tk.Label(master=frm_form, text="NFT Offer Index")
|
||||||
ent_standby_nft_offer_index = tk.Entry(master=frm_form, width="50")
|
ent_standby_nft_offer_index = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_standby_owner = tk.Label(master=frm_form, text="Owner")
|
lbl_standby_owner = tk.Label(master=frm_form, text="Owner")
|
||||||
ent_standby_owner = tk.Entry(master=frm_form, width="50")
|
ent_standby_owner = tk.Entry(master=frm_form, width="50")
|
||||||
@@ -854,14 +854,14 @@ lbl_operational_transfer_fee = tk.Label(master=frm_form, text="Transfer Fee")
|
|||||||
ent_operational_transfer_fee = tk.Entry(master=frm_form, width="50")
|
ent_operational_transfer_fee = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_taxon = tk.Label(master=frm_form, text="Taxon")
|
lbl_operational_taxon = tk.Label(master=frm_form, text="Taxon")
|
||||||
ent_operational_taxon = tk.Entry(master=frm_form, width="50")
|
ent_operational_taxon = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_nft_id = tk.Label(master=frm_form, text="NFToken ID")
|
lbl_operational_nft_id = tk.Label(master=frm_form, text="NFT ID")
|
||||||
ent_operational_nft_id = tk.Entry(master=frm_form, width="50")
|
ent_operational_nft_id = tk.Entry(master=frm_form, width="50")
|
||||||
```
|
```
|
||||||
|
|
||||||
Add fields for *NFToken Offer Index*, *Owner*, *Expiration*, and *Transfer Fee*.
|
Add fields for *NFT Offer Index*, *Owner*, *Expiration*, and *Transfer Fee*.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
lbl_operational_nft_offer_index = tk.Label(master=frm_form, text="NFToken Offer Index")
|
lbl_operational_nft_offer_index = tk.Label(master=frm_form, text="NFT Offer Index")
|
||||||
ent_operational_nft_offer_index = tk.Entry(master=frm_form, width="50")
|
ent_operational_nft_offer_index = tk.Entry(master=frm_form, width="50")
|
||||||
lbl_operational_owner = tk.Label(master=frm_form, text="Owner")
|
lbl_operational_owner = tk.Label(master=frm_form, text="Owner")
|
||||||
ent_operational_owner = tk.Entry(master=frm_form, width="50")
|
ent_operational_owner = tk.Entry(master=frm_form, width="50")
|
||||||
@@ -936,13 +936,13 @@ btn_standby_configure_account = tk.Button(master=frm_form,
|
|||||||
text="Configure Account",
|
text="Configure Account",
|
||||||
command = standby_configure_account)
|
command = standby_configure_account)
|
||||||
btn_standby_configure_account.grid(row=7,column=0, sticky = "nsew")
|
btn_standby_configure_account.grid(row=7,column=0, sticky = "nsew")
|
||||||
btn_standby_mint_token = tk.Button(master=frm_form, text="Mint NFToken",
|
btn_standby_mint_token = tk.Button(master=frm_form, text="Mint NFT",
|
||||||
command = standby_mint_token)
|
command = standby_mint_token)
|
||||||
btn_standby_mint_token.grid(row=8, column=2, sticky="nsew")
|
btn_standby_mint_token.grid(row=8, column=2, sticky="nsew")
|
||||||
btn_standby_get_tokens = tk.Button(master=frm_form, text="Get NFTokens",
|
btn_standby_get_tokens = tk.Button(master=frm_form, text="Get NFTs",
|
||||||
command = standby_get_tokens)
|
command = standby_get_tokens)
|
||||||
btn_standby_get_tokens.grid(row=9, column=2, sticky="nsew")
|
btn_standby_get_tokens.grid(row=9, column=2, sticky="nsew")
|
||||||
btn_standby_burn_token = tk.Button(master=frm_form, text="Burn NFToken",
|
btn_standby_burn_token = tk.Button(master=frm_form, text="Burn NFT",
|
||||||
command = standby_burn_token)
|
command = standby_burn_token)
|
||||||
btn_standby_burn_token.grid(row=10, column=2, sticky="nsew")
|
btn_standby_burn_token.grid(row=10, column=2, sticky="nsew")
|
||||||
```
|
```
|
||||||
@@ -993,13 +993,13 @@ btn_op_get_balances.grid(row=6, column=3, sticky = "nsew")
|
|||||||
btn_op_configure_account = tk.Button(master=frm_form, text="Configure Account",
|
btn_op_configure_account = tk.Button(master=frm_form, text="Configure Account",
|
||||||
command = operational_configure_account)
|
command = operational_configure_account)
|
||||||
btn_op_configure_account.grid(row=7,column=4, sticky = "nsew")
|
btn_op_configure_account.grid(row=7,column=4, sticky = "nsew")
|
||||||
btn_op_mint_token = tk.Button(master=frm_form, text="Mint NFToken",
|
btn_op_mint_token = tk.Button(master=frm_form, text="Mint NFT",
|
||||||
command = operational_mint_token)
|
command = operational_mint_token)
|
||||||
btn_op_mint_token.grid(row=8, column=3, sticky="nsew")
|
btn_op_mint_token.grid(row=8, column=3, sticky="nsew")
|
||||||
btn_op_get_tokens = tk.Button(master=frm_form, text="Get NFTokens",
|
btn_op_get_tokens = tk.Button(master=frm_form, text="Get NFTs",
|
||||||
command = operational_get_tokens)
|
command = operational_get_tokens)
|
||||||
btn_op_get_tokens.grid(row=9, column=3, sticky="nsew")
|
btn_op_get_tokens.grid(row=9, column=3, sticky="nsew")
|
||||||
btn_op_burn_token = tk.Button(master=frm_form, text="Burn NFToken",
|
btn_op_burn_token = tk.Button(master=frm_form, text="Burn NFT",
|
||||||
command = operational_burn_token)
|
command = operational_burn_token)
|
||||||
btn_op_burn_token.grid(row=10, column=3, sticky="nsew")
|
btn_op_burn_token.grid(row=10, column=3, sticky="nsew")
|
||||||
```
|
```
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
html: quickstart-intro.html
|
html: quickstart-intro.html
|
||||||
parent: quickstart-javascript.html
|
parent: quickstart-javascript.html
|
||||||
blurb: Use a JavaScript test harness to send XRP, trade currencies, and mint and trade NFTokens.
|
blurb: Use a JavaScript test harness to send XRP, trade currencies, and mint and trade NFTs.
|
||||||
labels:
|
labels:
|
||||||
- Accounts
|
- Accounts
|
||||||
- Cross-Currency
|
- Cross-Currency
|
||||||
@@ -28,7 +28,7 @@ Typically, the example functions for interacting with the XRP Ledger involve fou
|
|||||||
3. Get the state of accounts and tokens on the XRP Ledger using requests.
|
3. Get the state of accounts and tokens on the XRP Ledger using requests.
|
||||||
4. Disconnect from the XRP Ledger.
|
4. Disconnect from the XRP Ledger.
|
||||||
|
|
||||||
Each lesson shows you how to build the Token Test Harness one section at a time. Each module lets you try out meaningful interactions with the test ledger, with complete JavaScript and HTML code samples and a code walkthrough. There is also a link to the complete source code for each section that can be modified with a text editor and run in a browser. If you cannot wait, you can follow the prerequisites below, then jump to lesson 4, [Transfer NFTokens](transfer-nftokens.html), and try out the complete test harness right away.
|
Each lesson shows you how to build the Token Test Harness one section at a time. Each module lets you try out meaningful interactions with the test ledger, with complete JavaScript and HTML code samples and a code walkthrough. There is also a link to the complete source code for each section that can be modified with a text editor and run in a browser. If you cannot wait, you can follow the prerequisites below, then jump to lesson 4, [Transfer NFTs](transfer-nfts.html), and try out the complete test harness right away.
|
||||||
|
|
||||||
This quickstart tutorial introduces you to the API used to implement features and explore the capabilities of XRP Ledger. It does not represent *all* of the capabilities of the API and this example is not intended for production or secure payment use.
|
This quickstart tutorial introduces you to the API used to implement features and explore the capabilities of XRP Ledger. It does not represent *all* of the capabilities of the API and this example is not intended for production or secure payment use.
|
||||||
|
|
||||||
@@ -38,10 +38,10 @@ In this quickstart, you can:
|
|||||||
|
|
||||||
1. [Create Accounts and Send XRP](create-accounts-send-xrp.html)
|
1. [Create Accounts and Send XRP](create-accounts-send-xrp.html)
|
||||||
2. [Create Trust Line and Send Currency](create-trustline-send-currency.html).
|
2. [Create Trust Line and Send Currency](create-trustline-send-currency.html).
|
||||||
3. [Mint and Burn NFTokens](mint-and-burn-nftokens.html).
|
3. [Mint and Burn NFTs](mint-and-burn-nfts.html).
|
||||||
4. [Transfer NFTokens](transfer-nftokens.html).
|
4. [Transfer NFTs](transfer-nfts.html).
|
||||||
|
|
||||||
There are also expanded lessons demonstrating how to [Broker a NFToken Sale](broker-sale.html), [Assign an Authorized Minter](authorize-minter.html), and [Batch Mint NFTokens](batch-minting.html).
|
There are also expanded lessons demonstrating how to [Broker a NFT Sale](broker-sale.html), [Assign an Authorized Minter](authorize-minter.html), and [Batch Mint NFTs](batch-minting.html).
|
||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
---
|
---
|
||||||
html: transfer-nftokens.html
|
html: transfer-nftokens.html
|
||||||
parent: quickstart-javascript.html
|
parent: quickstart-javascript.html
|
||||||
blurb: Use a JavaScript test harness to send XRP, trade currencies, and mint and trade NFTokens.
|
blurb: Use a JavaScript test harness to send XRP, trade currencies, and mint and trade NFTs.
|
||||||
labels:
|
labels:
|
||||||
- Quickstart
|
- Quickstart
|
||||||
- Tokens
|
- Tokens
|
||||||
- Non-fungible Tokens, NFTs
|
- Non-fungible Tokens, NFTs
|
||||||
---
|
---
|
||||||
|
|
||||||
# 4. Transfer NFTokens
|
# 4. Transfer NFTs
|
||||||
|
|
||||||
This example shows how to:
|
This example shows how to:
|
||||||
|
|
||||||
1. Create NFToken Sell Offers.
|
1. Create NFT Sell Offers.
|
||||||
2. Create NFToken Buy Offers.
|
2. Create NFT Buy Offers.
|
||||||
3. Accept NFToken Sell Offers.
|
3. Accept NFT Sell Offers.
|
||||||
4. Accept NFToken Buy Offers.
|
4. Accept NFT Buy Offers.
|
||||||
5. Get a list of offers for a particular NFToken.
|
5. Get a list of offers for a particular NFT.
|
||||||
6. Cancel an offer.
|
6. Cancel an offer.
|
||||||
|
|
||||||
[](img/quickstart13.png)
|
[](img/quickstart13.png)
|
||||||
|
|
||||||
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/quickstart.zip){.github-code-download} archive to try each of the samples in your own browser.
|
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/quickstart.zip){.github-code-download} archive to try each of the samples in your own browser.
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Get Accounts
|
## Get Accounts
|
||||||
|
|
||||||
1. Open `4.transfer-nftokens.html` in a browser.
|
1. Open `4.transfer-nfts.html` in a browser.
|
||||||
2. Choose your ledger instance (**Testnet** or **Devnet**).
|
2. Choose your ledger instance (**Testnet** or **Devnet**).
|
||||||
3. Get test accounts.
|
3. Get test accounts.
|
||||||
1. If you have existing test account seeds
|
1. If you have existing test account seeds
|
||||||
@@ -41,56 +41,56 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
|||||||
|
|
||||||
## Create a Sell Offer
|
## Create a Sell Offer
|
||||||
|
|
||||||
To create a NFToken sell offer:
|
To create a NFT sell offer:
|
||||||
|
|
||||||
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
||||||
2. Set the **Flags** field to _1_.
|
2. Set the **Flags** field to _1_.
|
||||||
3. Enter the **NFToken ID** of the NFToken you want to sell.
|
3. Enter the **NFT ID** of the NFT you want to sell.
|
||||||
4. Optionally, enter a number of days until **Expiration**.
|
4. Optionally, enter a number of days until **Expiration**.
|
||||||
5. Click **Create Sell Offer**.
|
5. Click **Create Sell Offer**.
|
||||||
|
|
||||||
The important piece of information in the response is the NFToken Offer Index, labeled as `nft_offer_index`, which you use to accept the sell offer.
|
The important piece of information in the response is the NFT Offer Index, labeled as `nft_offer_index`, which you use to accept the sell offer.
|
||||||
|
|
||||||
[](img/quickstart15.png)
|
[](img/quickstart15.png)
|
||||||
|
|
||||||
## Accept Sell Offer
|
## Accept Sell Offer
|
||||||
|
|
||||||
Once a sell offer is available, another account can opt to accept the offer and buy the NFToken.
|
Once a sell offer is available, another account can opt to accept the offer and buy the NFT.
|
||||||
|
|
||||||
To accept an available sell offer:
|
To accept an available sell offer:
|
||||||
|
|
||||||
1. Enter the **NFToken Offer Index** (labeled as `nft_offer_index` in the token offer results. This is different from the `NFTokenID`.)
|
1. Enter the **NFT Offer Index** (labeled as `nft_offer_index` in the token offer results. This is different from the `NFTokenID`.)
|
||||||
2. Click **Accept Sell Offer**.
|
2. Click **Accept Sell Offer**.
|
||||||
|
|
||||||
[](img/quickstart16.png)
|
[](img/quickstart16.png)
|
||||||
|
|
||||||
## Create a Buy Offer
|
## Create a Buy Offer
|
||||||
|
|
||||||
You can offer to buy a NFToken from another account.
|
You can offer to buy a NFT from another account.
|
||||||
|
|
||||||
To create an offer to buy a NFToken:
|
To create an offer to buy a NFT:
|
||||||
|
|
||||||
1. Enter the **Amount** of your offer.
|
1. Enter the **Amount** of your offer.
|
||||||
2. Enter the **NFToken ID**.
|
2. Enter the **NFT ID**.
|
||||||
3. Enter the owner’s account string in the **Owner** field.
|
3. Enter the owner’s account string in the **Owner** field.
|
||||||
4. Optionally enter the number of days until **Expiration**.
|
4. Optionally enter the number of days until **Expiration**.
|
||||||
5. Click **Create Buy Offer**.
|
5. Click **Create Buy Offer**.
|
||||||
|
|
||||||
[](img/quickstart17.png)
|
[](img/quickstart17.png)
|
||||||
|
|
||||||
## Accept a Buy Offer
|
## Accept a Buy Offer
|
||||||
|
|
||||||
To accept an offer to buy a NFToken:
|
To accept an offer to buy an NFT:
|
||||||
|
|
||||||
1. Enter the **NFToken Offer Index** (the `nft_offer_index` of the NFToken buy offer).
|
1. Enter the **NFT Offer Index** (the `nft_offer_index` of the NFT buy offer).
|
||||||
3. Click **Accept Buy Offer**.
|
3. Click **Accept Buy Offer**.
|
||||||
|
|
||||||
[](img/quickstart18.png)
|
[](img/quickstart18.png)
|
||||||
|
|
||||||
## Get Offers
|
## Get Offers
|
||||||
|
|
||||||
To list the buy and sell offers associated with a NFToken:
|
To list the buy and sell offers associated with an NFT:
|
||||||
1. Enter the **NFToken ID**.
|
1. Enter the **NFT ID**.
|
||||||
2. Click **Get Offers**.
|
2. Click **Get Offers**.
|
||||||
|
|
||||||
[](img/quickstart19.png)
|
[](img/quickstart19.png)
|
||||||
@@ -99,7 +99,7 @@ To list the buy and sell offers associated with a NFToken:
|
|||||||
|
|
||||||
To cancel a buy or sell offer that you have created:
|
To cancel a buy or sell offer that you have created:
|
||||||
|
|
||||||
1. Enter the **NFToken Offer Index**.
|
1. Enter the **NFT Offer Index**.
|
||||||
2. Click **Cancel Offer**.
|
2. Click **Cancel Offer**.
|
||||||
|
|
||||||
[](img/quickstart20.png)
|
[](img/quickstart20.png)
|
||||||
@@ -165,7 +165,7 @@ If the Expiration Date is present, append it to the transaction.
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If the Destination field is not empty, append it to the transaction. When the destination is set, only the destination account can buy the NFToken.
|
If the Destination field is not empty, append it to the transaction. When the destination is set, only the destination account can buy the NFT.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
if(standbyDestinationField.value !== '') {
|
if(standbyDestinationField.value !== '') {
|
||||||
@@ -1140,7 +1140,7 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="standbyTokenUrlField"
|
<td><input type="text" id="standbyTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -1150,11 +1150,11 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
<td><input type="text" id="standbyFlagsField" value="1" size="10"/></td>
|
<td><input type="text" id="standbyFlagsField" value="1" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken Offer Index</td>
|
<td align="right">NFT Offer Index</td>
|
||||||
<td><input type="text" id="standbyTokenOfferIndexField" value="" size="80"/></td>
|
<td><input type="text" id="standbyTokenOfferIndexField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -1191,11 +1191,11 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBalances()">Get Balances</button>
|
<button type="button" onClick="getBalances()">Get Balances</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="mintToken()">Mint NFToken</button>
|
<button type="button" onClick="mintToken()">Mint NFT</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getTokens()">Get NFTokens</button>
|
<button type="button" onClick="getTokens()">Get NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="burnToken()">Burn NFToken</button>
|
<button type="button" onClick="burnToken()">Burn NFT</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="createSellOffer()">Create Sell Offer</button>
|
<button type="button" onClick="createSellOffer()">Create Sell Offer</button>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -1233,11 +1233,11 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="getBalances()">Get Balances</button>
|
<button type="button" onClick="getBalances()">Get Balances</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="oPmintToken()">Mint NFToken</button>
|
<button type="button" onClick="oPmintToken()">Mint NFT</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="oPgetTokens()">Get NFTokens</button>
|
<button type="button" onClick="oPgetTokens()">Get NFTs</button>
|
||||||
<br/>
|
<br/>
|
||||||
<button type="button" onClick="oPburnToken()">Burn NFToken</button>
|
<button type="button" onClick="oPburnToken()">Burn NFT</button>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<button type="button" onClick="oPcreateSellOffer()">Create Sell Offer</button>
|
<button type="button" onClick="oPcreateSellOffer()">Create Sell Offer</button>
|
||||||
<br/>
|
<br/>
|
||||||
@@ -1325,7 +1325,7 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken URL</td>
|
<td align="right">NFT URL</td>
|
||||||
<td><input type="text" id="operationalTokenUrlField"
|
<td><input type="text" id="operationalTokenUrlField"
|
||||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||||
</td>
|
</td>
|
||||||
@@ -1335,11 +1335,11 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
<td><input type="text" id="operationalFlagsField" value="1" size="10"/></td>
|
<td><input type="text" id="operationalFlagsField" value="1" size="10"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken ID</td>
|
<td align="right">NFT ID</td>
|
||||||
<td><input type="text" id="operationalTokenIdField" value="" size="80"/></td>
|
<td><input type="text" id="operationalTokenIdField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right">NFToken Offer Index</td>
|
<td align="right">NFT Offer Index</td>
|
||||||
<td><input type="text" id="operationalTokenOfferIndexField" value="" size="80"/></td>
|
<td><input type="text" id="operationalTokenOfferIndexField" value="" size="80"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -1248,7 +1248,7 @@ pages:
|
|||||||
html: quickstart-javascript.html
|
html: quickstart-javascript.html
|
||||||
parent: xrpl-quickstart.html
|
parent: xrpl-quickstart.html
|
||||||
template: pagetype-category.html.jinja
|
template: pagetype-category.html.jinja
|
||||||
blurb: Use a JavaScript test harness to send XRP, trade currencies, and mint and trade NFTokens.
|
blurb: Use a JavaScript test harness to send XRP, trade currencies, and mint and trade NFTs.
|
||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
- ja
|
- ja
|
||||||
@@ -1275,14 +1275,14 @@ pages:
|
|||||||
- ja
|
- ja
|
||||||
|
|
||||||
# TODO: translate
|
# TODO: translate
|
||||||
- md: tutorials/quickstart/mint-and-burn-nftokens.md
|
- md: tutorials/quickstart/mint-and-burn-nfts.md
|
||||||
parent: quickstart-javascript.html
|
parent: quickstart-javascript.html
|
||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
- ja
|
- ja
|
||||||
|
|
||||||
# TODO: translate
|
# TODO: translate
|
||||||
- md: tutorials/quickstart/transfer-nftokens.md
|
- md: tutorials/quickstart/transfer-nfts.md
|
||||||
parent: quickstart-javascript.html
|
parent: quickstart-javascript.html
|
||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
@@ -1313,7 +1313,7 @@ pages:
|
|||||||
html: quickstart-python.html
|
html: quickstart-python.html
|
||||||
parent: xrpl-quickstart.html
|
parent: xrpl-quickstart.html
|
||||||
template: pagetype-category.html.jinja
|
template: pagetype-category.html.jinja
|
||||||
blurb: Use a Python test harness to send XRP, trade currencies, and mint and trade NFTokens.
|
blurb: Use a Python test harness to send XRP, trade currencies, and mint and trade NFTs.
|
||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
- ja
|
- ja
|
||||||
@@ -1340,14 +1340,14 @@ pages:
|
|||||||
- ja
|
- ja
|
||||||
|
|
||||||
# TODO: translate
|
# TODO: translate
|
||||||
- md: tutorials/quickstart/py-mint-and-burn-nftokens.md
|
- md: tutorials/quickstart/py-mint-and-burn-nfts.md
|
||||||
parent: quickstart-python.html
|
parent: quickstart-python.html
|
||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
- ja
|
- ja
|
||||||
|
|
||||||
# TODO: translate
|
# TODO: translate
|
||||||
- md: tutorials/quickstart/py-transfer-nftokens.md
|
- md: tutorials/quickstart/py-transfer-nfts.md
|
||||||
parent: quickstart-python.html
|
parent: quickstart-python.html
|
||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
|
|||||||
Reference in New Issue
Block a user