Docs
Wallet Address
A utility for validating cryptocurrency wallet addresses across different networks.
Installation
pnpm dlx shadcn@latest add "https://ui.ednesdayw.com/r/wallet-address.json"
Usage
import { isAddress } from "@/lib/wallet-address";
// Validate EVM address (default)
const isValidEVM = isAddress("0x888777d851872Cd075D88C61BE8793Ff302C1FAd");
// Validate Tron address
const isValidTron = isAddress("TWJ88TmUTG3ZcvPqR8WrPxA33esoXFFFFF", "tron");
// Validate Solana address
const isValidSolana = isAddress("FQh8Vkasb6h173nJ7mXmHwmbV7DX81N6jXBaNQNaP5RA", "solana");
API
isAddress
Validates a cryptocurrency wallet address for the specified network.
isAddress(address: string, network?: Network): boolean
Parameters
address
- The wallet address to validatenetwork
- The blockchain network type. Options:evm
(default),tron
orsolana
Returns
boolean
- Returns true
if the address is valid for the specified network, false
otherwise.