@metamask/delegation-core 1.0.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.1.0]
11
+
12
+ ### Added
13
+
14
+ - `Caveat` terms decoding utils ([#191](https://github.com/metamask/smart-accounts-kit/pull/191))
15
+
10
16
  ## [1.0.0]
11
17
 
12
18
  ### Changed
@@ -84,7 +90,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
84
90
 
85
91
  - Add @metamask/delegation-core package, providing utility types, delegation hashing, and terms encoding for a limited set of caveat enforcers.
86
92
 
87
- [Unreleased]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/delegation-core@1.0.0...HEAD
93
+ [Unreleased]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/delegation-core@1.1.0...HEAD
94
+ [1.1.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/delegation-core@1.0.0...@metamask/delegation-core@1.1.0
88
95
  [1.0.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/delegation-core@0.4.0...@metamask/delegation-core@1.0.0
89
96
  [0.4.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/delegation-core@0.3.0...@metamask/delegation-core@0.4.0
90
97
  [0.3.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/delegation-core@0.2.0...@metamask/delegation-core@0.3.0
package/README.md CHANGED
@@ -67,8 +67,8 @@ Creates terms for a Timestamp caveat that enforces time-based constraints on del
67
67
  **Parameters:**
68
68
 
69
69
  - `terms: TimestampTerms`
70
- - `timestampAfterThreshold: number` - Timestamp (seconds) after which delegation can be used
71
- - `timestampBeforeThreshold: number` - Timestamp (seconds) before which delegation can be used
70
+ - `afterThreshold: number` - Timestamp (seconds) after which delegation can be used
71
+ - `beforeThreshold: number` - Timestamp (seconds) before which delegation can be used
72
72
  - `options?: EncodingOptions` - Optional encoding options
73
73
 
74
74
  **Returns:** `Hex | Uint8Array` - 32-byte encoded terms (16 bytes per timestamp)
@@ -80,14 +80,14 @@ import { createTimestampTerms } from '@metamask/delegation-core';
80
80
 
81
81
  // Valid between Jan 1, 2022 and Jan 1, 2023
82
82
  const terms = createTimestampTerms({
83
- timestampAfterThreshold: 1640995200, // 2022-01-01 00:00:00 UTC
84
- timestampBeforeThreshold: 1672531200, // 2023-01-01 00:00:00 UTC
83
+ afterThreshold: 1640995200, // 2022-01-01 00:00:00 UTC
84
+ beforeThreshold: 1672531200, // 2023-01-01 00:00:00 UTC
85
85
  });
86
86
 
87
87
  // Only valid after a certain time (no end time)
88
88
  const openEndedTerms = createTimestampTerms({
89
- timestampAfterThreshold: 1640995200,
90
- timestampBeforeThreshold: 0,
89
+ afterThreshold: 1640995200,
90
+ beforeThreshold: 0,
91
91
  });
92
92
  ```
93
93
 
@@ -354,8 +354,8 @@ export type ValueLteTerms = {
354
354
  };
355
355
 
356
356
  export type TimestampTerms = {
357
- timestampAfterThreshold: number;
358
- timestampBeforeThreshold: number;
357
+ afterThreshold: number;
358
+ beforeThreshold: number;
359
359
  };
360
360
 
361
361
  export type ExactCalldataTerms = {