Docs / Reference / Local API

Local API

Advanced. The web app needs no API — its engine runs in the page (see below). This page documents the JSON API of the optional standalone Python engine (bundler/server.py), exposed on http://127.0.0.1:8787. Bound to localhost only — do not expose the port.

The in-browser engine

What the web app itself uses — four globals on window, loaded with the page:

ModuleRoleKey entry points
JBCorechain layer: RPC/multicall with retries, Pons calldata, fee mathrpc, call, multicall, quoteBuyData/quoteSellData, buildBuy/buildSell, launchRecordData, feeParams, spendable
JBVaultBIP-39/BIP-44 vault, AES-GCM encrypted in localStoragecreate, unlock, lock, unlocked, list, account, exportCSV
JBFundrelay.link distribution plan + executionbuildPlan, execute, stop, resume, wasInterrupted, planStatus, sourceBalance
JBTermterminal: tracking, buys, sells, dump, approvals, auto-buytrack, price, holders, buy, sell, sellAll, dump, approveAll, auto.start/auto.stop, status

Signing always goes through JBVault.account(i) — a locked vault throws, so no module can move funds without the password having been entered in this tab.

State & identity

RouteMethodBodyReturns
/api/stateGET—vault/unlocked flags, wallets, plan status, token, jobs, log tail
/api/balancesGET—live ETH balance per wallet on Robinhood
/api/source-balancePOST{chain}wallet-0 ETH balance on a funding chain
/api/holdersGET—external holder table for the tracked token

Pipeline

RouteMethodBodyNotes
/api/seedPOST{count, password}generates vault; returns mnemonic once
/api/unlockPOST{password}opens vault into memory
/api/planPOST{hours, from_balance, src_chain, source_index}builds out/funding-plan.json
/api/executePOST{execute}runs the plan; false = dry run
/api/launchPOST{name, symbol, logo?, description?, quote_in_eth, deployer_index, execute}gated: rejects before steps 1–5 complete

Trading

RouteMethodBody
/api/tokenPOST{address} — resolve + track a token
/api/buyPOST{eth, wallet_index?}
/api/sellPOST{pct?, wallet_index?}
/api/autoPOST{lo_s, hi_s} — start progressive buys
/api/stopPOST— halt the auto loop
/api/dumpPOST— parallel exit, all wallets
/api/approvePOST— stage sell approvals
/api/lockPOST— same staging via the lock control

Rules every route enforces

  • Signing requires an unlocked vault and execute: true — otherwise simulate or refuse.
  • /api/launch runs the pipeline gate, canLaunch, and an eth_call simulation before broadcasting.
  • Errors come back as {"error": "…"} with a 4xx/5xx status — the UI toasts them verbatim.