v4.0.0
Clanker v4.0.0 SDK User Guide
Quick Start
npm install clanker-sdk viembun add clanker-sdk viemyarn add clanker-sdk viemBasic Usage
import { Clanker } from 'clanker-sdk/v4';
import { createWalletClient, createPublicClient, privateKeyToAccount, http } from 'viem';
// Viem setup
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const client = createPublicClient({ chain: base, transport: http() });
const wallet = createWalletClient({ account, chain: base, transport: http() });
// Initialize the SDK
const clanker = new Clanker({
publicClient: client,
wallet: walletClient,
});
// Deploy a token
const { txHash, waitForTransaction, error } = await clanker.deploy({
name: "My Token",
symbol: "MTK",
tokenAdmin: account.address,
// Optional parameter. This will make a call to Clanker's vanity-address
// service to generate a salt so the token deploys with the "b07" suffix.
vanity: true,
});
// The `deploy` function attempts to not throw and instead return an error
// for you to decide how to handle
if (error) throw error;
// It also returns a function `waitForTransaction` that you may use to wait
// for the full token deployment. This also may return an error, or the address
// of the token on success.
const { address } = await waitForTransaction();
console.log(`Deployed token to ${address}`);
Advanced Configuration
Token Configuration
Pool Configuration
Fee Configuration
Rewards Configuration
Vesting Vault
Initial Dev Buy
Complete Example
Last updated