Skip to content

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 viem

What it builds

TaskBuilderContract
Launch a token with Hook BlocksbuildLaunch, buildLaunchAdvised, buildLaunchFamilyHookrLauncher
Open pools for an existing tokenbuildLaunch with the token namedHookrLauncher
Quote a swapbuildQuoteHookrQuoter
SwapbuildSwapHookrRouter
Approve an ERC-20swapAllowance, launchFunding, buildApprovalsthe token
Claimclaim on HookrRulesHookrRules

Each builder returns the chain id, the contract, the call data and the value. Your wallet sends it.

Modules

ModuleWhat it does
releasesThe hookr-1 addresses and deployment, the release manifest, the chain for viem, explorer links and the lane gas floor
walletBuilds the launcher, router and quoter calls, each with its bounds
launchEncodes a Multi-pool launch, its dev buy and exactly what the launcher pulls
paramsEvery 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
quotesClassifies a quote asset and reads amounts in its own decimals
registryTyped registry operations and the admission checks
advisoriesEncodes the fee and market-hours advisory configs
vault, referrals, proofsLiquidity 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.