Below is an exhaustive list of all the external types used in the SDK.
import BigNumber from 'bignumber.js'import { ethers } from 'ethers'import { SUPPORTED_CHAIN_ID, TRADE_TYPE, TRADE_EXACT, FIXED_UNDERFLOW_BEHAVIOR } from './constants'export type BigNumberish = BigNumber | ethers.utils.BigNumber | string | number//// types for on-chain, submitted, and normalized dataexport type ChainIdOrProvider = SUPPORTED_CHAIN_ID | ethers.providers.AsyncSendable | ethers.providers.Provider// type guard for ChainIdOrProviderexport function isChainId(chainIdOrProvider: ChainIdOrProvider): chainIdOrProvider is SUPPORTED_CHAIN_ID {const chainId: SUPPORTED_CHAIN_ID = chainIdOrProvider as SUPPORTED_CHAIN_IDreturn typeof chainId === 'number'}// type guard for ChainIdOrProviderexport function isLowLevelProvider(chainIdOrProvider: ChainIdOrProvider): chainIdOrProvider is ethers.providers.AsyncSendable {if (isChainId(chainIdOrProvider)) {return false} else {const provider: ethers.providers.AsyncSendable = chainIdOrProvider as ethers.providers.AsyncSendablereturn 'send' in provider || 'sendAsync' in provider}}export interface Token {chainId?: SUPPORTED_CHAIN_IDaddress?: stringdecimals: number}export interface TokenAmount {token: Tokenamount: BigNumberish}export interface TokenAmountNormalized {token: Tokenamount: BigNumber}export interface TokenReserves {token: Tokenexchange?: TokenethReserve: TokenAmounttokenReserve: TokenAmount}export interface TokenReservesNormalized {token: Tokenexchange?: TokenethReserve: TokenAmountNormalizedtokenReserve: TokenAmountNormalized}export interface EthReserves {token: Token}// type for input dataexport type OptionalReserves = TokenReserves | EthReserves | undefined// type guard for OptionalReservesexport function areTokenReserves(reserves: OptionalReserves): reserves is TokenReserves {const tokenReserves: TokenReserves = reserves as TokenReservesreturn (tokenReserves !== undefined && tokenReserves.ethReserve !== undefined && tokenReserves.tokenReserve !== undefined)}// type guard for OptionalReservesexport function areETHReserves(reserves: OptionalReserves): reserves is EthReserves {const tokenReserves: TokenReserves = reserves as TokenReservesreturn (tokenReserves !== undefined && tokenReserves.ethReserve === undefined && tokenReserves.tokenReserve === undefined)}// type for output dataexport type NormalizedReserves = TokenReservesNormalized | EthReserves// type guard for NormalizedReservesexport function areTokenReservesNormalized(reserves: NormalizedReserves): reserves is TokenReservesNormalized {const tokenReservesNormalized: TokenReservesNormalized = reserves as TokenReservesNormalizedreturn tokenReservesNormalized.ethReserve !== undefined && tokenReservesNormalized.tokenReserve !== undefined}//// types for computed dataexport interface Rate {rate: BigNumberrateInverted: BigNumber}export interface MarketDetails {tradeType: TRADE_TYPEinputReserves: NormalizedReservesoutputReserves: NormalizedReservesmarketRate: Rate}export interface TradeDetails {marketDetailsPre: MarketDetailsmarketDetailsPost: MarketDetailstradeType: TRADE_TYPEtradeExact: TRADE_EXACTinputAmount: TokenAmountNormalizedoutputAmount: TokenAmountNormalizedexecutionRate: RatemarketRateSlippage: BigNumberexecutionRateSlippage: BigNumber}export type MethodArgument = BigNumber | number | stringexport interface ExecutionDetails {exchangeAddress: stringmethodName: stringmethodId: stringvalue: BigNumbermethodArguments: MethodArgument[]}//// types for formatting dataexport type FlexibleFormat = BigNumber.Format | boolean// type guard for FlexibleFormatexport function isFormat(flexibleFormat: FlexibleFormat): flexibleFormat is BigNumber.Format {const format: BigNumber.Format = flexibleFormat as BigNumber.Formatreturn typeof format !== 'boolean'}export interface FormatSignificantOptions {significantDigits: numberroundingMode: BigNumber.RoundingModeforceIntegerSignificance: booleanformat: FlexibleFormat}export interface FormatFixedOptions {decimalPlaces: numberroundingMode: BigNumber.RoundingModedropTrailingZeros: booleanunderflowBehavior: FIXED_UNDERFLOW_BEHAVIORformat: FlexibleFormat}