diff --git a/content/_code-samples/nftoken-tester/README.md b/content/_code-samples/nftoken-tester/README.md deleted file mode 100644 index 1ef97bb695..0000000000 --- a/content/_code-samples/nftoken-tester/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# NFToken Test Harness - -Build an interface that can mint and trade non-fungible tokens (NFTs) on the NFT-Devnet. diff --git a/content/_code-samples/nftoken-tester/js/nftoken-tester.html b/content/_code-samples/nftoken-tester/js/nftoken-tester.html deleted file mode 100644 index 3be39cc5af..0000000000 --- a/content/_code-samples/nftoken-tester/js/nftoken-tester.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - -NFToken Tester - - -

NFToken Tester

-
-

-   -   -   -

-

-   -   - -

-

-   -   -   -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Account
Secret
Token URL -
Flags
Token ID
Amount
Token Offer Index
Owner
-
- - diff --git a/content/_code-samples/quickstart/js/quickstart.zip b/content/_code-samples/quickstart/js/quickstart.zip index 88139f999c..57b7cdbdf3 100644 Binary files a/content/_code-samples/quickstart/js/quickstart.zip and b/content/_code-samples/quickstart/js/quickstart.zip differ diff --git a/content/tutorials/quickstart/authorize-minter.md b/content/tutorials/quickstart/authorize-minter.md index 72f8506445..1ec27a1745 100644 --- a/content/tutorials/quickstart/authorize-minter.md +++ b/content/tutorials/quickstart/authorize-minter.md @@ -27,11 +27,11 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port ## Get Accounts 1. Open `6.authorized-minter.html` in a browser. -2. Get test accounts. - 1. If you have existing NFT-Devnet account seeds: +2. Choose your ledger instance (_Testnet_ or _Devnet_). + 1. If you have existing test account seeds: 1. Paste the account seeds in the **Seeds** field. 2. Click **Get Accounts from Seeds**. - 2. If you do not have existing NFT-Devnet accounts: + 2. If you do not have existing test accounts: 1. Click **Get New Standby Account**. 2. Click **Get New Operational Account**. @@ -398,9 +398,6 @@ Update the form with fields and buttons to support the new functions.

Token Test Harness

Choose your ledger instance: - -    diff --git a/content/tutorials/quickstart/batch-minting.md b/content/tutorials/quickstart/batch-minting.md index afb56a130e..c3886289a5 100644 --- a/content/tutorials/quickstart/batch-minting.md +++ b/content/tutorials/quickstart/batch-minting.md @@ -23,10 +23,10 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port 1. Open `7.batch-minting.html` in a browser. 2. Get a test account. - 1. If you want to use an existing NFT-Devnet account seed: + 1. If you want to use an existing account seed: 1. Paste the account seed in the **Seed** field. 2. Click **Get Account from Seed**. - 2. If you do not want to use an existing NFT-Devnet account seed, click **Get New Standby Account**. + 2. If you do not want to use an existing account seed, click **Get New Standby Account**. **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). @@ -360,9 +360,6 @@ For this form:

Token Test Harness

Choose your ledger instance: - -    diff --git a/content/tutorials/quickstart/broker-sale.md b/content/tutorials/quickstart/broker-sale.md index 2ae7e13eac..59075afda6 100644 --- a/content/tutorials/quickstart/broker-sale.md +++ b/content/tutorials/quickstart/broker-sale.md @@ -28,12 +28,12 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port ## Get Accounts 1. Open `5.broker-nfts.html` in a browser. -2. Choose **XLS20-NFT** as your ledger instance. +2. Choose your ledger instance. 3. Get test accounts. - 1. If you have existing NFT-Devnet account seeds: + 1. If you have existing account seeds: 1. Paste 3 account seeds in the **Seeds** field. 2. Click **Get Accounts from Seeds**. - 2. If you do not have NFT-Devnet account seeds: + 2. If you do not have account seeds: 1. Click **Get New Standby Account**. 2. Click **Get New Operational Account**. 3. Click **Get New Broker Account** @@ -625,9 +625,6 @@ Revise the HTML form to add a new Broker section at the top.

Token Test Harness

