@syncswap/sdk
Version:
SyncSwap TypeScript SDK for building DeFi applications
51 lines • 1.7 kB
TypeScript
export interface TokenInfo {
description?: string;
website?: string;
twitter?: string;
discord?: string;
telegram?: string;
coingecko?: string;
coinmarketcap?: string;
docs?: string;
}
export interface TokenListItemMetadata {
about: string;
links?: any;
}
/**
* Represents an ERC20 token with a unique address and some metadata.
*/
export declare class Token {
readonly address: string;
decimals: number;
readonly symbol: string;
readonly name: string;
readonly icon: string;
readonly hidden?: boolean;
readonly info?: TokenInfo;
readonly bridgable?: boolean;
readonly metadata?: TokenListItemMetadata;
imported?: boolean;
network?: string;
wrapper?: string;
baseToken?: string;
constructor(address: string, decimals: number, symbol: string, name: string, hidden?: boolean, icon?: string, info?: TokenInfo, bridgable?: boolean, imported?: boolean, metadata?: TokenListItemMetadata, wrapper?: string, baseToken?: string);
static _ETHER: Token;
static _SOPH: Token;
static ETHER: Token;
toString(): string;
/**
* Returns true if the two tokens are equivalent, i.e. have the same chainId and address.
* @param other other token to compare
*/
equals(other: Token): 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
*/
isSorted(other: Token): boolean;
}
export declare function useTokenIconURI(address: string): string;
//# sourceMappingURL=token.d.ts.map