Skip to main content
Version: 2.2

Get account modules

GEThttps://mainnet-aptos-api.moralis.io/accounts/:address/modules

Get account modules for a given address.

PATH PARAMS
addressstringrequired
Address of account with or without a 0x prefix
QUERY PARAMS
ledger_versionstring

Ledger version to get state of account. If not provided, it will be the latest version

limitnumber

Max number of account resources to retrieve. If not provided, defaults to default page size.

startstring

Cursor specifying where to start for pagination This cursor cannot be derived manually client-side. Instead, you must call this endpoint once without this query parameter specified, and then use the cursor returned in the X-Aptos-Cursor header in the response.

Responses
200 array
bytecodestringrequired
All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.
abirequired
A Move module
addressstringrequired
A hex encoded 32 byte Aptos account address.
namestringrequired
friendsarrayrequired
Friends of the module
string
exposed_functionsarrayrequired
Public functions of the module
namestringrequired
Name of the function
visibilitystringrequired
Move function visibility
is_entrybooleanrequired
Whether the function can be called as an entry function directly in a transaction
generic_type_paramsarrayrequired
Generic type params associated with the Move function
constraintsarrayrequired
Move abilities tied to the generic type param and associated with the function that uses it
string
paramsarrayrequired
Parameters associated with the move function
string
returnarrayrequired
Return type of the function
string
structsarrayrequired
Structs of the module
namestringrequired
Name of the struct
is_nativebooleanrequired
Whether the struct is a native struct of Move
abilitiesarrayrequired
Abilities associated with the struct
string
generic_type_paramsarrayrequired
Generic types associated with the struct
constraintsarrayrequired
Move abilities tied to the generic type param and associated with the function that uses it
string
fieldsarrayrequired
Fields associated with the struct
namestringrequired
Name of the field
typestringrequired
String representation of an on-chain Move type tag that is exposed in transaction payload.
API KEY
import Moralis from 'moralis';

try {
await Moralis.start({
apiKey: "YOUR_API_KEY"
});

const response = await Moralis.AptosApi.accounts.getAccountModules({
"limit": 5,
"network": "mainnet"
});

console.log(response);
} catch (e) {
console.error(e);
}
Response Example
[
{
"bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1",
"abi": {
"address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1",
"name": "",
"exposed_functions": [
{
"name": "",
"visibility": "private",
"is_entry": true
}
],
"structs": [
{
"name": "",
"is_native": true,
"fields": [
{
"name": "sender",
"type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>"
}
]
}
]
}
}
]