Choose your ledger instance: - -    diff --git a/content/tutorials/quickstart/create-accounts-send-xrp.md b/content/tutorials/quickstart/create-accounts-send-xrp.md index 90ed61ce3f..7c6ae5a3a9 100644 --- a/content/tutorials/quickstart/create-accounts-send-xrp.md +++ b/content/tutorials/quickstart/create-accounts-send-xrp.md @@ -10,24 +10,18 @@ labels: --- # 1. Create Accounts and Send XRP - This example shows how to: - 1. Create accounts on the Testnet, funded with 10000 test XRP with no actual value. 2. Retrieve the accounts from seed values. 3. Transfer XRP between accounts. When you create an account, you receive a public/private key pair offline. It does not appear on the ledger until it is funded with XRP. This example shows how to create accounts for Testnet, but not how to create an account that you can use on Mainnet. - - ![Token Test Harness](img/quickstart2.png) - - ## Prerequisites To get started, create a new folder on your local disk and install the JavaScript library using `npm`. @@ -47,7 +41,7 @@ To get test accounts: 1. Open `1.get-accounts-send-xrp.html` in a browser -2. Choose **NFT-Devnet**, **Testnet**, or **Devnet**. +2. Choose **Testnet** or **Devnet**. 3. Click **Get New Standby Account**. 4. Click **Get New Operational Account.** 5. Copy and paste the **Seeds** field in a persistent location, such as a Notepad, so that you can reuse the accounts after reloading the form. @@ -80,7 +74,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port ## ripplex-1-send-xrp.js -This example can be used with any XRP Ledger network. Currently, there are _Testnet_ and _Devnet,_ with the experimental _NFT-Devnet_ server with support for NFTokens. You can update the code to choose different or additional XRP Ledger networks. +This example can be used with any XRP Ledger network, _Testnet_, or _Devnet_. You can update the code to choose different or additional XRP Ledger networks. ### getNet() @@ -100,7 +94,6 @@ This function uses brute force `if` statements to discover the selected network ``` let net - if (document.getElementById("xls").checked) net = "wss://xls20-sandbox.rippletest.net:51233" if (document.getElementById("tn").checked) net = "wss://s.altnet.rippletest.net:51233" if (document.getElementById("dn").checked) net = "wss://s.devnet.rippletest.net:51233" return net @@ -380,7 +373,6 @@ Connect to your selected ledger. ``` - Prepare the transaction. This is a Payment transaction from the standby wallet to the operational wallet. The _Payment_ transaction expects the XRP to be expressed in drops, or 1/millionth of an XRP. You can use the xrpToDrops utility to convert the send amount for you (which beats having to type an extra 6 zeroes to send 1 XRP). @@ -542,9 +534,6 @@ Create a standard HTML form to send transactions and requests, then display the

Token Test Harness

Choose your ledger instance: - -    diff --git a/content/tutorials/quickstart/create-trustline-send-currency.md b/content/tutorials/quickstart/create-trustline-send-currency.md index 10d91d6f00..4ccf932206 100644 --- a/content/tutorials/quickstart/create-trustline-send-currency.md +++ b/content/tutorials/quickstart/create-trustline-send-currency.md @@ -648,9 +648,6 @@ Update the form to support the new functions.

Token Test Harness

Choose your ledger instance: - -    diff --git a/content/tutorials/quickstart/mint-and-burn-nftokens.md b/content/tutorials/quickstart/mint-and-burn-nftokens.md index df5633bc9c..826b243af2 100644 --- a/content/tutorials/quickstart/mint-and-burn-nftokens.md +++ b/content/tutorials/quickstart/mint-and-burn-nftokens.md @@ -12,10 +12,12 @@ labels: This example shows how to: -1. Mint new Non-Fungible Tokens (NFTokens). + +1. Mint new Non-fungible Tokens (NFTokens). 2. Get a list of existing NFTokens. 3. Delete (Burn) a NFToken. + ![Test harness with mint NFToken fields](img/quickstart8.png) @@ -30,10 +32,10 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port 1. Open `3.mint-nfts.html` in a browser. 2. Get test accounts. - 1. If you have existing NFT-Devnet account seeds: + 1. If you have existing Testnet account seeds: 1. Paste the account seeds in the **Seeds** field. 2. Click **Get Accounts from Seeds**. - 2. If you do not have existing NFT-Devnet accounts: + 2. If you do not have existing Testnet accounts: 1. Click **Get New Standby Account**. 2. Click **Get New Operational Account**. @@ -480,11 +482,7 @@ Bold text in the following indicates changes to the form that support the new fu

Token Test Harness

- Choose your ledger instance: - - -    + Choose your ledger instance: diff --git a/content/tutorials/quickstart/transfer-nftokens.md b/content/tutorials/quickstart/transfer-nftokens.md index 32b5490d5c..930bf0c53f 100644 --- a/content/tutorials/quickstart/transfer-nftokens.md +++ b/content/tutorials/quickstart/transfer-nftokens.md @@ -10,9 +10,10 @@ labels: # 4. Transfer NFTokens - This example shows how to: + + 1. Create NFToken Sell Offers. 2. Create NFToken Buy Offers. 3. Accept NFToken Sell Offers. @@ -35,12 +36,12 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port 1. Open `4.transfer-nftokens.html` in a browser. -2. Choose **XLS20-NFT** as your ledger instance. +2. Choose your ledger instance (**Testnet** or **Devnet**). 3. Get test accounts. - 1. If you have existing NFT-Devnet account seeds + 1. If you have existing test account seeds 1. Paste account seeds in the **Seeds** field. 2. Click **Get Accounts from Seeds**. - 2. If you do not have NFT-Devnet account seeds: + 2. If you do not have test account seeds: 1. Click **Get New Standby Account**. 2. Click **Get New Operational Account**. @@ -1189,9 +1190,6 @@ Update the form with fields and buttons to support the new functions.

