Documentation
    Preparing search index...
    • Retrieves a swap quote between two coins using the aggregator API

      This function communicates with the aggregator API to find the best swap route between two tokens. It supports various parameters including DEX selection, amount specification, and API authentication.

      Parameters

      • fromCoinAddress: string

        The address of the coin to swap from

      • toCoinAddress: string

        The address of the coin to swap to

      • amountIn: string | number | bigint

        The amount of the fromCoin to swap (number, string, or bigint)

      • OptionalapiKey: string

        Optional API key for authentication

      • OptionalswapOptions: SwapOptions

        Optional swap options including baseUrl, dexList, byAmountIn, and depth

      Returns Promise<Quote>

      Promise - A promise that resolves to a Router object containing the swap route details

      Will throw an error if the API request fails or returns no data