This guide will walk you through the process of sending a token transfer from your wallet using the Crossmint transactions API. You can transfer various ERC20 tokens using this method. One of the benefits of non-custodial Smart Wallets is that you can hold and send different cryptocurrencies.

Prerequisites

Check out our Quickstart for non-custodial Smart Wallets to prepare the following:

  • API Key: Your Crossmint API key with the scope wallets:transactions.create.
  • Wallet Locator: The locator of the wallet you want to transfer the tokens from.

Sending the Transaction

We will use the Create Transaction API.

1

First, we need to prepare the transaction that will send 4 USDC to the recipient. This will encode the function call for the transfer function for sending 4 USDC to a recipient.

2

With our encoded transaction data, we need to set the following parameters for the /transactions endpoint:

  • calls: An array of objects with the following properties:
    • to: The token contract address.
    • value: Set to "0" for token transfers.
    • data: The encoded data generated in the previous step.
  • chain: The chain where the transaction will be sent.
  • signer: One of the wallet’s signers, typically the admin signer.