UNPKG

chaingate

Version:

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

34 lines (33 loc) 1.97 kB
import { PublicKey } from '../../entities/PublicKey'; import { PrivateKey } from '../../entities/Secret/implementations/PrivateKey'; import { Encrypted } from '../../entities/WalletEncryption/Encrypted'; import { Encrypt } from '../../entities/WalletEncryption/WalletEncryption'; import { SerializedWallet, Wallet } from '../../Wallet'; import { AllCurrencies } from '../../../Currencies/CurrencyModules'; import { Client } from '@hey-api/client-fetch'; import { TtlCache } from '../../../InternalUtils/TtlCache'; import { GlobalMarketsResponse } from '../../../Client'; export type SerializedPrivateKeyWallet = SerializedWallet & { secret: { iterations: number; dkLen: number; nonce: string; salt: string; data: string; cipher: string; }; publicKey: string; }; export declare class PrivateKeyWallet extends Wallet<(typeof AllCurrencies)[number]> { protected supportedCurrencies: readonly ["bitcoin", "bitcoinTestnet", "litecoin", "dogecoin", "bitcoinCash", "ethereum", "arbitrum", "avalanche", "base", "bnbChain", "fantom", "polygon"]; private publicKey; private walletUniqueId; private walletEncryption; getPublicKey(): Promise<PublicKey>; getPrivateKey(): Promise<PrivateKey>; protected constructor(client: Client, markets: TtlCache<GlobalMarketsResponse>, secret: PrivateKey | Encrypted, askForPassword?: (attempts: number, reject: () => void) => Promise<string>); static new(client: Client, markets: TtlCache<GlobalMarketsResponse>, privateKey: Uint8Array | string, warnAboutUnencrypted: boolean, encrypt?: Encrypt): Promise<PrivateKeyWallet>; static import(client: Client, markets: TtlCache<GlobalMarketsResponse>, exported: SerializedPrivateKeyWallet, askForPassword: (attempts: number, reject: () => void) => Promise<string>): Promise<PrivateKeyWallet>; getWalletUniqueId(): Promise<string>; protected serializeInternal(): Promise<SerializedPrivateKeyWallet>; }