UNPKG

@unilogin/sdk

Version:

SDK is a JS library, that communicates with relayer. SDK allows managing contract, by creating basic contract-calling messages.

30 lines 1.89 kB
import { BlockchainService } from '@unilogin/contracts'; import { RelayerRequest } from '@unilogin/commons'; import { utils } from 'ethers'; import { GnosisSafeService } from './GnosisSafeService'; import { WalletEventType } from '../../core/models/events'; export interface IWalletContractServiceStrategy { lastNonce: (walletAddress: string) => Promise<number>; keyExist: (walletAddress: string, key: string) => Promise<boolean>; requiredSignatures: (walletAddress: string) => Promise<utils.BigNumber>; signMessage: (privateKey: string, message: Uint8Array, walletAddress: string) => string; encodeFunction: (method: string, args?: any[], walletAddress?: string) => Promise<string> | string; getEventNameFor: (event: string) => WalletEventType; signRelayerRequest: (privateKey: string, relayerRequest: RelayerRequest) => RelayerRequest; } export declare class WalletContractService { private blockchainService; private beta2Service; private gnosisSafeService; private memoizedWalletVersions; constructor(blockchainService: BlockchainService, beta2Service: IWalletContractServiceStrategy, gnosisSafeService: GnosisSafeService); getWalletService(walletAddress: string): Promise<IWalletContractServiceStrategy>; lastNonce(walletAddress: string): Promise<number>; keyExist(walletAddress: string, key: string): Promise<boolean>; requiredSignatures(walletAddress: string): Promise<utils.BigNumber>; signMessage(walletAddress: string, privateKey: string, message: Uint8Array): Promise<string>; encodeFunction(walletAddress: string, method: string, args?: any[]): Promise<string>; getEventNameFor(walletAddress: string, event: string): Promise<WalletEventType>; signRelayerRequest(privateKey: string, relayerRequest: RelayerRequest): Promise<RelayerRequest>; } //# sourceMappingURL=WalletContractService.d.ts.map