Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.0

Get account module

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

Get a specific account module for a given address.

PATH PARAMS
addressstringrequired
Address of account with or without a 0x prefix
module_namestringrequired
Name of module to retrieve
QUERY PARAMS
ledger_versionstring

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

Responses
API KEY
import Moralis from 'moralis';

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

const response = await Moralis.AptosApi.accounts.getAccountModule({});

console.log(response);
} catch (e) {
console.error(e);
}
Response Example
{
"bytecode": "All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.",
"abi": ""
}