UX.SOL

Component

Safe Recipient Field

Validates Solana recipients with local safety checks and real RPC account inspection before a transaction continues.

Preview

Check a devnet recipient

No wallet connection required. Account details come directly from Solana RPC.

Verify the full address before continuing.

Installation

terminal
$npx shadcn@latest add https://uxdotsol.xyz/r/safe-recipient-field.json

Usage

safe-recipient-field.tsx
"use client";
 
import { useState } from "react";
import { SafeRecipientField } from "@/components/uxdotsol/components/safe-recipient-field";
 
export function SendRecipient() {
const [recipient, setRecipient] = useState("");
const [canContinue, setCanContinue] = useState(false);
 
return (
<div>
<SafeRecipientField
value={recipient}
onValueChange={setRecipient}
rpcEndpoint="https://api.devnet.solana.com"
onValidationChange={(result) => setCanContinue(result.canSubmit)}
/>
<button disabled={!canContinue}>Continue to review</button>
</div>
);
}

Props / Arguments

NameTypeDefaultDescription
value / defaultValuestring / stringuncontrolled / ''Controlled or initial recipient address value.
onValueChange(value: string) => voidundefinedCalled whenever typing, paste, or clear changes the address.
rpcEndpoint / connection / senderstring / { rpcEndpoint: string } | null / string | { toString(): string } | nullundefinedDirect RPC endpoint, compatible wallet-adapter Connection, and optional sender for account and self-recipient checks.
allowSelfbooleanfalseDowngrades a matching sender/recipient from blocked to warning when explicitly enabled.
requireExistingAccountbooleanfalseBlocks addresses without an existing account instead of showing the normal new-account warning.
blockExecutableAccountsbooleantrueBlocks executable program accounts by default.
blockedAddresses / trustedAddressesreadonly string[] / readonly string[][] / []Application policy lists applied before the RPC lookup.
onValidationChange(validation: RecipientValidationValue) => voidundefinedReports meaningful validation-state changes to the parent flow.
label / description / placeholderstring / string / string'Recipient' / safety guidance / 'Solana wallet address'Accessible field copy and placeholder customization.
required / disabled / showDetailsboolean / boolean / booleanfalse / false / trueNative requirement, disabled state, and visibility of explainable RPC details.