@xyo-network/xl1-protocol 1.18.1 → 1.18.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/index.mjs +174 -157
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/zod/BlockRate.d.ts +43 -0
- package/dist/neutral/zod/BlockRate.d.ts.map +1 -0
- package/dist/neutral/zod/HydratedTransaction.d.ts +12 -12
- package/dist/neutral/zod/index.d.ts +1 -0
- package/dist/neutral/zod/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/zod/BlockRate.ts +17 -0
- package/src/zod/HydratedTransaction.ts +2 -2
- package/src/zod/index.ts +1 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BlockRateZod: z.ZodObject<{
|
|
3
|
+
range: z.ZodTuple<[z.ZodPipe<z.ZodNumber, z.ZodTransform<import("../model/index.ts").XL1BlockNumber, number>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<import("../model/index.ts").XL1BlockNumber, number>>], null>;
|
|
4
|
+
rate: z.ZodNumber;
|
|
5
|
+
span: z.ZodInt;
|
|
6
|
+
timeDifference: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type BlockRateZod = z.infer<typeof BlockRateZod>;
|
|
9
|
+
export declare const isBlockRate: <T>(value: T) => value is T & {
|
|
10
|
+
range: [import("../model/index.ts").XL1BlockNumber, import("../model/index.ts").XL1BlockNumber];
|
|
11
|
+
rate: number;
|
|
12
|
+
span: number;
|
|
13
|
+
timeDifference: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const asBlockRate: {
|
|
16
|
+
<T>(value: T): (T & {
|
|
17
|
+
range: [import("../model/index.ts").XL1BlockNumber, import("../model/index.ts").XL1BlockNumber];
|
|
18
|
+
rate: number;
|
|
19
|
+
span: number;
|
|
20
|
+
timeDifference: number;
|
|
21
|
+
}) | undefined;
|
|
22
|
+
<T>(value: T, assert: import("@xylabs/zod").ZodFactoryConfig): T & {
|
|
23
|
+
range: [import("../model/index.ts").XL1BlockNumber, import("../model/index.ts").XL1BlockNumber];
|
|
24
|
+
rate: number;
|
|
25
|
+
span: number;
|
|
26
|
+
timeDifference: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const toBlockRate: {
|
|
30
|
+
<T>(value: T): (T & {
|
|
31
|
+
range: [import("../model/index.ts").XL1BlockNumber, import("../model/index.ts").XL1BlockNumber];
|
|
32
|
+
rate: number;
|
|
33
|
+
span: number;
|
|
34
|
+
timeDifference: number;
|
|
35
|
+
}) | undefined;
|
|
36
|
+
<T>(value: T, assert: import("@xylabs/zod").ZodFactoryConfig): T & {
|
|
37
|
+
range: [import("../model/index.ts").XL1BlockNumber, import("../model/index.ts").XL1BlockNumber];
|
|
38
|
+
rate: number;
|
|
39
|
+
span: number;
|
|
40
|
+
timeDifference: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=BlockRate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockRate.d.ts","sourceRoot":"","sources":["../../../src/zod/BlockRate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,YAAY;;;;;iBAKvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAEvD,eAAO,MAAM,WAAW;;;;;CAA6B,CAAA;AACrD,eAAO,MAAM,WAAW;;;;;;;;;;;;;CAA4C,CAAA;AACpE,eAAO,MAAM,WAAW;;;;;;;;;;;;;CAA4C,CAAA"}
|
|
@@ -935,7 +935,7 @@ export declare const UnsignedHydratedTransactionWithHashMetaZod: z.ZodTuple<[z.Z
|
|
|
935
935
|
readonly __address: true;
|
|
936
936
|
}, string>>>;
|
|
937
937
|
$sourceQuery: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").BrandedHash, string>>>;
|
|
938
|
-
$signatures: z.ZodArray<z.
|
|
938
|
+
$signatures: z.ZodArray<z.ZodNull>;
|
|
939
939
|
nbf: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("../index.ts").XL1BlockNumber, number>>;
|
|
940
940
|
exp: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("../index.ts").XL1BlockNumber, number>>;
|
|
941
941
|
fees: z.ZodObject<{
|
|
@@ -969,7 +969,7 @@ export declare const isUnsignedHydratedTransactionWithHashMeta: <T>(value: T) =>
|
|
|
969
969
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
970
970
|
payload_schemas: string[];
|
|
971
971
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
972
|
-
$signatures:
|
|
972
|
+
$signatures: null[];
|
|
973
973
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
974
974
|
exp: import("../index.ts").XL1BlockNumber;
|
|
975
975
|
fees: {
|
|
@@ -1009,7 +1009,7 @@ export declare const asUnsignedHydratedTransactionWithHashMeta: {
|
|
|
1009
1009
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1010
1010
|
payload_schemas: string[];
|
|
1011
1011
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1012
|
-
$signatures:
|
|
1012
|
+
$signatures: null[];
|
|
1013
1013
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1014
1014
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1015
1015
|
fees: {
|
|
@@ -1048,7 +1048,7 @@ export declare const asUnsignedHydratedTransactionWithHashMeta: {
|
|
|
1048
1048
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1049
1049
|
payload_schemas: string[];
|
|
1050
1050
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1051
|
-
$signatures:
|
|
1051
|
+
$signatures: null[];
|
|
1052
1052
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1053
1053
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1054
1054
|
fees: {
|
|
@@ -1089,7 +1089,7 @@ export declare const toUnsignedHydratedTransactionWithHashMeta: {
|
|
|
1089
1089
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1090
1090
|
payload_schemas: string[];
|
|
1091
1091
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1092
|
-
$signatures:
|
|
1092
|
+
$signatures: null[];
|
|
1093
1093
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1094
1094
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1095
1095
|
fees: {
|
|
@@ -1128,7 +1128,7 @@ export declare const toUnsignedHydratedTransactionWithHashMeta: {
|
|
|
1128
1128
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1129
1129
|
payload_schemas: string[];
|
|
1130
1130
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1131
|
-
$signatures:
|
|
1131
|
+
$signatures: null[];
|
|
1132
1132
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1133
1133
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1134
1134
|
fees: {
|
|
@@ -1174,7 +1174,7 @@ export declare const UnsignedHydratedTransactionWithStorageMetaZod: z.ZodTuple<[
|
|
|
1174
1174
|
readonly __address: true;
|
|
1175
1175
|
}, string>>>;
|
|
1176
1176
|
$sourceQuery: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/hex").BrandedHash, string>>>;
|
|
1177
|
-
$signatures: z.ZodArray<z.
|
|
1177
|
+
$signatures: z.ZodArray<z.ZodNull>;
|
|
1178
1178
|
nbf: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("../index.ts").XL1BlockNumber, number>>;
|
|
1179
1179
|
exp: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("../index.ts").XL1BlockNumber, number>>;
|
|
1180
1180
|
fees: z.ZodObject<{
|
|
@@ -1210,7 +1210,7 @@ export declare const isUnsignedHydratedTransactionWithStorageMeta: <T>(value: T)
|
|
|
1210
1210
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1211
1211
|
payload_schemas: string[];
|
|
1212
1212
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1213
|
-
$signatures:
|
|
1213
|
+
$signatures: null[];
|
|
1214
1214
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1215
1215
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1216
1216
|
fees: {
|
|
@@ -1252,7 +1252,7 @@ export declare const asUnsignedHydratedTransactionWithStorageMeta: {
|
|
|
1252
1252
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1253
1253
|
payload_schemas: string[];
|
|
1254
1254
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1255
|
-
$signatures:
|
|
1255
|
+
$signatures: null[];
|
|
1256
1256
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1257
1257
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1258
1258
|
fees: {
|
|
@@ -1293,7 +1293,7 @@ export declare const asUnsignedHydratedTransactionWithStorageMeta: {
|
|
|
1293
1293
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1294
1294
|
payload_schemas: string[];
|
|
1295
1295
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1296
|
-
$signatures:
|
|
1296
|
+
$signatures: null[];
|
|
1297
1297
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1298
1298
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1299
1299
|
fees: {
|
|
@@ -1336,7 +1336,7 @@ export declare const toUnsignedHydratedTransactionWithStorageMeta: {
|
|
|
1336
1336
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1337
1337
|
payload_schemas: string[];
|
|
1338
1338
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1339
|
-
$signatures:
|
|
1339
|
+
$signatures: null[];
|
|
1340
1340
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1341
1341
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1342
1342
|
fees: {
|
|
@@ -1377,7 +1377,7 @@ export declare const toUnsignedHydratedTransactionWithStorageMeta: {
|
|
|
1377
1377
|
payload_hashes: import("@xylabs/hex").BrandedHash[];
|
|
1378
1378
|
payload_schemas: string[];
|
|
1379
1379
|
previous_hashes: (import("@xylabs/hex").BrandedHash | null)[];
|
|
1380
|
-
$signatures:
|
|
1380
|
+
$signatures: null[];
|
|
1381
1381
|
nbf: import("../index.ts").XL1BlockNumber;
|
|
1382
1382
|
exp: import("../index.ts").XL1BlockNumber;
|
|
1383
1383
|
fees: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zod/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zod/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,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.18.
|
|
4
|
+
"version": "1.18.3",
|
|
5
5
|
"description": "XYO Layer One Protocol",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -87,4 +87,4 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
}
|
|
90
|
-
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { zodAsFactory, zodIsFactory } from '@xylabs/zod'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
import { XL1BlockRangeZod } from '../model/index.ts'
|
|
5
|
+
|
|
6
|
+
export const BlockRateZod = z.object({
|
|
7
|
+
range: XL1BlockRangeZod.describe('the block range the rate was calculated over'),
|
|
8
|
+
rate: z.number().nonnegative().describe('time to make a block'),
|
|
9
|
+
span: z.int().nonnegative().describe('number of blocks the rate was calculated over'),
|
|
10
|
+
timeDifference: z.number().nonnegative().describe('time difference from start and end block'),
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export type BlockRateZod = z.infer<typeof BlockRateZod>
|
|
14
|
+
|
|
15
|
+
export const isBlockRate = zodIsFactory(BlockRateZod)
|
|
16
|
+
export const asBlockRate = zodAsFactory(BlockRateZod, 'asBlockRate')
|
|
17
|
+
export const toBlockRate = zodAsFactory(BlockRateZod, 'toBlockRate')
|
|
@@ -56,7 +56,7 @@ export const asUnsignedHydratedTransaction = zodAsFactory(UnsignedHydratedTransa
|
|
|
56
56
|
export const toUnsignedHydratedTransaction = zodToFactory(UnsignedHydratedTransactionZod, 'toUnsignedHydratedTransaction')
|
|
57
57
|
|
|
58
58
|
export const UnsignedHydratedTransactionWithHashMetaZod = z.tuple([
|
|
59
|
-
WithHashMetaZod(
|
|
59
|
+
WithHashMetaZod(UnsignedTransactionBoundWitnessZod),
|
|
60
60
|
z.array(WithHashMetaZod(PayloadZodLoose)),
|
|
61
61
|
])
|
|
62
62
|
|
|
@@ -67,7 +67,7 @@ export const asUnsignedHydratedTransactionWithHashMeta = zodAsFactory(UnsignedHy
|
|
|
67
67
|
export const toUnsignedHydratedTransactionWithHashMeta = zodToFactory(UnsignedHydratedTransactionWithHashMetaZod, 'toUnsignedHydratedTransactionWithHashMeta')
|
|
68
68
|
|
|
69
69
|
export const UnsignedHydratedTransactionWithStorageMetaZod = z.tuple([
|
|
70
|
-
WithStorageMetaZod(
|
|
70
|
+
WithStorageMetaZod(UnsignedTransactionBoundWitnessZod),
|
|
71
71
|
z.array(WithStorageMetaZod(PayloadZodLoose)),
|
|
72
72
|
])
|
|
73
73
|
|