@beraji/wallet-sdk
Version:
Beraji: Distributed Secret Sharing.
62 lines (61 loc) • 1.5 kB
TypeScript
import { BWallet } from '../bwallet';
import { IApplication, ISession } from '../types';
import type { TransactionRequest } from 'viem';
export declare enum TxStatus {
Failed = -2,
Rejected = -1,
Init = 0,
Pending = 1,
Success = 2
}
export interface IWeb3Tx {
_id: string;
buid: string;
address: `0x${string}`;
meta: TransactionRequest;
chainId: number;
sig: string;
hash: string;
error: string;
status: TxStatus;
retry?: number;
createdAt: string;
}
export interface IMessage {
_id: string;
buid: string;
address: `0x${string}`;
message: `0x${string}`;
signature: `0x${string}`;
status: MsgStatus;
createdAt: string;
}
export declare enum MsgStatus {
Rejected = -1,
Init = 0,
Signed = 1
}
export type BNet = 'local' | 'test' | 'prod';
export declare const RPCS: Record<BNet, string>;
export declare const TELE_APPS: Record<BNet, string>;
export type BUserParams = {
net?: BNet;
};
export declare class BAuth {
private _token;
net: BNet;
constructor(params: BUserParams);
get conPub(): import("axios").AxiosInstance;
get conAuth(): import("axios").AxiosInstance;
getToken(): string;
setToken(token: string): void;
getAuthData(signer: BWallet): Promise<{
address: string;
expired_at: number;
signature: string;
}>;
getSessionData(sessionId: string): Promise<{
application: IApplication;
session: ISession;
}>;
}