UNPKG

evm-blockchain-tools

Version:

This is a collection of resuseable tools to support development for EVM-powered blockchains

27 lines (26 loc) 1.46 kB
import { OperationResult } from "mvc-common-toolkit"; import { CryptoWalletEngine, WALLET_TYPE, WalletStorage } from "../common/interfaces"; export interface CreatedWalletResponse { walletId: string; address: string; userPrivate?: string; } export type GetWalletOptions = { userSecret: string; serverSecret: string; recoverySecret: string; }; export type CreateWalletOptions = { userKeepsOwnPrivate: boolean; recoverable: boolean; }; export declare class CryptoWalletBank { protected storageEngine: Pick<WalletStorage, "create" | "getOne" | "deleteById">; protected evmWalletEngine: CryptoWalletEngine; constructor(storageEngine: Pick<WalletStorage, "create" | "getOne" | "deleteById">, evmWalletEngine: CryptoWalletEngine); importWallet(username: string, walletName: string, secret: string, data: any, type: WALLET_TYPE, options?: CreateWalletOptions): Promise<OperationResult<CreatedWalletResponse>>; createNewWallet(username: string, walletName: string, secret: string, type: WALLET_TYPE, options?: CreateWalletOptions): Promise<OperationResult<CreatedWalletResponse>>; deleteWallet(username: string, walletName: string): Promise<OperationResult<void>>; getWalletInfo(username: string, walletName: string): Promise<OperationResult<CreatedWalletResponse>>; recoverWallet(username: string, walletName: string, secret: string, options: Partial<GetWalletOptions>): Promise<OperationResult<string>>; }