GenericSigner
Interface that all signer adapters must implement for the SDK to interact with wallets.
Import
import type { GenericSigner } from "@zama-fhe/sdk";Definition
interface GenericSigner {
readonly walletAccount: WalletAccountStore;
requireWalletAccount(operation: string): WalletAccount;
refreshWalletAccount?(): Promise<WalletAccount | undefined>;
signTypedData(typedData: EIP712TypedData): Promise<Hex>;
writeContract(config: WriteContractConfig): Promise<Hex>;
dispose?(): void;
}
interface WalletAccountStore {
getSnapshot(): WalletAccount | undefined;
subscribe(onWalletAccountChange: WalletAccountListener): () => void;
}Usage with createConfig
Implementing a custom signer
Methods
walletAccount
requireWalletAccount
refreshWalletAccount (optional)
dispose (optional)
signTypedData
writeContract
walletAccount.subscribe
Related
Last updated