Balances
Read the on-chain MYRT balance of a wallet. Chain ids and token addresses are explained in network configuration; this page states the shapes.
Read a balance
/v1/balances/{walletAddress}Returns the MYRT held by a wallet, read from the chain on every call. Because every call reaches the chain, this endpoint draws from a tighter bucket of 60 requests per minute per key instead of the 120 per minute for other reads. Cache the result on your side for display. See rate limits.
Path parameters
| Parameter | Type | Notes |
|---|---|---|
walletAddress | string | An EVM wallet address. The response returns it checksummed |
Query parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
chainId | number | no | One of the chains[].chainId values from /v1/config. With it, balances holds one entry for that chain. Without it, one entry per chain listed in /v1/config |
curl "https://sandbox-api.myrt.money/v1/balances/0xAbC0000000000000000000000000000000000001?chainId=1" \
-H "Authorization: Bearer $MYRT_API_KEY"const res = await fetch(
"https://sandbox-api.myrt.money/v1/balances/0xAbC0000000000000000000000000000000000001?chainId=1",
{ headers: { Authorization: `Bearer ${process.env.MYRT_API_KEY}` } }
);
const result = await res.json();import os, requests
res = requests.get(
"https://sandbox-api.myrt.money/v1/balances/0xAbC0000000000000000000000000000000000001?chainId=1",
headers={"Authorization": f"Bearer {os.environ['MYRT_API_KEY']}"},
timeout=30,
)
result = res.json()Response 200 OK
{
"ok": true,
"walletAddress": "0xAbC0000000000000000000000000000000000001",
"balances": [
{
"chainId": 1,
"network": "Ethereum",
"tokenAddress": "0x...",
"symbol": "MYRT",
"decimals": 6,
"balanceRaw": "212400000",
"balance": "212.4"
}
]
}Each entry names the chain, the MYRT contract on it (tokenAddress), and the balance twice: balance is a decimal string and balanceRaw is the same value scaled by 10^decimals, as an integer string. Both are strings, never numbers, and balance is not zero-padded. Parse with a decimal library and never compare amount strings. See amounts.
Errors
| Code | HTTP |
|---|---|
INVALID_WALLET_ADDRESS | 400 |
UNAUTHORIZED | 401 |
SCOPE_DENIED | 403 |
RATE_LIMITED | 429 |
See errors for the meaning of each code. A 429 carries Retry-After in seconds.
