UNPKG

chaingate

Version:

A complete TypeScript library for connecting to and making transactions on different blockchains

31 lines (30 loc) 1.48 kB
import { HDWallet } from './HDWallet/HDWallet'; import { AllCurrencies, SerializedWallet } from '../Wallet'; import { ExtendedPublicKey } from '../entities/Secret/implementations/ExtendedPublicKey'; import { WalletEncryption } from '../entities/WalletEncryption/WalletEncryption'; import { ChainGateClient } from 'chaingate-client'; import { Encrypted } from '../entities/WalletEncryption/Encrypted'; import { Seed } from '../entities/Secret/implementations/Seed'; import { Secret } from '../entities/Secret/Secret'; 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, AllCurrencies> { protected walletEncryption: WalletEncryption; protected walletUniqueId: string; protected constructor(apiClient: ChainGateClient, 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>; protected supportedCurrencies: AllCurrencies[]; }