Spin out wallets on-demand by passing an email (or any user identifier) to the create wallet API. Get started in 5 minutes by following the next steps:

Prerequisites:

  1. Create a Crossmint account if you haven’t yet.
  2. Go to the API key section of the developer console and create a new API key with the following scopes: wallets.read, wallets.create, and wallets:nfts.read.
  3. Make a note of your project ID and API key secret, as you will need them to create wallets.

Creating a Wallet

To create a wallet, you can pass the following parameters to our API:

  • email: User email address. Contact us if you wish to pass an arbitrary string as a UUID instead of an email.
  • chain: Blockchain in which you’d like to create the wallet. You can see the list of blockchains available here.
JavaScript
import fetch from "node-fetch";

const body = {
    email: "<YOUR_USERS_EMAIL>",
    chain: "<TARGET_CHAIN>",
};

const response = await fetch(`https://staging.crossmint.com/api/v1-alpha1/wallets`, {
    method: "POST",
    headers: {
        "X-PROJECT-ID": "<YOUR_PROJECT_ID>",
        "X-CLIENT-SECRET": "<YOUR_CLIENT_SECRET>",
        "content-type": "application/json",
    },
    body: JSON.stringify(body),
});

const wallet = await response.json();

Implementation Notes

  • Users can interact with the wallet from your website or (optional) from Crossmint.com by logging in with the same email.
  • If you had already created a wallet for the same user on the same chain, no new wallet will be created. Instead, the API will return the existing wallet address.
  • The API currently does not perform any email/user validation on the passed email parameter.

If you pass an arbitrary user identifier instead of an email address or phone number when creating a wallet, it may hamper the ability to connect the wallet to third-party sites. This can be fixed, but requires custom work and is only available to enterprises.