Accounts

List account entities on network

Returns a list of all account entity items on the network.

GET/api/v1/accounts
Query parameters
Response

OK

Body
accounts*Accounts (array of AccountInfo (object))
links*Links (object)
Request
const response = await fetch('/api/v1/accounts', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "accounts": [
    {
      "account": "0.0.8",
      "alias": "HIQQEXWKW53RKN4W6XXC4Q232SYNZ3SZANVZZSUME5B5PRGXL663UAQA",
      "auto_renew_period": null,
      "balance": {
        "timestamp": "0.000002345",
        "balance": 80,
        "tokens": [
          {
            "token_id": "0.0.200001",
            "balance": 8
          }
        ]
      },
      "created_timestamp": "1562591528.000123456",
      "decline_reward": false,
      "deleted": false,
      "ethereum_nonce": 10,
      "evm_address": "0xac384c53f03855fa1b3616052f8ba32c6c2a2fec",
      "expiry_timestamp": null,
      "key": null,
      "max_automatic_token_associations": 200,
      "memo": "entity memo",
      "pending_reward": 100,
      "receiver_sig_required": false,
      "staked_account_id": null,
      "staked_node_id": 3,
      "stake_period_start": "172800000.000000000"
    }
  ],
  "links": {
    "next": null
  }
}

Get account by alias, id, or evm address

Return the account transactions and balance information given an account alias, an account id, or an evm address. The information will be limited to at most 1000 token balances for the account as outlined in HIP-367. When the timestamp parameter is supplied, we will return transactions and account state for the relevant timestamp query. Balance information will be accurate to within 15 minutes of the provided timestamp query. Historical ethereum nonce information is currently not available and may not be the exact value at a provided timestamp.

GET/api/v1/accounts/{idOrAliasOrEvmAddress}
Path parameters
idOrAliasOrEvmAddress*string

Account alias or account id or evm address

Query parameters
Response

OK

Body
account*nullable EntityId (string)

Network entity ID in the format of shard.realm.num

Example: "0.0.2"
alias*nullable Alias (string)

RFC4648 no-padding base32 encoded account alias

Example: "HIQQEXWKW53RKN4W6XXC4Q232SYNZ3SZANVZZSUME5B5PRGXL663UAQA"
auto_renew_period*nullable integer (int64)
balance*nullable Balance (object)
created_timestamp*nullable TimestampNullable (string)

A Unix timestamp in seconds.nanoseconds format

Example: "1586567700.453054000"
decline_reward*boolean

Whether the account declines receiving a staking reward

deleted*nullable boolean
ethereum_nonce*nullable integer (int64)
evm_address*nullable EvmAddressNullable (string (binary))

A network entity encoded as an EVM address in hex.

Example: "0x0000000000000000000000000000000000001f41"
expiry_timestamp*nullable TimestampNullable (string)

A Unix timestamp in seconds.nanoseconds format

Example: "1586567700.453054000"
key*nullable Key (object)

The public key which controls access to various network entities.

max_automatic_token_associations*nullable integer (int32)
memo*nullable string
pending_rewardinteger (int64)

The pending reward in tinybars the account will receive in the next reward payout. Note the value is updated at the end of each staking period and there may be delay to reflect the changes in the past staking period.

receiver_sig_required*nullable boolean
staked_account_id*all of
staked_node_id*nullable integer (int64)

The id of the node to which this account is staking

stake_period_start*all of
transactions*Transactions (array of Transaction (object))
links*Links (object)
Request
const response = await fetch('/api/v1/accounts/{idOrAliasOrEvmAddress}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "account": "0.0.8",
  "alias": "HIQQEXWKW53RKN4W6XXC4Q232SYNZ3SZANVZZSUME5B5PRGXL663UAQA",
  "auto_renew_period": null,
  "balance": {
    "timestamp": "0.000002345",
    "balance": 80,
    "tokens": [
      {
        "token_id": "0.0.200001",
        "balance": 8
      }
    ]
  },
  "created_timestamp": "1562591528.000123456",
  "decline_reward": false,
  "deleted": false,
  "ethereum_nonce": 10,
  "evm_address": "0xac384c53f03855fa1b3616052f8ba32c6c2a2fec",
  "expiry_timestamp": null,
  "key": null,
  "max_automatic_token_associations": 200,
  "memo": "entity memo",
  "pending_reward": 100,
  "receiver_sig_required": false,
  "staked_account_id": null,
  "staked_node_id": 3,
  "stake_period_start": "172800000.000000000",
  "transactions": [
    {
      "bytes": null,
      "charged_tx_fee": 7,
      "consensus_timestamp": "1234567890.000000007",
      "entity_id": "0.0.2281979",
      "max_fee": 33,
      "memo_base64": null,
      "name": "CRYPTOTRANSFER",
      "nft_transfers": [
        {
          "is_approval": true,
          "receiver_account_id": "0.0.121",
          "sender_account_id": "0.0.122",
          "serial_number": 1,
          "token_id": "0.0.123"
        },
        {
          "is_approval": true,
          "receiver_account_id": "0.0.321",
          "sender_account_id": "0.0.422",
          "serial_number": 2,
          "token_id": "0.0.123"
        }
      ],
      "node": "0.0.3",
      "nonce": 0,
      "parent_consensus_timestamp": "1234567890.000000007",
      "result": "SUCCESS",
      "scheduled": false,
      "staking_reward_transfers": [
        {
          "account": 3,
          "amount": 150
        },
        {
          "account": 9,
          "amount": 200
        }
      ],
      "transaction_hash": "vigzKe2J7fv4ktHBbNTSzQmKq7Lzdq1/lJMmHT+a2KgvdhAuadlvS4eKeqKjIRmW",
      "transaction_id": "0.0.8-1234567890-000000006",
      "token_transfers": [
        {
          "token_id": "0.0.90000",
          "account": "0.0.9",
          "amount": 1200,
          "is_approval": false
        },
        {
          "token_id": "0.0.90000",
          "account": "0.0.8",
          "amount": -1200,
          "is_approval": false
        }
      ],
      "transfers": [
        {
          "account": "0.0.3",
          "amount": 2,
          "is_approval": false
        },
        {
          "account": "0.0.8",
          "amount": -3,
          "is_approval": false
        },
        {
          "account": "0.0.98",
          "amount": 1,
          "is_approval": false
        },
        {
          "account": "0.0.800",
          "amount": 150,
          "is_approval": false
        },
        {
          "account": "0.0.800",
          "amount": 200,
          "is_approval": false
        }
      ],
      "valid_duration_seconds": 11,
      "valid_start_timestamp": "1234567890.000000006"
    }
  ],
  "links": {
    "next": null
  }
}

