Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.
- What's New
- Service Overview
- Getting Started
- User Guide
- User Guide (Staking Nodes)
-
Developer Guide
-
Ethereum Node Engine
- Introduction
- JSON-RPC API Request Examples
- Application Development
- Smart Contract Development
-
Ethereum APIs
- Dedicated Edition
-
Shared Edition
- eth_blocknumber
- eth_getBlockByNumber
- eth_getUncleByBlockNumberAndIndex
- eth_getUncleByBlockHashAndIndex
- eth_getUncleCountByBlockNumber
- eth_getUncleCountByBlockHash
- eth_getBlockByHash
- eth_getTransactionByHash
- eth_getTransactionCount
- eth_getTransactionByBlockHashAndIndex
- eth_getTransactionByBlockNumberAndIndex
- eth_getBlockTransactionCountByHash
- eth_getBlockTransactionCountByNumber
- eth_getTransactionReceipt
- eth_sendRawTransaction
- eth_call
- eth_createAccessList
- eth_estimateGas
- eth_feeHistory
- eth_maxPriorityFeePerGas
- eth_gasPrice
- eth_getBalance
- eth_subscribe
- eth_unsubscribe
- eth_getStorageAt
- eth_getCode
- eth_getProof
- eth_getLogs
- eth_getFilterChanges
- eth_getFilterLogs
- eth_newBlockFilter
- eth_newFilter
- eth_newPendingTransactionFilter
- eth_uninstallFilter
- eth_chainId
- web3_sha3
- web3_clientVersion
- net_version
- net_listening
- TRON Node Engine
-
Polygon PoS
- Polygon PoS Introduction
- HTTP Request Examples
- WebSocket Request Examples
-
Polygon PoS APIs
- Dedicated Edition
-
Shared Edition
-
Ethereum JSON-RPC APIs
- eth_blocknumber
- eth_getBlockByNumber
- eth_getUncleByBlockNumberAndIndex
- eth_getUncleByBlockHashAndIndex
- eth_getUncleCountByBlockNumber
- eth_getUncleCountByBlockHash
- eth_getBlockByHash
- eth_getTransactionByHash
- eth_getTransactionCount
- eth_getTransactionByBlockHashAndIndex
- eth_getTransactionByBlockNumberAndIndex
- eth_getBlockTransactionCountByHash
- eth_getBlockTransactionCountByNumber
- eth_getTransactionReceiptsByBlock
- eth_getTransactionReceipt
- eth_sendRawTransaction
- eth_call
- eth_createAccessList
- eth_estimateGas
- eth_feeHistory
- eth_maxPriorityFeePerGas
- eth_gasPrice
- eth_getBalance
- eth_getRootHash
- eth_subscribe
- eth_unsubscribe
- eth_getStorageAt
- eth_accounts
- eth_getCode
- eth_getProof
- eth_getLogs
- eth_getFilterChanges
- eth_getFilterLogs
- eth_newBlockFilter
- eth_newFilter
- eth_newPendingTransactionFilter
- eth_uninstallFilter
- eth_chainId
- web3_sha3
- web3_clientVersion
- Polygon JSON-RPC APIs
-
Ethereum JSON-RPC APIs
-
Arbitrum
- Arbitrum Introduction
- HTTP Request Examples
- WebSocket Request Examples
-
Arbitrum APIs
-
Shared Edition
-
Ethereum JSON-RPC APIs
- eth_blocknumber
- eth_getBlockByNumber
- eth_getUncleByBlockNumberAndIndex
- eth_getUncleByBlockHashAndIndex
- eth_getUncleCountByBlockNumber
- eth_getUncleCountByBlockHash
- eth_getBlockByHash
- eth_getTransactionByHash
- eth_getTransactionCount
- eth_getTransactionByBlockHashAndIndex
- eth_getTransactionByBlockNumberAndIndex
- eth_getBlockTransactionCountByHash
- eth_getBlockTransactionCountByNumber
- eth_syncing
- eth_getTransactionReceipt
- eth_sendRawTransaction
- eth_call
- eth_createAccessList
- eth_estimateGas
- eth_feeHistory
- eth_maxPriorityFeePerGas
- eth_gasPrice
- eth_getBalance
- eth_subscribe
- eth_unsubscribe
- eth_getStorageAt
- eth_accounts
- eth_getCode
- eth_getProof
- eth_getLogs
- eth_getFilterChanges
- eth_getFilterLogs
- eth_newBlockFilter
- eth_newFilter
- eth_newPendingTransactionFilter
- eth_uninstallFilter
- eth_chainId
- web3_sha3
- web3_clientVersion
-
Ethereum JSON-RPC APIs
-
Shared Edition
-
BNB Smart Chain
- BNB Smart Chain Introduction
- HTTP Request Examples
- WebSocket Request Examples
-
BNB Smart Chain APIs
- Dedicated Edition
-
Shared Edition
- eth_blocknumber
- eth_getBlockByNumber
- eth_hashrate
- eth_getUncleCountByBlockNumber
- eth_getUncleCountByBlockHash
- eth_getBlockByHash
- eth_getTransactionByHash
- eth_getTransactionCount
- eth_getTransactionByBlockHashAndIndex
- eth_getTransactionByBlockNumberAndIndex
- eth_getBlockTransactionCountByHash
- eth_getBlockTransactionCountByNumber
- eth_syncing
- eth_getTransactionReceipt
- eth_sendRawTransaction
- eth_call
- eth_mining
- eth_estimateGas
- eth_feeHistory
- eth_maxPriorityFeePerGas
- eth_gasPrice
- eth_getBalance
- eth_subscribe
- eth_unsubscribe
- eth_getStorageAt
- eth_accounts
- eth_getCode
- eth_getProof
- eth_getLogs
- eth_getFilterChanges
- eth_getFilterLogs
- eth_newBlockFilter
- eth_newFilter
- eth_newPendingTransactionFilter
- eth_uninstallFilter
- eth_chainId
- web3_sha3
- web3_clientVersion
- txpool_status
- net_listening
- net_version
- Batch Requests
-
Ethereum Node Engine
- API Reference
-
FAQs
-
APIs
- How Do I Determine Whether Flow Control Is Triggered for an API?
- What Are the Flow Control Policies for Full Nodes?
- How Many Methods Can Be Included in a JSON-RPC Batch Request for the Dedicated Version?
- How Many WebSocket Connections Can Be Made Each Time?
- How Do I Use HTTP Endpoints and Authentication Credentials to Access Nodes?
- Staking Nodes
-
APIs
- General Reference
Copied.
eth_getLogs
Introduction
This API returns an array of all the logs matching the given filter object. It consumes 75 CUs.
Parameter Description
Parameter |
Type |
Description |
---|---|---|
address |
String |
(Optional) A 20-byte contract address or a list of addresses from which logs should originate. |
fromBlock |
String |
(Optional) A hexadecimal block number, or the string (earliest, latest, or pending). Latest is set by default. |
toBlock |
String |
(Optional) A hexadecimal block number, or the string (earliest, latest, or pending). Latest is set by default. |
topics |
String |
(Optional) An array of 32-byte data topics. Topics are order-dependent. |
blockhash |
String |
(Optional) It restricts the logs returned to the single block referenced in the 32-byte hash blockHash. Using blockHash is equivalent to setting fromBlock and toBlock to the block number referenced in the blockHash. If blockHash is present in in the filter criteria, then neither fromBlock nor toBlock are allowed. |
Return Value
An array of log objects, or an empty array if nothing has changed since last poll. Log objects contain the following keys and their values:
- removed: true when the log was removed due to a chain reorganization. false if it is a valid log.
- logIndex: the hexadecimal of the log index position in the block. It is null for a pending log.
- transactionIndex: the hexadecimal of the transactions index position from which the log created. It is null for a pending log.
- transactionHash: 32 bytes. The hash of the transactions from which this log was created. It is null for a pending log.
- blockHash: 32 bytes. The hash of the block where this log was in. It is null for a pending log.
- blockNumber: the block number where this log was in. It is null for a pending log.
- address: 20 bytes. The address from which this log originated.
- data: It contains one or more 32-byte non-indexed arguments of the log.
- topics: an array of 0 to 4 indexed log arguments, each 32 bytes. In Solidity, the first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declare the event with the anonymous specifier.
Request
curl https://your-http-endpoint/v1/<API-KEY> \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}],"id":74}'
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot