@boltzpay/protocols
v0.3.2
Published
Protocol adapters for x402 and L402 payment protocols
Maintainers
Readme
@boltzpay/protocols
Protocol adapters and wallet managers for the BoltzPay SDK — x402, L402, and MPP implementations.
Install
npm install @boltzpay/protocolsMost users should install
@boltzpay/sdkinstead. This package is useful if you need direct access to protocol adapters, wallet managers, or conversion utilities.
Protocol Adapters
X402Adapter
Handles the x402 protocol — HTTP 402 payments with USDC on Base (EVM) and Solana (SVM).
import { X402Adapter } from "@boltzpay/protocols";L402Adapter
Handles the L402 protocol — Lightning Network payments with macaroon-based credentials.
import { L402Adapter } from "@boltzpay/protocols";MppAdapter
Handles the MPP protocol (IETF track) — supports Stripe, Tempo, Visa, and Lightning payment methods. Implements ProtocolAdapter for single-charge payments. For streaming sessions, use MppSessionManager.
import { MppAdapter } from "@boltzpay/protocols";ProtocolRouter
Auto-detects which protocol a server uses by probing all adapters in parallel, then routes to the correct one.
import { ProtocolRouter } from "@boltzpay/protocols";MppMethodSelector
Selects the best MPP payment method based on configured wallets and preference strategy.
import { MppMethodSelector } from "@boltzpay/protocols";MppSessionManager
Manages MPP streaming sessions — open, send vouchers, and close.
import { MppSessionManager } from "@boltzpay/protocols";Wallet Managers
CdpWalletManager— Coinbase Developer Platform wallet (EVM + Solana)CdpManager— CDP account provisioning and managementNwcWalletManager— Nostr Wallet Connect for Lightning paymentsCdpSvmSigner— Solana transaction signer via CDP
Utilities
centsToUsdcAtomic(cents)— Convert USD cents to USDC atomic unitsusdcAtomicToCents(atomic)— Convert USDC atomic units to USD cents
Peer Dependencies
mppx— Required for MPP protocol support (optional)viem— Required for EVM transaction handling (optional)
License
MIT
