Skip to main content

Core Entities

The following entities are the core ones, used in all the other libraries that the SDK provides


abstract class BaseCurrency
constructor(chainId: number, decimals: number, symbol?: string, name?: string)


class Token extends BaseCurrency
constructor(chainId: number, address: string, decimals: number, symbol?: string, name?: string) 

Token base entity used in helpers allowing you to wrap an address as a typed object and is used in other entities like SupportedToken


class Fraction
constructor(numerator: BigintIsh, denominator: BigintIsh = JSBI.BigInt(1)) 

Fraction is usually used in other core entities like CurrencyAmount


class CurrencyAmount<T extends Currency> extends Fraction
constructor(currency: T, numerator: BigintIsh, denominator?: BigintIsh)

CurrencyAmount represents a base entity allowing you to perform various operations on values like fromRawAmount (casts a number to CurrencyAmount), toFixed, toExact and others. The getter wrapped returns the CurrencyAmount object