JS SDK for PYUSD payments in web apps. 3-4 line integration. Supports NFC cards & ETH Global bands
The PYUSD Payments SDK is a comprehensive JavaScript library designed to seamlessly integrate PYUSD (PayPal's USD stablecoin) payment functionality into web applications with minimal development effort. Built on top of the Arx Research HaLo technology, this SDK enables secure, hardware-secured cryptocurrency transactions through NFC-enabled cards and compatible devices like ETH Global bands.
At its core, the SDK provides a simple yet powerful API that abstracts the complexity of blockchain interactions while maintaining the security benefits of hardware wallets. Developers can integrate PYUSD payments with just 3-4 lines of code by initializing a HaloClient instance with their preferred RPC endpoint, target network (mainnet, testnet, arbitrum, or arbitrum-testnet), and recipient address.
The SDK offers several key capabilities: reading wallet addresses from HaLo chips, checking PYUSD balances, constructing and signing transactions, and broadcasting them to the network. It supports multiple Ethereum-compatible networks with pre-configured PYUSD contract addresses, ensuring compatibility across different blockchain environments. The integration leverages the widely-used ethers.js library for robust blockchain communication and transaction handling.
The PYUSD Payments SDK is architecturally designed around the Arx Research HaLo technology stack, leveraging modern web standards and blockchain libraries to create a seamless bridge between hardware-secured credentials and web-based cryptocurrency transactions. At its foundation lies the @arx-research/libhalo library, which provides the critical Web NFC API integration that enables direct communication with HaLo NFC chips through the browser without requiring native mobile applications or complex middleware.
The SDK's architecture follows a modular design pattern with clear separation of concerns: the core HaloClient class orchestrates high-level payment operations, while specialized functions handle specific HaLo interactions like signTransaction and getWalletAddress. These lower-level functions utilize the HaLo Web API's execHaloCmdWeb method to execute commands directly on NFC hardware, with an intelligent method resolution system that automatically detects and falls back between Web NFC and credential-based authentication methods based on browser capabilities and user permissions.
Technically, the implementation relies heavily on ethers.js v6 for all blockchain interactions, including transaction construction, signing, and broadcasting across multiple networks. The SDK pre-configures PYUSD contract addresses for mainnet, testnet, Arbitrum, and Arbitrum testnet, using the ERC-20 ABI to handle balance queries and transfer operations with automatic decimal conversion. A particularly elegant aspect is the status tracking system that maps HaLo command execution states to user-friendly progress indicators, providing real-time feedback during the NFC scanning and transaction signing processes.

