Quickstart
This guide uses Arc Testnet (5042002) and @masterpeach/launchpad-sdk@0.0.0-experimental-20261104025800. Import Pro APIs from /v2. The included deployment preset selects the Core, V7 ABI and compatible Distributor contracts.
1. Install
Use Node.js 20 or newer. The SDK requires viem version 2.45 or newer, below 3.
pnpm add @masterpeach/launchpad-sdk@0.0.0-experimental-20261104025800 viem@^2.45.02. Connect and check the deployment
import { createPublicClient, http } from "viem";
import {
arcTestnetLaunchpadV2Deployment,
createLaunchpadV2Client,
verifyLaunchpadV2Deployment,
} from "@masterpeach/launchpad-sdk/v2";
const publicClient = createPublicClient({
transport: http("https://rpc.testnet.arc.io"),
});
const client = createLaunchpadV2Client({
publicClient,
deployment: arcTestnetLaunchpadV2Deployment,
});
const blockNumber = await client.snapshotBlock();
await verifyLaunchpadV2Deployment(client, { blockNumber });
const launchConfigId = 0n;
const launchFee = await client.contract("configRegistry")
.read("launchConfigFee", [launchConfigId], { blockNumber });
const feeToken = await client.contract("factory")
.read("launchFeeToken", [], { blockNumber });launchFee is in the fee token's raw units. Read the current configuration before creating a token; network gas and any first buy are separate costs. For transactions, create a client with the connected walletClient as well. Its account and network must match the operation.
3. Preview and create
Use Token Creation to preview the request and funding. Show the user the buy/sell Creator Tax, fees and protection choice. Default protectionDays to 0; allow integer days from 1 to 365. Current protection rules are empty, so no transfer restriction applies even when a nonzero period is selected. Approve the required assets, confirm approval receipts, prepare and submit creation, then wait for a successful receipt.
The SDK preview pins the current economics and protection hash. Review the returned request; if either changes, refresh the preview and ask the user to confirm again. An approval is permission to spend, not a payment.
4. Continue from the confirmed state
Trade on the Curve while it is open. After reserves are swept, create the V4 pool and confirm it is active before routing V4 swaps. If a transaction is pending, resolve its hash before retrying.
For optional shared Creator revenue, see Revenue Distribution.
Last updated
Was this helpful?