v2

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

Get module by module id.

This API renders a Move module identified by the module id. A module id consists of the module owner address and the module_name. The module is rendered at a ledger version (AKA transaction version) specified as a query param, otherwise the latest version is used.

get/accounts/{address}/module/{module_name}

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
module_namestring required

The name of the module.

Query parameters

versionstring uint64

The version of the latest transaction in the ledger.

Example:52635485

Response

Returns a move module.

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"
          }
        ]
      }
    ]
  }
}