v2

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2022-07-19176455.9 KB
accounts
state

Get resource by account address and resource type.

This API renders a resource identified by the owner account address and the resource_type, at a ledger version (AKA transaction version) specified as a query param, otherwise the latest version is used.

get/accounts/{address}/resource/{resource_type}

Path parameters

addressstring address required

Hex-encoded 16 bytes Aptos account address.

Prefixed with 0x and leading zeros are trimmed.

See doc for more details.

Example:0xdd
resource_typestring move_type required

String representation of an on-chain Move struct type.

It is a combination of:

  1. Move module address, module name and struct name joined by ::.
  2. struct generic type parameters joined by , .

Examples:

  • 0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>
  • 0x1::account::Account

Note:

  1. Empty chars should be ignored when comparing 2 struct tag ids.
  2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).

See doc for more details.

Example:0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>

Query parameters

versionstring uint64

The version of the latest transaction in the ledger.

Example:52635485

Response

Returns a resource.

typestring move_type required

String representation of an on-chain Move struct type.

It is a combination of:

  1. Move module address, module name and struct name joined by ::.
  2. struct generic type parameters joined by , .

Examples:

  • 0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>
  • 0x1::account::Account

Note:

  1. Empty chars should be ignored when comparing 2 struct tag ids.
  2. When used in an URL path, should be encoded by url-encoding (AKA percent-encoding).

See doc for more details.

dataobject required

Account resource data is JSON representation of the Move struct type.

Move struct field name and value are serialized as object property name and value.

Example response

{
  "type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>",
  "data": {
    "coin": {
      "value": "8000000000"
    }
  }
}