@xyo-network/xl1-protocol 1.25.1 → 1.25.3
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/dist/neutral/block/HydratedBlock.d.ts +38 -8
- package/dist/neutral/block/HydratedBlock.d.ts.map +1 -1
- package/dist/neutral/block/signed/SignedBlockBoundWitnessWithHashMeta.d.ts.map +1 -1
- package/dist/neutral/block/signed/SignedBlockBoundWitnessWithStorageMeta.d.ts.map +1 -1
- package/dist/neutral/index.mjs +130 -139
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/Context/BlockContext.zod.d.ts +6 -15
- package/dist/neutral/model/Context/BlockContext.zod.d.ts.map +1 -1
- package/dist/neutral/model/Context/ChainContext.zod.d.ts +81 -122
- package/dist/neutral/model/Context/ChainContext.zod.d.ts.map +1 -1
- package/dist/neutral/model/Context/HeadContext.zod.d.ts +2 -3
- package/dist/neutral/model/Context/HeadContext.zod.d.ts.map +1 -1
- package/dist/neutral/model/HydratedTransaction.d.ts +12 -2
- package/dist/neutral/model/HydratedTransaction.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/block/HydratedBlock.ts +9 -8
- package/src/block/signed/SignedBlockBoundWitnessWithHashMeta.ts +2 -2
- package/src/block/signed/SignedBlockBoundWitnessWithStorageMeta.ts +2 -2
- package/src/model/Context/BlockContext.zod.ts +7 -8
- package/src/model/Context/ChainContext.zod.ts +8 -13
- package/src/model/Context/HeadContext.zod.ts +1 -1
- package/src/model/HydratedTransaction.ts +3 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
zodAsFactory, zodIsFactory, zodToFactory,
|
|
3
3
|
} from '@xylabs/sdk-js'
|
|
4
|
-
import { PayloadBuilder,
|
|
4
|
+
import { PayloadBuilder, WithStorageMetaZod } from '@xyo-network/sdk-js'
|
|
5
5
|
import type { z } from 'zod'
|
|
6
6
|
|
|
7
7
|
import { isSignedBlockBoundWitness, SignedBlockBoundWitnessZod } from './SignedBlockBoundWitness.ts'
|
|
8
8
|
|
|
9
|
-
export const SignedBlockBoundWitnessWithStorageMetaZod = SignedBlockBoundWitnessZod
|
|
9
|
+
export const SignedBlockBoundWitnessWithStorageMetaZod = WithStorageMetaZod(SignedBlockBoundWitnessZod)
|
|
10
10
|
|
|
11
11
|
export type SignedBlockBoundWitnessWithStorageMeta = z.infer<typeof SignedBlockBoundWitnessWithStorageMetaZod>
|
|
12
12
|
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
Payload,
|
|
3
|
+
ReadArchivist, WriteArchivist,
|
|
4
|
+
} from '@xyo-network/sdk-js'
|
|
2
5
|
import z from 'zod'
|
|
3
6
|
|
|
4
|
-
import type { PayloadMapRead, PayloadMapWrite } from '../PayloadMap.ts'
|
|
5
7
|
import { CachingContextZod } from './CachingContext.zod.ts'
|
|
6
8
|
|
|
7
9
|
export const BlockContextReadZod = CachingContextZod.extend(
|
|
8
|
-
{ chainMap: z.custom<
|
|
10
|
+
{ chainMap: z.custom<ReadArchivist<Payload>>(val => val && typeof val === 'object' && ('get' in val)) },
|
|
9
11
|
)
|
|
10
12
|
|
|
11
13
|
export const BlockContextWriteZod = CachingContextZod.extend(
|
|
12
|
-
{ chainMap: z.custom<
|
|
14
|
+
{ chainMap: z.custom<WriteArchivist<Payload>>(val => val && typeof val === 'object' && ('get' in val && 'insert' in val)) },
|
|
13
15
|
)
|
|
14
16
|
|
|
15
|
-
export const BlockContextZod =
|
|
16
|
-
BlockContextReadZod,
|
|
17
|
-
BlockContextWriteZod,
|
|
18
|
-
)
|
|
17
|
+
export const BlockContextZod = BlockContextWriteZod
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
BlockContextReadZod, BlockContextWriteZod, BlockContextZod,
|
|
3
|
+
} from './BlockContext.zod.ts'
|
|
4
4
|
import { HeadContextBaseZod } from './HeadContext.zod.ts'
|
|
5
5
|
|
|
6
|
-
export const ChainContextReadZod =
|
|
7
|
-
HeadContextBaseZod,
|
|
8
|
-
BlockContextReadZod,
|
|
9
|
-
)
|
|
6
|
+
export const ChainContextReadZod = BlockContextReadZod.safeExtend(HeadContextBaseZod.shape)
|
|
10
7
|
|
|
11
|
-
export const ChainContextWriteZod =
|
|
12
|
-
HeadContextBaseZod,
|
|
13
|
-
BlockContextWriteZod,
|
|
8
|
+
export const ChainContextWriteZod = BlockContextWriteZod.safeExtend(
|
|
9
|
+
HeadContextBaseZod.shape,
|
|
14
10
|
)
|
|
15
11
|
|
|
16
|
-
export const ChainContextZod =
|
|
17
|
-
|
|
18
|
-
ChainContextWriteZod,
|
|
12
|
+
export const ChainContextZod = BlockContextZod.safeExtend(
|
|
13
|
+
HeadContextBaseZod.shape,
|
|
19
14
|
)
|
|
@@ -8,4 +8,4 @@ export const HeadContextBaseZod = z.object(
|
|
|
8
8
|
{ head: WithHashMetaZod(BlockBoundWitnessZod) },
|
|
9
9
|
)
|
|
10
10
|
|
|
11
|
-
export const HeadContextZod =
|
|
11
|
+
export const HeadContextZod = CachingContextZod.safeExtend(HeadContextBaseZod.shape)
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
zodAsFactory, zodIsFactory, zodToFactory,
|
|
3
3
|
} from '@xylabs/sdk-js'
|
|
4
4
|
import {
|
|
5
|
+
PayloadZod,
|
|
5
6
|
PayloadZodLoose, WithHashMetaZod,
|
|
6
7
|
WithStorageMetaZod,
|
|
7
8
|
} from '@xyo-network/sdk-js'
|
|
@@ -96,7 +97,7 @@ export const toSignedHydratedTransaction = zodToFactory(SignedHydratedTransactio
|
|
|
96
97
|
|
|
97
98
|
export const SignedHydratedTransactionWithHashMetaZod = z.tuple([
|
|
98
99
|
WithHashMetaZod(SignedTransactionBoundWitnessZod),
|
|
99
|
-
z.array(WithHashMetaZod(
|
|
100
|
+
z.array(WithHashMetaZod(PayloadZod).loose()),
|
|
100
101
|
])
|
|
101
102
|
|
|
102
103
|
export type SignedHydratedTransactionWithHashMeta = z.infer<typeof SignedHydratedTransactionWithHashMetaZod>
|
|
@@ -107,7 +108,7 @@ export const toSignedHydratedTransactionWithHashMeta = zodToFactory(SignedHydrat
|
|
|
107
108
|
|
|
108
109
|
export const SignedHydratedTransactionWithStorageMetaZod = z.tuple([
|
|
109
110
|
WithStorageMetaZod(SignedTransactionBoundWitnessZod),
|
|
110
|
-
z.array(WithStorageMetaZod(
|
|
111
|
+
z.array(WithStorageMetaZod(PayloadZod).loose()),
|
|
111
112
|
])
|
|
112
113
|
|
|
113
114
|
export type SignedHydratedTransactionWithStorageMeta = z.infer<typeof SignedHydratedTransactionWithStorageMetaZod>
|