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.
Encrypts a numeric value according to the specified encryption type or the most efficient one based on the value.
The numeric value to encrypt.
Optional
type: EncryptionTypesOptional. The encryption type (uint8, uint16, uint32).
Encrypts an Address (Uint160) value using the stored public key.
The Address (Uint160) value to encrypt.
Encrypts a Uint8 value using the stored public key.
The Uint8 value to encrypt.
Encrypts a Uint128 value using the stored public key.
The Uint128 value to encrypt.
Encrypts a Uint16 value using the stored public key.
The Uint16 value to encrypt.
Encrypts a Uint256 value using the stored public key.
The Uint256 value to encrypt.
Encrypts a Uint32 value using the stored public key.
The Uint32 value to encrypt.
Encrypts a Uint64 value using the stored public key.
The Uint32 value to encrypt.
Encrypts a Uint8 value using the stored public key.
The Uint8 value to encrypt.
Exports 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.
The FhenixClient class provides functionalities to interact with a FHE (Fully Homomorphic Encryption) system. It includes methods for encryption, unsealing, and managing permits.