File tree Expand file tree Collapse file tree 5 files changed +11
-0
lines changed
packages/thirdweb/src/x402 Expand file tree Collapse file tree 5 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ Add fundWalletLink prop to x402 responses
Original file line number Diff line number Diff line change @@ -41,13 +41,15 @@ export type RequestedPaymentRequirements = z.infer<
4141const FacilitatorSettleResponseSchema = SettleResponseSchema . extend ( {
4242 network : FacilitatorNetworkSchema ,
4343 errorMessage : z . string ( ) . optional ( ) ,
44+ fundWalletLink : z . string ( ) . optional ( ) ,
4445} ) ;
4546export type FacilitatorSettleResponse = z . infer <
4647 typeof FacilitatorSettleResponseSchema
4748> ;
4849
4950const FacilitatorVerifyResponseSchema = VerifyResponseSchema . extend ( {
5051 errorMessage : z . string ( ) . optional ( ) ,
52+ fundWalletLink : z . string ( ) . optional ( ) ,
5153} ) ;
5254
5355export type FacilitatorVerifyResponse = z . infer <
Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ export async function settlePayment(
167167 error,
168168 errorMessage :
169169 errorMessages ?. settlementFailed || settlement . errorMessage ,
170+ fundWalletLink : settlement . fundWalletLink ,
170171 accepts : paymentRequirements ,
171172 } ,
172173 } ;
Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ export type PaymentRequiredResult = {
5858 accepts : RequestedPaymentRequirements [ ] ;
5959 /** Optional payer address if verification partially succeeded */
6060 payer ?: string ;
61+ /** Optional link to a wallet to fund the wallet of the payer */
62+ fundWalletLink ?: string ;
6163 } ;
6264 /** Response headers for the error response */
6365 responseHeaders : Record < string , string > ;
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ export async function verifyPayment(
112112 error : error ,
113113 errorMessage :
114114 errorMessages ?. verificationFailed || verification . errorMessage ,
115+ fundWalletLink : verification . fundWalletLink ,
115116 accepts : paymentRequirements ,
116117 } ,
117118 } ;
You can’t perform that action at this time.
0 commit comments