Page cover

EVM Functions

We will explain how you can create fast queries using EVM Network on this page.

getBalance(chainId,address)

With the getBalance function, you can retrieve the balance of the wallet address you want in the desired EVM. For example, to select the Ethereum blockchain, you would write "1".

getBalance(1,"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045").then(console.log);
>> 4,119.640011905861845028 ETH

getAllBalance(address,separator,lineBreak)

You can use the getAllBalance function to query the balances of an address across all EVM chains.

The function allows you to configure separators and line breaks. You can try the following example to separate chains and balances with "," and line endings with ";":

getAllBalance("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",",",";").then(console.log);
>> Ethereum,4119640011905861845028;
BNB Chain,576324326496414808;
Polygon,108754938226757359777;
Arbitrum,1122162770859786554;
Optimism,502718340291416665;
.....

getBlockNumber(chainId)

You can use the getBlockNumber function to retrieve the latest block number on a chain.

getBlockNumber(1).then(console.log);
>> 17651557

getGasPrice(chainId)

You can use the getGasPrice function to retrieve the gas price on a chain.

getGasPrice(1).then(console.log);
>> 21845222534

Last updated