fhenix-client-sdk-permits
Installation
SKILL.md
Fhenix Client SDK — Permits
Overview
A permit is an EIP-712 signature authorizing decryption of confidential data. The issuer must have been granted on-chain access via FHE.allow(handle, issuer). When used, CoFHE validates the permit against the ACL contract to confirm the issuer can decrypt the requested handle. Each permit carries a sealing keypair: the public key goes to CoFHE so it can re-encrypt for the holder; the private key stays client-side to unseal the result. Permits are scoped to chainId + account.
When is a permit required?
decryptForView→ always requires a permit (no.withoutPermit()).decryptForTx→ depends on the contract's ACL policy for thatctHash: if anyone may decrypt, use.withoutPermit(); if restricted, use.withPermit(...).
Quick start (recommended: client.permits)
await client.connect(publicClient, walletClient);
// Returns the active self permit if one exists, else creates + signs + stores + activates it.
const permit = await client.permits.getOrCreateSelfPermit();
After this, decryptForView(...).execute() and decryptForTx(...).withPermit().execute() pick up the active permit automatically.