@veridex/sdk 1.1.1 → 1.1.2

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.mjs CHANGED
@@ -61,10 +61,10 @@ import {
61
61
  } from "./chunk-CSU4IV2F.mjs";
62
62
  import {
63
63
  AvalancheClient
64
- } from "./chunk-PEGOXMBU.mjs";
64
+ } from "./chunk-AFHWA4CZ.mjs";
65
65
  import {
66
66
  EVMClient
67
- } from "./chunk-YBN2VC6E.mjs";
67
+ } from "./chunk-DZUNCSI5.mjs";
68
68
  import {
69
69
  CONSISTENCY_LEVELS,
70
70
  GUARDIAN_CONFIG,
@@ -7730,6 +7730,12 @@ function validateSessionConfig(config) {
7730
7730
  "INVALID_CONFIG" /* INVALID_CONFIG */
7731
7731
  );
7732
7732
  }
7733
+ if (config.maxValue === 0n && config.allowUnboundedMaxValue !== true) {
7734
+ throw new SessionError(
7735
+ 'Session maxValue=0 means "no per-tx limit" \u2014 the vault daily cap is then the only bound. This is a foot-gun: a compromised session key can drain the vault up to that cap. Pass a non-zero maxValue, or set allowUnboundedMaxValue:true if you have verified the vault daily cap and accept the residual risk.',
7736
+ "INVALID_CONFIG" /* INVALID_CONFIG */
7737
+ );
7738
+ }
7733
7739
  }
7734
7740
 
7735
7741
  // src/sessions/storage.ts
@@ -8275,7 +8281,8 @@ var SessionManager = class {
8275
8281
  maxValue: config.maxValue ?? 0n,
8276
8282
  autoRefresh: config.autoRefresh ?? true,
8277
8283
  refreshBuffer: config.refreshBuffer ?? DEFAULT_REFRESH_BUFFER,
8278
- chainScopes: config.chainScopes ?? []
8284
+ chainScopes: config.chainScopes ?? [],
8285
+ allowUnboundedMaxValue: config.allowUnboundedMaxValue ?? false
8279
8286
  };
8280
8287
  validateSessionConfig(this.config);
8281
8288
  this.debug = managerConfig?.debug ?? false;