File tree Expand file tree Collapse file tree 5 files changed +15
-2
lines changed Expand file tree Collapse file tree 5 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Add optional recipientAddress to x402 settlePayment
Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Expose 7702 utility functions
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export {
5454 createSessionKey ,
5555 isCreateSessionKeySupported ,
5656} from "../../extensions/erc7702/account/createSessionKey.js" ;
57+
5758export type {
5859 Condition ,
5960 LimitType ,
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ export async function decodePaymentRequest(
4444 price,
4545 network,
4646 facilitator,
47+ payTo,
4748 resourceUrl,
4849 routeConfig = { } ,
4950 method,
@@ -104,7 +105,7 @@ export async function decodePaymentRequest(
104105 resource : resourceUrl ,
105106 description : description ?? "" ,
106107 mimeType : mimeType ?? "application/json" ,
107- payTo : getAddress ( facilitator . address ) ,
108+ payTo : getAddress ( facilitator . address ) , // always pay to the facilitator address first
108109 maxTimeoutSeconds : maxTimeoutSeconds ?? 300 ,
109110 asset : getAddress ( asset . address ) ,
110111 outputSchema : {
@@ -117,6 +118,7 @@ export async function decodePaymentRequest(
117118 output : outputSchema ,
118119 } ,
119120 extra : {
121+ recipientAddress : payTo , // input payTo is the final recipient address
120122 ...( ( asset as ERC20TokenAmount [ "asset" ] ) . eip712 ?? { } ) ,
121123 } ,
122124 } ) ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export type PaymentArgs = {
3434 facilitator : ThirdwebX402Facilitator ;
3535 /** Optional configuration for the payment middleware route */
3636 routeConfig ?: PaymentMiddlewareConfig ;
37- /** @deprecated Use facilitator. address instead */
37+ /** Optional recipient address to receive the payment if different from your facilitator address */
3838 payTo ?: string ;
3939} ;
4040
You can’t perform that action at this time.
0 commit comments