@xyo-network/xl1-protocol-model 1.30.3 → 2.0.0
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/TransferPayload.d.ts +14 -14
- package/dist/neutral/TransferPayload.d.ts.map +1 -1
- package/dist/neutral/block/BlockBoundWitness.d.ts +59 -59
- package/dist/neutral/block/BlockBoundWitness.d.ts.map +1 -1
- package/dist/neutral/block/HydratedBlock.d.ts +184 -184
- package/dist/neutral/block/HydratedBlock.d.ts.map +1 -1
- package/dist/neutral/block/signed/SignedBlockBoundWitness.d.ts +16 -16
- package/dist/neutral/block/signed/SignedBlockBoundWitness.d.ts.map +1 -1
- package/dist/neutral/block/signed/SignedBlockBoundWitnessWithHashMeta.d.ts +34 -34
- package/dist/neutral/block/signed/SignedBlockBoundWitnessWithHashMeta.d.ts.map +1 -1
- package/dist/neutral/block/signed/SignedBlockBoundWitnessWithStorageMeta.d.ts +35 -35
- package/dist/neutral/block/signed/SignedBlockBoundWitnessWithStorageMeta.d.ts.map +1 -1
- package/dist/neutral/block/unsigned/UnsignedBlockBoundWitness.d.ts +16 -16
- package/dist/neutral/block/unsigned/UnsignedBlockBoundWitness.d.ts.map +1 -1
- package/dist/neutral/index.mjs +308 -265
- package/dist/neutral/index.mjs.map +3 -3
- package/dist/neutral/model/AccountBalance.d.ts +56 -56
- package/dist/neutral/model/AccountBalance.d.ts.map +1 -1
- package/dist/neutral/model/ChainQualification.d.ts +4 -4
- package/dist/neutral/model/Context/ChainContext.zod.d.ts +45 -45
- package/dist/neutral/model/Context/HeadContext.zod.d.ts +30 -30
- package/dist/neutral/model/HydratedTransaction.d.ts +220 -220
- package/dist/neutral/model/HydratedTransaction.d.ts.map +1 -1
- package/dist/neutral/model/RewardsRangeOptions.d.ts +1 -1
- package/dist/neutral/model/Stake.d.ts +9 -9
- package/dist/neutral/model/TransferPair.d.ts +2 -2
- package/dist/neutral/payload/elevatable/Bridge/BridgeDestinationObservation.d.ts +11 -11
- package/dist/neutral/payload/elevatable/Bridge/BridgeDestinationObservation.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Bridge/BridgeDetails.d.ts +20 -20
- package/dist/neutral/payload/elevatable/Bridge/BridgeDetails.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Bridge/BridgeIntent.d.ts +11 -11
- package/dist/neutral/payload/elevatable/Bridge/BridgeIntent.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Bridge/BridgeSourceObservation.d.ts +11 -11
- package/dist/neutral/payload/elevatable/Bridge/BridgeSourceObservation.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Time.d.ts +22 -22
- package/dist/neutral/payload/elevatable/Time.d.ts.map +1 -1
- package/dist/neutral/rejection/BlockRejectionPayload.d.ts +48 -48
- package/dist/neutral/rejection/BlockRejectionPayload.d.ts.map +1 -1
- package/dist/neutral/rejection/RejectionError.d.ts +1 -1
- package/dist/neutral/rejection/TransactionRejectionPayload.d.ts +56 -56
- package/dist/neutral/rejection/TransactionRejectionPayload.d.ts.map +1 -1
- package/dist/neutral/transaction/TransactionBoundWitness.d.ts +216 -216
- package/dist/neutral/transaction/TransactionBoundWitness.d.ts.map +1 -1
- package/dist/neutral/transaction/TransactionFees.d.ts +25 -25
- package/dist/neutral/transaction/TransactionFees.d.ts.map +1 -1
- package/package.json +51 -51
package/dist/neutral/index.mjs
CHANGED
|
@@ -6,62 +6,64 @@ import {
|
|
|
6
6
|
isSchemaPayload,
|
|
7
7
|
SchemaSchema
|
|
8
8
|
} from "@xyo-network/sdk-js";
|
|
9
|
-
import { z as
|
|
9
|
+
import { z as z16 } from "zod";
|
|
10
10
|
|
|
11
11
|
// src/payload/elevatable/Bridge/BridgeDestinationObservation.ts
|
|
12
12
|
import { AsObjectFactory, HexZod as HexZod2 } from "@xylabs/sdk-js";
|
|
13
13
|
import { asSchema, isPayloadOfZodType } from "@xyo-network/sdk-js";
|
|
14
|
+
import { z as z2 } from "zod/mini";
|
|
14
15
|
|
|
15
16
|
// src/payload/elevatable/Bridge/BridgeDetails.ts
|
|
16
17
|
import { HexZod } from "@xylabs/sdk-js";
|
|
17
|
-
import { z } from "zod";
|
|
18
|
+
import { z } from "zod/mini";
|
|
18
19
|
var BridgeDetailsDestinationFieldsZod = z.object({
|
|
19
20
|
/**
|
|
20
21
|
* Destination network
|
|
21
22
|
*/
|
|
22
|
-
dest: HexZod.describe("The destination network identifier"),
|
|
23
|
+
dest: HexZod.check(z.describe("The destination network identifier")),
|
|
23
24
|
/**
|
|
24
25
|
* Destination address (EOA or contract)
|
|
25
26
|
*/
|
|
26
|
-
destAddress: HexZod.describe("The destination address (EOA or contract)"),
|
|
27
|
+
destAddress: HexZod.check(z.describe("The destination address (EOA or contract)")),
|
|
27
28
|
/**
|
|
28
29
|
* Token amount to bridge to destination
|
|
29
30
|
*/
|
|
30
|
-
destAmount: HexZod.describe("The token amount to bridge to destination"),
|
|
31
|
+
destAmount: HexZod.check(z.describe("The token amount to bridge to destination")),
|
|
31
32
|
/**
|
|
32
33
|
* Token being bridged to
|
|
33
34
|
*/
|
|
34
|
-
destToken: HexZod.describe("The token being bridged to")
|
|
35
|
+
destToken: HexZod.check(z.describe("The token being bridged to"))
|
|
35
36
|
});
|
|
36
37
|
var BridgeDetailsSourceFieldsZod = z.object({
|
|
37
38
|
/**
|
|
38
39
|
* Source network
|
|
39
40
|
*/
|
|
40
|
-
src: HexZod.describe("The source network identifier"),
|
|
41
|
+
src: HexZod.check(z.describe("The source network identifier")),
|
|
41
42
|
/**
|
|
42
43
|
* Source address (EOA or contract)
|
|
43
44
|
*/
|
|
44
|
-
srcAddress: HexZod.describe("The source address (EOA or contract)"),
|
|
45
|
+
srcAddress: HexZod.check(z.describe("The source address (EOA or contract)")),
|
|
45
46
|
/**
|
|
46
47
|
* Token amount to bridge from source
|
|
47
48
|
*/
|
|
48
|
-
srcAmount: HexZod.describe("The token amount to bridge from source"),
|
|
49
|
+
srcAmount: HexZod.check(z.describe("The token amount to bridge from source")),
|
|
49
50
|
/**
|
|
50
51
|
* Token being bridged from
|
|
51
52
|
*/
|
|
52
|
-
srcToken: HexZod.describe("The token being bridged from")
|
|
53
|
+
srcToken: HexZod.check(z.describe("The token being bridged from"))
|
|
53
54
|
});
|
|
54
|
-
var BridgeDetailsFieldsZod =
|
|
55
|
+
var BridgeDetailsFieldsZod = z.extend(
|
|
56
|
+
BridgeDetailsSourceFieldsZod,
|
|
55
57
|
BridgeDetailsDestinationFieldsZod.shape
|
|
56
58
|
);
|
|
57
59
|
|
|
58
60
|
// src/payload/elevatable/Bridge/BridgeDestinationObservation.ts
|
|
59
61
|
var BridgeDestinationObservationSchema = asSchema("network.xyo.chain.bridge.observation.destination", true);
|
|
60
|
-
var BridgeDestinationObservationFieldsZod =
|
|
62
|
+
var BridgeDestinationObservationFieldsZod = z2.extend(BridgeDetailsFieldsZod, {
|
|
61
63
|
/**
|
|
62
64
|
* Destination chain confirmation
|
|
63
65
|
*/
|
|
64
|
-
destConfirmation:
|
|
66
|
+
destConfirmation: z2.optional(HexZod2).check(z2.describe("Destination chain confirmation"))
|
|
65
67
|
});
|
|
66
68
|
var isBridgeDestinationObservation = isPayloadOfZodType(
|
|
67
69
|
BridgeDestinationObservationFieldsZod,
|
|
@@ -72,13 +74,13 @@ var asBridgeDestinationObservation = AsObjectFactory.create(isBridgeDestinationO
|
|
|
72
74
|
// src/payload/elevatable/Bridge/BridgeIntent.ts
|
|
73
75
|
import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/sdk-js";
|
|
74
76
|
import { asSchema as asSchema2, isPayloadOfZodType as isPayloadOfZodType2 } from "@xyo-network/sdk-js";
|
|
75
|
-
import { z as
|
|
77
|
+
import { z as z3 } from "zod/mini";
|
|
76
78
|
var BridgeIntentSchema = asSchema2("network.xyo.chain.bridge.intent", true);
|
|
77
|
-
var BridgeIntentFieldsZod =
|
|
79
|
+
var BridgeIntentFieldsZod = z3.extend(BridgeDetailsFieldsZod, {
|
|
78
80
|
/**
|
|
79
81
|
* Unique identifier for replay protection
|
|
80
82
|
*/
|
|
81
|
-
nonce:
|
|
83
|
+
nonce: z3.string().check(z3.describe("Unique identifier for replay protection"))
|
|
82
84
|
});
|
|
83
85
|
var isBridgeIntent = isPayloadOfZodType2(
|
|
84
86
|
BridgeIntentFieldsZod,
|
|
@@ -89,12 +91,13 @@ var asBridgeIntent = AsObjectFactory2.create(isBridgeIntent);
|
|
|
89
91
|
// src/payload/elevatable/Bridge/BridgeSourceObservation.ts
|
|
90
92
|
import { AsObjectFactory as AsObjectFactory3, HexZod as HexZod3 } from "@xylabs/sdk-js";
|
|
91
93
|
import { asSchema as asSchema3, isPayloadOfZodType as isPayloadOfZodType3 } from "@xyo-network/sdk-js";
|
|
94
|
+
import { z as z4 } from "zod/mini";
|
|
92
95
|
var BridgeSourceObservationSchema = asSchema3("network.xyo.chain.bridge.observation.source", true);
|
|
93
|
-
var BridgeSourceObservationFieldsZod =
|
|
96
|
+
var BridgeSourceObservationFieldsZod = z4.extend(BridgeDetailsFieldsZod, {
|
|
94
97
|
/**
|
|
95
98
|
* Source chain confirmation
|
|
96
99
|
*/
|
|
97
|
-
srcConfirmation:
|
|
100
|
+
srcConfirmation: z4.optional(HexZod3).check(z4.describe("Source chain confirmation"))
|
|
98
101
|
});
|
|
99
102
|
var isBridgeSourceObservation = isPayloadOfZodType3(
|
|
100
103
|
BridgeSourceObservationFieldsZod,
|
|
@@ -155,26 +158,29 @@ import {
|
|
|
155
158
|
isPayloadOfSchemaType as isPayloadOfSchemaType4,
|
|
156
159
|
PayloadZodOfSchema
|
|
157
160
|
} from "@xyo-network/sdk-js";
|
|
158
|
-
import { z as
|
|
161
|
+
import { z as z5 } from "zod/mini";
|
|
159
162
|
var TimeSchema = asSchema7("network.xyo.time", true);
|
|
160
|
-
var XL1TimeFieldsZod =
|
|
163
|
+
var XL1TimeFieldsZod = z5.object({
|
|
161
164
|
// block number
|
|
162
|
-
xl1:
|
|
165
|
+
xl1: z5.optional(z5.number()),
|
|
163
166
|
// block hash
|
|
164
|
-
xl1Hash:
|
|
167
|
+
xl1Hash: z5.optional(HashZod)
|
|
165
168
|
});
|
|
166
|
-
var EthereumTimeFieldsZod =
|
|
169
|
+
var EthereumTimeFieldsZod = z5.object({
|
|
167
170
|
// block number
|
|
168
|
-
ethereum:
|
|
171
|
+
ethereum: z5.optional(z5.number()),
|
|
169
172
|
// block hash
|
|
170
|
-
ethereumHash:
|
|
173
|
+
ethereumHash: z5.optional(HashZod)
|
|
171
174
|
});
|
|
172
|
-
var EpochTimeFieldsZod =
|
|
175
|
+
var EpochTimeFieldsZod = z5.object({
|
|
173
176
|
// in milliseconds
|
|
174
|
-
epoch:
|
|
177
|
+
epoch: z5.number()
|
|
175
178
|
});
|
|
176
|
-
var TimeFieldsZod =
|
|
177
|
-
|
|
179
|
+
var TimeFieldsZod = z5.extend(
|
|
180
|
+
z5.extend(z5.extend(XL1TimeFieldsZod, XL1TimeFieldsZod.shape), EthereumTimeFieldsZod.shape),
|
|
181
|
+
EpochTimeFieldsZod.shape
|
|
182
|
+
);
|
|
183
|
+
var TimePayloadZod = z5.extend(PayloadZodOfSchema(TimeSchema), TimeFieldsZod.shape);
|
|
178
184
|
var isSafeEpoch = (value) => {
|
|
179
185
|
return typeof value === "number" && value < 2 * Date.now();
|
|
180
186
|
};
|
|
@@ -190,18 +196,18 @@ import { asSchema as asSchema8, isPayloadOfZodType as isPayloadOfZodType4 } from
|
|
|
190
196
|
|
|
191
197
|
// src/Step/StepIdentity.ts
|
|
192
198
|
import { isUndefined } from "@xylabs/sdk-js";
|
|
193
|
-
import { z as
|
|
199
|
+
import { z as z10 } from "zod";
|
|
194
200
|
|
|
195
201
|
// src/BlockNumber/BlockNumber.ts
|
|
196
202
|
import { zodAsFactory, zodToFactory } from "@xylabs/sdk-js";
|
|
197
|
-
import { z as
|
|
203
|
+
import { z as z7 } from "zod";
|
|
198
204
|
|
|
199
205
|
// src/BlockNumber/Numberish.ts
|
|
200
|
-
import { z as
|
|
201
|
-
var NumberishZod =
|
|
206
|
+
import { z as z6 } from "zod";
|
|
207
|
+
var NumberishZod = z6.union([z6.number(), z6.string(), z6.bigint()]).transform((v) => typeof v === "bigint" ? Number(v) : typeof v === "string" ? Number(v) : v).pipe(z6.number());
|
|
202
208
|
|
|
203
209
|
// src/BlockNumber/BlockNumber.ts
|
|
204
|
-
var BlockNumberZod =
|
|
210
|
+
var BlockNumberZod = z7.number().transform((v) => v);
|
|
205
211
|
var BlockNumberishZod = NumberishZod.transform((v) => v);
|
|
206
212
|
var asBlockNumber = zodAsFactory(BlockNumberZod, "asBlockNumber");
|
|
207
213
|
var toBlockNumber = zodToFactory(BlockNumberishZod, "toBlockNumber");
|
|
@@ -209,8 +215,8 @@ var BLOCK_NUMBER_ZERO = asBlockNumber(0);
|
|
|
209
215
|
|
|
210
216
|
// src/BlockNumber/EthBlockNumber.ts
|
|
211
217
|
import { zodAsFactory as zodAsFactory2, zodToFactory as zodToFactory2 } from "@xylabs/sdk-js";
|
|
212
|
-
import { z as
|
|
213
|
-
var EthBlockNumberZod =
|
|
218
|
+
import { z as z8 } from "zod";
|
|
219
|
+
var EthBlockNumberZod = z8.number().transform((v) => v);
|
|
214
220
|
var EthBlockNumberishZod = BlockNumberishZod.transform((v) => v);
|
|
215
221
|
var asEthBlockNumber = zodAsFactory2(EthBlockNumberZod, "asEthBlockNumber");
|
|
216
222
|
var toEthBlockNumber = zodToFactory2(EthBlockNumberishZod, "toEthBlockNumber");
|
|
@@ -218,17 +224,17 @@ var ETH_BLOCK_NUMBER_ZERO = asEthBlockNumber(0);
|
|
|
218
224
|
|
|
219
225
|
// src/BlockNumber/XL1BlockNumber.ts
|
|
220
226
|
import { zodAsFactory as zodAsFactory3, zodToFactory as zodToFactory3 } from "@xylabs/sdk-js";
|
|
221
|
-
import { z as
|
|
222
|
-
var XL1BlockNumberZod =
|
|
227
|
+
import { z as z9 } from "zod";
|
|
228
|
+
var XL1BlockNumberZod = z9.number().transform((v) => v);
|
|
223
229
|
var XL1BlockNumberishZod = BlockNumberishZod.transform((v) => v);
|
|
224
230
|
var asXL1BlockNumber = zodAsFactory3(XL1BlockNumberZod, "asXL1BlockNumber");
|
|
225
231
|
var toXL1BlockNumber = zodToFactory3(XL1BlockNumberishZod, "toXL1BlockNumber");
|
|
226
232
|
var XL1_BLOCK_NUMBER_ZERO = asXL1BlockNumber(0);
|
|
227
233
|
|
|
228
234
|
// src/Step/StepIdentity.ts
|
|
229
|
-
var StepIdentityZod =
|
|
235
|
+
var StepIdentityZod = z10.object({
|
|
230
236
|
block: XL1BlockNumberZod.describe("The block number at which the step occurs"),
|
|
231
|
-
step:
|
|
237
|
+
step: z10.number().int().nonnegative().describe("The index of the step into the StepSize array")
|
|
232
238
|
});
|
|
233
239
|
function tryParseInt(value) {
|
|
234
240
|
if (value === "") return void 0;
|
|
@@ -314,12 +320,12 @@ import {
|
|
|
314
320
|
WithHashMetaZod,
|
|
315
321
|
WithStorageMetaZod
|
|
316
322
|
} from "@xyo-network/sdk-js";
|
|
317
|
-
import { z as
|
|
323
|
+
import { z as z14 } from "zod/mini";
|
|
318
324
|
|
|
319
325
|
// src/chain/Chain.ts
|
|
320
326
|
import { AddressRegEx, toAddress } from "@xylabs/sdk-js";
|
|
321
|
-
import { z as
|
|
322
|
-
var ChainZod =
|
|
327
|
+
import { z as z11 } from "zod";
|
|
328
|
+
var ChainZod = z11.string().toLowerCase().regex(AddressRegEx).transform((v) => toAddress(v));
|
|
323
329
|
|
|
324
330
|
// src/transaction/TransactionFees.ts
|
|
325
331
|
import {
|
|
@@ -330,10 +336,10 @@ import {
|
|
|
330
336
|
zodIsFactory,
|
|
331
337
|
zodToFactory as zodToFactory4
|
|
332
338
|
} from "@xylabs/sdk-js";
|
|
333
|
-
import { z as
|
|
339
|
+
import { z as z13 } from "zod/mini";
|
|
334
340
|
|
|
335
341
|
// src/xl1/isXL1Factory.ts
|
|
336
|
-
import { z as
|
|
342
|
+
import { z as z12 } from "zod";
|
|
337
343
|
|
|
338
344
|
// src/xl1/xl1MaxValue.ts
|
|
339
345
|
var xl1MaxValue = (places) => 10n ** (32n - places) - 1n;
|
|
@@ -346,7 +352,7 @@ var isXL1Factory = (places) => (val) => {
|
|
|
346
352
|
var XL1ZodFactory = (places, name) => {
|
|
347
353
|
const is = isXL1Factory(places);
|
|
348
354
|
const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`;
|
|
349
|
-
return
|
|
355
|
+
return z12.bigint().refine(
|
|
350
356
|
(x) => {
|
|
351
357
|
const result = is(x);
|
|
352
358
|
return result;
|
|
@@ -357,7 +363,7 @@ var XL1ZodFactory = (places, name) => {
|
|
|
357
363
|
var XL1TransformZodFactory = (places, name) => {
|
|
358
364
|
const is = isXL1Factory(places);
|
|
359
365
|
const message = `Invalid value for ${name}, must be between 0 and ${xl1MaxValue(places)}`;
|
|
360
|
-
return
|
|
366
|
+
return z12.union([z12.bigint(), z12.number(), z12.string(), z12.boolean()]).transform((val) => BigInt(val)).refine(
|
|
361
367
|
(x) => {
|
|
362
368
|
const result = is(x);
|
|
363
369
|
return result;
|
|
@@ -454,9 +460,9 @@ var XL1 = asXL1;
|
|
|
454
460
|
|
|
455
461
|
// src/transaction/TransactionFees.ts
|
|
456
462
|
import { BigIntToJsonZod as BigIntToJsonZod2 } from "@xylabs/sdk-js";
|
|
457
|
-
var AttoZod =
|
|
458
|
-
var JsonToAttoZod = JsonToBigIntZod.transform((v) => asAttoXL1(v));
|
|
459
|
-
var TransactionFeesHexZod =
|
|
463
|
+
var AttoZod = z13.bigint();
|
|
464
|
+
var JsonToAttoZod = z13.pipe(JsonToBigIntZod, z13.transform((v) => asAttoXL1(v)));
|
|
465
|
+
var TransactionFeesHexZod = z13.object({
|
|
460
466
|
base: HexZod4,
|
|
461
467
|
gasLimit: HexZod4,
|
|
462
468
|
gasPrice: HexZod4,
|
|
@@ -465,7 +471,7 @@ var TransactionFeesHexZod = z11.object({
|
|
|
465
471
|
var isTransactionFeesHex = zodIsFactory(TransactionFeesHexZod);
|
|
466
472
|
var asTransactionFeesHex = zodAsFactory4(TransactionFeesHexZod, "asTransactionFeesHex");
|
|
467
473
|
var toTransactionFeesHex = zodToFactory4(TransactionFeesHexZod, "toTransactionFeesHex");
|
|
468
|
-
var TransactionFeesBigIntZod =
|
|
474
|
+
var TransactionFeesBigIntZod = z13.object({
|
|
469
475
|
base: AttoZod,
|
|
470
476
|
gasLimit: AttoZod,
|
|
471
477
|
gasPrice: AttoZod,
|
|
@@ -474,44 +480,59 @@ var TransactionFeesBigIntZod = z11.object({
|
|
|
474
480
|
var isTransactionFeesBigInt = zodIsFactory(TransactionFeesBigIntZod);
|
|
475
481
|
var asTransactionFeesBigInt = zodAsFactory4(TransactionFeesBigIntZod, "asTransactionFeesBigInt");
|
|
476
482
|
var toTransactionFeesBigInt = zodToFactory4(TransactionFeesBigIntZod, "toTransactionFeesBigInt");
|
|
477
|
-
var TransactionFeesJsonToBigIntZod =
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
483
|
+
var TransactionFeesJsonToBigIntZod = z13.pipe(
|
|
484
|
+
TransactionFeesHexZod,
|
|
485
|
+
z13.transform((val) => ({
|
|
486
|
+
base: JsonToBigIntZod.parse(val.base),
|
|
487
|
+
gasLimit: JsonToBigIntZod.parse(val.gasLimit),
|
|
488
|
+
gasPrice: JsonToBigIntZod.parse(val.gasPrice),
|
|
489
|
+
priority: JsonToBigIntZod.parse(val.priority)
|
|
490
|
+
}))
|
|
491
|
+
);
|
|
492
|
+
var TransactionFeesBigIntToJsonZod = z13.pipe(
|
|
493
|
+
TransactionFeesBigIntZod,
|
|
494
|
+
z13.transform((val) => ({
|
|
495
|
+
base: BigIntToJsonZod.parse(val.base),
|
|
496
|
+
gasLimit: BigIntToJsonZod.parse(val.gasLimit),
|
|
497
|
+
gasPrice: BigIntToJsonZod.parse(val.gasPrice),
|
|
498
|
+
priority: BigIntToJsonZod.parse(val.priority)
|
|
499
|
+
}))
|
|
500
|
+
);
|
|
489
501
|
|
|
490
502
|
// src/transaction/TransactionBoundWitness.ts
|
|
491
|
-
var BlockStartZod =
|
|
492
|
-
var BlockEndZod =
|
|
493
|
-
var BlockDurationZod =
|
|
494
|
-
var BlockScriptsZod =
|
|
495
|
-
var TransactionFeesZod =
|
|
496
|
-
var TransactionBoundWitnessIdentityFields =
|
|
497
|
-
var TransactionBoundWitnessFieldsZod =
|
|
498
|
-
|
|
503
|
+
var BlockStartZod = z14.object({ nbf: XL1BlockNumberZod });
|
|
504
|
+
var BlockEndZod = z14.object({ exp: XL1BlockNumberZod });
|
|
505
|
+
var BlockDurationZod = z14.object({ nbf: XL1BlockNumberZod, exp: XL1BlockNumberZod });
|
|
506
|
+
var BlockScriptsZod = z14.object({ script: z14.optional(z14.array(z14.string())) });
|
|
507
|
+
var TransactionFeesZod = z14.object({ fees: TransactionFeesHexZod });
|
|
508
|
+
var TransactionBoundWitnessIdentityFields = z14.object({ chain: ChainZod, from: AddressZod });
|
|
509
|
+
var TransactionBoundWitnessFieldsZod = z14.safeExtend(
|
|
510
|
+
z14.safeExtend(
|
|
511
|
+
z14.safeExtend(
|
|
512
|
+
z14.safeExtend(z14.object(), BlockDurationZod.shape),
|
|
513
|
+
TransactionFeesZod.shape
|
|
514
|
+
),
|
|
515
|
+
TransactionBoundWitnessIdentityFields.shape
|
|
516
|
+
),
|
|
517
|
+
BlockScriptsZod.shape
|
|
518
|
+
);
|
|
519
|
+
var TransactionBoundWitnessZod = z14.safeExtend(BoundWitnessZod, TransactionBoundWitnessFieldsZod.shape);
|
|
499
520
|
var isTransactionBoundWitness = zodIsFactory2(TransactionBoundWitnessZod);
|
|
500
521
|
var asTransactionBoundWitness = zodAsFactory5(TransactionBoundWitnessZod, "asTransactionBoundWitness");
|
|
501
522
|
var toTransactionBoundWitness = zodToFactory5(TransactionBoundWitnessZod, "toTransactionBoundWitness");
|
|
502
|
-
var TransactionBoundWitnessWithHashMetaZod =
|
|
523
|
+
var TransactionBoundWitnessWithHashMetaZod = z14.safeExtend(TransactionBoundWitnessZod, HashMetaZod.shape);
|
|
503
524
|
var isTransactionBoundWitnessWithHashMeta = zodIsFactory2(TransactionBoundWitnessWithHashMetaZod);
|
|
504
525
|
var asTransactionBoundWitnessWithHashMeta = zodAsFactory5(TransactionBoundWitnessWithHashMetaZod, "asTransactionBoundWitnessWithHashMeta");
|
|
505
526
|
var toTransactionBoundWitnessWithHashMeta = zodToFactory5(TransactionBoundWitnessWithHashMetaZod, "toTransactionBoundWitnessWithHashMeta");
|
|
506
|
-
var TransactionBoundWitnessWithStorageMetaZod =
|
|
527
|
+
var TransactionBoundWitnessWithStorageMetaZod = z14.safeExtend(TransactionBoundWitnessZod, StorageMetaZod.shape);
|
|
507
528
|
var isTransactionBoundWitnessWithStorageMeta = zodIsFactory2(TransactionBoundWitnessWithStorageMetaZod);
|
|
508
529
|
var asTransactionBoundWitnessWithStorageMeta = zodAsFactory5(TransactionBoundWitnessWithStorageMetaZod, "asTransactionBoundWitnessWithStorageMeta");
|
|
509
530
|
var toTransactionBoundWitnessWithStorageMeta = zodToFactory5(TransactionBoundWitnessWithStorageMetaZod, "toTransactionBoundWitnessWithStorageMeta");
|
|
510
|
-
var UnsignedTransactionBoundWitnessZod =
|
|
531
|
+
var UnsignedTransactionBoundWitnessZod = z14.safeExtend(UnsignedBoundWitnessZod, TransactionBoundWitnessFieldsZod.shape);
|
|
511
532
|
var isUnsignedTransactionBoundWitness = zodIsFactory2(UnsignedTransactionBoundWitnessZod);
|
|
512
533
|
var asUnsignedTransactionBoundWitness = zodAsFactory5(UnsignedTransactionBoundWitnessZod, "asUnsignedTransactionBoundWitness");
|
|
513
534
|
var toUnsignedTransactionBoundWitness = zodToFactory5(UnsignedTransactionBoundWitnessZod, "toUnsignedTransactionBoundWitness");
|
|
514
|
-
var UnsignedTransactionBoundWitnessWithHashMetaZod =
|
|
535
|
+
var UnsignedTransactionBoundWitnessWithHashMetaZod = z14.safeExtend(UnsignedTransactionBoundWitnessZod, HashMetaZod.shape);
|
|
515
536
|
var isUnsignedTransactionBoundWitnessWithHashMeta = zodIsFactory2(UnsignedTransactionBoundWitnessWithHashMetaZod);
|
|
516
537
|
var asUnsignedTransactionBoundWitnessWithHashMeta = zodAsFactory5(
|
|
517
538
|
UnsignedTransactionBoundWitnessWithHashMetaZod,
|
|
@@ -521,7 +542,7 @@ var toUnsignedTransactionBoundWitnessWithHashMeta = zodToFactory5(
|
|
|
521
542
|
UnsignedTransactionBoundWitnessWithHashMetaZod,
|
|
522
543
|
"toUnsignedTransactionBoundWitnessWithHashMeta"
|
|
523
544
|
);
|
|
524
|
-
var UnsignedTransactionBoundWitnessWithStorageMetaZod =
|
|
545
|
+
var UnsignedTransactionBoundWitnessWithStorageMetaZod = z14.safeExtend(UnsignedTransactionBoundWitnessZod, StorageMetaZod.shape);
|
|
525
546
|
var isUnsignedTransactionBoundWitnessWithStorageMeta = zodIsFactory2(UnsignedTransactionBoundWitnessWithStorageMetaZod);
|
|
526
547
|
var asUnsignedTransactionBoundWitnessWithStorageMeta = zodAsFactory5(
|
|
527
548
|
UnsignedTransactionBoundWitnessWithStorageMetaZod,
|
|
@@ -531,7 +552,7 @@ var toUnsignedTransactionBoundWitnessWithStorageMeta = zodToFactory5(
|
|
|
531
552
|
UnsignedTransactionBoundWitnessWithStorageMetaZod,
|
|
532
553
|
"toUnsignedTransactionBoundWitnessWithStorageMeta"
|
|
533
554
|
);
|
|
534
|
-
var SignedTransactionBoundWitnessZod =
|
|
555
|
+
var SignedTransactionBoundWitnessZod = z14.safeExtend(SignedBoundWitnessZod, TransactionBoundWitnessFieldsZod.shape);
|
|
535
556
|
var isSignedTransactionBoundWitness = zodIsFactory2(SignedTransactionBoundWitnessZod);
|
|
536
557
|
var asSignedTransactionBoundWitness = zodAsFactory5(SignedTransactionBoundWitnessZod, "asSignedTransactionBoundWitness");
|
|
537
558
|
var toSignedTransactionBoundWitness = zodToFactory5(SignedTransactionBoundWitnessZod, "toSignedTransactionBoundWitness");
|
|
@@ -585,17 +606,17 @@ import {
|
|
|
585
606
|
isPayloadOfSchemaType as isPayloadOfSchemaType5,
|
|
586
607
|
PayloadZodOfSchema as PayloadZodOfSchema2
|
|
587
608
|
} from "@xyo-network/sdk-js";
|
|
588
|
-
import { z as
|
|
609
|
+
import { z as z15 } from "zod/mini";
|
|
589
610
|
var TransferSchema = asSchema9("network.xyo.transfer", true);
|
|
590
|
-
var TransferFieldsZod =
|
|
611
|
+
var TransferFieldsZod = z15.object({
|
|
591
612
|
// Removed as only transaction have opCodes
|
|
592
613
|
// $opCodes: z.array(z.string()).optional(),
|
|
593
|
-
context:
|
|
594
|
-
epoch:
|
|
614
|
+
context: z15.optional(JsonObjectZod),
|
|
615
|
+
epoch: z15.number(),
|
|
595
616
|
from: AddressZod2,
|
|
596
|
-
transfers:
|
|
617
|
+
transfers: z15.record(AddressZod2, HexZod5)
|
|
597
618
|
});
|
|
598
|
-
var TransferZod = PayloadZodOfSchema2(TransferSchema)
|
|
619
|
+
var TransferZod = z15.extend(PayloadZodOfSchema2(TransferSchema), TransferFieldsZod.shape);
|
|
599
620
|
var isTransfer = isPayloadOfSchemaType5(TransferSchema);
|
|
600
621
|
var asTransfer = AsObjectFactory9.create(isTransfer);
|
|
601
622
|
|
|
@@ -612,7 +633,7 @@ var AllowedBlockPayloadSchemas = [
|
|
|
612
633
|
TimeSchema,
|
|
613
634
|
TransferSchema
|
|
614
635
|
];
|
|
615
|
-
var AllowedBlockPayloadSchemaZod =
|
|
636
|
+
var AllowedBlockPayloadSchemaZod = z16.enum(AllowedBlockPayloadSchemas);
|
|
616
637
|
var isAllowedBlockPayloadSchema = zodIsFactory3(AllowedBlockPayloadSchemaZod);
|
|
617
638
|
var isAllowedBlockPayload = (value) => {
|
|
618
639
|
return isTransfer(value) || isBridgeDestinationObservation(value) || isBridgeIntent(value) || isBridgeSourceObservation(value) || isChainStakeIntent(value) || isHashPayload(value) || isSchemaPayload(value) || isTimePayload(value) || isTransactionBoundWitness(value);
|
|
@@ -633,16 +654,16 @@ import {
|
|
|
633
654
|
WithHashMetaZod as WithHashMetaZod2,
|
|
634
655
|
WithStorageMetaZod as WithStorageMetaZod2
|
|
635
656
|
} from "@xyo-network/sdk-js";
|
|
636
|
-
import { z as
|
|
637
|
-
var BlockBoundWitnessFieldsZod =
|
|
657
|
+
import { z as z17 } from "zod/mini";
|
|
658
|
+
var BlockBoundWitnessFieldsZod = z17.object({
|
|
638
659
|
block: XL1BlockNumberZod,
|
|
639
660
|
chain: ChainZod,
|
|
640
|
-
previous:
|
|
641
|
-
protocol:
|
|
642
|
-
step_hashes:
|
|
661
|
+
previous: z17.nullable(HashZod2),
|
|
662
|
+
protocol: z17.optional(z17.number()),
|
|
663
|
+
step_hashes: z17.optional(z17.array(HashZod2))
|
|
643
664
|
});
|
|
644
|
-
var BlockBoundWitnessMetaZod =
|
|
645
|
-
var BlockBoundWitnessZod =
|
|
665
|
+
var BlockBoundWitnessMetaZod = z17.object({ $epoch: z17.number() });
|
|
666
|
+
var BlockBoundWitnessZod = z17.object({
|
|
646
667
|
...BoundWitnessZod2.shape,
|
|
647
668
|
...BlockBoundWitnessFieldsZod.shape,
|
|
648
669
|
...BlockBoundWitnessMetaZod.shape
|
|
@@ -671,7 +692,7 @@ import {
|
|
|
671
692
|
WithHashMetaZod as WithHashMetaZod4,
|
|
672
693
|
WithStorageMetaZod as WithStorageMetaZod4
|
|
673
694
|
} from "@xyo-network/sdk-js";
|
|
674
|
-
import { z as
|
|
695
|
+
import { z as z21 } from "zod/mini";
|
|
675
696
|
|
|
676
697
|
// src/block/signed/SignedBlockBoundWitness.ts
|
|
677
698
|
import {
|
|
@@ -680,7 +701,11 @@ import {
|
|
|
680
701
|
zodToFactory as zodToFactory7
|
|
681
702
|
} from "@xylabs/sdk-js";
|
|
682
703
|
import { SignedBoundWitnessZod as SignedBoundWitnessZod2 } from "@xyo-network/sdk-js";
|
|
683
|
-
|
|
704
|
+
import { z as z18 } from "zod/mini";
|
|
705
|
+
var SignedBlockBoundWitnessZod = z18.safeExtend(
|
|
706
|
+
z18.safeExtend(SignedBoundWitnessZod2, BlockBoundWitnessFieldsZod.shape),
|
|
707
|
+
BlockBoundWitnessMetaZod.shape
|
|
708
|
+
);
|
|
684
709
|
var isSignedBlockBoundWitness = zodIsFactory5(SignedBlockBoundWitnessZod);
|
|
685
710
|
var asSignedBlockBoundWitness = zodAsFactory7(SignedBlockBoundWitnessZod, "asSignedBlockBoundWitness");
|
|
686
711
|
var toSignedBlockBoundWitness = zodToFactory7(SignedBlockBoundWitnessZod, "toSignedBlockBoundWitness");
|
|
@@ -692,18 +717,22 @@ import {
|
|
|
692
717
|
zodToFactory as zodToFactory8
|
|
693
718
|
} from "@xylabs/sdk-js";
|
|
694
719
|
import { PayloadBuilder, WithHashMetaZod as WithHashMetaZod3 } from "@xyo-network/sdk-js";
|
|
720
|
+
import { z as z19 } from "zod/mini";
|
|
695
721
|
var SignedBlockBoundWitnessWithHashMetaZod = WithHashMetaZod3(SignedBlockBoundWitnessZod);
|
|
696
722
|
var isSignedBlockBoundWitnessWithHashMeta = zodIsFactory6(SignedBlockBoundWitnessWithHashMetaZod);
|
|
697
723
|
var asSignedBlockBoundWitnessWithHashMeta = zodAsFactory8(SignedBlockBoundWitnessWithHashMetaZod, "asSignedBlockBoundWitnessWithHashMeta");
|
|
698
|
-
var SignedBlockBoundWitnessWithHashMetaishZod =
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
}
|
|
724
|
+
var SignedBlockBoundWitnessWithHashMetaishZod = z19.pipe(
|
|
725
|
+
SignedBlockBoundWitnessZod,
|
|
726
|
+
z19.transform(async (data) => {
|
|
727
|
+
if (isSignedBlockBoundWitnessWithHashMeta(data)) {
|
|
728
|
+
return data;
|
|
729
|
+
}
|
|
730
|
+
if (isSignedBlockBoundWitness(data)) {
|
|
731
|
+
return await PayloadBuilder.addHashMeta(data);
|
|
732
|
+
}
|
|
733
|
+
throw new Error("Invalid SignedBlockBoundWitnessWithHashMetaish format");
|
|
734
|
+
})
|
|
735
|
+
);
|
|
707
736
|
var toSignedBlockBoundWitnessWithHashMeta = zodToFactory8(SignedBlockBoundWitnessWithHashMetaZod, "toSignedBlockBoundWitnessWithHashMeta");
|
|
708
737
|
|
|
709
738
|
// src/block/signed/SignedBlockBoundWitnessWithStorageMeta.ts
|
|
@@ -713,83 +742,87 @@ import {
|
|
|
713
742
|
zodToFactory as zodToFactory9
|
|
714
743
|
} from "@xylabs/sdk-js";
|
|
715
744
|
import { PayloadBuilder as PayloadBuilder2, WithStorageMetaZod as WithStorageMetaZod3 } from "@xyo-network/sdk-js";
|
|
745
|
+
import { z as z20 } from "zod/mini";
|
|
716
746
|
var SignedBlockBoundWitnessWithStorageMetaZod = WithStorageMetaZod3(SignedBlockBoundWitnessZod);
|
|
717
747
|
var isSignedBlockBoundWitnessWithStorageMeta = zodIsFactory7(SignedBlockBoundWitnessWithStorageMetaZod);
|
|
718
748
|
var asSignedBlockBoundWitnessWithStorageMeta = zodAsFactory9(
|
|
719
749
|
SignedBlockBoundWitnessWithStorageMetaZod,
|
|
720
750
|
"asSignedBlockBoundWitnessWithStorageMeta"
|
|
721
751
|
);
|
|
722
|
-
var SignedBlockBoundWitnessWithStorageMetaishZod =
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
}
|
|
752
|
+
var SignedBlockBoundWitnessWithStorageMetaishZod = z20.pipe(
|
|
753
|
+
SignedBlockBoundWitnessZod,
|
|
754
|
+
z20.transform(async (data) => {
|
|
755
|
+
if (isSignedBlockBoundWitnessWithStorageMeta(data)) {
|
|
756
|
+
return data;
|
|
757
|
+
}
|
|
758
|
+
if (isSignedBlockBoundWitness(data)) {
|
|
759
|
+
return await PayloadBuilder2.addStorageMeta(data);
|
|
760
|
+
}
|
|
761
|
+
throw new Error("Invalid SignedBlockBoundWitnessWithStorageMetaish format");
|
|
762
|
+
})
|
|
763
|
+
);
|
|
731
764
|
var toSignedBlockBoundWitnessWithStorageMeta = zodToFactory9(
|
|
732
765
|
SignedBlockBoundWitnessWithStorageMetaishZod,
|
|
733
766
|
"toSignedBlockBoundWitnessWithStorageMeta"
|
|
734
767
|
);
|
|
735
768
|
|
|
736
769
|
// src/block/HydratedBlock.ts
|
|
737
|
-
var HydratedBlockZod =
|
|
770
|
+
var HydratedBlockZod = z21.tuple([
|
|
738
771
|
BlockBoundWitnessZod,
|
|
739
|
-
|
|
772
|
+
z21.array(PayloadZodLoose)
|
|
740
773
|
]);
|
|
741
774
|
var isHydratedBlock = zodIsFactory8(HydratedBlockZod);
|
|
742
775
|
var asHydratedBlock = zodAsFactory10(HydratedBlockZod, "asHydratedBlock");
|
|
743
776
|
var toHydratedBlock = zodToFactory10(HydratedBlockZod, "toHydratedBlock");
|
|
744
|
-
var HydratedBlockWithHashMetaZod =
|
|
777
|
+
var HydratedBlockWithHashMetaZod = z21.tuple([
|
|
745
778
|
WithHashMetaZod4(BlockBoundWitnessZod),
|
|
746
|
-
|
|
779
|
+
z21.array(z21.looseObject(WithHashMetaZod4(PayloadZod).shape))
|
|
747
780
|
]);
|
|
748
781
|
var isHydratedBlockWithHashMeta = zodIsFactory8(HydratedBlockWithHashMetaZod);
|
|
749
782
|
var asHydratedBlockWithHashMeta = zodAsFactory10(HydratedBlockWithHashMetaZod, "asHydratedBlockWithHashMeta");
|
|
750
783
|
var toHydratedBlockWithHashMeta = zodToFactory10(HydratedBlockWithHashMetaZod, "toHydratedBlockWithHashMeta");
|
|
751
|
-
var HydratedBlockWithStorageMetaZod =
|
|
784
|
+
var HydratedBlockWithStorageMetaZod = z21.tuple([
|
|
752
785
|
WithStorageMetaZod4(BlockBoundWitnessZod),
|
|
753
|
-
|
|
786
|
+
z21.array(z21.looseObject(WithStorageMetaZod4(PayloadZod).shape))
|
|
754
787
|
]);
|
|
755
788
|
var isHydratedBlockWithStorageMeta = zodIsFactory8(HydratedBlockWithStorageMetaZod);
|
|
756
789
|
var asHydratedBlockWithStorageMeta = zodAsFactory10(HydratedBlockWithStorageMetaZod, "asHydratedBlockWithStorageMeta");
|
|
757
790
|
var toHydratedBlockWithStorageMeta = zodToFactory10(HydratedBlockWithStorageMetaZod, "toHydratedBlockWithStorageMeta");
|
|
758
|
-
var SignedHydratedBlockZod =
|
|
791
|
+
var SignedHydratedBlockZod = z21.tuple([
|
|
759
792
|
SignedBlockBoundWitnessZod,
|
|
760
|
-
|
|
793
|
+
z21.array(z21.looseObject(PayloadZod.shape))
|
|
761
794
|
]);
|
|
762
795
|
var isSignedHydratedBlock = zodIsFactory8(SignedHydratedBlockZod);
|
|
763
796
|
var asSignedHydratedBlock = zodAsFactory10(SignedHydratedBlockZod, "asSignedHydratedBlock");
|
|
764
797
|
var toSignedHydratedBlock = zodToFactory10(SignedHydratedBlockZod, "toSignedHydratedBlock");
|
|
765
|
-
var SignedHydratedBlockToJsonZod =
|
|
798
|
+
var SignedHydratedBlockToJsonZod = z21.tuple([
|
|
766
799
|
SignedBlockBoundWitnessZod,
|
|
767
|
-
|
|
800
|
+
z21.array(z21.looseObject(PayloadZod.shape))
|
|
768
801
|
]);
|
|
769
802
|
var isSignedHydratedBlockToJson = zodIsFactory8(SignedHydratedBlockToJsonZod);
|
|
770
803
|
var asSignedHydratedBlockToJson = zodAsFactory10(SignedHydratedBlockToJsonZod, "asSignedHydratedBlockToJson");
|
|
771
804
|
var toSignedHydratedBlockToJson = zodToFactory10(SignedHydratedBlockToJsonZod, "toSignedHydratedBlockToJson");
|
|
772
|
-
var SignedHydratedBlockWithHashMetaZod =
|
|
805
|
+
var SignedHydratedBlockWithHashMetaZod = z21.tuple([
|
|
773
806
|
WithHashMetaZod4(SignedBlockBoundWitnessZod),
|
|
774
|
-
|
|
807
|
+
z21.array(z21.looseObject(WithHashMetaZod4(PayloadZod).shape))
|
|
775
808
|
]);
|
|
776
|
-
var SignedHydratedBlockWithHashMetaishZod =
|
|
777
|
-
|
|
778
|
-
|
|
809
|
+
var SignedHydratedBlockWithHashMetaishZod = z21.tuple([
|
|
810
|
+
z21.union([WithHashMetaZod4(SignedBlockBoundWitnessZod)]),
|
|
811
|
+
z21.array(z21.looseObject(WithHashMetaZod4(PayloadZod).shape))
|
|
779
812
|
]);
|
|
780
813
|
var isSignedHydratedBlockWithHashMeta = zodIsFactory8(SignedHydratedBlockWithHashMetaZod);
|
|
781
814
|
var asSignedHydratedBlockWithHashMeta = zodAsFactory10(SignedHydratedBlockWithHashMetaZod, "asSignedHydratedBlockWithHashMeta");
|
|
782
815
|
var toSignedHydratedBlockWithHashMeta = zodToFactory10(SignedHydratedBlockWithHashMetaZod, "toSignedHydratedBlockWithHashMeta");
|
|
783
|
-
var SignedHydratedBlockWithStorageMetaZod =
|
|
816
|
+
var SignedHydratedBlockWithStorageMetaZod = z21.tuple([
|
|
784
817
|
WithStorageMetaZod4(SignedBlockBoundWitnessZod),
|
|
785
|
-
|
|
818
|
+
z21.array(z21.looseObject(WithStorageMetaZod4(PayloadZod).shape))
|
|
786
819
|
]);
|
|
787
820
|
var isSignedHydratedBlockWithStorageMeta = zodIsFactory8(SignedHydratedBlockWithStorageMetaZod);
|
|
788
821
|
var asSignedHydratedBlockWithStorageMeta = zodAsFactory10(SignedHydratedBlockWithStorageMetaZod, "asSignedHydratedBlockWithStorageMeta");
|
|
789
822
|
var toSignedHydratedBlockWithStorageMeta = zodToFactory10(SignedHydratedBlockWithStorageMetaZod, "toSignedHydratedBlockWithStorageMeta");
|
|
790
|
-
var SignedHydratedBlockWithStorageMetaishZod =
|
|
791
|
-
|
|
792
|
-
|
|
823
|
+
var SignedHydratedBlockWithStorageMetaishZod = z21.tuple([
|
|
824
|
+
z21.union([WithStorageMetaZod4(SignedBlockBoundWitnessZod)]),
|
|
825
|
+
z21.array(z21.looseObject(WithStorageMetaZod4(PayloadZod).shape))
|
|
793
826
|
]);
|
|
794
827
|
|
|
795
828
|
// src/block/unsigned/UnsignedBlockBoundWitness.ts
|
|
@@ -799,7 +832,11 @@ import {
|
|
|
799
832
|
zodToFactory as zodToFactory11
|
|
800
833
|
} from "@xylabs/sdk-js";
|
|
801
834
|
import { UnsignedBoundWitnessZod as UnsignedBoundWitnessZod2 } from "@xyo-network/sdk-js";
|
|
802
|
-
|
|
835
|
+
import { z as z22 } from "zod/mini";
|
|
836
|
+
var UnsignedBlockBoundWitnessZod = z22.safeExtend(
|
|
837
|
+
z22.safeExtend(UnsignedBoundWitnessZod2, BlockBoundWitnessFieldsZod.shape),
|
|
838
|
+
BlockBoundWitnessMetaZod.shape
|
|
839
|
+
);
|
|
803
840
|
var isUnsignedBlockBoundWitness = zodIsFactory9(UnsignedBlockBoundWitnessZod);
|
|
804
841
|
var asUnsignedBlockBoundWitness = zodAsFactory11(UnsignedBlockBoundWitnessZod, "asUnsignedBlockBoundWitness");
|
|
805
842
|
var toUnsignedBlockBoundWitness = zodToFactory11(UnsignedBlockBoundWitnessZod, "toUnsignedBlockBoundWitness");
|
|
@@ -820,11 +857,11 @@ var asBlockNumberPayloadWithSources = AsObjectFactory10.create(isBlockNumberPayl
|
|
|
820
857
|
// src/model/AccountBalance.ts
|
|
821
858
|
import { zodIsFactory as zodIsFactory12 } from "@xylabs/sdk-js";
|
|
822
859
|
import { WithHashMetaZod as WithHashMetaZod5 } from "@xyo-network/sdk-js";
|
|
823
|
-
import { z as
|
|
860
|
+
import { z as z28 } from "zod/mini";
|
|
824
861
|
|
|
825
862
|
// src/model/ChainQualification.ts
|
|
826
863
|
import { HashZod as HashZod3, zodIsFactory as zodIsFactory11 } from "@xylabs/sdk-js";
|
|
827
|
-
import { z as
|
|
864
|
+
import { z as z27 } from "zod";
|
|
828
865
|
|
|
829
866
|
// src/model/BlockRange/BlockRange.ts
|
|
830
867
|
import {
|
|
@@ -833,9 +870,9 @@ import {
|
|
|
833
870
|
zodAsFactory as zodAsFactory12,
|
|
834
871
|
zodToFactory as zodToFactory12
|
|
835
872
|
} from "@xylabs/sdk-js";
|
|
836
|
-
import { z as
|
|
837
|
-
var BlockRangeZod =
|
|
838
|
-
var BlockRangeishZod =
|
|
873
|
+
import { z as z23 } from "zod";
|
|
874
|
+
var BlockRangeZod = z23.tuple([BlockNumberZod, BlockNumberZod]);
|
|
875
|
+
var BlockRangeishZod = z23.tuple([BlockNumberishZod, BlockNumberishZod]);
|
|
839
876
|
var asBlockRange = zodAsFactory12(BlockRangeZod, "BlockRange");
|
|
840
877
|
var toBlockRange = zodToFactory12(BlockRangeishZod, "BlockRange");
|
|
841
878
|
var toBlockNumberKey = (range) => `${range[0]}|${range[1]}`;
|
|
@@ -852,9 +889,9 @@ import {
|
|
|
852
889
|
zodAsFactory as zodAsFactory13,
|
|
853
890
|
zodToFactory as zodToFactory13
|
|
854
891
|
} from "@xylabs/sdk-js";
|
|
855
|
-
import { z as
|
|
856
|
-
var EthBlockRangeZod =
|
|
857
|
-
var EthBlockRangeishZod =
|
|
892
|
+
import { z as z24 } from "zod";
|
|
893
|
+
var EthBlockRangeZod = z24.tuple([EthBlockNumberZod, EthBlockNumberZod]);
|
|
894
|
+
var EthBlockRangeishZod = z24.tuple([EthBlockNumberishZod, EthBlockNumberishZod]);
|
|
858
895
|
var asEthBlockRange = zodAsFactory13(EthBlockRangeZod, "EthBlockRange");
|
|
859
896
|
var toEthBlockRange = zodToFactory13(EthBlockRangeishZod, "EthBlockRange");
|
|
860
897
|
var toEthBlockNumberKey = (range) => `${range[0]}|${range[1]}`;
|
|
@@ -870,8 +907,8 @@ import {
|
|
|
870
907
|
zodIsFactory as zodIsFactory10,
|
|
871
908
|
zodToFactory as zodToFactory14
|
|
872
909
|
} from "@xylabs/sdk-js";
|
|
873
|
-
import { z as
|
|
874
|
-
var RangeZod =
|
|
910
|
+
import { z as z25 } from "zod";
|
|
911
|
+
var RangeZod = z25.tuple([z25.number(), z25.number()]);
|
|
875
912
|
var isRange = zodIsFactory10(RangeZod);
|
|
876
913
|
var asRange = zodAsFactory14(RangeZod, "Range");
|
|
877
914
|
var toRange = zodToFactory14(RangeZod, "Range");
|
|
@@ -883,9 +920,9 @@ import {
|
|
|
883
920
|
zodAsFactory as zodAsFactory15,
|
|
884
921
|
zodToFactory as zodToFactory15
|
|
885
922
|
} from "@xylabs/sdk-js";
|
|
886
|
-
import { z as
|
|
887
|
-
var XL1BlockRangeZod =
|
|
888
|
-
var XL1BlockRangeishZod =
|
|
923
|
+
import { z as z26 } from "zod";
|
|
924
|
+
var XL1BlockRangeZod = z26.tuple([XL1BlockNumberZod, XL1BlockNumberZod]);
|
|
925
|
+
var XL1BlockRangeishZod = z26.tuple([XL1BlockNumberishZod, XL1BlockNumberishZod]);
|
|
889
926
|
var asXL1BlockRange = zodAsFactory15(XL1BlockRangeZod, "XL1BlockRange");
|
|
890
927
|
var toXL1BlockRange = zodToFactory15(XL1BlockRangeishZod, "XL1BlockRange");
|
|
891
928
|
var toXL1BlockNumberKey = (range) => `${range[0]}|${range[1]}`;
|
|
@@ -896,29 +933,29 @@ function fromXL1BlockNumberKey(key, assert) {
|
|
|
896
933
|
}
|
|
897
934
|
|
|
898
935
|
// src/model/ChainQualification.ts
|
|
899
|
-
var ChainQualificationZod =
|
|
936
|
+
var ChainQualificationZod = z27.object({ head: HashZod3, range: XL1BlockRangeZod });
|
|
900
937
|
var isChainQualification = zodIsFactory11(ChainQualificationZod);
|
|
901
|
-
var ChainQualifiedRangeConfigZod =
|
|
938
|
+
var ChainQualifiedRangeConfigZod = z27.object({ range: XL1BlockRangeZod });
|
|
902
939
|
var isChainQualifiedRangeConfig = zodIsFactory11(ChainQualifiedRangeConfigZod);
|
|
903
|
-
var ChainQualifiedHeadConfigZod =
|
|
940
|
+
var ChainQualifiedHeadConfigZod = z27.object({ head: HashZod3 });
|
|
904
941
|
var isChainQualifiedHeadConfig = zodIsFactory11(ChainQualifiedHeadConfigZod);
|
|
905
|
-
var ChainQualifiedConfigZod =
|
|
942
|
+
var ChainQualifiedConfigZod = z27.union([ChainQualifiedRangeConfigZod, ChainQualifiedHeadConfigZod, z27.object({})]);
|
|
906
943
|
var isChainQualifiedConfig = zodIsFactory11(ChainQualifiedConfigZod);
|
|
907
944
|
var ExtendChainQualifiedConfigZod = ((zodType) => {
|
|
908
|
-
return
|
|
945
|
+
return z27.union([
|
|
909
946
|
ChainQualifiedRangeConfigZod.extend(zodType),
|
|
910
947
|
ChainQualifiedHeadConfigZod.extend(zodType),
|
|
911
948
|
zodType
|
|
912
949
|
]);
|
|
913
950
|
});
|
|
914
951
|
var ChainQualifiedZod = (zodType) => {
|
|
915
|
-
return
|
|
952
|
+
return z27.tuple([zodType, ChainQualificationZod]);
|
|
916
953
|
};
|
|
917
954
|
|
|
918
955
|
// src/model/AccountBalance.ts
|
|
919
|
-
var AccountBalanceHistoryItemZod =
|
|
956
|
+
var AccountBalanceHistoryItemZod = z28.tuple([
|
|
920
957
|
WithHashMetaZod5(BlockBoundWitnessZod),
|
|
921
|
-
WithHashMetaZod5(TransactionBoundWitnessZod)
|
|
958
|
+
z28.nullable(WithHashMetaZod5(TransactionBoundWitnessZod)),
|
|
922
959
|
WithHashMetaZod5(TransferZod)
|
|
923
960
|
]);
|
|
924
961
|
var AccountBalanceQualificationZod = ChainQualificationZod;
|
|
@@ -939,7 +976,7 @@ var XL1_ETH_MAIN_STAKED_XYO_CHAIN_ADDRESS = "0x319e667cED10452A117472811130444dE
|
|
|
939
976
|
var XL1_ETH_MAIN_GOVERNANCE_ADDRESS = "0x7595710956d6B14b4f2F51a8dF41379eEeC9074E";
|
|
940
977
|
|
|
941
978
|
// src/model/ArrayBuffer.ts
|
|
942
|
-
import { z as
|
|
979
|
+
import { z as z29 } from "zod";
|
|
943
980
|
function base64Encode(u8) {
|
|
944
981
|
if (typeof Buffer !== "undefined" && typeof Buffer.from === "function") {
|
|
945
982
|
return Buffer.from(u8).toString("base64");
|
|
@@ -960,44 +997,44 @@ function base64Decode(b64) {
|
|
|
960
997
|
for (let i = 0; i < binary.length; i++) u8[i] = binary.charCodeAt(i);
|
|
961
998
|
return u8;
|
|
962
999
|
}
|
|
963
|
-
var ArrayBufferToJsonZod =
|
|
1000
|
+
var ArrayBufferToJsonZod = z29.instanceof(ArrayBuffer).transform((x) => {
|
|
964
1001
|
const u8 = new Uint8Array(x);
|
|
965
1002
|
return base64Encode(u8);
|
|
966
1003
|
});
|
|
967
|
-
var JsonToArrayBufferZod =
|
|
1004
|
+
var JsonToArrayBufferZod = z29.string().transform((x) => {
|
|
968
1005
|
const u8 = base64Decode(x);
|
|
969
1006
|
return u8.buffer;
|
|
970
1007
|
});
|
|
971
1008
|
|
|
972
1009
|
// src/model/BlockRate.ts
|
|
973
1010
|
import { zodAsFactory as zodAsFactory16, zodIsFactory as zodIsFactory13 } from "@xylabs/sdk-js";
|
|
974
|
-
import { z as
|
|
975
|
-
var TimeDurationsZod =
|
|
976
|
-
millis:
|
|
977
|
-
seconds:
|
|
978
|
-
minutes:
|
|
979
|
-
hours:
|
|
980
|
-
days:
|
|
981
|
-
weeks:
|
|
1011
|
+
import { z as z30 } from "zod";
|
|
1012
|
+
var TimeDurationsZod = z30.object({
|
|
1013
|
+
millis: z30.number().nonnegative(),
|
|
1014
|
+
seconds: z30.number().nonnegative(),
|
|
1015
|
+
minutes: z30.number().nonnegative(),
|
|
1016
|
+
hours: z30.number().nonnegative(),
|
|
1017
|
+
days: z30.number().nonnegative(),
|
|
1018
|
+
weeks: z30.number().nonnegative()
|
|
982
1019
|
});
|
|
983
1020
|
var isTimeDurations = zodIsFactory13(TimeDurationsZod);
|
|
984
1021
|
var asTimeDurations = zodAsFactory16(TimeDurationsZod, "asTimeDurations");
|
|
985
1022
|
var toTimeDurations = zodAsFactory16(TimeDurationsZod, "toTimeDurations");
|
|
986
|
-
var BlockRateZod =
|
|
1023
|
+
var BlockRateZod = z30.object({
|
|
987
1024
|
range: XL1BlockRangeZod.describe("the block range the rate was calculated over"),
|
|
988
|
-
rate:
|
|
1025
|
+
rate: z30.number().nonnegative().describe("rate of blocks per specified time unit"),
|
|
989
1026
|
timeUnit: TimeDurationsZod.keyof().describe("the unit of time for the rate and timePerBlock"),
|
|
990
|
-
span:
|
|
991
|
-
timeDifference:
|
|
992
|
-
timePerBlock:
|
|
1027
|
+
span: z30.int().nonnegative().describe("number of blocks the rate was calculated over"),
|
|
1028
|
+
timeDifference: z30.number().nonnegative().describe("time difference from start and end block"),
|
|
1029
|
+
timePerBlock: z30.number().nonnegative().describe("average time per block for the given range")
|
|
993
1030
|
});
|
|
994
1031
|
var isBlockRate = zodIsFactory13(BlockRateZod);
|
|
995
1032
|
var asBlockRate = zodAsFactory16(BlockRateZod, "asBlockRate");
|
|
996
1033
|
var toBlockRate = zodAsFactory16(BlockRateZod, "toBlockRate");
|
|
997
|
-
var CountZod =
|
|
998
|
-
var StepIndexZod =
|
|
999
|
-
var timeUnitSchema =
|
|
1000
|
-
var TimeConfigZod =
|
|
1034
|
+
var CountZod = z30.int().nonnegative().describe("A non-negative integer count");
|
|
1035
|
+
var StepIndexZod = z30.int().min(0).max(StepSizes.length).describe("A non-negative integer step index");
|
|
1036
|
+
var timeUnitSchema = z30.number().positive();
|
|
1037
|
+
var TimeConfigZod = z30.object({
|
|
1001
1038
|
minutes: timeUnitSchema.optional(),
|
|
1002
1039
|
hours: timeUnitSchema.optional(),
|
|
1003
1040
|
days: timeUnitSchema.optional(),
|
|
@@ -1008,30 +1045,30 @@ var TimeConfigZod = z24.object({
|
|
|
1008
1045
|
var isTimeConfig = zodIsFactory13(TimeConfigZod);
|
|
1009
1046
|
var asTimeConfig = zodAsFactory16(TimeConfigZod, "asTimeConfig");
|
|
1010
1047
|
var toTimeConfig = zodAsFactory16(TimeConfigZod, "toTimeConfig");
|
|
1011
|
-
var SingleTimeConfigZod =
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1048
|
+
var SingleTimeConfigZod = z30.union([
|
|
1049
|
+
z30.object({ minutes: timeUnitSchema }),
|
|
1050
|
+
z30.object({ hours: timeUnitSchema }),
|
|
1051
|
+
z30.object({ days: timeUnitSchema }),
|
|
1052
|
+
z30.object({ weeks: timeUnitSchema }),
|
|
1053
|
+
z30.object({ months: timeUnitSchema }),
|
|
1054
|
+
z30.object({ years: timeUnitSchema })
|
|
1018
1055
|
]).describe("Time configuration with exactly one time unit");
|
|
1019
1056
|
var isSingleTimeConfig = zodIsFactory13(SingleTimeConfigZod);
|
|
1020
1057
|
var asSingleTimeConfig = zodAsFactory16(SingleTimeConfigZod, "asSingleTimeConfig");
|
|
1021
1058
|
var toSingleTimeConfig = zodAsFactory16(SingleTimeConfigZod, "toSingleTimeConfig");
|
|
1022
1059
|
|
|
1023
1060
|
// src/model/Context/BaseContext.zod.ts
|
|
1024
|
-
import { z as
|
|
1025
|
-
var CachesZod =
|
|
1026
|
-
|
|
1027
|
-
|
|
1061
|
+
import { z as z31 } from "zod";
|
|
1062
|
+
var CachesZod = z31.record(
|
|
1063
|
+
z31.string(),
|
|
1064
|
+
z31.custom((val) => val && typeof val === "object" && ("get" in val || "set" in val))
|
|
1028
1065
|
);
|
|
1029
|
-
var SingletonsZod =
|
|
1030
|
-
var LoggerZod =
|
|
1031
|
-
var MeterProviderZod =
|
|
1032
|
-
var TracerProviderZod =
|
|
1033
|
-
var TimeBudgetLimitZod =
|
|
1034
|
-
var BaseContextZod =
|
|
1066
|
+
var SingletonsZod = z31.record(z31.union([z31.string(), z31.symbol()]), z31.unknown());
|
|
1067
|
+
var LoggerZod = z31.custom((val) => val && typeof val === "object" && "info" in val && "error" in val);
|
|
1068
|
+
var MeterProviderZod = z31.custom((val) => val && typeof val === "object" && "getMeter" in val);
|
|
1069
|
+
var TracerProviderZod = z31.custom((val) => val && typeof val === "object" && "getTracer" in val);
|
|
1070
|
+
var TimeBudgetLimitZod = z31.number();
|
|
1071
|
+
var BaseContextZod = z31.object({
|
|
1035
1072
|
caches: CachesZod.optional(),
|
|
1036
1073
|
logger: LoggerZod.optional(),
|
|
1037
1074
|
meterProvider: MeterProviderZod.optional(),
|
|
@@ -1041,24 +1078,24 @@ var BaseContextZod = z25.object({
|
|
|
1041
1078
|
});
|
|
1042
1079
|
|
|
1043
1080
|
// src/model/Context/BlockContext.zod.ts
|
|
1044
|
-
import
|
|
1081
|
+
import z32 from "zod";
|
|
1045
1082
|
|
|
1046
1083
|
// src/model/Context/CachingContext.zod.ts
|
|
1047
1084
|
var CachingContextZod = BaseContextZod.extend({ caches: CachesZod });
|
|
1048
1085
|
|
|
1049
1086
|
// src/model/Context/BlockContext.zod.ts
|
|
1050
1087
|
var BlockContextReadZod = CachingContextZod.extend(
|
|
1051
|
-
{ chainMap:
|
|
1088
|
+
{ chainMap: z32.custom((val) => val && typeof val === "object" && "get" in val) }
|
|
1052
1089
|
);
|
|
1053
1090
|
var BlockContextWriteZod = CachingContextZod.extend(
|
|
1054
|
-
{ chainMap:
|
|
1091
|
+
{ chainMap: z32.custom((val) => val && typeof val === "object" && ("get" in val && "insert" in val)) }
|
|
1055
1092
|
);
|
|
1056
1093
|
var BlockContextZod = BlockContextWriteZod;
|
|
1057
1094
|
|
|
1058
1095
|
// src/model/Context/HeadContext.zod.ts
|
|
1059
1096
|
import { WithHashMetaZod as WithHashMetaZod6 } from "@xyo-network/sdk-js";
|
|
1060
|
-
import
|
|
1061
|
-
var HeadContextBaseZod =
|
|
1097
|
+
import z33 from "zod";
|
|
1098
|
+
var HeadContextBaseZod = z33.object(
|
|
1062
1099
|
{ head: WithHashMetaZod6(BlockBoundWitnessZod) }
|
|
1063
1100
|
);
|
|
1064
1101
|
var HeadContextZod = CachingContextZod.safeExtend(HeadContextBaseZod.shape);
|
|
@@ -1103,45 +1140,45 @@ import {
|
|
|
1103
1140
|
WithHashMetaZod as WithHashMetaZod7,
|
|
1104
1141
|
WithStorageMetaZod as WithStorageMetaZod5
|
|
1105
1142
|
} from "@xyo-network/sdk-js";
|
|
1106
|
-
import { z as
|
|
1107
|
-
var HydratedTransactionZod =
|
|
1143
|
+
import { z as z34 } from "zod/mini";
|
|
1144
|
+
var HydratedTransactionZod = z34.tuple([
|
|
1108
1145
|
TransactionBoundWitnessZod,
|
|
1109
|
-
|
|
1146
|
+
z34.array(PayloadZodLoose2)
|
|
1110
1147
|
]);
|
|
1111
1148
|
var isHydratedTransaction = zodIsFactory14(HydratedTransactionZod);
|
|
1112
1149
|
var asHydratedTransaction = zodAsFactory17(HydratedTransactionZod, "asHydratedTransaction");
|
|
1113
1150
|
var toHydratedTransaction = zodToFactory16(HydratedTransactionZod, "toHydratedTransaction");
|
|
1114
|
-
var HydratedTransactionWithHashMetaZod =
|
|
1151
|
+
var HydratedTransactionWithHashMetaZod = z34.tuple([
|
|
1115
1152
|
WithHashMetaZod7(TransactionBoundWitnessZod),
|
|
1116
|
-
|
|
1153
|
+
z34.array(z34.looseObject(WithHashMetaZod7(PayloadZod2).shape))
|
|
1117
1154
|
]);
|
|
1118
1155
|
var isHydratedTransactionWithHashMeta = zodIsFactory14(HydratedTransactionWithHashMetaZod);
|
|
1119
1156
|
var asHydratedTransactionWithHashMeta = zodAsFactory17(HydratedTransactionWithHashMetaZod, "asHydratedTransactionWithHashMeta");
|
|
1120
1157
|
var toHydratedTransactionWithHashMeta = zodToFactory16(HydratedTransactionWithHashMetaZod, "toHydratedTransactionWithHashMeta");
|
|
1121
|
-
var HydratedTransactionWithStorageMetaZod =
|
|
1158
|
+
var HydratedTransactionWithStorageMetaZod = z34.tuple([
|
|
1122
1159
|
WithStorageMetaZod5(TransactionBoundWitnessZod),
|
|
1123
|
-
|
|
1160
|
+
z34.array(z34.looseObject(WithStorageMetaZod5(PayloadZod2).shape))
|
|
1124
1161
|
]);
|
|
1125
1162
|
var isHydratedTransactionWithStorageMeta = zodIsFactory14(HydratedTransactionWithStorageMetaZod);
|
|
1126
1163
|
var asHydratedTransactionWithStorageMeta = zodAsFactory17(HydratedTransactionWithStorageMetaZod, "asHydratedTransactionWithStorageMeta");
|
|
1127
1164
|
var toHydratedTransactionWithStorageMeta = zodToFactory16(HydratedTransactionWithStorageMetaZod, "toHydratedTransactionWithStorageMeta");
|
|
1128
|
-
var UnsignedHydratedTransactionZod =
|
|
1165
|
+
var UnsignedHydratedTransactionZod = z34.tuple([
|
|
1129
1166
|
UnsignedTransactionBoundWitnessZod,
|
|
1130
|
-
|
|
1167
|
+
z34.array(PayloadZodLoose2)
|
|
1131
1168
|
]);
|
|
1132
1169
|
var isUnsignedHydratedTransaction = zodIsFactory14(UnsignedHydratedTransactionZod);
|
|
1133
1170
|
var asUnsignedHydratedTransaction = zodAsFactory17(UnsignedHydratedTransactionZod, "asUnsignedHydratedTransaction");
|
|
1134
1171
|
var toUnsignedHydratedTransaction = zodToFactory16(UnsignedHydratedTransactionZod, "toUnsignedHydratedTransaction");
|
|
1135
|
-
var UnsignedHydratedTransactionWithHashMetaZod =
|
|
1172
|
+
var UnsignedHydratedTransactionWithHashMetaZod = z34.tuple([
|
|
1136
1173
|
WithHashMetaZod7(UnsignedTransactionBoundWitnessZod),
|
|
1137
|
-
|
|
1174
|
+
z34.array(z34.looseObject(WithHashMetaZod7(PayloadZod2).shape))
|
|
1138
1175
|
]);
|
|
1139
1176
|
var isUnsignedHydratedTransactionWithHashMeta = zodIsFactory14(UnsignedHydratedTransactionWithHashMetaZod);
|
|
1140
1177
|
var asUnsignedHydratedTransactionWithHashMeta = zodAsFactory17(UnsignedHydratedTransactionWithHashMetaZod, "asUnsignedHydratedTransactionWithHashMeta");
|
|
1141
1178
|
var toUnsignedHydratedTransactionWithHashMeta = zodToFactory16(UnsignedHydratedTransactionWithHashMetaZod, "toUnsignedHydratedTransactionWithHashMeta");
|
|
1142
|
-
var UnsignedHydratedTransactionWithStorageMetaZod =
|
|
1179
|
+
var UnsignedHydratedTransactionWithStorageMetaZod = z34.tuple([
|
|
1143
1180
|
WithStorageMetaZod5(UnsignedTransactionBoundWitnessZod),
|
|
1144
|
-
|
|
1181
|
+
z34.array(z34.looseObject(WithStorageMetaZod5(PayloadZod2).shape))
|
|
1145
1182
|
]);
|
|
1146
1183
|
var isUnsignedHydratedTransactionWithStorageMeta = zodIsFactory14(UnsignedHydratedTransactionWithStorageMetaZod);
|
|
1147
1184
|
var asUnsignedHydratedTransactionWithStorageMeta = zodAsFactory17(
|
|
@@ -1152,23 +1189,23 @@ var toUnsignedHydratedTransactionWithStorageMeta = zodToFactory16(
|
|
|
1152
1189
|
UnsignedHydratedTransactionWithStorageMetaZod,
|
|
1153
1190
|
"toUnsignedHydratedTransactionWithStorageMeta"
|
|
1154
1191
|
);
|
|
1155
|
-
var SignedHydratedTransactionZod =
|
|
1192
|
+
var SignedHydratedTransactionZod = z34.tuple([
|
|
1156
1193
|
SignedTransactionBoundWitnessZod,
|
|
1157
|
-
|
|
1194
|
+
z34.array(PayloadZodLoose2)
|
|
1158
1195
|
]);
|
|
1159
1196
|
var isSignedHydratedTransaction = zodIsFactory14(SignedHydratedTransactionZod);
|
|
1160
1197
|
var asSignedHydratedTransaction = zodAsFactory17(SignedHydratedTransactionZod, "asSignedHydratedTransaction");
|
|
1161
1198
|
var toSignedHydratedTransaction = zodToFactory16(SignedHydratedTransactionZod, "toSignedHydratedTransaction");
|
|
1162
|
-
var SignedHydratedTransactionWithHashMetaZod =
|
|
1199
|
+
var SignedHydratedTransactionWithHashMetaZod = z34.tuple([
|
|
1163
1200
|
WithHashMetaZod7(SignedTransactionBoundWitnessZod),
|
|
1164
|
-
|
|
1201
|
+
z34.array(z34.looseObject(WithHashMetaZod7(PayloadZod2).shape))
|
|
1165
1202
|
]);
|
|
1166
1203
|
var isSignedHydratedTransactionWithHashMeta = zodIsFactory14(SignedHydratedTransactionWithHashMetaZod);
|
|
1167
1204
|
var asSignedHydratedTransactionWithHashMeta = zodAsFactory17(SignedHydratedTransactionWithHashMetaZod, "asSignedHydratedTransactionWithHashMeta");
|
|
1168
1205
|
var toSignedHydratedTransactionWithHashMeta = zodToFactory16(SignedHydratedTransactionWithHashMetaZod, "toSignedHydratedTransactionWithHashMeta");
|
|
1169
|
-
var SignedHydratedTransactionWithStorageMetaZod =
|
|
1206
|
+
var SignedHydratedTransactionWithStorageMetaZod = z34.tuple([
|
|
1170
1207
|
WithStorageMetaZod5(SignedTransactionBoundWitnessZod),
|
|
1171
|
-
|
|
1208
|
+
z34.array(z34.looseObject(WithStorageMetaZod5(PayloadZod2).shape))
|
|
1172
1209
|
]);
|
|
1173
1210
|
var isSignedHydratedTransactionWithStorageMeta = zodIsFactory14(SignedHydratedTransactionWithStorageMetaZod);
|
|
1174
1211
|
var asSignedHydratedTransactionWithStorageMeta = zodAsFactory17(
|
|
@@ -1184,22 +1221,22 @@ var toSignedHydratedTransactionWithStorageMeta = zodToFactory16(
|
|
|
1184
1221
|
var ELEVATE_OPCODE = "elevate";
|
|
1185
1222
|
|
|
1186
1223
|
// src/model/Permission.ts
|
|
1187
|
-
import { z as
|
|
1188
|
-
var CaveatTypesZod =
|
|
1189
|
-
var CaveatsZod =
|
|
1224
|
+
import { z as z35 } from "zod";
|
|
1225
|
+
var CaveatTypesZod = z35.enum(["chain", "dataLakeAccess", "expiration", "filteredResponse", "rateLimit", "restrictReturnedAccounts"]);
|
|
1226
|
+
var CaveatsZod = z35.object({
|
|
1190
1227
|
type: CaveatTypesZod,
|
|
1191
|
-
value:
|
|
1228
|
+
value: z35.json()
|
|
1192
1229
|
});
|
|
1193
|
-
var PermissionZod =
|
|
1194
|
-
parentCapability:
|
|
1230
|
+
var PermissionZod = z35.object({
|
|
1231
|
+
parentCapability: z35.string(),
|
|
1195
1232
|
caveats: CaveatsZod.array().optional(),
|
|
1196
|
-
invoker:
|
|
1233
|
+
invoker: z35.string()
|
|
1197
1234
|
});
|
|
1198
|
-
var InvokerPermissionZod = PermissionZod.safeExtend({ date:
|
|
1199
|
-
var PermissionRequestZod =
|
|
1200
|
-
var RequestedPermissionZod =
|
|
1201
|
-
parentCapability:
|
|
1202
|
-
date:
|
|
1235
|
+
var InvokerPermissionZod = PermissionZod.safeExtend({ date: z35.number().optional() });
|
|
1236
|
+
var PermissionRequestZod = z35.record(z35.string(), z35.record(z35.string(), z35.any()));
|
|
1237
|
+
var RequestedPermissionZod = z35.object({
|
|
1238
|
+
parentCapability: z35.string(),
|
|
1239
|
+
date: z35.number().optional()
|
|
1203
1240
|
});
|
|
1204
1241
|
|
|
1205
1242
|
// src/model/rewards.ts
|
|
@@ -1214,44 +1251,44 @@ var XL1_REWARDS_CREATOR_REWARD = asAttoXL1(toFixedPoint(20000000000n, XL1_REWARD
|
|
|
1214
1251
|
|
|
1215
1252
|
// src/model/RewardsRangeOptions.ts
|
|
1216
1253
|
import { AddressZod as AddressZod3 } from "@xylabs/sdk-js";
|
|
1217
|
-
import { z as
|
|
1218
|
-
var RewardsRangeOptionsZod =
|
|
1219
|
-
positions:
|
|
1254
|
+
import { z as z36 } from "zod";
|
|
1255
|
+
var RewardsRangeOptionsZod = z36.object({
|
|
1256
|
+
positions: z36.array(z36.number()).optional(),
|
|
1220
1257
|
range: BlockRangeZod.optional(),
|
|
1221
|
-
steps:
|
|
1222
|
-
stakers:
|
|
1258
|
+
steps: z36.array(StepIdentityZod).optional(),
|
|
1259
|
+
stakers: z36.array(AddressZod3).optional()
|
|
1223
1260
|
});
|
|
1224
1261
|
|
|
1225
1262
|
// src/model/Sequence.ts
|
|
1226
1263
|
import { HexRegExMinMax, toHex } from "@xylabs/sdk-js";
|
|
1227
1264
|
import { SequenceConstants } from "@xyo-network/sdk-js";
|
|
1228
|
-
import { z as
|
|
1265
|
+
import { z as z37 } from "zod";
|
|
1229
1266
|
var LocalSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.localSequenceBytes, SequenceConstants.localSequenceBytes));
|
|
1230
|
-
var LocalSequenceToStringZod =
|
|
1231
|
-
var LocalSequenceFromStringZod =
|
|
1267
|
+
var LocalSequenceToStringZod = z37.string().regex(LocalSequenceRegex);
|
|
1268
|
+
var LocalSequenceFromStringZod = z37.string().regex(LocalSequenceRegex).transform((v) => toHex(v));
|
|
1232
1269
|
var QualifiedSequenceRegex = new RegExp(HexRegExMinMax(SequenceConstants.qualifiedSequenceBytes, SequenceConstants.qualifiedSequenceBytes));
|
|
1233
|
-
var QualifiedSequenceToStringZod =
|
|
1234
|
-
var QualifiedSequenceFromStringZod =
|
|
1235
|
-
var SequenceToStringZod =
|
|
1236
|
-
var SequenceFromStringZod =
|
|
1270
|
+
var QualifiedSequenceToStringZod = z37.string().regex(QualifiedSequenceRegex);
|
|
1271
|
+
var QualifiedSequenceFromStringZod = z37.string().regex(QualifiedSequenceRegex).transform((v) => toHex(v));
|
|
1272
|
+
var SequenceToStringZod = z37.union([LocalSequenceToStringZod, QualifiedSequenceToStringZod]);
|
|
1273
|
+
var SequenceFromStringZod = z37.union([LocalSequenceFromStringZod, QualifiedSequenceFromStringZod]);
|
|
1237
1274
|
|
|
1238
1275
|
// src/model/Stake.ts
|
|
1239
1276
|
import { AddressZod as AddressZod4, HexZod as HexZod6 } from "@xylabs/sdk-js";
|
|
1240
|
-
import { z as
|
|
1241
|
-
var StakeZod =
|
|
1277
|
+
import { z as z38 } from "zod";
|
|
1278
|
+
var StakeZod = z38.object({
|
|
1242
1279
|
amount: AttoZod,
|
|
1243
1280
|
// the block number when the stake was added
|
|
1244
|
-
addBlock:
|
|
1281
|
+
addBlock: z38.number(),
|
|
1245
1282
|
// the unique id for the stake item
|
|
1246
|
-
id:
|
|
1283
|
+
id: z38.number(),
|
|
1247
1284
|
// the block number when the stake was removed (set to 0 if not removed)
|
|
1248
|
-
removeBlock:
|
|
1285
|
+
removeBlock: z38.number(),
|
|
1249
1286
|
// the address that is being staked
|
|
1250
1287
|
staked: AddressZod4,
|
|
1251
1288
|
// the address that owns the stake
|
|
1252
1289
|
staker: AddressZod4,
|
|
1253
1290
|
// the block number when the stake was withdrawn (set to 0 if not withdrawn)
|
|
1254
|
-
withdrawBlock:
|
|
1291
|
+
withdrawBlock: z38.number()
|
|
1255
1292
|
});
|
|
1256
1293
|
var StakeToJsonZod = StakeZod.transform((val) => ({
|
|
1257
1294
|
addBlock: val.addBlock,
|
|
@@ -1273,17 +1310,17 @@ var JsonToStakeZod = StakeZod.extend({ amount: HexZod6 }).transform((val) => ({
|
|
|
1273
1310
|
}));
|
|
1274
1311
|
|
|
1275
1312
|
// src/model/TimeDomain.ts
|
|
1276
|
-
import { z as
|
|
1277
|
-
var TimeDomainZod =
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1313
|
+
import { z as z39 } from "zod";
|
|
1314
|
+
var TimeDomainZod = z39.union([
|
|
1315
|
+
z39.literal("xl1"),
|
|
1316
|
+
z39.literal("epoch"),
|
|
1317
|
+
z39.literal("ethereum")
|
|
1281
1318
|
]);
|
|
1282
1319
|
|
|
1283
1320
|
// src/model/TransferPair.ts
|
|
1284
1321
|
import { AddressZod as AddressZod5 } from "@xylabs/sdk-js";
|
|
1285
|
-
import { z as
|
|
1286
|
-
var TransferPairZod =
|
|
1322
|
+
import { z as z40 } from "zod";
|
|
1323
|
+
var TransferPairZod = z40.tuple([
|
|
1287
1324
|
AddressZod5,
|
|
1288
1325
|
AddressZod5
|
|
1289
1326
|
]);
|
|
@@ -1310,25 +1347,28 @@ import {
|
|
|
1310
1347
|
isPayloadOfSchemaType as isPayloadOfSchemaType7,
|
|
1311
1348
|
PayloadZodOfSchema as PayloadZodOfSchema3
|
|
1312
1349
|
} from "@xyo-network/sdk-js";
|
|
1313
|
-
import { z as
|
|
1350
|
+
import { z as z42 } from "zod/mini";
|
|
1314
1351
|
|
|
1315
1352
|
// src/rejection/RejectionError.ts
|
|
1316
1353
|
import { HashZod as HashZod4 } from "@xylabs/sdk-js";
|
|
1317
|
-
import { z as
|
|
1318
|
-
var RejectionErrorZod =
|
|
1354
|
+
import { z as z41 } from "zod";
|
|
1355
|
+
var RejectionErrorZod = z41.object({
|
|
1319
1356
|
hash: HashZod4,
|
|
1320
|
-
message:
|
|
1321
|
-
name:
|
|
1357
|
+
message: z41.string().optional(),
|
|
1358
|
+
name: z41.string()
|
|
1322
1359
|
}).loose();
|
|
1323
1360
|
|
|
1324
1361
|
// src/rejection/BlockRejectionPayload.ts
|
|
1325
1362
|
var BlockRejectionSchema = asSchema11("network.xyo.block.rejection", true);
|
|
1326
|
-
var BlockRejectionFieldsZod =
|
|
1363
|
+
var BlockRejectionFieldsZod = z42.object({
|
|
1327
1364
|
block: HydratedBlockZod,
|
|
1328
|
-
errors:
|
|
1329
|
-
rejector:
|
|
1365
|
+
errors: z42.array(RejectionErrorZod),
|
|
1366
|
+
rejector: z42.string()
|
|
1330
1367
|
});
|
|
1331
|
-
var BlockRejectionZod =
|
|
1368
|
+
var BlockRejectionZod = z42.extend(
|
|
1369
|
+
PayloadZodOfSchema3(BlockRejectionSchema),
|
|
1370
|
+
BlockRejectionFieldsZod.shape
|
|
1371
|
+
);
|
|
1332
1372
|
var isBlockRejection = isPayloadOfSchemaType7(BlockRejectionSchema);
|
|
1333
1373
|
var asBlockRejection = AsObjectFactory11.create(isBlockRejection);
|
|
1334
1374
|
|
|
@@ -1339,14 +1379,17 @@ import {
|
|
|
1339
1379
|
isPayloadOfSchemaType as isPayloadOfSchemaType8,
|
|
1340
1380
|
PayloadZodOfSchema as PayloadZodOfSchema4
|
|
1341
1381
|
} from "@xyo-network/sdk-js";
|
|
1342
|
-
import { z as
|
|
1382
|
+
import { z as z43 } from "zod/mini";
|
|
1343
1383
|
var TransactionRejectionSchema = asSchema12("network.xyo.transaction.rejection", true);
|
|
1344
|
-
var TransactionRejectionFieldsZod =
|
|
1345
|
-
errors:
|
|
1346
|
-
rejector:
|
|
1384
|
+
var TransactionRejectionFieldsZod = z43.object({
|
|
1385
|
+
errors: z43.array(RejectionErrorZod),
|
|
1386
|
+
rejector: z43.string(),
|
|
1347
1387
|
transaction: HydratedTransactionZod
|
|
1348
1388
|
});
|
|
1349
|
-
var TransactionRejectionZod =
|
|
1389
|
+
var TransactionRejectionZod = z43.extend(
|
|
1390
|
+
PayloadZodOfSchema4(TransactionRejectionSchema),
|
|
1391
|
+
TransactionRejectionFieldsZod.shape
|
|
1392
|
+
);
|
|
1350
1393
|
var isTransactionRejection = isPayloadOfSchemaType8(TransactionRejectionSchema);
|
|
1351
1394
|
var asTransactionRejection = AsObjectFactory12.create(isTransactionRejection);
|
|
1352
1395
|
export {
|