@xyo-network/xl1-protocol 1.14.13 → 1.14.14
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/AllowedBlockPayload.d.ts +3 -3
- package/dist/neutral/block/AllowedBlockPayload.d.ts.map +1 -1
- package/dist/neutral/index.mjs +269 -181
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/BlockRange/Range.d.ts +1 -1
- package/dist/neutral/model/BlockRange/Range.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Time.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/TransferPayload.d.ts +0 -3
- package/dist/neutral/payload/elevatable/TransferPayload.d.ts.map +1 -1
- package/dist/neutral/zod/HydratedBlock.d.ts +177 -6
- package/dist/neutral/zod/HydratedBlock.d.ts.map +1 -1
- package/dist/neutral/zod/HydratedTransaction.d.ts +9 -9
- package/dist/neutral/zod/TransactionBoundWitness.d.ts +9 -9
- package/dist/neutral/zod/TransactionFees.d.ts +2 -2
- package/dist/neutral/zod/block/BlockBoundWitness.d.ts +345 -0
- package/dist/neutral/zod/block/BlockBoundWitness.d.ts.map +1 -0
- package/dist/neutral/zod/block/index.d.ts +4 -0
- package/dist/neutral/zod/block/index.d.ts.map +1 -0
- package/dist/neutral/zod/block/signed/SignedBlockBoundWitness.d.ts +103 -0
- package/dist/neutral/zod/block/signed/SignedBlockBoundWitness.d.ts.map +1 -0
- package/dist/neutral/zod/block/signed/SignedBlockBoundWitnessWithHashMeta.d.ts +179 -0
- package/dist/neutral/zod/block/signed/SignedBlockBoundWitnessWithHashMeta.d.ts.map +1 -0
- package/dist/neutral/zod/block/signed/SignedBlockBoundWitnessWithStorageMeta.d.ts +216 -0
- package/dist/neutral/zod/block/signed/SignedBlockBoundWitnessWithStorageMeta.d.ts.map +1 -0
- package/dist/neutral/zod/block/signed/index.d.ts +4 -0
- package/dist/neutral/zod/block/signed/index.d.ts.map +1 -0
- package/dist/neutral/zod/block/unsigned/UnsignedBlockBoundWitness.d.ts +103 -0
- package/dist/neutral/zod/block/unsigned/UnsignedBlockBoundWitness.d.ts.map +1 -0
- package/dist/neutral/zod/block/unsigned/index.d.ts +2 -0
- package/dist/neutral/zod/block/unsigned/index.d.ts.map +1 -0
- package/dist/neutral/zod/index.d.ts +2 -1
- package/dist/neutral/zod/index.d.ts.map +1 -1
- package/dist/neutral/zod/payload/WithHashMetaish.d.ts +27 -0
- package/dist/neutral/zod/payload/WithHashMetaish.d.ts.map +1 -0
- package/dist/neutral/zod/payload/WithStorageMetaish.d.ts +30 -0
- package/dist/neutral/zod/payload/WithStorageMetaish.d.ts.map +1 -0
- package/dist/neutral/zod/payload/index.d.ts +3 -0
- package/dist/neutral/zod/payload/index.d.ts.map +1 -0
- package/package.json +22 -21
- package/src/payload/elevatable/Time.ts +1 -3
- package/src/payload/elevatable/TransferPayload.ts +1 -3
- package/src/zod/HydratedBlock.ts +17 -1
- package/src/zod/block/BlockBoundWitness.ts +48 -0
- package/src/zod/block/index.ts +3 -0
- package/src/zod/block/signed/SignedBlockBoundWitness.ts +17 -0
- package/src/zod/block/signed/SignedBlockBoundWitnessWithHashMeta.ts +29 -0
- package/src/zod/block/signed/SignedBlockBoundWitnessWithStorageMeta.ts +35 -0
- package/src/zod/block/signed/index.ts +3 -0
- package/src/zod/block/unsigned/UnsignedBlockBoundWitness.ts +17 -0
- package/src/zod/block/unsigned/index.ts +1 -0
- package/src/zod/index.ts +2 -1
- package/src/zod/payload/WithHashMetaish.ts +23 -0
- package/src/zod/payload/WithStorageMetaish.ts +23 -0
- package/src/zod/payload/index.ts +2 -0
- package/dist/neutral/zod/BlockBoundWitness.d.ts +0 -1011
- package/dist/neutral/zod/BlockBoundWitness.d.ts.map +0 -1
- package/src/zod/BlockBoundWitness.ts +0 -114
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
zodAsFactory, zodIsFactory, zodToFactory,
|
|
3
|
+
} from '@xylabs/zod'
|
|
4
|
+
import { SignedBoundWitnessZod } from '@xyo-network/boundwitness-model'
|
|
5
|
+
import type * as z from 'zod'
|
|
6
|
+
|
|
7
|
+
import { BlockBoundWitnessFieldsZod, BlockBoundWitnessMetaZod } from '../BlockBoundWitness.ts'
|
|
8
|
+
|
|
9
|
+
export const SignedBlockBoundWitnessZod = SignedBoundWitnessZod
|
|
10
|
+
.safeExtend(BlockBoundWitnessFieldsZod.shape)
|
|
11
|
+
.safeExtend(BlockBoundWitnessMetaZod.shape)
|
|
12
|
+
|
|
13
|
+
export type SignedBlockBoundWitness = z.infer<typeof SignedBlockBoundWitnessZod>
|
|
14
|
+
|
|
15
|
+
export const isSignedBlockBoundWitness = zodIsFactory(SignedBlockBoundWitnessZod)
|
|
16
|
+
export const asSignedBlockBoundWitness = zodAsFactory(SignedBlockBoundWitnessZod, 'asSignedBlockBoundWitness')
|
|
17
|
+
export const toSignedBlockBoundWitness = zodToFactory(SignedBlockBoundWitnessZod, 'toSignedBlockBoundWitness')
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
zodAsFactory, zodIsFactory, zodToFactory,
|
|
3
|
+
} from '@xylabs/zod'
|
|
4
|
+
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
5
|
+
import { HashMetaZod } from '@xyo-network/payload-model'
|
|
6
|
+
import type * as z from 'zod'
|
|
7
|
+
|
|
8
|
+
import { isSignedBlockBoundWitness, SignedBlockBoundWitnessZod } from './SignedBlockBoundWitness.ts'
|
|
9
|
+
|
|
10
|
+
export const SignedBlockBoundWitnessWithHashMetaZod = SignedBlockBoundWitnessZod.safeExtend(HashMetaZod.shape)
|
|
11
|
+
|
|
12
|
+
export type SignedBlockBoundWitnessWithHashMeta = z.infer<typeof SignedBlockBoundWitnessWithHashMetaZod>
|
|
13
|
+
|
|
14
|
+
export const isSignedBlockBoundWitnessWithHashMeta = zodIsFactory(SignedBlockBoundWitnessWithHashMetaZod)
|
|
15
|
+
export const asSignedBlockBoundWitnessWithHashMeta = zodAsFactory(SignedBlockBoundWitnessWithHashMetaZod, 'asSignedBlockBoundWitnessWithHashMeta')
|
|
16
|
+
|
|
17
|
+
export const SignedBlockBoundWitnessWithHashMetaishZod = SignedBlockBoundWitnessZod.transform(async (data) => {
|
|
18
|
+
if (isSignedBlockBoundWitnessWithHashMeta(data)) {
|
|
19
|
+
return data
|
|
20
|
+
}
|
|
21
|
+
if (isSignedBlockBoundWitness(data)) {
|
|
22
|
+
return await PayloadBuilder.addHashMeta(data)
|
|
23
|
+
}
|
|
24
|
+
throw new Error('Invalid SignedBlockBoundWitnessWithHashMetaish format')
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export type SignedBlockBoundWitnessWithHashMetaish = z.input<typeof SignedBlockBoundWitnessWithHashMetaishZod>
|
|
28
|
+
|
|
29
|
+
export const toSignedBlockBoundWitnessWithHashMeta = zodToFactory(SignedBlockBoundWitnessWithHashMetaZod, 'toSignedBlockBoundWitnessWithHashMeta')
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
zodAsFactory, zodIsFactory, zodToFactory,
|
|
3
|
+
} from '@xylabs/zod'
|
|
4
|
+
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
5
|
+
import { StorageMetaZod } from '@xyo-network/payload-model'
|
|
6
|
+
import type * as z from 'zod'
|
|
7
|
+
|
|
8
|
+
import { isSignedBlockBoundWitness, SignedBlockBoundWitnessZod } from './SignedBlockBoundWitness.ts'
|
|
9
|
+
|
|
10
|
+
export const SignedBlockBoundWitnessWithStorageMetaZod = SignedBlockBoundWitnessZod.safeExtend(StorageMetaZod.shape)
|
|
11
|
+
|
|
12
|
+
export type SignedBlockBoundWitnessWithStorageMeta = z.infer<typeof SignedBlockBoundWitnessWithStorageMetaZod>
|
|
13
|
+
|
|
14
|
+
export const isSignedBlockBoundWitnessWithStorageMeta = zodIsFactory(SignedBlockBoundWitnessWithStorageMetaZod)
|
|
15
|
+
export const asSignedBlockBoundWitnessWithStorageMeta = zodAsFactory(
|
|
16
|
+
SignedBlockBoundWitnessWithStorageMetaZod,
|
|
17
|
+
'asSignedBlockBoundWitnessWithStorageMeta',
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export const SignedBlockBoundWitnessWithStorageMetaishZod = SignedBlockBoundWitnessZod.transform(async (data) => {
|
|
21
|
+
if (isSignedBlockBoundWitnessWithStorageMeta(data)) {
|
|
22
|
+
return data
|
|
23
|
+
}
|
|
24
|
+
if (isSignedBlockBoundWitness(data)) {
|
|
25
|
+
return await PayloadBuilder.addStorageMeta(data)
|
|
26
|
+
}
|
|
27
|
+
throw new Error('Invalid SignedBlockBoundWitnessWithStorageMetaish format')
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export type SignedBlockBoundWitnessWithStorageMetaish = z.input<typeof SignedBlockBoundWitnessWithStorageMetaishZod>
|
|
31
|
+
|
|
32
|
+
export const toSignedBlockBoundWitnessWithStorageMeta = zodToFactory(
|
|
33
|
+
SignedBlockBoundWitnessWithStorageMetaishZod,
|
|
34
|
+
'toSignedBlockBoundWitnessWithStorageMeta',
|
|
35
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
zodAsFactory, zodIsFactory, zodToFactory,
|
|
3
|
+
} from '@xylabs/zod'
|
|
4
|
+
import { UnsignedBoundWitnessZod } from '@xyo-network/boundwitness-model'
|
|
5
|
+
import type * as z from 'zod'
|
|
6
|
+
|
|
7
|
+
import { BlockBoundWitnessFieldsZod, BlockBoundWitnessMetaZod } from '../BlockBoundWitness.ts'
|
|
8
|
+
|
|
9
|
+
export const UnsignedBlockBoundWitnessZod = UnsignedBoundWitnessZod
|
|
10
|
+
.safeExtend(BlockBoundWitnessFieldsZod.shape)
|
|
11
|
+
.safeExtend(BlockBoundWitnessMetaZod.shape)
|
|
12
|
+
|
|
13
|
+
export type UnsignedBlockBoundWitness = z.infer<typeof UnsignedBlockBoundWitnessZod>
|
|
14
|
+
|
|
15
|
+
export const isUnsignedBlockBoundWitness = zodIsFactory(UnsignedBlockBoundWitnessZod)
|
|
16
|
+
export const asUnsignedBlockBoundWitness = zodAsFactory(UnsignedBlockBoundWitnessZod, 'asUnsignedBlockBoundWitness')
|
|
17
|
+
export const toUnsignedBlockBoundWitness = zodToFactory(UnsignedBlockBoundWitnessZod, 'toUnsignedBlockBoundWitness')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UnsignedBlockBoundWitness.ts'
|
package/src/zod/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './ArrayBuffer.ts'
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './block/index.ts'
|
|
3
3
|
export * from './Chain.ts'
|
|
4
4
|
export * from './HydratedBlock.ts'
|
|
5
5
|
export * from './HydratedTransaction.ts'
|
|
6
|
+
export * from './payload/index.ts'
|
|
6
7
|
export * from './Permission.ts'
|
|
7
8
|
export * from './RewardsRangeOptions.ts'
|
|
8
9
|
export * from './Sequence.ts'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { zodToAsyncFactory } from '@xylabs/zod'
|
|
2
|
+
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
+
import {
|
|
4
|
+
isAnyPayload, isHashMeta, PayloadZodLoose,
|
|
5
|
+
} from '@xyo-network/payload-model'
|
|
6
|
+
import type z from 'zod'
|
|
7
|
+
|
|
8
|
+
export const WithHashMetaishZod = PayloadZodLoose.transform(async (data) => {
|
|
9
|
+
if (isAnyPayload(data)) {
|
|
10
|
+
if (isHashMeta(data)) {
|
|
11
|
+
return data
|
|
12
|
+
}
|
|
13
|
+
return await PayloadBuilder.addHashMeta(data)
|
|
14
|
+
}
|
|
15
|
+
throw new Error('Invalid WithHashMetaish format')
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export type WithHashMetaish = z.input<typeof WithHashMetaishZod>
|
|
19
|
+
|
|
20
|
+
export const toWithHashMeta = zodToAsyncFactory(
|
|
21
|
+
WithHashMetaishZod,
|
|
22
|
+
'toWithHashMeta',
|
|
23
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { zodToAsyncFactory } from '@xylabs/zod'
|
|
2
|
+
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
+
import {
|
|
4
|
+
isAnyPayload, isStorageMeta, PayloadZodLoose,
|
|
5
|
+
} from '@xyo-network/payload-model'
|
|
6
|
+
import type z from 'zod'
|
|
7
|
+
|
|
8
|
+
export const WithStorageMetaishZod = PayloadZodLoose.transform(async (data) => {
|
|
9
|
+
if (isAnyPayload(data)) {
|
|
10
|
+
if (isStorageMeta(data)) {
|
|
11
|
+
return data
|
|
12
|
+
}
|
|
13
|
+
return await PayloadBuilder.addStorageMeta(data)
|
|
14
|
+
}
|
|
15
|
+
throw new Error('Invalid WithStorageMetaish format')
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export type WithStorageMetaish = z.input<typeof WithStorageMetaishZod>
|
|
19
|
+
|
|
20
|
+
export const toWithStorageMeta = zodToAsyncFactory(
|
|
21
|
+
WithStorageMetaishZod,
|
|
22
|
+
'toWithStorageMeta',
|
|
23
|
+
)
|