import Web3 from "web3"; import { BigNumber } from 'bignumber.js'; import { Wallet } from "./wallet"; import { Network } from "./network"; export interface Currency { addr: string; decimals: number; symbol: string; name: string; } export declare function getCurrency(w3: Web3, addr: string): Promise; export interface CurrencyValue { /** * 原始金额 */ rawValue: BigNumber; /** * 货币 */ currency: Currency; /** * 显示金额 */ value: string; /** * 对应美元金额 */ usd?: CurrencyValue | null; } /** * 新建货币金额 * @param value 显示金额 * @param currency 货币 * @returns */ export declare function newValue(value: string, currency: Currency): CurrencyValue; /** * 新建货币金额 * @param rawValue 原始金额 * @param currency 货币 * @returns */ export declare function newRawValue(rawValue: BigNumber, currency: Currency): CurrencyValue; /** * 货币兑换 * @param w3 * @param chainId * @param from * @param to * @param rawValue */ export declare function exchange(w: Wallet, from: Currency, to: Currency, rawValue: BigNumber): Promise; export declare function getCurrencyByWallet(w: Wallet, symbol: string): Currency | undefined; export declare function getCurrencyByNetwork(network: Network, symbol: string): Currency | undefined; export declare function getCurrencyByAddress(chainId: string, addr: string): Currency | undefined; export declare function calculateValue(value: CurrencyValue): Promise; export declare function optimizeRawValue(rawValue: BigNumber): string; //# sourceMappingURL=currency.d.ts.map