Creates an instance of FhenixClient. Initializes the fhevm library if needed and retrieves the public key for encryption from the provider.
Parameters to initialize the client.
Optional
type: EncryptionTypesExports all stored permits.
Creates a new permit for a specific contract address. Also saves the permit to localstorage (if available)
The address of the contract.
Optional
provider: SupportedProviderThe provider from which to sign the permit - must container a signer.
Optional
signer: PermitSignerthe signer to use to sign the permit if provider does not support signing (e.g. hardhat)
Permit - The permit associated with the contract address.
Retrieves the stored permit for a specific contract address.
The address of the contract.
The address of the user account.
Stores a permit for a specific contract address. Will overwrite any existing permit for the same contract address. Does not store the permit in localstorage (should it?)
The permit to store.
Unseals an encrypted message using the stored permit for a specific contract address.
The address of the contract.
The encrypted message to unseal.
The account attached to existing permits.
bigint - The unsealed message.
Static
getRetrieves the FHE public key from the provider.
The provider from which to retrieve the key.
The security zone for which to retrieve the key (default 0).
The FhenixClient class provides functionalities to interact with a FHE (Fully Homomorphic Encryption) system. It includes methods for encryption, unsealing, and managing permits.