@t2000/cli 10.17.4 → 10.19.0

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.
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  AggregatorClient,
12
12
  Env
13
- } from "./chunk-QSITA6GU.js";
13
+ } from "./chunk-3YV35WUN.js";
14
14
  import {
15
15
  BalanceChange,
16
16
  BaseClient,
@@ -11542,6 +11542,44 @@ var LimitEnforcer = class {
11542
11542
  return dailySpentToday(this.configDir);
11543
11543
  }
11544
11544
  };
11545
+ var MemoryLimitEnforcer = class extends LimitEnforcer {
11546
+ limitsMem;
11547
+ spend = { date: todayUtc(), usd: 0 };
11548
+ assert(input) {
11549
+ assertLimitConfig({
11550
+ limits: this.limitsMem,
11551
+ spentTodayUsd: this.dailySpentToday(),
11552
+ operation: input.operation,
11553
+ amountUsd: input.amountUsd,
11554
+ force: input.force
11555
+ });
11556
+ }
11557
+ record(amountUsd) {
11558
+ if (!Number.isFinite(amountUsd) || amountUsd <= 0) return;
11559
+ const today = todayUtc();
11560
+ const prior = this.spend.date === today ? this.spend.usd : 0;
11561
+ this.spend = { date: today, usd: prior + amountUsd };
11562
+ }
11563
+ getLimits() {
11564
+ return this.limitsMem;
11565
+ }
11566
+ hasLimits() {
11567
+ const l = this.limitsMem;
11568
+ return !!l && (l.perTxUsd !== void 0 || l.dailyUsd !== void 0);
11569
+ }
11570
+ setLimits(limits) {
11571
+ const merged = { ...this.limitsMem };
11572
+ if (limits.perTxUsd !== void 0) merged.perTxUsd = limits.perTxUsd;
11573
+ if (limits.dailyUsd !== void 0) merged.dailyUsd = limits.dailyUsd;
11574
+ this.limitsMem = merged;
11575
+ }
11576
+ clearLimits() {
11577
+ this.limitsMem = void 0;
11578
+ }
11579
+ dailySpentToday() {
11580
+ return this.spend.date === todayUtc() ? this.spend.usd : 0;
11581
+ }
11582
+ };
11545
11583
  var DEFAULT_CONFIG_DIR2 = join2(homedir(), ".t2000");
11546
11584
  var T2000 = class _T2000 extends import_index.default {
11547
11585
  _signer;
@@ -11564,7 +11602,7 @@ var T2000 = class _T2000 extends import_index.default {
11564
11602
  this._address = getAddress(kp);
11565
11603
  }
11566
11604
  this.client = client;
11567
- this.limits = new LimitEnforcer(configDir);
11605
+ this.limits = isSignerMode ? new MemoryLimitEnforcer() : new LimitEnforcer(configDir);
11568
11606
  }
11569
11607
  static async create(options = {}) {
11570
11608
  const { keyPath, rpcUrl } = options;
@@ -12562,7 +12600,7 @@ var SPONSORED_PYTH_DEPENDENT_PROVIDERS = [
12562
12600
  "HAEDALHMMV2"
12563
12601
  ];
12564
12602
  async function getSponsoredSwapProviders() {
12565
- const { getProvidersExcluding } = await import("./dist-WNY2TO7E.js");
12603
+ const { getProvidersExcluding } = await import("./dist-3WU6OGLY.js");
12566
12604
  return getProvidersExcluding([...SPONSORED_PYTH_DEPENDENT_PROVIDERS]);
12567
12605
  }
12568
12606
  var WRITE_APPENDER_REGISTRY = {
@@ -13562,4 +13600,4 @@ export {
13562
13600
  @scure/bip39/index.js:
13563
13601
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
13564
13602
  */
13565
- //# sourceMappingURL=chunk-F2KFMF7W.js.map
13603
+ //# sourceMappingURL=chunk-RHEUNSVF.js.map