Skip to main content
A Typescript SDK to interact with Crossmint Wallets. This SDK enables developers to easily create and manage wallets on Solana and EVM chains.

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

index.ts
import { CrossmintWallets, createCrossmint } from "@crossmint/wallets-sdk";

const crossmint = createCrossmint({
    apiKey: "<your-client-OR-server-api-key>",
    jwt: "<your-jwt>", // required for client-side calls, optional for server-side calls
});
const crossmintWallets = CrossmintWallets.from(crossmint);
const wallet = await crossmintWallets.getOrCreateWallet({
    chain: "<your-chain>",
    signer: {
        type: "email",
        email: "<your-email>",
    },
});

console.log(wallet.address);

Wallet Examples

Get wallet balances

const balances = await wallet.balances();

console.log(balances.nativeToken.amount);
console.log(balances.usdc.amount);

Transfer

const transaction = await wallet.send(recipient, "usdc", "100");

console.log(transaction.explorerLink);

Get wallet activity

const activity = await wallet.experimental_activity();

console.log(activity.events);

Operational signers

// Add an operational signer
await wallet.addDelegatedSigner({ signer: "<signer-address>" });

const signers = await wallet.delegatedSigners();

console.log(signers);

Create custom transactions

import { SolanaWallet, EVMWallet } from "@crossmint/wallets-sdk";

// Solana
const solanaWallet = SolanaWallet.from(wallet);
const solTx = await solanaWallet.sendTransaction({ transaction: "<serialized-or-non-serialized-transaction>" });

console.log(solTx.explorerLink);

// EVM
const evmWallet = EVMWallet.from(wallet);
const evmTx = await evmWallet.sendTransaction({ transaction: "<serialized-or-non-serialized-transaction>" });

console.log(evmTx.explorerLink);

Signers and custody

Wallet Signers

Learn about signer types and how to choose the right ones.