Skip to main content

Type Alias: SwapAmount

gSwap SDK 2.0.0-rc.4


gSwap SDK 2.0.0-rc.4 / SwapAmount

Type Alias: SwapAmount

SwapAmount = { amountInMaximum?: undefined; amountOutMinimum?: NumericAmount; exactIn: NumericAmount; exactOut?: undefined; priceLimit?: NumericAmount; } | { amountInMaximum?: NumericAmount; amountOutMinimum?: undefined; exactIn?: undefined; exactOut: NumericAmount; priceLimit?: NumericAmount; }

Defined in: packages/gswap-sdk/dist/index.d.ts:2621

What a swap trades: exactly one of exactIn (sell this much of the input token) or exactOut (receive this much of the output token), with that side's slippage bound and an optional sqrt-price limit.

Union Members​

Type Literal​

{ amountInMaximum?: undefined; amountOutMinimum?: NumericAmount; exactIn: NumericAmount; exactOut?: undefined; priceLimit?: NumericAmount; }

amountInMaximum?​

optional amountInMaximum?: undefined

amountOutMinimum?​

optional amountOutMinimum?: NumericAmount

exactIn​

exactIn: NumericAmount

exactOut?​

optional exactOut?: undefined

priceLimit?​

optional priceLimit?: NumericAmount

Sqrt-price limit passed through to the chain as priceLimit; omitted when undefined.


Type Literal​

{ amountInMaximum?: NumericAmount; amountOutMinimum?: undefined; exactIn?: undefined; exactOut: NumericAmount; priceLimit?: NumericAmount; }

amountInMaximum?​

optional amountInMaximum?: NumericAmount

amountOutMinimum?​

optional amountOutMinimum?: undefined

exactIn?​

optional exactIn?: undefined

exactOut​

exactOut: NumericAmount

priceLimit?​

optional priceLimit?: NumericAmount

Sqrt-price limit passed through to the chain as priceLimit; omitted when undefined.