Clanker Documentation
  • Introduction to Clanker
  • Users
    • FAQ
    • Deploying a Token
    • Creator Rewards
    • Token Deployment & Token Info
      • Presale Token Deployments
    • Unclaimed Rewards Balance
  • Developers
    • API
      • Public Endpoints
      • Deploy a Token
        • Standard Deployment
        • Standard Deployment w/Custom Reward Splits
      • Get Clanker Info by Address
      • Get Tokens Deployed by Address
      • Get Estimated Rewards in USD
      • Get Estimated Uncollected Fees
  • SDK
  • Core Contracts
    • Clanker (Direct Contract Deployments)
    • LpLockerv2
    • ClankerVault
  • Integrations / Partnerships
  • References
    • Brand Assets
    • Changelog
    • Audits
    • Deployed Contracts
    • Supported Quote Tokens
    • Core Team
    • Contact
Powered by GitBook
On this page
  • Quick Start
  • Overview
  • Core Features
  • Basic Usage
  • Advanced Configuration
  • Complete Example
  • CLI Usage
  • CLI Commands
  • Resources
  • Mini App Example!!

SDK

Clanker SDK Developer Guide

Quick Start

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

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}`);

CLI Usage

For rapid development, use our CLI:

# 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

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:

PreviousGet Estimated Uncollected FeesNextCore Contracts

Last updated 7 days ago

Clanker World
GitHub Repository
Deploy a Clanker in a Mini App
Repository
Logonpm: clanker-sdknpm