mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-27 07:05:51 +00:00
Migrate content syntax via script
The changes in this commit were auto-generated by running tool/migrate.sh Following this commit, the Dactyl build no longer works but the Redocly build (mostly) should.
This commit is contained in:
@@ -17,7 +17,7 @@ This example shows how to:
|
||||
1. Authorize an account to create NFTs for your account.
|
||||
2. Mint an NFT for another account, when authorized.
|
||||
|
||||
[](img/quickstart28.png)
|
||||
[](/img/quickstart28.png)
|
||||
|
||||
# Usage
|
||||
|
||||
@@ -42,7 +42,7 @@ To authorize another account to create NFTs for your account:
|
||||
2. Paste the **Operational Account** value in the **Authorized Minter** field.
|
||||
3. Click **Set Minter**.
|
||||
|
||||
[](img/quickstart29.png)
|
||||
[](/img/quickstart29.png)
|
||||
|
||||
## Mint an NFT for Another Account
|
||||
|
||||
@@ -61,7 +61,7 @@ To mint a non-fungible token for another account:
|
||||
5. Paste the **Standby Account** value in the Operational account **Issuer** field.
|
||||
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 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.
|
||||
|
||||
@@ -77,7 +77,7 @@ To create an NFT 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
|
||||
|
||||
@@ -90,7 +90,7 @@ To accept an available 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.
|
||||
[](img/quickstart32.png)
|
||||
[](/img/quickstart32.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -208,7 +208,7 @@ Report success
|
||||
standbyResultField.value = results
|
||||
```
|
||||
|
||||
This transaction blob is the same as the one used for the previous [`mintToken()` function](mint-and-burn-nfts-using-javascript.html#mint-token), with the addition of the `Issuer` field.
|
||||
This transaction blob is the same as the one used for the previous [`mintToken()` function](mint-and-burn-nfts-using-javascript.md#mint-token), with the addition of the `Issuer` field.
|
||||
|
||||
```javascript
|
||||
const tx_json = {
|
||||
@@ -514,25 +514,25 @@ Update the form with fields and buttons to support the new functions.
|
||||
<td><input type="text" id="standbyOwnerField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Authorized Minter</td>
|
||||
<td><input type="text" id="standbyMinterField" value="" size="80"/></td>
|
||||
<td align="right">Authorized Minter</td>
|
||||
<td><input type="text" id="standbyMinterField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Issuer</td>
|
||||
<td><input type="text" id="standbyIssuerField" value="" size="80"/></td>
|
||||
<td align="right">Issuer</td>
|
||||
<td><input type="text" id="standbyIssuerField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Destination</td>
|
||||
<td><input type="text" id="standbyDestinationField" value="" size="80"/></td>
|
||||
<td align="right">Destination</td>
|
||||
<td><input type="text" id="standbyDestinationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Expiration</td>
|
||||
<td><input type="text" id="standbyExpirationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="standbyTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Expiration</td>
|
||||
<td><input type="text" id="standbyExpirationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="standbyTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p align="left">
|
||||
<textarea id="standbyResultField" cols="80" rows="20" ></textarea>
|
||||
@@ -715,25 +715,25 @@ Update the form with fields and buttons to support the new functions.
|
||||
<td><input type="text" id="operationalOwnerField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Authorized Minter</td>
|
||||
<td><input type="text" id="operationalMinterField" value="" size="80"/></td>
|
||||
<td align="right">Authorized Minter</td>
|
||||
<td><input type="text" id="operationalMinterField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Issuer</td>
|
||||
<td><input type="text" id="operationalIssuerField" value="" size="80"/></td>
|
||||
<td align="right">Issuer</td>
|
||||
<td><input type="text" id="operationalIssuerField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Destination</td>
|
||||
<td><input type="text" id="operationalDestinationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Expiration</td>
|
||||
<td><input type="text" id="operationalExpirationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="operationalTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Destination</td>
|
||||
<td><input type="text" id="operationalDestinationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Expiration</td>
|
||||
<td><input type="text" id="operationalExpirationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="operationalTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p align="right">
|
||||
<textarea id="operationalResultField" cols="80" rows="20" ></textarea>
|
||||
|
||||
@@ -14,7 +14,7 @@ You can create an application that mints multiple NFTs at one time. You can use
|
||||
|
||||
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 any individual failures afterward.
|
||||
|
||||
[](img/quickstart33-batch-mint.png)
|
||||
[](/img/quickstart33-batch-mint.png)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -41,7 +41,7 @@ This example lets you mint multiple NFTs for a single unique item. The NFT might
|
||||
|
||||
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 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.
|
||||
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](../../references/protocol/transactions/types/nftokenmint.md) 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 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 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 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.
|
||||
@@ -68,42 +68,42 @@ async function getAccountFromSeed() {
|
||||
Connect to the XRP Ledger.
|
||||
|
||||
```javascript
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
standbyResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected, finding wallets.\n'
|
||||
standbyResultField.value = results
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
standbyResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected, finding wallets.\n'
|
||||
standbyResultField.value = results
|
||||
```
|
||||
|
||||
Use the seed to derive the account.
|
||||
|
||||
```javascript
|
||||
var theSeed = seeds.value
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(theSeed)
|
||||
var theSeed = seeds.value
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(theSeed)
|
||||
```
|
||||
|
||||
Get the current XRP balance.
|
||||
|
||||
```javascript
|
||||
```javascript
|
||||
const standby_balance = (await client.getXrpBalance(standby_wallet.address))
|
||||
```
|
||||
```
|
||||
|
||||
Populate the fields for Standby account.
|
||||
|
||||
```javascript
|
||||
standbyAccountField.value = standby_wallet.address
|
||||
standbyPubKeyField.value = standby_wallet.publicKey
|
||||
standbyPrivKeyField.value = standby_wallet.privateKey
|
||||
standbySeedField.value = standby_wallet.seed
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
standbyAccountField.value = standby_wallet.address
|
||||
standbyPubKeyField.value = standby_wallet.publicKey
|
||||
standbyPrivKeyField.value = standby_wallet.privateKey
|
||||
standbySeedField.value = standby_wallet.seed
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
```
|
||||
|
||||
Disconnect from the XRP Ledger.
|
||||
|
||||
```javascript
|
||||
client.disconnect()
|
||||
client.disconnect()
|
||||
}
|
||||
```
|
||||
|
||||
@@ -268,28 +268,28 @@ Use a `for` loop to create the NFTs one at a time, up to the number you specifie
|
||||
|
||||
```javascript
|
||||
for (let i=0; i < nftCount; i++) {
|
||||
const transactionBlob = {
|
||||
"TransactionType": "NFTokenMint",
|
||||
"Account": standby_wallet.classicAddress,
|
||||
"URI": xrpl.convertStringToHex(standbyTokenUrlField.value),
|
||||
"Flags": parseInt(standbyFlagsField.value),
|
||||
"TransferFee": parseInt(standbyTransferFeeField.value),
|
||||
"Sequence": 0,
|
||||
const transactionBlob = {
|
||||
"TransactionType": "NFTokenMint",
|
||||
"Account": standby_wallet.classicAddress,
|
||||
"URI": xrpl.convertStringToHex(standbyTokenUrlField.value),
|
||||
"Flags": parseInt(standbyFlagsField.value),
|
||||
"TransferFee": parseInt(standbyTransferFeeField.value),
|
||||
"Sequence": 0,
|
||||
```
|
||||
|
||||
Use the loop variable to step through the array. Set the `LastLedgerSequence` to `null`.
|
||||
|
||||
```javascript
|
||||
"TicketSequence": tickets[i],
|
||||
"LastLedgerSequence": null,
|
||||
"NFTokenTaxon": 0
|
||||
}
|
||||
"TicketSequence": tickets[i],
|
||||
"LastLedgerSequence": null,
|
||||
"NFTokenTaxon": 0
|
||||
}
|
||||
```
|
||||
|
||||
Submit the signed transaction hash.
|
||||
|
||||
```javascript
|
||||
const tx = client.submit(transactionBlob, { wallet: standby_wallet} )
|
||||
const tx = client.submit(transactionBlob, { wallet: standby_wallet} )
|
||||
}
|
||||
```
|
||||
|
||||
@@ -306,12 +306,12 @@ Use the same logic as `getBatchNFTs`, above, to get the list of current NFTs.
|
||||
results += JSON.stringify(nfts,null,2)
|
||||
while (nfts.result.marker)
|
||||
{
|
||||
nfts = await client.request({
|
||||
method: "account_nfts",
|
||||
account: standby_wallet.classicAddress,
|
||||
limit: 400,
|
||||
marker: nfts.result.marker
|
||||
})
|
||||
nfts = await client.request({
|
||||
method: "account_nfts",
|
||||
account: standby_wallet.classicAddress,
|
||||
limit: 400,
|
||||
marker: nfts.result.marker
|
||||
})
|
||||
results += '\n' + JSON.stringify(nfts,null,2)
|
||||
}
|
||||
```
|
||||
@@ -319,10 +319,10 @@ Use the same logic as `getBatchNFTs`, above, to get the list of current NFTs.
|
||||
Report the results.
|
||||
|
||||
```javascript
|
||||
results += '\n\nTransaction result: '+ tx.result.meta.TransactionResult
|
||||
results += '\n\nnfts: ' + JSON.stringify(nfts, null, 2)
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
standbyResultField.value = results
|
||||
results += '\n\nTransaction result: '+ tx.result.meta.TransactionResult
|
||||
results += '\n\nnfts: ' + JSON.stringify(nfts, null, 2)
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
standbyResultField.value = results
|
||||
```
|
||||
|
||||
Disconnect from the XRP Ledger.
|
||||
@@ -384,109 +384,109 @@ For this form:
|
||||
<br/>
|
||||
<textarea id="seeds" cols="40" rows= "1" maxlength="524,288"></textarea>
|
||||
<br/><br/>
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<button type="button" onClick="getAccount('standby')">Get New Standby Account</button>
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td align="right">
|
||||
Standby Account
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyAccountField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Public Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyPubKeyField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Private Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyPrivKeyField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Seed
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbySeedField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
XRP Balance
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyBalanceField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td><button type="button" onClick="configureAccount('standby',document.querySelector('#standbyDefault').checked)">Configure Account</button></td>
|
||||
<td>
|
||||
<input type="checkbox" id="standbyDefault" checked="true"/>
|
||||
<label for="standbyDefault">Allow Rippling</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Currency
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyCurrencyField" size="40" value="USD"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">NFT URL</td>
|
||||
<td><input type="text" id="standbyTokenUrlField"
|
||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Flags</td>
|
||||
<td><input type="text" id="standbyFlagsField" value="8" size="10"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">NFT ID</td>
|
||||
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
NFT Count
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyNFTCountField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="standbyTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
<button type="button" onClick="batchMint()">Batch Mint</button>
|
||||
<br/>
|
||||
<button type="button" onClick="getBatchNFTs()">Get Batch NFTs</button>
|
||||
<br/>
|
||||
<p align="left">
|
||||
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<button type="button" onClick="getAccount('standby')">Get New Standby Account</button>
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td align="right">
|
||||
Standby Account
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyAccountField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Public Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyPubKeyField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Private Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyPrivKeyField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Seed
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbySeedField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
XRP Balance
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyBalanceField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td><button type="button" onClick="configureAccount('standby',document.querySelector('#standbyDefault').checked)">Configure Account</button></td>
|
||||
<td>
|
||||
<input type="checkbox" id="standbyDefault" checked="true"/>
|
||||
<label for="standbyDefault">Allow Rippling</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Currency
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyCurrencyField" size="40" value="USD"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">NFT URL</td>
|
||||
<td><input type="text" id="standbyTokenUrlField"
|
||||
value = "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi" size="80"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Flags</td>
|
||||
<td><input type="text" id="standbyFlagsField" value="8" size="10"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">NFT ID</td>
|
||||
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
NFT Count
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="standbyNFTCountField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="standbyTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
<button type="button" onClick="batchMint()">Batch Mint</button>
|
||||
<br/>
|
||||
<button type="button" onClick="getBatchNFTs()">Get Batch NFTs</button>
|
||||
<br/>
|
||||
<p align="left">
|
||||
|
||||
<!-- Note the increased maxlength to hold the most possible NFT info. -->
|
||||
|
||||
<textarea id="standbyResultField" cols="80" rows="20" maxlength="524288"></textarea>
|
||||
|
||||
@@ -20,7 +20,7 @@ This example shows how to:
|
||||
2. Get a list of offers for the brokered item.
|
||||
3. Broker a sale between two different accounts.
|
||||
|
||||
[](img/quickstart21.png)
|
||||
[](/img/quickstart21.png)
|
||||
|
||||
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/){.github-code-download} archive to try each of the samples in your own browser.
|
||||
|
||||
@@ -37,7 +37,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
2. Click **Get New Operational Account**.
|
||||
3. Click **Get New Broker Account**
|
||||
|
||||
[](img/quickstart22.png)
|
||||
[](/img/quickstart22.png)
|
||||
|
||||
## Prepare a Brokered Transaction
|
||||
|
||||
@@ -46,31 +46,31 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
</div>
|
||||
|
||||
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).
|
||||
2. Set the **Flags** field to _1_.
|
||||
3. Enter the **NFT ID** of the NFT you want to sell.
|
||||
4. Optionally, enter a number of days until **Expiration**.
|
||||
5. Enter the Broker account number as the **Destination**.
|
||||
6. Click **Create Sell Offer**.
|
||||
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
||||
2. Set the **Flags** field to _1_.
|
||||
3. Enter the **NFT ID** of the NFT you want to sell.
|
||||
4. Optionally, enter a number of days until **Expiration**.
|
||||
5. Enter the Broker account number as the **Destination**.
|
||||
6. Click **Create Sell Offer**.
|
||||
|
||||
|
||||
[](img/quickstart23.png)
|
||||
[](/img/quickstart23.png)
|
||||
|
||||
2. Use the Operational account to create an NFT Buy Offer.
|
||||
1. Enter the **Amount** of your offer.
|
||||
2. Enter the **NFT ID**.
|
||||
3. Enter the owner’s account string in the **Owner** field.
|
||||
4. Optionally enter the number of days until **Expiration**.
|
||||
5. Click **Create Buy Offer**.
|
||||
1. Enter the **Amount** of your offer.
|
||||
2. Enter the **NFT ID**.
|
||||
3. Enter the owner’s account string in the **Owner** field.
|
||||
4. Optionally enter the number of days until **Expiration**.
|
||||
5. Click **Create Buy Offer**.
|
||||
|
||||
[](img/quickstart24.png)
|
||||
[](/img/quickstart24.png)
|
||||
|
||||
## Get Offers
|
||||
|
||||
1. Enter the **NFT ID**.
|
||||
2. Click **Get Offers**.
|
||||
|
||||
[](img/quickstart25.png)
|
||||
[](/img/quickstart25.png)
|
||||
|
||||
## Broker the Sale
|
||||
|
||||
@@ -79,7 +79,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
3. Enter a **Broker Fee**, in drops.
|
||||
4. Click **Broker Sale**.
|
||||
|
||||
[](img/quickstart26.png)
|
||||
[](/img/quickstart26.png)
|
||||
|
||||
|
||||
## Cancel Offer
|
||||
@@ -89,7 +89,7 @@ After accepting a buy offer, a best practice for the broker is to cancel all oth
|
||||
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**.
|
||||
|
||||
[](img/quickstart27.png)
|
||||
[](/img/quickstart27.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -119,7 +119,7 @@ Connect to the ledger.
|
||||
brokerResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected. Getting offers...'
|
||||
brokerResultField.value = results
|
||||
brokerResultField.value = results
|
||||
```
|
||||
|
||||
Request the list of sell offers for the token.
|
||||
@@ -136,7 +136,7 @@ Request the list of sell offers for the token.
|
||||
nftSellOffers = 'No sell offers.'
|
||||
}
|
||||
results += JSON.stringify(nftSellOffers,null,2)
|
||||
brokerResultField.value = results
|
||||
brokerResultField.value = results
|
||||
```
|
||||
|
||||
Request the list of buy offers for the token.
|
||||
@@ -153,7 +153,7 @@ Request the list of buy offers for the token.
|
||||
nftBuyOffers = 'No buy offers.'
|
||||
}
|
||||
results += JSON.stringify(nftBuyOffers,null,2)
|
||||
brokerResultField.value = results
|
||||
brokerResultField.value = results
|
||||
```
|
||||
|
||||
Disconnect from the ledger.
|
||||
@@ -172,16 +172,16 @@ async function brokerSale() {
|
||||
Connect to the ledger and get the accounts.
|
||||
|
||||
```javascript
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
const broker_wallet = xrpl.Wallet.fromSeed (brokerSeedField.value)
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '...'
|
||||
brokerResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected. Brokering sale...'
|
||||
brokerResultField.value = results
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
const broker_wallet = xrpl.Wallet.fromSeed (brokerSeedField.value)
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '...'
|
||||
brokerResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected. Brokering sale...'
|
||||
brokerResultField.value = results
|
||||
```
|
||||
|
||||
Prepare the transaction. The difference between a brokered sale and a direct sale is that you provide both a sell offer and a buy offer, with an agreed-upon broker's fee.
|
||||
@@ -205,14 +205,14 @@ Prepare the transaction. The difference between a brokered sale and a direct sal
|
||||
Report the results.
|
||||
|
||||
```javascript
|
||||
results += "\n\nTransaction result:\n" +
|
||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||
results += "\nBalance changes:\n" +
|
||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
brokerBalanceField.value = (await client.getXrpBalance(broker_wallet.address))
|
||||
brokerResultField.value = results
|
||||
results += "\n\nTransaction result:\n" +
|
||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||
results += "\nBalance changes:\n" +
|
||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
brokerBalanceField.value = (await client.getXrpBalance(broker_wallet.address))
|
||||
brokerResultField.value = results
|
||||
```
|
||||
|
||||
Disconnect from the ledger.
|
||||
@@ -237,9 +237,9 @@ Get the broker account and connect to the ledger.
|
||||
|
||||
```javascript
|
||||
const wallet = xrpl.Wallet.fromSeed(brokerSeedField.value)
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '...'
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '...'
|
||||
brokerResultField.value = results
|
||||
await client.connect()
|
||||
results += "\nConnected. Cancelling offer..."
|
||||
@@ -456,13 +456,13 @@ async function getAccountsFromSeeds() {
|
||||
Connect to the ledger.
|
||||
|
||||
```javascript
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
standbyResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected, finding wallets.\n'
|
||||
standbyResultField.value = results
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
standbyResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected, finding wallets.\n'
|
||||
standbyResultField.value = results
|
||||
```
|
||||
|
||||
Use the `split` function to parse the values from the **Seeds** field.
|
||||
@@ -490,23 +490,23 @@ Get the XRP balances for the accounts.
|
||||
Populate the form fields based on the account values.
|
||||
|
||||
```javascript
|
||||
standbyAccountField.value = standby_wallet.address
|
||||
standbyPubKeyField.value = standby_wallet.publicKey
|
||||
standbyPrivKeyField.value = standby_wallet.privateKey
|
||||
standbySeedField.value = standby_wallet.seed
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
standbyAccountField.value = standby_wallet.address
|
||||
standbyPubKeyField.value = standby_wallet.publicKey
|
||||
standbyPrivKeyField.value = standby_wallet.privateKey
|
||||
standbySeedField.value = standby_wallet.seed
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
|
||||
operationalAccountField.value = operational_wallet.address
|
||||
operationalPubKeyField.value = operational_wallet.publicKey
|
||||
operationalPrivKeyField.value = operational_wallet.privateKey
|
||||
operationalSeedField.value = operational_wallet.seed
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
operationalAccountField.value = operational_wallet.address
|
||||
operationalPubKeyField.value = operational_wallet.publicKey
|
||||
operationalPrivKeyField.value = operational_wallet.privateKey
|
||||
operationalSeedField.value = operational_wallet.seed
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
|
||||
brokerAccountField.value = broker_wallet.address
|
||||
brokerPubKeyField.value = broker_wallet.publicKey
|
||||
brokerPrivKeyField.value = broker_wallet.privateKey
|
||||
brokerSeedField.value = broker_wallet.seed
|
||||
brokerBalanceField.value = (await client.getXrpBalance(broker_wallet.address))
|
||||
brokerAccountField.value = broker_wallet.address
|
||||
brokerPubKeyField.value = broker_wallet.publicKey
|
||||
brokerPrivKeyField.value = broker_wallet.privateKey
|
||||
brokerSeedField.value = broker_wallet.seed
|
||||
brokerBalanceField.value = (await client.getXrpBalance(broker_wallet.address))
|
||||
```
|
||||
|
||||
Disconnect from the ledger.
|
||||
@@ -519,7 +519,7 @@ Use the `getBalances()` function to get the current balances of fiat currency.
|
||||
|
||||
```javascript
|
||||
getBalances()
|
||||
|
||||
|
||||
} // End of getAccountsFromSeeds()
|
||||
```
|
||||
|
||||
@@ -661,93 +661,93 @@ Revise the HTML form to add a new Broker section at the top.
|
||||
<br/>
|
||||
<textarea id="seeds" cols="40" rows= "3"></textarea>
|
||||
<br/><br/>
|
||||
<table align="center">
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<button type="button" onClick="getAccount('broker')">Get New Broker Account</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right">
|
||||
Broker Account
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerAccountField" size="40"></input>
|
||||
<button type="button" id="another" onclick="brokerSale()">Broker Sale</button>
|
||||
</td>
|
||||
<td rowspan="7">
|
||||
<textarea id="brokerResultField" cols="40" rows="12"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Public Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerPubKeyField" size="40"></input>
|
||||
<table align="center">
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<button type="button" onClick="getAccount('broker')">Get New Broker Account</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right">
|
||||
Broker Account
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerAccountField" size="40"></input>
|
||||
<button type="button" id="another" onclick="brokerSale()">Broker Sale</button>
|
||||
</td>
|
||||
<td rowspan="7">
|
||||
<textarea id="brokerResultField" cols="40" rows="12"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Public Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerPubKeyField" size="40"></input>
|
||||
<button type="button" onClick="brGetOffers()">Get Offers</button>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Private Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerPrivKeyField" size="40"></input>
|
||||
<button type="button" onClick="brCancelOffer()">Cancel Offer</button>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Seed
|
||||
<br>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerSeedField" size="40"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
XRP Balance
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerBalanceField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Amount
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerAmountField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">NFT ID</td>
|
||||
<td><input type="text" id="brokerTokenIdField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Sell NFT Offer Index</td>
|
||||
<td><input type="text" id="brokerTokenSellOfferIndexField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Buy NFT Offer Index</td>
|
||||
<td><input type="text" id="brokerTokenBuyOfferIndexField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Owner</td>
|
||||
<td><input type="text" id="brokerOwnerField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Broker Fee</td>
|
||||
<td><input type="text" id="brokerBrokerFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/><br/>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Private Key
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerPrivKeyField" size="40"></input>
|
||||
<button type="button" onClick="brCancelOffer()">Cancel Offer</button>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Seed
|
||||
<br>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerSeedField" size="40"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
XRP Balance
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerBalanceField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
Amount
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="brokerAmountField" size="40"></input>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">NFT ID</td>
|
||||
<td><input type="text" id="brokerTokenIdField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Sell NFT Offer Index</td>
|
||||
<td><input type="text" id="brokerTokenSellOfferIndexField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Buy NFT Offer Index</td>
|
||||
<td><input type="text" id="brokerTokenBuyOfferIndexField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Owner</td>
|
||||
<td><input type="text" id="brokerOwnerField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Broker Fee</td>
|
||||
<td><input type="text" id="brokerBrokerFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/><br/>
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
@@ -1033,14 +1033,14 @@ Revise the HTML form to add a new Broker section at the top.
|
||||
<td align="right">Owner</td>
|
||||
<td><input type="text" id="operationalOwnerField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<td align="right">Destination</td>
|
||||
<td><input type="text" id="operationalDestinationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Expiration</td>
|
||||
<td><input type="text" id="operationalExpirationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<td><input type="text" id="operationalDestinationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Expiration</td>
|
||||
<td><input type="text" id="operationalExpirationField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="operationalTransferFeeField" value="" size="80"/></td>
|
||||
|
||||
@@ -18,14 +18,14 @@ This example shows how to:
|
||||
|
||||
When you create an account, you receive a public/private key pair offline. Your account 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.
|
||||
|
||||
[](img/quickstart2.png)
|
||||
[](/img/quickstart2.png)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To get started, create a new folder on your local disk and install the JavaScript library using `npm`.
|
||||
|
||||
```
|
||||
npm install xrpl
|
||||
npm install xrpl
|
||||
```
|
||||
|
||||
Download and expand the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/){.github-code-download} archive.
|
||||
@@ -46,7 +46,7 @@ To get test accounts:
|
||||
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.
|
||||
|
||||
[](img/quickstart3.png)
|
||||
[](/img/quickstart3.png)
|
||||
|
||||
You can transfer XRP between your new accounts. Each account has its own fields and buttons.
|
||||
|
||||
@@ -66,7 +66,7 @@ To transfer XRP from the Operational account to the Standby account:
|
||||
2. Copy and paste the **Standby Account** field to the Operational **Destination** field.
|
||||
3. Click **<Send XRP** to transfer XRP from the Operational account to the Standby account.
|
||||
|
||||
[](img/quickstart4.png)
|
||||
[](/img/quickstart4.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -326,13 +326,13 @@ The _Payment_ transaction expects the XRP to be expressed in drops, or 1/million
|
||||
Sign the prepared transaction.
|
||||
|
||||
```
|
||||
const signed = standby_wallet.sign(prepared)
|
||||
const signed = standby_wallet.sign(prepared)
|
||||
```
|
||||
|
||||
Submit the transaction and wait for the results.
|
||||
|
||||
```
|
||||
const tx = await client.submitAndWait(signed.tx_blob)
|
||||
const tx = await client.submitAndWait(signed.tx_blob)
|
||||
```
|
||||
|
||||
Request the balance changes caused by the transaction and report the results.
|
||||
|
||||
@@ -18,7 +18,7 @@ This example shows how to:
|
||||
|
||||
3. Cancel a conditional escrow transaction.
|
||||
|
||||
[](img/conditional-escrow1.png)
|
||||
[](/img/conditional-escrow1.png)
|
||||
|
||||
|
||||
## Prerequisites
|
||||
@@ -42,7 +42,7 @@ To create a condition/fulfillment pair:
|
||||
2. Enter the command `node getConditionAndFulfillment.js`.
|
||||
3. Copy and save the generated Condition and Fulfillment pair.
|
||||
|
||||
[](img/conditional-escrow2.png)
|
||||
[](/img/conditional-escrow2.png)
|
||||
|
||||
To get test accounts:
|
||||
|
||||
@@ -56,7 +56,7 @@ To get test accounts:
|
||||
1. Click **Get New Standby Account**.
|
||||
2. Click **Get New Operational Account**.
|
||||
|
||||
[](img/conditional-escrow3.png)
|
||||
[](/img/conditional-escrow3.png)
|
||||
|
||||
### Create Conditional Escrow:
|
||||
|
||||
@@ -80,7 +80,7 @@ The escrow is created on the XRP Ledger instance, reserving your requested XRP a
|
||||
|
||||
When you create an escrow, capture and save the _Sequence Number_ so that you can use it to finish the escrow transaction.
|
||||
|
||||
[](img/conditional-escrow4.png)
|
||||
[](/img/conditional-escrow4.png)
|
||||
|
||||
## Finish Conditional Escrow
|
||||
|
||||
@@ -94,7 +94,7 @@ To finish a time-based escrow:
|
||||
|
||||
The transaction completes and balances are updated for both the Standby and Operational accounts.
|
||||
|
||||
[](img/conditional-escrow5.png)
|
||||
[](/img/conditional-escrow5.png)
|
||||
|
||||
## Get Escrows
|
||||
|
||||
@@ -111,12 +111,12 @@ If you forget to save the sequence number, you can find it in the escrow transac
|
||||
1. Create a new escrow as described in [Create Escrow](#create-escrow), above.
|
||||
2. Click **Get Escrows** to get the escrow information.
|
||||
3. Copy the _PreviousTxnID_ value from the results.
|
||||

|
||||

|
||||
4. Paste the _PreviousTxnID_ in the **Transaction to Look Up** field.
|
||||

|
||||

|
||||
5. Click **Get Transaction**.
|
||||
6. Locate the _Sequence_ value in the results.
|
||||

|
||||

|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -662,4 +662,3 @@ Disconnect from the XRPL.
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ This example shows how to:
|
||||
3. Cancel an escrow payment and return the XRP to the sending account.
|
||||
|
||||
|
||||
[](img/quickstart-escrow1.png)
|
||||
[](/img/quickstart-escrow1.png)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -39,7 +39,7 @@ To get test accounts:
|
||||
1. Click **Get New Standby Account**.
|
||||
2. Click **Get New Operational Account**.
|
||||
|
||||
[](img/quickstart-escrow2.png)
|
||||
[](/img/quickstart-escrow2.png)
|
||||
|
||||
## Create Escrow
|
||||
|
||||
@@ -61,7 +61,7 @@ To create a time-based escrow:
|
||||
|
||||
The escrow is created on the XRP Ledger instance, reserving 100 XRP plus the transaction cost. When you create an escrow, capture and save the **Sequence Number** so that you can use it to finish the escrow transaction.
|
||||
|
||||
[](img/quickstart-escrow3.png)
|
||||
[](/img/quickstart-escrow3.png)
|
||||
|
||||
## Finish Escrow
|
||||
|
||||
@@ -74,7 +74,7 @@ To finish a time-based escrow:
|
||||
|
||||
The transaction completes and balances are updated for both the Standby and Operational accounts.
|
||||
|
||||
[](img/quickstart-escrow4.png)
|
||||
[](/img/quickstart-escrow4.png)
|
||||
|
||||
## Get Escrows
|
||||
|
||||
@@ -84,7 +84,7 @@ For the purposes of this tutorial, follow the steps in [Create Escrow](#create-e
|
||||
|
||||
Click **Get Escrows** for both the Standby and the Operational account. The `account_info` request returns the same `account_object` for both accounts, demonstrating the link between the accounts created by the escrow transaction.
|
||||
|
||||
[](img/quickstart-escrow5.png)
|
||||
[](/img/quickstart-escrow5.png)
|
||||
|
||||
|
||||
## Cancel Escrow
|
||||
@@ -100,7 +100,7 @@ To cancel an expired escrow:
|
||||
|
||||
The funds are returned to the Standby account, less the initial transaction fee.
|
||||
|
||||
[](img/quickstart-escrow6.png)
|
||||
[](/img/quickstart-escrow6.png)
|
||||
|
||||
## Oh No! I Forgot to Save the Sequence Number!
|
||||
|
||||
@@ -109,12 +109,12 @@ If you forget to save the sequence number, you can find it in the escrow transac
|
||||
1. Create a new escrow as described in [Create Escrow](#create-escrow), above.
|
||||
2. Click **Get Escrows** to get the escrow information.
|
||||
3. Copy the _PreviousTxnID_ value from the results.
|
||||

|
||||

|
||||
4. Paste the _PreviousTxnID_ in the **Transaction to Look Up** field.
|
||||

|
||||

|
||||
5. Click **Get Transaction**.
|
||||
6. Locate the _Sequence_ value in the results.
|
||||

|
||||

|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -826,4 +826,3 @@ Disconnect from the XRP Ledger instance.
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ This example shows how to:
|
||||
4. Send issued currency between accounts.
|
||||
5. Display account balances for all currencies.
|
||||
|
||||
[](img/quickstart5.png)
|
||||
[](/img/quickstart5.png)
|
||||
|
||||
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/){.github-code-download} archive to try each of the samples in your own browser.
|
||||
|
||||
@@ -51,7 +51,7 @@ To create a trust line between accounts:
|
||||
3. Enter the destination account value in the **Destination** field.
|
||||
4. Click **Create Trustline**. <!-- SPELLING_IGNORE: trustline --><!--{# TODO: update the test harness to spell trust line as two words #}-->
|
||||
|
||||
[](img/quickstart6.png)
|
||||
[](/img/quickstart6.png)
|
||||
|
||||
## Send an Issued Currency Token
|
||||
|
||||
@@ -62,7 +62,7 @@ To transfer an issued currency token, once you have created a trust line:
|
||||
3. Enter the **Currency** type.
|
||||
4. Click **Send Currency**.
|
||||
|
||||
[](img/quickstart7.png)
|
||||
[](/img/quickstart7.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -97,14 +97,14 @@ Connect to the ledger
|
||||
Get the account wallets.
|
||||
|
||||
```
|
||||
if (type=='standby') {
|
||||
my_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
} else {
|
||||
my_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
resultField = 'operationalResultField'
|
||||
}
|
||||
results += '\nRipple Default Setting: ' + defaultRippleSetting
|
||||
resultField.value = results
|
||||
if (type=='standby') {
|
||||
my_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
} else {
|
||||
my_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
resultField = 'operationalResultField'
|
||||
}
|
||||
results += '\nRipple Default Setting: ' + defaultRippleSetting
|
||||
resultField.value = results
|
||||
```
|
||||
|
||||
Prepare the transaction. If the `rippleDefault` argument is true, set the `asfDefaultRipple` flag. If it is false, clear the `asfDefaultRipple` flag.
|
||||
@@ -806,4 +806,4 @@ Update the form to support the new functions.
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
```
|
||||
|
||||
@@ -15,7 +15,7 @@ This example shows how to:
|
||||
2. Get a list of existing NFTs.
|
||||
3. Delete (Burn) an NFT.
|
||||
|
||||
[](img/quickstart8.png)
|
||||
[](/img/quickstart8.png)
|
||||
|
||||
# Usage
|
||||
|
||||
@@ -32,7 +32,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
1. Click **Get New Standby Account**.
|
||||
2. Click **Get New Operational Account**.
|
||||
|
||||
[](img/quickstart9.png)
|
||||
[](/img/quickstart9.png)
|
||||
|
||||
## Mint an NFT
|
||||
|
||||
@@ -42,19 +42,19 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
|
||||
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 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.
|
||||
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](../../references/protocol/transactions/types/nftokenmint.md) 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 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 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 NFT**.
|
||||
|
||||
[](img/quickstart10.png)
|
||||
[](/img/quickstart10.png)
|
||||
|
||||
|
||||
## Get Tokens
|
||||
|
||||
Click **Get NFTs** to get a list of NFTs owned by the account.
|
||||
|
||||
[](img/quickstart11.png)
|
||||
[](/img/quickstart11.png)
|
||||
|
||||
## Burn a Token
|
||||
|
||||
@@ -65,7 +65,7 @@ To permanently destroy an NFT:
|
||||
1. Enter the **Token ID**.
|
||||
2. Click **Burn NFT**.
|
||||
|
||||
[](img/quickstart12.png)
|
||||
[](/img/quickstart12.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -531,10 +531,10 @@ async function oPburnToken() {
|
||||
<td align="right">NFT ID</td>
|
||||
<td><input type="text" id="standbyTokenIdField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="standbyTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="standbyTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p align="left">
|
||||
<textarea id="standbyResultField" cols="80" rows="20" ></textarea>
|
||||
@@ -688,7 +688,7 @@ async function oPburnToken() {
|
||||
<td align="right">Transfer Fee</td>
|
||||
<td><input type="text" id="operationalTransferFeeField" value="" size="80"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
<p align="right">
|
||||
<textarea id="operationalResultField" cols="80" rows="20" ></textarea>
|
||||
</p>
|
||||
|
||||
@@ -18,7 +18,7 @@ This example shows how to:
|
||||
1. Authorize an account to create NFTs for your account.
|
||||
2. Mint an NFT for another account, when authorized.
|
||||
|
||||
[](img/quickstart-py30.png)
|
||||
[](/img/quickstart-py30.png)
|
||||
|
||||
# Usage
|
||||
|
||||
@@ -53,7 +53,7 @@ To authorize another account to create NFTs for your account (for example, allow
|
||||
2. Paste the **Operational Account** value in the standby **Authorized Minter** field.
|
||||
3. Click **Set Minter**.
|
||||
|
||||
[](img/quickstart-py31.png)
|
||||
[](/img/quickstart-py31.png)
|
||||
|
||||
## Mint an NFT for Another Account
|
||||
|
||||
@@ -69,7 +69,7 @@ To mint a non-fungible token for another account:
|
||||
5. Paste the **Standby Account** value in the Operational account **Issuer** field.
|
||||
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 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.
|
||||
|
||||
@@ -85,7 +85,7 @@ To create a NFT 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
|
||||
|
||||
@@ -99,11 +99,11 @@ To accept an available sell offer:
|
||||
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**.
|
||||
|
||||
[](img/quickstart-py34.png)
|
||||
[](/img/quickstart-py34.png)
|
||||
|
||||
The Buyer account was debited the 100 XRP price plus 10 drops as the transaction cost. The Seller (Authorized Minter) account is credited 90 XRP. the Issuer and the Seller can divide the proceeds per their agreement in a separate transaction. The original Standby account receives a transfer fee of 10 XRP.
|
||||
|
||||
[](img/quickstart-py35.png)
|
||||
[](/img/quickstart-py35.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ You can create an application that mints multiple NFTs at one time, using a `for
|
||||
|
||||
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 any individual failures afterward.
|
||||
|
||||
[](img/quickstart-py36.png)
|
||||
[](/img/quickstart-py36.png)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -43,7 +43,7 @@ This example lets you mint multiple NFTs for a single unique item. The NFT might
|
||||
To batch mint non-fungible token objects:
|
||||
|
||||
1. Enter the **NFT URI**. This is a URI that points to the data or metadata associated with the NFT object. You can use this sample URI if you do not have one of your own: ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi.
|
||||
2. 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 available NFT minting flags.
|
||||
2. 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](../../references/protocol/transactions/types/nftokenmint.md) for available NFT minting flags.
|
||||
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 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.
|
||||
4. Enter the **Taxon** for the NFT. If you do not have a need for the Taxon field, set this value to 0.
|
||||
5. Enter an **NFT Count** of up to 200 NFTs to create in one batch.
|
||||
@@ -88,14 +88,14 @@ Get the account wallet and a client instance.
|
||||
|
||||
Request the full account info.
|
||||
|
||||
```python
|
||||
```python
|
||||
acct_info = xrpl.models.requests.account_info.AccountInfo(
|
||||
account=wallet.classic_address,
|
||||
ledger_index='validated'
|
||||
)
|
||||
get_seq_request = client.request(acct_info)
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
Parse the current sequence value.
|
||||
|
||||
@@ -386,4 +386,4 @@ btn_standby_get_batch_nfts.grid(row=8, column=2, sticky = "nsew")
|
||||
# Start the application
|
||||
window.mainloop()
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
@@ -21,7 +21,7 @@ This example shows how to:
|
||||
2. Get a list of offers for the brokered item.
|
||||
3. Broker a sale between two different accounts.
|
||||
|
||||
[](img/quickstart-py23.png)
|
||||
[](/img/quickstart-py23.png)
|
||||
|
||||
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/py/){.github-code-download} archive to try each of the samples in your own browser.
|
||||
|
||||
@@ -44,7 +44,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
4. Click **Get Standby Account Info**.
|
||||
5. Click **Get Operational Account Info**.
|
||||
|
||||
[](img/quickstart-py24.png)
|
||||
[](/img/quickstart-py24.png)
|
||||
|
||||
## Prepare a Brokered Transaction
|
||||
|
||||
@@ -53,31 +53,31 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
</div>
|
||||
|
||||
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).
|
||||
2. Enter the **NFT ID** of the NFT you want to sell.
|
||||
3. Optionally, enter a number of seconds until **Expiration**.
|
||||
4. Enter the Broker account number as the **Destination**.
|
||||
5. Click **Create Sell Offer**.
|
||||
6. Click **Get Offers** to see the new offer.
|
||||
1. Enter the **Amount** of the sell offer in drops (millionths of an XRP).
|
||||
2. Enter the **NFT ID** of the NFT you want to sell.
|
||||
3. Optionally, enter a number of seconds until **Expiration**.
|
||||
4. Enter the Broker account number as the **Destination**.
|
||||
5. Click **Create Sell Offer**.
|
||||
6. Click **Get Offers** to see the new offer.
|
||||
|
||||
|
||||
[](img/quickstart25.png)
|
||||
[](/img/quickstart25.png)
|
||||
|
||||
2. Use the Operational account to create a NFT Buy Offer.
|
||||
1. Enter the **Amount** of your offer.
|
||||
2. Enter the **NFT ID**.
|
||||
3. Enter the owner’s account string in the **Owner** field.
|
||||
4. Optionally enter the number of seconds until **Expiration**.
|
||||
5. Click **Create Buy Offer**.
|
||||
1. Enter the **Amount** of your offer.
|
||||
2. Enter the **NFT ID**.
|
||||
3. Enter the owner’s account string in the **Owner** field.
|
||||
4. Optionally enter the number of seconds until **Expiration**.
|
||||
5. Click **Create Buy Offer**.
|
||||
|
||||
[](img/quickstart-py26.png)
|
||||
[](/img/quickstart-py26.png)
|
||||
|
||||
## Get Offers
|
||||
|
||||
1. Enter the **NFT ID**.
|
||||
2. Click **Get Offers**.
|
||||
|
||||
[](img/quickstart-py27.png)
|
||||
[](/img/quickstart-py27.png)
|
||||
|
||||
## Broker the Sale
|
||||
|
||||
@@ -86,7 +86,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
3. Enter a **Broker Fee**, in drops.
|
||||
4. Click **Broker Sale**.
|
||||
|
||||
[](img/quickstart-py28.png)
|
||||
[](/img/quickstart-py28.png)
|
||||
|
||||
|
||||
## Cancel Offer
|
||||
@@ -96,7 +96,7 @@ After accepting a buy offer, a best practice for the broker is to cancel all oth
|
||||
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**.
|
||||
|
||||
[](img/quickstart-py29.png)
|
||||
[](/img/quickstart-py29.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -879,4 +879,4 @@ btn_op_cancel_offer.grid(row=16, column=3, sticky="nsew")
|
||||
|
||||
# Start the application
|
||||
window.mainloop()
|
||||
```x
|
||||
```x
|
||||
|
||||
@@ -18,14 +18,14 @@ This example shows how to:
|
||||
|
||||
When you create an account, you receive a public/private key pair offline. Your account 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.
|
||||
|
||||
[](img/quickstart-py2.png)
|
||||
[](/img/quickstart-py2.png)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To get started, create a new folder on your local disk and install the Python library using `pip`.
|
||||
|
||||
```
|
||||
pip3 install xrpl-py
|
||||
pip3 install xrpl-py
|
||||
```
|
||||
|
||||
Download and expand the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/py/){.github-code-download} archive.
|
||||
@@ -47,7 +47,7 @@ To get test accounts:
|
||||
5. Click **Get Operational Account Info**.
|
||||
5. Copy and paste the **Standby Seed** and **Operational Seed** fields to a persistent location, such as a Notepad, so that you can reuse the accounts after reloading the form.
|
||||
|
||||
[](img/quickstart-py3.png)
|
||||
[](/img/quickstart-py3.png)
|
||||
|
||||
You can transfer XRP between your new accounts. Each account has its own fields and buttons.
|
||||
|
||||
@@ -61,7 +61,7 @@ To transfer XRP from the Standby account to the Operational account:
|
||||
2. Copy and paste the **Operational Account** field to the Standby **Destination** field.
|
||||
3. Click **Send XRP>** to transfer XRP from the standby account to the operational account
|
||||
|
||||
[](img/quickstart-py4.png)
|
||||
[](/img/quickstart-py4.png)
|
||||
|
||||
To transfer XRP from the Operational account to the Standby account:
|
||||
|
||||
@@ -182,9 +182,9 @@ Create a transaction request, passing the sending account, amount, and destinati
|
||||
Submit the transaction and return the response. If the transaction fails, return the error message.
|
||||
|
||||
```python
|
||||
try:
|
||||
response = xrpl.transaction.submit_and_wait(payment, client, sending_wallet)
|
||||
except xrpl.transaction.XRPLReliableSubmissionException as e:
|
||||
try:
|
||||
response = xrpl.transaction.submit_and_wait(payment, client, sending_wallet)
|
||||
except xrpl.transaction.XRPLReliableSubmissionException as e:
|
||||
response = f"Submit failed: {e}"
|
||||
return response
|
||||
```
|
||||
@@ -203,7 +203,7 @@ import json
|
||||
|
||||
Import the methods from mod1.py.
|
||||
|
||||
```python
|
||||
```python
|
||||
from .mod1 import get_account, get_account_info, send_xrp
|
||||
```
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ This example shows how to:
|
||||
|
||||
3. Cancel a conditional escrow transaction.
|
||||
|
||||
[](img/quickstart-py-conditional-escrow-1.png)
|
||||
[](/img/quickstart-py-conditional-escrow-1.png)
|
||||
|
||||
|
||||
## Prerequisites
|
||||
@@ -54,13 +54,13 @@ To get test accounts:
|
||||
3. Click **Get Operational Account**.
|
||||
4. Click **Get Op Account Info**.
|
||||
|
||||
[](img/quickstart-py-conditional-escrow-2.png)
|
||||
[](/img/quickstart-py-conditional-escrow-2.png)
|
||||
|
||||
#### Get a Condition and Fulfillment
|
||||
|
||||
Click **Get Condition** to generate a condition/fulfillment pair and populate the fields on the form. You can copy the values and store them in a text file for safe keeping.
|
||||
|
||||
[](img/quickstart-py-conditional-escrow-3.png)
|
||||
[](/img/quickstart-py-conditional-escrow-3.png)
|
||||
|
||||
### Create Conditional Escrow
|
||||
|
||||
@@ -83,7 +83,7 @@ The escrow is created on the XRP Ledger instance, reserving your requested XRP a
|
||||
|
||||
When you create an escrow, capture and save the _Sequence Number_ so that you can use it to finish the escrow transaction.
|
||||
|
||||
[](img/quickstart-py-conditional-escrow-4.png)
|
||||
[](/img/quickstart-py-conditional-escrow-4.png)
|
||||
|
||||
## Finish Conditional Escrow
|
||||
|
||||
@@ -100,7 +100,7 @@ To finish a conditional escrow:
|
||||
|
||||
The transaction completes and balances are updated for both the Standby and Operational accounts.
|
||||
|
||||
[](img/quickstart-py-conditional-escrow-5.png)
|
||||
[](/img/quickstart-py-conditional-escrow-5.png)
|
||||
|
||||
## Get Escrows
|
||||
|
||||
@@ -117,13 +117,13 @@ If you forget to save the sequence number, you can find it in the escrow transac
|
||||
1. Create a new escrow as described in [Create Conditional Escrow](#create-conditional-escrow), above.
|
||||
2. Click **Get Escrows** to get the escrow information.
|
||||
3. Copy the _PreviousTxnLgrSeq_ value from the results.
|
||||

|
||||

|
||||
4. Paste the _PreviousTxnLgrSeq_ in the **Transaction to Look Up** field.
|
||||

|
||||

|
||||
5. Click **Get Transaction**.
|
||||
6. Locate the _Sequence_ value in the results.
|
||||
|
||||

|
||||

|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -605,4 +605,3 @@ btn_op_get_transaction.grid(row = 6, column = 3, sticky = "nsew")
|
||||
# Start the application
|
||||
window.mainloop()
|
||||
```
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ This example shows how to:
|
||||
3. Cancel an escrow payment and return the XRP to the sending account.
|
||||
|
||||
|
||||
[](img/quickstart-py-escrow1.png)
|
||||
[](/img/quickstart-py-escrow1.png)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -44,7 +44,7 @@ To get test accounts:
|
||||
3. Click **Get Operational Account**.
|
||||
4. Click **Get Op Account Info**.
|
||||
|
||||
[](img/quickstart-py-escrow2.png)
|
||||
[](/img/quickstart-py-escrow2.png)
|
||||
|
||||
## Create Escrow
|
||||
|
||||
@@ -66,7 +66,7 @@ To create a time-based escrow:
|
||||
|
||||
The escrow is created on the XRP Ledger instance, reserving 100 XRP plus the transaction cost and reserve requirements. When you create an escrow, capture and save the **Sequence Number** so that you can use it to finish the escrow transaction.
|
||||
|
||||
[](img/quickstart-py-escrow3.png)
|
||||
[](/img/quickstart-py-escrow3.png)
|
||||
|
||||
## Finish Escrow
|
||||
|
||||
@@ -80,7 +80,7 @@ To finish a time-based escrow:
|
||||
|
||||
The transaction completes and balances are updated for both the Standby and Operational accounts.
|
||||
|
||||
[](img/quickstart-py-escrow4.png)
|
||||
[](/img/quickstart-py-escrow4.png)
|
||||
|
||||
## Get Escrows
|
||||
|
||||
@@ -88,7 +88,7 @@ Click **Get Escrows** to see the current list of escrows for the Operational acc
|
||||
|
||||
For the purposes of this tutorial, you can follow the steps in [Create Escrow](#create-escrow), above, to create a new escrow transaction that you can then look up. Remember to capture the _Sequence Number_ from the transaction results.
|
||||
|
||||
[](img/quickstart-py-escrow5.png)
|
||||
[](/img/quickstart-py-escrow5.png)
|
||||
|
||||
|
||||
## Cancel Escrow
|
||||
@@ -105,7 +105,7 @@ To cancel an expired escrow:
|
||||
|
||||
The funds are returned to the Standby account, less the initial transaction fee.
|
||||
|
||||
[](img/quickstart-py-escrow6.png)
|
||||
[](/img/quickstart-py-escrow6.png)
|
||||
|
||||
## Oh No! I Forgot to Save the Sequence Number!
|
||||
|
||||
@@ -114,11 +114,11 @@ If you forget to save the sequence number, you can find it in the escrow transac
|
||||
1. Create a new escrow as described in [Create Escrow](#create-escrow), above.
|
||||
2. Click **Get Escrows** to get the escrow information.
|
||||
3. Copy the _PreviousTxnLgrSeq_ value from the results.
|
||||

|
||||

|
||||
4. Paste the _PreviousTxnLgrSeq_ in the **Transaction to Look Up** field.
|
||||
5. Click **Get Transaction**.
|
||||
6. Locate the _Sequence_ value in the results.
|
||||

|
||||

|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -634,4 +634,4 @@ btn_op_get_transaction.grid(row = 6, column = 3, sticky = "nsew")
|
||||
|
||||
# Start the application
|
||||
window.mainloop()
|
||||
```
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ This example shows how to:
|
||||
4. Send issued currency between accounts.
|
||||
5. Display account balances for all currencies.
|
||||
|
||||
[](img/quickstart-py5.png)
|
||||
[](/img/quickstart-py5.png)
|
||||
|
||||
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/py/){.github-code-download} archive to try each of the samples in your own browser.
|
||||
|
||||
@@ -51,7 +51,7 @@ To create a trust line between accounts:
|
||||
3. Enter the destination account value in the **Destination** field.
|
||||
4. Click **Create Trust Line**.
|
||||
|
||||
[](img/quickstart-py6.png)
|
||||
[](/img/quickstart-py6.png)
|
||||
|
||||
## Send an Issued Currency Token
|
||||
|
||||
@@ -62,7 +62,7 @@ To transfer an issued currency token, once you have created a trust line:
|
||||
3. Enter the **Currency** type.
|
||||
4. Click **Send Currency**.
|
||||
|
||||
[](img/quickstart-py7.png)
|
||||
[](/img/quickstart-py7.png)
|
||||
|
||||
### Configure Account
|
||||
|
||||
@@ -75,7 +75,7 @@ To enable rippling:
|
||||
|
||||
Verify the setting by looking for the _Set Flag_ value in the response, which should show a flag setting of _8_.
|
||||
|
||||
[](img/quickstart-py8.png)
|
||||
[](/img/quickstart-py8.png)
|
||||
|
||||
To disable rippling:
|
||||
|
||||
@@ -84,7 +84,7 @@ To disable rippling:
|
||||
|
||||
Verify the setting by looking for the _Clear Flag_ value in the response, which shold show a flag setting of _8_.
|
||||
|
||||
[](img/quickstart-py9.png)
|
||||
[](/img/quickstart-py9.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -220,7 +220,7 @@ Return the result.
|
||||
|
||||
### configure_account
|
||||
|
||||
This example shows how to set and clear configuration flags using the `AccountSet` method. The `ASF_DEFAULT_RIPPLE` flag is pertinent to experimentation with transfer of issued currencies to third-party accounts, so it is demonstrated here. You can set any of the configuration flags using the same structure, substituting the particular flags you want to set. See [AccountSet Flags](accountset.html).
|
||||
This example shows how to set and clear configuration flags using the `AccountSet` method. The `ASF_DEFAULT_RIPPLE` flag is pertinent to experimentation with transfer of issued currencies to third-party accounts, so it is demonstrated here. You can set any of the configuration flags using the same structure, substituting the particular flags you want to set. See [AccountSet Flags](../../references/protocol/transactions/types/accountset.md).
|
||||
|
||||
Send the account seed and a Boolean value for whether to enable or disable rippling.
|
||||
```python
|
||||
@@ -576,4 +576,4 @@ btn_op_configure_account.grid(row=7,column=4, sticky = "nsew")
|
||||
|
||||
```python
|
||||
window.mainloop()
|
||||
```
|
||||
```
|
||||
|
||||
@@ -16,7 +16,7 @@ This example shows how to:
|
||||
2. Get a list of existing NFTs.
|
||||
3. Delete (Burn) an NFT.
|
||||
|
||||
[](img/quickstart-py10.png)
|
||||
[](/img/quickstart-py10.png)
|
||||
|
||||
# Usage
|
||||
|
||||
@@ -37,7 +37,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
3. Click **Get Standby Account Info**.
|
||||
4. Click **Get Op Account Info**.
|
||||
|
||||
[](img/quickstart-py11.png)
|
||||
[](/img/quickstart-py11.png)
|
||||
|
||||
## Mint an NFT
|
||||
|
||||
@@ -53,14 +53,14 @@ To mint a non-fungible token object:
|
||||
4. Optionally a **Taxon** value as an integer. If you choose not to use a taxon, enter _0_.
|
||||
4. Click **Mint NFT**.
|
||||
|
||||
[](img/quickstart-py12.png)
|
||||
[](/img/quickstart-py12.png)
|
||||
|
||||
|
||||
## Get Tokens
|
||||
|
||||
Click **Get NFTs** to get a list of NFTs owned by the account.
|
||||
|
||||
[](img/quickstart-py13.png)
|
||||
[](/img/quickstart-py13.png)
|
||||
|
||||
## Burn a Token
|
||||
|
||||
@@ -71,7 +71,7 @@ To permanently destroy an NFT:
|
||||
1. Enter the **Token ID**.
|
||||
2. Click **Burn NFT**.
|
||||
|
||||
[](img/quickstart-py14.png)
|
||||
[](/img/quickstart-py14.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ The XRP Ledger (XRPL) is a robust, secure, customizable service. You can create
|
||||
|
||||
This quickstart describes a test harness interface you can build to try out the XRP Ledger. The test harness displays multiple accounts, so that you can transfer tokens from one account to the other and see the results in real time. The image below shows the Token Test Harness at the completion of step 4.
|
||||
|
||||
[](img/quickstart-py15.png)
|
||||
[](/img/quickstart-py15.png)
|
||||
|
||||
That is a lot of fields and buttons, all working together to perform some significant practical tasks. But getting _started_ with the XRP Ledger is not that complicated. When you eat the elephant a bite at a time, none of the tasks are difficult to consume.
|
||||
|
||||
@@ -49,9 +49,9 @@ There are also expanded lessons demonstrating how to [Broker an NFT Sale](py-bro
|
||||
To get started, create a new folder on your local disk and install the Python library (xrpl-py) using `pip`.
|
||||
|
||||
```
|
||||
pip3 install xrpl-py
|
||||
pip3 install xrpl-py
|
||||
```
|
||||
|
||||
Download the python [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/py/){.github-code-download}.
|
||||
|
||||
**Note:** Without the Quickstart Samples, you will not be able to try the examples that follow.
|
||||
**Note:** Without the Quickstart Samples, you will not be able to try the examples that follow.
|
||||
|
||||
@@ -19,7 +19,7 @@ This example shows how to:
|
||||
5. Get a list of offers for a particular NFT.
|
||||
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/py/){.github-code-download} archive to try each of the samples in your own browser.
|
||||
|
||||
@@ -43,7 +43,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
3. Click **Get Operational Account**.
|
||||
4. Click **Get Get Op Account Info**.
|
||||
|
||||
[](img/quickstart-py16.png)
|
||||
[](/img/quickstart-py16.png)
|
||||
|
||||
## Create a Sell Offer
|
||||
|
||||
@@ -62,7 +62,7 @@ To create a NFT 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
|
||||
|
||||
@@ -75,7 +75,7 @@ To accept an available sell offer:
|
||||
3. Click **Get Standby Account Info** and **Get Op Account Info** to update the XRP balances.
|
||||
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)
|
||||
|
||||
## Create a Buy Offer
|
||||
|
||||
@@ -91,7 +91,7 @@ To create an offer to buy an NFT:
|
||||
6. On the Operational side, enter the **NFT ID**.
|
||||
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
|
||||
|
||||
@@ -102,7 +102,7 @@ To accept an offer to buy an NFT:
|
||||
3. Click **Get Standby Account Info** and **Get Op Account Info** to update the XRP balances.
|
||||
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
|
||||
|
||||
@@ -111,7 +111,7 @@ To list the buy and sell offers associated with an NFT:
|
||||
1. Enter the **NFT ID**.
|
||||
2. Click **Get Offers**.
|
||||
|
||||
[](img/quickstart-py21.png)
|
||||
[](/img/quickstart-py21.png)
|
||||
|
||||
## Cancel Offer
|
||||
|
||||
@@ -120,7 +120,7 @@ To cancel a buy or sell offer that you have created:
|
||||
1. Enter the **NFT Offer Index**.
|
||||
2. Click **Cancel Offer**.
|
||||
|
||||
[](img/quickstart-py22.png)
|
||||
[](/img/quickstart-py22.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
@@ -447,9 +447,9 @@ Define the cancel offer transaction.
|
||||
```python
|
||||
nftSellOffers="No sell offers"
|
||||
cancel_offer_tx=xrpl.models.transactions.NFTokenCancelOffer(
|
||||
account=owner_wallet.classic_address,
|
||||
nftoken_offers=tokenOfferIDs
|
||||
)
|
||||
account=owner_wallet.classic_address,
|
||||
nftoken_offers=tokenOfferIDs
|
||||
)
|
||||
```
|
||||
|
||||
Submit the transaction and return the result.
|
||||
@@ -1020,4 +1020,4 @@ btn_op_cancel_offer.grid(row=16, column=3, sticky="nsew")
|
||||
|
||||
# Start the application
|
||||
window.mainloop()
|
||||
```
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ The XRP Ledger (XRPL) is a robust, secure, customizable service. You can create
|
||||
|
||||
This quickstart describes a test harness interface you can build to try out the XRP Ledger. The test harness displays multiple accounts, so that you can transfer tokens from one account to the other and see the results in real time. The image below shows the Token Test Harness at the completion of step 4.
|
||||
|
||||

|
||||

|
||||
|
||||
That is a lot of fields and buttons, all working together to perform some significant practical tasks. But getting _started_ with the XRP Ledger is not that complicated. When you eat the elephant a bite at a time, none of the tasks are difficult to consume.
|
||||
|
||||
@@ -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.
|
||||
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 NFTs](transfer-nfts-using-javascript.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-using-javascript.md), 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.
|
||||
|
||||
@@ -39,7 +39,7 @@ Much of this is “brute force” code that sacrifices conciseness for readabili
|
||||
To get started, create a new folder on your local disk and install the JavaScript library using `npm`.
|
||||
|
||||
```
|
||||
npm install xrpl
|
||||
npm install xrpl
|
||||
```
|
||||
|
||||
Download and expand the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/){.github-code-download}.
|
||||
|
||||
@@ -17,7 +17,7 @@ The XRP Ledger (XRPL) is a robust, secure, customizable service. You can create
|
||||
|
||||
This quickstart describes a test harness interface you can build to try out the XRP Ledger. The test harness displays multiple accounts, so that you can transfer tokens from one account to the other and see the results in real time. The image below shows the Token Test Harness at the completion of step 4.
|
||||
|
||||
[](img/quickstart-py15.png)
|
||||
[](/img/quickstart-py15.png)
|
||||
|
||||
That is a lot of fields and buttons, all working together to perform some significant practical tasks. But getting _started_ with the XRP Ledger is not that complicated. When you eat the elephant a bite at a time, none of the tasks are difficult to consume.
|
||||
|
||||
@@ -36,12 +36,12 @@ Much of this is “brute force” code that sacrifices conciseness for readabili
|
||||
|
||||
In this quickstart, you can:
|
||||
|
||||
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).
|
||||
3. [Mint and Burn NFTs](py-mint-and-burn-nfts.html).
|
||||
4. [Transfer NFTs](py-transfer-nfts.html).
|
||||
1. [Create Accounts and Send XRP](py-create-accounts-send-xrp.md)
|
||||
2. [Create Trust Line and Send Currency](py-create-trustline-send-currency.md).
|
||||
3. [Mint and Burn NFTs](py-mint-and-burn-nfts.md).
|
||||
4. [Transfer NFTs](py-transfer-nfts.md).
|
||||
|
||||
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).
|
||||
There are also expanded lessons demonstrating how to [Broker an NFT Sale](py-broker-sale.md) and [Assign an Authorized Minter](py-authorize-minter.md).
|
||||
|
||||
|
||||
## Prerequisites
|
||||
@@ -49,9 +49,9 @@ There are also expanded lessons demonstrating how to [Broker an NFT Sale](py-bro
|
||||
To get started, create a new folder on your local disk and install the Python library (xrpl-py) using `pip`.
|
||||
|
||||
```
|
||||
pip3 install xrpl-py
|
||||
pip3 install xrpl-py
|
||||
```
|
||||
|
||||
Download the python [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/py/){.github-code-download}.
|
||||
|
||||
**Note:** Without the Quickstart Samples, you will not be able to try the examples that follow.
|
||||
**Note:** Without the Quickstart Samples, you will not be able to try the examples that follow.
|
||||
|
||||
@@ -18,7 +18,7 @@ This example shows how to:
|
||||
5. Get a list of offers for a particular NFT.
|
||||
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/){.github-code-download} archive to try each of the samples in your own browser.
|
||||
|
||||
@@ -36,7 +36,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port
|
||||
1. Click **Get New Standby Account**.
|
||||
2. Click **Get New Operational Account**.
|
||||
|
||||
[](img/quickstart14.png)
|
||||
[](/img/quickstart14.png)
|
||||
|
||||
## Create a Sell Offer
|
||||
|
||||
@@ -54,7 +54,7 @@ To create a NFT 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
|
||||
|
||||
@@ -65,7 +65,7 @@ To accept an available sell offer:
|
||||
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**.
|
||||
|
||||
[](img/quickstart16.png)
|
||||
[](/img/quickstart16.png)
|
||||
|
||||
## Create a Buy Offer
|
||||
|
||||
@@ -79,7 +79,7 @@ To create an offer to buy a NFT:
|
||||
4. Optionally enter the number of days until **Expiration**.
|
||||
5. Click **Create Buy Offer**.
|
||||
|
||||
[](img/quickstart17.png)
|
||||
[](/img/quickstart17.png)
|
||||
|
||||
## Accept a Buy Offer
|
||||
|
||||
@@ -88,7 +88,7 @@ To accept an offer to buy a NFT:
|
||||
1. Enter the **NFT Offer Index** (the `nft_offer_index` of the NFT buy offer).
|
||||
3. Click **Accept Buy Offer**.
|
||||
|
||||
[](img/quickstart18.png)
|
||||
[](/img/quickstart18.png)
|
||||
|
||||
## Get Offers
|
||||
|
||||
@@ -96,7 +96,7 @@ To list the buy and sell offers associated with a NFT:
|
||||
1. Enter the **NFT ID**.
|
||||
2. Click **Get Offers**.
|
||||
|
||||
[](img/quickstart19.png)
|
||||
[](/img/quickstart19.png)
|
||||
|
||||
## Cancel Offer
|
||||
|
||||
@@ -105,7 +105,7 @@ To cancel a buy or sell offer that you have created:
|
||||
1. Enter the **NFT Offer Index**.
|
||||
2. Click **Cancel Offer**.
|
||||
|
||||
[](img/quickstart20.png)
|
||||
[](/img/quickstart20.png)
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
|
||||
Reference in New Issue
Block a user