@agent-score/commerce 2.7.5 → 2.7.7
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/challenge/index.d.mts +3 -3
- package/dist/challenge/index.d.ts +3 -3
- package/dist/{checkout-DKq9gV3G.d.mts → checkout-B0jIzAEo.d.mts} +5 -5
- package/dist/{checkout-DW7GgRrl.d.ts → checkout-BRdpPSnc.d.ts} +5 -5
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/discovery/index.d.mts +6 -6
- package/dist/discovery/index.d.ts +6 -6
- package/dist/{gate-GCXy4FHI.d.mts → gate-BMUMi-P0.d.mts} +2 -2
- package/dist/{gate-D2RP6bZg.d.ts → gate-Bhbi5zvG.d.ts} +2 -2
- package/dist/identity/express.d.mts +2 -2
- package/dist/identity/express.d.ts +2 -2
- package/dist/identity/express.js +1 -1
- package/dist/identity/express.mjs +1 -1
- package/dist/identity/fastify.d.mts +2 -2
- package/dist/identity/fastify.d.ts +2 -2
- package/dist/identity/fastify.js +1 -1
- package/dist/identity/fastify.mjs +1 -1
- package/dist/identity/hono.d.mts +2 -2
- package/dist/identity/hono.d.ts +2 -2
- package/dist/identity/hono.js +1 -1
- package/dist/identity/hono.mjs +1 -1
- package/dist/identity/nextjs.d.mts +2 -2
- package/dist/identity/nextjs.d.ts +2 -2
- package/dist/identity/nextjs.js +1 -1
- package/dist/identity/nextjs.mjs +1 -1
- package/dist/identity/web.d.mts +2 -2
- package/dist/identity/web.d.ts +2 -2
- package/dist/identity/web.js +1 -1
- package/dist/identity/web.mjs +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +179 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +179 -65
- package/dist/index.mjs.map +1 -1
- package/dist/{network_kind-toxNABqw.d.ts → network_kind-C3NA2wX2.d.ts} +2 -2
- package/dist/{network_kind-CLdLbqU5.d.mts → network_kind-DmHbQbOb.d.mts} +2 -2
- package/dist/payment/index.d.mts +5 -5
- package/dist/payment/index.d.ts +5 -5
- package/dist/{pricing-Dx3F1VAv.d.ts → pricing-DUYE2hIy.d.ts} +1 -1
- package/dist/{pricing-sfv3CPiY.d.mts → pricing-Wqbq6xIR.d.mts} +1 -1
- package/dist/{rail_spec-DGdb4Gnd.d.mts → rail_spec-C-jTQ7g6.d.mts} +1 -1
- package/dist/{rail_spec-DGdb4Gnd.d.ts → rail_spec-C-jTQ7g6.d.ts} +1 -1
- package/dist/stripe-multichain/index.js +175 -61
- package/dist/stripe-multichain/index.js.map +1 -1
- package/dist/stripe-multichain/index.mjs +175 -61
- package/dist/stripe-multichain/index.mjs.map +1 -1
- package/dist/{types-D1slMt0H.d.mts → types-1Mr5ZDas.d.mts} +1 -1
- package/dist/{types-D1slMt0H.d.ts → types-1Mr5ZDas.d.ts} +1 -1
- package/dist/{x402_server-Ciz2mls2.d.mts → x402_server-hgQzWQwB.d.mts} +1 -1
- package/dist/{x402_server-Ciz2mls2.d.ts → x402_server-hgQzWQwB.d.ts} +1 -1
- package/package.json +15 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as RecipientLike, T as TempoRailSpec, X as X402BaseRailSpec, S as SolanaMppRailSpec, b as StripeRailSpec } from './rail_spec-C-jTQ7g6.js';
|
|
2
2
|
|
|
3
3
|
/** Detects whether a request is a "settle leg" (carries a payment credential)
|
|
4
4
|
* vs a "discovery leg" (no payment credential, expects a 402).
|
|
@@ -231,4 +231,4 @@ declare function isEvmNetwork(input: NetworkLike): boolean;
|
|
|
231
231
|
* network spec — this helper treats it as false. */
|
|
232
232
|
declare function isSolanaNetwork(input: NetworkLike): boolean;
|
|
233
233
|
|
|
234
|
-
export { type BuildDefaultCheckoutRailsOptions as B, type HeadersLike as H, type MalformedPaymentCredential as M,
|
|
234
|
+
export { type BuildDefaultCheckoutRailsOptions as B, type HeadersLike as H, type MalformedPaymentCredential as M, buildMppxComposeRails as a, buildDefaultCheckoutRails as b, hasPaymentHeader as c, hasX402Header as d, isSolanaNetwork as e, formatUsdCents as f, type BuildMppxComposeRailsOptions as g, hasMppxHeader as h, isEvmNetwork as i, asHeaders as j, loadSolanaFeePayer as l, malformedPaymentCredential as m, readHeader as r, usdToAtomic as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as RecipientLike, T as TempoRailSpec, X as X402BaseRailSpec, S as SolanaMppRailSpec, b as StripeRailSpec } from './rail_spec-C-jTQ7g6.mjs';
|
|
2
2
|
|
|
3
3
|
/** Detects whether a request is a "settle leg" (carries a payment credential)
|
|
4
4
|
* vs a "discovery leg" (no payment credential, expects a 402).
|
|
@@ -231,4 +231,4 @@ declare function isEvmNetwork(input: NetworkLike): boolean;
|
|
|
231
231
|
* network spec — this helper treats it as false. */
|
|
232
232
|
declare function isSolanaNetwork(input: NetworkLike): boolean;
|
|
233
233
|
|
|
234
|
-
export { type BuildDefaultCheckoutRailsOptions as B, type HeadersLike as H, type MalformedPaymentCredential as M,
|
|
234
|
+
export { type BuildDefaultCheckoutRailsOptions as B, type HeadersLike as H, type MalformedPaymentCredential as M, buildMppxComposeRails as a, buildDefaultCheckoutRails as b, hasPaymentHeader as c, hasX402Header as d, isSolanaNetwork as e, formatUsdCents as f, type BuildMppxComposeRailsOptions as g, hasMppxHeader as h, isEvmNetwork as i, asHeaders as j, loadSolanaFeePayer as l, malformedPaymentCredential as m, readHeader as r, usdToAtomic as u };
|
package/dist/payment/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TempoRailSpec, S as SolanaMppRailSpec,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { B as BuildX402AcceptsForOptions, C as CreateX402ServerOptions,
|
|
1
|
+
import { T as TempoRailSpec, S as SolanaMppRailSpec, a as TempoSessionRailSpec, b as StripeRailSpec, X as X402BaseRailSpec } from '../rail_spec-C-jTQ7g6.mjs';
|
|
2
|
+
export { c as RAIL_SPEC_DEFAULTS, R as RecipientLike, r as resolveRecipient } from '../rail_spec-C-jTQ7g6.mjs';
|
|
3
|
+
import { X as X402Server } from '../x402_server-hgQzWQwB.mjs';
|
|
4
|
+
export { B as BuildX402AcceptsForOptions, C as CreateX402ServerOptions, a as X402FacilitatorChoice, b as X402SymbolicRail, c as buildX402AcceptsFor402, d as createX402Server } from '../x402_server-hgQzWQwB.mjs';
|
|
5
5
|
export { a as aliasAmountFields, p as paymentRequiredHeader, w as wwwAuthenticateHeader } from '../wwwauthenticate-Dgm-_af9.mjs';
|
|
6
6
|
import { S as SignerNetwork } from '../signer-3FAit11j.mjs';
|
|
7
7
|
export { P as PaymentSigner, e as extractPaymentSigner, a as extractPaymentSignerFromAuth, b as extractSignerForPrecheck, r as readX402PaymentHeader } from '../signer-3FAit11j.mjs';
|
|
8
|
-
export { B as BuildDefaultCheckoutRailsOptions,
|
|
8
|
+
export { B as BuildDefaultCheckoutRailsOptions, g as BuildMppxComposeRailsOptions, H as HeadersLike, M as MalformedPaymentCredential, j as asHeaders, b as buildDefaultCheckoutRails, a as buildMppxComposeRails, f as formatUsdCents, h as hasMppxHeader, c as hasPaymentHeader, d as hasX402Header, i as isEvmNetwork, e as isSolanaNetwork, l as loadSolanaFeePayer, m as malformedPaymentCredential, r as readHeader, u as usdToAtomic } from '../network_kind-DmHbQbOb.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Build the base64-encoded `request` blob for an MPP Payment directive (per the
|
package/dist/payment/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TempoRailSpec, S as SolanaMppRailSpec,
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export { B as BuildX402AcceptsForOptions, C as CreateX402ServerOptions,
|
|
1
|
+
import { T as TempoRailSpec, S as SolanaMppRailSpec, a as TempoSessionRailSpec, b as StripeRailSpec, X as X402BaseRailSpec } from '../rail_spec-C-jTQ7g6.js';
|
|
2
|
+
export { c as RAIL_SPEC_DEFAULTS, R as RecipientLike, r as resolveRecipient } from '../rail_spec-C-jTQ7g6.js';
|
|
3
|
+
import { X as X402Server } from '../x402_server-hgQzWQwB.js';
|
|
4
|
+
export { B as BuildX402AcceptsForOptions, C as CreateX402ServerOptions, a as X402FacilitatorChoice, b as X402SymbolicRail, c as buildX402AcceptsFor402, d as createX402Server } from '../x402_server-hgQzWQwB.js';
|
|
5
5
|
export { a as aliasAmountFields, p as paymentRequiredHeader, w as wwwAuthenticateHeader } from '../wwwauthenticate-Dgm-_af9.js';
|
|
6
6
|
import { S as SignerNetwork } from '../signer-3FAit11j.js';
|
|
7
7
|
export { P as PaymentSigner, e as extractPaymentSigner, a as extractPaymentSignerFromAuth, b as extractSignerForPrecheck, r as readX402PaymentHeader } from '../signer-3FAit11j.js';
|
|
8
|
-
export { B as BuildDefaultCheckoutRailsOptions,
|
|
8
|
+
export { B as BuildDefaultCheckoutRailsOptions, g as BuildMppxComposeRailsOptions, H as HeadersLike, M as MalformedPaymentCredential, j as asHeaders, b as buildDefaultCheckoutRails, a as buildMppxComposeRails, f as formatUsdCents, h as hasMppxHeader, c as hasPaymentHeader, d as hasX402Header, i as isEvmNetwork, e as isSolanaNetwork, l as loadSolanaFeePayer, m as malformedPaymentCredential, r as readHeader, u as usdToAtomic } from '../network_kind-C3NA2wX2.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Build the base64-encoded `request` blob for an MPP Payment directive (per the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TempoRailSpec, X as X402BaseRailSpec, S as SolanaMppRailSpec, b as StripeRailSpec } from './rail_spec-
|
|
1
|
+
import { T as TempoRailSpec, X as X402BaseRailSpec, S as SolanaMppRailSpec, b as StripeRailSpec } from './rail_spec-C-jTQ7g6.js';
|
|
2
2
|
|
|
3
3
|
interface HowToPayRailEntry {
|
|
4
4
|
setup?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TempoRailSpec, X as X402BaseRailSpec, S as SolanaMppRailSpec, b as StripeRailSpec } from './rail_spec-
|
|
1
|
+
import { T as TempoRailSpec, X as X402BaseRailSpec, S as SolanaMppRailSpec, b as StripeRailSpec } from './rail_spec-C-jTQ7g6.mjs';
|
|
2
2
|
|
|
3
3
|
interface HowToPayRailEntry {
|
|
4
4
|
setup?: string[];
|
|
@@ -128,4 +128,4 @@ declare const RAIL_SPEC_DEFAULTS: {
|
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
export {
|
|
131
|
+
export { type RecipientLike as R, type SolanaMppRailSpec as S, type TempoRailSpec as T, type X402BaseRailSpec as X, type TempoSessionRailSpec as a, type StripeRailSpec as b, RAIL_SPEC_DEFAULTS as c, resolveRecipient as r };
|
|
@@ -128,4 +128,4 @@ declare const RAIL_SPEC_DEFAULTS: {
|
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
export {
|
|
131
|
+
export { type RecipientLike as R, type SolanaMppRailSpec as S, type TempoRailSpec as T, type X402BaseRailSpec as X, type TempoSessionRailSpec as a, type StripeRailSpec as b, RAIL_SPEC_DEFAULTS as c, resolveRecipient as r };
|
|
@@ -24,11 +24,11 @@ var __export = (target, all) => {
|
|
|
24
24
|
for (var name in all)
|
|
25
25
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
26
|
};
|
|
27
|
-
var __copyProps = (to,
|
|
28
|
-
if (
|
|
29
|
-
for (let key of __getOwnPropNames(
|
|
27
|
+
var __copyProps = (to, from10, except, desc) => {
|
|
28
|
+
if (from10 && typeof from10 === "object" || typeof from10 === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from10))
|
|
30
30
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
-
__defProp(to, key, { get: () =>
|
|
31
|
+
__defProp(to, key, { get: () => from10[key], enumerable: !(desc = __getOwnPropDesc(from10, key)) || desc.enumerable });
|
|
32
32
|
}
|
|
33
33
|
return to;
|
|
34
34
|
};
|
|
@@ -1008,7 +1008,7 @@ var init_sha256 = __esm({
|
|
|
1008
1008
|
}
|
|
1009
1009
|
});
|
|
1010
1010
|
|
|
1011
|
-
// node_modules/@noble/curves/esm/abstract/utils.js
|
|
1011
|
+
// node_modules/ox/node_modules/@noble/curves/esm/abstract/utils.js
|
|
1012
1012
|
function equalBytes(a, b) {
|
|
1013
1013
|
if (a.length !== b.length)
|
|
1014
1014
|
return false;
|
|
@@ -1019,7 +1019,7 @@ function equalBytes(a, b) {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
var hasHexBuiltin;
|
|
1021
1021
|
var init_utils2 = __esm({
|
|
1022
|
-
"node_modules/@noble/curves/esm/abstract/utils.js"() {
|
|
1022
|
+
"node_modules/ox/node_modules/@noble/curves/esm/abstract/utils.js"() {
|
|
1023
1023
|
"use strict";
|
|
1024
1024
|
hasHexBuiltin = // @ts-ignore
|
|
1025
1025
|
typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function";
|
|
@@ -19244,10 +19244,16 @@ var init_Errors2 = __esm({
|
|
|
19244
19244
|
methodUnsupported: "Use a supported wallet to pay for this resource using one of the supported payment methods returned in the WWW-Authenticate header. See https://mpp.dev/tools/wallet.md"
|
|
19245
19245
|
};
|
|
19246
19246
|
PaymentError = class extends Error {
|
|
19247
|
+
/** Safe method-specific context for diagnostics and relay responses. */
|
|
19248
|
+
details;
|
|
19247
19249
|
/** HTTP status code. */
|
|
19248
19250
|
status = 402;
|
|
19249
19251
|
/** Actionable hint for resolving the error (RFC 9457 extension member). */
|
|
19250
19252
|
hint;
|
|
19253
|
+
constructor(message, options = {}) {
|
|
19254
|
+
super(message);
|
|
19255
|
+
this.details = options.details;
|
|
19256
|
+
}
|
|
19251
19257
|
/** Converts the error to RFC 9457 Problem Details format. */
|
|
19252
19258
|
toProblemDetails(challengeId) {
|
|
19253
19259
|
return {
|
|
@@ -19255,6 +19261,7 @@ var init_Errors2 = __esm({
|
|
|
19255
19261
|
title: this.title,
|
|
19256
19262
|
status: this.status,
|
|
19257
19263
|
detail: this.message,
|
|
19264
|
+
...this.details && Object.keys(this.details).length > 0 && { details: this.details },
|
|
19258
19265
|
...this.hint && { hint: this.hint },
|
|
19259
19266
|
...challengeId && { challengeId }
|
|
19260
19267
|
};
|
|
@@ -19288,8 +19295,10 @@ var init_Errors2 = __esm({
|
|
|
19288
19295
|
title = "Verification Failed";
|
|
19289
19296
|
type = "https://paymentauth.org/problems/verification-failed";
|
|
19290
19297
|
constructor(options = {}) {
|
|
19291
|
-
const { reason } = options;
|
|
19292
|
-
super(reason ? `Payment verification failed: ${reason}.` : "Payment verification failed."
|
|
19298
|
+
const { details, reason } = options;
|
|
19299
|
+
super(reason ? `Payment verification failed: ${reason}.` : "Payment verification failed.", {
|
|
19300
|
+
details
|
|
19301
|
+
});
|
|
19293
19302
|
}
|
|
19294
19303
|
};
|
|
19295
19304
|
PaymentActionRequiredError = class extends PaymentError {
|
|
@@ -19521,7 +19530,7 @@ var version3;
|
|
|
19521
19530
|
var init_version2 = __esm({
|
|
19522
19531
|
"node_modules/viem/_esm/errors/version.js"() {
|
|
19523
19532
|
"use strict";
|
|
19524
|
-
version3 = "2.55.
|
|
19533
|
+
version3 = "2.55.8";
|
|
19525
19534
|
}
|
|
19526
19535
|
});
|
|
19527
19536
|
|
|
@@ -20006,60 +20015,93 @@ var init_isAddress = __esm({
|
|
|
20006
20015
|
}
|
|
20007
20016
|
});
|
|
20008
20017
|
|
|
20009
|
-
// node_modules/viem/_esm/
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
init_base();
|
|
20015
|
-
InvalidDecimalNumberError = class extends BaseError3 {
|
|
20016
|
-
constructor({ value }) {
|
|
20017
|
-
super(`Number \`${value}\` is not a valid decimal number.`, {
|
|
20018
|
-
name: "InvalidDecimalNumberError"
|
|
20019
|
-
});
|
|
20020
|
-
}
|
|
20021
|
-
};
|
|
20022
|
-
}
|
|
20023
|
-
});
|
|
20024
|
-
|
|
20025
|
-
// node_modules/viem/_esm/utils/unit/parseUnits.js
|
|
20026
|
-
function parseUnits(value, decimals) {
|
|
20027
|
-
if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(value))
|
|
20018
|
+
// node_modules/viem/_esm/utils/unit/Value.js
|
|
20019
|
+
function from6(value, decimals = 0) {
|
|
20020
|
+
if (!Number.isInteger(decimals) || decimals < 0)
|
|
20021
|
+
throw new InvalidDecimalsError({ decimals });
|
|
20022
|
+
if (!/^-?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)$/.test(value))
|
|
20028
20023
|
throw new InvalidDecimalNumberError({ value });
|
|
20029
|
-
let [integer2, fraction = "0"] = value.split(".");
|
|
20024
|
+
let [integer2 = "", fraction = "0"] = value.split(".");
|
|
20030
20025
|
const negative = integer2.startsWith("-");
|
|
20031
20026
|
if (negative)
|
|
20032
20027
|
integer2 = integer2.slice(1);
|
|
20028
|
+
if (integer2 === "")
|
|
20029
|
+
integer2 = "0";
|
|
20033
20030
|
fraction = fraction.replace(/(0+)$/, "");
|
|
20034
20031
|
if (decimals === 0) {
|
|
20035
|
-
if (
|
|
20032
|
+
if (fraction.length > 0 && Number.parseInt(fraction[0], 10) >= 5)
|
|
20036
20033
|
integer2 = `${BigInt(integer2) + 1n}`;
|
|
20037
20034
|
fraction = "";
|
|
20038
20035
|
} else if (fraction.length > decimals) {
|
|
20039
|
-
const
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
fraction =
|
|
20051
|
-
integer2 = `${BigInt(integer2) + 1n}`;
|
|
20036
|
+
const left = fraction.slice(0, decimals);
|
|
20037
|
+
const roundDigit = Number.parseInt(fraction.slice(decimals, decimals + 1), 10);
|
|
20038
|
+
if (roundDigit >= 5) {
|
|
20039
|
+
const carried = carry(left);
|
|
20040
|
+
if (carried.length > decimals) {
|
|
20041
|
+
fraction = carried.slice(1);
|
|
20042
|
+
integer2 = `${BigInt(integer2) + 1n}`;
|
|
20043
|
+
} else {
|
|
20044
|
+
fraction = carried;
|
|
20045
|
+
}
|
|
20046
|
+
} else {
|
|
20047
|
+
fraction = left;
|
|
20052
20048
|
}
|
|
20053
|
-
fraction = fraction.slice(0, decimals);
|
|
20054
20049
|
} else {
|
|
20055
20050
|
fraction = fraction.padEnd(decimals, "0");
|
|
20056
20051
|
}
|
|
20057
20052
|
return BigInt(`${negative ? "-" : ""}${integer2}${fraction}`);
|
|
20058
20053
|
}
|
|
20054
|
+
function carry(digits) {
|
|
20055
|
+
const out = digits.split("");
|
|
20056
|
+
let i = out.length - 1;
|
|
20057
|
+
while (i >= 0) {
|
|
20058
|
+
const d = Number.parseInt(out[i], 10) + 1;
|
|
20059
|
+
if (d < 10) {
|
|
20060
|
+
out[i] = String(d);
|
|
20061
|
+
return out.join("");
|
|
20062
|
+
}
|
|
20063
|
+
out[i] = "0";
|
|
20064
|
+
i--;
|
|
20065
|
+
}
|
|
20066
|
+
return `1${out.join("")}`;
|
|
20067
|
+
}
|
|
20068
|
+
var InvalidDecimalNumberError, InvalidDecimalsError;
|
|
20069
|
+
var init_Value2 = __esm({
|
|
20070
|
+
"node_modules/viem/_esm/utils/unit/Value.js"() {
|
|
20071
|
+
"use strict";
|
|
20072
|
+
InvalidDecimalNumberError = class extends Error {
|
|
20073
|
+
constructor({ value }) {
|
|
20074
|
+
super(`Value \`${value}\` is not a valid decimal number.`);
|
|
20075
|
+
Object.defineProperty(this, "name", {
|
|
20076
|
+
enumerable: true,
|
|
20077
|
+
configurable: true,
|
|
20078
|
+
writable: true,
|
|
20079
|
+
value: "Value.InvalidDecimalNumberError"
|
|
20080
|
+
});
|
|
20081
|
+
}
|
|
20082
|
+
};
|
|
20083
|
+
InvalidDecimalsError = class extends Error {
|
|
20084
|
+
constructor({ decimals }) {
|
|
20085
|
+
super(`\`decimals\` must be a non-negative integer. Got \`${decimals}\`.`);
|
|
20086
|
+
Object.defineProperty(this, "name", {
|
|
20087
|
+
enumerable: true,
|
|
20088
|
+
configurable: true,
|
|
20089
|
+
writable: true,
|
|
20090
|
+
value: "Value.InvalidDecimalsError"
|
|
20091
|
+
});
|
|
20092
|
+
}
|
|
20093
|
+
};
|
|
20094
|
+
}
|
|
20095
|
+
});
|
|
20096
|
+
|
|
20097
|
+
// node_modules/viem/_esm/utils/unit/parseUnits.js
|
|
20098
|
+
function parseUnits(value, decimals) {
|
|
20099
|
+
return from6(value, decimals);
|
|
20100
|
+
}
|
|
20059
20101
|
var init_parseUnits = __esm({
|
|
20060
20102
|
"node_modules/viem/_esm/utils/unit/parseUnits.js"() {
|
|
20061
20103
|
"use strict";
|
|
20062
|
-
|
|
20104
|
+
init_Value2();
|
|
20063
20105
|
}
|
|
20064
20106
|
});
|
|
20065
20107
|
|
|
@@ -20283,13 +20325,70 @@ var init_Chains = __esm({
|
|
|
20283
20325
|
// node_modules/mppx/dist/Method.js
|
|
20284
20326
|
var Method_exports = {};
|
|
20285
20327
|
__export(Method_exports, {
|
|
20286
|
-
|
|
20328
|
+
broadcastCredential: () => broadcastCredential,
|
|
20329
|
+
from: () => from7,
|
|
20330
|
+
selectServerMethod: () => selectServerMethod,
|
|
20287
20331
|
toClient: () => toClient,
|
|
20288
|
-
toServer: () => toServer
|
|
20332
|
+
toServer: () => toServer,
|
|
20333
|
+
validateCredential: () => validateCredential
|
|
20289
20334
|
});
|
|
20290
|
-
function
|
|
20335
|
+
function from7(method) {
|
|
20291
20336
|
return method;
|
|
20292
20337
|
}
|
|
20338
|
+
async function validateCredential(methods, input) {
|
|
20339
|
+
const prepared = prepareCredential(methods, input);
|
|
20340
|
+
if (!prepared.method.validate)
|
|
20341
|
+
throw new VerificationFailedError({
|
|
20342
|
+
details: { intent: prepared.method.intent, method: prepared.method.name },
|
|
20343
|
+
reason: `${prepared.method.name}/${prepared.method.intent} does not support non-mutating credential validation`
|
|
20344
|
+
});
|
|
20345
|
+
return prepared.method.validate({
|
|
20346
|
+
credential: prepared.credential,
|
|
20347
|
+
request: prepared.request
|
|
20348
|
+
});
|
|
20349
|
+
}
|
|
20350
|
+
async function broadcastCredential(methods, input) {
|
|
20351
|
+
const prepared = prepareCredential(methods, input);
|
|
20352
|
+
const { method } = prepared;
|
|
20353
|
+
if (method.broadcast && method.validate)
|
|
20354
|
+
await method.validate({ credential: prepared.credential, request: prepared.request });
|
|
20355
|
+
const broadcast = method.broadcast ?? method.verify;
|
|
20356
|
+
return broadcast({ credential: prepared.credential, request: prepared.request });
|
|
20357
|
+
}
|
|
20358
|
+
function prepareCredential(methods, input) {
|
|
20359
|
+
const credential = typeof input === "string" ? deserialize3(input) : input;
|
|
20360
|
+
const candidates = methods.filter((method2) => method2.name === credential.challenge.method && method2.intent === credential.challenge.intent);
|
|
20361
|
+
const method = selectServerMethod(candidates, credential.challenge);
|
|
20362
|
+
if (!method)
|
|
20363
|
+
throw new InvalidChallengeError({
|
|
20364
|
+
id: credential.challenge.id,
|
|
20365
|
+
reason: `no registered method for ${credential.challenge.method}/${credential.challenge.intent}`
|
|
20366
|
+
});
|
|
20367
|
+
assert5(credential.challenge.expires, credential.challenge.id);
|
|
20368
|
+
let payload;
|
|
20369
|
+
try {
|
|
20370
|
+
payload = method.schema.credential.payload.parse(credential.payload);
|
|
20371
|
+
} catch (error51) {
|
|
20372
|
+
throw new InvalidPayloadError(error51 instanceof Error ? { reason: error51.message } : {});
|
|
20373
|
+
}
|
|
20374
|
+
return {
|
|
20375
|
+
credential: { ...credential, payload },
|
|
20376
|
+
method,
|
|
20377
|
+
request: credential.challenge.request
|
|
20378
|
+
};
|
|
20379
|
+
}
|
|
20380
|
+
function selectServerMethod(methods, challenge) {
|
|
20381
|
+
if (methods.length <= 1)
|
|
20382
|
+
return methods[0];
|
|
20383
|
+
if (challenge.method !== Methods.tempo || challenge.intent !== Intents.session)
|
|
20384
|
+
return methods[0];
|
|
20385
|
+
const sessionProtocol = getMethodDetail(challenge.request.methodDetails, MethodDetailKeys.sessionProtocol);
|
|
20386
|
+
if (sessionProtocol === void 0 || sessionProtocol === SessionProtocols.v1)
|
|
20387
|
+
return methods.find((method) => method.alias === "sessionLegacy") ?? methods[0];
|
|
20388
|
+
if (sessionProtocol === SessionProtocols.v2)
|
|
20389
|
+
return methods.find((method) => method.alias === void 0) ?? methods[0];
|
|
20390
|
+
return void 0;
|
|
20391
|
+
}
|
|
20293
20392
|
function toClient(method, options) {
|
|
20294
20393
|
const { canHandleChallenge, context, createCredential } = options;
|
|
20295
20394
|
return {
|
|
@@ -20300,7 +20399,16 @@ function toClient(method, options) {
|
|
|
20300
20399
|
};
|
|
20301
20400
|
}
|
|
20302
20401
|
function toServer(method, options) {
|
|
20303
|
-
const { alias, authorize, defaults, extensions, html, preflight, request, respond, stableBinding, transport, verify: verify3 } = options;
|
|
20402
|
+
const { alias, authorize, defaults, extensions, html, preflight, request, respond, broadcast, stableBinding, transport, validate: validate4, verify: verify3 } = options;
|
|
20403
|
+
const effectiveVerify = verify3 ?? (async (parameters) => {
|
|
20404
|
+
if (validate4)
|
|
20405
|
+
await validate4(parameters);
|
|
20406
|
+
if (!broadcast)
|
|
20407
|
+
throw new VerificationFailedError({
|
|
20408
|
+
reason: `${method.name}/${method.intent} does not support credential broadcast`
|
|
20409
|
+
});
|
|
20410
|
+
return broadcast(parameters);
|
|
20411
|
+
});
|
|
20304
20412
|
return {
|
|
20305
20413
|
...method,
|
|
20306
20414
|
alias,
|
|
@@ -20311,14 +20419,20 @@ function toServer(method, options) {
|
|
|
20311
20419
|
preflight,
|
|
20312
20420
|
request,
|
|
20313
20421
|
respond,
|
|
20422
|
+
broadcast,
|
|
20314
20423
|
stableBinding,
|
|
20315
20424
|
transport,
|
|
20316
|
-
|
|
20425
|
+
validate: validate4,
|
|
20426
|
+
verify: effectiveVerify
|
|
20317
20427
|
};
|
|
20318
20428
|
}
|
|
20319
20429
|
var init_Method = __esm({
|
|
20320
20430
|
"node_modules/mppx/dist/Method.js"() {
|
|
20321
20431
|
"use strict";
|
|
20432
|
+
init_Constants();
|
|
20433
|
+
init_Credential();
|
|
20434
|
+
init_Errors2();
|
|
20435
|
+
init_Expires();
|
|
20322
20436
|
}
|
|
20323
20437
|
});
|
|
20324
20438
|
|
|
@@ -20447,7 +20561,7 @@ var init_Methods = __esm({
|
|
|
20447
20561
|
init_Method();
|
|
20448
20562
|
init_zod();
|
|
20449
20563
|
init_Types();
|
|
20450
|
-
charge =
|
|
20564
|
+
charge = from7({
|
|
20451
20565
|
name: paymentMethod,
|
|
20452
20566
|
intent: chargeIntent,
|
|
20453
20567
|
schema: {
|
|
@@ -20539,15 +20653,15 @@ var Receipt_exports = {};
|
|
|
20539
20653
|
__export(Receipt_exports, {
|
|
20540
20654
|
Schema: () => Schema2,
|
|
20541
20655
|
deserialize: () => deserialize4,
|
|
20542
|
-
from: () =>
|
|
20656
|
+
from: () => from8,
|
|
20543
20657
|
fromResponse: () => fromResponse2,
|
|
20544
20658
|
serialize: () => serialize4
|
|
20545
20659
|
});
|
|
20546
20660
|
function deserialize4(encoded) {
|
|
20547
20661
|
const json2 = Base64_exports.toString(encoded);
|
|
20548
|
-
return
|
|
20662
|
+
return from8(JSON.parse(json2));
|
|
20549
20663
|
}
|
|
20550
|
-
function
|
|
20664
|
+
function from8(parameters) {
|
|
20551
20665
|
return Schema2.parse(parameters);
|
|
20552
20666
|
}
|
|
20553
20667
|
function serialize4(receipt) {
|
|
@@ -20590,12 +20704,12 @@ var init_Receipt = __esm({
|
|
|
20590
20704
|
var Store_exports = {};
|
|
20591
20705
|
__export(Store_exports, {
|
|
20592
20706
|
cloudflare: () => cloudflare,
|
|
20593
|
-
from: () =>
|
|
20707
|
+
from: () => from9,
|
|
20594
20708
|
memory: () => memory,
|
|
20595
20709
|
redis: () => redis,
|
|
20596
20710
|
upstash: () => upstash
|
|
20597
20711
|
});
|
|
20598
|
-
function
|
|
20712
|
+
function from9(store, options) {
|
|
20599
20713
|
return withKeyPrefix(store, options?.keyPrefix);
|
|
20600
20714
|
}
|
|
20601
20715
|
function withKeyPrefix(store, keyPrefix = "") {
|
|
@@ -20606,7 +20720,7 @@ function withKeyPrefix(store, keyPrefix = "") {
|
|
|
20606
20720
|
return cached2;
|
|
20607
20721
|
const backing = store;
|
|
20608
20722
|
const prefixedKey = (key) => `${keyPrefix}${key}`;
|
|
20609
|
-
const prefixed =
|
|
20723
|
+
const prefixed = from9({
|
|
20610
20724
|
async get(key) {
|
|
20611
20725
|
return backing.get(prefixedKey(key));
|
|
20612
20726
|
},
|
|
@@ -20643,7 +20757,7 @@ function wrapJsonUpdate(update) {
|
|
|
20643
20757
|
};
|
|
20644
20758
|
}
|
|
20645
20759
|
function cloudflare(kv, options) {
|
|
20646
|
-
return
|
|
20760
|
+
return from9({
|
|
20647
20761
|
async get(key) {
|
|
20648
20762
|
const raw = await kv.get(key);
|
|
20649
20763
|
if (raw == null)
|
|
@@ -20661,7 +20775,7 @@ function cloudflare(kv, options) {
|
|
|
20661
20775
|
}
|
|
20662
20776
|
function memory(options) {
|
|
20663
20777
|
const store = /* @__PURE__ */ new Map();
|
|
20664
|
-
return
|
|
20778
|
+
return from9({
|
|
20665
20779
|
async get(key) {
|
|
20666
20780
|
const raw = store.get(key);
|
|
20667
20781
|
if (raw === void 0)
|
|
@@ -20686,7 +20800,7 @@ function memory(options) {
|
|
|
20686
20800
|
}, options);
|
|
20687
20801
|
}
|
|
20688
20802
|
function redis(client, options) {
|
|
20689
|
-
return
|
|
20803
|
+
return from9({
|
|
20690
20804
|
async get(key) {
|
|
20691
20805
|
const raw = await client.get(key);
|
|
20692
20806
|
if (raw == null)
|
|
@@ -20703,7 +20817,7 @@ function redis(client, options) {
|
|
|
20703
20817
|
}, options);
|
|
20704
20818
|
}
|
|
20705
20819
|
function upstash(redis2, options) {
|
|
20706
|
-
return
|
|
20820
|
+
return from9({
|
|
20707
20821
|
async get(key) {
|
|
20708
20822
|
return await redis2.get(key);
|
|
20709
20823
|
},
|