Class for retrieving data and processing it from the Midgard API using MidgardCache to optimize the number of requests (MAYAChain L2 API).

Constructors

  • Constructor to create a MidgardQuery instance.

    Parameters

    • midgardCache: MidgardCache = ...

      An instance of the MidgardCache (could be pointing to stagenet, testnet, mainnet).

    Returns MidgardQuery

    MidgardQuery

Properties

midgardCache: MidgardCache

Methods

  • Retrieves the latest block height using the Health endpoint within Midgard.

    Returns Promise<number>

    The latest block height.

  • Retrieves MAYAName details.

    Parameters

    • mayaName: string

      The MAYAName.

    Returns Promise<undefined | THORNameDetails>

    An array of chains and their addresses associated with the given MAYAName.

  • Performs a reverse lookup to get MAYAName(s) associated with the given address.

    Parameters

    • address: string

      The address to check for associated MAYAName(s).

    Returns Promise<undefined | ReverseTHORNames>

    An array of MAYAName(s) associated with the given address.

  • Retrieves member details.

    Parameters

    • address: string

      The member address.

    Returns Promise<MemberDetails>

    An array of statistics for all the liquidity providers associated with a given member address.

  • Gets the network MidgardQuery is working with.

    Returns Network

    The network.

  • Retrieves the pool details for a specific asset.

    Parameters

    • asset: Asset

      The asset for which pool details are requested.

    Returns Promise<PoolDetail>

    Details of the selected pool.

    Throws

    If the pool for the asset cannot be found.

  • Retrieves pool statistics for a particular asset.

    Parameters

    • asset: Asset

      The asset string to query its pool stats.

    Returns Promise<PoolStatsDetail>

    Pool statistics details.

  • Retrieves the list of pools.

    Returns Promise<PoolDetail[]>

    An array containing details for a set of pools.

Generated using TypeDoc