Skip to main content

Class: Quoting

Handles quote operations for token swaps.

Constructors

Constructor

new Quoting(
gatewayBaseUrl,
dexContractBasePath,
httpClient?): Quoting;

Parameters

ParameterType
gatewayBaseUrlstring
dexContractBasePathstring
httpClient?HttpClient

Returns

Quoting

Methods

quoteExactInput()

quoteExactInput(
tokenIn,
tokenOut,
amountIn,
fee?): Promise<GetQuoteResult>;

Gets a quote for an exact amount of token being sold.

Parameters

ParameterTypeDescription
tokenIn| string | GalaChainTokenClassKeyThe input token to sell.
tokenOut| string | GalaChainTokenClassKeyThe output token to buy.
amountInNumericAmountThe exact amount of input tokens you want to sell.
fee?FEE_TIERThe pool fee tier. If not specified, will check all available fee tiers and return the best quote.

Returns

Promise<GetQuoteResult>

The expected number of tokens you will receive (buy) when/if you execute the swap.


quoteExactOutput()

quoteExactOutput(
tokenIn,
tokenOut,
amountOut,
fee?): Promise<GetQuoteResult>;

Gets a quote for an exact amount of tokens being bought.

Parameters

ParameterTypeDescription
tokenIn| string | GalaChainTokenClassKeyThe input token sell.
tokenOut| string | GalaChainTokenClassKeyThe output token to buy.
amountOutstring | number | BigNumberThe exact amount of output tokens you want to buy.
fee?FEE_TIERThe pool fee tier. If not specified, will check all available fee tiers and return the best quote.

Returns

Promise<GetQuoteResult>

The expected number of tokens you will need to sell (input) to receive the specified amount of output tokens.