Hethers
  • Documentation
  • Getting Started
  • Application Programming Interface
    • Providers
      • Provider
        • Accounts Methods
        • Logs Methods
        • Network Status Methods
        • Transactions Methods
        • Event Emitter Methods
        • Base Provider
        • HederaProvider
      • Types
    • Contract Interaction
      • Contract
      • ContractFactory
      • Example: ERC-20 Contract
    • Utilities
      • Accounts
      • Addresses
      • Application Binary Interface
        • AbiCoder
        • ABI Formats
        • Fragments
        • Interface
      • BigNumber
      • Byte Manipulation
      • Constants
      • Display Logic and Input
      • Encoding Utilities
      • FixedNumber
      • Hashing Algorithms
      • HD Wallet
      • Logging
      • Property Utilities
      • Signing Key
      • Strings
      • Transactions
      • Web Utilities
      • Wordlists
    • Signers
  • Contributing
  • Other Resources
Powered by GitBook
On this page
  1. Application Programming Interface
  2. Providers
  3. Provider

Logs Methods

PreviousAccounts MethodsNextNetwork Status Methods

Last updated 3 years ago

provider.getLogs(filter) ⇒ Promise<Array<>>

Returns the Array of matching the filter.

Keep in mind that many backends will discard old events, and that requests which are too broad may get dropped as they require too many resources to execute the query.

const filterParams = {
    // address: "0.0.25623322",
    address: "0x000000000000000000000000000000000186fb1A",
    fromTimestamp: "1642065156.264170833",
    toTimestamp: "1642080642.176149864"
}
await provider.getLogs(filterParams);
// {
//     "logs": [
//         {
//             "address": "0x000000000000000000000000000000000186fb1a",
//             "bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000040000000000000000000000000000000000000000000000002000000000008000000000000000000000000000000000000000000000000020000000000000000000800000400000000000000000010000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
//             "contract_id": "0.0.25623322",
//             "data": "0x00000000000000000000000000000000000000000000003635c9adc5dea00000",
//             "index": 0,
//             "topics": [
//                 "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
//                 "0x0000000000000000000000000000000000000000000000000000000000000000",
//                 "0x0000000000000000000000000000000000000000000000000000000000179977"
//             ],
//             "root_contract_id": "0.0.25623322",
//             "timestamp": "1642080642.176149864"
//         },
//         {
//             "address": "0x000000000000000000000000000000000186fb1a",
//             "bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000040000000000000000000000000000000000000000000000002000000000008000000000000000000000000000000000000000000000000020000000000000000000800000400000000000000000010000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
//             "contract_id": "0.0.25623322",
//             "data": "0x00000000000000000000000000000000000000000000003635c9adc5dea00000",
//             "index": 0,
//             "topics": [
//                 "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
//                 "0x0000000000000000000000000000000000000000000000000000000000000000",
//                 "0x0000000000000000000000000000000000000000000000000000000000179977"
//             ],
//             "root_contract_id": "0.0.25623322",
//             "timestamp": "1642065156.264170833"
//         }
//     ]
// }
Log
Log