Telos — net, web3, parity, eth, trace (3/3)
API reference for Telos. All methods ->
eth_getLogs
Returns an array of all logs matching a given filter object.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):-
object: the filter options:-
fromBlock(string; quantity|tag; optional; default: "latest"): either the block number or one of the following block tags:latest: for the last mined block.earliest: for the lowest numbered block available on the client.pending: for not yet mined transactions.
-
toBlock(string; quantity|tag; optional; default: "latest"): either the block number or one of the following block tags:latest: for the last mined block.earliest: for the lowest numbered block available on the client.pending: for not yet mined transactions.
-
address(array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. -
topics(array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. -
blockhash(string; data, 32 bytes; optional; future): with the addition of EIP-234,blockHashwill be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent tofromBlock = toBlock = the blocknumber with hash blockHash. IfblockHashis present in the filter criteria, then neitherfromBlocknortoBlockare allowed.
-
-
Returns
removed(string; tag):truewhen the log was removed, due to a chain reorganization;falseif it's a valid log.logIndex(string; quantity): the log index position in the block; null when it's a pending log.transactionIndex(string; quantity): the transactions index position log was created from; null when it's a pending log.transactionHash(string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log.blockHash(string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log.blockNumber(string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log.address(string; data, 20 bytes): an address from which this log originated.data(string; data): contains one or more 32 bytes non-indexed arguments of the log.topics(array of strings; data): an array of 0 to 4 32 bytes data of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.)
Request example
curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [{
"fromBlock": "0x14869E9E",
"toBlock": "0x14869EA5",
"address": "0x339d413CCEfD986b1B3647A9cfa9CBbE70A30749",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": []
}
trace_filter
Retrieve traces that match filter criteria.
Parameters
-
id(integer; required): a request ID (example: 1). -
jsonrpc(string; required): a JSON RPC spec used (example: 2.0). -
method(string; required): a method used for the request. -
params(array; required):fromBlock(string, optional): the starting block number, given as a hexadecimal string. Example: "0x1" for the first block.toBlock(string, optional): the ending block number, given as a hexadecimal string. Example: "latest" for the most recent block.fromAddress(array of strings, optional): an array of addresses that initiated the transactions. Example: ["0xAddress1", "0xAddress2"].toAddress(array of strings, optional): an array of addresses that received the transactions. Example: ["0xAddress1", "0xAddress2"].after(integer, optional): the offset for pagination. Example: 0.count(integer, optional): the number of results to return. Example: 100.
Returns
-
action(object)- For
call:callType(string): the type of call (e.g., "call", "delegatecall", "staticcall").from(string): the address that initiated the call.to(string): the address that was called.gas(string): the amount of gas provided for the call.input(string): the input data for the call.value(string): the amount of Wei sent with the call.
- For
create:from(string): the address that created the contract.gas(string): the amount of gas provided for the creation.init(string): the initialization code for the contract.value(string): the amount of Wei sent with the creation.
- For
reward:author(string): the address that received the reward.value(string): the amount of Wei rewarded.rewardType(string): the type of reward (e.g., "block", "uncle").
- For
suicide:address(string): the address of the contract that self-destructed.refundAddress(string): the address that received the remaining balance.balance(string): the remaining balance of the contract.
- For
-
blockHash(string): the hash of the block containing the transaction. -
blockNumber(string): The number of the block containing the transaction. -
result(object)- For
call:gasUsed(string): The amount of gas used by the call.output(string): The output data from the call.
- For
create:address(string): The address of the created contract.code(string): The runtime code of the created contract.gasUsed(string): The amount of gas used by the creation.
- For
reward: No additional fields. - For
suicide: No additional fields.
- For
-
subtraces(integer): The number of subtraces (nested traces) generated by this trace. -
traceAddress(array of integers): The address within the trace hierarchy. -
transactionHash(string): The hash of the transaction containing the trace. -
transactionPosition(integer): The index position of the transaction within the block. -
type(string): The type of trace (e.g., "call", "create", "reward", "suicide").
Request example
curl -X POST https://rpc.ankr.com/telos/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [{
"fromBlock": "0x3ff718",
"toBlock": "0x3ff720",
"fromAddress": ["0x1234567890abcdef1234567890abcdef12345678"],
"toAddress": ["0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"],
"topics": [["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"]]
}],
"id": 1
}'
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": []
}