UNPKG

chaingate

Version:

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

32 lines (31 loc) 1.72 kB
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 { ChainGateContext } from '../../Currencies/CurrencyUtils/ChainGateContext'; 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(context: ChainGateContext, 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>; }