@unilogin/sdk
Version:
SDK is a JS library, that communicates with relayer. SDK allows managing contract, by creating basic contract-calling messages.
58 lines • 2.8 kB
TypeScript
import { ApplicationWallet, Procedure, ExecutionOptions } from '@unilogin/commons';
import UniLoginSdk from '../../api/sdk';
import { FutureWallet } from '../../api/wallet/FutureWallet';
import { DeployingWallet } from '../../api/wallet/DeployingWallet';
import { Wallet } from 'ethers';
import { DeployedWallet } from '../..';
import { Property } from 'reactive-properties';
import { WalletState } from '../models/WalletService';
import { IStorageService } from '../models/IStorageService';
import { ConnectingWallet } from '../../api/wallet/ConnectingWallet';
declare type WalletFromBackupCodes = (username: string, password: string) => Promise<Wallet>;
export declare class WalletService {
readonly sdk: UniLoginSdk;
private readonly walletFromPassphrase;
private readonly walletSerializer;
private readonly walletStorage;
private readonly _stateProperty;
readonly stateProperty: Property<WalletState>;
walletDeployed: Property<boolean>;
isAuthorized: Property<boolean>;
get state(): WalletState;
private setState;
constructor(sdk: UniLoginSdk, walletFromPassphrase?: WalletFromBackupCodes, storageService?: IStorageService);
getDeployedWallet(): DeployedWallet;
getFutureWallet(): FutureWallet;
private getDeployingWallet;
getConnectingWallet(): ConnectingWallet;
createDeployingWallet(name: string): Promise<DeployingWallet>;
createFutureWallet(name: string, gasToken?: string): Promise<FutureWallet>;
createWallet(name: string, gasToken?: string): Promise<FutureWallet | DeployingWallet>;
initDeploy(): Promise<DeployingWallet>;
waitForTransactionHash(): Promise<DeployedWallet | DeployingWallet>;
waitToBeSuccess(): Promise<DeployedWallet>;
deployFutureWallet(): Promise<DeployedWallet>;
setFutureWallet(wallet: FutureWallet, name: string): void;
setDeployed(): void;
setDeploying(wallet: DeployingWallet): void;
setConnecting(wallet: ConnectingWallet): void;
setWallet(wallet: ApplicationWallet): void;
recover(name: string, passphrase: string): Promise<void>;
initializeConnection(name: string): Promise<number[]>;
waitForConnection(): Promise<unknown>;
cancelWaitForConnection(tick?: number, timeout?: number): Promise<void>;
connect(name: string, callback: Procedure): Promise<{
unsubscribe: () => void;
securityCode: number[];
}>;
removeWallet(executionOptions: ExecutionOptions): Promise<import("./ExecutionFactory").Execution | undefined>;
disconnect(): void;
saveToStorage(state: WalletState): void;
loadFromStorage(): Promise<void>;
finalize(): void;
getRequiredDeploymentBalance(): string;
isKind(kind: string): boolean;
getContractAddress(): string;
}
export {};
//# sourceMappingURL=WalletService.d.ts.map