Last updated
Edit

nft_sell_offers

[Source]

The nft_sell_offers method returns a list of sell offers for a given NFToken object.

(Added by the NonFungibleTokensV1_1 amendment.)

Request Format

An example of the request format:

Note

There is no commandline syntax for this method. You can use the json method to access this method from the commandline instead.

  1. WebSocket
  2. JSON-RPC
{
  "command": "nft_sell_offers",
  "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
  "ledger_index": "validated"
}

Try it! >

The request includes the following parameters:

FieldTypeDescription
nft_idStringThe unique identifier of a NFToken object.
ledger_hashString(Optional) A 20-byte hex string for the ledger version to use. (See Specifying Ledgers)
ledger_indexString or Number(Optional) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers)
limitInteger(Optional) Limit the number of NFT sell offers to retrieve. This value cannot be lower than 50 or more than 500. Positive values outside this range are replaced with the closest valid option. The default is 250.
markerMarker(Optional) Value from a previous paginated response. Resume retrieving data where that response left off.

Response Format

An example of a successful response:

  1. WebSocket
  2. JSON-RPC
{
  "result": {
    "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
    "offers": [
      {
        "amount": "1000",
        "flags": 1,
        "nft_offer_index": "9E28E366573187F8E5B85CE301F229E061A619EE5A589EF740088F8843BF10A1",
        "owner": "rLpSRZ1E8JHyNDZeHYsQs1R5cwDCB3uuZt"
      }
    ]
  },
  "status": "success",
  "type": "response"
}

The response follows the standard format, with a successful result containing the following fields:

FieldTypeDescription
nft_idStringThe NFToken these offers are for, as specified in the request.
offersArrayA list of buy offers for the token. Each of these is formatted as a Sell Offer (see below).
limitNumber(May be omitted) The limit, as specified in the request.
markerMarker(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:

FieldTypeDescription
amountString or ObjectThe 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)
flagsNumberA set of bit-flags for this offer. See NFTokenOffer flags for possible values.
nft_offer_indexStringThe ledger object ID of this offer.
ownerStringThe 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.
  • objectNotFound - The NFT does not have any sell offers (note that object refers to the sell offer rather than the NFT itself).