account_objects

How to use it

// yarn add @tatumio/tatum

import { TatumSDK, Xrp, Network } from '@tatumio/tatum'

const tatum = await TatumSDK.init<Xrp>({network: Network.XRP})

const res = await tatum.rpc.accountObjects('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', {
  ledger_index: 'validated',
  type: 'state',
  deletion_blockers_only: false,
  limit: 10
})

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs

Overview

The accountObjects method returns the raw ledger format for all objects owned by an account. This includes Offer objects for orders that are currently live, unfunded, or expired but not yet removed, RippleState objects for trust lines where this account's side is not in the default state, the account's SignerList, if the account has multi-signing enabled, Escrow objects for held payments that have not yet been executed or canceled, PayChannel objects for open payment channels, Check objects for pending Checks, DepositPreauth objects for deposit preauthorizations, Ticket objects for Tickets, and NFTokenPage objects for collections of NFTs.

Parameters

Main Parameters

  • account: A unique identifier for the account, most commonly the account's Address.

Optional Parameters (part of options?: AccountObjectsOptions object)

  • deletion_blockers_only: If true, the response only includes objects that would block this account from being deleted. The default is false.

  • ledger_hash: A 20-byte hex string for the ledger version to use.

  • ledger_index: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically.

  • limit: The maximum number of objects to include in the results. Must be within the inclusive range 10 to 400 on non-admin connections. The default is 200.

  • marker: Value from a previous paginated response. Resume retrieving data where that response left off.

  • type: Filter results by a ledger entry type. The valid types are: check, deposit_preauth, escrow, nft_offer, offer, payment_channel, signer_list, state (trust line), and ticket.

Return Object

The returned object will be a successful result containing the account's address and an array of objects owned by this account.

Here are the fields in the response:

  • account: This is a string that represents the unique address of the account that this request corresponds to.

  • account_objects: This is an array of objects owned by the account. Each object is in its raw ledger format. The specific fields in each object can vary depending on the type of the object. Common ledger object types include Offer, RippleState, AccountRoot, and others.

  • ledger_hash: This is a string that may be omitted. It represents the identifying hash of the ledger that was used to generate this response.

  • ledger_index: This is a number that may be omitted. It represents the ledger index of the ledger version that was used to generate this response.

  • ledger_current_index: This is a number that may be omitted. It represents the ledger index of the current in-progress ledger version, which was used to generate this response.

  • limit: This is a number that may be omitted. It represents the limit that was used in this request, if any.

  • marker: This is a server-defined value indicating the response is paginated. You can pass this to the next call to resume where this call left off. It is omitted when there are no additional pages after this one.

  • validated: This is a 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.

JSON-RPC Request Example

{
  "method": "account_objects",
  "params": [
    {
      "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
      "ledger_index": "validated",
      "type": "state",
      "deletion_blockers_only": false,
      "limit": 10
    }
  ]
}

JSON-RPC Response Example

{
    "result": {
        "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "account_objects": [
            {
                "Balance": {
                    "currency": "ASP",
                    "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
                    "value": "0"
                },
                "Flags": 65536,
                "HighLimit": {
                    "currency": "ASP",
                    "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",