v2

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

Get account modules

get/accounts/{address}/modules

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

Query parameters

versionstring uint64

The version of the latest transaction in the ledger.

Example:52635485

Response

This API returns account modules for a specific ledger version (AKA transaction version). If not present, the latest version is used.

The Aptos nodes prune account state history, via a configurable time window (link).

If the requested data has been pruned, the server responds with a 404

bytecodestring hex required

All bytes data are represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Different with Address type, hex-encoded bytes should not trim any zeros.

Example response

[
  {
    "bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1",
    "abi": {
      "address": "0xdd",
      "name": "Aptos",
      "friends": [
        "0x1::aptos"
      ],
      "exposed_functions": [
        {
          "name": "peer_to_peer_with_metadata",
          "visibility": "script",
          "generic_type_params": [
            {
              "constraints": []
            }
          ],
          "params": [
            "signer",
            "address",
            "u64",
            "vector<u8>",
            "vector<u8>"
          ],
          "return": []
        }
      ],
      "structs": [
        {
          "name": "Balance",
          "is_native": false,
          "abilities": [
            "key"
          ],
          "generic_type_params": [
            {
              "constraints": [],
              "is_phantom": true
            }
          ],
          "fields": [
            {
              "name": "coin",
              "type": "0x1::aptos_coin::AptosCoin"
            }
          ]
        }
      ]
    }
  }
]