@agentspend/sdk 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/src/index.ts +3 -2
package/dist/index.js
CHANGED
|
@@ -141,8 +141,9 @@ function createAgentSpend(options) {
|
|
|
141
141
|
return c.json({ error: "Could not determine payment amount from request" }, 400);
|
|
142
142
|
}
|
|
143
143
|
const currency = opts.currency ?? "usd";
|
|
144
|
-
// Step 3: Check for
|
|
145
|
-
|
|
144
|
+
// Step 3: Check for payment header → crypto payment
|
|
145
|
+
// x402 v2 uses "Payment-Signature", v1 uses "X-Payment"
|
|
146
|
+
const paymentHeader = c.req.header("payment-signature") ?? c.req.header("x-payment");
|
|
146
147
|
if (paymentHeader) {
|
|
147
148
|
return handleCryptoPayment(c, next, paymentHeader, effectiveAmount, currency, body, opts);
|
|
148
149
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -293,8 +293,9 @@ export function createAgentSpend(options: AgentSpendOptions): AgentSpend {
|
|
|
293
293
|
|
|
294
294
|
const currency = opts.currency ?? "usd";
|
|
295
295
|
|
|
296
|
-
// Step 3: Check for
|
|
297
|
-
|
|
296
|
+
// Step 3: Check for payment header → crypto payment
|
|
297
|
+
// x402 v2 uses "Payment-Signature", v1 uses "X-Payment"
|
|
298
|
+
const paymentHeader = c.req.header("payment-signature") ?? c.req.header("x-payment");
|
|
298
299
|
if (paymentHeader) {
|
|
299
300
|
return handleCryptoPayment(c, next, paymentHeader, effectiveAmount, currency, body, opts);
|
|
300
301
|
}
|