Token Test Harness

Choose your ledger instance: - -    diff --git a/content/tutorials/use-tokens/nftoken-tester-tutorial.md b/content/tutorials/use-tokens/nftoken-tester-tutorial.md deleted file mode 100644 index fe1e4657f4..0000000000 --- a/content/tutorials/use-tokens/nftoken-tester-tutorial.md +++ /dev/null @@ -1,1104 +0,0 @@ ---- -html: nftoken-tester-tutorial.html -parent: use-tokens.html -blurb: Use a JavaScript test harness to mint, trade, and destroy NFTs. -labels: - - Non-fungible Tokens, NFTs ---- -# NFToken Tester Tutorial - -This example builds a JavaScript test harness where you can create NFTokens and associated transactions. Each button triggers a frequently used request or transaction used to manage `NFTokens`. The fields provided let you enter required parameters. - -[![NFTokenTester Tutorial Window](img/nftokentester1.png)](img/nftokentester1.png) - -# Prerequisites - -To mint a `NFToken`, you need to generate Account and Secret credentials on the NFT-Devnet (`wss://xls20-sandbox.rippletest.net:51233`). Go to the [Test XRP Faucet](xrp-testnet-faucet.html) and click **Generate NFT-Devnet credentials**. You can also obtain a second set of account credentials to try creating and accepting buy and sell offers. - -You need a URL to the token data you want to turn into a `NFToken`. You can use your own object or this example IPFS address for testing. - - -``` -ipfs://QmQjDvDhfHcMyUgDAxKig4AoMTtS5JrsfpiEEpFa3F9QRt -``` - - -Open `nftoken-tester.html` in a web browser, and display the JavaScript console. For example, in Google Chrome choose **View> Developer> JavaScript Console**. - -You can find [the NFToken Tester source code in this website's repository]({{target.github_forkurl}}/tree/{{target.github_branch}}/content/_code-samples/nftoken-tester/js/nftoken-tester.html). The walkthrough below describes key sections in the code. The functions share much of the same code, with the only changes in the body of the transaction arguments themselves. - - -## The `NFTokenMint` Transaction - -The best place to begin is by creating your own `NFToken`. - -To create an `NFToken`: - -1. In the appropriate fields, enter your **Account** and **Secret** credentials. -2. Enter the URL to your NFT data. -3. If you want the NFT to be transferable, enter **8** in the **Flag** field. Otherwise, it can be transferred only one time to another account. -4. Click **Mint Token**. -5. Wait about 5 - 6 seconds for the response. Expand the response by clicking the arrows on the left of each subordinate entry to see the record of your new NFToken. - -[![NFTokenTester Tutorial Results](img/nftokentester2.png)](img/nftokentester2.png) - -### The `mintToken()`Function - -The `mintToken()`function creates a `NFToken` object on your account’s `NFTokenPage` ledger structure. The steps are: - - - -1. Connect an account to the XRP ledger. -2. Create a `NFTokenMint` transaction. -3. Submit the transaction to the ledger. -4. List the NFTs associated with your account. -5. Request transaction details and updates to your account. -6. Disconnect from the server. - - -```js -//*************************** -//** Mint Token ************* -//*************************** - -``` - - - -1. Create a wallet and client, then connect to the developer network. - - -```js -async function mintToken() { - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new - xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") - -``` - - - -2. Create a `NFTokenMint` transaction using your account address and the `URI` to your token data. Note that you must convert the token `URI` to a hexadecimal value for this transaction. The `NFTokenTaxon` is a required field, but if you are not using the value as a custom indexing field, you can set it to 0. - - -```js - const transactionBlob = { - TransactionType: "NFTokenMint", - Account: wallet.classicAddress, - URI: xrpl.convertStringToHex(tokenUrl.value), - Flags: parseInt(flags.value), - NFTokenTaxon: 0 - } - -``` - - - -3. Submit the signed transaction blob and wait for the response. - - -```js - const tx = await client.submitAndWait(transactionBlob,{wallet}) - -``` - - - -4. Send an `account_nfts` request to list all `NFTokens` for your account. - - -```js - const nfts = await client.request({ - method: "account_nfts", - account: wallet.classicAddress - }) - console.log(nfts) - -``` - - - -5. Request the transaction results and updates to the account balance. - - -``` - console.log("Transaction result:", tx.result.meta.TransactionResult) - console.log("Balance changes:", - JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)) - -``` - - - -6. `Disconnect` - - -```js - client.disconnect() -} //End of mintToken -``` - - - -## The `account_nfts` Request - -Use the `account_nfts` request to list the `NFTokens` on your account’s `NFTokenPage`. - -To request a list of NFTokens for your account: - - - -1. In the appropriate fields, enter your **Account** and **Secret** credentials. -2. Click **Get Tokens**. -3. Expand the results in your console log. - - -### The `getTokens()`Function - -The `getTokens` function steps are: - - - -1. Connect to the devnet server. -2. Send an `account_nfts` request. -3. Display the results in your console log. -4. Disconnect from the server. - - -```js -//*************************** -//** Get Tokens ************* -//*************************** - -``` - - - -1. Connect to the devnet server. - - -```js -async function getTokens() { - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") - -``` - - - -2. Request `account_nfts` for your wallet account. - - -```js - const nfts = await client.request({ - method: "account_nfts", - account: wallet.classicAddress - }) - -``` - - - -3. Display the results in your console log. - - -```js - console.log(nfts) -``` - - - -4. Disconnect from the server. - - -```js - client.disconnect() -} //End of getTokens -``` - - - -## The `NFTokenBurn` Transaction - -Use `NFTokenBurn` to permanently destroy a `NFToken`. In practice, the `NFToken` is transferred to an account that is inaccessible, rendering it irretrievable. - -To destroy a `NFToken`: - - - -1. Enter your **Account** and **Secret** in the appropriate fields. -2. Enter the **Token ID** of the `NFToken` you want to destroy. -3. Click **Burn Token**. - - -### The `burnToken()` function - -The `burnToken` function steps are: - - - -1. Connect to the devnet server. -2. Prepare a transaction blob. -3. Submit the transaction and wait for the results. -4. Request a refreshed list of current `NFTokens`. -5. Display the results in your console log. -6. Disconnect from the server. - - -```js -//*************************** -//** Burn Token ************* -//*************************** - -``` - - - -1. Connect to the devnet server - - -```js -async function burnToken() { - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") - -``` - - - -2. Prepare the `NFTokenBurn` transaction. - - -```js - const transactionBlob = { - "TransactionType": "NFTokenBurn", - "Account": wallet.classicAddress, - "NFTokenID": nftokenId.value - } - -``` - - - -3. Submit the transaction and wait for the results. - - -```js - const tx = await client.submitAndWait(transactionBlob,{wallet}) -``` - - - -4. Request a refreshed list of the current `NFTokens`, if any. - - -```js - const nfts = await client.request({ - method: "account_nfts", - account: wallet.classicAddress - }) -``` - - - -5. Display the results in your console log. - - -```js - console.log(nfts) - console.log("Transaction result:", tx.result.meta.TransactionResult) - console.log("Balance changes:", - JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)) -``` - - - -6. Disconnect from the server. - - -```js - client.disconnect() -} -// End of burnToken() -``` - - - -## The `NFTokenCreateOffer` Transaction - -You use `NFTokenCreateOffer` to offer `NFTokens` for sale or to propose a purchase of a `NFToken` from another account. The same transaction is used for the `createSellOffer` and `createBuyOffer` functions. - - -### The `createSellOffer()` function - -The `createSellOffer`() function adds an item to the ledger placing a `NFToken` from your account up for sale. Other accounts can discover the offer and choose to accept the transaction to purchase your item. - -To create an offer to sell a `NFToken`: - - - -1. Enter your **Account** and **Secret** in the appropriate fields. -2. Enter the **NFToken ID** of the NFToken you want to sell. -3. Set the **Flags** value to 1. -4. Enter the **Amount**, the sale price in drops (millionths of an xrp). For example, if you enter 1000000, the sale price is 1 xrp. -5. Click **Create Sell Offer**. -6. Expand the results in the console log to see your Sell Offer ledger entry. - -The `createSellOffer()` function steps are: - - - -1. Connect to the devnet server. -2. Prepare a transaction blob. -3. Submit the transaction and wait for the results. -4. Request lists of current Sell Offers and Buy Offers. -5. Display the results in your console log. -6. Disconnect from the server. - - -```js -//******************************** -//** Create Sell Offer *********** -//******************************** - -``` - - - -1. Connect to the devnet server. - - -```js -async function createSellOffer() { - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") -``` - - - -2. Prepare a transaction blob. - - -```js - const transactionBlob = { - "TransactionType": "NFTokenCreateOffer", - "Account": wallet.classicAddress, - "NFTokenID": nftokenId.value, - "Amount": amount.value, - "Flags": parseInt(flags.value) - } -``` - - - -3. Submit the transaction and wait for the results. - - -```js - const tx = await client.submitAndWait(transactionBlob,{wallet}) - -``` - - - -4. Request lists of current Sell Offers and Buy Offers. Note that these requests must go in `Try/Catch` blocks: otherwise, If either the Buy offers or Sell offers are empty for the `NFToken`, the script fails with an error. - - -```js - console.log("***Sell Offers***") - let nftSellOffers - try { - nftSellOffers = await client.request({ - method: "nft_sell_offers", - nft_id: nftokenId.value - }) - } catch (err) { - console.log("No sell offers.") - } - console.log(JSON.stringify(nftSellOffers,null,2)) - console.log("***Buy Offers***") - let nftBuyOffers - try { - nftBuyOffers = await client.request({ - method: "nft_buy_offers", - nft_id: nftokenId.value }) - } catch (err) { - console.log("No buy offers.") - } - console.log(JSON.stringify(nftBuyOffers,null,2)) - -``` - - - -5. Display the results in your console log. - - -```js - console.log("Transaction result:", - JSON.stringify(tx.result.meta.TransactionResult, null, 2)) - console.log("Balance changes:", - JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)) - -``` - - - -6. Disconnect from the server. - - -```js - client.disconnect() - // End of createSellOffer() -} -``` - - - -### The `createBuyOffer()` function - -The `createBuyOffer() `function adds an item to the ledger where your account requests to purchase a `NFToken` for a proposed price. The owner of the `NFToken` can review your proposal and choose to accept it, completing the transaction. - -To create an offer to buy a `NFToken`: - - - -1. Enter your **Account** and **Secret** in the appropriate fields. -2. Set the **Flags** value to `0`. -3. Enter the **NFToken ID** of the `NFToken` you want to purchase. -4. Enter your proposed purchase **Amount** in drops (millionths of an xrp). -5. Enter the **Owner** account address. -6. Click **Create Buy Offer**. -7. Expand the results in the console log to see your Buy Offer ledger entry. - -The `createBuyOffer()` function steps are: - - - -1. Connect to the nft-devnet server. -2. Prepare a transaction blob. -3. Submit the transaction and wait for the results. -4. Request lists of current Sell Offers and Buy Offers. -5. Display the results in your console log. -6. Disconnect from the server. - - -```js -//******************************** -//** Create Buy Offer *********** -//******************************** - -``` - - - -1. Connect to the nft-devnet server. - - -```js -async function createBuyOffer() { - - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") - -``` - - - -2. Prepare a transaction blob. - - -```js - const transactionBlob = { - "TransactionType": "NFTokenCreateOffer", - "Account": wallet.classicAddress, - "Owner": owner.value, - "NFTokenID": nftokenId.value, - "Amount": amount.value, - "Flags": parseInt(flags.value) - } -``` - - - -3. Submit the transaction and wait for the results. - - -```js - const tx = await client.submitAndWait(transactionBlob,{wallet}) - -``` - - - -4. Request lists of current Sell Offers and Buy Offers. - - -```js - console.log("***Sell Offers***") - let nftSellOffers - try { - nftSellOffers = await client.request({ - method: "nft_sell_offers", - tokenid: nftokenId.value - }) - } catch (err) { - console.log("No sell offers.") - } - console.log(JSON.stringify(nftSellOffers,null,2)) - console.log("***Buy Offers***") - let nftBuyOffers - try { - nftBuyOffers = await client.request({ - method: "nft_buy_offers", - tokenid: nftokenId.value }) - } catch (err) { - console.log("No buy offers.") - } - console.log(JSON.stringify(nftBuyOffers,null,2)) - -``` - - - -5. Display the results in your console log. - - -```js - console.log("Transaction result:", - JSON.stringify(tx.result.meta.TransactionResult, null, 2)) - console.log("Balance changes:", - JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)) - -``` - - - -6. Disconnect from the server. - - -```js - client.disconnect() - // End of createBuyOffer() -} -``` - - - -## The `nft_sell_offers` and `nft_buy_offers` Requests - -Use the `nft_sell_offers` and `nft_buy_offers` requests to get the current lists of offers associated with a NFToken. - -To create an offer to buy a `NFToken`: - - - -1. Enter your **Account** and **Secret** in the appropriate fields. -2. Enter the **NFToken ID** of the `NFToken` you want to list. -3. Click **Get Offers**. - -The `getOffers()` function steps are: - - - -1. Connect to the nft-devnet server. -2. Request `nft_sell_offers` and `nft_buy_offers` for your wallet account and send the results to your console log. -3. Disconnect from the server. - - -```js -//*************************** -//** Get Offers ************* -//*************************** - -async function getOffers() { - -``` - - - -1. Enter your **Account** and **Secret** in the appropriate fields. - - -```js - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") - -``` - - - -2. Request `nft_sell_offers` and `nft_buy_offers` for your wallet account and send the results to your console log. - - -```js - console.log("***Sell Offers***") - let nftSellOffers - try { - nftSellOffers = await client.request({ - method: "nft_sell_offers", - tokenid: nftokenId.value - }) - } catch (err) { - console.log("No sell offers.") - } - console.log(JSON.stringify(nftSellOffers,null,2)) - console.log("***Buy Offers***") - let nftBuyOffers - try { - nftBuyOffers = await client.request({ - method: "nft_buy_offers", - tokenid: nftokenId.value - }) - } catch (err) { - console.log("No buy offers.") - } - console.log(JSON.stringify(nftBuyOffers,null,2)) - -``` - - - -3. Disconnect from the server. - - -```js - client.disconnect() - // End of getOffers() -} -``` - - - -## The `NFTokenCancelOffer` Transaction - -Use the `NFTokenCancelOffer` transaction to remove an offer from the ledger. - -To cancel an offer to sell or buy a `NFToken`: - - - -1. Enter your **Account** and **Secret** in the appropriate fields. -2. Enter the **NFToken Offer Index** of the offer you want to cancel. (Labeled as nft_offer_index in the responses to `nft_buy_offers `and` nft_sell_offers` requests.) -3. Click **Cancel Offer**. - - -### The `cancelOffer()` Function - -The `cancelOffer()` function steps are: - - - -1. Connect to the nft-devnet server. -2. Prepare a transaction blob. -3. Submit the transaction and wait for the results. -4. Request lists of current Sell Offers and Buy Offers. -5. Display the results in your console log. -6. Disconnect from the server. - - -```js -//*************************** -//** Cancel Offer *********** -//*************************** - -``` - - - -1. Connect to the nft-devnet server. - - -```js -async function cancelOffer() { - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") - -``` - - - -2. Prepare a transaction blob. The tokenID argument requires an array rather than a single string. - - -```js - const tokenOfferID = nftokenOfferIndex.value - const tokenOffers = [tokenOfferID] - - const transactionBlob = { - "TransactionType": "NFTokenCancelOffer", - "Account": wallet.classicAddress, - "NFTokenOffers": tokenOffers - } - -``` - - - -3. Submit the transaction and wait for the results. - - -```js - const tx = await client.submitAndWait(transactionBlob,{wallet}) - -``` - - - -4. Request lists of current Sell Offers and Buy Offers. - - -```js - console.log("***Sell Offers***") - let nftSellOffers - try { - nftSellOffers = await client.request({ - method: "nft_sell_offers", - tokenid: nftokenId.value - }) - } catch (err) { - console.log("No sell offers.") - } - console.log(JSON.stringify(nftSellOffers,null,2)) - console.log("***Buy Offers***") - let nftBuyOffers - try { - nftBuyOffers = await client.request({ - method: "nft_buy_offers", - tokenid: nftokenId.value }) - } catch (err) { - console.log("No buy offers.") - } - -``` - - - -5. Display the results in your console log. - - -```js - console.log(JSON.stringify(nftBuyOffers,null,2)) - console.log("Transaction result:", - JSON.stringify(tx.result.meta.TransactionResult, null, 2)) - console.log("Balance changes:", - JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)) - -``` - - - -6. Disconnect from the server. - - -```js - client.disconnect() - // End of cancelOffer() -} -``` - - - -## The `NFTokenAcceptOffer` Transaction - -Use the NFTokenAcceptOffer transaction to accept buy or sell offers from other accounts. - - -### The acceptSellOffer() Function - -Another account on your ledger can create an offer to sell a NFToken. If you agree with the price, you can purchase the NFToken by accepting the sell offer. The transaction completes immediately, debiting your XRP account and crediting the seller account. - -To accept a sell offer: - - - -1. Enter your **Account** and **Secret** in the appropriate fields. -2. Enter the **Token Offer Index** of the offer you want to accept. (Labeled as `nft_offer_index` in the responses to `nft_sell_offers` requests.) -3. Click **Accept Sell Offer**. - -The `acceptSellOffer()` function steps are: - - - -1. Connect to the nft-devnet server. -2. Prepare a transaction blob. -3. Submit the transaction and wait for the results. -4. Display the results in your console log. -5. Disconnect from the server. - - -```js -//*************************** -//** Accept Sell Offer ****** -//*************************** - -``` - - - -1. Connect to the nft-devnet server. - - -```js -async function acceptSellOffer() { - - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") -``` - - - -2. Prepare a transaction blob. - - -```js - const transactionBlob = { - "TransactionType": "NFTokenAcceptOffer", - "Account": wallet.classicAddress, - "SellOffer": nftokenOfferIndex.value, - } -``` - - - -3. Submit the transaction and wait for the results. - - -```js - const tx = await client.submitAndWait(transactionBlob,{wallet}) -``` - - - -4. Display the results in your console log. - - -```js - const nfts = await client.request({ - method: "account_nfts", - account: wallet.classicAddress - }) - console.log(JSON.stringify(nfts,null,2)) - console.log("Transaction result:", - JSON.stringify(tx.result.meta.TransactionResult, null, 2)) - console.log("Balance changes:", - JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)) -``` - - - -6. Disconnect from the server. - - -```js - client.disconnect() - // End of acceptSellOffer() -} -``` - - - -### The `acceptBuyOffer()` Function - -Another account holder can create a buy offer for one of your NFTokens. If you agree with the purchase price offered, you can use the `acceptBuyOffer()` function to complete the transaction. - -To accept a buy offer: - - - -1. Enter your **Account** and **Secret** in the appropriate fields. -2. Enter the **NFToken Offer Index** of the offer you want to accept. (Labeled as `nft_offer_index` in the responses to `nft_sell_offers` requests.) -3. Click **Accept Buy Offer**. - -The `acceptBuyOffer()` function steps are: - - - -1. Connect to the nft-devnet server. -2. Prepare a transaction blob. -3. Submit the transaction and wait for the results. -4. Display the results in your console log. -5. Disconnect from the server. - - -```js -//*************************** -//** Accept Buy Offer ****** -//*************************** - -async function acceptBuyOffer() { - -``` - - - -1. Connect to the nft-devnet server. - - -```js - const wallet = xrpl.Wallet.fromSeed(secret.value) - const client = new xrpl.Client("wss://xls20-sandbox.rippletest.net:51233") - await client.connect() - console.log("Connected to devnet") -``` - - - -2. Prepare a transaction blob. - - -```js - const transactionBlob = { - "TransactionType": "NFTokenAcceptOffer", - "Account": wallet.classicAddress, - "BuyOffer": nftokenOfferIndex.value - } -``` - - - -3. Submit the transaction and wait for the results. - - -```js - const tx = await client.submitAndWait(transactionBlob,{wallet}) -``` - - - -4. Display the results in your console log. - - -```js - const nfts = await client.request({ - method: "account_nfts", - account: wallet.classicAddress - }) - console.log(JSON.stringify(nfts,null,2)) - console.log("Transaction result:", - JSON.stringify(tx.result.meta.TransactionResult, null, 2)) - console.log("Balance changes:", - JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)) -``` - - - -5. Disconnect from the server. - - -```js - client.disconnect() - // End of submitTransaction() -} - -``` - - - -## The NFToken Tester HTML Form - -The remainder of the test harness file creates a standard HTML form with 9 buttons to initiate the form functions and 8 fields to hold the required parameters. - - -```html -NFToken Tester - - -

