@xyo-network/xl1-protocol 1.12.57 → 1.12.59
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 +105 -24
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/payload/elevatable/Bridge/BridgeDestinationObservation.d.ts +49 -8
- package/dist/neutral/payload/elevatable/Bridge/BridgeDestinationObservation.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Bridge/BridgeDetails.d.ts +99 -39
- package/dist/neutral/payload/elevatable/Bridge/BridgeDetails.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Bridge/BridgeIntent.d.ts +46 -8
- package/dist/neutral/payload/elevatable/Bridge/BridgeIntent.d.ts.map +1 -1
- package/dist/neutral/payload/elevatable/Bridge/BridgeSourceObservation.d.ts +49 -8
- package/dist/neutral/payload/elevatable/Bridge/BridgeSourceObservation.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/payload/elevatable/Bridge/BridgeDestinationObservation.ts +13 -7
- package/src/payload/elevatable/Bridge/BridgeDetails.ts +33 -20
- package/src/payload/elevatable/Bridge/BridgeIntent.ts +13 -7
- package/src/payload/elevatable/Bridge/BridgeSourceObservation.ts +12 -7
package/dist/neutral/index.mjs
CHANGED
|
@@ -279,35 +279,110 @@ var XL1Amount = class _XL1Amount {
|
|
|
279
279
|
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
280
280
|
import { isHashStorageMeta as isHashStorageMeta2, isSchema } from "@xyo-network/payload-model";
|
|
281
281
|
import { isSchemaPayload, SchemaSchema } from "@xyo-network/schema-payload-plugin";
|
|
282
|
-
import
|
|
282
|
+
import z4 from "zod";
|
|
283
283
|
|
|
284
284
|
// src/payload/elevatable/Bridge/BridgeDestinationObservation.ts
|
|
285
|
+
import { HexZod as HexZod2 } from "@xylabs/hex";
|
|
285
286
|
import { AsObjectFactory } from "@xylabs/object";
|
|
286
|
-
import {
|
|
287
|
+
import { isPayloadOfZodType } from "@xyo-network/payload-model";
|
|
288
|
+
|
|
289
|
+
// src/payload/elevatable/Bridge/BridgeDetails.ts
|
|
290
|
+
import { HexZod } from "@xylabs/hex";
|
|
291
|
+
import z2 from "zod";
|
|
292
|
+
var BridgeDetailsDestinationFieldsZod = z2.object({
|
|
293
|
+
/**
|
|
294
|
+
* Destination network
|
|
295
|
+
*/
|
|
296
|
+
dest: HexZod.describe("The destination network identifier"),
|
|
297
|
+
/**
|
|
298
|
+
* Destination address (EOA or contract)
|
|
299
|
+
*/
|
|
300
|
+
destAddress: HexZod.describe("The destination address (EOA or contract)"),
|
|
301
|
+
/**
|
|
302
|
+
* Token amount to bridge to destination
|
|
303
|
+
*/
|
|
304
|
+
destAmount: HexZod.describe("The token amount to bridge to destination"),
|
|
305
|
+
/**
|
|
306
|
+
* Token being bridged to
|
|
307
|
+
*/
|
|
308
|
+
destToken: HexZod.describe("The token being bridged to")
|
|
309
|
+
});
|
|
310
|
+
var BridgeDetailsSourceFieldsZod = z2.object({
|
|
311
|
+
/**
|
|
312
|
+
* Source network
|
|
313
|
+
*/
|
|
314
|
+
src: HexZod.describe("The source network identifier"),
|
|
315
|
+
/**
|
|
316
|
+
* Source address (EOA or contract)
|
|
317
|
+
*/
|
|
318
|
+
srcAddress: HexZod.describe("The source address (EOA or contract)"),
|
|
319
|
+
/**
|
|
320
|
+
* Token amount to bridge from source
|
|
321
|
+
*/
|
|
322
|
+
srcAmount: HexZod.describe("The token amount to bridge from source"),
|
|
323
|
+
/**
|
|
324
|
+
* Token being bridged from
|
|
325
|
+
*/
|
|
326
|
+
srcToken: HexZod.describe("The token being bridged from")
|
|
327
|
+
});
|
|
328
|
+
var BridgeDetailsFieldsZod = BridgeDetailsSourceFieldsZod.extend(
|
|
329
|
+
BridgeDetailsDestinationFieldsZod.shape
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
// src/payload/elevatable/Bridge/BridgeDestinationObservation.ts
|
|
287
333
|
var BridgeDestinationObservationSchema = "network.xyo.chain.bridge.observation.destination";
|
|
288
|
-
var
|
|
334
|
+
var BridgeDestinationObservationFieldsZod = BridgeDetailsFieldsZod.extend({
|
|
335
|
+
/**
|
|
336
|
+
* Destination chain confirmation
|
|
337
|
+
*/
|
|
338
|
+
destConfirmation: HexZod2.optional().describe("Destination chain confirmation")
|
|
339
|
+
});
|
|
340
|
+
var isBridgeDestinationObservation = isPayloadOfZodType(
|
|
341
|
+
BridgeDestinationObservationFieldsZod,
|
|
342
|
+
BridgeDestinationObservationSchema
|
|
343
|
+
);
|
|
289
344
|
var asBridgeDestinationObservation = AsObjectFactory.create(isBridgeDestinationObservation);
|
|
290
345
|
|
|
291
346
|
// src/payload/elevatable/Bridge/BridgeIntent.ts
|
|
292
347
|
import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/object";
|
|
293
|
-
import {
|
|
348
|
+
import { isPayloadOfZodType as isPayloadOfZodType2 } from "@xyo-network/payload-model";
|
|
349
|
+
import z3 from "zod";
|
|
294
350
|
var BridgeIntentSchema = "network.xyo.chain.bridge.intent";
|
|
295
|
-
var
|
|
351
|
+
var BridgeIntentFieldsZod = BridgeDetailsFieldsZod.extend({
|
|
352
|
+
/**
|
|
353
|
+
* Unique identifier for replay protection
|
|
354
|
+
*/
|
|
355
|
+
nonce: z3.string().describe("Unique identifier for replay protection")
|
|
356
|
+
});
|
|
357
|
+
var isBridgeIntent = isPayloadOfZodType2(
|
|
358
|
+
BridgeIntentFieldsZod,
|
|
359
|
+
BridgeIntentSchema
|
|
360
|
+
);
|
|
296
361
|
var asBridgeIntent = AsObjectFactory2.create(isBridgeIntent);
|
|
297
362
|
|
|
298
363
|
// src/payload/elevatable/Bridge/BridgeSourceObservation.ts
|
|
364
|
+
import { HexZod as HexZod3 } from "@xylabs/hex";
|
|
299
365
|
import { AsObjectFactory as AsObjectFactory3 } from "@xylabs/object";
|
|
300
|
-
import {
|
|
366
|
+
import { isPayloadOfZodType as isPayloadOfZodType3 } from "@xyo-network/payload-model";
|
|
301
367
|
var BridgeSourceObservationSchema = "network.xyo.chain.bridge.observation.source";
|
|
302
|
-
var
|
|
368
|
+
var BridgeSourceObservationFieldsZod = BridgeDetailsFieldsZod.extend({
|
|
369
|
+
/**
|
|
370
|
+
* Source chain confirmation
|
|
371
|
+
*/
|
|
372
|
+
srcConfirmation: HexZod3.optional().describe("Source chain confirmation")
|
|
373
|
+
});
|
|
374
|
+
var isBridgeSourceObservation = isPayloadOfZodType3(
|
|
375
|
+
BridgeSourceObservationFieldsZod,
|
|
376
|
+
BridgeSourceObservationSchema
|
|
377
|
+
);
|
|
303
378
|
var asBridgeSourceObservation = AsObjectFactory3.create(isBridgeSourceObservation);
|
|
304
379
|
|
|
305
380
|
// src/payload/elevatable/ChainStakeIntent.ts
|
|
306
381
|
import { AsObjectFactory as AsObjectFactory4 } from "@xylabs/object";
|
|
307
|
-
import { isPayloadOfSchemaType
|
|
382
|
+
import { isPayloadOfSchemaType, isStorageMeta } from "@xyo-network/payload-model";
|
|
308
383
|
var ChainStakeIntentSchema = "network.xyo.chain.stake.intent";
|
|
309
384
|
var isChainStakeIntent = (x) => {
|
|
310
|
-
return
|
|
385
|
+
return isPayloadOfSchemaType(ChainStakeIntentSchema)(x) && asNonNegativeInteger(x.nbf) !== void 0 && asNonNegativeInteger(x.exp) !== void 0;
|
|
311
386
|
};
|
|
312
387
|
var asChainStakeIntent = AsObjectFactory4.create(isChainStakeIntent);
|
|
313
388
|
var isChainStakeIntentWithStorageMeta = (x) => {
|
|
@@ -331,37 +406,37 @@ var asExecutable = (value) => {
|
|
|
331
406
|
|
|
332
407
|
// src/payload/elevatable/Hash.ts
|
|
333
408
|
import { AsObjectFactory as AsObjectFactory5 } from "@xylabs/object";
|
|
334
|
-
import { isPayloadOfSchemaType as
|
|
409
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
|
|
335
410
|
var HashSchema = "network.xyo.hash";
|
|
336
|
-
var isHashPayload =
|
|
411
|
+
var isHashPayload = isPayloadOfSchemaType2(HashSchema);
|
|
337
412
|
var asHashPayload = AsObjectFactory5.create(isHashPayload);
|
|
338
413
|
var asHashPayloadWithStorageMeta = AsObjectFactory5.create(isHashPayload);
|
|
339
414
|
|
|
340
415
|
// src/payload/elevatable/StepComplete.ts
|
|
341
416
|
import { AsObjectFactory as AsObjectFactory6 } from "@xylabs/object";
|
|
342
|
-
import { isPayloadOfSchemaType as
|
|
417
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType3 } from "@xyo-network/payload-model";
|
|
343
418
|
var StepCompleteSchema = "network.xyo.chain.step.complete";
|
|
344
|
-
var isStepComplete =
|
|
419
|
+
var isStepComplete = isPayloadOfSchemaType3(StepCompleteSchema);
|
|
345
420
|
var asStepComplete = AsObjectFactory6.create(isStepComplete);
|
|
346
421
|
|
|
347
422
|
// src/payload/elevatable/Time.ts
|
|
348
423
|
import { AsObjectFactory as AsObjectFactory7 } from "@xylabs/object";
|
|
349
|
-
import { isPayloadOfSchemaType as
|
|
424
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType4 } from "@xyo-network/payload-model";
|
|
350
425
|
var TimeSchema = "network.xyo.time";
|
|
351
426
|
var isSafeEpoch = (value) => {
|
|
352
427
|
return typeof value === "number" && value < 2 * Date.now();
|
|
353
428
|
};
|
|
354
429
|
var isTimePayload = (value) => {
|
|
355
|
-
return
|
|
430
|
+
return isPayloadOfSchemaType4(TimeSchema)(value) && isSafeEpoch(value.epoch);
|
|
356
431
|
};
|
|
357
432
|
var asTimePayload = AsObjectFactory7.create(isTimePayload);
|
|
358
433
|
var asTimePayloadWithStorageMeta = AsObjectFactory7.create(isTimePayload);
|
|
359
434
|
|
|
360
435
|
// src/payload/elevatable/TransferPayload.ts
|
|
361
436
|
import { AsObjectFactory as AsObjectFactory8 } from "@xylabs/object";
|
|
362
|
-
import { isPayloadOfSchemaType as
|
|
437
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType5 } from "@xyo-network/payload-model";
|
|
363
438
|
var TransferSchema = "network.xyo.transfer";
|
|
364
|
-
var isTransfer =
|
|
439
|
+
var isTransfer = isPayloadOfSchemaType5(TransferSchema);
|
|
365
440
|
var asTransfer = AsObjectFactory8.create(isTransfer);
|
|
366
441
|
|
|
367
442
|
// src/transaction/AnyHydratedTransaction.ts
|
|
@@ -533,7 +608,7 @@ var isAllowedBlockPayload = (value) => {
|
|
|
533
608
|
var isAllowedBlockPayloadWithHashStorageMeta = (value) => {
|
|
534
609
|
return isAllowedBlockPayload(value) && isHashStorageMeta2(value);
|
|
535
610
|
};
|
|
536
|
-
var AllowedBlockPayloadZod =
|
|
611
|
+
var AllowedBlockPayloadZod = z4.object({ schema: z4.enum(AllowedBlockPayloadSchemas) });
|
|
537
612
|
|
|
538
613
|
// src/block/BlockBoundWitness.ts
|
|
539
614
|
import { isHex as isHex2 } from "@xylabs/hex";
|
|
@@ -663,19 +738,19 @@ var XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1e6 + XL1_PROTOCOL_VERSI
|
|
|
663
738
|
// src/fields/BlockNumber.ts
|
|
664
739
|
import { AsObjectFactory as AsObjectFactory21 } from "@xylabs/object";
|
|
665
740
|
import {
|
|
666
|
-
isPayloadOfSchemaType as
|
|
741
|
+
isPayloadOfSchemaType as isPayloadOfSchemaType6,
|
|
667
742
|
isPayloadOfSchemaTypeWithSources
|
|
668
743
|
} from "@xyo-network/payload-model";
|
|
669
744
|
var BlockNumberSchema = "network.xyo.chain.block.number";
|
|
670
|
-
var isBlockNumber =
|
|
745
|
+
var isBlockNumber = isPayloadOfSchemaType6(BlockNumberSchema);
|
|
671
746
|
var asBlockNumber = AsObjectFactory21.create(isBlockNumber);
|
|
672
747
|
var isBlockNumberWithSources = isPayloadOfSchemaTypeWithSources(BlockNumberSchema);
|
|
673
748
|
var asBlockNumberWithSources = AsObjectFactory21.create(isBlockNumberWithSources);
|
|
674
749
|
|
|
675
750
|
// src/network/Status.ts
|
|
676
|
-
import { isPayloadOfSchemaType as
|
|
751
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType7 } from "@xyo-network/payload-model";
|
|
677
752
|
var NetworkStatusSchema = "network.xyo.chain.status";
|
|
678
|
-
var isNetworkStatus =
|
|
753
|
+
var isNetworkStatus = isPayloadOfSchemaType7(NetworkStatusSchema);
|
|
679
754
|
|
|
680
755
|
// src/provider/XyoDataLake.ts
|
|
681
756
|
var isDataLakeViewer = (value) => {
|
|
@@ -687,10 +762,10 @@ var isDataLakeProvider = (value) => {
|
|
|
687
762
|
|
|
688
763
|
// src/services/StakeIntentService/ChainIndexingServiceStateSchema.ts
|
|
689
764
|
import { AsObjectFactory as AsObjectFactory22 } from "@xylabs/object";
|
|
690
|
-
import { isPayloadOfSchemaType as
|
|
765
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType8, isStorageMeta as isStorageMeta8 } from "@xyo-network/payload-model";
|
|
691
766
|
var ChainIndexingServiceStateSchema = "network.xyo.chain.indexing.service.state";
|
|
692
767
|
var isChainIndexingServiceState = (payload) => {
|
|
693
|
-
return
|
|
768
|
+
return isPayloadOfSchemaType8(ChainIndexingServiceStateSchema)(payload);
|
|
694
769
|
};
|
|
695
770
|
var asChainIndexingServiceState = AsObjectFactory22.create(isChainIndexingServiceState);
|
|
696
771
|
var isChainIndexingServiceStateWithStorageMeta = (value) => isChainIndexingServiceState(value) && isStorageMeta8(value);
|
|
@@ -782,8 +857,14 @@ export {
|
|
|
782
857
|
BlockNumberSchema,
|
|
783
858
|
BlockValidationError,
|
|
784
859
|
BoundWitnessValidationError,
|
|
860
|
+
BridgeDestinationObservationFieldsZod,
|
|
785
861
|
BridgeDestinationObservationSchema,
|
|
862
|
+
BridgeDetailsDestinationFieldsZod,
|
|
863
|
+
BridgeDetailsFieldsZod,
|
|
864
|
+
BridgeDetailsSourceFieldsZod,
|
|
865
|
+
BridgeIntentFieldsZod,
|
|
786
866
|
BridgeIntentSchema,
|
|
867
|
+
BridgeSourceObservationFieldsZod,
|
|
787
868
|
BridgeSourceObservationSchema,
|
|
788
869
|
ChainIndexingServiceStateSchema,
|
|
789
870
|
ChainStakeIntentSchema,
|