mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 11:55:50 +00:00
NFT API method fixes
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', {
|
||||
description: "Returns the raw ledger format for all objects owned by an account.",
|
||||
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', {
|
||||
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",
|
||||
@@ -544,38 +577,3 @@ Request('random', {
|
||||
"command": "random"
|
||||
}
|
||||
})
|
||||
|
||||
Request("NFT Methods")
|
||||
|
||||
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('nft_buy_offers', {
|
||||
description: "Retrieves offers to buy a given NFT.",
|
||||
link: "nft_buy_offers.html",
|
||||
status: "not_enabled",
|
||||
body: {
|
||||
"command": "nft_buy_offers",
|
||||
"tokenid": "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",
|
||||
"tokenid": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
---
|
||||
html: account_nfts.html
|
||||
parent: nft-methods.html
|
||||
blurb: Get a list of all NFTs for an account.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# 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:
|
||||
|
||||
<!-- 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 [NFTokenPage objects][] to retrieve. Each NFTokenPage can contain up to 32 NFTs. This 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. Each item is an [NFToken][] object. |
|
||||
| `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. |
|
||||
|
||||
## 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' %}
|
||||
@@ -1,118 +0,0 @@
|
||||
---
|
||||
html: account_nfts.html
|
||||
parent: nft-methods.html
|
||||
blurb: Get a list of all NFTs for an account.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# account_nfts
|
||||
[[Source]](https://github.com/ripple/rippled/blob/xls20/src/ripple/rpc/handlers/AccountObjects.cpp "Source")
|
||||
{% include '_snippets/nfts-disclaimer.md' %}
|
||||
|
||||
The `account_nfts` method returns a list of `NFToken` objects for the specified account.
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"command": "account_nfts",
|
||||
"params": [{
|
||||
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "account_nfts",
|
||||
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#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. |
|
||||
|
|
||||
## Response Format
|
||||
An example of a successful response:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
{
|
||||
"result": {
|
||||
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"
|
||||
"account_nfts": Array(1)
|
||||
0:
|
||||
"Flags": 1
|
||||
"Issuer": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"
|
||||
"TokenID": "000100002252403649165C1748D1DC71A713A9C40B292AD60000099B00000000"
|
||||
"TokenTaxon": 0
|
||||
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469"
|
||||
"nft_serial": 0
|
||||
"ledger_current_index": 57855
|
||||
"validated": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"
|
||||
"account_nfts": Array(1)
|
||||
0:
|
||||
"Flags": 1
|
||||
"Issuer": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH"
|
||||
"TokenID": "000100002252403649165C1748D1DC71A713A9C40B292AD60000099B00000000"
|
||||
"TokenTaxon": 0
|
||||
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469"
|
||||
"nft_serial": 0
|
||||
"ledger_current_index": 57855
|
||||
"validated": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- 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 | The list of NFTs owned by the account |
|
||||
| `ledger_current_index` | Unsigned Integer | The [ledger index][] of this ledger version. |
|
||||
| 'validated' | boolean | Validation status of the current ledger. |
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
* `rpcACT_NOT_FOUND` - The account string is not found on the ledger.
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -1,111 +0,0 @@
|
||||
---
|
||||
html: nft_buy_offers.html
|
||||
parent: nft-methods.html
|
||||
blurb: Get a list of all buy offers for a NFToken.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs, NFTokens
|
||||
---
|
||||
# account_nfts
|
||||
[[Source]](https://github.com/ripple/rippled/blob/xls20/src/ripple/rpc/handlers/NFTOffers.cpp "Source")
|
||||
{% include '_snippets/nfts-disclaimer.md' %}
|
||||
|
||||
The `nft_buy_offers` method returns a list of buy offers for a `NFToken` object.
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"command": "nft_buy_offers",
|
||||
"params": [{
|
||||
"tokenid": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "nft_buy_offers",
|
||||
"tokenid": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#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
|
||||
{
|
||||
"id": 7,
|
||||
"result": {
|
||||
"offers": [
|
||||
{
|
||||
"amount": "8000",
|
||||
"flags": 0,
|
||||
"index": "9A4ACB71D49C8A4F1B079DE9D3CD289851E637B68BE7FDC383D01BE413B24C7A",
|
||||
"owner": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm"
|
||||
}
|
||||
],
|
||||
"tokenid": "000800001FD350FC4A6133360827DE142E60E7522E4F4DF5409177A90000000E"
|
||||
},
|
||||
"type": "response"
|
||||
}```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
{
|
||||
"id": 7,
|
||||
"result": {
|
||||
"offers": [
|
||||
{
|
||||
"amount": "8000",
|
||||
"flags": 0,
|
||||
"index": "9A4ACB71D49C8A4F1B079DE9D3CD289851E637B68BE7FDC383D01BE413B24C7A",
|
||||
"owner": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm"
|
||||
}
|
||||
],
|
||||
"tokenid": "000800001FD350FC4A6133360827DE142E60E7522E4F4DF5409177A90000000E"
|
||||
},
|
||||
"type": "response"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:-----------------|:-----------------------------------------|
|
||||
| `tokenid` | String | The NFToken associated with the sell offers |
|
||||
| `offers` | Array | The list of sell offers for the NFToken |
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -1,112 +0,0 @@
|
||||
---
|
||||
html: nft_sell_offers.html
|
||||
parent: nft-methods.html
|
||||
blurb: Get a list of all sell offers for a NFToken.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs, NFTokens
|
||||
---
|
||||
# account_nfts
|
||||
[[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 `NFToken` object.
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"command": "nft_sell_offers",
|
||||
"params": [{
|
||||
"tokenid": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007"
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "nft_sell_offers",
|
||||
"tokenid": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html#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
|
||||
{
|
||||
"id": 0,
|
||||
"result": {
|
||||
"offers": [
|
||||
{
|
||||
"amount": "100",
|
||||
"flags": 1,
|
||||
"index": "0468126DEDD7EF3F624137F55F4BABE6BEFB4A2CE8F2D9E5D7756FD06B9B2045",
|
||||
"owner": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm"
|
||||
}
|
||||
],
|
||||
"tokenid": "000900001FD350FC4A6133360827DE142E60E7522E4F4DF529ABA6A80000000D"
|
||||
},
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
{
|
||||
"id": 0,
|
||||
"result": {
|
||||
"offers": [
|
||||
{
|
||||
"amount": "100",
|
||||
"flags": 1,
|
||||
"index": "0468126DEDD7EF3F624137F55F4BABE6BEFB4A2CE8F2D9E5D7756FD06B9B2045",
|
||||
"owner": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm"
|
||||
}
|
||||
],
|
||||
"tokenid": "000900001FD350FC4A6133360827DE142E60E7522E4F4DF529ABA6A80000000D"
|
||||
},
|
||||
"type": "response"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------------|:-----------------|:-----------------------------------------|
|
||||
| `tokenid` | String | The NFToken associated with the sell offers |
|
||||
| `offers` | Array | The list of sell offers for the NFToken |
|
||||
|
||||
## Possible Errors
|
||||
|
||||
* Any of the [universal error types][].
|
||||
|
||||
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
@@ -0,0 +1,132 @@
|
||||
---
|
||||
html: nft_buy_offers.html
|
||||
parent: nft-methods.html
|
||||
blurb: Get a list of all buy offers for a NFToken.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs, NFTokens
|
||||
---
|
||||
# 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 `NFToken` object.
|
||||
|
||||
{% include '_snippets/nfts-disclaimer.md' %}
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
<!-- 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#nft_sell_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,124 @@
|
||||
---
|
||||
html: nft_sell_offers.html
|
||||
parent: nft-methods.html
|
||||
blurb: Get a list of all sell offers for a NFToken.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs, NFTokens
|
||||
---
|
||||
# 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 `NFToken` object.
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
<!-- 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#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_info`](account_info.html)** - Get basic data about an account.
|
||||
* **[`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_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.
|
||||
@@ -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).
|
||||
|
||||
* **[`sign`](sign.html)** - Cryptographically sign a transaction.
|
||||
* **[`sign`](sign.html)** - Cryptographically sign a transaction.
|
||||
* **[`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.
|
||||
* **[`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.
|
||||
* **[`ripple_path_find`](ripple_path_find.html)** - Find a path for payment between two accounts, once.
|
||||
|
||||
@@ -97,14 +100,6 @@ Use these methods to perform convenient tasks, such as ping and random number ge
|
||||
* **[`ping`](ping.html)** - Confirm connectivity with the server.
|
||||
* **[`random`](random.html)** - Generate a random number.
|
||||
|
||||
## [NFT Methods](nft-methods.html)
|
||||
|
||||
Use these methods to retrieve information about NFToken objects.
|
||||
{% include '_snippets/nfts-disclaimer.md' %}
|
||||
|
||||
* **[`account_nfts`](account_nfts.html)** - Retrieve a list of NFToken objects for a specified account.
|
||||
* **[`nft_buy_offers`](nft_buy_offers.html)** - Retrieve a list of buy offers for a specified NFToken object.
|
||||
* **[`nft_sell_offers`](nft_sell_offers.html)** - Retrieve a list of sell offers for a specified NFToken object.
|
||||
|
||||
## Deprecated Methods
|
||||
|
||||
|
||||
@@ -2730,6 +2730,12 @@ pages:
|
||||
targets:
|
||||
- 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
|
||||
targets:
|
||||
- en
|
||||
@@ -2915,6 +2921,18 @@ pages:
|
||||
targets:
|
||||
- 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
|
||||
targets:
|
||||
- en
|
||||
|
||||
Reference in New Issue
Block a user