> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clanker.world/llms.txt
> Use this file to discover all available pages before exploring further.

# v5

`clanker-sdk/v5` launches and manages Clanker v5 tokens. It uses the v4 method names, token fields and result format where the v5 contracts support them.

From `clanker-sdk` 5.0.0, the SDK launches v5 tokens only: the v3 and v4 launch methods throw. The [v4 Clanker Class](https://docs.clanker.world/sdk-reference/v4.md) and the [v3 Clanker Class](https://docs.clanker.world/sdk-reference/v3.md) still manage existing tokens.

## Installation

```bash theme={null}
npm install clanker-sdk viem
```

The v5 client is in `clanker-sdk` 5.0.0 and later. viem 2.49.3 or later is a peer dependency, so the SDK uses your project's viem.

## Launch a token

```typescript theme={null}
import { Clanker } from "clanker-sdk/v5";
import {
  createPublicClient,
  createWalletClient,
  http,
  type PublicClient,
} from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const publicClient = createPublicClient({
  chain: base,
  transport: http(),
}) as PublicClient;
const wallet = createWalletClient({ account, chain: base, transport: http() });

const clanker = new Clanker({ wallet, publicClient });

const { txHash, waitForTransaction, error } = await clanker.deploy({
  name: "My Token",
  symbol: "TKN",
  image: "ipfs://...",
  buyFee: 2,
  sellFee: 2,
  devBuy: { ethAmount: "0.01" },
});
if (error) throw error;

const result = await waitForTransaction();
if (result.error) throw result.error;
console.log(result.address, result.poolId);
```

`wallet` and `publicClient` must use the same chain. `deploy` returns `txHash`, `expectedAddress` and `waitForTransaction`.

* A top-level `error` means nothing was sent, so you can try again.
* After the launch is sent, `deploy` returns no top-level `error`. `waitForTransaction` returns the launch or its error.
* With a creator buy for another recipient, `transferTxHash` is the transfer. If the transfer fails, the result has `transferError` and `failedStep`, and the token exists.

> [!WARNING]
>
> An `error` whose `data.rawName` is `SEND_UNCERTAIN` means the send itself failed, so the launch can exist. Check the wallet's transactions before you call `deploy` again, because a second call launches a second token.

`getDeployTransaction(token, { account })` builds the launch transaction without sending it.

## Token fields

### Token

| Parameter | Description |
| - | - |
| `name` | Token name. Required. |
| `symbol` | Token symbol. Required. |
| `image` | Token image URL. |
| `metadata` | `{ description, socialMediaUrls, auditUrls }`, the same as v4. |
| `context` | Launch context, the same as v4. Defaults to `{ interface: "SDK" }`. |
| `tokenAdmin` | Creator of the token. Defaults to the caller. |

### Tax

| Parameter | Description |
| - | - |
| `buyFee` | Total buy tax in percent, including the Clanker fee. Defaults to 1. Must be within the launch policy bounds. |
| `sellFee` | Total sell tax in percent, including the Clanker fee. Defaults to 1. Same bounds as `buyFee`. |
| `dividends` | `{ share, minimumHolding }`: `share` percent of the tax after the Clanker fee goes to holders. `minimumHolding` uses token base units. |
| `burn` | Percent of the tax after the Clanker fee burned in the launched token. Defaults to 0. |
| `integrator` | `{ address, share }`: gives an integrator `share` percent of the tax after the Clanker fee. |

`dividends.share`, `burn` and the integrator `share` together must not exceed 100. The rest of the tax after the Clanker fee goes to the reward recipients.

The Clanker fee is 10% of the tax, but at least 0.5% and at most 1% of the trade. At the default 1% tax, it is half the tax. While no holder meets `minimumHolding`, the dividend share goes to Clanker. Read the live policy with `taxPolicy()`.

### Pool, rewards and creator buy

| Parameter | Description |
| - | - |
| `pool.pairedToken` | Quote token. Defaults to the native coin, and `"WETH"` also means the native coin. On Arc, both mean USDC. |
| `rewards` | `{ recipients }`: one to seven `{ admin, recipient, bps }` entries. The bps must add up to 10000. Defaults to 100% to `tokenAdmin`. |
| `devBuy` | Creator buy: `{ ethAmount, recipient, minAmountOut, poolKey, routeData }`. Only `ethAmount` is required. |

v5 does not accept v4 `fee`, `fees`, `salt`, `vault`, `airdrop`, `presale`, `sniperFees`, other `pool` settings, `locker` or `poolExtension`, or the `Both` and `Clanker` reward tokens.

## Creator buy

* The SDK picks the route for the native quote and for the stable quote of each chain. Another quote needs `devBuy.routeData` or the `buildBuyRoute` option.
* Elysium has no HYPE/USDC pool, so a USDC creator buy there also needs `devBuy.routeData` or `buildBuyRoute`. A HYPE creator buy needs no route.
* The SDK simulates the launch and sets the minimum output 5% below the quote. Set `devBuySlippagePercent` in the second argument of `deploy` to change it.
* The contract sends the bought tokens to the caller. If `devBuy.recipient` or `tokenAdmin` is another address, `deploy` sends them in a second transaction and returns `transferTxHash`.

## Chains

| Chain | Chain ID | Quote tokens | Creator buy |
| - | - | - | - |
| Base | 8453 | ETH, USDC | ETH or USDC |
| BNB Chain | 56 | BNB, USDC | BNB or USDC |
| Monad | 143 | MON, USDC | MON or USDC |
| Robinhood Chain | 4663 | ETH, USDG | ETH or USDG |
| X Layer | 196 | OKB, USDC | OKB or USDC |
| Arc | 5042 | USDC | USDC |
| Elysium | 99901 | HYPE, USDC | HYPE |

Launches are open on Base, BNB Chain, Monad, Robinhood Chain, X Layer, Arc and Elysium. Clanker no longer supports new launches on Ethereum, Arbitrum and Unichain. Their factories have launches turned off, so a launch there returns `Launches are not open on chain <id>.` On Arc, the native coin is USDC.

### Elysium

Elysium (chain ID 99901) needs `clanker-sdk` 5.1.0 or later. viem has no Elysium chain, so import `elysium` from `clanker-sdk`. Elysium has no public RPC, so pass your own RPC URL to both clients.

```typescript theme={null}
import { elysium } from "clanker-sdk";
import { Clanker } from "clanker-sdk/v5";
import {
  createPublicClient,
  createWalletClient,
  http,
  type PublicClient,
} from "viem";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const transport = http(process.env.ELYSIUM_RPC_URL);
const publicClient = createPublicClient({
  chain: elysium,
  transport,
}) as PublicClient;
const wallet = createWalletClient({ account, chain: elysium, transport });

const clanker = new Clanker({ wallet, publicClient });

const { waitForTransaction, error } = await clanker.deploy({
  name: "My Token",
  symbol: "TKN",
  buyFee: 2,
  sellFee: 2,
  devBuy: { ethAmount: "0.01" },
});
if (error) throw error;
```

`elysium.id` is 99901, and `clanker-sdk/v5` also exports it as `ELYSIUM_CHAIN_ID`. The token pairs with HYPE, and `devBuy.ethAmount` is in HYPE. `ELYSIUM_USDC` is the USDC pair address. In the CLI, use `--chain elysium --rpc <url>`.

## Manage a token

The v5 client keeps the v4 method names. Each write returns `{ txHash, error }`.

```typescript theme={null}
await clanker.claimRewards({ token, rewardRecipient });
await clanker.availableRewards({ token, rewardRecipient });
await clanker.getTokenRewards({ token });
await clanker.updateRewardRecipient({ token, rewardIndex: 0n, newRecipient });
await clanker.updateRewardAdmin({ token, rewardIndex: 1n, newAdmin });
await clanker.updateImage({ token, newImage: "ipfs://..." });
await clanker.updateMetadata({
  token,
  metadata: JSON.stringify({ description: "New" }),
});
```

* A claim pays the recipient's whole balance in one currency, across all pools. An integrator claims with `claimRewards({ token, rewardRecipient: integrator })`.
* The admin of the creator slot follows creator rights, and `getTokenRewards` marks that slot with `rewardIsCreator`. Use `proposeCreatorRightsTransfer` and `acceptCreatorRightsTransfer` to change it, or `safeTransferCreatorRights` to move it to a contract.
* Holders check dividends with `withdrawableDividends({ token, holder })` and claim up to 64 tokens at once with `claimDividends({ tokens })`.
* `getPoolConfig({ token })` reads a launch's settings, and `getTaxRates({ token, isBuy })` reads the tax a trade pays now, including the anti-snipe fee. Its rates use a 1e24 scale, so 1% is `10n ** 22n`.
* Each write has matching `get…Transaction` and `…Simulate` methods.

## CLI

```bash theme={null}
npx clanker-sdk deploy --name "My Token" --symbol "TKN" --chain base \
  --buy-fee 2 --sell-fee 2
```

`clanker-sdk deploy` launches v5 tokens only. Without a name or symbol, it asks for each option. The `rewards` and `token` commands pick v4 or v5 for each token, and `dividends available` and `dividends claim` check and claim holder dividends.

## Related

* Full v5 SDK reference: see [`docs/v5.md`](https://github.com/clanker-devco/clanker-sdk/blob/main/docs/v5.md) in the clanker-sdk repository.
* Taxes, rewards and dividends: see [Creator Rewards & Fees](https://docs.clanker.world/general/creator-rewards-and-fees.md) and [Holder Dividends](https://docs.clanker.world/general/holder-dividends.md).
* Launches without the SDK: see [API Deployments](https://docs.clanker.world/general/token-deployments/v5-deployments.md).
* The Admin page: see [Managing a Token](https://docs.clanker.world/general/managing-a-token.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.