Client options
Options passed to theOneSwap constructor.
CreateSwapArgs
The argument to oneswap.swaps.createSwap.
poolId to createSwap so both operations use the same
pool.
WaitForSwapOptions
The optional second argument to oneswap.swaps.waitForSwap.
SwapStatus
The lifecycle status of a swap. Terminal statuses are returned, refunded, expired, failed, and cancelled.
SDK 1.2.0 added
cancelled, and added recovering and needs_review to the union — those
two were always reachable, but were missing from the published type. Both are non-terminal:
the funds are in motion and waitForSwap keeps polling. If you switch exhaustively over
SwapStatus, you may need new cases.Swap
Returned by createSwap, getSwap, and waitForSwap.
GetQuoteArgs
The argument to oneswap.quotes.get.
Quote
A swap quote. Amounts are numbers denominated in the input/output token.
QuoteResult
What quotes.get returns: the Quote plus the resolution the SDK did for you.
Token
One entry from tokens.list().
Pool
One entry from pools.list() (and the pool field of PoolDetail).
PoolDetail
What pools.get(id) returns.
PoolTicker
What pools.getTicker(id) returns. Formatted figures are strings; null means “not derivable right now”.
priceChange24h fields are null until the pool’s hourly price history is at least 24h old (warm-up), and price.usd is null when the pool cannot be USD-priced (e.g. unseeded).
PoolPairCandidate
Carried by AmbiguousPoolPairError.candidates when several pools trade a requested pair.