Skip to main content
This page has been updated for Wallets SDK V1. If you are using the previous version, see the previous version of this page or the V1 migration guide.

Before you start

Set up your project and get an API key.
1

Install the SDK

Run the following command to install the SDK:
npm i @crossmint/wallets-sdk
2

Create a wallet with a server signer

The server signer uses a secret key you provide to derive a blockchain address deterministically. The same secret always produces the same address.
Before creating a wallet, you need a signer secret. Generate one using the key generation tool or programmatically, then store it as an environment variable (e.g. SIGNER_SECRET). See the Server Signer guide for full details.
See all supported chains here.
index.ts
import {
    CrossmintWallets,
    createCrossmint,
} from "@crossmint/wallets-sdk";

const crossmint = createCrossmint({
    apiKey: "YOUR_SERVER_API_KEY",
});

const wallets = CrossmintWallets.from(crossmint);

const wallet = await wallets.createWallet({
    chain: "base-sepolia",
    recovery: {
        type: "server",
        secret: process.env.SIGNER_SECRET!, // set in your .env file
    },
});

console.log("Wallet address:", wallet.address);
The secret is never sent to Crossmint. The SDK derives the blockchain address locally from the secret and only sends the address to the API.
3

Check balances

check-balance.ts
// Assumes `wallet` was created in the wallet creation step above
const balances = await wallet.balances(["usdc", "usdxm"]);

for (const token of balances.tokens) {
    console.log(`${token.symbol}: ${token.amount}`);
}
4

Transfer tokens

transfer.ts
// Assumes `wallet` was created in the wallet creation step above
const tx = await wallet.send(
    "RECIPIENT_ADDRESS",
    "usdxm",
    "1"
);

console.log("Explorer:", tx.explorerLink);

Launching in Production

For production, some changes are required:
  1. Create a developer account on the production console
  2. Create a production server API key on the API Keys page with the API scopes users.create, users.read, wallets.read, wallets.create, wallets:transactions.create, wallets:transactions.sign, wallets:balance.read, wallets.fund
  3. Replace your test API key with the production key

Learn More

Check Balances

Check the balance of a wallet.

Transfer Tokens

Send tokens between wallets.

Operational Signers

Register operational signers on a wallet.

API Reference

Deep dive into API reference docs.

Talk to an expert

Contact our sales team for support.