@xyo-network/xl1-protocol 1.13.4 → 1.13.6

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.
@@ -3,15 +3,16 @@ import { assertError } from '@xylabs/hex'
3
3
  import { type Brand, isDefined } from '@xylabs/typeof'
4
4
  import z from 'zod'
5
5
 
6
+ import type { EthBlockNumber } from '../BlockNumber/index.ts'
6
7
  import {
7
8
  asEthBlockNumber,
8
- type BlockNumber, EthBlockNumberZod,
9
+ EthBlockNumberZod,
9
10
  NumberishEthBlockNumberZod,
10
11
  } from '../BlockNumber/index.ts'
11
12
  import { zodAsFactory, zodToFactory } from '../zod/index.ts'
12
13
 
13
- export type EthBlockRange = [BlockNumber, BlockNumber]
14
- export type NumberishEthBlockRange = [BlockNumber, BlockNumber]
14
+ export type EthBlockRange = [EthBlockNumber, EthBlockNumber]
15
+ export type NumberishEthBlockRange = [EthBlockNumber, EthBlockNumber]
15
16
 
16
17
  export const EthBlockRangeZod = z.tuple([EthBlockNumberZod, EthBlockNumberZod])
17
18
  export const NumberishEthBlockRangeZod = z.tuple([NumberishEthBlockNumberZod, NumberishEthBlockNumberZod])
@@ -3,16 +3,16 @@ import { assertError } from '@xylabs/hex'
3
3
  import { type Brand, isDefined } from '@xylabs/typeof'
4
4
  import z from 'zod'
5
5
 
6
+ import type { XL1BlockNumber } from '../BlockNumber/index.ts'
6
7
  import {
7
8
  asXL1BlockNumber,
8
- type BlockNumber,
9
9
  NumberishXL1BlockNumberZod,
10
10
  XL1BlockNumberZod,
11
11
  } from '../BlockNumber/index.ts'
12
12
  import { zodAsFactory, zodToFactory } from '../zod/index.ts'
13
13
 
14
- export type XL1BlockRange = [BlockNumber, BlockNumber]
15
- export type NumberishXL1BlockRange = [BlockNumber, BlockNumber]
14
+ export type XL1BlockRange = [XL1BlockNumber, XL1BlockNumber]
15
+ export type NumberishXL1BlockRange = [XL1BlockNumber, XL1BlockNumber]
16
16
 
17
17
  export const XL1BlockRangeZod = z.tuple([XL1BlockNumberZod, XL1BlockNumberZod])
18
18
  export const NumberishXL1BlockRangeZod = z.tuple([NumberishXL1BlockNumberZod, NumberishXL1BlockNumberZod])
@@ -1,7 +1,13 @@
1
1
  import { type Brand, isUndefined } from '@xylabs/typeof'
2
+ import * as z from 'zod'
2
3
 
3
4
  import { toXL1BlockNumber, type XL1BlockNumber } from './BlockNumber/index.ts'
4
5
 
6
+ export const StepIdentityZod = z.object({
7
+ block: z.number().int().nonnegative(),
8
+ step: z.number().int().nonnegative(),
9
+ })
10
+
5
11
  export interface StepIdentity {
6
12
  block: XL1BlockNumber
7
13
  // the index of the step into the StepSize array
@@ -0,0 +1,20 @@
1
+ import { AsObjectFactory } from '@xylabs/object'
2
+ import type { Payload } from '@xyo-network/payload-model'
3
+ import { isPayloadOfZodType } from '@xyo-network/payload-model'
4
+ import type { z } from 'zod'
5
+
6
+ import { StepIdentityZod } from '../model/index.ts'
7
+
8
+ export const StepIdentitySchema = 'network.xyo.chain.step.identity' as const
9
+ export type StepIdentitySchema = typeof StepIdentitySchema
10
+
11
+ export type StepIdentityFields = z.infer<typeof StepIdentityZod>
12
+
13
+ /**
14
+ * A Step Identity Payload
15
+ */
16
+ export type StepIdentityPayload = Payload<StepIdentityFields, StepIdentitySchema>
17
+
18
+ export const isStepIdentityPayload = isPayloadOfZodType<StepIdentityPayload>(StepIdentityZod, StepIdentitySchema)
19
+
20
+ export const asStepIdentityPayload = AsObjectFactory.create(isStepIdentityPayload)
@@ -1 +1,2 @@
1
1
  export * from './elevatable/index.ts'
2
+ export * from './StepIdentityPayload.ts'