Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Base

Class for Base Covalent API calls

date

1/13/2023 - 2:32:33 PM

export
implements

{IBase}

Hierarchy

  • Base

Implements

Index

Constructors

constructor

Properties

Private API_KEY

API_KEY: string

API key to use fo making calls to Covalent API V1 passed as a parameter &key=api_key

date

1/13/2023 - 2:32:33 PM

Private API_URL

API_URL: string
property

{string} API_URL for Covalent API

Methods

getBlock

  • Fetch A single Block.

    date

    1/13/2023 - 2:32:33 PM

    async

    Parameters

    • chainId: number

      for the network

    • blockHeight: number

      blockHeight to get Block from

    Returns Promise<ErrorResponse | Block>

getBlockHeights

  • Get Block Heights withing given dates

    date

    1/13/2023 - 2:32:33 PM

    async

    Parameters

    • chainId: number
    • startDate: string

      Datestring of the start date: YYYY:MM:mm:ss

    • endDate: string

      Datestring of the end date: YYYY:MM:mm:ss

    Returns Promise<ErrorResponse | BlockHeightRes>

getLogEventsByContractAddress

  • getLogEventsByContractAddress(chainId: number, contractAddress: string, startingBlock: number, endingBlock: number): Promise<ErrorResponse | LogEvents>
  • Fetch Events for a smart contract

    date

    1/13/2023 - 2:32:33 PM

    async

    Parameters

    • chainId: number

      of the Chain

    • contractAddress: string

      of the Contract

    • startingBlock: number

      Block height to fetch logs from

    • endingBlock: number

      block height to fetch logs up to

    Returns Promise<ErrorResponse | LogEvents>

getLogEventsByTopicHash

  • Description placeholder

    date

    1/13/2023 - 2:32:33 PM

    async

    Parameters

    • chainId: number

      chainId for the network to query contract log Events

    • topicHash: string
    • startingBlock: number

      starting Block to fetch from,

    • endingBlock: number

      end Block to fetch upto

    Returns Promise<ErrorResponse | LogEventsByTopicHash>

Generated using TypeDoc