WDK logoWDK documentation

WDK Utils

Address validation, BIP-21, BOLT11 invoice, and EIP-681 request helpers for @tetherto/wdk-utils

WDK Utils provides validation helpers for Bitcoin, EVM, Lightning, Spark, Tron, and UMA identifiers, BIP-21 Bitcoin payment URI helpers, BOLT11 invoice helpers, and EIP-681 request parsing helpers for token transfer deep links. Powered by @tetherto/wdk-utils.

Features

  • Address validation helpers: Validate Bitcoin, EVM, Lightning invoice, LNURL, Lightning address, Spark, Tron, and UMA inputs before you hand them to a wallet flow.
  • BIP-21 payment URI helpers: Detect, parse, and encode bitcoin: payment URIs with optional amount, label, and message fields.
  • Lightning payment parsing: Decode LNURL strings and BOLT11 invoices before you display or route payment details.
  • BOLT11 invoice helpers: Validate, decode, hash, sign, and encode BOLT11 invoices for Bitcoin, testnet, regtest, and signet flows.
  • EIP-681 request parsing: Detect request-shaped EIP-681 strings and parse transfer payloads into recipient, tokenAddress, chainId, and amountSmallest.
  • No runtime setup: Import the functions you need. The package has no constructor or runtime configuration.
  • TypeScript support: The published package ships typed exports for every validator and parser.
  • Bare runtime export: The package publishes a bare entrypoint in addition to the default module entrypoint.

Why this matters

  • Validate user input early and return machine-readable failure reasons before you attempt a transaction or resolution flow.
  • Parse and encode BIP-21 Bitcoin payment links before pre-filling send forms.
  • Inspect BOLT11 invoice metadata, fallback addresses, routing information, and feature bits before presenting payment details.
  • Normalize EIP-681 payment links into structured transfer data that wallet UIs can inspect before execution.
  • Reuse the same helpers across Node.js and Bare-based environments without adding a larger wallet module dependency.

Need Help?

On this page