chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
32 lines (31 loc) • 1.8 kB
TypeScript
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 { ChainGateContext } from '../../../Currencies/CurrencyUtils/ChainGateContext';
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(context: ChainGateContext, secret: PrivateKey | Encrypted, askForPassword?: (attempts: number, reject: () => void) => Promise<string>);
static new(context: ChainGateContext, privateKey: Uint8Array | string, warnAboutUnencrypted: boolean, encrypt?: Encrypt): Promise<PrivateKeyWallet>;
static import(context: ChainGateContext, exported: SerializedPrivateKeyWallet, askForPassword: (attempts: number, reject: () => void) => Promise<string>): Promise<PrivateKeyWallet>;
getWalletUniqueId(): Promise<string>;
protected serializeInternal(): Promise<SerializedPrivateKeyWallet>;
}