File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
packages/thirdweb/src/x402 Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " thirdweb " : patch
3+ ---
4+
5+ updates default x402 transfer with authorization timeout
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ export async function decodePaymentRequest(
107107 description : description ?? "" ,
108108 mimeType : mimeType ?? "application/json" ,
109109 payTo : getAddress ( facilitator . address ) , // always pay to the facilitator address first
110- maxTimeoutSeconds : maxTimeoutSeconds ?? 300 ,
110+ maxTimeoutSeconds : maxTimeoutSeconds ?? 86400 ,
111111 asset : getAddress ( asset . address ) ,
112112 outputSchema : {
113113 input : {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ function preparePaymentHeader(
3232 nonce : Hex ,
3333) : UnsignedPaymentPayload {
3434 const validAfter = BigInt (
35- Math . floor ( Date . now ( ) / 1000 ) - 600 , // 10 minutes before
35+ Math . floor ( Date . now ( ) / 1000 ) - 86400 , // 24h before in case weird block timestamp behavior
3636 ) . toString ( ) ;
3737 const validBefore = BigInt (
3838 Math . floor ( Date . now ( ) / 1000 + paymentRequirements . maxTimeoutSeconds ) ,
You can’t perform that action at this time.
0 commit comments