SDK Clanker SDK Developer Guide
Quick Start
Copy npm install clanker-sdk
Overview
The Clanker SDK enables developers to easily create and deploy meme tokens on Base with built-in liquidity pools, vesting vaults, and customizable reward distributions.
Core Features
🚀 One-click token deployment
💧 Automatic liquidity pool creation
🔒 Optional vesting vaults
💰 Configurable reward distributions
🎨 Built-in metadata and social links
Basic Usage
Copy import { Clanker } from 'clanker-sdk';
import { createWalletClient, createPublicClient, http } from 'viem';
// Initialize SDK
const clanker = new Clanker({
wallet: walletClient,
publicClient,
factoryAddress: FACTORY_ADDRESS
});
// Deploy a token
const tokenAddress = await clanker.deployToken({
name: "MyToken",
symbol: "TOKEN",
image: "ipfs://...",
metadata: {
description: "My awesome token",
socialMediaUrls: ["https://twitter.com/mytoken"],
auditUrls: []
},
pool: {
quoteToken: "0x4200000000000000000000000000000000000006", // WETH
initialMarketCap: "1" // 1 WETH
}
});
Advanced Configuration
Vesting Vault
Add a vesting schedule for token distribution:
Copy const config = {
// ... basic config ...
vault: {
percentage: 20, // 20% of tokens
durationInDays: 90 // 90-day vesting
}
};
Reward Distribution
Configure creator and interface rewards (Clanker retains 20%):
Copy const config = {
// ... basic config ...
rewardsConfig: {
creatorReward: 80, // 80% max to creator, 0% to interface
creatorAdmin: "0x...", // Optional: Custom admin address
creatorRewardRecipient: "0x..." // Optional: Custom reward recipient
}
};
Initial Dev Buy
Configure an initial buy to provide liquidity:
Copy const config = {
// ... basic config ...
devBuy: {
ethAmount: "0.1", // Buy 0.1 ETH worth
maxSlippage: 5 // 5% max slippage
}
};
Complete Example
Copy const tokenAddress = await clanker.deployToken({
name: "Awesome Token",
symbol: "AWESOME",
image: "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi",
metadata: {
description: "The most awesome token on Base",
socialMediaUrls: [
"https://twitter.com/awesome",
"https://t.me/awesome"
],
auditUrls: []
},
context: {
interface: "My dApp",
platform: "Awesome Platform",
messageId: "deployment-1",
id: "awesome-token-1"
},
vault: {
percentage: 20,
durationInDays: 90
},
pool: {
quoteToken: "0x4200000000000000000000000000000000000006",
initialMarketCap: "1"
},
devBuy: {
ethAmount: "0.1",
maxSlippage: 5
},
rewardsConfig: {
creatorReward: 80,
creatorAdmin: "0x...",
creatorRewardRecipient: "0x..."
}
});
console.log(`Token deployed at: ${tokenAddress}`);
console.log(`View on Clanker World: https://clanker.world/clanker/${tokenAddress}`);
CLI Usage
For rapid development, use our CLI:
Copy # Set up environment
echo "PRIVATE_KEY=your_private_key_here
FACTORY_ADDRESS=factory_address_here" > .env
# Create a token
npx clanker-sdk --create
CLI Commands
Copy npx clanker-sdk --create
# Env Example
# Required: Your private key (with 0x prefix)
PRIVATE_KEY=0x123...
# Required: The Clanker factory contract address
FACTORY_ADDRESS="0x2A787b2362021cC3eEa3C24C4748a6cD5B687382"
# Optional: Custom RPC URL (if not provided, will use default Base RPC, we suggest using something other than default!)
RPC_URL=https://...
Resources
Mini App Example!!
The SDK and quickstart guide are available on the npm Registry: