API Reference
Web3 API
- Basic API
- Balance API
- Token API
- NFT API
- Domain API
SQL API
- Alpha
- Classic(Deprecated)
Get account module
Retrieves an individual module from a given account and at a specific ledger version. If the ledger version is not specified in the request, the latest ledger version is used.
The Aptos nodes prune account state history, via a configurable time window. If the requested ledger version has been pruned, the server responds with a 410.
curl --request GET \
--url https://aptos-mainnet.s.chainbase.online/{api-key}/v1/accounts/{address}/module/{module_name}
{
"bytecode": "0xc739507214d0e1bf9795485299d709e00024e92f7c0d055a4c2c39717882bdfd",
"abi": {
"address": "0xc739507214d0e1bf9795485299d709e00024e92f7c0d055a4c2c39717882bdfd",
"name": "<string>",
"friends": [
"0x1::aptos_coin"
],
"exposed_functions": [
{
"name": "<string>",
"visibility": "private",
"is_entry": true,
"generic_type_params": [
{
"constraints": [
"<string>"
]
}
],
"params": [
"<string>"
],
"return": [
"<string>"
]
}
],
"structs": [
{
"name": "<string>",
"is_native": true,
"abilities": [
"<string>"
],
"generic_type_params": [
{
"constraints": [
"<string>"
]
}
],
"fields": [
{
"name": "<string>",
"type": "<string>"
}
]
}
]
}
}
Path Parameters
Address of account with or without a 0x
prefix
"0xc739507214d0e1bf9795485299d709e00024e92f7c0d055a4c2c39717882bdfd"
Name of module to retrieve e.g. coin
Query Parameters
Ledger version to get state of account
If not provided, it will be the latest version
"32425224034"
Response
Move module bytecode along with it's ABI
All bytes (Vec<u8>) data is represented as hex-encoded string prefixed with 0x
and fulfilled with
two hex digits per byte.
Unlike the Address
type, HexEncodedBytes will not trim any zeros.
"0xc739507214d0e1bf9795485299d709e00024e92f7c0d055a4c2c39717882bdfd"
A Move module
A hex encoded 32 byte Aptos account address.
This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.
For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.
"0xc739507214d0e1bf9795485299d709e00024e92f7c0d055a4c2c39717882bdfd"
Friends of the module
Move module id is a string representation of Move module.
Format: {address}::{module name}
address
should be hex-encoded 32 byte account address that is prefixed with 0x
.
Module name is case-sensitive.
Public functions of the module
Move function
Move function visibility
private
, public
, friend
Whether the function can be called as an entry function directly in a transaction
Generic type params associated with the Move function
Move function generic type param
Move abilities tied to the generic type param and associated with the function that uses it
Parameters associated with the move function
String representation of an on-chain Move type tag that is exposed in transaction payload.
Values:
- bool
- u8
- u16
- u32
- u64
- u128
- u256
- address
- signer
- vector: vector<{non-reference MoveTypeId}>
- struct: {address}::{module_name}::{struct_name}::<{generic types}>
Vector type value examples:
- `vector<u8>`
- `vector<vector<u64>>`
- `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>`
Struct type value 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).
Return type of the function
String representation of an on-chain Move type tag that is exposed in transaction payload.
Values:
- bool
- u8
- u16
- u32
- u64
- u128
- u256
- address
- signer
- vector: vector<{non-reference MoveTypeId}>
- struct: {address}::{module_name}::{struct_name}::<{generic types}>
Vector type value examples:
- `vector<u8>`
- `vector<vector<u64>>`
- `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>`
Struct type value 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).
Structs of the module
A move struct
Whether the struct is a native struct of Move
Abilities associated with the struct
Generic types associated with the struct
Move generic type param
Move abilities tied to the generic type param and associated with the type that uses it
Fields associated with the struct
Move struct field
String representation of an on-chain Move type tag that is exposed in transaction payload.
Values:
- bool
- u8
- u16
- u32
- u64
- u128
- u256
- address
- signer
- vector: vector<{non-reference MoveTypeId}>
- struct: {address}::{module_name}::{struct_name}::<{generic types}>
Vector type value examples:
- `vector<u8>`
- `vector<vector<u64>>`
- `vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>`
Struct type value 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).
curl --request GET \
--url https://aptos-mainnet.s.chainbase.online/{api-key}/v1/accounts/{address}/module/{module_name}
{
"bytecode": "0xc739507214d0e1bf9795485299d709e00024e92f7c0d055a4c2c39717882bdfd",
"abi": {
"address": "0xc739507214d0e1bf9795485299d709e00024e92f7c0d055a4c2c39717882bdfd",
"name": "<string>",
"friends": [
"0x1::aptos_coin"
],
"exposed_functions": [
{
"name": "<string>",
"visibility": "private",
"is_entry": true,
"generic_type_params": [
{
"constraints": [
"<string>"
]
}
],
"params": [
"<string>"
],
"return": [
"<string>"
]
}
],
"structs": [
{
"name": "<string>",
"is_native": true,
"abilities": [
"<string>"
],
"generic_type_params": [
{
"constraints": [
"<string>"
]
}
],
"fields": [
{
"name": "<string>",
"type": "<string>"
}
]
}
]
}
}