Skip to main content

Launch SDK

@bankr/launch-sdk is a TypeScript SDK for launching tokens and running your own launchpad on Bankr's contracts.

  • A launch is one transaction. It creates an ERC-20 token and its Uniswap v4 pool, with the liquidity locked for good.
  • A launchpad is an entry in Bankr's contracts that you operate. It sets the rules for every coin launched on it, and it pays you a share of every trade.
  • The SDK never holds your keys. client.launch sends from the wallet you give it. Every other call returns an unsigned transaction for you to send.
// first-launch.ts: `bun first-launch.ts`
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
import { createLaunchClient } from "@bankr/launch-sdk";

const account = privateKeyToAccount(process.env.LAUNCHER_KEY as `0x${string}`);
const client = createLaunchClient({
chain: "base",
walletClient: createWalletClient({ account, chain: base, transport: http() }),
});

const { token, txHash } = await client.launch({
name: "My Coin",
symbol: "MINE",
metadataUri: "ipfs://your-metadata-cid",
launcher: account.address,
launchpadId: 7n, // replace with your launchpad's id: Getting started registers one
});
console.log(token, txHash);

Pick your path​

You want toStart here
Run a launchpad, step by stepGetting started
Set up every part of a launchpadSet up a launchpad
Launch coins for your users in your appLaunch for your users
Launch one coin for yourselfLaunch a token yourself
See everything you can configureConfiguration
Give a coin its own trading ruleExtensions

What you can build​

  • Your own launchpad. One transaction registers it. You set the fee range, your share of every trade, snipe protection, the supply, the wallet cap, vesting and which features a launch may use. You write no contracts.
  • Token launches inside your app. Your users launch from their own wallets, or your server launches for them. A name and a symbol are enough: every other option has a default that your launchpad sets.
  • Coins with their own trading rules. An extension adds a sniper tax, a tax that fades, a brake on pumps or a raffle on every buy, with one option.
  • Coins that pay their holders. Part of every trading fee goes to the wallets that hold the coin, in BNKR where a route exists. Nobody has to stake.
  • Vesting and allocations. Vest supply to the creator, a team or the coin's holders, each on its own schedule.
  • Fees that work for the coin. Auto-LP adds a share of the fees to the locked liquidity. A buyback buys the coin and burns it.
  • Dashboards with no indexer. Bankr indexes every launch on every launchpad. Read it from the SDK or over HTTP, with no key.

What every coin gets​

These are built into the contracts. No setting changes them.

PropertyWhat it means
A fixed supplyMinted once at launch, 18 decimals. No owner and no mint.
Locked liquidityThe pool's liquidity can never be removed. No contract has a function for it.
Fixed termsA coin's fees, its fee split, its vesting and its wallet cap are set at launch. Nobody can change them later.
Fees in the quote tokenEvery trade pays its fee in the token the coin trades against, such as WETH, on buys and on sells.
Holder rewardsPart of every fee goes to the coin's holders.
Sells always go throughAn extension can add a fee to a sell. It can never refuse one.

What it costs​

ActionCost
Registering a launchpadA one-time bond, 0.01 ETH on Base. It is not refunded.
Launching a coinGas only. There is no launch fee.
TradingThe coin's own fee. Bankr's cut comes out of that fee, not on top.

Install​

bun add @bankr/launch-sdk viem

With another package manager:

npm install @bankr/launch-sdk viem
pnpm add @bankr/launch-sdk viem
yarn add @bankr/launch-sdk viem
  • ESM only. The SDK runs on Node 22 or later, on Bun and in modern browsers.
  • One peer dependency: viem 2.57.8 or later.
  • No API key. The SDK plans and launches from the chain, and reads from Bankr's API need no key.

The package has two entry points:

ImportUse it inWhat it holds
@bankr/launch-sdkBrowsers and serversThe client, the reads, every helper. It holds no key.
@bankr/launch-sdk/serverServers onlyThe same, plus the helpers that sign with your launchpad's key.

Supported chains​

Base, Robinhood Chain, Arbitrum, Arc, Ethereum and BNB Chain. Chains and addresses has each chain's name in the SDK and every contract address.

Before you register a launchpad on a chain, read client.status(): a launchpad launches where it reports gated: false.

Words these pages use​

WordMeaning
LaunchpadAn entry in Bankr's contracts with its own rules and payees. Every launch names one by its id.
OperatorThe wallet or Safe that registered a launchpad and can change its settings.
PayeeA wallet that takes part of a launchpad's share of every fee. A launchpad names up to 4.
LauncherThe account that sends a launch transaction.
Quote tokenThe token a coin trades against, such as WETH or USDC. The coin's price and every fee are in it.
Fee recipientA wallet that receives the creator's part of a coin's fees. The launcher, unless the launch names others.
Creator sideWhat is left of a fee after Bankr's cut, any referrer and the launchpad's payees.
First buyA buy the launcher makes inside the launch transaction. The option is devBuy.
Snipe protectionA high fee in the first seconds of trading that falls to the coin's trading fee.
ExtensionA contract attached to a pool at launch that adds its own fee to every swap, such as Sniper Tax.
Knob, switchA launchpad setting with a range and a default, and a feature that is on or off.
Pips, bpsUnits. Fee rates are in pips: 10,000 pips is 1%. Shares are in bps: 100 bps is 1%.

For AI tools​