@array.inc/sdk
Version:
🛠An SDK for building applications on top of Array.
54 lines (53 loc) • 1.97 kB
TypeScript
import { Currency } from './Currency';
import { Token } from './Token';
/**
* A currency is any fungible financial instrument, including Ether, all ERC20 tokens, and other chain-native currencies
*/
export declare abstract class AbstractCurrency {
/**
* Returns whether the currency is native to the chain and must be wrapped (e.g. Ether)
*/
abstract readonly isNative: boolean;
/**
* Returns whether the currency is a token that is usable in Uniswap without wrapping
*/
abstract readonly isToken: boolean;
/**
* The chain ID on which this currency resides
*/
readonly chainId: number;
/**
* The decimals used in representing currency amounts
*/
readonly decimals: number;
/**
* The symbol of the currency, i.e. a short textual non-unique identifier
*/
readonly symbol?: string;
/**
* The name of the currency, i.e. a descriptive textual non-unique identifier
*/
readonly name?: string;
/**
* Constructs an instance of the base class `BaseCurrency`.
* @param chainId the chain ID on which this currency resides
* @param decimals decimals of the currency
* @param symbol symbol of the currency
* @param name of the currency
*/
protected constructor(chainId: number, decimals: number, symbol?: string, name?: string);
/**
* Returns whether this currency is functionally equivalent to the other currency
* @param other the other currency
*/
abstract equals(other: Currency): boolean;
/**
* Return the wrapped version of this currency that can be used with the Uniswap contracts. Currencies must
* implement this to be used in Uniswap
*/
abstract get wrapped(): Token;
/**
* Returns token address. Useful in cases where a dependency is needed to detect changes (e.g. useEffect).
*/
serialize(): string;
}