chaingate
Version:
A complete TypeScript library for connecting to and making transactions on different blockchains
32 lines (31 loc) • 1.63 kB
TypeScript
import { ChainGateClient } from 'chaingate-client';
import { PublicKey } from '../../entities/PublicKey';
import { PrivateKey } from '../../entities/Secret/implementations/PrivateKey';
import { AllCurrencies, CurrencyMap, SerializedWallet, Wallet } from '../../Wallet';
import { Encrypted } from '../../entities/WalletEncryption/Encrypted';
import { Encrypt } from '../../entities/WalletEncryption/WalletEncryption';
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<AllCurrencies> {
private publicKey;
private walletUniqueId;
private walletEncryption;
getPublicKey(): Promise<PublicKey>;
getPrivateKey(): Promise<PrivateKey>;
protected constructor(apiClient: ChainGateClient, secret: PrivateKey | Encrypted, askForPassword?: (attempts: number, reject: () => void) => Promise<string>);
static new(apiKey: string, privateKey: Uint8Array | string, warnAboutUnencrypted: boolean, encrypt?: Encrypt): Promise<PrivateKeyWallet>;
static import(apiKey: string, exported: SerializedPrivateKeyWallet, askForPassword: (attempts: number, reject: () => void) => Promise<string>): Promise<PrivateKeyWallet>;
currency<T extends AllCurrencies>(currency: AllCurrencies): CurrencyMap[T];
protected supportedCurrencies: AllCurrencies[];
getWalletUniqueId(): Promise<string>;
protected serializeInternal(): Promise<SerializedPrivateKeyWallet>;
}