curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x9729187D9E8Bbefa8295F39f5634cA454dd9d294",
"latest"
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}Returns a placeholder value on Tempo since there is no native token. To check balances, query TIP-20 token contracts using balanceOf.
curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x9729187D9E8Bbefa8295F39f5634cA454dd9d294",
"latest"
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}balanceOf function.address — the address to check balance forblockParameter — the block number (hex) or tag (latest, earliest, pending)result — returns a placeholder value 0x5e5de0bada3a8d... since Tempo has no native tokeneth_call with the TIP-20 balanceOf function:
const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
// pathUSD token address
const PATHUSD = "0x20c0000000000000000000000000000000000000";
const checkBalance = async (address) => {
const abi = ["function balanceOf(address) view returns (uint256)"];
const token = new ethers.Contract(PATHUSD, abi, provider);
const balance = await token.balanceOf(address);
// TIP-20 tokens use 6 decimals
console.log(`pathUSD balance: ${ethers.formatUnits(balance, 6)}`);
};
checkBalance("0x9729187D9E8Bbefa8295F39f5634cA454dd9d294");
| Token | Address |
|---|---|
| pathUSD | 0x20c0000000000000000000000000000000000000 |
| AlphaUSD | 0x20c0000000000000000000000000000000000001 |
| BetaUSD | 0x20c0000000000000000000000000000000000002 |
| ThetaUSD | 0x20c0000000000000000000000000000000000003 |
Was this page helpful?