@xyo-network/xl1-protocol 1.14.7 → 1.14.9
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/index.mjs +42 -42
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/BlockNumber/BlockNumber.d.ts +2 -1
- package/dist/neutral/model/BlockNumber/BlockNumber.d.ts.map +1 -1
- package/dist/neutral/model/BlockNumber/EthBlockNumber.d.ts +2 -1
- package/dist/neutral/model/BlockNumber/EthBlockNumber.d.ts.map +1 -1
- package/dist/neutral/model/BlockNumber/Numberish.d.ts +1 -0
- package/dist/neutral/model/BlockNumber/Numberish.d.ts.map +1 -1
- package/dist/neutral/model/BlockNumber/XL1BlockNumber.d.ts +2 -1
- package/dist/neutral/model/BlockNumber/XL1BlockNumber.d.ts.map +1 -1
- package/dist/neutral/model/BlockRange/BlockRange.d.ts +2 -2
- package/dist/neutral/model/BlockRange/BlockRange.d.ts.map +1 -1
- package/dist/neutral/model/BlockRange/EthBlockRange.d.ts +2 -2
- package/dist/neutral/model/BlockRange/EthBlockRange.d.ts.map +1 -1
- package/dist/neutral/model/BlockRange/XL1BlockRange.d.ts +2 -2
- package/dist/neutral/model/BlockRange/XL1BlockRange.d.ts.map +1 -1
- package/dist/neutral/model/ChainId.d.ts +2 -2
- package/dist/neutral/model/ChainId.d.ts.map +1 -1
- package/dist/neutral/model/GatewayName.d.ts +3 -2
- package/dist/neutral/model/GatewayName.d.ts.map +1 -1
- package/dist/neutral/validation/payload/InBlockPayloadValidationFunction.d.ts +2 -2
- package/dist/neutral/validation/payload/InBlockPayloadValidationFunction.d.ts.map +1 -1
- package/dist/neutral/zod/BlockBoundWitness.d.ts +55 -55
- package/dist/neutral/zod/BlockBoundWitness.d.ts.map +1 -1
- package/dist/neutral/zod/BoundWitness.d.ts.map +1 -1
- package/dist/neutral/zod/Chain.d.ts +1 -2
- package/dist/neutral/zod/Chain.d.ts.map +1 -1
- package/dist/neutral/zod/HydratedBlock.d.ts +37 -37
- package/dist/neutral/zod/HydratedTransaction.d.ts +180 -180
- package/dist/neutral/zod/Permission.d.ts.map +1 -1
- package/dist/neutral/zod/Stake.d.ts.map +1 -1
- package/dist/neutral/zod/TransactionBoundWitness.d.ts +170 -170
- package/dist/neutral/zod/TransactionBoundWitness.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/model/BlockNumber/BlockNumber.ts +4 -2
- package/src/model/BlockNumber/EthBlockNumber.ts +5 -3
- package/src/model/BlockNumber/Numberish.ts +2 -0
- package/src/model/BlockNumber/XL1BlockNumber.ts +5 -3
- package/src/model/BlockRange/BlockRange.ts +6 -4
- package/src/model/BlockRange/EthBlockRange.ts +5 -4
- package/src/model/BlockRange/XL1BlockRange.ts +5 -4
- package/src/model/ChainId.ts +2 -2
- package/src/model/GatewayName.ts +3 -1
- package/src/validation/payload/InBlockPayloadValidationFunction.ts +2 -2
- package/src/zod/BlockBoundWitness.ts +12 -12
- package/src/zod/BoundWitness.ts +3 -4
- package/src/zod/Permission.ts +1 -1
- package/src/zod/Stake.ts +1 -0
- package/src/zod/TransactionBoundWitness.ts +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/zod/TransactionBoundWitness.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AASxB,eAAO,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"TransactionBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/zod/TransactionBoundWitness.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AASxB,eAAO,MAAM,aAAa;;iBAAuC,CAAA;AACjE,eAAO,MAAM,WAAW;;iBAAuC,CAAA;AAC/D,eAAO,MAAM,gBAAgB;;;iBAA+D,CAAA;AAC5F,eAAO,MAAM,eAAe;;iBAAuD,CAAA;AAEnF,eAAO,MAAM,kBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;CAG1D,CAAA;AACD,eAAO,MAAM,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAG1D,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-protocol",
|
|
4
|
-
"version": "1.14.
|
|
4
|
+
"version": "1.14.9",
|
|
5
5
|
"description": "XYO Layer One Protocol",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -40,39 +40,39 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@opentelemetry/api": "~1.9.0",
|
|
43
|
-
"@xylabs/assert": "~5.0.
|
|
44
|
-
"@xylabs/error": "~5.0.
|
|
45
|
-
"@xylabs/hex": "~5.0.
|
|
46
|
-
"@xylabs/logger": "~5.0.
|
|
47
|
-
"@xylabs/object": "~5.0.
|
|
48
|
-
"@xylabs/promise": "~5.0.
|
|
49
|
-
"@xylabs/sdk-js": "~5.0.
|
|
50
|
-
"@xylabs/typeof": "~5.0.
|
|
51
|
-
"@xylabs/zod": "~5.0.
|
|
52
|
-
"@xyo-network/archivist-model": "~5.2.
|
|
53
|
-
"@xyo-network/boundwitness-model": "~5.2.
|
|
54
|
-
"@xyo-network/payload-model": "~5.2.
|
|
55
|
-
"@xyo-network/schema-payload-plugin": "~5.2.
|
|
43
|
+
"@xylabs/assert": "~5.0.41",
|
|
44
|
+
"@xylabs/error": "~5.0.41",
|
|
45
|
+
"@xylabs/hex": "~5.0.41",
|
|
46
|
+
"@xylabs/logger": "~5.0.41",
|
|
47
|
+
"@xylabs/object": "~5.0.41",
|
|
48
|
+
"@xylabs/promise": "~5.0.41",
|
|
49
|
+
"@xylabs/sdk-js": "~5.0.41",
|
|
50
|
+
"@xylabs/typeof": "~5.0.41",
|
|
51
|
+
"@xylabs/zod": "~5.0.41",
|
|
52
|
+
"@xyo-network/archivist-model": "~5.2.6",
|
|
53
|
+
"@xyo-network/boundwitness-model": "~5.2.6",
|
|
54
|
+
"@xyo-network/payload-model": "~5.2.6",
|
|
55
|
+
"@xyo-network/schema-payload-plugin": "~5.2.6",
|
|
56
56
|
"zod": "~4.1.12"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "~24.10.1",
|
|
60
60
|
"@typescript-eslint/types": "~8.47.0",
|
|
61
|
-
"@xylabs/creatable": "~5.0.
|
|
61
|
+
"@xylabs/creatable": "~5.0.41",
|
|
62
62
|
"@xylabs/eslint-config-flat": "~7.2.8",
|
|
63
63
|
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
64
64
|
"@xylabs/tsconfig": "~7.2.8",
|
|
65
|
-
"@xyo-network/account-model": "~5.2.
|
|
66
|
-
"@xyo-network/payload-builder": "~5.2.
|
|
65
|
+
"@xyo-network/account-model": "~5.2.6",
|
|
66
|
+
"@xyo-network/payload-builder": "~5.2.6",
|
|
67
67
|
"dependency-cruiser": "~17.3.1",
|
|
68
68
|
"dotenv": "~17.2.3",
|
|
69
69
|
"eslint": "~9.39.1",
|
|
70
70
|
"eslint-import-resolver-typescript": "~4.4.4",
|
|
71
71
|
"knip": "~5.70.1",
|
|
72
72
|
"typescript": "~5.9.3",
|
|
73
|
-
"vite": "~7.2.
|
|
73
|
+
"vite": "~7.2.4",
|
|
74
74
|
"vite-tsconfig-paths": "~5.1.4",
|
|
75
|
-
"vitest": "~4.0.
|
|
75
|
+
"vitest": "~4.0.12"
|
|
76
76
|
},
|
|
77
77
|
"packageManager": "yarn@4.10.3",
|
|
78
78
|
"engines": {
|
|
@@ -7,9 +7,11 @@ import { NumberishZod } from './Numberish.ts'
|
|
|
7
7
|
export type BlockNumber = Brand<number, { readonly __blockNumber: true }>
|
|
8
8
|
|
|
9
9
|
export const BlockNumberZod = z.number().transform(v => v as BlockNumber)
|
|
10
|
-
export const
|
|
10
|
+
export const BlockNumberishZod = NumberishZod.transform(v => v as BlockNumber)
|
|
11
|
+
|
|
12
|
+
export type BlockNumberish = z.input<typeof BlockNumberishZod>
|
|
11
13
|
|
|
12
14
|
export const asBlockNumber = zodAsFactory<BlockNumber>(BlockNumberZod, 'asBlockNumber')
|
|
13
|
-
export const toBlockNumber = zodToFactory<BlockNumber>(
|
|
15
|
+
export const toBlockNumber = zodToFactory<BlockNumber>(BlockNumberishZod, 'toBlockNumber')
|
|
14
16
|
|
|
15
17
|
export const BLOCK_NUMBER_ZERO = asBlockNumber(0)
|
|
@@ -3,14 +3,16 @@ import { zodAsFactory, zodToFactory } from '@xylabs/zod'
|
|
|
3
3
|
import z from 'zod'
|
|
4
4
|
|
|
5
5
|
import type { BlockNumber } from './BlockNumber.ts'
|
|
6
|
-
import {
|
|
6
|
+
import { BlockNumberishZod } from './BlockNumber.ts'
|
|
7
7
|
|
|
8
8
|
export type EthBlockNumber = Brand<BlockNumber, { readonly __ethBlockNumber: true }>
|
|
9
9
|
|
|
10
10
|
export const EthBlockNumberZod = z.number().transform(v => v as EthBlockNumber)
|
|
11
|
-
export const
|
|
11
|
+
export const EthBlockNumberishZod = BlockNumberishZod.transform(v => v as EthBlockNumber)
|
|
12
|
+
|
|
13
|
+
export type EthBlockNumberish = z.input<typeof EthBlockNumberishZod>
|
|
12
14
|
|
|
13
15
|
export const asEthBlockNumber = zodAsFactory<EthBlockNumber>(EthBlockNumberZod, 'asEthBlockNumber')
|
|
14
|
-
export const toEthBlockNumber = zodToFactory<EthBlockNumber>(
|
|
16
|
+
export const toEthBlockNumber = zodToFactory<EthBlockNumber>(EthBlockNumberishZod, 'toEthBlockNumber')
|
|
15
17
|
|
|
16
18
|
export const ETH_BLOCK_NUMBER_ZERO = asEthBlockNumber(0)
|
|
@@ -3,14 +3,16 @@ import { zodAsFactory, zodToFactory } from '@xylabs/zod'
|
|
|
3
3
|
import z from 'zod'
|
|
4
4
|
|
|
5
5
|
import type { BlockNumber } from './BlockNumber.ts'
|
|
6
|
-
import {
|
|
6
|
+
import { BlockNumberishZod } from './BlockNumber.ts'
|
|
7
7
|
|
|
8
8
|
export type XL1BlockNumber = Brand<BlockNumber, { readonly __xl1BlockNumber: true }>
|
|
9
9
|
|
|
10
10
|
export const XL1BlockNumberZod = z.number().transform(v => v as XL1BlockNumber)
|
|
11
|
-
export const
|
|
11
|
+
export const XL1BlockNumberishZod = BlockNumberishZod.transform(v => v as XL1BlockNumber)
|
|
12
|
+
|
|
13
|
+
export type XL1BlockNumberish = z.input<typeof XL1BlockNumberishZod>
|
|
12
14
|
|
|
13
15
|
export const asXL1BlockNumber = zodAsFactory<XL1BlockNumber>(XL1BlockNumberZod, 'asXL1BlockNumber')
|
|
14
|
-
export const toXL1BlockNumber = zodToFactory<XL1BlockNumber>(
|
|
16
|
+
export const toXL1BlockNumber = zodToFactory<XL1BlockNumber>(XL1BlockNumberishZod, 'toXL1BlockNumber')
|
|
15
17
|
|
|
16
18
|
export const XL1_BLOCK_NUMBER_ZERO = asXL1BlockNumber(0)
|
|
@@ -6,17 +6,19 @@ import z from 'zod'
|
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
asBlockNumber,
|
|
9
|
-
type BlockNumber,
|
|
9
|
+
type BlockNumber, BlockNumberishZod,
|
|
10
|
+
BlockNumberZod,
|
|
10
11
|
} from '../BlockNumber/index.ts'
|
|
11
12
|
|
|
12
13
|
export type BlockRange = [BlockNumber, BlockNumber]
|
|
13
|
-
export type NumberishBlockRange = [BlockNumber, BlockNumber]
|
|
14
14
|
|
|
15
15
|
export const BlockRangeZod = z.tuple([BlockNumberZod, BlockNumberZod])
|
|
16
|
-
export const
|
|
16
|
+
export const BlockRangeishZod = z.tuple([BlockNumberishZod, BlockNumberishZod])
|
|
17
|
+
|
|
18
|
+
export type BlockRangeish = z.input<typeof BlockRangeishZod>
|
|
17
19
|
|
|
18
20
|
export const asBlockRange = zodAsFactory<BlockRange>(BlockRangeZod, 'BlockRange')
|
|
19
|
-
export const toBlockRange = zodToFactory<BlockRange>(
|
|
21
|
+
export const toBlockRange = zodToFactory<BlockRange>(BlockRangeishZod, 'BlockRange')
|
|
20
22
|
|
|
21
23
|
export type BlockRangeKey = Brand<string, { readonly __blockRangeKey: true }>
|
|
22
24
|
export const toBlockNumberKey = (range: BlockRange) => `${range[0]}|${range[1]}` as BlockRangeKey
|
|
@@ -7,18 +7,19 @@ import z from 'zod'
|
|
|
7
7
|
import type { EthBlockNumber } from '../BlockNumber/index.ts'
|
|
8
8
|
import {
|
|
9
9
|
asEthBlockNumber,
|
|
10
|
+
EthBlockNumberishZod,
|
|
10
11
|
EthBlockNumberZod,
|
|
11
|
-
NumberishEthBlockNumberZod,
|
|
12
12
|
} from '../BlockNumber/index.ts'
|
|
13
13
|
|
|
14
14
|
export type EthBlockRange = [EthBlockNumber, EthBlockNumber]
|
|
15
|
-
export type NumberishEthBlockRange = [EthBlockNumber, EthBlockNumber]
|
|
16
15
|
|
|
17
16
|
export const EthBlockRangeZod = z.tuple([EthBlockNumberZod, EthBlockNumberZod])
|
|
18
|
-
export const
|
|
17
|
+
export const EthBlockRangeishZod = z.tuple([EthBlockNumberishZod, EthBlockNumberishZod])
|
|
18
|
+
|
|
19
|
+
export type EthBlockRangeish = z.input<typeof EthBlockRangeishZod>
|
|
19
20
|
|
|
20
21
|
export const asEthBlockRange = zodAsFactory<EthBlockRange>(EthBlockRangeZod, 'EthBlockRange')
|
|
21
|
-
export const toEthBlockRange = zodToFactory<EthBlockRange>(
|
|
22
|
+
export const toEthBlockRange = zodToFactory<EthBlockRange>(EthBlockRangeishZod, 'EthBlockRange')
|
|
22
23
|
|
|
23
24
|
export type EthBlockRangeKey = Brand<string, { readonly __ethBlockRangeKey: true }>
|
|
24
25
|
export const toEthBlockNumberKey = (range: EthBlockRange) => `${range[0]}|${range[1]}` as EthBlockRangeKey
|
|
@@ -7,18 +7,19 @@ import z from 'zod'
|
|
|
7
7
|
import type { XL1BlockNumber } from '../BlockNumber/index.ts'
|
|
8
8
|
import {
|
|
9
9
|
asXL1BlockNumber,
|
|
10
|
-
|
|
10
|
+
XL1BlockNumberishZod,
|
|
11
11
|
XL1BlockNumberZod,
|
|
12
12
|
} from '../BlockNumber/index.ts'
|
|
13
13
|
|
|
14
14
|
export type XL1BlockRange = [XL1BlockNumber, XL1BlockNumber]
|
|
15
|
-
export type NumberishXL1BlockRange = [XL1BlockNumber, XL1BlockNumber]
|
|
16
15
|
|
|
17
16
|
export const XL1BlockRangeZod = z.tuple([XL1BlockNumberZod, XL1BlockNumberZod])
|
|
18
|
-
export const
|
|
17
|
+
export const XL1BlockRangeishZod = z.tuple([XL1BlockNumberishZod, XL1BlockNumberishZod])
|
|
18
|
+
|
|
19
|
+
export type XL1BlockRangeish = z.input<typeof XL1BlockRangeishZod>
|
|
19
20
|
|
|
20
21
|
export const asXL1BlockRange = zodAsFactory<XL1BlockRange>(XL1BlockRangeZod, 'XL1BlockRange')
|
|
21
|
-
export const toXL1BlockRange = zodToFactory<XL1BlockRange>(
|
|
22
|
+
export const toXL1BlockRange = zodToFactory<XL1BlockRange>(XL1BlockRangeishZod, 'XL1BlockRange')
|
|
22
23
|
|
|
23
24
|
export type XL1BlockRangeKey = Brand<string, { readonly __xl1BlockRangeKey: true }>
|
|
24
25
|
export const toXL1BlockNumberKey = (range: XL1BlockRange) => `${range[0]}|${range[1]}` as XL1BlockRangeKey
|
package/src/model/ChainId.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Hex } from '@xylabs/hex'
|
|
2
2
|
|
|
3
|
-
export type ChainId =
|
|
3
|
+
export type ChainId = Hex
|
package/src/model/GatewayName.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise'
|
|
2
2
|
import type { Payload, WithHashMeta } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { HydratedBlockWithHashMeta } from '../../zod/index.ts'
|
|
5
5
|
import type { InBlockPayloadValidationError } from './error.ts'
|
|
6
6
|
|
|
7
7
|
export type InBlockPayloadValidationFunction = (
|
|
8
|
-
payload: WithHashMeta<Payload>, block:
|
|
8
|
+
payload: WithHashMeta<Payload>, block: HydratedBlockWithHashMeta,
|
|
9
9
|
) => Promisable<InBlockPayloadValidationError[]>
|
|
@@ -24,8 +24,8 @@ export const BlockBoundWitnessFieldsZod = z.object({
|
|
|
24
24
|
export const BlockBoundWitnessMetaZod = z.object({ $epoch: z.number() })
|
|
25
25
|
|
|
26
26
|
export const BlockBoundWitnessZod = BoundWitnessZod
|
|
27
|
-
.
|
|
28
|
-
.
|
|
27
|
+
.safeExtend(BlockBoundWitnessFieldsZod.shape)
|
|
28
|
+
.safeExtend(BlockBoundWitnessMetaZod.shape)
|
|
29
29
|
|
|
30
30
|
export type BlockBoundWitness = z.infer<typeof BlockBoundWitnessZod>
|
|
31
31
|
|
|
@@ -34,7 +34,7 @@ export const asBlockBoundWitness = zodAsFactory(BlockBoundWitnessZod, 'asBlockBo
|
|
|
34
34
|
export const toBlockBoundWitness = zodToFactory(BlockBoundWitnessZod, 'toBlockBoundWitness')
|
|
35
35
|
|
|
36
36
|
export const BlockBoundWitnessWithHashMetaZod = BlockBoundWitnessZod
|
|
37
|
-
.
|
|
37
|
+
.safeExtend(HashMetaZod.shape)
|
|
38
38
|
|
|
39
39
|
export type BlockBoundWitnessWithHashMeta = z.infer<typeof BlockBoundWitnessWithHashMetaZod>
|
|
40
40
|
|
|
@@ -43,7 +43,7 @@ export const asBlockBoundWitnessWithHashMeta = zodAsFactory(BlockBoundWitnessWit
|
|
|
43
43
|
export const toBlockBoundWitnessWithHashMeta = zodToFactory(BlockBoundWitnessWithHashMetaZod, 'toBlockBoundWitnessWithHashMeta')
|
|
44
44
|
|
|
45
45
|
export const BlockBoundWitnessWithStorageMetaZod = BlockBoundWitnessZod
|
|
46
|
-
.
|
|
46
|
+
.safeExtend(StorageMetaZod.shape)
|
|
47
47
|
|
|
48
48
|
export type BlockBoundWitnessWithStorageMeta = z.infer<typeof BlockBoundWitnessWithStorageMetaZod>
|
|
49
49
|
|
|
@@ -52,8 +52,8 @@ export const asBlockBoundWitnessWithStorageMeta = zodAsFactory(BlockBoundWitness
|
|
|
52
52
|
export const toBlockBoundWitnessWithStorageMeta = zodToFactory(BlockBoundWitnessWithStorageMetaZod, 'toBlockBoundWitnessWithStorageMeta')
|
|
53
53
|
|
|
54
54
|
export const UnsignedBlockBoundWitnessZod = UnsignedBoundWitnessZod
|
|
55
|
-
.
|
|
56
|
-
.
|
|
55
|
+
.safeExtend(BlockBoundWitnessFieldsZod.shape)
|
|
56
|
+
.safeExtend(BlockBoundWitnessMetaZod.shape)
|
|
57
57
|
|
|
58
58
|
export type UnsignedBlockBoundWitness = z.infer<typeof UnsignedBlockBoundWitnessZod>
|
|
59
59
|
|
|
@@ -61,7 +61,7 @@ export const isUnsignedBlockBoundWitness = zodIsFactory(UnsignedBlockBoundWitnes
|
|
|
61
61
|
export const asUnsignedBlockBoundWitness = zodAsFactory(UnsignedBlockBoundWitnessZod, 'asUnsignedBlockBoundWitness')
|
|
62
62
|
export const toUnsignedBlockBoundWitness = zodToFactory(UnsignedBlockBoundWitnessZod, 'toUnsignedBlockBoundWitness')
|
|
63
63
|
|
|
64
|
-
export const UnsignedBlockBoundWitnessWithHashMetaZod = UnsignedBlockBoundWitnessZod.
|
|
64
|
+
export const UnsignedBlockBoundWitnessWithHashMetaZod = UnsignedBlockBoundWitnessZod.safeExtend(HashMetaZod.shape)
|
|
65
65
|
|
|
66
66
|
export type UnsignedBlockBoundWitnessWithHashMeta = z.infer<typeof UnsignedBlockBoundWitnessWithHashMetaZod>
|
|
67
67
|
|
|
@@ -69,7 +69,7 @@ export const isUnsignedBlockBoundWitnessWithHashMeta = zodIsFactory(UnsignedBloc
|
|
|
69
69
|
export const asUnsignedBlockBoundWitnessWithHashMeta = zodAsFactory(UnsignedBlockBoundWitnessWithHashMetaZod, 'asUnsignedBlockBoundWitnessWithHashMeta')
|
|
70
70
|
export const toUnsignedBlockBoundWitnessWithHashMeta = zodToFactory(UnsignedBlockBoundWitnessWithHashMetaZod, 'toUnsignedBlockBoundWitnessWithHashMeta')
|
|
71
71
|
|
|
72
|
-
export const UnsignedBlockBoundWitnessWithStorageMetaZod = UnsignedBlockBoundWitnessZod.
|
|
72
|
+
export const UnsignedBlockBoundWitnessWithStorageMetaZod = UnsignedBlockBoundWitnessZod.safeExtend(StorageMetaZod.shape)
|
|
73
73
|
|
|
74
74
|
export type UnsignedBlockBoundWitnessWithStorageMeta = z.infer<typeof UnsignedBlockBoundWitnessWithStorageMetaZod>
|
|
75
75
|
|
|
@@ -84,8 +84,8 @@ export const toUnsignedBlockBoundWitnessWithStorageMeta = zodToFactory(
|
|
|
84
84
|
)
|
|
85
85
|
|
|
86
86
|
export const SignedBlockBoundWitnessZod = SignedBoundWitnessZod
|
|
87
|
-
.
|
|
88
|
-
.
|
|
87
|
+
.safeExtend(BlockBoundWitnessFieldsZod.shape)
|
|
88
|
+
.safeExtend(BlockBoundWitnessMetaZod.shape)
|
|
89
89
|
|
|
90
90
|
export type SignedBlockBoundWitness = z.infer<typeof SignedBlockBoundWitnessZod>
|
|
91
91
|
|
|
@@ -93,7 +93,7 @@ export const isSignedBlockBoundWitness = zodIsFactory(SignedBlockBoundWitnessZod
|
|
|
93
93
|
export const asSignedBlockBoundWitness = zodAsFactory(SignedBlockBoundWitnessZod, 'asSignedBlockBoundWitness')
|
|
94
94
|
export const toSignedBlockBoundWitness = zodToFactory(SignedBlockBoundWitnessZod, 'toSignedBlockBoundWitness')
|
|
95
95
|
|
|
96
|
-
export const SignedBlockBoundWitnessWithHashMetaZod = SignedBlockBoundWitnessZod.
|
|
96
|
+
export const SignedBlockBoundWitnessWithHashMetaZod = SignedBlockBoundWitnessZod.safeExtend(HashMetaZod.shape)
|
|
97
97
|
|
|
98
98
|
export type SignedBlockBoundWitnessWithHashMeta = z.infer<typeof SignedBlockBoundWitnessWithHashMetaZod>
|
|
99
99
|
|
|
@@ -101,7 +101,7 @@ export const isSignedBlockBoundWitnessWithHashMeta = zodIsFactory(SignedBlockBou
|
|
|
101
101
|
export const asSignedBlockBoundWitnessWithHashMeta = zodAsFactory(SignedBlockBoundWitnessWithHashMetaZod, 'asSignedBlockBoundWitnessWithHashMeta')
|
|
102
102
|
export const toSignedBlockBoundWitnessWithHashMeta = zodToFactory(SignedBlockBoundWitnessWithHashMetaZod, 'toSignedBlockBoundWitnessWithHashMeta')
|
|
103
103
|
|
|
104
|
-
export const SignedBlockBoundWitnessWithStorageMetaZod = SignedBlockBoundWitnessZod.
|
|
104
|
+
export const SignedBlockBoundWitnessWithStorageMetaZod = SignedBlockBoundWitnessZod.safeExtend(StorageMetaZod.shape)
|
|
105
105
|
|
|
106
106
|
export type SignedBlockBoundWitnessWithStorageMeta = z.infer<typeof SignedBlockBoundWitnessWithStorageMetaZod>
|
|
107
107
|
|
package/src/zod/BoundWitness.ts
CHANGED
|
@@ -21,10 +21,9 @@ const BoundWitnessMetaZod = z.object({
|
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
export const BoundWitnessZod = PayloadZod
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
.
|
|
27
|
-
.refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })
|
|
24
|
+
.safeExtend({ schema: z.literal(BoundWitnessSchema) })
|
|
25
|
+
.safeExtend(BoundWitnessRequiredFieldsZod.shape)
|
|
26
|
+
.safeExtend(BoundWitnessMetaZod.shape)
|
|
28
27
|
|
|
29
28
|
export type BoundWitness = z.infer<typeof BoundWitnessZod>
|
|
30
29
|
|
package/src/zod/Permission.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const PermissionZod = z.object({
|
|
|
13
13
|
invoker: z.string(),
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
export const InvokerPermissionZod = PermissionZod.
|
|
16
|
+
export const InvokerPermissionZod = PermissionZod.safeExtend({ date: z.number().optional() })
|
|
17
17
|
|
|
18
18
|
export const PermissionRequestZod = z.record(z.string(), z.record(z.string(), z.any()))
|
|
19
19
|
|
package/src/zod/Stake.ts
CHANGED
|
@@ -32,6 +32,7 @@ export const StakeToJsonZod = StakeZod.transform(val => ({
|
|
|
32
32
|
withdrawBlock: val.withdrawBlock,
|
|
33
33
|
}))
|
|
34
34
|
|
|
35
|
+
// we intentionally use extend and not safeExtend here to ensure all fields are present
|
|
35
36
|
export const JsonToStakeZod = StakeZod.extend({ amount: HexZod }).transform(val => ({
|
|
36
37
|
addBlock: val.addBlock,
|
|
37
38
|
amount: JsonToAttoZod.parse(val.amount),
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import { HashMetaZod, StorageMetaZod } from '@xyo-network/payload-model'
|
|
6
6
|
import * as z from 'zod'
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { XL1BlockNumberZod } from '../model/index.ts'
|
|
9
9
|
import {
|
|
10
10
|
BoundWitnessZod, SignedBoundWitnessZod, UnsignedBoundWitnessZod,
|
|
11
11
|
} from './BoundWitness.ts'
|
|
12
12
|
import { ChainZod } from './Chain.ts'
|
|
13
13
|
import { TransactionFeesHexZod } from './TransactionFees.ts'
|
|
14
14
|
|
|
15
|
-
export const BlockStartZod = z.object({ nbf:
|
|
16
|
-
export const BlockEndZod = z.object({ exp:
|
|
17
|
-
export const BlockDurationZod = z.object({ nbf:
|
|
15
|
+
export const BlockStartZod = z.object({ nbf: XL1BlockNumberZod })
|
|
16
|
+
export const BlockEndZod = z.object({ exp: XL1BlockNumberZod })
|
|
17
|
+
export const BlockDurationZod = z.object({ nbf: XL1BlockNumberZod, exp: XL1BlockNumberZod })
|
|
18
18
|
export const BlockScriptsZod = z.object({ script: z.array(z.string()).optional() })
|
|
19
19
|
|
|
20
20
|
export const TransactionFeesZod = z.object({ fees: TransactionFeesHexZod })
|
|
@@ -22,15 +22,15 @@ export const TransactionFeesZod = z.object({ fees: TransactionFeesHexZod })
|
|
|
22
22
|
export const TransactionBoundWitnessIdentityFields = z.object({ chain: ChainZod, from: AddressZod })
|
|
23
23
|
|
|
24
24
|
export const TransactionBoundWitnessFieldsZod = z.object()
|
|
25
|
-
.
|
|
26
|
-
.
|
|
27
|
-
.
|
|
28
|
-
.
|
|
25
|
+
.safeExtend(BlockDurationZod.shape)
|
|
26
|
+
.safeExtend(TransactionFeesZod.shape)
|
|
27
|
+
.safeExtend(TransactionBoundWitnessIdentityFields.shape)
|
|
28
|
+
.safeExtend(BlockScriptsZod.shape)
|
|
29
29
|
|
|
30
30
|
export type TransactionBoundWitnessFields = z.infer<typeof TransactionBoundWitnessFieldsZod>
|
|
31
31
|
|
|
32
32
|
export const TransactionBoundWitnessZod = BoundWitnessZod
|
|
33
|
-
.
|
|
33
|
+
.safeExtend(TransactionBoundWitnessFieldsZod.shape)
|
|
34
34
|
|
|
35
35
|
export type TransactionBoundWitness = z.infer<typeof TransactionBoundWitnessZod>
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ export const asTransactionBoundWitness = zodAsFactory(TransactionBoundWitnessZod
|
|
|
39
39
|
export const toTransactionBoundWitness = zodToFactory(TransactionBoundWitnessZod, 'toTransactionBoundWitness')
|
|
40
40
|
|
|
41
41
|
export const TransactionBoundWitnessWithHashMetaZod = TransactionBoundWitnessZod
|
|
42
|
-
.
|
|
42
|
+
.safeExtend(HashMetaZod.shape)
|
|
43
43
|
|
|
44
44
|
export type TransactionBoundWitnessWithHashMeta = z.infer<typeof TransactionBoundWitnessWithHashMetaZod>
|
|
45
45
|
|
|
@@ -48,7 +48,7 @@ export const asTransactionBoundWitnessWithHashMeta = zodAsFactory(TransactionBou
|
|
|
48
48
|
export const toTransactionBoundWitnessWithHashMeta = zodToFactory(TransactionBoundWitnessWithHashMetaZod, 'toTransactionBoundWitnessWithHashMeta')
|
|
49
49
|
|
|
50
50
|
export const TransactionBoundWitnessWithStorageMetaZod = TransactionBoundWitnessZod
|
|
51
|
-
.
|
|
51
|
+
.safeExtend(StorageMetaZod.shape)
|
|
52
52
|
|
|
53
53
|
export type TransactionBoundWitnessWithStorageMeta = z.infer<typeof TransactionBoundWitnessWithStorageMetaZod>
|
|
54
54
|
|
|
@@ -57,7 +57,7 @@ export const asTransactionBoundWitnessWithStorageMeta = zodAsFactory(Transaction
|
|
|
57
57
|
export const toTransactionBoundWitnessWithStorageMeta = zodToFactory(TransactionBoundWitnessWithStorageMetaZod, 'toTransactionBoundWitnessWithStorageMeta')
|
|
58
58
|
|
|
59
59
|
export const UnsignedTransactionBoundWitnessZod = UnsignedBoundWitnessZod
|
|
60
|
-
.
|
|
60
|
+
.safeExtend(TransactionBoundWitnessFieldsZod.shape)
|
|
61
61
|
|
|
62
62
|
export type UnsignedTransactionBoundWitness = z.infer<typeof UnsignedTransactionBoundWitnessZod>
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ export const isUnsignedTransactionBoundWitness = zodIsFactory(UnsignedTransactio
|
|
|
65
65
|
export const asUnsignedTransactionBoundWitness = zodAsFactory(UnsignedTransactionBoundWitnessZod, 'asUnsignedTransactionBoundWitness')
|
|
66
66
|
export const toUnsignedTransactionBoundWitness = zodToFactory(UnsignedTransactionBoundWitnessZod, 'toUnsignedTransactionBoundWitness')
|
|
67
67
|
|
|
68
|
-
export const UnsignedTransactionBoundWitnessWithHashMetaZod = UnsignedTransactionBoundWitnessZod.
|
|
68
|
+
export const UnsignedTransactionBoundWitnessWithHashMetaZod = UnsignedTransactionBoundWitnessZod.safeExtend(HashMetaZod.shape)
|
|
69
69
|
|
|
70
70
|
export type UnsignedTransactionBoundWitnessWithHashMeta = z.infer<typeof UnsignedTransactionBoundWitnessWithHashMetaZod>
|
|
71
71
|
|
|
@@ -80,7 +80,7 @@ export const toUnsignedTransactionBoundWitnessWithHashMeta = zodToFactory(
|
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
export const UnsignedTransactionBoundWitnessWithStorageMetaZod = UnsignedTransactionBoundWitnessZod
|
|
83
|
-
.
|
|
83
|
+
.safeExtend(StorageMetaZod.shape)
|
|
84
84
|
|
|
85
85
|
export type UnsignedTransactionBoundWitnessWithStorageMeta = z.infer<typeof UnsignedTransactionBoundWitnessWithStorageMetaZod>
|
|
86
86
|
|
|
@@ -95,7 +95,7 @@ export const toUnsignedTransactionBoundWitnessWithStorageMeta = zodToFactory(
|
|
|
95
95
|
)
|
|
96
96
|
|
|
97
97
|
export const SignedTransactionBoundWitnessZod = SignedBoundWitnessZod
|
|
98
|
-
.
|
|
98
|
+
.safeExtend(TransactionBoundWitnessFieldsZod.shape)
|
|
99
99
|
|
|
100
100
|
export type SignedTransactionBoundWitness = z.infer<typeof SignedTransactionBoundWitnessZod>
|
|
101
101
|
|
|
@@ -104,7 +104,7 @@ export const asSignedTransactionBoundWitness = zodAsFactory(SignedTransactionBou
|
|
|
104
104
|
export const toSignedTransactionBoundWitness = zodToFactory(SignedTransactionBoundWitnessZod, 'toSignedTransactionBoundWitness')
|
|
105
105
|
|
|
106
106
|
export const SignedTransactionBoundWitnessWithHashMetaZod = SignedTransactionBoundWitnessZod
|
|
107
|
-
.
|
|
107
|
+
.safeExtend(HashMetaZod.shape)
|
|
108
108
|
|
|
109
109
|
export type SignedTransactionBoundWitnessWithHashMeta = z.infer<typeof SignedTransactionBoundWitnessWithHashMetaZod>
|
|
110
110
|
|
|
@@ -119,7 +119,7 @@ export const toSignedTransactionBoundWitnessWithHashMeta = zodToFactory(
|
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
export const SignedTransactionBoundWitnessWithStorageMetaZod = SignedTransactionBoundWitnessZod
|
|
122
|
-
.
|
|
122
|
+
.safeExtend(StorageMetaZod.shape)
|
|
123
123
|
|
|
124
124
|
export type SignedTransactionBoundWitnessWithStorageMeta = z.infer<typeof SignedTransactionBoundWitnessWithStorageMetaZod>
|
|
125
125
|
|