chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
32 lines (31 loc) • 1.72 kB
TypeScript
import { Transports } from '../Currencies/CurrencyWallet/Transports';
import { CurrencyWallet } from '../Currencies/CurrencyWallet/CurrencyWallet';
import { AllCurrencies, CurrencyModules } from '../Currencies/CurrencyModules';
import { ChainGateContext } from '../Currencies/CurrencyUtils/ChainGateContext';
export type WalletOf<C extends keyof typeof CurrencyModules> = InstanceType<(typeof CurrencyModules)[C]['wallet']>;
export type InfoOf<C extends keyof typeof CurrencyModules> = (typeof CurrencyModules)[C]['info'];
export type SerializedWallet = {
format: 'ChainGate Serialize Wallet Format Version 2';
walletType: string;
walletUniqueId: string;
};
export declare abstract class Wallet<SupportedCurrencies extends (typeof AllCurrencies)[number]> {
protected abstract supportedCurrencies: readonly SupportedCurrencies[];
get client(): import("@hey-api/client-fetch").Client;
protected readonly context: ChainGateContext;
protected readonly transports: Transports;
protected constructor(context: ChainGateContext, transports: Transports);
currency<C extends SupportedCurrencies>(id: C): WalletOf<C>;
get allCurrencies(): Array<CurrencyWallet<InfoOf<SupportedCurrencies>>>;
abstract getWalletUniqueId(): Promise<string>;
protected abstract serializeInternal(): Promise<SerializedWallet>;
serialize(): Promise<string>;
getAllBalances(): Promise<{
currency: InfoOf<SupportedCurrencies>;
balance: {
confirmed: import("..").CurrencyAmount<InfoOf<SupportedCurrencies>>;
unconfirmed: import("..").CurrencyAmount<InfoOf<SupportedCurrencies>>;
};
}[]>;
static isSerializedWallet(serialized: object): boolean;
}