Overview

With Crossmint’s Wallets API, you can create a Solana wallet with a non-custodial signer that you control. This means that:

  • Wallets are controlled by your own keys, which you manage server-side
  • Transactions are signed using your private keys, giving you full control over transaction approval and execution

This quickstart demonstrates how to create such wallets and send transactions from them.

Crossmint abstracts away all Solana-related fees, including:

  • Transaction fees for all operations - Rent for new token accounts
  • Account creation fees

1. Create and Configure a Crossmint Project

To get started, create a developer account in the Crossmint Staging Console. Open that link, sign in, and accept the dialog to continue.

Crossmint offers two consoles: staging, for development and testing, and www, for production.

2. Get an API Key

Once you log in to the console, the next step is to create an API key.

  • Navigate to project Integrate > API Keys, and click the “Create new key” button in the “Server-side keys” section
  • Under the Wallets API category, select the scopes wallets.create, wallets.read, wallets.fund, wallets:balance.read ,wallets:nfts.read, wallets:transactions.create and wallets:transactions.read
  • Click “Create server key” to save the key for the next step

3. Create or import your admin signers

Smart Wallets are controlled by one or more secrets that you hold, called the wallet “signers”.

For the purposes of this tutorial, we will generate a key that you can guard in your computer.

4. Create Your Wallet

To create a new non-custodial wallet, make a POST request to the Create Wallet endpoint, specifying the admin signer type and address:

5. Fund Your Wallet

This funding step is only to get USDC tokens that we’ll transfer in the next step. You don’t need to fund the wallet for gas fees, as Crossmint abstracts away all transaction fees.

Now that your wallet is created, let’s give it some funds so that you can complete your first transfer transaction.

To do so we will call the Fund Wallet endpoint, using the wallet address returned from the previous step as the wallet locator.

This endpoint is only available in staging and only supports USDC and USDXM.

6. Transaction Flow

Now that the wallet is funded, you can send transactions from it, such as transferring currency, interacting with smart contracts, or purchasing items. Non-custodial smart wallet transactions follow a simple three-step process:

  1. Create Transaction - Create your intended transaction (i.e. transfer tokens, call a contract)
  2. Sign Transaction - Sign the transaction with the wallet’s signer
  3. Approve Transaction - Submit the transaction onchain

Once all approvals are submitted, Crossmint will automatically broadcast the transaction onchain

Here’s a quick visualization of the flow:

The following sections will walk you through implementing each step. You’ll need to:

  • Create a transaction with your intended operation
  • Sign and approve the transaction
  • Monitor the transaction status

Crossmint automatically broadcasts the transaction once all required approvals are submitted. No manual broadcasting is needed.

A. Create a Transaction

Now that the wallet is funded, you can send transactions from it, such as transferring currency, interacting with smart contracts, or purchasing items.

When creating transactions, you don’t need to worry about:

  • Transaction fees — Crossmint will cover all fees
  • Rent for new token accounts — Crossmint handles account creation and rent
  • Correct blockhash — You can use the placeholder shown below

As an example, let’s send 0.5 USDC from your wallet to a new recipient address.

The first step is to create a Base58 encoded serialized Solana transaction. To create a transaction, you will need to:

  1. Create a Versioned Transaction using the Solana web3.js / python SDK
  2. Input the following transaction parameters:
    • Use "11111111111111111111111111111111" as the blockhash (Crossmint will replace this)
    • Leave the transaction unsigned - all signatures will be added during the approval process

The transaction will be properly configured on Crossmint’s servers with the correct values before execution. Crossmint will also pay for the transaction fee.

Now the serialized transaction data can be passed to the Create Transaction endpoint.

B. Sign and Approve Transaction

Before execution, transactions require authorization from the admin signer. This authorization is performed by calling the Approve Transaction endpoint with the appropriate signature.

Solana transactions have a validity window of 150 blocks (~60-90 seconds). Make sure to submit your approvals within this window. If the transaction expires, you’ll need to send and approve a new transaction.

C. Monitor Transaction Status

To monitor the transaction status, you can call the Get Transaction endpoint.

The API will return the full transaction, including it’s status, which can be one of the following:

  • pending: Broadcasting transaction onchain
  • success: Transaction successfully executed onchain
  • failed: Transaction failed during execution