maia-core-sdk
Version:
⚒️ An SDK for building applications on top of Maia DAO Ecosytem
76 lines (75 loc) • 3.25 kB
TypeScript
import type { Currency } from '../../tokens/currency';
import { BaseCurrency } from '../baseCurrency';
/**
* Represents an ERC20 token with a unique address and some metadata native to a given chain.
*/
export declare class NativeToken extends BaseCurrency {
readonly isNative: false;
readonly isToken: true;
readonly isGlobal: boolean;
readonly isAcross: boolean;
readonly acrossInfo?: {
[chain: number]: {
address: string;
decimals?: number;
};
};
/**
* The contract address on the chain on which this token lives.
*/
readonly address: string;
/**
*
* @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 isAcross If true, the token is supported by Across
* @param isOFT If true, the token is an OFT (Omnichain Fungible Token)
* @param oftAdapter The address of the token's OFT adapter, if applicable
* @param oftVersion The version of the OFT (Omnichain Fungible Token)
* @param endpointVersion The version of the Layer Zero endpoint used
* @param endpointId The ID of the Layer Zero endpoint used
* @param oftSharedDecimals The OFT's “lowest common denominator” of decimal precision across all chains in the OFT system.
* @param oftFee The OFT bridging fee and minimum destination gas per chain in bips, if applicable
* @param oftPeers The OFT's connected peers
* @param acrossInfo The across connected peers
* @param priceSource The price source for the token, if applicable
*/
constructor(chainId: number, address: string, decimals: number, symbol?: string, name?: string, bypassChecksum?: boolean, isAcross?: boolean, isOFT?: boolean, oftAdapter?: string, oftVersion?: number, endpointVersion?: number, endpointId?: number, oftSharedDecimals?: number, oftFee?: {
[chain: number]: {
oftFee?: number;
minDstGas?: number;
};
}, oftPeers?: {
[chain: number]: {
tokenAddress?: string;
};
}, acrossInfo?: {
[chain: number]: {
address: string;
decimals?: number;
};
}, priceSource?: {
address?: string;
chainId: number;
});
/**
* 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: NativeToken): boolean;
/**
* Return this token, which does not need to be wrapped
*/
get wrapped(): this;
}