Crypto Currency

Native validation for major blockchain networks. Ideal for FinTech and exchanges to prevent input errors.

Strict Validation with Zod

Configure the schema to accept only specific networks (e.g., strictly allowing USDT on TRC20).

schema.ts
typescript
import * as z from 'zod';
import { zCrypto } from 'zod-ir';

const ExchangeFormSchema = z.object({
  anyWallet: zCrypto({ message: 'آدرس کیف پول نامعتبر است' }),
  
  usdtWallet: zCrypto({
    ticker: 'TRX',
    message: 'فقط شبکه‌های TRC20 پشتیبانی می‌شود'
  })
});

Metadata Extraction (Standalone)

Easily extract the underlying Network and Ticker from any given wallet address using standalone functions.

metadata.ts
typescript
import { getCryptoInfo } from 'zod-ir';

const info = getCryptoInfo('TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t');

if (info.isValid) {
  console.log(info.network); // "TRC20"
  console.log(info.ticker); // "TRX"
}