Midgard Query

MidgardQuery

Class for getting data and process from Midgard API using MidgardCache for optimize request number (MAYAChain L2 Api).

Parameters

  • midgardCache an instance of the midgardCache (could be pointing to stagenet,testnet,mainnet) (optional, default new midgard_cache_1.MidgardCache())

getLatestBlockHeight

Gets the latest block using the Health endpoint within Midgard

getPools

Get pool list

Returns any an array containing details for a set of pools

getPool

Get pool by string asset

Parameters

  • asset Asset In example: BTC.BTC

  • Throws Error Can't find pool for asset

Returns PoolDetail Details of selected pool

getPoolStats

Function to return pool statistics for a particular asset

Parameters

  • asset asset string to query its pool stats

Returns any type object poolStatsDetail

getMAYANameDetails

Get MAYAName details

Parameters

Returns any an array of chains and their addresses associated with the given THORName

getMAYANameReverseLookup

Gives a list of MayaNames by reverse lookup

Parameters

  • address string to know if it has a MayaName associated with

Returns any an array of THORNames associated with the given address

getMemberDetails

Return member details

Parameters

Returns any an array of statistics for all the liquidity providers associated with a given member address

getNetwork

Get the network midgard query is working with