ThorchainQuery Class for interacting with THORChain. Recommended main class to use for swapping with THORChain Has access to Midgard and THORNode data



chainAttributes: Record<string, ChainAttributes>
thorchainCache: ThorchainCache


  • Finds the required confCount required for an inbound or outbound Tx to THORChain. Estimate based on Midgard data only. Finds the gas asset of the given asset (e.g. BUSD is on BNB), finds the value of asset in Gas Asset then finds the required confirmation count. ConfCount is then times by 6 seconds.


    • inbound: CryptoAmount

    Returns Promise<number>

    time in seconds before a Tx is confirmed by THORChain

  • Returns the exchange of a CryptoAmount to a different Asset Ex. convert(input:100 BUSD, outAsset: BTC) -> 0.0001234 BTC


    • input: CryptoAmount

      amount/asset to convert to outAsset

    • outAsset: Asset

    Returns Promise<CryptoAmount>

    CryptoAmount of input

  • Generate the memo and estimate the cost of registering or updating a THORName.


    Returns Promise<{
        memo: string;
        value: CryptoAmount;

    Memo and value of deposit.

  • Get errors related to estimating the addition of funds to a saver's pool.


    • addAmount: CryptoAmount

      Amount of funds to be added to the saver's pool.

    Returns Promise<string[]>

    An array of strings representing any errors encountered during the estimation process.

  • Convenience method to convert TotalFees to a different CryptoAmount TotalFees are always calculated and returned in RUNE, this method can be used to show the equivalent fees in another Asset Type


    Returns Promise<TotalFees>

    TotalFees in asset

  • Validate a cryptoAmount is well formed


    • cryptoAmount: CryptoAmount

      CryptoAmount to validate

    Returns Promise<void | Error>

    Error if the cryptoAmount is not well formed

Generated using TypeDoc