Skip to content

Commit ae3a122

Browse files
[X402] Fix network comparison in decodePaymentRequest (#8313)
1 parent 2412a69 commit ae3a122

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/plain-maps-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix network comparison when using diff libraries

packages/thirdweb/src/x402/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ export async function decodePaymentRequest(
162162
const selectedPaymentRequirements = paymentRequirements.find(
163163
(value) =>
164164
value.scheme === decodedPayment.scheme &&
165-
value.network === decodedPayment.network,
165+
networkToChainId(value.network) ===
166+
networkToChainId(decodedPayment.network),
166167
);
167168
if (!selectedPaymentRequirements) {
168169
return {

0 commit comments

Comments
 (0)