Type Definitions
This page documents the core type definitions and interfaces used throughout the Uniswap SDK Core.
Core Types
Currency
Base interface for all currencies (tokens and native currencies).
interface Currency {
readonly isNative: boolean
readonly isToken: boolean
readonly chainId: number
readonly decimals: number
readonly symbol?: string
readonly name?: string
}
BigintIsh
Union type for values that can be converted to BigInt.
type BigintIsh = JSBI | string | number
Used throughout the SDK for numeric inputs that need high precision.
Utility Types
TradeType
Enum for specifying trade direction:
enum TradeType {
EXACT_INPUT,
EXACT_OUTPUT
}
Rounding
Enum for mathematical rounding modes:
enum Rounding {
ROUND_DOWN,
ROUND_HALF_UP,
ROUND_UP
}
Chain Support
ChainId
Supported blockchain networks:
enum ChainId {
MAINNET = 1,
GOERLI = 5,
SEPOLIA = 11155111,
OPTIMISM = 10,
OPTIMISM_GOERLI = 420,
ARBITRUM_ONE = 42161,
ARBITRUM_GOERLI = 421613,
POLYGON = 137,
POLYGON_MUMBAI = 80001,
CELO = 42220,
CELO_ALFAJORES = 44787,
GNOSIS = 100,
MOONBEAM = 1284,
BNB = 56,
AVALANCHE = 43114,
BASE_GOERLI = 84531,
BASE = 8453
}
Constants
Key constants used throughout the SDK:
MaxUint256- Maximum uint256 valueZERO- BigInt zero valueONE- BigInt one valueTWO- BigInt two valueTHREE- BigInt three value