跳至主要內容

eth_getBalance RPC 方法

載入中...

更新於
2026年6月15日

eth_getBalance RPC 方法

▾ How to check TIP-20 token balances

Since Tempo does not have a native token, you need to query TIP-20 stablecoin contracts directly to check account balances. Use the balanceOf function on the token contract.

Example using ethers.js:

const ethers = require('ethers');
const NODE_URL = "YOUR_QUICKNODE_ENDPOINT";
const provider = new ethers.JsonRpcProvider(NODE_URL);

// pathUSD token contract address
const PATHUSD_ADDRESS = "0x20c0000000000000000000000000000000000000";

async function checkTokenBalance(address) {
const abi = ["function balanceOf(address) view returns (uint256)"];
const tokenContract = new ethers.Contract(PATHUSD_ADDRESS, abi, provider);
const balance = await tokenContract.balanceOf(address);

// TIP-20 tokens use 6 decimal places
const formattedBalance = ethers.formatUnits(balance, 6);
console.log(`pathUSD balance: ${formattedBalance}`);
}

checkTokenBalance("0x9729187D9E8Bbefa8295F39f5634cA454dd9d294");

Available TIP-20 stablecoins:

TokenAddress
pathUSD0x20c0000000000000000000000000000000000000
AlphaUSD0x20c0000000000000000000000000000000000001
BetaUSD0x20c0000000000000000000000000000000000002
ThetaUSD0x20c0000000000000000000000000000000000003

參數

地址
字串
必填
載入中...
區塊編號
字串
必填
載入中...

退貨

結果
字串
載入中...
請求
回應
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": "0x9612084f0316e0ebd5182f398e5195a51b5ca47667d4c9b26c9b26c9b26c9b2"
5
}
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": "0x9612084f0316e0ebd5182f398e5195a51b5ca47667d4c9b26c9b26c9b26c9b2"
5
}
還沒有帳號嗎?
只需幾秒鐘即可建立您的 Quicknode 端點,並開始建置
立即免費開始使用