ox 1.0.3 → 1.0.5

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.
@@ -68,6 +68,28 @@ export * as AuthorizationTempo from './AuthorizationTempo.js'
68
68
  * @category Reference
69
69
  */
70
70
  export * as Channel from './Channel.js'
71
+ /**
72
+ * Tempo Earn `VaultAdapter` share math: raw vault-share and venue-share conversions
73
+ * at the anchor rate, the dilution-correct fee-share formula, and the
74
+ * `minimumOutput` slippage floor.
75
+ *
76
+ * Conversions are fee-blind mirrors of the adapter's anchor arithmetic; use the
77
+ * adapter's `previewRedeem` for user-facing value.
78
+ *
79
+ * @example
80
+ * ```ts twoslash
81
+ * import { EarnShares } from 'ox/tempo'
82
+ *
83
+ * const shareAmount = EarnShares.toAmount(
84
+ * { engineShares: 3n, shareSupply: 2n },
85
+ * 7n
86
+ * )
87
+ * // @log: 4n
88
+ * ```
89
+ *
90
+ * @category Reference
91
+ */
92
+ export * as EarnShares from './EarnShares.js'
71
93
  /**
72
94
  * Tempo key authorization utilities for provisioning and signing access keys.
73
95
  *
@@ -510,18 +532,17 @@ export * as VirtualMaster from './VirtualMaster.js'
510
532
  /**
511
533
  * Zone ID utilities for converting between zone IDs and zone chain IDs.
512
534
  *
513
- * Zone chain IDs are deterministically derived from zone IDs using the formula
514
- * `421_700_000 + zoneId`. This module provides helpers to convert between them.
535
+ * Zone chain IDs use the base and range assigned to their Tempo source chain.
515
536
  *
516
537
  * @example
517
538
  * ```ts twoslash
518
539
  * import { ZoneId } from 'ox/tempo'
519
540
  *
520
- * const zoneId = ZoneId.fromChainId(421_700_026)
521
- * // @log: 26
541
+ * const zoneId = ZoneId.fromChainId(421_700_001)
542
+ * // @log: 1
522
543
  *
523
- * const chainId = ZoneId.toChainId(26)
524
- * // @log: 421700026
544
+ * const chainId = ZoneId.toChainId(1)
545
+ * // @log: 421700001
525
546
  * ```
526
547
  *
527
548
  * @category Reference
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** @internal */
2
- export const version = '1.0.3'
2
+ export const version = '1.0.5'
@@ -11,7 +11,7 @@ describe('ZoneId', () => {
11
11
  })
12
12
 
13
13
  test('decodes and encodes chain ids', () => {
14
- expect(z.decode(z_ZoneId.chainId, 4_217_000_006)).toMatchInlineSnapshot(`6`)
15
- expect(z.encode(z_ZoneId.chainId, 6)).toMatchInlineSnapshot(`4217000006`)
14
+ expect(z.decode(z_ZoneId.chainId, 421_700_001)).toMatchInlineSnapshot(`1`)
15
+ expect(z.encode(z_ZoneId.chainId, 1)).toMatchInlineSnapshot(`421700001`)
16
16
  })
17
17
  })