SDK
The hookr-sdk package: the builders for every launch, swap, quote and claim call, the release manifest, and how hookr.fun uses it.
On this page
hookr-sdk is the TypeScript package for building on the new pools from any app, launcher or agent. It runs on viem, holds no wallet and signs nothing. It carries the release's addresses, its ABIs, the 22-quote catalog, the bounds of every Hook Block, and the builders hookr.fun itself uses.
npm install hookr-sdk viemWhat it builds
| Task | Builder | Contract |
|---|---|---|
| Launch a token with Hook Blocks | buildLaunch, buildLaunchAdvised, buildLaunchFamily | HookrLauncher |
| Open pools for an existing token | buildLaunch with the token named | HookrLauncher |
| Quote a swap | buildQuote | HookrQuoter |
| Swap | buildSwap | HookrRouter |
| Approve an ERC-20 | swapAllowance, launchFunding, buildApprovals | the token |
| Claim | claim on HookrRules | HookrRules |
Each builder returns the chain id, the contract, the call data and the value. Your wallet sends it.
Modules
| Module | What it does |
|---|---|
releases | The hookr-1 addresses and deployment, the release manifest, the chain for viem, explorer links and the lane gas floor |
wallet | Builds the launcher, router and quoter calls, each with its bounds |
launch | Encodes a Multi-pool launch, its dev buy and exactly what the launcher pulls |
params | Every creator knob with its range and default, and the checks that refuse a value outside them |
Core block settings (rules.ts) | Encodes and checks a pool's core block settings, and prices the Snipe tax and the dynamic fee |
quotes | Classifies a quote asset and reads amounts in its own decimals |
registry | Typed registry operations and the admission checks |
advisories | Encodes the fee and market-hours advisory configs |
vault, referrals, proofs | Liquidity vault and treasury calls, referral authorizations and Merkle proofs |
The release manifest
Every builder takes the release's manifest: each contract it calls, at its address, with its runtime code hash. The package carries the release's deployment, so there is nothing to pass:
const manifest = await readReleaseManifest(client, HOOKR_1);It reads the code at each address and refuses it unless every contract runs the code the release deployed. releaseManifest(HOOKR_1) builds the same manifest with no reads.
Arb recapture
On a pool with arb recapture on, each profit splits 25/25/50 at the lane's full share: the partner keeps up to 25% (the lane's share), Hookr takes 25%, and the rest is the pool's, as it froze it at launch. recaptureSplit works it out to the wei.
A swap on such a pool must carry the lane's gas floor, gasFloor from laneOf(id) on the root: 6,802,619 at the lane's 3,000,000 gas cap. The swap's own gas comes on top: the release rehearsal's lane swap needed a gas limit of 7,419,835. Estimate and add a sixth. A fixed limit should be at least 7.5 million.
How hookr.fun uses it
hookr.fun carries the SDK's source, pinned by the hash of every file, and builds each call with it. The package carries the same source, and a parity test keeps the two equal. Before it offers a launch, hookr.fun checks the call against the release as read from chain, and refuses one the release cannot take.
Before you send a call
- Check the wallet's chain, the payer, the token approvals, the deadline and the slippage yourself.
- A quote simulates the pool's accounting. It does not prove approvals, balances or gas.
- Treat token names and links as untrusted display text.
The package README on npm has an example for each task.