PolicyKit Client
ThePolicyKit class is the high-level orchestrator that ties together IPFS pinning, on-chain deployment, Lit Protocol integration, and policy simulation.
Constructor
Options
| Option | Type | Required | Description |
|---|---|---|---|
publicClient | PublicClient | Yes | viem public client for reading chain state |
walletClient | WalletClient | Yes | viem wallet client for sending transactions |
engineAddress | Address | Yes | Deployed PolicyEngine contract address |
ipfsBackends | IPFSBackend[] | Yes | Array of IPFS backend configurations |
litConfig | LitConfig | No | Lit Protocol configuration (required for Tier 3 rules) |
IPFSBackend
LitConfig
Methods
deployPolicy(policy)
Deploy a policy to IPFS and register it on-chain.
| Parameter | Type | Description |
|---|---|---|
policy | Policy | The policy to deploy |
Promise<DeployResult>
updatePolicy(policy)
Update an existing policy. Pins the new version to IPFS and updates the on-chain reference.
| Parameter | Type | Description |
|---|---|---|
policy | Policy | The updated policy |
Promise<DeployResult>
removePolicy()
Remove the active policy from the caller’s account.
Promise<Hex> — The transaction hash
getPolicy(account)
Retrieve the active policy for an account.
| Parameter | Type | Description |
|---|---|---|
account | Address | The smart account address |
Promise<PolicyData | null>
simulate(policy, txParams)
Simulate a transaction against a policy locally.
| Parameter | Type | Description |
|---|---|---|
policy | Policy | The policy to evaluate against |
txParams | TxParams | Transaction parameters |
Promise<EvaluationReport>
requestAttestation(policy, txParams)
Request a Lit Protocol attestation for a transaction.
| Parameter | Type | Description |
|---|---|---|
policy | Policy | The policy with off-chain rules |
txParams | TxParams | Transaction parameters |
Promise<Attestation>

