SDK Reference
The LaunchpadSDK class is the primary interface for interacting with the LaunchRobin protocol from TypeScript/JavaScript applications. It supports both Node.js and browser environments.
Installation
npm install launch-robinOr with your package manager of choice:
pnpm add launch-robin
yarn add launch-robinThe package exports LaunchpadSDK, React hooks, contract ABIs, TypeScript types, and chain constants. Requires ethers v6 as a peer dependency.
Need a platform ID? Register your own launchpad platform to get a platformId for the SDK. Create a platform →
Setup
import { LaunchpadSDK } from "launch-robin";
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider(
"https://rpc.mainnet.chain.robinhood.com"
);
const signer = await provider.getSigner(); // browser wallet
const sdk = new LaunchpadSDK({
provider,
signer, // optional, required for writes
configKey: "launch-robin", // or 0x... platformId
platformConfigAddress: "0x...",
factoryAddress: "0x...",
registryAddress: "0x...",
uniswapV3AdapterAddress: "0x...",
swapRouterAddress: "0x...",
wethAddress: "0x...",
});Read Methods
getPlatformBranding()
Returns the platform's branding profile (name, logo, social links, description).
const b = await sdk.getPlatformBranding();
// { name, logoUri, website, twitter, telegram,
// discord, docUrl, supportUrl, description }getPlatformFees()
Returns the platform's fee configuration.
const f = await sdk.getPlatformFees();
// { creationFee: "0.001", tradingFeeBps: 125,
// lpFee: 5000, creatorShareBps: 500 }getPlatformStats()
Returns on-chain statistics for the active platform.
const s = await sdk.getPlatformStats();
// { totalTokens, graduatedTokens, tradingVolume,
// totalFees, creatorRewards, protocolRewards,
// liquidityCreated, creationCount }getProtocolStats()
Returns protocol-wide aggregated stats across all platforms.
getFilteredLaunches(options?)
Returns token launches with sorting and filtering.
const tokens = await sdk.getFilteredLaunches({
sortBy: "volume", // "marketCap" | "creationTime" | "volume"
sortOrder: "desc",
search: "pepe",
platformId: "0x...",
});
// Each token: { token, name, symbol, creator,
// marketCap, totalVolume, currentPrice,
// platformId, creationTimestamp, ... }getToken(tokenAddress)
Returns detailed info for a single token.
const t = await sdk.getToken("0x...");
// { token, creator, poolId, marketCap,
// creationTimestamp, platformId, configVersion }getFullTokenDetails(tokenAddress)
Like getToken but also returns metadata (name, symbol, description, imageUri, social links) and computed fields (totalVolume, currentPrice, fees).
getTokenPrice(tokenAddress)
Returns the current per-token price in ETH.
getTokenVolume(tokenAddress)
Returns cumulative trading volume in ETH.
getTokenVolumeWindows(tokenAddress)
Returns volume breakdown by time window.
const w = await sdk.getTokenVolumeWindows("0x...");
// { vol30m: "1.5", vol6h: "12.3",
// vol12h: "28.7", vol24h: "45.1" }getTokenCandlesticks(tokenAddress, intervalSeconds)
Returns OHLCV candlestick data grouped by time interval. Scans historical trade events.
const candles = await sdk.getTokenCandlesticks(
"0x...", 300 // 5-minute intervals
);
// [{ time, open, high, low, close, volume }, ...]getTradeHistory(tokenAddress, startBlock?)
Returns all buy/sell events for a token, sorted by timestamp.
getCreatorTokens(creatorAddress)
Returns array of token addresses created by a wallet.
getAllPlatforms()
Returns all registered platforms with branding, fees, and stats. Note: owner is always empty (managed via AccessControl). Use getPlatforms() for owner info.
getAccruedFees(tokenAddress)
Returns accrued fee balances for a token.
const fees = await sdk.getAccruedFees("0x...");
// { platformEth, platformToken,
// creatorEth, creatorToken }quoteBuy(tokenAddress, ethIn)
Returns estimated tokens received and fee for a buy.
const q = await sdk.quoteBuy("0x...", "0.1");
// { tokensOutOrEthOut: "500000.0", fee: "0.000125" }quoteSell(tokenAddress, tokensIn)
Returns estimated ETH received and fee for a sell.
Write Methods (require signer)
createToken(metadata)
Deploys a new meme token with single-sided Uniswap V3 liquidity.
const result = await sdk.createToken({
name: "Pepe Coin",
symbol: "PEPE",
description: "The OG meme coin",
imageUri: "https://example.com/pepe.png",
website: "https://pepe.com",
twitter: "https://x.com/pepe",
telegram: "https://t.me/pepe",
discord: "https://discord.gg/pepe",
tokensForPool: "1000000000000000000000000000",
});
// { tokenAddress, poolAddress, transactionHash }buy(tokenAddress, ethAmount, minTokensOut?, deadlineSeconds?)
Buy tokens from the Uniswap V3 pool with ETH.
const txHash = await sdk.buy(
"0x...", "0.1", "500000"
);sell(tokenAddress, tokenAmount, minEthOut?, deadlineSeconds?)
Sell tokens back to the pool. Automatically approves token spending if needed.
const txHash = await sdk.sell(
"0x...", "10000", "0.01"
);harvestDEXFees(tokenAddress)
Harvests accrued DEX fees from a token's Uniswap V3 pool.
claimCreatorFees(tokenAddress)
Creator claims their share of harvested LP fees for a token.
claimPlatformFees(tokenAddress)
Platform treasury/owner claims platform share of harvested LP fees.
registerPlatform(owner, treasury, branding, fees)
Register a new branded launchpad platform on the protocol.
const result = await sdk.registerPlatform(
ownerAddress,
treasuryAddress,
{
name: "My Launchpad",
logoUri: "ipfs://...",
website: "https://...",
twitter: "",
telegram: "",
discord: "",
docUrl: "",
supportUrl: "",
description: "The best launchpad",
},
{
creationFee: "0.0005",
lpFee: 10000, // 1%
creatorShareBps: 500, // 5%
}
);
// { platformId, transactionHash }Event Watching
watchTrades(tokenAddress, callback)
Listens for Swap events on a token's V3 pool. Returns a cleanup function.
const cleanup = sdk.watchTrades("0x...", (event) => {
console.log(event.type, event.args);
// event.type: "Buy" | "Sell"
// Buy args: { token, buyer, ethIn, tokensOut,
// fee, currentPrice, timestamp }
// Sell args: { token, seller, tokensIn, ethOut,
// fee, currentPrice, timestamp }
});
// Later: cleanup();watchNewTokens(callback)
Listens for TokenCreated events from the Factory. Returns a cleanup function.
Types
SDKConfig
interface SDKConfig {
provider: ethers.Provider;
signer?: ethers.Signer;
configKey?: string;
platformConfigAddress?: string;
factoryAddress?: string;
registryAddress?: string;
uniswapV3AdapterAddress?: string;
swapRouterAddress?: string;
poolManagerAddress?: string;
wethAddress?: string;
}LaunchMetadata
interface LaunchMetadata {
name: string;
symbol: string;
description: string;
imageUri: string;
website: string;
twitter: string;
telegram: string;
discord: string;
tokensForPool: string;
}LaunchInfo
interface LaunchInfo {
token: string;
creator: string;
poolId: string;
marketCap: string;
creationTimestamp: number;
platformId: string;
configVersion: number;
totalVolume?: string;
currentPrice?: string;
}PlatformBranding
interface PlatformBranding {
name: string;
logoUri: string;
website: string;
twitter: string;
telegram: string;
discord: string;
docUrl: string;
supportUrl: string;
description: string;
}Constants
import {
CHAIN_ID,
CONTRACT_ADDRESSES,
getAddressesForChain,
} from "launch-robin/constants";
CHAIN_ID.MAINNET // 4663
const addr = getAddressesForChain(4663);
// {
// PLATFORM_CONFIG, UNISWAP_V3_ADAPTER,
// FACTORY, REGISTRY, SWAP_ROUTER,
// WETH, DEFAULT_PLATFORM_ID
// }