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.jsonUsage
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
| Name | Type | Default | Description |
|---|---|---|---|
| value / defaultValue | string / string | uncontrolled / '' | Controlled or initial recipient address value. |
| onValueChange | (value: string) => void | undefined | Called whenever typing, paste, or clear changes the address. |
| rpcEndpoint / connection / sender | string / { rpcEndpoint: string } | null / string | { toString(): string } | null | undefined | Direct RPC endpoint, compatible wallet-adapter Connection, and optional sender for account and self-recipient checks. |
| allowSelf | boolean | false | Downgrades a matching sender/recipient from blocked to warning when explicitly enabled. |
| requireExistingAccount | boolean | false | Blocks addresses without an existing account instead of showing the normal new-account warning. |
| blockExecutableAccounts | boolean | true | Blocks executable program accounts by default. |
| blockedAddresses / trustedAddresses | readonly string[] / readonly string[] | [] / [] | Application policy lists applied before the RPC lookup. |
| onValidationChange | (validation: RecipientValidationValue) => void | undefined | Reports meaningful validation-state changes to the parent flow. |
| label / description / placeholder | string / string / string | 'Recipient' / safety guidance / 'Solana wallet address' | Accessible field copy and placeholder customization. |
| required / disabled / showDetails | boolean / boolean / boolean | false / false / true | Native requirement, disabled state, and visibility of explainable RPC details. |

