fhenix-sdk

fhenix-sdk is a skill for Claude Code, Codex from FhenixProtocol/fhenix-toolkit. It costs 101 tokens per session (1,651 once invoked), scanned A, original, MIT.

Integration guidance for the Fhenix TypeScript SDK, which lets an application encrypt inputs and read encrypted results from confidential smart contracts.

In plain words
What is it for?
Use it in Next.js, React, wagmi, or viem apps that initialize @cofhe/sdk, encrypt inputs, create permits, or decrypt values for a screen or transaction.
Why use it?
It prevents setup and decryption errors by explaining required chain connections, explicit permission permits, lazy encryption setup, and the difference between Unix seconds and JavaScript milliseconds.

Skill for Claude CodeCodex

Part of the fhenix-toolkit plugin — 4 skills, 1 agent shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fhenixprotocol/fhenix-toolkit/fhenix-sdk
Any agent
npx skills add FhenixProtocol/fhenix-toolkit --skill fhenix-sdk
Clone the repo
git clone --depth 1 https://github.com/FhenixProtocol/fhenix-toolkit

Made for: Claude Code, Codex.

Or install fhenix-toolkit, the plugin that ships this one along with the rest of its 4 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fhenix-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/fhenixprotocol/fhenix-toolkit/fhenix-sdk.svg)](https://agentmods.dev/skills/fhenixprotocol/fhenix-toolkit/fhenix-sdk)
Your own site
<a href="https://agentmods.dev/skills/fhenixprotocol/fhenix-toolkit/fhenix-sdk"><img src="https://agentmods.dev/badge/skills/fhenixprotocol/fhenix-toolkit/fhenix-sdk.svg" alt="Measured on agentmods" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,651 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00101 $0.01651
Opus 5 $0.00051 $0.00826
Sonnet 5 $0.00020 $0.00330
Haiku 4.5 $0.00010 $0.00165

Measured 5d ago against content hash 4e152faa8ec2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fhenix-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/fhenix-toolkit/skills/fhenix-sdk/SKILL.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

fhenix-sdk — integrate @cofhe/sdk in dApps

You activate when the user is writing TypeScript that uses Fhenix's @cofhe/sdk — initializing the client, encrypting inputs, managing permits, decrypting handles, or building React/Next.js hooks around any of the above.

Hard rules — never violate

  1. Encryption is lazy. SDK keys aren't fetched until the first client.encryptInputs(...).execute(). Don't await createCofheClient for crypto-readiness; only the first .execute() triggers the heavy init.

  2. .connect(publicClient, walletClient) is mandatory before any .execute(). Without chain context, calls fail with opaque "no chain" errors.

  3. Permits are explicit — no auto-creation. Unlike legacy cofhejs, the new SDK does NOT auto-generate permits. Call client.permits.getOrCreateSelfPermit(...) before any decryptForView or decryptForTx().withPermit() call. Verify the current signature via references/lookup-recipes.md.

  4. Permit expiration is Unix SECONDS, not milliseconds. Date.now() returns ms — divide by 1000.

  5. decryptForTx(...).withoutPermit() requires on-chain FHE.allowPublic(ct). Otherwise the threshold network refuses. Pair them.

  6. The InEuintXX struct doesn't match wagmi's ABI inference — cast as any at the wagmi boundary, or build a typed wrapper.

  7. SSR-unsafe by default. In Next.js, wrap the client in a Proxy so it lazy-instantiates only in the browser. See references/concepts/init-singleton.md.

  8. issuer must equal the connected signer. Always derive issuer from client.getSnapshot().account — never hardcode. Hardcoding is the single most common cause of "Invalid issuer signature." See references/concepts/permit-issuer-gotcha.md.

  9. /web and /node are not interchangeable. /node is a strict subset. Don't alias web → node in your bundler. See references/concepts/entry-points-web-vs-node.md.

  10. Declare @cofhe/abi explicitly and pin it with @cofhe/sdk. @cofhe/sdk imports from it but doesn't declare it as a runtime dep. Pin both versions (e.g. via pnpm-workspace.yaml overrides) so transitives can't drift.

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 116 lines · 101 tokens per session scan A 4e152faa8ec2

Subscribe to this mod's changes

fhenix-sdk is a skill published in the GitHub repository FhenixProtocol/fhenix-toolkit (12 stars, last pushed 3mo ago), licensed MIT. It adds 101 tokens to every session and 1,651 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

starknet-js

Use when writing or debugging JavaScript/TypeScript that interacts with Starknet through the starknet.js SDK — building Call objects or calldata, encoding/decoding Cairo types (felt252, u256, structs, arrays, spans, ByteArray, Option/Result/custom enums), or working with contracts, accounts, providers, transactions…

starknet-io/starknet.js · 79 tokens

adding-personhog-rpc

Guide for adding a new RPC to personhog-replica and personhog-router. Covers eligibility checks, proto definition, code generation for Python and Node.js clients, Rust implementation (storage trait, postgres queries, service handler, router wiring), and index compatibility validation. Use when adding a new gRPC…

PostHog/posthog · 88 tokens

viem-integration

Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.

Uniswap/uniswap-ai · 69 tokens

solana

Use when working on Solana software, including one or more of: Solana client code using TypeScript, Rust libraries that use Solana crates, Anchor programs, Quasar programs, LiteSVM tests, including Rust program files, TypeScript tests, and Anchor.toml or Quasar.toml configuration. Designed to create minimal, reusable…

quicknode/solana-finance-claude-plugin · 76 tokens

bnb-chain-toolkit-guide

Guide to the BNB Chain Toolkit — a modular TypeScript toolkit for building, deploying, and interacting with smart contracts on BNB Chain. Includes BEP-20 token utilities, DeFi integrations, wallet management, and cross-chain bridging. Built for BNB Chain Hackathon by the Sperax team.

nirholas/three.ws · 67 tokens

wallet-cli

Operate the TypeScript TRON wallet CLI for accounts, transfers, staking, governance, contracts, signing, chain queries, and password input with wallet-cli 4.12.0. Refuse wallet passwords in argv and require the supported stdin channel. For Java REPL requests, refuse that entry and offer the TypeScript one-shot CLI…

BofAI/skills · 82 tokens