chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
26 lines (25 loc) • 1.37 kB
TypeScript
import { ChainGateClient } from 'chaingate-client';
import { Address } from '../Address';
import { CurrencyInfo } from './CurrencyInfo';
import { CurrencyProviders } from './CurrencyProviders';
import { CurrencyAmount } from './CurrencyAmount';
import { CurrencyPreparedTransaction } from './CurrencyPreparedTransaction';
import { FiatCurrencies } from '../../../MarketsProvider';
import Decimal from 'decimal.js';
export declare abstract class Currency {
readonly currencyInfo: CurrencyInfo;
protected currencyProviders: CurrencyProviders;
protected client: ChainGateClient;
protected constructor(currencyInfo: CurrencyInfo, client: ChainGateClient, currencyProviders: CurrencyProviders);
abstract amount(amountStr: string, unit: unknown): Promise<CurrencyAmount>;
amountFiat(amountStr: string, fiatCurrency: typeof FiatCurrencies[number]): Promise<CurrencyAmount>;
getUsdRate(): Promise<Decimal>;
abstract getAddress(): Promise<string>;
abstract getBalance(address?: string): Promise<{
confirmed: CurrencyAmount;
unconfirmed: CurrencyAmount;
}>;
abstract createTransfer(toAddress: Address, amount: CurrencyAmount): Promise<CurrencyPreparedTransaction>;
getPublicKey(): Promise<import("../PublicKey").PublicKey>;
getPrivateKey(): Promise<import("../Secret/implementations/PrivateKey").PrivateKey>;
}