xrp

XRP (XRP)

Method: POST book_offers

dropdown

POST book_offers

The book_offers method retrieves a list of offers, also known as the order book , between two currencies.

Parameters

ledger_hash - String

(Optional) A 20-byte hex string for the ledger version to use.

ledger_index - String or Unsigned Integer

(Optional) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically.

limit - Unsigned Integer

(Optional) If provided, the server does not provide more than this many offers in the results.

The total number of results returned may be fewer than the limit, because the server omits unfunded offers.

taker - String

(Optional) The Address of an account to use as a perspective. Unfunded offers placed by this account are always included in the response. (You can use this to look up your own orders to cancel them.)

taker_gets - Object

Specification of which currency the account taking the offer would receive, as an object with currency and issuer fields (omit issuer for XRP), like currency amounts.

taker_pays - Object

Specification of which currency the account taking the offer would pay, as an object with currency and issuer fields (omit issuer for XRP), like currency amounts.

Request

curl --location --request POST 'https://xrp.getblock.io/mainnet/' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "book_offers",
"params": [{"taker_gets": {"currency": "XRP"}, "taker_pays": {"currency": "USD", "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}}],
"id": "getblock.io"}'


Response

{
    "result": {
        "ledger_current_index": 63632813,
        "offers": [
            {
                "Account": "rwCyujNHfkbN1hi4XSbU9mZKxwn3BSto78",
                "BookDirectory": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F0574DEAB4D28FE",
                "BookNode": "0000000000000000",
                "Flags": 131072,
                "LedgerEntryType": "Offer",
                "OwnerNode": "0000000000000000",
                "PreviousTxnID": "0000000000000000000000000000000000000000000000000000000000000000",
                "PreviousTxnLgrSeq": 0,
                "Sequence": 63350714,
                "TakerGets": "537128005",
                "TakerPays": {
                    "currency": "USD",
                    "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
                    "value": "824.9612539604309"
                },
                "index": "61B2C75E155F8A02666D8ACC61D3545BC8B8976325B3586FB3536EF049978B38",
                "owner_funds": "2163511982",
                "quality": "0.00000153587458907571"
            }
        ]
    }
}
GetBlock.io

Get access to 40+ blockchain nodes right now! GetBlock provides a fast and reliable API connection to full nodes from many leading blockchains.

Subscribe

Email is invalid

2019 - 2021 GetBlock