mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 12:45:50 +00:00
Merge pull request #1379 from XRPLF/dd-add-nft-methods
Document NFT-related API methods
This commit is contained in:
@@ -50,6 +50,17 @@ Request('account_lines', {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Request('account_nfts', {
|
||||||
|
description: "Retrieves NFTs owned by an account.",
|
||||||
|
link: "account_nfts.html",
|
||||||
|
status: "not_enabled",
|
||||||
|
body: {
|
||||||
|
"command": "account_nfts",
|
||||||
|
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
|
||||||
|
"ledger_index": "validated"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
Request('account_objects', {
|
Request('account_objects', {
|
||||||
description: "Returns the raw ledger format for all objects owned by an account.",
|
description: "Returns the raw ledger format for all objects owned by an account.",
|
||||||
link: "account_objects.html",
|
link: "account_objects.html",
|
||||||
@@ -403,6 +414,28 @@ Request('deposit_authorized', {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Request('nft_buy_offers', {
|
||||||
|
description: "Retrieves offers to buy a given NFT.",
|
||||||
|
link: "nft_buy_offers.html",
|
||||||
|
status: "not_enabled",
|
||||||
|
body: {
|
||||||
|
"command": "nft_buy_offers",
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"ledger_index": "validated"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Request('nft_sell_offers', {
|
||||||
|
description: "Retrieves offers to sell a given NFT.",
|
||||||
|
link: "nft_sell_offers.html",
|
||||||
|
status: "not_enabled",
|
||||||
|
body: {
|
||||||
|
"command": "nft_sell_offers",
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"ledger_index": "validated"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
Request('path_find', {
|
Request('path_find', {
|
||||||
description: "Searches for a path along which a payment can possibly be made, and periodically sends updates when the path changes over time.",
|
description: "Searches for a path along which a payment can possibly be made, and periodically sends updates when the path changes over time.",
|
||||||
link: "path_find.html",
|
link: "path_find.html",
|
||||||
|
|||||||
@@ -51,7 +51,11 @@ function generate_table_of_contents() {
|
|||||||
if (req.slug === null) {
|
if (req.slug === null) {
|
||||||
commandlist.append("<li class='separator'>"+req.name+"</li>");
|
commandlist.append("<li class='separator'>"+req.name+"</li>");
|
||||||
} else {
|
} else {
|
||||||
commandlist.append("<li class='method'><a href='#"+req.slug+"'>"+req.name+"</a></li>");
|
let status_label = ""
|
||||||
|
if (req.status == "not_enabled") {
|
||||||
|
status_label = '<span class="status not_enabled" title="This feature is not currently enabled on the production XRP Ledger."><i class="fa fa-flask"></i></span> '
|
||||||
|
}
|
||||||
|
commandlist.append("<li class='method'><a href='#"+req.slug+"'>"+status_label+req.name+"</a></li>");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -284,7 +288,7 @@ const update_curl = function(event) {
|
|||||||
$("#curl-box-1").text(curl_syntax)
|
$("#curl-box-1").text(curl_syntax)
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_from_permalink(params) {
|
function server_from_params(params) {
|
||||||
const server = params.get("server")
|
const server = params.get("server")
|
||||||
if (server) {
|
if (server) {
|
||||||
const server_checkbox = $("input[value='"+server+"']")
|
const server_checkbox = $("input[value='"+server+"']")
|
||||||
@@ -293,7 +297,9 @@ function load_from_permalink(params) {
|
|||||||
// relies on connect_socket() being run shortly thereafter
|
// relies on connect_socket() being run shortly thereafter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function req_from_params(params) {
|
||||||
let req_body = params.get("req")
|
let req_body = params.get("req")
|
||||||
let cmd_name = ""
|
let cmd_name = ""
|
||||||
if (req_body) {
|
if (req_body) {
|
||||||
@@ -336,10 +342,14 @@ $(document).ready(function() {
|
|||||||
// default instead.
|
// default instead.
|
||||||
select_request()
|
select_request()
|
||||||
}
|
}
|
||||||
} else if (search_params.has("server") || search_params.has("req")) {
|
} else if (search_params.has("req")) {
|
||||||
load_from_permalink(search_params)
|
req_from_params(search_params)
|
||||||
} else {
|
} else {
|
||||||
select_request();
|
select_request()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (search_params.has("server")) {
|
||||||
|
server_from_params(search_params)
|
||||||
}
|
}
|
||||||
|
|
||||||
connect_socket()
|
connect_socket()
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
_The XLS-20 standard for NFTs :not_enabled: has a preliminary implementation that can be used in test networks, but is not yet available as an [amendment](amendments.html) to the XRP Ledger protocol. An amendment may be included in a future XRP Ledger release._
|
_Non-fungible token functionality is part of the [NonFungibleTokensV1 amendment][] :not_enabled: to the XRP Ledger protocol. You can use these functions on the [NFT-Devnet](parallel-networks.html) now, but they are not yet available on the production Mainnet._
|
||||||
|
|||||||
@@ -0,0 +1,165 @@
|
|||||||
|
---
|
||||||
|
html: account_nfts.html
|
||||||
|
parent: account-methods.html
|
||||||
|
blurb: Get a list of all NFTs for an account.
|
||||||
|
labels:
|
||||||
|
- Non-fungible Tokens, NFTs
|
||||||
|
status: not_enabled
|
||||||
|
---
|
||||||
|
# account_nfts
|
||||||
|
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/AccountObjects.cpp "Source")
|
||||||
|
|
||||||
|
The `account_nfts` method returns a list of `NFToken` objects for the specified account.
|
||||||
|
|
||||||
|
{% include '_snippets/nfts-disclaimer.md' %}
|
||||||
|
|
||||||
|
## Request Format
|
||||||
|
An example of the request format:
|
||||||
|
|
||||||
|
{% include '_snippets/no-cli-syntax.md' %}
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_START -->
|
||||||
|
|
||||||
|
*WebSocket*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"command": "account_nfts",
|
||||||
|
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
|
||||||
|
"ledger_index": "validated"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*JSON-RPC*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"method": "account_nfts",
|
||||||
|
"params": [{
|
||||||
|
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
|
||||||
|
"ledger_index": "validated"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_END -->
|
||||||
|
|
||||||
|
[Try it! >](websocket-api-tool.html?server=wss%3A%2F%2Fxls20-sandbox.rippletest.net%3A51233%2F#account_nfts)
|
||||||
|
|
||||||
|
The request includes the following parameters:
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|:---------------|:-----------------|:-----------------------------------------|
|
||||||
|
| `account` | String | The unique identifier of an account, typically the account's [Address][]. The request returns a list of NFTs owned by this account. |
|
||||||
|
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
|
||||||
|
| `ledger_index` | String or Number | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
|
||||||
|
| `limit` | Integer | _(Optional)_ Limit the number of [token pages][NFTokenPage object] to retrieve. Each page can contain up to 32 NFTs. The `limit` value cannot be lower than 20 or more than 400. The default is 100. |
|
||||||
|
| `marker` | [Marker][] | _(Optional)_ Value from a previous paginated response. Resume retrieving data where that response left off. |
|
||||||
|
|
||||||
|
|
||||||
|
## Response Format
|
||||||
|
An example of a successful response:
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_START -->
|
||||||
|
|
||||||
|
*WebSocket*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": {
|
||||||
|
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
|
||||||
|
"account_nfts": [
|
||||||
|
{
|
||||||
|
"Flags": 1,
|
||||||
|
"Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm",
|
||||||
|
"NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004",
|
||||||
|
"NFTokenTaxon": 0,
|
||||||
|
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
|
||||||
|
"nft_serial": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Flags": 1,
|
||||||
|
"Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm",
|
||||||
|
"NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE087727D1EA000000005",
|
||||||
|
"NFTokenTaxon": 0,
|
||||||
|
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
|
||||||
|
"nft_serial": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ledger_hash": "7971093E67341E325251268A5B7CD665EF450B126F67DF8384D964DF834961E8",
|
||||||
|
"ledger_index": 2380540,
|
||||||
|
"validated": true
|
||||||
|
},
|
||||||
|
"status": "success",
|
||||||
|
"type": "response"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*JSON-RPC*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": {
|
||||||
|
"account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx",
|
||||||
|
"account_nfts": [
|
||||||
|
{
|
||||||
|
"Flags": 1,
|
||||||
|
"Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm",
|
||||||
|
"NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004",
|
||||||
|
"NFTokenTaxon": 0,
|
||||||
|
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
|
||||||
|
"nft_serial": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Flags": 1,
|
||||||
|
"Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm",
|
||||||
|
"NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE087727D1EA000000005",
|
||||||
|
"NFTokenTaxon": 0,
|
||||||
|
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
|
||||||
|
"nft_serial": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ledger_hash": "46497E9FF17A993324F1A0A693DC068B467184023C7FD162812265EAAFEB97CB",
|
||||||
|
"ledger_index": 2380559,
|
||||||
|
"status": "success",
|
||||||
|
"validated": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_END -->
|
||||||
|
|
||||||
|
The response follows the [standard format][], with a successful result containing the following fields:
|
||||||
|
|
||||||
|
| `Field` | Type | Description |
|
||||||
|
|:---------------|:-----------------|:-----------------------------------------|
|
||||||
|
| `account` | String | The account that owns the list of NFTs |
|
||||||
|
| `account_nfts` | Array | A list of NFTs owned by the account, formatted as **NFT Objects** (see below). |
|
||||||
|
| `ledger_hash` | String | (May be omitted) The identifying hash of the ledger that was used to generate this response. |
|
||||||
|
| `ledger_index` | Number - [Ledger Index][] | _(May be omitted)_ The ledger index of the ledger that was used to generate this response. |
|
||||||
|
| `ledger_current_index` | Number - [Ledger Index][] | _(May be omitted)_ The ledger index of the current in-progress ledger version, which was used to generate this response. |
|
||||||
|
| `validated` | Boolean | If included and set to `true`, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change. |
|
||||||
|
|
||||||
|
### NFT Objects
|
||||||
|
|
||||||
|
Each object in the `account_nfts` array represents one [NFToken][] and has the following fields:
|
||||||
|
|
||||||
|
| `Field` | Type | Description |
|
||||||
|
|:---------------|:---------------------|:-------------------------------------|
|
||||||
|
| `Flags` | Number | A bit-map of boolean flags enabled for this NFToken. See [NFToken Flags](nftoken.html#nftoken-flags) for possible values. |
|
||||||
|
| `Issuer` | String - [Address][] | The account that issued this NFToken. |
|
||||||
|
| `NFTokenID` | String | The unique identifier of this NFToken, in hexadecimal. |
|
||||||
|
| `NFTokenTaxon` | Number | The unscrambled version of this token's [taxon](nftoken.html#taxon). Several tokens with the same taxon might represent instances of a limited series. |
|
||||||
|
| `URI` | String | The URI data associated with this NFToken, in hexadecimal. |
|
||||||
|
| `nft_serial` | Number | The token sequence number of this NFToken, which is unique for its issuer. |
|
||||||
|
|
||||||
|
## Possible Errors
|
||||||
|
|
||||||
|
* Any of the [universal error types][].
|
||||||
|
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||||
|
* `actNotFound` - The [Address][] specified in the `account` field of the request does not correspond to an account in the ledger.
|
||||||
|
* `lgrNotFound` - The ledger specified by the `ledger_hash` or `ledger_index` does not exist, or it does exist but the server does not have it.
|
||||||
|
|
||||||
|
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
---
|
||||||
|
html: nft_buy_offers.html
|
||||||
|
parent: path-and-order-book-methods.html
|
||||||
|
blurb: Get a list of all buy offers for a NFToken.
|
||||||
|
labels:
|
||||||
|
- Non-fungible Tokens, NFTs, NFTokens
|
||||||
|
status: not_enabled
|
||||||
|
---
|
||||||
|
# nft_buy_offers
|
||||||
|
[[Source]](https://github.com/ripple/rippled/blob/xls20/src/ripple/rpc/handlers/NFTOffers.cpp "Source")
|
||||||
|
|
||||||
|
The `nft_buy_offers` method returns a list of buy offers for a given [NFToken][] object.
|
||||||
|
|
||||||
|
{% include '_snippets/nfts-disclaimer.md' %}
|
||||||
|
|
||||||
|
## Request Format
|
||||||
|
An example of the request format:
|
||||||
|
|
||||||
|
{% include '_snippets/no-cli-syntax.md' %}
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_START -->
|
||||||
|
|
||||||
|
*WebSocket*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"command": "nft_buy_offers",
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"ledger_index": "validated"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*JSON-RPC*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"method": "nft_buy_offers",
|
||||||
|
"params": [{
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"ledger_index": "validated"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_END -->
|
||||||
|
|
||||||
|
[Try it! >](websocket-api-tool.html?server=wss%3A%2F%2Fxls20-sandbox.rippletest.net%3A51233%2F#nft_buy_offers)
|
||||||
|
|
||||||
|
The request includes the following parameters:
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|:---------------|:-----------------|:-----------------------------------------|
|
||||||
|
| `nft_id` | String | The unique identifier of a [NFToken][] object. |
|
||||||
|
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
|
||||||
|
| `ledger_index` | String or Number | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string to choose a ledger automatically. (See [Specifying Ledgers][]) |
|
||||||
|
| `limit` | Integer | _(Optional)_ Limit the number of NFT buy offers to retrieve. This value cannot be lower than 50 or more than 500. The default is 250. |
|
||||||
|
| `marker` | [Marker][] | _(Optional)_ Value from a previous paginated response. Resume retrieving data where that response left off. |
|
||||||
|
|
||||||
|
|
||||||
|
## Response Format
|
||||||
|
An example of a successful response:
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_START -->
|
||||||
|
|
||||||
|
*WebSocket*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": {
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"offers": [
|
||||||
|
{
|
||||||
|
"amount": "1500",
|
||||||
|
"flags": 0,
|
||||||
|
"nft_offer_index": "3212D26DB00031889D4EF7D9129BB0FA673B5B40B1759564486C0F0946BA203F",
|
||||||
|
"owner": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"status": "success",
|
||||||
|
"type": "response"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*JSON-RPC*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": {
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"offers": [
|
||||||
|
{
|
||||||
|
"amount": "1500",
|
||||||
|
"flags": 0,
|
||||||
|
"nft_offer_index": "3212D26DB00031889D4EF7D9129BB0FA673B5B40B1759564486C0F0946BA203F",
|
||||||
|
"owner": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "success"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_END -->
|
||||||
|
|
||||||
|
The response follows the [standard format][], with a successful result containing the following fields:
|
||||||
|
|
||||||
|
| `Field` | Type | Description |
|
||||||
|
|:---------|:-----------|:-----------------------------------------------------|
|
||||||
|
| `nft_id` | String | The NFToken these offers are for, as specified in the request. |
|
||||||
|
| `offers` | Array | A list of buy offers for the token. Each of these is formatted as a **Buy Offer** (see below). |
|
||||||
|
| `limit` | Number | _(May be omitted)_The `limit`, as specified in the request. |
|
||||||
|
| `marker` | [Marker][] | _(May be omitted)_ Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one. |
|
||||||
|
|
||||||
|
### Buy Offers
|
||||||
|
|
||||||
|
Each member of the `offers` array represents one [NFTokenOffer object][] to buy the NFT in question and has the following fields:
|
||||||
|
|
||||||
|
| `Field` | Type | Description |
|
||||||
|
|:------------------|:-----------------|:--------------------------------------|
|
||||||
|
| `amount` | String or Object | The amount offered to buy the NFT for, as a String representing an amount in drops of XRP, or an object representing an amount of a fungible token. (See [Specifying Currency Amounts][Currency Amount]) |
|
||||||
|
| `flags` | Number | A set of bit-flags for this offer. See [NFTokenOffer flags](nftokenoffer.html#nftokenoffer-flags) for possible values. |
|
||||||
|
| `nft_offer_index` | String | The [ledger object ID](ledger-object-ids.html) of this offer. |
|
||||||
|
| `owner` | String | The account that placed this offer. |
|
||||||
|
|
||||||
|
## Possible Errors
|
||||||
|
|
||||||
|
* Any of the [universal error types][].
|
||||||
|
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||||
|
* `actNotFound` - The [Address][] specified in the `account` field of the request does not correspond to an account in the ledger.
|
||||||
|
* `lgrNotFound` - The ledger specified by the `ledger_hash` or `ledger_index` does not exist, or it does exist but the server does not have it.
|
||||||
|
|
||||||
|
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
---
|
||||||
|
html: nft_sell_offers.html
|
||||||
|
parent: path-and-order-book-methods.html
|
||||||
|
blurb: Get a list of all sell offers for a NFToken.
|
||||||
|
labels:
|
||||||
|
- Non-fungible Tokens, NFTs, NFTokens
|
||||||
|
status: not_enabled
|
||||||
|
---
|
||||||
|
# nft_sell_offers
|
||||||
|
[[Source]](https://github.com/ripple/rippled/blob/xls20/src/ripple/rpc/handlers/NFTOffers.cpp "Source")
|
||||||
|
{% include '_snippets/nfts-disclaimer.md' %}
|
||||||
|
|
||||||
|
The `nft_sell_offers` method returns a list of sell offers for a given [NFToken][] object.
|
||||||
|
|
||||||
|
## Request Format
|
||||||
|
An example of the request format:
|
||||||
|
|
||||||
|
{% include '_snippets/no-cli-syntax.md' %}
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_START -->
|
||||||
|
|
||||||
|
*WebSocket*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"command": "nft_sell_offers",
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"ledger_index": "validated"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*JSON-RPC*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"method": "nft_sell_offers",
|
||||||
|
"tokenid": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_END -->
|
||||||
|
|
||||||
|
[Try it! >](websocket-api-tool.html?server=wss%3A%2F%2Fxls20-sandbox.rippletest.net%3A51233%2F#nft_sell_offers)
|
||||||
|
|
||||||
|
The request includes the following parameters:
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|:----------------------|:---------------------------|:------------------------|
|
||||||
|
| `tokenid` | String | The unique identifier of a NFToken object. |
|
||||||
|
|
|
||||||
|
## Response Format
|
||||||
|
An example of a successful response:
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_START -->
|
||||||
|
|
||||||
|
*WebSocket*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": {
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"offers": [
|
||||||
|
{
|
||||||
|
"amount": "1000",
|
||||||
|
"flags": 1,
|
||||||
|
"nft_offer_index": "9E28E366573187F8E5B85CE301F229E061A619EE5A589EF740088F8843BF10A1",
|
||||||
|
"owner": "rLpSRZ1E8JHyNDZeHYsQs1R5cwDCB3uuZt"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"status": "success",
|
||||||
|
"type": "response"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*JSON-RPC*
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": {
|
||||||
|
"nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||||
|
"offers": [
|
||||||
|
{
|
||||||
|
"amount": "1000",
|
||||||
|
"flags": 1,
|
||||||
|
"nft_offer_index": "9E28E366573187F8E5B85CE301F229E061A619EE5A589EF740088F8843BF10A1",
|
||||||
|
"owner": "rLpSRZ1E8JHyNDZeHYsQs1R5cwDCB3uuZt"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "success"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- MULTICODE_BLOCK_END -->
|
||||||
|
|
||||||
|
|
||||||
|
The response follows the [standard format][], with a successful result containing the following fields:
|
||||||
|
|
||||||
|
| `Field` | Type | Description |
|
||||||
|
|:---------|:-----------|:-----------------------------------------------------|
|
||||||
|
| `nft_id` | String | The NFToken these offers are for, as specified in the request. |
|
||||||
|
| `offers` | Array | A list of buy offers for the token. Each of these is formatted as a **Sell Offer** (see below). |
|
||||||
|
| `limit` | Number | _(May be omitted)_The `limit`, as specified in the request. |
|
||||||
|
| `marker` | [Marker][] | _(May be omitted)_ Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one. |
|
||||||
|
|
||||||
|
### Sell Offers
|
||||||
|
|
||||||
|
Each member of the `offers` array represents one [NFTokenOffer object][] to buy the NFT in question and has the following fields:
|
||||||
|
|
||||||
|
| `Field` | Type | Description |
|
||||||
|
|:------------------|:-----------------|:--------------------------------------|
|
||||||
|
| `amount` | String or Object | The amount offered to sell the NFT for, as a String representing an amount in drops of XRP, or an object representing an amount of a fungible token. (See [Specifying Currency Amounts][Currency Amount]) |
|
||||||
|
| `flags` | Number | A set of bit-flags for this offer. See [NFTokenOffer flags](nftokenoffer.html#nftokenoffer-flags) for possible values. |
|
||||||
|
| `nft_offer_index` | String | The [ledger object ID](ledger-object-ids.html) of this offer. |
|
||||||
|
| `owner` | String | The account that placed this offer. |
|
||||||
|
|
||||||
|
## Possible Errors
|
||||||
|
|
||||||
|
* Any of the [universal error types][].
|
||||||
|
* `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||||
|
* `actNotFound` - The [Address][] specified in the `account` field of the request does not correspond to an account in the ledger.
|
||||||
|
* `lgrNotFound` - The ledger specified by the `ledger_hash` or `ledger_index` does not exist, or it does exist but the server does not have it.
|
||||||
|
|
||||||
|
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
@@ -20,6 +20,7 @@ An account in the XRP Ledger represents a holder of XRP and a sender of transact
|
|||||||
* **[`account_currencies`](account_currencies.html)** - Get a list of currencies an account can send or receive.
|
* **[`account_currencies`](account_currencies.html)** - Get a list of currencies an account can send or receive.
|
||||||
* **[`account_info`](account_info.html)** - Get basic data about an account.
|
* **[`account_info`](account_info.html)** - Get basic data about an account.
|
||||||
* **[`account_lines`](account_lines.html)** - Get info about an account's trust lines.
|
* **[`account_lines`](account_lines.html)** - Get info about an account's trust lines.
|
||||||
|
* **[`account_nfts`](account_nfts.html)** :not_enabled: - Get a list of non-fungible tokens owned by an account.
|
||||||
* **[`account_objects`](account_objects.html)** - Get all ledger objects owned by an account.
|
* **[`account_objects`](account_objects.html)** - Get all ledger objects owned by an account.
|
||||||
* **[`account_offers`](account_offers.html)** - Get info about an account's currency exchange offers.
|
* **[`account_offers`](account_offers.html)** - Get info about an account's currency exchange offers.
|
||||||
* **[`account_tx`](account_tx.html)** - Get info about an account's transactions.
|
* **[`account_tx`](account_tx.html)** - Get info about an account's transactions.
|
||||||
@@ -50,7 +51,7 @@ Transactions are the only thing that can modify the shared state of the XRP Ledg
|
|||||||
|
|
||||||
By default, the following methods are [admin-only](admin-rippled-methods.html). They can be used as public methods if the server admin has [enabled public signing](enable-public-signing.html).
|
By default, the following methods are [admin-only](admin-rippled-methods.html). They can be used as public methods if the server admin has [enabled public signing](enable-public-signing.html).
|
||||||
|
|
||||||
* **[`sign`](sign.html)** - Cryptographically sign a transaction.
|
* **[`sign`](sign.html)** - Cryptographically sign a transaction.
|
||||||
* **[`sign_for`](sign_for.html)** - Contribute to a multi-signature.
|
* **[`sign_for`](sign_for.html)** - Contribute to a multi-signature.
|
||||||
|
|
||||||
|
|
||||||
@@ -60,6 +61,8 @@ Paths define a way for payments to flow through intermediary steps on their way
|
|||||||
|
|
||||||
* **[`book_offers`](book_offers.html)** - Get info about offers to exchange two currencies.
|
* **[`book_offers`](book_offers.html)** - Get info about offers to exchange two currencies.
|
||||||
* **[`deposit_authorized`](deposit_authorized.html)** - Look up whether one account is authorized to send payments directly to another.
|
* **[`deposit_authorized`](deposit_authorized.html)** - Look up whether one account is authorized to send payments directly to another.
|
||||||
|
* **[`nft_buy_offers`](nft_buy_offers.html)** :not_enabled: - Retrieve a list of buy offers for a specified NFToken object.
|
||||||
|
* **[`nft_sell_offers`](nft_sell_offers.html)** :not_enabled: - Retrieve a list of sell offers for a specified NFToken object.
|
||||||
* **[`path_find`](path_find.html)** - Find a path for a payment between two accounts and receive updates.
|
* **[`path_find`](path_find.html)** - Find a path for a payment between two accounts and receive updates.
|
||||||
* **[`ripple_path_find`](ripple_path_find.html)** - Find a path for payment between two accounts, once.
|
* **[`ripple_path_find`](ripple_path_find.html)** - Find a path for payment between two accounts, once.
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ Report the results.
|
|||||||
```
|
```
|
||||||
results += '\n\nTransaction result: '+ tx.result.meta.TransactionResult
|
results += '\n\nTransaction result: '+ tx.result.meta.TransactionResult
|
||||||
results += '\n\nnfts: ' + JSON.stringify(nfts, null, 2)
|
results += '\n\nnfts: ' + JSON.stringify(nfts, null, 2)
|
||||||
document.getElementById('standbyBalanceField').value =
|
document.getElementById('standbyBalanceField').value =
|
||||||
(await client.getXrpBalance(standby_wallet.address))
|
(await client.getXrpBalance(standby_wallet.address))
|
||||||
document.getElementById('operationalBalanceField').value = results
|
document.getElementById('operationalBalanceField').value = results
|
||||||
```
|
```
|
||||||
@@ -268,7 +268,7 @@ Disconnect from the ledger.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Burn Token
|
### Burn Token
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -295,7 +295,7 @@ Connect to the ledger and get the account wallets.
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Define the transaction.
|
Define the transaction.
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -334,7 +334,7 @@ Report the results.
|
|||||||
results += '\nBalance changes: ' +
|
results += '\nBalance changes: ' +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
document.getElementById('standbyBalanceField').value =
|
document.getElementById('standbyBalanceField').value =
|
||||||
(await client.getXrpBalance(standby_wallet.address))
|
(await client.getXrpBalance(standby_wallet.address))
|
||||||
results += '\nNFTs: \n' + JSON.stringify(nfts,null,2)
|
results += '\nNFTs: \n' + JSON.stringify(nfts,null,2)
|
||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
@@ -366,7 +366,7 @@ Report the results.
|
|||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
|
|
||||||
|
|
||||||
// Note that you must convert the token URL to a hexadecimal
|
// Note that you must convert the token URL to a hexadecimal
|
||||||
// value for this transaction.
|
// value for this transaction.
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
const transactionBlob = {
|
const transactionBlob = {
|
||||||
@@ -378,7 +378,7 @@ Report the results.
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------- Submit transaction and wait for results
|
// ------------------- Submit transaction and wait for results
|
||||||
const tx = await client.submitAndWait(transactionBlob, { wallet: operational_wallet} )
|
const tx = await client.submitAndWait(transactionBlob, { wallet: operational_wallet} )
|
||||||
const nfts = await client.request({
|
const nfts = await client.request({
|
||||||
method: "account_nfts",
|
method: "account_nfts",
|
||||||
@@ -389,7 +389,7 @@ Report the results.
|
|||||||
// ------------------------------------------------------- Report results
|
// ------------------------------------------------------- Report results
|
||||||
results += '\n\nTransaction result: '+ tx.result.meta.TransactionResult
|
results += '\n\nTransaction result: '+ tx.result.meta.TransactionResult
|
||||||
results += '\n\nnfts: ' + JSON.stringify(nfts, null, 2)
|
results += '\n\nnfts: ' + JSON.stringify(nfts, null, 2)
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(operational_wallet.address))
|
(await client.getXrpBalance(operational_wallet.address))
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
|
|
||||||
@@ -457,7 +457,7 @@ Report the results.
|
|||||||
results += '\nBalance changes: ' +
|
results += '\nBalance changes: ' +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(operational_wallet.address))
|
(await client.getXrpBalance(operational_wallet.address))
|
||||||
results += '\nNFTs: \n' + JSON.stringify(nfts,null,2)
|
results += '\nNFTs: \n' + JSON.stringify(nfts,null,2)
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
@@ -777,3 +777,8 @@ Bold text in the following indicates changes to the form that support the new fu
|
|||||||
| Previous | Next |
|
| Previous | Next |
|
||||||
| :--- | ---: |
|
| :--- | ---: |
|
||||||
| [← 2. Create TrustLine and Send Currency >](create-trustline-send-currency.html) | [4. Transfer NFTokens → >](transfer-nftokens.html) |
|
| [← 2. Create TrustLine and Send Currency >](create-trustline-send-currency.html) | [4. Transfer NFTokens → >](transfer-nftokens.html) |
|
||||||
|
|
||||||
|
<!--{# common link defs #}-->
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
|
{% include '_snippets/tx-type-links.md' %}
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ To cancel a buy or sell offer that you have created:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Code Walkthrough
|
# Code Walkthrough
|
||||||
|
|
||||||
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/quickstart.zip) archive to try each of the samples in your own browser.
|
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/quickstart.zip) archive to try each of the samples in your own browser.
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ Define the transaction. The _Flags_ value of 1 indicates that this transaction i
|
|||||||
|
|
||||||
Submit the transaction and wait for the results.
|
Submit the transaction and wait for the results.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -216,7 +216,7 @@ Submit the transaction and wait for the results.
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -266,9 +266,9 @@ Report the results of the transaction.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
results += '\n\nTransaction result:\n' +
|
results += '\n\nTransaction result:\n' +
|
||||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||||
results += '\n\nBalance changes:\n' +
|
results += '\n\nBalance changes:\n' +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -277,9 +277,9 @@ Get the current XRP balances for the operational and standby accounts.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(operational_wallet.address))
|
(await client.getXrpBalance(operational_wallet.address))
|
||||||
document.getElementById('standbyBalanceField').value =
|
document.getElementById('standbyBalanceField').value =
|
||||||
(await client.getXrpBalance(standby_wallet.address))
|
(await client.getXrpBalance(standby_wallet.address))
|
||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
```
|
```
|
||||||
@@ -395,13 +395,13 @@ Request the list of buy offers for the token.
|
|||||||
|
|
||||||
Report the results of the transaction.
|
Report the results of the transaction.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
results += "\n\nTransaction result:\n" +
|
results += "\n\nTransaction result:\n" +
|
||||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||||
results += "\n\nBalance changes:\n" +
|
results += "\n\nBalance changes:\n" +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
```
|
```
|
||||||
@@ -517,7 +517,7 @@ Report the transaction results.
|
|||||||
|
|
||||||
results += "\nTransaction result:\n" +
|
results += "\nTransaction result:\n" +
|
||||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||||
results += "\nBalance changes:\n" +
|
results += "\nBalance changes:\n" +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
```
|
```
|
||||||
@@ -680,9 +680,9 @@ Get the balances for both accounts.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
document.getElementById('standbyBalanceField').value =
|
document.getElementById('standbyBalanceField').value =
|
||||||
(await client.getXrpBalance(standby_wallet.address))
|
(await client.getXrpBalance(standby_wallet.address))
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(operational_wallet.address))
|
(await client.getXrpBalance(operational_wallet.address))
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -781,7 +781,7 @@ Report the transaction result.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
result += "\n\nTransaction result:\n" +
|
result += "\n\nTransaction result:\n" +
|
||||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||||
result += "\nBalance changes:\n" +
|
result += "\nBalance changes:\n" +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
@@ -792,9 +792,9 @@ Request the XRP balance for both accounts.
|
|||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(operational_wallet.address))
|
(await client.getXrpBalance(operational_wallet.address))
|
||||||
document.getElementById('standbyBalanceField').value =
|
document.getElementById('standbyBalanceField').value =
|
||||||
(await client.getXrpBalance(standby_wallet.address))
|
(await client.getXrpBalance(standby_wallet.address))
|
||||||
document.getElementById('standbyResultField').value = results
|
document.getElementById('standbyResultField').value = results
|
||||||
```
|
```
|
||||||
@@ -875,13 +875,13 @@ These functions duplicate the functions of the standby account for the operation
|
|||||||
|
|
||||||
|
|
||||||
// Check transaction results -------------------------------------------------
|
// Check transaction results -------------------------------------------------
|
||||||
results += '\n\nTransaction result:\n' +
|
results += '\n\nTransaction result:\n' +
|
||||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||||
results += '\n\nBalance changes:\n' +
|
results += '\n\nBalance changes:\n' +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(operational_wallet.address))
|
(await client.getXrpBalance(operational_wallet.address))
|
||||||
document.getElementById('standbyBalanceField').value =
|
document.getElementById('standbyBalanceField').value =
|
||||||
(await client.getXrpBalance(standby_wallet.address))
|
(await client.getXrpBalance(standby_wallet.address))
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
|
|
||||||
@@ -902,7 +902,7 @@ These functions duplicate the functions of the standby account for the operation
|
|||||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||||
let net = getNet()
|
let net = getNet()
|
||||||
const client = new xrpl.Client(net)
|
const client = new xrpl.Client(net)
|
||||||
let results = 'Connecting to ' + net + '...'
|
let results = 'Connecting to ' + net + '...'
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
await client.connect()
|
await client.connect()
|
||||||
results += '\nConnected. Creating buy offer...'
|
results += '\nConnected. Creating buy offer...'
|
||||||
@@ -950,7 +950,7 @@ These functions duplicate the functions of the standby account for the operation
|
|||||||
|
|
||||||
|
|
||||||
// Check transaction results -------------------------------------------------
|
// Check transaction results -------------------------------------------------
|
||||||
results +="\n\nTransaction result:\n" +
|
results +="\n\nTransaction result:\n" +
|
||||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||||
results += "\n\nBalance changes:\n" +
|
results += "\n\nBalance changes:\n" +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
@@ -1017,7 +1017,7 @@ These functions duplicate the functions of the standby account for the operation
|
|||||||
|
|
||||||
results += "\nTransaction result:\n" +
|
results += "\nTransaction result:\n" +
|
||||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||||
results += "\nBalance changes:\n" +
|
results += "\nBalance changes:\n" +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
|
|
||||||
@@ -1101,7 +1101,7 @@ These functions duplicate the functions of the standby account for the operation
|
|||||||
"SellOffer": operationalTokenOfferIndexField.value,
|
"SellOffer": operationalTokenOfferIndexField.value,
|
||||||
}
|
}
|
||||||
// Submit transaction --------------------------------------------------------
|
// Submit transaction --------------------------------------------------------
|
||||||
const tx = await client.submitAndWait(transactionBlob,{wallet: operational_wallet})
|
const tx = await client.submitAndWait(transactionBlob,{wallet: operational_wallet})
|
||||||
const nfts = await client.request({
|
const nfts = await client.request({
|
||||||
method: "account_nfts",
|
method: "account_nfts",
|
||||||
account: operational_wallet.classicAddress
|
account: operational_wallet.classicAddress
|
||||||
@@ -1113,9 +1113,9 @@ These functions duplicate the functions of the standby account for the operation
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
document.getElementById('standbyBalanceField').value =
|
document.getElementById('standbyBalanceField').value =
|
||||||
(await client.getXrpBalance(standby_wallet.address))
|
(await client.getXrpBalance(standby_wallet.address))
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(operational_wallet.address))
|
(await client.getXrpBalance(operational_wallet.address))
|
||||||
|
|
||||||
|
|
||||||
@@ -1156,7 +1156,7 @@ These functions duplicate the functions of the standby account for the operation
|
|||||||
"BuyOffer": operationalTokenOfferIndexField.value
|
"BuyOffer": operationalTokenOfferIndexField.value
|
||||||
}
|
}
|
||||||
// Submit transaction --------------------------------------------------------
|
// Submit transaction --------------------------------------------------------
|
||||||
const tx = await client.submitAndWait(transactionBlob,{wallet: operational_wallet})
|
const tx = await client.submitAndWait(transactionBlob,{wallet: operational_wallet})
|
||||||
const nfts = await client.request({
|
const nfts = await client.request({
|
||||||
method: "account_nfts",
|
method: "account_nfts",
|
||||||
account: operational_wallet.classicAddress
|
account: operational_wallet.classicAddress
|
||||||
@@ -1165,13 +1165,13 @@ These functions duplicate the functions of the standby account for the operation
|
|||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
|
|
||||||
// Check transaction results -------------------------------------------------
|
// Check transaction results -------------------------------------------------
|
||||||
result += "\n\nTransaction result:\n" +
|
result += "\n\nTransaction result:\n" +
|
||||||
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
JSON.stringify(tx.result.meta.TransactionResult, null, 2)
|
||||||
result += "\nBalance changes:\n" +
|
result += "\nBalance changes:\n" +
|
||||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(operational_wallet.address))
|
(await client.getXrpBalance(operational_wallet.address))
|
||||||
document.getElementById('operationalBalanceField').value =
|
document.getElementById('operationalBalanceField').value =
|
||||||
(await client.getXrpBalance(standby_wallet.address))
|
(await client.getXrpBalance(standby_wallet.address))
|
||||||
document.getElementById('operationalResultField').value = results
|
document.getElementById('operationalResultField').value = results
|
||||||
client.disconnect()
|
client.disconnect()
|
||||||
@@ -1512,3 +1512,8 @@ Update the form with fields and buttons to support the new functions.
|
|||||||
| Previous | Next |
|
| Previous | Next |
|
||||||
| :--- | ---: |
|
| :--- | ---: |
|
||||||
| [← 3. Mint and Burn NFTokens >](mint-and-burn-nftokens.html) | |
|
| [← 3. Mint and Burn NFTokens >](mint-and-burn-nftokens.html) | |
|
||||||
|
|
||||||
|
<!--{# common link defs #}-->
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
|
{% include '_snippets/tx-type-links.md' %}
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
|
|||||||
@@ -185,6 +185,8 @@ targets:
|
|||||||
"currency-formats.html#comparison": "currency-formats.html"
|
"currency-formats.html#comparison": "currency-formats.html"
|
||||||
# Fix links from untranslated NFToken tx refs to translated NFToken page
|
# Fix links from untranslated NFToken tx refs to translated NFToken page
|
||||||
"nftoken.html#nftoken-flags": "nftoken.html#nftoken-フラグ"
|
"nftoken.html#nftoken-flags": "nftoken.html#nftoken-フラグ"
|
||||||
|
"nftoken.html#taxon": "nftoken.html#分類群"
|
||||||
|
"basic-data-types.html#addresses": "basic-data-types.html#アドレス"
|
||||||
|
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
@@ -2730,6 +2732,12 @@ pages:
|
|||||||
targets:
|
targets:
|
||||||
- ja
|
- ja
|
||||||
|
|
||||||
|
# TODO: translate
|
||||||
|
- md: references/rippled-api/public-rippled-methods/account-methods/account_nfts.md
|
||||||
|
targets:
|
||||||
|
- en
|
||||||
|
- ja
|
||||||
|
|
||||||
- md: references/rippled-api/public-rippled-methods/account-methods/account_objects.md
|
- md: references/rippled-api/public-rippled-methods/account-methods/account_objects.md
|
||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
@@ -2915,6 +2923,18 @@ pages:
|
|||||||
targets:
|
targets:
|
||||||
- ja
|
- ja
|
||||||
|
|
||||||
|
# TODO: translate
|
||||||
|
- md: references/rippled-api/public-rippled-methods/path-and-order-book-methods/nft_buy_offers.md
|
||||||
|
targets:
|
||||||
|
- en
|
||||||
|
- ja
|
||||||
|
|
||||||
|
# TODO: translate
|
||||||
|
- md: references/rippled-api/public-rippled-methods/path-and-order-book-methods/nft_sell_offers.md
|
||||||
|
targets:
|
||||||
|
- en
|
||||||
|
- ja
|
||||||
|
|
||||||
- md: references/rippled-api/public-rippled-methods/path-and-order-book-methods/path_find.md
|
- md: references/rippled-api/public-rippled-methods/path-and-order-book-methods/path_find.md
|
||||||
targets:
|
targets:
|
||||||
- en
|
- en
|
||||||
|
|||||||
Reference in New Issue
Block a user