UNPKG

@tmawallet/sdk

Version:
31 lines (30 loc) 1.22 kB
import { EventEmitter } from 'eventemitter3'; import { IClientBundle } from './client/ClientBundleController'; import { AbstractStorage } from './storage/AbstractStorage'; export interface ITMAWClientOptions { storage?: AbstractStorage; endpoint?: string; telegramInitData?: string; } export type TMAWalletClientEvents = 'walletChanged'; export declare class TMAWalletClient extends EventEmitter<TMAWalletClientEvents> { readonly projectPublicToken: string; private _bundle; private readonly telegramInitData; readonly storage: AbstractStorage; private readonly endpoint; private clientBundleController; constructor(projectPublicToken: string, options?: ITMAWClientOptions); get isBundleExists(): boolean; get bundle(): IClientBundle | null; _init(): Promise<void>; _authenticate(): Promise<void>; private _createBundle; _storeWalletAddress(type: string, walletAddress: string): Promise<void>; destroyBundleAndLoseWalletAccessForever(): Promise<void>; private getIntermediaryKeyAttempt; private getIntermediaryKey; private restorePrivateKey; accessPrivateKey(): Promise<Uint8Array<ArrayBufferLike>>; createBundle(): Promise<void>; }