SwapQuoter

Handles the encoding of calldata required to call the quoter contract.

GitHub File: quoter.ts

Properties

Public

PropertyTypeModifierDescription

INTERFACE

static

The Application Binary Interface for the related Elastic contracts.

Methods

quoteCallParameters() - public static

Based on the input parameters, handles the encoding of the relevant on-chain method that enables safe request for quotes.

Parameters

ParamsTypeDescription

route

Route<TInput, TOutput>

Array of potential pools with the same pair through which the swap can be routed. Ordered by the route the swap will take.

amount

CurrencyAmount<TInput, TOutput>

The quote amount in either amount in or amount out. Direction is determined by the tradeType.

tradeType

The type of trade: exact in OR exact out.

options

Default is {}.

Returns

TypeDescription

An object containing: calldata: string = The hex encoded calldata to perform the given operation. value: string = The amount of ether (wei) to send in hex.

Last updated