Skip to content

Latest commit

 

History

History
86 lines (54 loc) · 3.28 KB

balance.md

File metadata and controls

86 lines (54 loc) · 3.28 KB

balance API:

evm_api.balance


get_native_balance

evm_api.balance.get_native_balance()

Get the native balance for a specific wallet address.

Example

from moralis import evm_api

api_key = "YOUR_API_KEY"
params = {
    "address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e", 
    "chain": "eth", 
    "to_block": 1.2, 
}

result = evm_api.balance.get_native_balance(
    api_key=api_key,
    params=params,
)

print(result)

Parameters

Name Type Description Required Default Example
address str The address from which the native balance will be checked Yes "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e"
chain enum[str]:
- "eth"
- "0x1"
- "sepolia"
- "0xaa36a7"
- "polygon"
- "0x89"
- "bsc"
- "0x38"
- "bsc testnet"
- "0x61"
- "avalanche"
- "0xa86a"
- "fantom"
- "0xfa"
- "palm"
- "0x2a15c308d"
- "cronos"
- "0x19"
- "arbitrum"
- "0xa4b1"
- "chiliz"
- "0x15b38"
- "chiliz testnet"
- "0x15b32"
- "gnosis"
- "0x64"
- "gnosis testnet"
- "0x27d8"
- "base"
- "0x2105"
- "base sepolia"
- "0x14a34"
- "optimism"
- "0xa"
- "holesky"
- "0x4268"
- "polygon amoy"
- "0x13882"
- "linea"
- "0xe708"
- "moonbeam"
- "0x504"
- "moonriver"
- "0x505"
- "moonbase"
- "0x507"
- "linea sepolia"
- "0xe705"
The chain to query "eth" "eth"
to_block float The block number up to which the balances will be checked. 1.2

get_native_balances_for_addresses

evm_api.balance.get_native_balances_for_addresses()

Get the native balances for a set of specific addresses

Example

from moralis import evm_api

api_key = "YOUR_API_KEY"
params = {
    "wallet_addresses": [], 
    "chain": "eth", 
    "to_block": 1.2, 
}

result = evm_api.balance.get_native_balances_for_addresses(
    api_key=api_key,
    params=params,
)

print(result)

Parameters

Name Type Description Required Default Example
wallet_addresses List of str The addresses to get metadata for Yes []
chain enum[str]:
- "eth"
- "0x1"
- "sepolia"
- "0xaa36a7"
- "polygon"
- "0x89"
- "bsc"
- "0x38"
- "bsc testnet"
- "0x61"
- "avalanche"
- "0xa86a"
- "fantom"
- "0xfa"
- "palm"
- "0x2a15c308d"
- "cronos"
- "0x19"
- "arbitrum"
- "0xa4b1"
- "chiliz"
- "0x15b38"
- "chiliz testnet"
- "0x15b32"
- "gnosis"
- "0x64"
- "gnosis testnet"
- "0x27d8"
- "base"
- "0x2105"
- "base sepolia"
- "0x14a34"
- "optimism"
- "0xa"
- "holesky"
- "0x4268"
- "polygon amoy"
- "0x13882"
- "linea"
- "0xe708"
- "moonbeam"
- "0x504"
- "moonriver"
- "0x505"
- "moonbase"
- "0x507"
- "linea sepolia"
- "0xe705"
The chain to query "eth" "eth"
to_block float The block number on which the balances should be checked 1.2