Function: assertCanonicalPair()
gSwap SDK 2.0.0-rc.4 / assertCanonicalPair
Function: assertCanonicalPair()
assertCanonicalPair(
token0,token1):void
Defined in: packages/gswap-sdk/dist/index.d.ts:4474
Asserts that a pair is in the contract's canonical order (token0 < token1 by plain string
comparison), which every write DTO requires. A pair a caller took from a stale quote or
position can be reversed; signing it would sign something other than what was priced.
Parameters
token0
string
token1
string
Returns
void
Throws
GSwapSDKError NON_CANONICAL_PAIR (params.token0, params.token1) otherwise.