eth_getBalance
Returns the balance of the account of given address in wei.
Params
Address
:string
. The address to get the balance of.BlockNumber
:string
(optional). The block number to get the balance at. If omitted, the latest block is used.
Result
Returns a Promise that resolves with a string containing the hexadecimal balance of the account in wei.
Example
const balance = await provider.request({
method: 'eth_getBalance',
params: [
'0x...',
'latest'
]
});
console.log(balance); // ['0x...']