blockreq_walletBalance
此内容尚不支持你的语言。
Description
Section titled “Description”Returns your PAYG wallet balance in USD cents, formatted amount, plan, and auto-recharge settings. This method is only available on private endpoints (requires API key).
Parameters
Section titled “Parameters”None
Returns
Section titled “Returns”| Field | Type | Description |
|---|---|---|
balanceUsd | integer | Wallet balance in cents (e.g. 1050 = $10.50) |
balanceFormatted | string | Human-readable balance (e.g. "$10.50") |
plan | string | Active plan type |
autoRechargeEnabled | boolean | Whether auto-recharge is on |
Request Example
Section titled “Request Example”{ "jsonrpc": "2.0", "method": "blockreq_walletBalance", "params": [], "id": 1}Response Example
Section titled “Response Example”{ "jsonrpc": "2.0", "id": 1, "result": { "balanceUsd": 1050, "balanceFormatted": "$10.50", "plan": "payg", "autoRechargeEnabled": true }}Code Examples
Section titled “Code Examples”curl -X POST https://eth-mainnet.blockreq.com/v1/rpc/public \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"blockreq_walletBalance","params":[],"id":1}'const response = await fetch('https://eth-mainnet.blockreq.com/v1/rpc/public', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', method: 'blockreq_walletBalance', params: [], id: 1, }),});const { result } = await response.json();console.log(`Balance: ${result.balanceFormatted}`);