@xeiswap/sdk-core
Version:
⚒️ An SDK for building applications on top of Xei V3
49 lines (48 loc) • 2.02 kB
TypeScript
import { BigNumber } from '@ethersproject/bignumber';
import { BaseCurrency } from './baseCurrency';
import { Currency } from './currency';
/**
* Represents an ERC20 token with a unique address and some metadata.
*/
export declare class Token extends BaseCurrency {
readonly isNative: false;
readonly isToken: true;
/**
* The contract address on the chain on which this token lives
*/
readonly address: string;
/**
* Relevant for fee-on-transfer (FOT) token taxes,
* Not every ERC20 token is FOT token, so this field is optional
*/
readonly buyFeeBps?: BigNumber;
readonly sellFeeBps?: BigNumber;
/**
*
* @param chainId {@link BaseCurrency#chainId}
* @param address The contract address on the chain on which this token lives
* @param decimals {@link BaseCurrency#decimals}
* @param symbol {@link BaseCurrency#symbol}
* @param name {@link BaseCurrency#name}
* @param bypassChecksum If true it only checks for length === 42, startsWith 0x and contains only hex characters
* @param buyFeeBps Buy fee tax for FOT tokens, in basis points
* @param sellFeeBps Sell fee tax for FOT tokens, in basis points
*/
constructor(chainId: number, address: string, decimals: number, symbol?: string, name?: string, bypassChecksum?: boolean, buyFeeBps?: BigNumber, sellFeeBps?: BigNumber);
/**
* Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
* @param other other token to compare
*/
equals(other: Currency): boolean;
/**
* Returns true if the address of this token sorts before the address of the other token
* @param other other token to compare
* @throws if the tokens have the same address
* @throws if the tokens are on different chains
*/
sortsBefore(other: Token): boolean;
/**
* Return this token, which does not need to be wrapped
*/
get wrapped(): Token;
}