Skip to content

Commit 3bb4d0b

Browse files
[x402] Add recipientAddress to payment request and replace deprecated payTo
1 parent 080d7f2 commit 3bb4d0b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.changeset/loud-apples-poke.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+
Add optional recipientAddress to x402 settlePayment

packages/thirdweb/src/x402/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export async function decodePaymentRequest(
4444
price,
4545
network,
4646
facilitator,
47+
recipientAddress,
4748
resourceUrl,
4849
routeConfig = {},
4950
method,
@@ -117,6 +118,7 @@ export async function decodePaymentRequest(
117118
output: outputSchema,
118119
},
119120
extra: {
121+
recipientAddress,
120122
...((asset as ERC20TokenAmount["asset"]).eip712 ?? {}),
121123
},
122124
});

packages/thirdweb/src/x402/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export type PaymentArgs = {
3434
facilitator: ThirdwebX402Facilitator;
3535
/** Optional configuration for the payment middleware route */
3636
routeConfig?: PaymentMiddlewareConfig;
37-
/** @deprecated Use facilitator.address instead */
38-
payTo?: string;
37+
/** Optional recipient address to receive the payment if different from your facilitator address */
38+
recipientAddress?: string;
3939
};
4040

4141
export type SettlePaymentArgs = PaymentArgs & {

0 commit comments

Comments
 (0)