Function: buildRequestTradeDto
buildRequestTradeDto(
input):RequestTradeDTO
Builds the RequestTrade DTO: exactIn sells that much of the input token (sell0Qty or
sell1Qty), exactOut buys that much of the output token (buy1Qty or buy0Qty), plus the
side's slippage bound and an optional priceLimit. Key order is
token0, token1, fee, uniqueKey, then the one quantity, then the slippage bound, then
priceLimit.
request trade dto exact in sell0 qty sell1 out buy1 buy0 price limit unique key
Parameters
| Parameter | Type |
|---|---|
input | RequestTradeInput |
request trade input
Returns
request trade dto
Example
const dto = buildRequestTradeDto({
token0: quote.token0Symbol, token1: quote.token1Symbol,
tokenInIsToken0: quote.tokenInIsToken0, fee: quote.fee,
uniqueKey: createUniqueKey('galaswap-operation-'),
exactIn: '100', amountOutMinimum: '14',
});