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.2

Get historical Coin balances by wallet(s)

🚨Aptos: Confirmed Deprecation (60 Days Notice)

Aptos mainnet and testnet will be discontinued on November 22nd, in line with the network’s deprecation of their v1 Indexers. We recommend exploring alternative providers, which you can find at Aptos APIs.

GEThttps://mainnet-aptos-api.moralis.io/wallets/coins/history

Get historical Coin balances for one or many wallet addresses. Filter by coin type hashes to retrieve specific balances.

QUERY PARAMS
limitnumberrequired
The number of results to return
offsetnumber
The number of results to skip
cursorstring
The cursor to use for getting the next page
owner_addressesarrayrequired
The addresses of the owner addresses to get historical balances for
No items in the array
coin_type_hash_blacklistarray
The coin type hash of the coins to whitelist
No items in the array
coin_type_hash_whitelistarray
The coin type hash of the coins to whitelist
No items in the array
Responses
API KEY
import Moralis from 'moralis';

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

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

console.log(response);
} catch (e) {
console.error(e);
}
Response Example
{
"cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHhkODUwOTQyZWY4ODExZjJhODY2NjkyYTYyMzAxMWJkZTUyYTQ2MmMxIiwiY2hhaW4iOiJldGgiLCJkaXNhYmxlVG90YWwiOiJ0cnVlIiwiYXBpS2V5SWQiOjM2NTg5LCJsaW1pdCI6MTAwLCJ0b3BpYzMiOiI9Om51bGwiLCJ0b19ibG9jayI6IjE0NjgxNTM3IiwicGFnZSI6MSwidG90YWwiOjAsIm9mZnNldCI6MSwidWMiOnRydWUsImlhdCI6MTY3MTk3ODQwNH0.XM9IN3wRJgWzSvQCy-K4Asgs_j8p9xTM1pY7UnHEhs4",
"hasNextPage": true,
"result": {
"amount": "324933484",
"coin_type": "T0xa911c7236486be921f6cc9227b09afe4a4ad14d291ba1bb8a9b7c4d628759de::gegg::GEGG",
"coin_type_hash": "6993fb8b5688d392a2d94127b9926519d6327e69f2bcf3dc0c5df2c060aec97d",
"transaction_timestamp": "2022-09-17T22:03:32.000000Z",
"transaction_version": "210373856",
"owner_address": "0x9125e4054d884fdc7296b66e12c0d63a7baa0d88c77e8e784987c0a967c670ac"
}
}