View Source Ethex.Abi.Event (ethex v0.1.3)
"https://mainnet.infura.io/v3/{{INFURA_API_KEY}}"
%{ address: ["0x497c41e4d95e9738bde7f23977e22d875de8fbd4"], fromBlock: "0xF83845", toBlock: "0xFA3845" }
Link to this section Summary
Functions
decode given logs using given function selectors.
Generate fromBlock and toBlock params according to current block num
combine eth_getLogs with decode, using the given abi_name, which MUST register in Abi genserver.
Link to this section Functions
@spec decode(list(), [ABI.FunctionSelector.t(), ...]) :: list()
decode given logs using given function selectors.
discard log when no function_selector match its method_id.
@spec decode_log(map(), ABI.FunctionSelector.t()) :: map()
@spec gen_block_range(String.t(), non_neg_integer() | String.t()) :: any()
Generate fromBlock and toBlock params according to current block num
- when
last_block
== latest, fetch from newest back to 20 blocks. - when
cur_block
-last_block
> 800, fetch fromlast_block
forwards 800 blocks. - else,
cur_block
-last_block
> 800, fetch fromlast_block
to cur_block.
NOTE: the max block range in Polygon is 1000, in BSC is 5000.
combine eth_getLogs with decode, using the given abi_name, which MUST register in Abi genserver.
NOTE: address in filter SHOULD match abi_name, or will be discard.