Prerequisites

  • Ensure you have a wallet created.
  • API Key: Ensure you have an API key with the scopes: wallets:transactions.create.

Sending tokens

import { useWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

const { hash, explorerLink } = await wallet.send(walletLocator, tokenLocator, amount);

Parameters

walletLocator
string
required
The recipient of the tokens, represented by a wallet locator. A wallet locator can be of the format:
  • <walletAddress>
  • email:<email>:<walletType>
  • userId:<userId>:<walletType>
  • userId:<userId>:<walletType> (white label user example)
  • phoneNumber:<phoneNumber>:<walletType>
  • twitter:<handle>:<walletType>
  • x:<handle>:<walletType>
tokenLocator
string
required
The token to be transferred, represented as a token locator.A token locator that supports native tokens, fungible tokens, and NFTs across different chains. It can be of the format:
  • address[:tokenId]
  • symbol
amount
string
required
The amount of tokens to send in decimal format (e.g. 42.69).

Returns

hash
string
The hash of the transaction.
The explorer link of the transaction.