@mint.club/v2-sdk
v3.0.0
Published
TypeScript SDK for creating, trading, and managing assets on the Mint Club V2 bonding curve protocol.
Maintainers
Readme
What is Mint Club V2?
Mint Club V2 is a permissionless bonding curve protocol. Launch tokens backed by any reserve asset (HUNT, ETH, USDC, …) with automated pricing — no liquidity pool required. The protocol handles minting, burning, and price discovery through audited smart contracts.
This SDK is the canonical TypeScript client for the protocol. Use it from Node.js, browsers, or any JavaScript runtime.
→ Full docs: sdk.mint.club
Install
Version 2 moved the SDK from mint.club-v2-sdk to the official Mint Club scope. Use @mint.club/v2-sdk for all new installations.
npm install @mint.club/v2-sdk
# or
yarn add @mint.club/v2-sdk
# or
bun add @mint.club/v2-sdkQuick Start
import { mintclub } from '@mint.club/v2-sdk';
// Read token state without connecting a wallet.
const signet = mintclub.network('base').token('SIGNET');
const [details, nextMintPrice] = await Promise.all([
signet.getDetail(),
signet.getPriceForNextMint(),
]);
// Resolve the current USD price and its quote path.
const { usdRate, path } = await mintclub.network('base').token('HUNT').getUsdRate();For trusted Node.js environments, configure a private key after selecting the network. Never expose a private key in browser code.
import { mintclub, wei } from '@mint.club/v2-sdk';
const serverToken = mintclub
.network('base')
.withPrivateKey(process.env.PRIVATE_KEY as `0x${string}`)
.token('SIGNET');
const serverAmount = wei(100, await serverToken.getDecimals());
await serverToken.buy({ amount: serverAmount, slippage: 1 });Browser applications should pass a viem wallet client from their wallet integration to mintclub.withWalletClient(). See the getting started guide for a complete example.
Token metadata
Save Mint Club metadata after the token creation receipt succeeds. Keep selected image File objects in your application until then; uploading NFT metadata to IPFS before deployment remains a separate operation.
Given your connected creator walletClient, selected logoFile, and token createParams:
const token = mintclub.withWalletClient(walletClient).network('base').token('MY_TOKEN');
const receipt = await token.create(createParams);
if (receipt?.status !== 'success') throw new Error('Token creation did not succeed');
const message = await token.getMetadataSignatureMessage();
const signature = await walletClient.signMessage({ account: walletClient.account!, message });
await token.createMintClubMetadata({
logo: logoFile,
website: 'https://example.com',
message,
signature,
});Both metadata methods send a signed PUT with your supplied message and signature, plus the connected wallet address. Build the message with getMetadataSignatureMessage() and sign it with that same wallet. It identifies mint.club, the metadata action, the token, the chain, the wallet, and a ten-minute validity window. A signature may be reused for the same token and wallet during that window; metadata field values are not bound to the signature. Initial metadata clears unspecified fields, including any historical placeholder links. Later updateMintClubMetadata calls preserve omitted fields; empty strings and null images clear fields. Set externalDexUrl: '' to remove an existing DEX link.
Version 3 migration: createMintClubMetadata no longer sends an anonymous POST or works before deployment, and now requires the same message and signature parameters as updateMintClubMetadata. Existing updateMintClubMetadata callers still pass message and signature, but must use getMetadataSignatureMessage() instead of an arbitrary message. Generate and sign a fresh message when the previous one expires. If saving fails after deployment, retain the metadata inputs and retry the metadata call without creating the token again. Metadata requests use native fetch, FormData, and File (available in modern browsers and Node.js 20+).
Features
| | | |---|---| | Bonding curves | Create, buy, sell, estimate, and inspect ERC-20 and ERC-1155 assets | | Wallet integration | Use viem wallet clients, injected wallets, or a server-side private key | | Airdrops | Create and claim Merkle airdrops with IPFS-backed allowlists | | Lockups and staking | Create token lockups and interact with staking pools | | Wrapped-native Zap | Buy with or sell to the native asset when the reserve is its wrapped token | | USD pricing | Resolve token prices through bonding curves and supported price providers | | IPFS and metadata | Upload and resolve asset metadata and airdrop lists |
Supported Networks
The SDK accepts a chain ID or the lowercase network key shown below.
| Environment | Network keys |
|---|---|
| Mainnet | ethereum, base, blast, optimism, arbitrum, polygon, bnbchain, avalanche, kaia, cyber, ham, shibarium, unichain, zora, apechain, hashkey, robinhood, over |
| Testnet | sepolia, basesepolia, blastsepolia, avalanchefuji, cybertestnet, puppynet |
Contract availability differs by feature and network. Use getMintClubContractAddress() or the contract repository when you need a specific deployment.
Development
npm install
npm run typecheck
npm test
npm run buildIntegration tests that require credentials (PRIVATE_KEY, FILEBASE_API_KEY) are auto-skipped when the env var is not set.
Links
| | | |---|---| | App | mint.club | | SDK docs | sdk.mint.club | | Protocol docs | docs.mint.club | | Contracts | Steemhunt/mint.club-v2-contract | | CLI and MCP | Steemhunt/mint.club-v2-ai | | Community | OnChat | | X / Twitter | @MintClubPro |
License
BSD-3-Clause — built with 🏗️ by Hunt Town
