ERC20s

Note

functions that require multiple RPC calls will attempt to do so concurrently for maximum efficiency

Examples

Note

These examples are crafted as a Jupyter notebook. You can download the original notebook file here.

Also note that inside Jupyter notebooks, await can be used freely outside of asyncio.run().

erc20s

Reference

async ctc.evm.async_get_erc20_balance(wallet, token, *, block=None, normalize=True, provider=None, **rpc_kwargs)

get ERC20 balance

async ctc.evm.async_get_erc20_balances_of_addresses(wallets, token, *, block=None, normalize=True, provider=None, **rpc_kwargs)

get ERC20 balance of multiple addresses

async ctc.evm.async_get_erc20_balance_by_block(wallet, token, *, blocks, normalize=True, provider=None, empty_token=0, **rpc_kwargs)

get historical ERC20 balance over multiple blocks

async ctc.evm.async_get_erc20_decimals(token, *, block=None, use_db=True, provider=None, **rpc_kwargs)

get decimals of an erc20

async ctc.evm.async_get_erc20_balances_from_transfers(transfers, *, block=None, dtype=None, normalize=False)

compute ERC20 balance of each wallet using Transfer events

async ctc.evm.async_get_erc20_name(token, *, block=None, use_db=True, provider=None, **rpc_kwargs)

get name of an erc20

async ctc.evm.async_get_erc20_symbol(token, *, block=None, use_db=True, provider=None, **rpc_kwargs)

get symbol of an erc20

async ctc.evm.async_get_erc20_total_supply(token, *, block=None, normalize=True, provider=None, **rpc_kwargs)

get total supply of ERC20

async ctc.evm.async_get_erc20_total_supply_by_block(token, blocks, *, normalize=True, provider=None, **rpc_kwargs)

get historical total supply of ERC20 across multiple blocks

async ctc.evm.async_get_erc20_transfers(token, *, start_block=None, end_block=None, start_time=None, end_time=None, include_timestamps=False, normalize=True, convert_from_str=True, verbose=False, provider=None, **event_kwargs)

get transfer events of ERC20 token

async ctc.evm.async_get_erc20s_balances(wallet, tokens, *, block=None, normalize=True, provider=None, **rpc_kwargs)

get ERC20 balance of wallet for multiple tokens

async ctc.evm.async_get_erc20s_decimals(tokens, *, block=None, **rpc_kwargs)

get decimals of multiple erc20s

async ctc.evm.async_get_erc20s_names(tokens, block=None, **rpc_kwargs)

get name of multiple erc20s

async ctc.evm.async_get_erc20s_symbols(tokens, *, block=None, **rpc_kwargs)

get symbol of multiple erc20s

async ctc.evm.async_get_erc20s_total_supplies(tokens, *, block=None, normalize=True, provider=None, **rpc_kwargs)

get total supplies of ERC20s

async ctc.evm.async_normalize_erc20_quantities(quantities, token=None, *, provider=None, decimals=None, block=None)

normalize ERC20 quantites by adjusting radix by (10 ** decimals)

async ctc.evm.async_normalize_erc20_quantity(quantity, token=None, *, provider=None, decimals=None, block=None)

convert raw erc20 quantity by adjusting radix by (10 ** decimals)