From 2fc5974c70fbb2067f39334a9930c33144d11e5e Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Sun, 26 Oct 2025 20:42:04 +1300 Subject: [PATCH] [X402] Fix network comparison in decodePaymentRequest --- .changeset/plain-maps-draw.md | 5 +++++ packages/thirdweb/src/x402/common.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/plain-maps-draw.md diff --git a/.changeset/plain-maps-draw.md b/.changeset/plain-maps-draw.md new file mode 100644 index 00000000000..6a4817651ef --- /dev/null +++ b/.changeset/plain-maps-draw.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fix network comparison when using diff libraries diff --git a/packages/thirdweb/src/x402/common.ts b/packages/thirdweb/src/x402/common.ts index 84c93b80fee..bf4a4721f41 100644 --- a/packages/thirdweb/src/x402/common.ts +++ b/packages/thirdweb/src/x402/common.ts @@ -162,7 +162,8 @@ export async function decodePaymentRequest( const selectedPaymentRequirements = paymentRequirements.find( (value) => value.scheme === decodedPayment.scheme && - value.network === decodedPayment.network, + networkToChainId(value.network) === + networkToChainId(decodedPayment.network), ); if (!selectedPaymentRequirements) { return {