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://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}'import requests
url = "https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
"abi": {
"address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
"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>"
}
]
}
]
}
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}30 Compute Units.
Path Parameters
Address of account with or without a 0x prefix
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.
"0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
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 A string containing a 64-bit unsigned integer.
We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.
"32425224034"
Response
Move module bytecode along with it's ABI
All bytes (Vec) 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.
"0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
A Move module
Show child attributes
Show child attributes
curl --request GET \
--url 'https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}'import requests
url = "https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.aptos.validationcloud.io/v1/<YOUR_API_KEY_HERE>/v1/accounts/{address}/module/{module_name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"bytecode": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
"abi": {
"address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
"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>"
}
]
}
]
}
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}{
"message": "<string>",
"error_code": "account_not_found",
"vm_error_code": 123
}