Skip to content

radius-sdk@0.5.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 14:50
· 117 commits to main since this release
4516ee9

Minor Changes

  • 8c8c671: Require Node 22 or later. Node 20 reached end of life on 30 April 2026.

  • 25eb09d: MPP (the HTTP Payment auth scheme, evm charge method) alongside x402.

    Buyers: createRadiusFetch pays WWW-Authenticate: Payment challenges with an EIP-3009 authorization bound to the challenge, in the Authorization: Payment credential mppx and other MPP servers expect, and reads Payment-Receipt. protocols (default ['x402', 'mpp']) sets the preference when a 402 offers both (a funded network still beats an unfunded one across protocols). PaymentOffer is now X402Offer | MppOffer, told apart by offer.protocol; requirements and x402Version exist on x402 offers only. PaymentReceipt gains protocol, and getPaymentReceipt also reads Payment-Receipt.

    Sellers: radiusPayments({ mpp: { secretKey } }) adds an MPP challenge per network to every 402, mirroring the x402 offers, and accepts MPP credentials: checked statelessly (HMAC challenge id, realm, expiry, route price, nonce binding), then verified and settled by the network's x402 facilitator, before or after the handler per settle. Responses carry Payment-Receipt; the handler and onSettled get receipts with protocol: 'mpp'. Not available through the upstream x402 framework adapters.

  • 8f4900a: Pay and charge on more than one network. Networks are now PaymentNetworks (was RadiusNetwork), built with definePaymentNetwork({ chain, asset }) (was defineRadiusNetwork), with presets for Radius ('radius' / 'mainnet', 'radius-testnet' / 'testnet'), Base ('base') and Base Sepolia ('base-sepolia'), both paying in USDC. Preset names are now the preset ids ('radius', 'radius-testnet'), and radiusNetworkForChainId is presetForChainId.

    createRadiusFetch({ networks: [...] }) pays on any of the listed networks, preferring them in order among those the payer's balance covers (preferFunded: false skips the balance reads; none funded throws insufficient_balance); offer.network and ApprovalRequest.network are the PaymentNetwork paid on, a USD maxPerRequest is converted per asset, and payFetch.on(network) gives the wallet helpers for each network. x402 v1 challenges that name a network (base, base-sepolia) are matched too.

    radiusPayments({ networks: [...] }) / createRadiusServer offer one payment option per network on every route, each settled by its own facilitator ({ network, facilitator }); Base mainnet has no default facilitator, so sellers name one, and Base Sepolia defaults to x402.org. Receipts and onSettled report the network a payment settled on. When a facilitator's /supported names no transfer method, exact offers now default to EIP-3009 (x402's default) instead of Permit2.