NFToken Tester

- -

-   -   -   -

-

-   -   - -

-

-   -   -   -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Account
Secret
NFToken URL -
Flags
NFToken ID
Amount
NFToken Offer Index
Owner
-
- - -``` - - -## See Also - -- **Concepts:** - - [NFT Conceptual Overview](nft-conceptual-overview.html) -- **Developer Tools:** - - [NFT-Devnet Network Explorer by RippleX](https://nft-devnet.xrpl.org/) - - [NFT-Devnet Network Explorer by Bithomp](https://xls20.bithomp.com/explorer/) - - [Test XRP Faucet](xrp-testnet-faucet.html) - - [NFT-Devnet Faucet by Bithomp](https://xls20.bithomp.com/faucet/) -- **References:** - - [NFTokenOffer object](nftokenoffer.html) - - [NFTokenPage object](nftokenpage.html) - - [NFTokenAcceptOffer transaction](nftokenacceptoffer.html) - - [NFTokenBurn transaction](nftokenburn.html) - - [NFTokenCancelOffer transaction](nftokencanceloffer.html) - - [NFTokenCreateOffer transaction](nftokencreateoffer.html) - - [NFTokenMint transaction](nftokenmint.html) - - - -{% include '_snippets/rippled-api-links.md' %} -{% include '_snippets/tx-type-links.md' %} -{% include '_snippets/rippled_versions.md' %} diff --git a/dactyl-config.yml b/dactyl-config.yml index 589dbd1f78..345040f8c3 100644 --- a/dactyl-config.yml +++ b/dactyl-config.yml @@ -1595,12 +1595,6 @@ pages: - en - ja - # TODO: translate - - md: tutorials/use-tokens/nftoken-tester-tutorial.md - targets: - - en - - ja - # TODO: translate this page & blurb - md: tutorials/use-tokens/enable-no-freeze.md targets: diff --git a/img/nftokentester1.png b/img/nftokentester1.png deleted file mode 100644 index 0040acb16a..0000000000 Binary files a/img/nftokentester1.png and /dev/null differ diff --git a/img/nftokentester2.png b/img/nftokentester2.png deleted file mode 100644 index 921346993d..0000000000 Binary files a/img/nftokentester2.png and /dev/null differ diff --git a/img/quickstart1.png b/img/quickstart1.png index 4fbd881096..f8ff06a598 100644 Binary files a/img/quickstart1.png and b/img/quickstart1.png differ diff --git a/img/quickstart10.png b/img/quickstart10.png index eaaa1ebdc2..04d222423c 100644 Binary files a/img/quickstart10.png and b/img/quickstart10.png differ diff --git a/img/quickstart11.png b/img/quickstart11.png index 728be3681d..fe27adaf21 100644 Binary files a/img/quickstart11.png and b/img/quickstart11.png differ diff --git a/img/quickstart12.png b/img/quickstart12.png index 133b2029ba..cf6388b416 100644 Binary files a/img/quickstart12.png and b/img/quickstart12.png differ diff --git a/img/quickstart13.png b/img/quickstart13.png index 604b384211..f6a8232be1 100644 Binary files a/img/quickstart13.png and b/img/quickstart13.png differ diff --git a/img/quickstart14.png b/img/quickstart14.png index d614846e26..3bb26b975b 100644 Binary files a/img/quickstart14.png and b/img/quickstart14.png differ diff --git a/img/quickstart15.png b/img/quickstart15.png index ab5a2015de..0b1c42722c 100644 Binary files a/img/quickstart15.png and b/img/quickstart15.png differ diff --git a/img/quickstart16.png b/img/quickstart16.png index c481b19f2c..e4b361c7c9 100644 Binary files a/img/quickstart16.png and b/img/quickstart16.png differ diff --git a/img/quickstart17.png b/img/quickstart17.png index 019a927fb4..b14652a9dd 100644 Binary files a/img/quickstart17.png and b/img/quickstart17.png differ diff --git a/img/quickstart18.png b/img/quickstart18.png index 6498a669e7..4b0958ceec 100644 Binary files a/img/quickstart18.png and b/img/quickstart18.png differ diff --git a/img/quickstart19.png b/img/quickstart19.png index 08a74ef695..f4dcbddde0 100644 Binary files a/img/quickstart19.png and b/img/quickstart19.png differ diff --git a/img/quickstart2.png b/img/quickstart2.png index 5c2a568247..531a67954d 100644 Binary files a/img/quickstart2.png and b/img/quickstart2.png differ diff --git a/img/quickstart20.png b/img/quickstart20.png index 177bbdde58..e36d121c70 100644 Binary files a/img/quickstart20.png and b/img/quickstart20.png differ diff --git a/img/quickstart21.png b/img/quickstart21.png index 3ba8d91904..2c4bcc8eb8 100644 Binary files a/img/quickstart21.png and b/img/quickstart21.png differ diff --git a/img/quickstart22.png b/img/quickstart22.png index 840f1dbddf..ae10d2959a 100644 Binary files a/img/quickstart22.png and b/img/quickstart22.png differ diff --git a/img/quickstart23.png b/img/quickstart23.png index 99a318d321..b77a445d3b 100644 Binary files a/img/quickstart23.png and b/img/quickstart23.png differ diff --git a/img/quickstart24.png b/img/quickstart24.png index f8f559c9e9..9dad362c10 100644 Binary files a/img/quickstart24.png and b/img/quickstart24.png differ diff --git a/img/quickstart25.png b/img/quickstart25.png index 0fa1bcbeeb..a04cb23556 100644 Binary files a/img/quickstart25.png and b/img/quickstart25.png differ diff --git a/img/quickstart26.png b/img/quickstart26.png index 7e23026627..757cbf7a36 100644 Binary files a/img/quickstart26.png and b/img/quickstart26.png differ diff --git a/img/quickstart27.png b/img/quickstart27.png index e22bfbe2fe..26301ed6d3 100644 Binary files a/img/quickstart27.png and b/img/quickstart27.png differ diff --git a/img/quickstart28.png b/img/quickstart28.png index 9e855c06ed..9cfb5efb25 100644 Binary files a/img/quickstart28.png and b/img/quickstart28.png differ diff --git a/img/quickstart29.png b/img/quickstart29.png index 5be484f996..019d668d0a 100644 Binary files a/img/quickstart29.png and b/img/quickstart29.png differ diff --git a/img/quickstart3.png b/img/quickstart3.png index 31217103a7..63beced880 100644 Binary files a/img/quickstart3.png and b/img/quickstart3.png differ diff --git a/img/quickstart30.png b/img/quickstart30.png index 8ca4aca11c..2dc4f33a23 100644 Binary files a/img/quickstart30.png and b/img/quickstart30.png differ diff --git a/img/quickstart31.png b/img/quickstart31.png index a6725f1d6a..f74cbe437c 100644 Binary files a/img/quickstart31.png and b/img/quickstart31.png differ diff --git a/img/quickstart4.png b/img/quickstart4.png index d6b7857b0d..b381d5ca2f 100644 Binary files a/img/quickstart4.png and b/img/quickstart4.png differ diff --git a/img/quickstart5.png b/img/quickstart5.png index 8e6a85a01a..eef4349512 100644 Binary files a/img/quickstart5.png and b/img/quickstart5.png differ diff --git a/img/quickstart6.png b/img/quickstart6.png index 5ba2b2a801..6049449a2f 100644 Binary files a/img/quickstart6.png and b/img/quickstart6.png differ diff --git a/img/quickstart7.png b/img/quickstart7.png index cd729239f4..cfc7e3f0ab 100644 Binary files a/img/quickstart7.png and b/img/quickstart7.png differ diff --git a/img/quickstart8.png b/img/quickstart8.png index 5c1a8a8b4c..fd6dae66c4 100644 Binary files a/img/quickstart8.png and b/img/quickstart8.png differ diff --git a/img/quickstart9.png b/img/quickstart9.png index f54f9e801c..93a3019e14 100644 Binary files a/img/quickstart9.png and b/img/quickstart9.png differ diff --git a/template/page-docs.html.jinja b/template/page-docs.html.jinja index ba00f4dc9b..a5b50c61d0 100644 --- a/template/page-docs.html.jinja +++ b/template/page-docs.html.jinja @@ -101,7 +101,6 @@