Overview
When integrating Multihopper into an automated or agentic workflow, the transfer lifecycle splits into two distinct halves:- API-managed — create, prepare, confirm-broadcast, and monitor via REST
- Client-managed — sign and broadcast transactions to Solana (requires wallet access)
Transfer lifecycle for agents
confirm-broadcast is called twice: once immediately after keeperFundingTx (step 4), and once after the rest (step 6). This prevents double-funding if deployment is interrupted and /prepare is called again.
Transaction signing
preparedTxs contains four groups of transactions that must be signed in order. Each group uses either a VersionedTransaction (v0) or a legacy Transaction — the signing approach differs.
Any field that is
null in preparedTxs is already confirmed on-chain from a previous broadcast attempt — skip it.
Python
Dependencies:pip install solders base58
TypeScript
Dependencies:npm install @solana/web3.js bs58
Broadcasting to Solana
Signed transactions must be broadcast in a strict order. Each group must reachconfirmed status before the next group is sent — later transactions depend on accounts created by earlier ones.
Broadcast order
dispersionInitTxs is only non-empty for a multi-destination transfer.
It’s signed by sourceOwner alone, like sessionInitTxs.
Python
TypeScript
Handling expiry and resume
Solana blockhashes expire roughly 60 seconds after the/prepare call. If broadcast fails mid-way — due to expiry, an RPC error, or a process crash — call /prepare again with a new Idempotency-Key.
The server inspects the chain and returns null for any group already confirmed. The signing and broadcast helpers above skip null fields automatically.
Compliance & screening
On compliance-enabled networks (mainnet today) every route is screened against sanctions/risk data automatically, after deployment, by the keeper — your agent does nothing to “pass” screening. Two things to account for:- Budget the screening fee. The
/preparebundle takes 0.002 SOL (on mainnet, a configured value) fromsourceOwnerfor each wallet the route screens./estimatequotes it assol.breakdown.screeningFeeLamportsand counts it inrequiredSolUpFrontLamports; pass the transfer’sarrivalSecondsso late payouts are priced. It is the cost of the screen, so it is not refunded, whether the route is clean or flagged. The wallet must holdrequiredSolUpFrontLamportsplus the transfer amount at deploy time, or the deploy can fail for insufficient lamports. - Expect a short verification window. After your final
confirm-broadcast, the transfer sits inprocessingwhile the keeper verifies compliance, then hops begin executing. Keep polling — no action is needed. If a wallet is flagged, the transfer ends asrefunded: the principal is returned and the screening fee is retained.
Full autonomous loop (TypeScript)
Agent context file (CLAUDE.md)
Drop the block below into your project’sCLAUDE.md (or any system prompt / context file your agent reads). It gives the agent everything it needs to call MultiHopper correctly without hallucinating endpoints or field names.
MCP server integration
MultiHopper hosts the API steps as MCP tools athttps://multihopper.com/api/mcp, authenticated with your
API key (see MCP servers). Your agent adds one local tool,
sign_and_broadcast, which holds the wallet. The hosted server never sees a key.
Rescue and reclaim-rent are not hosted tools. Call
POST /api/v1/transfers/:id/rescue/prepare and
/rescue/confirm over REST, or wrap them yourself.
API Reference
Full endpoint documentation, error codes, and rate limits.
Webhooks
Receive real-time transfer lifecycle events instead of polling.
Security model
Trust assumptions and on-chain guarantees.
Keeper network
How keepers execute hops after broadcast.

