Recursively convert BigInt values to string so the result is
safe for JSON.stringify().
Useful in Next.js API Routes, Express handlers, or anywhere you
need to serialize gateway / x402 objects that contain BigInt
fields like pricePerCall, maxBudget, or amountCharged.
Parameters
obj: unknown
Any value (object, array, primitive, BigInt).
Returns unknown
A deep clone with every BigInt replaced by its string
representation.
Recursively convert
BigIntvalues tostringso the result is safe forJSON.stringify().Useful in Next.js API Routes, Express handlers, or anywhere you need to serialize gateway / x402 objects that contain
BigIntfields likepricePerCall,maxBudget, oramountCharged.