Skip to main content
The Send Transaction screen is displayed when your application requests to sign and broadcast a blockchain transaction. This screen shows users the transaction details, signs it with their wallet, and automatically broadcasts it to the blockchain network.
Send Transaction combines signing and broadcasting in one step. For more control over when a transaction is broadcast, use Sign Transaction instead.

How it works

When your application requests to send a transaction:
  1. Your app calls the send transaction method from the MoonKey SDK
  2. The Send Transaction screen appears, displaying transaction details
  3. User reviews the transaction information (recipient, amount, gas, etc.)
  4. User approves or rejects the transaction
  5. If approved, MoonKey signs the transaction with the user’s wallet
  6. MoonKey automatically broadcasts the signed transaction to the blockchain
  7. The transaction hash is returned to your application

Triggering the Send Transaction screen

Use the useSendTransaction hook from the MoonKey SDK to trigger the Send Transaction screen:

Customizing the Send Transaction screen

You can customize the Send Transaction screen by passing UI configuration in the uiConfig object:

Configuration options

Basic UI Options

string
URL to your company logo. Displayed at the top of the Send Transaction screen.Example:
string
Custom title text displayed at the top of the Send Transaction screen.Example:
string
Custom description text displayed below the title, providing context for the transaction.Example:
string
Custom text for the confirm/send button.Default: 'Send'Example:
string
Custom text for the cancel button.Default: 'Cancel'Example:
boolean
Whether to show wallet information (address, balance) in the Send Transaction screen.Default: trueExample:
number
Time in milliseconds to wait before automatically closing the screen after a successful transaction.Default: 1500 (1.5 seconds)Example:

Advanced Transaction Options

object
Configuration for the advanced transaction settings screen.

Success Screen Options

object
Configuration for the success screen displayed after the transaction is sent.

Failed Screen Options

object
Configuration for the error screen displayed if the transaction fails.

Common use cases

Simple ETH/SOL transfer

Send native currency to a recipient:

Token transfer

Send ERC-20 or SPL tokens:

NFT transfer

Transfer an NFT to another wallet:

Mint NFT

Mint an NFT with payment:

Contract interaction with gas estimation

Send a transaction with custom gas settings:

Complete example

Here’s a complete example with transaction tracking:

User experience flow

1

Trigger transaction

Your application calls sendTransaction() with transaction data, wallet, and optional UI options.
2

Send Transaction screen appears

The customized Send Transaction screen is displayed with transaction details.
3

Review transaction details

User reviews the transaction information including recipient, amount, gas fees, and any contract interactions.
4

Approve or reject

User clicks the send button to proceed, or cancels (if isCancellable: true) to reject.
5

Transaction signed and broadcast

If approved, MoonKey signs the transaction and automatically broadcasts it to the blockchain network.
6

Success screen

The success screen appears with the configured successHeader and successDescription.
7

Return transaction hash

The transaction hash (or signature for Solana) is returned to your application for tracking.

Send Transaction vs. Sign Transaction

Understanding when to use each:
  • Signs and broadcasts in one step
  • Automatically submits to the blockchain
  • Returns transaction hash immediately
  • Simpler API for basic operations
  • Best for immediate transactions
  • User can’t control broadcast timing
  • Most common for standard transfers
  • Example: Send ETH, transfer tokens, mint NFTs
  • Only signs the transaction
  • Does not broadcast automatically
  • Returns signed transaction data
  • Requires manual broadcasting
  • More control over when to broadcast
  • Can sign offline
  • Good for batch operations or complex flows
  • Example: Multi-step flows, conditional broadcasting
Use Send Transaction for most use cases. Only use Sign Transaction when you need explicit control over the broadcasting step.

Tracking transaction status

After sending a transaction, you typically want to track its confirmation status:

Best practices

Always provide clear information about what the transaction does:
Check transaction validity before showing the UI:
Different errors require different handling:
Help users track their transaction:
Always show wallet UI so users can verify they have sufficient funds:
For complex transactions, set appropriate gas limits:
Keep a record of sent transactions for user reference:
Inform users about next steps:

Error handling

Common errors and how to handle them:

Security considerations

Always validate transaction parameters before sending. Malicious applications could trick users into sending funds to unintended recipients or approving dangerous contract interactions.
For developers:
  1. Validate all inputs - Check addresses, amounts, and data before sending
  2. Show full details - Display recipient, amount, gas fees, and contract interactions
  3. Estimate gas - Provide accurate gas estimates to prevent failed transactions
  4. Check balances - Verify sufficient funds before attempting to send
  5. Rate limit - Prevent abuse by limiting transaction frequency
  6. Log transactions - Keep records for debugging and support
  7. Handle errors - Provide clear error messages for different failure scenarios
For users: The Send Transaction screen helps users by:
  • Displaying full transaction details before sending
  • Showing wallet balance to prevent insufficient funds errors
  • Providing clear context via title and description
  • Allowing cancellation if isCancellable is true
  • Showing success confirmation with transaction hash

Next steps

Sign Transaction

Sign transactions without broadcasting

Sign Message

Sign messages for authentication

UI Components Overview

Explore all UI components

Configure Appearance

Global appearance settings