v0.2.0 - 2026-07-03
🩹 Fixes
- Initial release with EVM-only support and single-network routing.
📖 Changes
What's New:
- Multi-network (EVM + SVM) support: Routes now accept payment from both EVM (Base, etc.) and Solana networks simultaneously, matching
@x402/expressbehaviour. TNetworkPaymenttype -- per-network entry with optionalscheme,price,network,payTo,description, andmimeTypeoverrides.TRoutePaymenttype -- replaces the oldTX402Config; supports anacceptsarray for full multi-network control.TSchemetype --"exact"|"upto"|"batch-settlement".acceptsarray field onTRoutePayment-- pass an explicit list of network entries for full control.config.networksarray -- replaces the singlenetwork+addresspair; supports both EVM and SVM entries project-wide.BunAdapter-- new class implementing@x402/core HTTPAdapterdirectly againstBun.BunRequest, handling headers, method, path, URL, query params, user-agent, and accept header.- Scheme registration is now driven by the resolved
acceptslist; every unique network is registered exactly once (EVM registersexact,upto, andbatch-settlement; SVM registersexact). X402Buildernow maintains a static server cache (_serverCache+_initPromises) so each route'sx402HTTPResourceServeris initialized only once across all requests, preventing duplicate SVM feePayer lookups.- Payment flow delegates entirely to
@x402/core'sx402HTTPResourceServer.processHTTPRequestandprocessSettlement, replacing the hand-rolled verify/settle/decode chain. - CORS headers (
Access-Control-Allow-Origin: *,Access-Control-Expose-Headers: *) are now attached to all 402 and settlement responses. - Handler cancellation: if the route handler throws or returns a 4xx/5xx,
cancellationDispatcher.cancel()is called before returning. - Facilitator errors during settlement are caught and returned as
502JSON responses instead of being re-thrown. X402Exceptionnow defaults to error code502instead of402.
Changes:
config/x402.tsno longer has aversionfield at all (the oldx402Version/version: 1key is gone project-wide); it now ships with a flatnetworksarray containing Base mainnet (eip155:8453) and Solana mainnet (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp) entries instead of a singlenetwork+address+testnetblock.- Default scheme is
"exact". X402Builderresolves networks via a 4-level priority cascade: explicitacceptsarray -> route single-network shorthand (network+payTo) -> confignetworksblock -> built-in defaults (Base + Polygon + Arbitrum + World Chain for EVM; Solana mainnet for SVM).setPaywall()removed; replaced bysetRoutePayment(config?: TRoutePayment).setConfig()removed; per-route metadata (description,mimeType,scheme,price) are now fields onTRoutePayment.setFacilitator()now acceptsTFacilitator(a plain{ url?: string, createAuthHeaders?: () => Promise<...> }object) instead of the oldFacilitatorConfig; defaults to@coinbase/x402facilitator.middleware()return type tightened toPromise<Response>.- Dependency
x402replaced by@coinbase/x402 ^2.1.0,@x402/core ^2.17.0,@x402/evm ^2.17.0, and@x402/svm ^2.17.0. src/types/directory added; types are now exported from their own module instead of being inlined in builder files.- Build script now includes a
typesstep (cp -rf src/types dist) so type definitions are copied alongside compiled output.
❤️Contributors
- Havea Crenata (@crenata)
Full Changelog: https://github.com/Bejibun-Framework/bejibun-x402/blob/master/CHANGELOG.md