Prerequisites
- Ensure you have a wallet created.
- API Key: Ensure you have an API key with the scopes:
wallets:transactions.create.
What is sending a custom transaction?
Sending a custom transaction lets you interact with any smart contract on the blockchain beyond simple transfers. Common use cases include minting free tokens, claiming rewards, or registering for allowlists—all without needing to manage private keys yourself.Sending a Transaction
- React
- Node.js
- React Native
- Swift
- REST
Report incorrect code
Copy
Ask AI
import { useWallet, SolanaWallet } from '@crossmint/client-sdk-react-ui';
const { wallet } = useWallet();
const solanaWallet = SolanaWallet.from(wallet);
const { hash, explorerLink } = await solanaWallet.sendTransaction({
transaction: versionedTransaction,
additionalSigners: additionalSigners,
});
Report incorrect code
Copy
Ask AI
import { CrossmintWallets, createCrossmint, SolanaWallet } from "@crossmint/wallets-sdk";
const crossmint = createCrossmint({
apiKey: "<your-server-api-key>",
});
const crossmintWallets = CrossmintWallets.from(crossmint);
const wallet = await crossmintWallets.getWallet(
"email:user@example.com:solana",
{ chain: "solana", signer: { type: "email" } }
);
const solanaWallet = SolanaWallet.from(wallet);
const { hash, explorerLink } = await solanaWallet.sendTransaction({
transaction: versionedTransaction,
additionalSigners: additionalSigners,
});
Parameters
The transaction to send.
The additional signers to sign the transaction with.
Returns
The hash of the transaction.
The explorer link of the transaction.
Report incorrect code
Copy
Ask AI
import { useWallet, SolanaWallet } from '@crossmint/client-sdk-react-native-ui';
const { wallet } = useWallet();
const solanaWallet = SolanaWallet.from(wallet);
const { hash, explorerLink } = await solanaWallet.sendTransaction({
transaction: versionedTransaction,
additionalSigners: additionalSigners,
});
Report incorrect code
Copy
Ask AI
import CrossmintClient
import Wallet
let sdk = CrossmintSDK.shared
let wallet = try await sdk.crossmintWallets.getOrCreateWallet(
chain: .solana,
signer: .email("user@example.com")
)
let solanaWallet = try SolanaWallet.from(wallet: wallet)
let result = try await solanaWallet.sendTransaction(transaction)
Parameters
The transaction to send.
Returns
The hash of the transaction.
The explorer link of the transaction.
Transactions must be approved by one of the wallet’s signers.
The SDK handles this automatically, but with the REST API you must approve the transaction to complete it.Call the approve transaction endpoint with the signature from Step 2 and the transaction ID from Step 1.See the API reference for more details.
Create the transaction
Call the create transaction endpoint.See the API reference for more details.
Report incorrect code
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets/<walletAddress>/transactions \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"params": {
"transaction": "AQAAAAAAAAAAAAA...",
"signer": "external-wallet:<externalWalletAddress>"
}
}'
Choose your signer type
The next steps depend on which signer type you specified in the previous step.API Key signers require no additional steps. Crossmint approves transactions automatically when using API key authentication, so the remaining steps in this guide do not apply.
- API Key
- External Wallet
- Email & Phone
- Passkey
Contact us for access to API key signers.
For External Wallet signers, you must manually sign the approval message and submit it via the API. The response from Step 1 includes a pending approval with a
message field that must be signed exactly as returned.From the previous step’s response, extract:id- The transaction ID (used in the next step)approvals.pending[0].message- The hex message to sign
Report incorrect code
Copy
Ask AI
import { privateKeyToAccount } from "viem/accounts";
// The message from tx.approvals.pending[0].message
const messageToSign = "<messageFromResponse>";
// Sign the message exactly as returned (raw hex)
const account = privateKeyToAccount(`0x${"<privateKey>"}`);
const signature = await account.signMessage({
message: { raw: messageToSign },
});
Email, phone number, and social login signers require client-side OTP verification and key derivation, which the Crossmint SDK handles automatically. While REST API signing is technically possible, Crossmint does not recommend it because you would still need client-side SDK integration for the signing step.
Crossmint recommends using the React, React Native, Swift, or Node.js SDK examples instead. The SDK handles the full signing flow for email and phone signers.
Passkey signers use WebAuthn for biometric or password manager authentication, which requires browser interaction. While REST API signing is technically possible, Crossmint does not recommend it because you would still need client-side SDK integration for the WebAuthn signing step.
Crossmint recommends using the React, React Native, Swift, or Node.js SDK examples instead. The SDK handles the full passkey signing flow automatically.
Submit the approval
Skip this step if using an
api-key signer.Report incorrect code
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets/<walletAddress>/transactions/<txId>/approvals \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"approvals": [{
"signer": "external-wallet:<externalWalletAddress>",
"signature": "<signature>"
}]
}'

