@agent-score/commerce 2.6.4 → 2.6.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/README.md +2 -2
- package/dist/challenge/index.js +1 -1
- package/dist/challenge/index.js.map +1 -1
- package/dist/challenge/index.mjs +1 -1
- package/dist/challenge/index.mjs.map +1 -1
- package/dist/{checkout-BtdHSF_w.d.mts → checkout-DOd9GDmt.d.mts} +6 -3
- package/dist/{checkout-B-Z5_EQP.d.ts → checkout-GcDNDzSK.d.ts} +6 -3
- package/dist/core.js +2 -2
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +2 -2
- package/dist/core.mjs.map +1 -1
- package/dist/discovery/index.d.mts +12 -3
- package/dist/discovery/index.d.ts +12 -3
- package/dist/discovery/index.js +15 -9
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/index.mjs +15 -9
- package/dist/discovery/index.mjs.map +1 -1
- package/dist/identity/express.js +2 -2
- package/dist/identity/express.js.map +1 -1
- package/dist/identity/express.mjs +2 -2
- package/dist/identity/express.mjs.map +1 -1
- package/dist/identity/fastify.js +2 -2
- package/dist/identity/fastify.js.map +1 -1
- package/dist/identity/fastify.mjs +2 -2
- package/dist/identity/fastify.mjs.map +1 -1
- package/dist/identity/hono.js +2 -2
- package/dist/identity/hono.js.map +1 -1
- package/dist/identity/hono.mjs +2 -2
- package/dist/identity/hono.mjs.map +1 -1
- package/dist/identity/nextjs.js +2 -2
- package/dist/identity/nextjs.js.map +1 -1
- package/dist/identity/nextjs.mjs +2 -2
- package/dist/identity/nextjs.mjs.map +1 -1
- package/dist/identity/web.js +2 -2
- package/dist/identity/web.js.map +1 -1
- package/dist/identity/web.mjs +2 -2
- package/dist/identity/web.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -6
- package/dist/index.mjs.map +1 -1
- package/dist/payment/index.d.mts +26 -12
- package/dist/payment/index.d.ts +26 -12
- package/dist/payment/index.js +18 -0
- package/dist/payment/index.js.map +1 -1
- package/dist/payment/index.mjs +17 -0
- package/dist/payment/index.mjs.map +1 -1
- package/package.json +12 -12
package/dist/payment/index.mjs
CHANGED
|
@@ -1142,6 +1142,22 @@ function x402SignerFromPayload(payload) {
|
|
|
1142
1142
|
txHash: null
|
|
1143
1143
|
};
|
|
1144
1144
|
}
|
|
1145
|
+
function mppCredentialPayloadType(authorizationHeader) {
|
|
1146
|
+
if (typeof authorizationHeader !== "string") return null;
|
|
1147
|
+
if (!authorizationHeader.toLowerCase().startsWith("payment ")) return null;
|
|
1148
|
+
const token = authorizationHeader.slice("payment ".length).trim();
|
|
1149
|
+
if (!token) return null;
|
|
1150
|
+
try {
|
|
1151
|
+
const credential = JSON.parse(atob(token));
|
|
1152
|
+
if (!credential || typeof credential !== "object") return null;
|
|
1153
|
+
const payload = credential.payload;
|
|
1154
|
+
if (!payload || typeof payload !== "object") return null;
|
|
1155
|
+
const type = payload.type;
|
|
1156
|
+
return typeof type === "string" ? type : null;
|
|
1157
|
+
} catch {
|
|
1158
|
+
return null;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1145
1161
|
function mppSignerFromAuth(authorizationHeader) {
|
|
1146
1162
|
if (typeof authorizationHeader !== "string") return NULL_RESULT;
|
|
1147
1163
|
if (!authorizationHeader.toLowerCase().startsWith("payment ")) return NULL_RESULT;
|
|
@@ -1434,6 +1450,7 @@ export {
|
|
|
1434
1450
|
loadSolanaFeePayer,
|
|
1435
1451
|
lookupRail,
|
|
1436
1452
|
malformedPaymentCredential,
|
|
1453
|
+
mppCredentialPayloadType,
|
|
1437
1454
|
mppxChallengeHeaders,
|
|
1438
1455
|
networkFamily,
|
|
1439
1456
|
networks,
|