Launching a token
Router createAndBuyWithParams, then POST /tokens/create.
Launching is an on-chain call, usually through Router.createAndBuyWithParams (or createTokenWithParams without an initial buy). Then register the token with POST /tokens/create so the index and UI stay in sync.
Receipt sync
The API verifies the create receipt. Economics in the body should match the on-chain params (creator fee bps, USD graduation target, initial buy, etc.).
On-chain create and buy
import { parseEther, parseAbi } from "viem";
const routerAbi = parseAbi([
"function createAndBuyWithParams(string name, string symbol, string uri, uint256 creatorFeeBps, uint256 usdTarget, uint256 minTokensOut) payable returns (address token, address curve, uint256 tokensOut)",
]);
const hash = await walletClient.writeContract({
address: "0xf4070f50Aed754c12d781d21de9986742017A2B8" as `0x${string}`,
abi: routerAbi,
functionName: "createAndBuyWithParams",
args: [
"Example",
"EXMPL",
"ipfs://…", // or https metadata URI
50n, // creator fee bps (0–100)
15_000n, // USD graduation target
0n, // minTokensOut for the initial buy
],
value: parseEther("0.05"), // launch fee (0) + initial buy ETH
});
const receipt = await publicClient.waitForTransactionReceipt({ hash });
// Parse factory/router events for token + curve addressesIndex the launch
curl -sS -X POST "${API_URL}/tokens/create" \
-H "authorization: Bearer $JWT" \
-H "content-type: application/json" \
-d '{
"contractAddress": "0xToken",
"curveAddress": "0xCurve",
"txHash": "0x…",
"name": "Example",
"symbol": "EXMPL",
"creatorFeeBps": 50,
"usdGraduationTarget": 15000
}'Upload logos via POST /uploads (JWT, multipart, max 5MB) or Pinata signature flow before create if you need hosted images. See the Trancepad app useLaunch hook for the full UI path.
Expected result
Token appears in GET /tokens and emits Socket.IO newToken when indexing succeeds.