This class manages retrieving information from up-to-date Thorchain.

Constructors

  • Constructor to create a ThorchainCache

    Parameters

    • thornode: Thornode = defaultThornode

      An instance of the Thornode API (could be pointing to stagenet, testnet, or mainnet).

    • midgardQuery: MidgardQuery = defaultMidgardQuery

      An instance of the MidgardQuery class (could be pointing to stagenet, testnet, or mainnet).

    • expirePoolCacheMillis: number = 6000

      How long the pools should be cached before expiry.

    • expireInboundDetailsCacheMillis: number = 6000

      How long the InboundDetails should be cached before expiry.

    • expireNetworkValuesCacheMillis: number = TEN_MINUTES

      How long the Mimir/Constants should be cached before expiry.

    Returns ThorchainCache

    ThorchainCache

Properties

inboundDetailCache: CachedValue<Record<string, InboundDetail>>
midgardQuery: MidgardQuery
networkValuesCache: CachedValue<Record<string, number>>
poolCache: CachedValue<undefined | Record<string, LiquidityPool>>
thornode: Thornode

Methods

  • Returns the exchange of a CryptoAmount to a different Asset.

    Parameters

    • input: CryptoAmount

      The amount/asset to convert.

    • outAsset: Asset

      The asset you want to convert to.

    Returns Promise<CryptoAmount>

    Promise - The converted amount.

  • Gets the exchange rate of the from asset in terms of the to asset.

    Parameters

    • from: Asset
    • to: Asset

    Returns Promise<BigNumber>

    Promise - The exchange rate.

  • Gets the router address for a given chain.

    Parameters

    • chain: string

      The chain to get the router address for.

    Returns Promise<string>

    Promise

    - The router address.

Generated using TypeDoc