When running in "Gateway" mode, an IoTeX node exposes both the IoTeX native API and the Ethereum JSON API. The IoTeX native API is based on the gRPC protocol. In this document, we list the official IoTeX public gateway nodes exposing the gRPC API and the API calls reference.
Below is the alphabetical list of all available gRPC calls provided by the IoTeX native API. To run the examples you can use the grpcurl command-line client for your OS.
If you are accessing a non-TLS endpoint, make sure you use -plaintext option in your grpcurl command.
EstimateActionGasConsumptionByExecution
Usage:
Get Estimated Action Gas Consumption By Execution
Request:
Execution: iotextypes.Execution
-Amount: Execution Amount
-Contract: Contract Address
-Data: Data
CallerAddress: Address of Caller
Response:
Gas: Estimated Gas Amount
Usage:
Get Estimated Action Gas Consumption By Transfer
Request:
Transfer: iotextypes.Transfer
-Amount: Transfer Amount
-Recipient: Recipient Address
-Payload: Payload
CallerAddress: Address of Caller
Response:
Gas: Estimated Gas Amount
Usage:
Get Actions By Address
Request:
ByAddr: GetActionsByAddressRequest
-Address: Encoded Address
-Start: Start Index of Actions
-Count: Number of Actions
Resposne:
ActionInfo: List of Action Info
Usage:
Get Actions By Block
Request:
ByBlk: GetActionsByBlockRequest
-BlkHash: Block Hash
-Start: Start Index of Actions
-Count: Number of Actions
Resposne:
ActionInfo: List of ActionInfo
Usage:
Get Action By Action Hash
Request:
ByHash: GetActionByHashRequest
-ActionHash: Hash of Action
-CheckPending: Wether To Check Pending Actions in Action Pool
Response:
ActionInfo: Action Info
Usage:
Get Actions By Index
Request:
ByIndex: GetActionsByIndexRequest
-Start: Start Index of Actions
-Count: Number of Actions
Response:
ActionInfo: List of Action Info
Usage:
Get Block Metadata By Index
Request:
ByIndex: GetBlockMetasByIndexRequest
-Start: Start Block Height
-Count: Number of Blocks
Response:
BlkMetas: List of Block Metadata
Usage:
Get Epoch Metadata Given an Epoch Number
Request:
EpochNumber: Epoch Number
Response:
EpochData: Basic Epoch Information
TotalBlocks: Number of Blocks in the Epoch
BlockProducersInfo: List of Block Producer Information
Usage:
Get Logs filtered by contract address and Topics with given Block hash
Request:
Filter: LogsFilter
-Address: List of Addresses
-Topics: List of Topics
ByBlock: GetLogsByBlock
-BlockHash: blockhash
Response:
Logs: List of Logs
Usage:
Get Logs filtered by contract address and Topics with given Range
Request:
Filter: LogsFilter
-Address: List of Addresses
-Topics: List of Topics
ByRange: GetLogsByRange
-FromBlock: Start Block Height
-Count: Count of Blocks
Response:
Logs: List of Logs
Usage:
Get A List of Raw Block Data
Request:
StartHeight: Start Block Height
Count: Block Count
WithReceipts: Whether to Include Action Receipts in Each Returned Block
Response:
Blocks: A List of Raw Block Data
Usage:
Get Unconfirmed Actions By Address
Request:
UnconfirmedByAddr: GetUnconfirmedActionsByAddressRequest
-Address: Encoded Address
-Start: Start Index of Unconfirmed Actions
-Count: Number of Unconfirmed Actions
Resposne:
ActionInfo: List of Action Info
Usage:
Read State on Blockchain
Request:
ProtocolID: Protocol ID
MethodName: Method To Be Invoked To Read State
Arguments: List of Method Arguments
Height: BlockHeight of Request // optional, if empty, read from tip
Response:
Data: State Result
Usage:
Get Logs filtered by contract address and Topics in stream
Request:
Filter: LogsFilter
-Address: List of Addresses
-Topics: List of Topics
Response:
Logs: List of Logs