UX.SOL

Component

Quick Send Flow

Drop-in SOL send flow with recipient validation, transfer review, wallet approval states, retry handling, and an explorer receipt.

Preview

Installation

terminal
$npx shadcn@latest add https://uxdotsol.xyz/r/quick-send-flow.json

Usage

quick-send-flow.tsx
"use client";
 
import { useConnection, useWallet } from "@solana/wallet-adapter-react";
import { LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction } from "@solana/web3.js";
import { QuickSendFlow } from "@/components/uxdotsol/flows/quick-send-flow";
 
export default function App() {
const { connection } = useConnection();
const { publicKey, sendTransaction } = useWallet();
 
if (!publicKey) return <p>Connect a wallet to continue.</p>;
 
return (
<QuickSendFlow
sender={publicKey.toBase58()}
senderName="Connected wallet"
recipient=""
cluster="devnet"
connection={connection}
networkFee="Calculated by wallet"
onSend={async (amount, recipient) => {
const transaction = new Transaction().add(
SystemProgram.transfer({
fromPubkey: publicKey,
toPubkey: new PublicKey(recipient),
lamports: Math.round(amount * LAMPORTS_PER_SOL),
}),
);
return sendTransaction(transaction, connection);
}}
/>
);
}

Props / Arguments

NameTypeDefaultDescription
senderName / senderstring'Connected wallet' / requiredConnected-wallet label and required sender address shown in the transfer route.
recipientName / recipientstringundefined / ''Optional human-readable recipient label and initial destination wallet address.
tokenSymbol / presetsstring / number[]'SOL' / [0.1, 0.5, 1, 5]Token label and quick amount buttons.
networkFeestring'Calculated at signing'Honest fee state or a fee value calculated by the wallet/RPC and shown in the summary.
onSend(amount: number, recipient: string) => Promise<string>requiredRequired wallet signing and submission function. It must return the real transaction signature.
onConfirm(signature: string, amount: number, recipient: string) => Promise<unknown>undefinedOptional real confirmation hook. When omitted, connection tracks the submitted signature.
connection / clusterConnection | null / stringnullOptional Solana RPC and cluster used for live transaction status and explorer links.
onSuccess(signature: string, amount: number, recipient: string) => voidundefinedCalled when the send flow confirms successfully.
onError(error: Error) => voidundefinedCalled when send or confirmation fails.
retrySendbooleanfalseEnables automatic send retries only when onSend is idempotent or can prove a prior broadcast did not land.