Deployment and chain
- Fetch
/api/capabilities?chainId=...on the server. - Require
flags.create === true. - Use
activeCreationDeploymentonly for new native launches. - Confirm the connected wallet and RPC report the selected chain ID.
- Fetch the hook bytecode and match
hookRuntimeHash. - Refresh the plan if
releaseCommit, hook, ABI family, or runtime hash changes. - Keep historical tokens on the hook that created them.
User intent
- Show token name, ticker, image, quote asset, target, curve gain, creator split, start time, anti-snipe time, and prebuy before signing.
- State which wallet becomes creator and fee recipient.
- Keep all contract amounts as integers; format only at the UI edge.
- For xStocks, show the wrapper symbol and address, not only the stock name.
- Never request or store a user’s private key.
Transaction safety
- Simulate the exact call with the current account, chain, value, and approval state.
- Recheck account and chain after simulation and before signing.
- Save the transaction hash as soon as the wallet returns it.
- Do not auto-resubmit a timed-out transaction.
- Require a successful receipt.
- Decode one
LaunchCreatedevent from the expected hook. - Verify
creator,targetRaise, and token address from the receipt. - Persist chain, hook, launch ID, token address, and transaction hash together.
Indexing and recovery
- Show confirmed, indexing separately from failed.
- Poll
/api/tokenfrom your server with bounded backoff. - Resume by transaction hash after refresh or reconnect.
- Keep
404after receipt confirmation from triggering a second launch. - Surface finality and canonical-chain state for accounting views.
xStocks
- Load the current asset record from
/api/xstocks/quote-assets. - Require
canCreateand an active deployment. - Use the wrapper address as quote token.
- Validate target and prebuy against the asset’s raw-unit limits.
- Approve only the exact per-asset hook and needed amount.
- Send zero native value to
createLaunchWithQuotePrebuy. - Store release and configuration hashes with the prepared intent.
- Treat USD valuation as optional display evidence, not an execution input.
Trading links and pools
- Link the token to
/:chain/trade/:tokenAddress. - Route pre-bond trades to the token’s own hook.
- Use
getLaunchPoolKeyonly on corrected/current hooks; use complete indexed pool fields onink-legacy. - Verify pool currencies, original hook, fee, tick spacing, and computed pool ID before routing.
- Never assume every native pool is WETH/token.
- Require the correct spender for every approval.
- Keep quote expiry, minimum output, and block identity with a trade plan.
API behavior
- Send
chainIdon every request. - Call the read API from your backend, not a third-party browser origin.
- Handle
429and endpoint-specific limits. - Ignore additive response fields.
- Treat
nullas unknown or not applicable, never as zero. - Keep exact decimal strings intact.
Failure tests
Test all of these before release:- User rejects the signature.
- Wallet changes account after simulation.
- Wallet changes chain after simulation.
- RPC times out after the transaction is broadcast.
- Receipt succeeds but indexing is delayed.
- Receipt reverts.
- The hook emits no launch event or more than one matching event.
- Capabilities change while the confirmation screen is open.
- An xStocks allowance is too low.
- An xStocks asset becomes unavailable between selection and signing.
- The read API returns
429,503, or malformed data. - A page reload occurs at each step of the flow.
Minimum release proof
A production integration is not complete until you have saved evidence for:- A native launch with no prebuy.
- A native launch with prebuy.
- Receipt-derived launch ID and token address.
- Indexed discovery without duplicate submission.
- Correct creator ownership and fee recipient.
- Wrong-chain and account-change rejection.
- At least one xStocks launch if you expose that option.
- Existing-token routing across both active and deprecated deployments.