@smartledger/bsv 7.4.0 → 7.5.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.
package/bsv.d.ts CHANGED
@@ -344,20 +344,33 @@ declare module '@smartledger/bsv' {
344
344
  namespace Interpreter {
345
345
  const SCRIPT_ENABLE_SIGHASH_FORKID: any;
346
346
 
347
- // Pre-Genesis consensus caps (defaults: 520 / 4 / 201).
347
+ // Pre-Genesis consensus caps (defaults: 520 / 4 / 201 / 10,000).
348
348
  // Mutable: see useGenesisLimits() for a one-call opt-in.
349
349
  let MAX_SCRIPT_ELEMENT_SIZE: number;
350
350
  let MAXIMUM_ELEMENT_SIZE: number;
351
351
  let MAX_OPS_PER_SCRIPT: number;
352
+ /** Total serialized script size. Anything larger fails SCRIPT_ERR_SCRIPT_SIZE. */
353
+ let MAX_SCRIPT_SIZE: number;
354
+
355
+ interface Limits {
356
+ maxScriptElementSize: number;
357
+ maximumElementSize: number;
358
+ maxOpsPerScript: number;
359
+ maxScriptSize: number;
360
+ }
352
361
 
353
362
  /**
354
363
  * Opt into post-Genesis BSV consensus limits (no caps on stack
355
- * element size, script-number width, or opcode count). Mutates
356
- * Interpreter-wide static state — call once at app startup.
357
- * Pass an explicit `max` (e.g. 64 KB) when verifying scripts
358
- * from untrusted sources.
364
+ * element size, script-number width, opcode count, or total script
365
+ * size). Mutates Interpreter-wide static state — call once at app
366
+ * startup. Pass an explicit `max` (e.g. 64 KB) when verifying
367
+ * scripts from untrusted sources.
359
368
  */
360
369
  function useGenesisLimits(max?: number): typeof Interpreter;
370
+ /** Capture the four caps, for restoring with setLimits(). */
371
+ function getLimits(): Limits;
372
+ /** Restore caps captured by getLimits(). */
373
+ function setLimits(limits: Partial<Limits>): typeof Interpreter;
361
374
  }
362
375
 
363
376
  function Interpreter(): {