Get nfts for an account info

Returns information for all non-fungible tokens for an account.

Ordering

When considering NFTs, their order is governed by a combination of their numerical token.Id and serialnumber values, with token.id being the parent column. A serialnumbers value governs its order within the given token.id

In that regard, if a user acquired a set of NFTs in the order (2-2, 2-4 1-5, 1-1, 1-3, 3-3, 3-4), the following layouts illustrate the ordering expectations for ownership listing

  1. All NFTs in ASC order: 1-1, 1-3, 1-5, 2-2, 2-4, 3-3, 3-4
  2. All NFTs in DESC order: 3-4, 3-3, 2-4, 2-2, 1-5, 1-3, 1-1
  3. NFTs above 1-1 in ASC order: 1-3, 1-5, 2-2, 2-4, 3-3, 3-4
  4. NFTs below 3-3 in ASC order: 1-1, 1-3, 1-5, 2-2, 2-4
  5. NFTs between 1-3 and 3-3 inclusive in DESC order: 3-4, 3-3, 2-4, 2-2, 1-5, 1-3

Note: The default order for this API is currently DESC

Filtering

When filtering there are some restrictions enforced to ensure correctness and scalability.

The table below defines the restrictions and support for the NFT ownership endpoint

Query Param Comparison Operator Support Description Example
token.id eq Y Single occurrence only. ?token.id=X
ne N
lt(e) Y Single occurrence only. ?token.id=lte:X
gt(e) Y Single occurrence only. ?token.id=gte:X
serialnumber eq Y Single occurrence only. Requires the presence of a token.id query ?serialnumber=Y
ne N
lt(e) Y Single occurrence only. Requires the presence of an lte or eq token.id query ?token.id=lte:X&serialnumber=lt:Y
gt(e) Y Single occurrence only. Requires the presence of an gte or eq token.id query ?token.id=gte:X&serialnumber=gt:Y
spender.id eq Y ?spender.id=Z
ne N
lt(e) Y ?spender.id=lt:Z
gt(e) Y ?spender.id=gt:Z

Note: When searching across a range for individual NFTs a serialnumber with an additional token.id query filter must be provided. Both filters must be a single occurrence of gt(e) or lt(e) which provide a lower and or upper boundary for search.

GET/api/v1/accounts/{idOrAliasOrEvmAddress}/nfts
Path parameters
idOrAliasOrEvmAddress*string

Account alias or account id or evm address

Query parameters
Response

OK

Body
nftsarray of Nft (object)
linksLinks (object)
Request
const response = await fetch('/api/v1/accounts/{idOrAliasOrEvmAddress}/nfts', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "nfts": [
    {
      "account_id": "0.1.2",
      "created_timestamp": "1234567890.000000001",
      "delegating_spender": "0.0.400",
      "deleted": false,
      "metadata": "VGhpcyBpcyBhIHRlc3QgTkZU",
      "modified_timestamp": "1610682445.003266001",
      "serial_number": 124,
      "spender_id": "0.0.500",
      "token_id": "0.0.222"
    }
  ],
  "links": {
    "next": null
  }
}

Get past staking reward payouts for an account

Returns information for all past staking reward payouts for an account.

GET/api/v1/accounts/{idOrAliasOrEvmAddress}/rewards
Path parameters
idOrAliasOrEvmAddress*string

Account alias or account id or evm address

Query parameters
Response

OK

Body
rewardsarray of StakingReward (object)
linksLinks (object)
Request
const response = await fetch('/api/v1/accounts/{idOrAliasOrEvmAddress}/rewards', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "rewards": [
    {
      "account_id": "0.0.1000",
      "amount": 10,
      "timestamp": "1234567890.000000001"
    }
  ],
  "links": {
    "next": null
  }
}

Last updated