v3.1.0
Clanker v3.1.0 SDK User Guide
Quick Start
npm install clanker-sdk
Basic Usage
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:
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%):
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:
const config = {
// ... basic config ...
devBuy: {
ethAmount: "0.1", // Buy 0.1 ETH worth
maxSlippage: 5 // 5% max slippage
}
};
Complete Example
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}`);
Last updated