@tempoxyz/patron 0.0.33 → 0.0.35
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/bin.js +3 -3
- package/dist/chunks/{-IY3OYWAY.js → -PPYINGG5.js} +1 -1
- package/dist/chunks/{chunk-U536WCJ4.js → chunk-VIXY6Z5V.js} +5 -16
- package/dist/chunks/{hook-XH5QRR5O.js → hook-Q33Q4ZRA.js} +1 -1
- package/dist/chunks/{hook-process-QKKTEUP6.js → hook-process-EH7UVTUM.js} +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -12,14 +12,14 @@ if (!process.env.PATRON_HOME) {
|
|
|
12
12
|
if (home) process.env.PATRON_HOME = home;
|
|
13
13
|
}
|
|
14
14
|
if (process.argv[2] === "hook") {
|
|
15
|
-
const { runHookProcess } = await import("./chunks/hook-process-
|
|
15
|
+
const { runHookProcess } = await import("./chunks/hook-process-EH7UVTUM.js");
|
|
16
16
|
await runHookProcess().catch(() => void 0);
|
|
17
17
|
process.exit(0);
|
|
18
18
|
} else if (process.argv[2] === "pay") {
|
|
19
|
-
const { runPayProcess } = await import("./chunks/hook-process-
|
|
19
|
+
const { runPayProcess } = await import("./chunks/hook-process-EH7UVTUM.js");
|
|
20
20
|
await runPayProcess().catch(() => void 0);
|
|
21
21
|
process.exit(0);
|
|
22
22
|
} else {
|
|
23
|
-
const { run } = await import("./chunks/-
|
|
23
|
+
const { run } = await import("./chunks/-PPYINGG5.js");
|
|
24
24
|
process.exitCode = await run(process.argv.slice(2));
|
|
25
25
|
}
|
|
@@ -14942,17 +14942,6 @@ async function sha256(data) {
|
|
|
14942
14942
|
return new Uint8Array(await crypto.subtle.digest("SHA-256", data.slice()));
|
|
14943
14943
|
}
|
|
14944
14944
|
|
|
14945
|
-
// ../client/src/issuer.ts
|
|
14946
|
-
var ISSUER_TTL_MS = 60 * 60 * 1e3;
|
|
14947
|
-
|
|
14948
|
-
// ../client/src/spacing.ts
|
|
14949
|
-
var REDEEM_HOLD_MIN_MS = 2 * 6e4;
|
|
14950
|
-
var REDEEM_HOLD_SPREAD_MS = 8 * 6e4;
|
|
14951
|
-
var GATEWAY_QUIET_MS = 2 * 6e4;
|
|
14952
|
-
var GATEWAY_WANT_MS = 15 * 6e4;
|
|
14953
|
-
var GATEWAY_LEASE_MS = 15 * 6e4;
|
|
14954
|
-
var REDEEM_LEASE_MS = 2 * 6e4;
|
|
14955
|
-
|
|
14956
14945
|
// ../client/src/index.ts
|
|
14957
14946
|
var RelayError = class extends Error {
|
|
14958
14947
|
status;
|
|
@@ -15020,7 +15009,7 @@ async function refusalCode(response) {
|
|
|
15020
15009
|
}
|
|
15021
15010
|
|
|
15022
15011
|
// src/budget.ts
|
|
15023
|
-
var
|
|
15012
|
+
var LINK_TOKEN_STEP = 10;
|
|
15024
15013
|
var REFILL_THRESHOLD = 400;
|
|
15025
15014
|
var STARTER_TOKENS = 100;
|
|
15026
15015
|
function budgetTokens(monthlyBudgetUsd) {
|
|
@@ -15030,7 +15019,7 @@ function budgetTokens(monthlyBudgetUsd) {
|
|
|
15030
15019
|
}
|
|
15031
15020
|
function purchasableTokens(config, usage, wanted) {
|
|
15032
15021
|
const left = budgetTokens(config.monthlyBudgetUsd) - usage.boughtTokens;
|
|
15033
|
-
const step = config.wallet === "link" ?
|
|
15022
|
+
const step = config.wallet === "link" ? LINK_TOKEN_STEP : 1;
|
|
15034
15023
|
const asked = Math.ceil(Math.floor(wanted) / step) * step;
|
|
15035
15024
|
const count = Math.max(0, Math.min(asked, left, MAX_TOKENS_PER_PURCHASE));
|
|
15036
15025
|
return count - count % step;
|
|
@@ -15300,13 +15289,13 @@ async function writeText(path, text) {
|
|
|
15300
15289
|
}
|
|
15301
15290
|
|
|
15302
15291
|
// src/issuer.ts
|
|
15303
|
-
var
|
|
15292
|
+
var ISSUER_TTL_MS = 60 * 60 * 1e3;
|
|
15304
15293
|
async function storedIssuer(home, gatewayUrl, now = Date.now()) {
|
|
15305
15294
|
const cached = await readJson(statePaths(home).issuer).catch(() => void 0);
|
|
15306
15295
|
const parsed = IssuerInfo.safeParse(cached?.issuer);
|
|
15307
15296
|
if (!parsed.success || cached?.gatewayUrl !== gatewayUrl) return void 0;
|
|
15308
15297
|
const at = typeof cached.at === "number" ? cached.at : Number.NEGATIVE_INFINITY;
|
|
15309
|
-
return { issuer: parsed.data, stale: !(now - at <
|
|
15298
|
+
return { issuer: parsed.data, stale: !(now - at < ISSUER_TTL_MS) };
|
|
15310
15299
|
}
|
|
15311
15300
|
async function loadIssuer(home, gatewayUrl, options = {}) {
|
|
15312
15301
|
const now = options.now ?? Date.now();
|
|
@@ -15428,7 +15417,7 @@ var FileTokenStore = class {
|
|
|
15428
15417
|
export {
|
|
15429
15418
|
buyTokens,
|
|
15430
15419
|
redeem,
|
|
15431
|
-
|
|
15420
|
+
LINK_TOKEN_STEP,
|
|
15432
15421
|
STARTER_TOKENS,
|
|
15433
15422
|
budgetTokens,
|
|
15434
15423
|
purchasableTokens,
|
|
@@ -248,7 +248,7 @@ async function waitForHold(home) {
|
|
|
248
248
|
}
|
|
249
249
|
async function payEvent(event, settings, refill, timeoutMs) {
|
|
250
250
|
if (timeoutMs <= 0) return;
|
|
251
|
-
const { runHook } = await import("./hook-
|
|
251
|
+
const { runHook } = await import("./hook-Q33Q4ZRA.js");
|
|
252
252
|
await runHook(
|
|
253
253
|
{
|
|
254
254
|
readInput: async () => event.raw,
|