launch-robin
v1.0.1
Published
TypeScript SDK and React hooks for the LaunchRobin protocol on Robinhood Chain — launch tokens, trade on Uniswap V3, and earn creator rewards.
Maintainers
Readme
launch-robin
A comprehensive, high-performance TypeScript SDK and React hooks library for building custom meme coin launchpads on EVM chains, fully integrated with Robinhood Chain Multi-Platform LaaS (Launchpad-as-a-Service).
Features
- Platform Customization: Query platform-specific branding profiles, social details, fees configuration, and live stats.
- Dynamic Swap Quotes: Retrieve precise estimates for token buy outputs, ETH sell returns, and associated transaction fees directly from bonding curves.
- Swapping: Fully managed ERC20 approvals and swap transaction triggers.
- Permanent Liquidity Locking: Rug-proof positions locked in Uniswap v4 on graduation by design.
- Advanced Registry Filters: Search, sort, and retrieve launched tokens based on creation time, graduation progress, market cap, trading volume, or latest swap activity (bump order).
- Historical Candlesticks: Aggregate historical trade logs into custom Open-High-Low-Close-Volume (OHLCV) candlestick buckets.
- React Hooks: Built-in hooks utilizing
wagmifor easy integration into web applications.
Installation
npm install launch-robin ethersQuick Start (Vanilla SDK)
1. Initialize the SDK
Initialize the SDK by connecting it to your RPC provider and contract address deployments:
import { LaunchpadSDK } from "launch-robin";
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider("https://rpc.testnet.chain.robinhood.com");
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
const sdk = new LaunchpadSDK({
provider,
signer: wallet,
configKey: "bullion-launchpad", // Platform ID key string or 32-byte hex ID
platformConfigAddress: "0xc7cDb7A2E5dDa1B7A0E792Fe1ef08ED20A6F56D4",
factoryAddress: "0x871ACbEabBaf8Bed65c22ba7132beCFaBf8c27B5",
registryAddress: "0x6A59CC73e334b018C9922793d96Df84B538E6fD5"
});2. Fetch Config & Stats
// Fetch branding profile
const branding = await sdk.getPlatformBranding();
console.log("Welcome to:", branding.name);
// Fetch fee configurations
const fees = await sdk.getPlatformFees();
console.log("Platform Swap Fee Bps:", fees.tradingFeeBps);
// Fetch platform statistics
const stats = await sdk.getPlatformStats();
console.log("Cumulative Trading Volume:", stats.tradingVolume, "ETH");3. Swap Quoting
Get quotes before sending transactions:
const tokenAddress = "0xe48949F272a47D8cFB90B9b6e1298CF65A504964";
// Quote Buy: input 1 ETH of capital
const buyQuote = await sdk.quoteBuy(tokenAddress, "1.0");
console.log("Receive tokens:", buyQuote.tokensOutOrEthOut);
console.log("Fee:", buyQuote.fee, "ETH");
// Quote Sell: input 1,000,000 tokens
const sellQuote = await sdk.quoteSell(tokenAddress, "1000000");
console.log("Receive ETH:", sellQuote.tokensOutOrEthOut);4. Swap Execution
Perform swaps directly on the bonding curve:
// Buy tokens
const buyTx = await sdk.buy(tokenAddress, "0.1"); // buy with 0.1 ETH
console.log("Buy transaction broadcasted:", buyTx);
// Sell tokens (automatically processes approvals if necessary)
const sellTx = await sdk.sell(tokenAddress, "5000000"); // sell 5M tokens
console.log("Sell transaction broadcasted:", sellTx);React Hooks Usage
Integrate into your React/wagmi application:
import { useLaunchpadTokenDetails, useLaunchpadBuy } from "launch-robin/react";
const REGISTRY_ADDR = "0x6A59CC73e334b018C9922793d96Df84B538E6fD5";
export function TokenInspector({ tokenAddress }) {
// Fetch live token launch progress and reserves
const { data: launch, isLoading } = useLaunchpadTokenDetails(REGISTRY_ADDR, tokenAddress);
// Connect to buy hook
const { buy, isPending } = useLaunchpadBuy(launch?.bondingCurve);
if (isLoading) return <p>Loading details...</p>;
return (
<div>
<h3>{launch?.name}</h3>
<p>Graduation Progress: {Number(launch?.realEthReserves) / Number(launch?.reserveTarget) * 100}%</p>
<button disabled={isPending} onClick={() => buy(100000000000000000n, 0n)}>
Buy 0.1 ETH of tokens
</button>
</div>
);
}License
MIT License. Deployed under LaaS specifications.
