@zeroxyz/cli 1.26.0 → 1.26.1
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 +42 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -78668,7 +78668,7 @@ init_esm_shims();
|
|
|
78668
78668
|
// ../sdk/dist/index.js
|
|
78669
78669
|
init_esm_shims();
|
|
78670
78670
|
|
|
78671
|
-
// ../sdk/dist/chunk-
|
|
78671
|
+
// ../sdk/dist/chunk-YB3TVCUC.js
|
|
78672
78672
|
init_esm_shims();
|
|
78673
78673
|
|
|
78674
78674
|
// ../../node_modules/.pnpm/viem@2.52.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@6.0.6_zod@4.3.6/node_modules/viem/_esm/index.js
|
|
@@ -164385,7 +164385,7 @@ var normalizeTransportEnvelopeRequest = (url4, opts) => {
|
|
|
164385
164385
|
};
|
|
164386
164386
|
};
|
|
164387
164387
|
var package_default = {
|
|
164388
|
-
version: "0.19.
|
|
164388
|
+
version: "0.19.1"
|
|
164389
164389
|
};
|
|
164390
164390
|
var SDK_VERSION2 = package_default.version;
|
|
164391
164391
|
var refreshResponseSchema = external_exports3.object({
|
|
@@ -165044,6 +165044,10 @@ var resolveDefaultPrefund = (displayCostAmount) => {
|
|
|
165044
165044
|
return bounded.toFixed(6).replace(/\.?0+$/, "");
|
|
165045
165045
|
};
|
|
165046
165046
|
var isUintString = (v) => typeof v === "string" && v.length > 0 && v.length <= MAX_AMOUNT_DIGITS && UINT_RE.test(v);
|
|
165047
|
+
var buildTempoPaymentMethods = (parameters) => [
|
|
165048
|
+
tempo2(parameters),
|
|
165049
|
+
tempo2.sessionLegacy.method(parameters)
|
|
165050
|
+
];
|
|
165047
165051
|
var coerceTempoChainId = (raw) => {
|
|
165048
165052
|
const id = typeof raw === "number" && Number.isFinite(raw) ? raw : typeof raw === "string" && /^-?[0-9]+$/.test(raw) ? Number(raw) : null;
|
|
165049
165053
|
if (id === TEMPO_CHAIN_ID2) return { id, chain: "tempo" };
|
|
@@ -165433,43 +165437,44 @@ var Payments = class {
|
|
|
165433
165437
|
let capturedChallenge;
|
|
165434
165438
|
let channelEntry;
|
|
165435
165439
|
let openTimeCumulative;
|
|
165440
|
+
const handleChannelUpdate = (entry) => {
|
|
165441
|
+
let cumulative;
|
|
165442
|
+
if (typeof entry.cumulativeAmount === "bigint") {
|
|
165443
|
+
cumulative = entry.cumulativeAmount;
|
|
165444
|
+
} else {
|
|
165445
|
+
cumulative = 0n;
|
|
165446
|
+
this.client.logger?.({
|
|
165447
|
+
level: "warn",
|
|
165448
|
+
message: "mppx emitted non-bigint cumulativeAmount; coerced to 0n",
|
|
165449
|
+
meta: { actualType: typeof entry.cumulativeAmount }
|
|
165450
|
+
});
|
|
165451
|
+
}
|
|
165452
|
+
if (openTimeCumulative === void 0 && entry.opened) {
|
|
165453
|
+
openTimeCumulative = cumulative;
|
|
165454
|
+
}
|
|
165455
|
+
const wasOpened = channelEntry?.opened ?? false;
|
|
165456
|
+
channelEntry = {
|
|
165457
|
+
channelId: entry.channelId,
|
|
165458
|
+
// mppx >=0.8 renamed the channel-entry escrow field from
|
|
165459
|
+
// `escrowContract` to `escrow` (see SessionManager
|
|
165460
|
+
// entryFromSnapshot); the legacy client still emits
|
|
165461
|
+
// `escrowContract`. Read `escrow` first, fall back to the old
|
|
165462
|
+
// name, then to any value we already latched so a later
|
|
165463
|
+
// escrow-less emit can't blank an open channel's escrow.
|
|
165464
|
+
escrowContract: entry.escrow ?? entry.escrowContract ?? channelEntry?.escrowContract ?? "0x0000000000000000000000000000000000000000",
|
|
165465
|
+
cumulativeAmount: cumulative,
|
|
165466
|
+
opened: wasOpened || entry.opened
|
|
165467
|
+
};
|
|
165468
|
+
};
|
|
165469
|
+
const tempoMethodParams = {
|
|
165470
|
+
account,
|
|
165471
|
+
maxDeposit: input.maxPay ?? resolveDefaultPrefund(input.displayCostAmount),
|
|
165472
|
+
onChannelUpdate: handleChannelUpdate
|
|
165473
|
+
};
|
|
165436
165474
|
const mppx = Mppx_exports.create({
|
|
165437
165475
|
polyfill: false,
|
|
165438
165476
|
fetch: configuredFetch,
|
|
165439
|
-
methods:
|
|
165440
|
-
tempo2({
|
|
165441
|
-
account,
|
|
165442
|
-
maxDeposit: input.maxPay ?? resolveDefaultPrefund(input.displayCostAmount),
|
|
165443
|
-
onChannelUpdate: (entry) => {
|
|
165444
|
-
let cumulative;
|
|
165445
|
-
if (typeof entry.cumulativeAmount === "bigint") {
|
|
165446
|
-
cumulative = entry.cumulativeAmount;
|
|
165447
|
-
} else {
|
|
165448
|
-
cumulative = 0n;
|
|
165449
|
-
this.client.logger?.({
|
|
165450
|
-
level: "warn",
|
|
165451
|
-
message: "mppx emitted non-bigint cumulativeAmount; coerced to 0n",
|
|
165452
|
-
meta: { actualType: typeof entry.cumulativeAmount }
|
|
165453
|
-
});
|
|
165454
|
-
}
|
|
165455
|
-
if (openTimeCumulative === void 0 && entry.opened) {
|
|
165456
|
-
openTimeCumulative = cumulative;
|
|
165457
|
-
}
|
|
165458
|
-
const wasOpened = channelEntry?.opened ?? false;
|
|
165459
|
-
channelEntry = {
|
|
165460
|
-
channelId: entry.channelId,
|
|
165461
|
-
// mppx >=0.8 renamed the channel-entry escrow field from
|
|
165462
|
-
// `escrowContract` to `escrow` (see SessionManager
|
|
165463
|
-
// entryFromSnapshot). Read `escrow` first, fall back to the
|
|
165464
|
-
// old name, then to any value we already latched so a later
|
|
165465
|
-
// escrow-less emit can't blank an open channel's escrow.
|
|
165466
|
-
escrowContract: entry.escrow ?? entry.escrowContract ?? channelEntry?.escrowContract ?? "0x0000000000000000000000000000000000000000",
|
|
165467
|
-
cumulativeAmount: cumulative,
|
|
165468
|
-
opened: wasOpened || entry.opened
|
|
165469
|
-
};
|
|
165470
|
-
}
|
|
165471
|
-
})
|
|
165472
|
-
],
|
|
165477
|
+
methods: buildTempoPaymentMethods(tempoMethodParams),
|
|
165473
165478
|
onChallenge: async (challenge2) => {
|
|
165474
165479
|
capturedChallenge = challenge2;
|
|
165475
165480
|
capturedAmount = await this.prepareTempoFunds(
|
|
@@ -168777,7 +168782,7 @@ var placeholderFor = (fieldName, propSchema) => String(sampleValueFor(fieldName,
|
|
|
168777
168782
|
|
|
168778
168783
|
// package.json
|
|
168779
168784
|
var package_default2 = {
|
|
168780
|
-
version: "1.26.
|
|
168785
|
+
version: "1.26.1"};
|
|
168781
168786
|
|
|
168782
168787
|
// src/app.ts
|
|
168783
168788
|
init_esm_shims();
|