A

Animica · Chain Balances

by Animica

POSTBaseanimica:1

$0.0058

per call · USD Coin on Base

Balances for up to 500 Animica accounts in ONE batched call, head-pinned, amounts in nANM as exact decimal strings. Single-address balance lookups stay free on the public API — this sells the batch.

Endpoint

POST https://animica.dev/x402/chain/balances

4

Calls / 30d

1

Unique payers / 30d

Aug 22

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://animica.dev/x402/chain/balances", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "addresses": [
      "anim1zqpye0muk7etljd2fh7wxsh9y9027cq7dykj3de8u80s2mcnfp6qxecpunkth"
    ]
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://animica.dev/x402/chain/balances" \
  -H "Content-Type: application/json" \
  -d '{"addresses":["anim1zqpye0muk7etljd2fh7wxsh9y9027cq7dykj3de8u80s2mcnfp6qxecpunkth"]}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "as_of": {
    "consistent": true,
    "entry_head_max": 73635,
    "entry_head_min": 73635,
    "head_hash": "0x00000000015b1e1021c5354baeac63e24fa52aff9aee92bd467653654256cdd4",
    "head_height": 73635
  },
  "balances": [
    {
      "account_digest": "0x4cbf7cb7b2bfc9aa4dfce342e5215eaf601e692d28b727e1df056f1348740367",
      "address": "anim1zqpye0muk7etljd2fh7wxsh9y9027cq7dykj3de8u80s2mcnfp6qxecpunkth",
      "balance": "150863000",
      "exists": true,
      "spendable_balance": "150863000"
    }
  ],
  "count": 1,
  "decimals": 9,
  "derivation": {
    "account_digest": "bech32m anim1… payload = alg_id (2 bytes) || sha3_256(pubkey) (32 bytes); the lookup key is payload[2:34] (the 32-byte digest), which is what is sent to the node.",
    "amounts": "balances are nANM (1e-9 ANM) as exact decimal strings, normalised through BigInt from the node's confirmed_balance. Divide by 1e9 for ANM — with a decimal library, never a float.",
    "duplicates": "duplicate addresses are resolved once and answered in place; total_balance sums UNIQUE accounts only.",
    "fields": "balance = the node's confirmed_balance. spendable_balance and exists are passed through only when the node returns them; nothing here is synthesised.",
    "source": "state.getAddressBalance on the local Animica node, one batched JSON-RPC request. Note the node has an upstream read-through fallback when it believes it is behind, so a balance may come from a trusted upstream rather than local state."
  },
  "failed_lookups": 0,
  "product": "chain_batch_balances",
  "total_balance": "150863000",
  "unique_addresses": 1,
  "unit": "nANM"
}

Payment details

Pay to0x5d17c40fd6b119dc6006c4ab3c20a917fcab2acd
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase, animica:1
Schemesexact

Is this your API?

Pin it to the top of Onchain Data and the homepage with a featured placement.

Get featured →

More from Animica & similar services