@make-software/csprclick-core-client
Version:
CSPR.click core client package for web applications
40 lines (39 loc) • 1.89 kB
TypeScript
import { AccountType } from '@make-software/csprclick-core-types';
import { SendResult, SignResult } from '../types';
import { Log4TS } from '../log-config';
import { Provider } from '../provider';
import { CoreSdkSettings } from '../inner-types';
export default class CsprclickCustomjwt extends Provider {
#private;
private static instance;
private _logger;
private _released;
private _activePublicKey;
get logger(): Log4TS;
constructor(settings: CoreSdkSettings);
static getInstance(settings: CoreSdkSettings): CsprclickCustomjwt;
addEventListeners(): void;
releaseListeners(): void;
name(): string;
static IsPresent(): boolean;
static Name(): string;
static IsConnected(): Promise<boolean | undefined>;
static IsUnlocked(): Promise<boolean | undefined>;
version(): Promise<string | undefined>;
connect(options: any): Promise<AccountType | undefined>;
switchAccount(options: any): Promise<void>;
disconnect(): Promise<boolean>;
getActivePublicKey(): Promise<string | undefined>;
isConnected(): Promise<boolean | undefined>;
isUnlocked(): Promise<boolean | undefined>;
sign(payload: string | object, account: AccountType): Promise<SignResult | undefined>;
signMessage(message: string, account: AccountType): Promise<SignResult | undefined>;
send(payload: string | object, account: AccountType): Promise<SendResult>;
cancelSignatureRequest(deployHash: string): Promise<boolean>;
unlockAccountWithPin(unlockPin: string, trustDevice: boolean): Promise<void>;
saveUnlockPin(unlockPin: string, trustDevice: boolean): Promise<void>;
downloadKey(unlockPin: string): Promise<void>;
generateNewRecoveryPhrase(unlockPin: string): Promise<string>;
unlockAccountWithRecoveryPhrase(phrase: string): Promise<void>;
triggerEvent(evtType: string, evtDetail: any): void;
}