chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
34 lines (33 loc) • 1.82 kB
TypeScript
import { HDWallet } from './HDWallet/HDWallet';
import { SerializedWallet } from '../Wallet';
import { ExtendedPublicKey } from '../entities/Secret/implementations/ExtendedPublicKey';
import { WalletEncryption } from '../entities/WalletEncryption/WalletEncryption';
import { Encrypted } from '../entities/WalletEncryption/Encrypted';
import { Seed } from '../entities/Secret/implementations/Seed';
import { Secret } from '../entities/Secret/Secret';
import { AllCurrencies } from '../../Currencies/CurrencyModules';
import { Client } from '@hey-api/client-fetch';
import { TtlCache } from '../../InternalUtils/TtlCache';
import { GlobalMarketsResponse } from '../../Client';
export type SerializedSeedableWallet = SerializedWallet & {
secret: {
iterations: number;
dkLen: number;
nonce: string;
salt: string;
data: string;
cipher: string;
};
derivationPaths: Record<string, string>;
publicKeys: Record<string, string>;
};
export declare abstract class SeedableWallet extends HDWallet<ExtendedPublicKey, (typeof AllCurrencies)[number]> {
protected supportedCurrencies: readonly ["bitcoin", "bitcoinTestnet", "litecoin", "dogecoin", "bitcoinCash", "ethereum", "arbitrum", "avalanche", "base", "bnbChain", "fantom", "polygon"];
protected walletEncryption: WalletEncryption;
protected walletUniqueId: string;
protected constructor(client: Client, markets: TtlCache<GlobalMarketsResponse>, secret: Secret | Encrypted, askForPassword?: (attempts: number, reject: () => void) => Promise<string>);
abstract getSeed(): Promise<Seed>;
protected deriveFromPath(derivationPath: string): Promise<ExtendedPublicKey>;
protected internalSerialize(walletType: string): Promise<SerializedSeedableWallet>;
getWalletUniqueId(): Promise<string>;
}