ox 0.14.11 → 0.14.13

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/_cjs/erc8021/Attribution.js +7 -1
  3. package/_cjs/erc8021/Attribution.js.map +1 -1
  4. package/_cjs/tempo/KeyAuthorization.js +150 -21
  5. package/_cjs/tempo/KeyAuthorization.js.map +1 -1
  6. package/_cjs/tempo/Period.js +31 -0
  7. package/_cjs/tempo/Period.js.map +1 -0
  8. package/_cjs/tempo/index.js +2 -1
  9. package/_cjs/tempo/index.js.map +1 -1
  10. package/_cjs/version.js +1 -1
  11. package/_esm/erc8021/Attribution.js +7 -1
  12. package/_esm/erc8021/Attribution.js.map +1 -1
  13. package/_esm/tempo/KeyAuthorization.js +159 -22
  14. package/_esm/tempo/KeyAuthorization.js.map +1 -1
  15. package/_esm/tempo/Period.js +92 -0
  16. package/_esm/tempo/Period.js.map +1 -0
  17. package/_esm/tempo/index.js +29 -0
  18. package/_esm/tempo/index.js.map +1 -1
  19. package/_esm/version.js +1 -1
  20. package/_types/erc8021/Attribution.d.ts +2 -0
  21. package/_types/erc8021/Attribution.d.ts.map +1 -1
  22. package/_types/tempo/KeyAuthorization.d.ts +95 -19
  23. package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
  24. package/_types/tempo/Period.d.ts +78 -0
  25. package/_types/tempo/Period.d.ts.map +1 -0
  26. package/_types/tempo/index.d.ts +29 -0
  27. package/_types/tempo/index.d.ts.map +1 -1
  28. package/_types/version.d.ts +1 -1
  29. package/erc8021/Attribution.ts +12 -1
  30. package/package.json +6 -1
  31. package/tempo/KeyAuthorization.test.ts +407 -3
  32. package/tempo/KeyAuthorization.ts +291 -51
  33. package/tempo/Period/package.json +6 -0
  34. package/tempo/Period.test.ts +44 -0
  35. package/tempo/Period.ts +97 -0
  36. package/tempo/e2e.test.ts +969 -1
  37. package/tempo/index.ts +30 -0
  38. package/version.ts +1 -1
package/tempo/index.ts CHANGED
@@ -77,6 +77,36 @@ export * as AuthorizationTempo from './AuthorizationTempo.js'
77
77
  */
78
78
  export * as KeyAuthorization from './KeyAuthorization.js'
79
79
 
80
+ /**
81
+ * Utilities for constructing period durations (in seconds) for recurring spending limits.
82
+ *
83
+ * Periods define the reset interval for access key spending limits. A spending limit with a
84
+ * period will reset every `period` seconds. For example, a daily spending limit uses
85
+ * `Period.days(1)` (86400 seconds).
86
+ *
87
+ * @example
88
+ * ```ts twoslash
89
+ * import { Value } from 'ox'
90
+ * import { KeyAuthorization, Period } from 'ox/tempo'
91
+ *
92
+ * const authorization = KeyAuthorization.from({
93
+ * address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
94
+ * chainId: 4217n,
95
+ * type: 'secp256k1',
96
+ * limits: [{
97
+ * token: '0x20c0000000000000000000000000000000000001',
98
+ * limit: Value.from('100', 6),
99
+ * period: Period.days(1), // resets daily
100
+ * }],
101
+ * })
102
+ * ```
103
+ *
104
+ * [Access Keys Specification](https://docs.tempo.xyz/protocol/transactions/spec-tempo-transaction#access-keys)
105
+ *
106
+ * @category Reference
107
+ */
108
+ export * as Period from './Period.js'
109
+
80
110
  /**
81
111
  * Pool ID utilities for computing pool identifiers from token pairs.
82
112
  *
package/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** @internal */
2
- export const version = '0.14.11'
2
+ export const version = '0.14.13'