Quickstart
Install the SDK, connect a wallet and complete your first token purchase.
Use the stable production SDK and Arc Mainnet (5042). Import Classic APIs from the package root.
Install
Use Node.js 20 or newer and viem 2.45 or newer, below 3.
pnpm add @masterpeach/launchpad-sdk@1.0.0 viem@^2.45.0Connect
This browser example creates a read client. Use your configured Arc Mainnet RPC endpoint and require chain ID 5042.
import { createPublicClient, http } from "viem";
import {
arcMainnetLaunchpadDeployment,
createLaunchpadFactoryClient,
defineLaunchpadChain,
verifyLaunchpadDeployment,
} from "@masterpeach/launchpad-sdk";
const deployment = arcMainnetLaunchpadDeployment;
const rpcUrl = "https://rpc.arc-scan.org";
const publicClient = createPublicClient({ transport: http(rpcUrl) });
if (await publicClient.getChainId() !== deployment.chainId) {
throw new Error("Use Arc Mainnet");
}
const chain = defineLaunchpadChain({
slug: "arc-mainnet", chainId: deployment.chainId, family: "evm",
nativeCurrency: { symbol: "USDC", decimals: 18 },
rpcUrls: [rpcUrl], explorerUrl: "https://arc-scan.org",
apiBaseUrl: window.location.origin, realtimeUrl: rpcUrl,
deployment, quoteTokens: deployment.economics.quoteTokens,
capabilities: { create: true, bondingTrade: true, partnerAttribution: true },
confirmations: 2,
});
await verifyLaunchpadDeployment(publicClient, deployment);
const client = createLaunchpadFactoryClient({ publicClient, chain });SDK 1.0.0 requires API and realtime URL metadata; this example uses RPC reads and starts no subscriptions. Verification checks deployment identity, bindings and pinned configuration. If it fails, check the reported difference against the approved production configuration before continuing.
Prepare and confirm
For writes, also pass the connected walletClient to createLaunchpadFactoryClient. Check its account and chain before preparing an operation.
Read current fees and economics, obtain user confirmation, approve the correct spender and wait for approval receipts. Prepare the operation, send it through the wallet and confirm the receipt. An approval or simulation does not establish a completed launch or trade.
For ordinary creation, use client.prepareLaunchAndBuy; for optional Holder Fee Sharing, use client.prepareLaunchWithHolderFeeSharing. See Token Creation and the production addresses.
Last updated
Was this helpful?