@xyo-network/xl1-protocol 1.13.0 → 1.13.2
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 +128 -99
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/model/BlockNumber/BlockNumber.d.ts +12 -9
- package/dist/neutral/model/BlockNumber/BlockNumber.d.ts.map +1 -1
- package/dist/neutral/model/BlockNumber/EthBlockNumber.d.ts +13 -10
- package/dist/neutral/model/BlockNumber/EthBlockNumber.d.ts.map +1 -1
- package/dist/neutral/model/BlockNumber/Numberish.d.ts +3 -0
- package/dist/neutral/model/BlockNumber/Numberish.d.ts.map +1 -0
- package/dist/neutral/model/BlockNumber/XL1BlockNumber.d.ts +12 -9
- package/dist/neutral/model/BlockNumber/XL1BlockNumber.d.ts.map +1 -1
- package/dist/neutral/model/BlockNumber/index.d.ts +1 -0
- package/dist/neutral/model/BlockNumber/index.d.ts.map +1 -1
- package/dist/neutral/model/BlockRange/BlockRange.d.ts +23 -0
- package/dist/neutral/model/BlockRange/BlockRange.d.ts.map +1 -0
- package/dist/neutral/model/BlockRange/EthBlockRange.d.ts +23 -0
- package/dist/neutral/model/BlockRange/EthBlockRange.d.ts.map +1 -0
- package/dist/neutral/model/BlockRange/Numberish.d.ts +3 -0
- package/dist/neutral/model/BlockRange/Numberish.d.ts.map +1 -0
- package/dist/neutral/model/BlockRange/Range.d.ts +13 -0
- package/dist/neutral/model/BlockRange/Range.d.ts.map +1 -0
- package/dist/neutral/model/BlockRange/XL1BlockRange.d.ts +23 -0
- package/dist/neutral/model/BlockRange/XL1BlockRange.d.ts.map +1 -0
- package/dist/neutral/model/BlockRange/index.d.ts +5 -0
- package/dist/neutral/model/BlockRange/index.d.ts.map +1 -0
- package/dist/neutral/model/RangeMultipliers.d.ts +1 -1
- package/dist/neutral/model/RangeMultipliers.d.ts.map +1 -1
- package/dist/neutral/model/index.d.ts +1 -0
- package/dist/neutral/model/index.d.ts.map +1 -1
- package/dist/neutral/model/zod/index.d.ts +4 -0
- package/dist/neutral/model/zod/index.d.ts.map +1 -0
- package/dist/neutral/model/zod/zodAsFactory.d.ts +7 -0
- package/dist/neutral/model/zod/zodAsFactory.d.ts.map +1 -0
- package/dist/neutral/model/zod/zodIsFactory.d.ts +3 -0
- package/dist/neutral/model/zod/zodIsFactory.d.ts.map +1 -0
- package/dist/neutral/model/zod/zodToFactory.d.ts +6 -0
- package/dist/neutral/model/zod/zodToFactory.d.ts.map +1 -0
- package/dist/neutral/transaction/HydratedTransactionWithHashMeta.d.ts +7 -0
- package/dist/neutral/transaction/HydratedTransactionWithHashMeta.d.ts.map +1 -0
- package/dist/neutral/transaction/SignedHydratedTransactionWithHashMeta.d.ts +7 -0
- package/dist/neutral/transaction/SignedHydratedTransactionWithHashMeta.d.ts.map +1 -0
- package/dist/neutral/transaction/SignedHydratedTransactionWithStorageMeta.d.ts +1 -1
- package/dist/neutral/transaction/SignedHydratedTransactionWithStorageMeta.d.ts.map +1 -1
- package/dist/neutral/transaction/index.d.ts +2 -0
- package/dist/neutral/transaction/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/constants/StepSizes.ts +9 -9
- package/src/model/BlockNumber/BlockNumber.ts +9 -23
- package/src/model/BlockNumber/EthBlockNumber.ts +8 -17
- package/src/model/BlockNumber/Numberish.ts +5 -0
- package/src/model/BlockNumber/XL1BlockNumber.ts +7 -16
- package/src/model/BlockNumber/index.ts +1 -0
- package/src/model/BlockRange/BlockRange.ts +30 -0
- package/src/model/BlockRange/EthBlockRange.ts +30 -0
- package/src/model/BlockRange/Numberish.ts +5 -0
- package/src/model/BlockRange/Range.ts +13 -0
- package/src/model/BlockRange/XL1BlockRange.ts +30 -0
- package/src/model/BlockRange/index.ts +4 -0
- package/src/model/RangeMultipliers.ts +1 -1
- package/src/model/StepIdentity.ts +4 -4
- package/src/model/index.ts +1 -0
- package/src/model/zod/index.ts +3 -0
- package/src/model/zod/zodAsFactory.ts +17 -0
- package/src/model/zod/zodIsFactory.ts +5 -0
- package/src/model/zod/zodToFactory.ts +7 -0
- package/src/transaction/HydratedTransactionWithHashMeta.ts +23 -0
- package/src/transaction/SignedHydratedTransactionWithHashMeta.ts +25 -0
- package/src/transaction/SignedHydratedTransactionWithStorageMeta.ts +4 -2
- package/src/transaction/index.ts +2 -0
package/dist/neutral/index.mjs
CHANGED
|
@@ -501,57 +501,77 @@ var asHydratedTransaction = AsObjectFactory12.create(
|
|
|
501
501
|
isHydratedTransaction
|
|
502
502
|
);
|
|
503
503
|
|
|
504
|
-
// src/transaction/
|
|
504
|
+
// src/transaction/HydratedTransactionWithHashMeta.ts
|
|
505
505
|
import { AsObjectFactory as AsObjectFactory13 } from "@xylabs/object";
|
|
506
506
|
import {
|
|
507
507
|
isStorageMeta as isStorageMeta4
|
|
508
508
|
} from "@xyo-network/payload-model";
|
|
509
|
-
var
|
|
509
|
+
var isHydratedTransactionWithHashMeta = (value) => {
|
|
510
510
|
return isAnyHydratedTransaction(value) && isStorageMeta4(value[0]) && !value[1].some((v) => !isStorageMeta4(v));
|
|
511
511
|
};
|
|
512
|
-
var
|
|
512
|
+
var asHydratedTransactionWithHashMeta = AsObjectFactory13.create(
|
|
513
|
+
isHydratedTransactionWithHashMeta
|
|
514
|
+
);
|
|
515
|
+
|
|
516
|
+
// src/transaction/HydratedTransactionWithStorageMeta.ts
|
|
517
|
+
import { AsObjectFactory as AsObjectFactory14 } from "@xylabs/object";
|
|
518
|
+
import {
|
|
519
|
+
isStorageMeta as isStorageMeta5
|
|
520
|
+
} from "@xyo-network/payload-model";
|
|
521
|
+
var isHydratedTransactionWithStorageMeta = (value) => {
|
|
522
|
+
return isAnyHydratedTransaction(value) && isStorageMeta5(value[0]) && !value[1].some((v) => !isStorageMeta5(v));
|
|
523
|
+
};
|
|
524
|
+
var asHydratedTransactionWithStorageMeta = AsObjectFactory14.create(
|
|
513
525
|
isHydratedTransactionWithStorageMeta
|
|
514
526
|
);
|
|
515
527
|
|
|
516
528
|
// src/transaction/SignedHydratedTransaction.ts
|
|
517
|
-
import { AsObjectFactory as
|
|
529
|
+
import { AsObjectFactory as AsObjectFactory15 } from "@xylabs/object";
|
|
518
530
|
import { isSigned as isSigned2 } from "@xyo-network/boundwitness-model";
|
|
519
531
|
var isSignedHydratedTransaction = (value) => {
|
|
520
532
|
return isAnyHydratedTransaction(value) && isSigned2(value[0]);
|
|
521
533
|
};
|
|
522
|
-
var asSignedHydratedTransaction =
|
|
534
|
+
var asSignedHydratedTransaction = AsObjectFactory15.create(
|
|
523
535
|
isSignedHydratedTransaction
|
|
524
536
|
);
|
|
525
537
|
|
|
538
|
+
// src/transaction/SignedHydratedTransactionWithHashMeta.ts
|
|
539
|
+
import { AsObjectFactory as AsObjectFactory16 } from "@xylabs/object";
|
|
540
|
+
import { isStorageMeta as isStorageMeta6 } from "@xyo-network/payload-model";
|
|
541
|
+
var isSignedHydratedTransactionWithHashMeta = (value) => {
|
|
542
|
+
return isSignedHydratedTransaction(value) && isStorageMeta6(value[0]) && !value[1].some((v) => !isStorageMeta6(v));
|
|
543
|
+
};
|
|
544
|
+
var asSignedHydratedTransactionWithHashMeta = AsObjectFactory16.create(
|
|
545
|
+
isSignedHydratedTransactionWithHashMeta
|
|
546
|
+
);
|
|
547
|
+
|
|
526
548
|
// src/transaction/SignedHydratedTransactionWithStorageMeta.ts
|
|
527
|
-
import { AsObjectFactory as
|
|
528
|
-
import {
|
|
529
|
-
isStorageMeta as isStorageMeta5
|
|
530
|
-
} from "@xyo-network/payload-model";
|
|
549
|
+
import { AsObjectFactory as AsObjectFactory17 } from "@xylabs/object";
|
|
550
|
+
import { isStorageMeta as isStorageMeta7 } from "@xyo-network/payload-model";
|
|
531
551
|
var isSignedHydratedTransactionWithStorageMeta = (value) => {
|
|
532
|
-
return isSignedHydratedTransaction(value) &&
|
|
552
|
+
return isSignedHydratedTransaction(value) && isStorageMeta7(value[0]) && !value[1].some((v) => !isStorageMeta7(v));
|
|
533
553
|
};
|
|
534
|
-
var asSignedHydratedTransactionWithStorageMeta =
|
|
554
|
+
var asSignedHydratedTransactionWithStorageMeta = AsObjectFactory17.create(
|
|
535
555
|
isSignedHydratedTransactionWithStorageMeta
|
|
536
556
|
);
|
|
537
557
|
|
|
538
558
|
// src/transaction/TransactionBoundWitnessDeprecated.ts
|
|
539
|
-
import { AsObjectFactory as
|
|
559
|
+
import { AsObjectFactory as AsObjectFactory18 } from "@xylabs/object";
|
|
540
560
|
import { isSigned as isSigned3 } from "@xyo-network/boundwitness-model";
|
|
541
|
-
import { isHashMeta, isStorageMeta as
|
|
561
|
+
import { isHashMeta, isStorageMeta as isStorageMeta8 } from "@xyo-network/payload-model";
|
|
542
562
|
var isSignedTransactionBoundWitness = (value) => {
|
|
543
563
|
return isTransactionBoundWitness(value) && isSigned3(value);
|
|
544
564
|
};
|
|
545
|
-
var isTransactionBoundWitnessWithStorageMeta = (value) => isTransactionBoundWitness(value) &&
|
|
565
|
+
var isTransactionBoundWitnessWithStorageMeta = (value) => isTransactionBoundWitness(value) && isStorageMeta8(value);
|
|
546
566
|
var isTransactionBoundWitnessWithHashMeta = (value) => isTransactionBoundWitness(value) && isHashMeta(value);
|
|
547
|
-
var isSignedTransactionBoundWitnessWithStorageMeta = (value) => isSignedTransactionBoundWitness(value) &&
|
|
567
|
+
var isSignedTransactionBoundWitnessWithStorageMeta = (value) => isSignedTransactionBoundWitness(value) && isStorageMeta8(value);
|
|
548
568
|
var isSignedTransactionBoundWitnessWithHashMeta = (value) => isSignedTransactionBoundWitness(value) && isHashMeta(value);
|
|
549
|
-
var asTransactionBoundWitnessWithStorageMeta =
|
|
550
|
-
var asTransactionBoundWitnessWithHashMeta =
|
|
569
|
+
var asTransactionBoundWitnessWithStorageMeta = AsObjectFactory18.create(isTransactionBoundWitnessWithStorageMeta);
|
|
570
|
+
var asTransactionBoundWitnessWithHashMeta = AsObjectFactory18.create(isTransactionBoundWitnessWithHashMeta);
|
|
551
571
|
|
|
552
572
|
// src/transaction/TransactionFeesFields.ts
|
|
553
573
|
import { isHex } from "@xylabs/hex";
|
|
554
|
-
import { AsObjectFactory as
|
|
574
|
+
import { AsObjectFactory as AsObjectFactory19 } from "@xylabs/object";
|
|
555
575
|
import { isObject } from "@xylabs/typeof";
|
|
556
576
|
var isTransactionFeesBigInt = (value) => {
|
|
557
577
|
if (!isObject(value)) {
|
|
@@ -565,7 +585,7 @@ var isTransactionFeesBigInt = (value) => {
|
|
|
565
585
|
} = value;
|
|
566
586
|
return isAttoXL1(base) && isAttoXL1(gasLimit) && isAttoXL1(gasPrice) && isAttoXL1(priority);
|
|
567
587
|
};
|
|
568
|
-
var asTransactionFeesBigInt =
|
|
588
|
+
var asTransactionFeesBigInt = AsObjectFactory19.create(
|
|
569
589
|
isTransactionFeesBigInt
|
|
570
590
|
);
|
|
571
591
|
var isTransactionFeesHex = (value) => {
|
|
@@ -580,29 +600,29 @@ var isTransactionFeesHex = (value) => {
|
|
|
580
600
|
} = value;
|
|
581
601
|
return isHex(base) && isHex(gasLimit) && isHex(gasPrice) && isHex(priority);
|
|
582
602
|
};
|
|
583
|
-
var asTransactionFeesHex =
|
|
603
|
+
var asTransactionFeesHex = AsObjectFactory19.create(
|
|
584
604
|
isTransactionFeesHex
|
|
585
605
|
);
|
|
586
606
|
|
|
587
607
|
// src/transaction/UnsignedHydratedTransaction.ts
|
|
588
|
-
import { AsObjectFactory as
|
|
608
|
+
import { AsObjectFactory as AsObjectFactory20 } from "@xylabs/object";
|
|
589
609
|
import { isUnsigned } from "@xyo-network/boundwitness-model";
|
|
590
610
|
var isUnsignedHydratedTransaction = (value) => {
|
|
591
611
|
return isAnyHydratedTransaction(value) && isUnsigned(value[0]);
|
|
592
612
|
};
|
|
593
|
-
var asUnsignedHydratedTransaction =
|
|
613
|
+
var asUnsignedHydratedTransaction = AsObjectFactory20.create(
|
|
594
614
|
isUnsignedHydratedTransaction
|
|
595
615
|
);
|
|
596
616
|
|
|
597
617
|
// src/transaction/UnsignedHydratedTransactionWithHashMeta.ts
|
|
598
|
-
import { AsObjectFactory as
|
|
618
|
+
import { AsObjectFactory as AsObjectFactory21 } from "@xylabs/object";
|
|
599
619
|
import {
|
|
600
620
|
isHashMeta as isHashMeta2
|
|
601
621
|
} from "@xyo-network/payload-model";
|
|
602
622
|
var isUnsignedHydratedTransactionWithHashMeta = (value) => {
|
|
603
623
|
return isSignedHydratedTransaction(value) && isHashMeta2(value[0]) && !value[1].some((v) => !isHashMeta2(v));
|
|
604
624
|
};
|
|
605
|
-
var asUnsignedHydratedTransactionWithHashMeta =
|
|
625
|
+
var asUnsignedHydratedTransactionWithHashMeta = AsObjectFactory21.create(
|
|
606
626
|
isUnsignedHydratedTransactionWithHashMeta
|
|
607
627
|
);
|
|
608
628
|
|
|
@@ -632,9 +652,9 @@ var AllowedBlockPayloadZod = z4.object({ schema: z4.enum(AllowedBlockPayloadSche
|
|
|
632
652
|
|
|
633
653
|
// src/block/BlockBoundWitness.ts
|
|
634
654
|
import { isHex as isHex2 } from "@xylabs/hex";
|
|
635
|
-
import { AsObjectFactory as
|
|
655
|
+
import { AsObjectFactory as AsObjectFactory22 } from "@xylabs/object";
|
|
636
656
|
import { isBoundWitness as isBoundWitness3, isSigned as isSigned4 } from "@xyo-network/boundwitness-model";
|
|
637
|
-
import { isHashMeta as isHashMeta4, isStorageMeta as
|
|
657
|
+
import { isHashMeta as isHashMeta4, isStorageMeta as isStorageMeta9 } from "@xyo-network/payload-model";
|
|
638
658
|
var isBlockBoundWitness = (value) => {
|
|
639
659
|
const typedObj = value;
|
|
640
660
|
return isBoundWitness3(value) && Number.isInteger(typedObj.block) && isHex2(typedObj.chain);
|
|
@@ -643,7 +663,7 @@ var isSignedBlockBoundWitness = (value) => {
|
|
|
643
663
|
return isBlockBoundWitness(value) && isSigned4(value);
|
|
644
664
|
};
|
|
645
665
|
var isBlockBoundWitnessWithStorageMeta = (value) => {
|
|
646
|
-
return isBlockBoundWitness(value) &&
|
|
666
|
+
return isBlockBoundWitness(value) && isStorageMeta9(value);
|
|
647
667
|
};
|
|
648
668
|
var isSignedBlockBoundWitnessWithStorageMeta = (value) => {
|
|
649
669
|
return isBlockBoundWitnessWithStorageMeta(value) && isSigned4(value);
|
|
@@ -654,19 +674,19 @@ var isBlockBoundWitnessWithHashMeta = (value) => {
|
|
|
654
674
|
var isSignedBlockBoundWitnessWithHashMeta = (value) => {
|
|
655
675
|
return isBlockBoundWitnessWithHashMeta(value) && isSigned4(value);
|
|
656
676
|
};
|
|
657
|
-
var asBlockBoundWitness =
|
|
658
|
-
var asSignedBlockBoundWitness =
|
|
659
|
-
var asBlockBoundWitnessWithStorageMeta =
|
|
660
|
-
var asSignedBlockBoundWitnessWithStorageMeta =
|
|
661
|
-
var asBlockBoundWitnessWithHashMeta =
|
|
662
|
-
var asSignedBlockBoundWitnessWithHashMeta =
|
|
677
|
+
var asBlockBoundWitness = AsObjectFactory22.create(isBlockBoundWitness);
|
|
678
|
+
var asSignedBlockBoundWitness = AsObjectFactory22.create(isSignedBlockBoundWitness);
|
|
679
|
+
var asBlockBoundWitnessWithStorageMeta = AsObjectFactory22.create(isBlockBoundWitnessWithStorageMeta);
|
|
680
|
+
var asSignedBlockBoundWitnessWithStorageMeta = AsObjectFactory22.create(isSignedBlockBoundWitnessWithStorageMeta);
|
|
681
|
+
var asBlockBoundWitnessWithHashMeta = AsObjectFactory22.create(isBlockBoundWitnessWithHashMeta);
|
|
682
|
+
var asSignedBlockBoundWitnessWithHashMeta = AsObjectFactory22.create(isSignedBlockBoundWitnessWithHashMeta);
|
|
663
683
|
|
|
664
684
|
// src/block/HydratedBlock.ts
|
|
665
|
-
import { AsObjectFactory as
|
|
685
|
+
import { AsObjectFactory as AsObjectFactory23 } from "@xylabs/object";
|
|
666
686
|
var isHydratedBlock = (value) => {
|
|
667
687
|
return isHydratedBoundWitness(value) && isBlockBoundWitnessWithStorageMeta(value[0]);
|
|
668
688
|
};
|
|
669
|
-
var asHydratedBlock =
|
|
689
|
+
var asHydratedBlock = AsObjectFactory23.create(
|
|
670
690
|
isHydratedBlock
|
|
671
691
|
);
|
|
672
692
|
|
|
@@ -707,55 +727,57 @@ var ELEVATE_OPCODE = "elevate";
|
|
|
707
727
|
import { AsTypeFactory } from "@xylabs/object";
|
|
708
728
|
|
|
709
729
|
// src/model/BlockNumber/BlockNumber.ts
|
|
710
|
-
import
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
function
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
return value;
|
|
730
|
+
import z6 from "zod";
|
|
731
|
+
|
|
732
|
+
// src/model/zod/zodAsFactory.ts
|
|
733
|
+
import { assertError } from "@xylabs/hex";
|
|
734
|
+
function zodAsFactory(zod) {
|
|
735
|
+
function asFunc(value, assert) {
|
|
736
|
+
const result = zod.safeParse(value);
|
|
737
|
+
if (result.success) {
|
|
738
|
+
return result.data;
|
|
739
|
+
}
|
|
740
|
+
return assertError(value, assert, result.error.message);
|
|
722
741
|
}
|
|
723
|
-
|
|
742
|
+
return asFunc;
|
|
724
743
|
}
|
|
725
|
-
var BLOCK_NUMBER_ZERO = asBlockNumber(0);
|
|
726
|
-
var toBlockNumberKey = (range) => `${range[0]}|${range[1]}`;
|
|
727
|
-
var fromBlockNumberKey = (key) => {
|
|
728
|
-
const [start, end] = key.split("|").map((v) => asBlockNumber(Number(v)));
|
|
729
|
-
return [start, end];
|
|
730
|
-
};
|
|
731
744
|
|
|
732
|
-
// src/model/
|
|
733
|
-
function
|
|
734
|
-
return
|
|
745
|
+
// src/model/zod/zodIsFactory.ts
|
|
746
|
+
function zodIsFactory(zod) {
|
|
747
|
+
return (value) => zod.safeParse(value).success;
|
|
735
748
|
}
|
|
736
|
-
|
|
737
|
-
|
|
749
|
+
|
|
750
|
+
// src/model/zod/zodToFactory.ts
|
|
751
|
+
function zodToFactory(zod) {
|
|
752
|
+
return zodAsFactory(zod);
|
|
738
753
|
}
|
|
754
|
+
|
|
755
|
+
// src/model/BlockNumber/Numberish.ts
|
|
756
|
+
import z5 from "zod";
|
|
757
|
+
var NumberishZod = z5.union([z5.number(), z5.string(), z5.bigint()]).transform((v) => typeof v === "bigint" ? Number(v) : typeof v === "string" ? Number(v) : v).pipe(z5.number());
|
|
758
|
+
|
|
759
|
+
// src/model/BlockNumber/BlockNumber.ts
|
|
760
|
+
var BlockNumberZod = z6.number().transform((v) => v);
|
|
761
|
+
var NumberishBlockNumberZod = NumberishZod.transform((v) => v);
|
|
762
|
+
var asBlockNumber = zodAsFactory(BlockNumberZod);
|
|
763
|
+
var toBlockNumber = zodToFactory(NumberishBlockNumberZod);
|
|
764
|
+
var BLOCK_NUMBER_ZERO = asBlockNumber(0);
|
|
765
|
+
|
|
766
|
+
// src/model/BlockNumber/EthBlockNumber.ts
|
|
767
|
+
import z7 from "zod";
|
|
768
|
+
var EthBlockNumberZod = z7.number().transform((v) => v);
|
|
769
|
+
var NumberishEthBlockNumberZod = NumberishBlockNumberZod.transform((v) => v);
|
|
770
|
+
var asEthBlockNumber = zodAsFactory(EthBlockNumberZod);
|
|
771
|
+
var toEthBlockNumber = zodToFactory(NumberishEthBlockNumberZod);
|
|
739
772
|
var ETH_BLOCK_NUMBER_ZERO = asEthBlockNumber(0);
|
|
740
|
-
var toEthBlockRangeKey = (range) => `${range[0]}|${range[1]}`;
|
|
741
|
-
var fromEthBlockNumberKey = (key) => {
|
|
742
|
-
const [start, end] = key.split("|").map((v) => asEthBlockNumber(Number(v)));
|
|
743
|
-
return [start, end];
|
|
744
|
-
};
|
|
745
773
|
|
|
746
774
|
// src/model/BlockNumber/XL1BlockNumber.ts
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
775
|
+
import z8 from "zod";
|
|
776
|
+
var XL1BlockNumberZod = z8.number().transform((v) => v);
|
|
777
|
+
var NumberishXL1BlockNumberZod = NumberishBlockNumberZod.transform((v) => v);
|
|
778
|
+
var asXL1BlockNumber = zodAsFactory(XL1BlockNumberZod);
|
|
779
|
+
var toXL1BlockNumber = zodToFactory(NumberishXL1BlockNumberZod);
|
|
753
780
|
var XL1_BLOCK_NUMBER_ZERO = asXL1BlockNumber(0);
|
|
754
|
-
var toXL1BlockRangeKey = (range) => `${range[0]}|${range[1]}`;
|
|
755
|
-
var fromXL1BlockNumberKey = (key) => {
|
|
756
|
-
const [start, end] = key.split("|").map((v) => asXL1BlockNumber(Number(v)));
|
|
757
|
-
return [start, end];
|
|
758
|
-
};
|
|
759
781
|
|
|
760
782
|
// src/model/StepIdentity.ts
|
|
761
783
|
import { isUndefined } from "@xylabs/typeof";
|
|
@@ -771,11 +793,10 @@ var asStepIdentity = (stepIdentityString) => {
|
|
|
771
793
|
return void 0;
|
|
772
794
|
}
|
|
773
795
|
const step = tryParseInt(stepString);
|
|
774
|
-
const
|
|
775
|
-
if (isUndefined(
|
|
796
|
+
const block = toXL1BlockNumber(blockNumberString);
|
|
797
|
+
if (isUndefined(block) || isUndefined(step)) {
|
|
776
798
|
return void 0;
|
|
777
799
|
}
|
|
778
|
-
const block = asXL1BlockNumber(blockNumber);
|
|
779
800
|
return { block, step };
|
|
780
801
|
} catch {
|
|
781
802
|
return void 0;
|
|
@@ -784,15 +805,15 @@ var asStepIdentity = (stepIdentityString) => {
|
|
|
784
805
|
|
|
785
806
|
// src/constants/StepSizes.ts
|
|
786
807
|
var StepSizes = [
|
|
787
|
-
asXL1BlockNumber(7),
|
|
788
|
-
asXL1BlockNumber(31),
|
|
789
|
-
asXL1BlockNumber(211),
|
|
790
|
-
asXL1BlockNumber(2311),
|
|
791
|
-
asXL1BlockNumber(30031),
|
|
792
|
-
asXL1BlockNumber(510511),
|
|
793
|
-
asXL1BlockNumber(9699691),
|
|
794
|
-
asXL1BlockNumber(223092871),
|
|
795
|
-
asXL1BlockNumber(6469693231)
|
|
808
|
+
asXL1BlockNumber(7, true),
|
|
809
|
+
asXL1BlockNumber(31, true),
|
|
810
|
+
asXL1BlockNumber(211, true),
|
|
811
|
+
asXL1BlockNumber(2311, true),
|
|
812
|
+
asXL1BlockNumber(30031, true),
|
|
813
|
+
asXL1BlockNumber(510511, true),
|
|
814
|
+
asXL1BlockNumber(9699691, true),
|
|
815
|
+
asXL1BlockNumber(223092871, true),
|
|
816
|
+
asXL1BlockNumber(6469693231, true)
|
|
796
817
|
];
|
|
797
818
|
function isValidStep(step) {
|
|
798
819
|
if (typeof step === "number" && Number.isInteger(step)) {
|
|
@@ -847,16 +868,16 @@ var XL1_PROTOCOL_VERSION_STRING = `${XL1_PROTOCOL_VERSION_MAJOR}.${XL1_PROTOCOL_
|
|
|
847
868
|
var XL1_PROTOCOL_VERSION = XL1_PROTOCOL_VERSION_MAJOR * 1e6 + XL1_PROTOCOL_VERSION_MINOR * 1e3 + XL1_PROTOCOL_VERSION_PATCH;
|
|
848
869
|
|
|
849
870
|
// src/fields/BlockNumber.ts
|
|
850
|
-
import { AsObjectFactory as
|
|
871
|
+
import { AsObjectFactory as AsObjectFactory24 } from "@xylabs/object";
|
|
851
872
|
import {
|
|
852
873
|
isPayloadOfSchemaType as isPayloadOfSchemaType6,
|
|
853
874
|
isPayloadOfSchemaTypeWithSources
|
|
854
875
|
} from "@xyo-network/payload-model";
|
|
855
876
|
var BlockNumberSchema = "network.xyo.chain.block.number";
|
|
856
877
|
var isBlockNumberPayload = isPayloadOfSchemaType6(BlockNumberSchema);
|
|
857
|
-
var asBlockNumberPayload =
|
|
878
|
+
var asBlockNumberPayload = AsObjectFactory24.create(isBlockNumberPayload);
|
|
858
879
|
var isBlockNumberPayloadWithSources = isPayloadOfSchemaTypeWithSources(BlockNumberSchema);
|
|
859
|
-
var asBlockNumberPayloadWithSources =
|
|
880
|
+
var asBlockNumberPayloadWithSources = AsObjectFactory24.create(isBlockNumberPayloadWithSources);
|
|
860
881
|
|
|
861
882
|
// src/network/Status.ts
|
|
862
883
|
import { isPayloadOfSchemaType as isPayloadOfSchemaType7 } from "@xyo-network/payload-model";
|
|
@@ -923,6 +944,7 @@ export {
|
|
|
923
944
|
AttoXL1MaxValue,
|
|
924
945
|
BLOCK_NUMBER_ZERO,
|
|
925
946
|
BlockNumberSchema,
|
|
947
|
+
BlockNumberZod,
|
|
926
948
|
BoundWitnessValidationError,
|
|
927
949
|
BridgeDestinationObservationFieldsZod,
|
|
928
950
|
BridgeDestinationObservationSchema,
|
|
@@ -936,6 +958,7 @@ export {
|
|
|
936
958
|
ChainStakeIntentSchema,
|
|
937
959
|
ELEVATE_OPCODE,
|
|
938
960
|
ETH_BLOCK_NUMBER_ZERO,
|
|
961
|
+
EthBlockNumberZod,
|
|
939
962
|
FemtoXL1,
|
|
940
963
|
FemtoXL1MaxValue,
|
|
941
964
|
HashSchema,
|
|
@@ -949,6 +972,10 @@ export {
|
|
|
949
972
|
NanoXL1,
|
|
950
973
|
NanoXL1MaxValue,
|
|
951
974
|
NetworkStatusSchema,
|
|
975
|
+
NumberishBlockNumberZod,
|
|
976
|
+
NumberishEthBlockNumberZod,
|
|
977
|
+
NumberishXL1BlockNumberZod,
|
|
978
|
+
NumberishZod,
|
|
952
979
|
PicoXL1,
|
|
953
980
|
PicoXL1MaxValue,
|
|
954
981
|
ShiftedBigInt,
|
|
@@ -961,6 +988,7 @@ export {
|
|
|
961
988
|
ValidationError,
|
|
962
989
|
XL1,
|
|
963
990
|
XL1Amount,
|
|
991
|
+
XL1BlockNumberZod,
|
|
964
992
|
XL1MaxValue,
|
|
965
993
|
XL1Places,
|
|
966
994
|
XL1_BLOCK_NUMBER_ZERO,
|
|
@@ -986,19 +1014,18 @@ export {
|
|
|
986
1014
|
asBlockNumber,
|
|
987
1015
|
asBlockNumberPayload,
|
|
988
1016
|
asBlockNumberPayloadWithSources,
|
|
989
|
-
asBlockRange,
|
|
990
1017
|
asBridgeDestinationObservation,
|
|
991
1018
|
asBridgeIntent,
|
|
992
1019
|
asBridgeSourceObservation,
|
|
993
1020
|
asChainStakeIntent,
|
|
994
1021
|
asEthBlockNumber,
|
|
995
|
-
asEthBlockRange,
|
|
996
1022
|
asExecutable,
|
|
997
1023
|
asFemtoXL1,
|
|
998
1024
|
asHashPayload,
|
|
999
1025
|
asHashPayloadWithStorageMeta,
|
|
1000
1026
|
asHydratedBlock,
|
|
1001
1027
|
asHydratedTransaction,
|
|
1028
|
+
asHydratedTransactionWithHashMeta,
|
|
1002
1029
|
asHydratedTransactionWithStorageMeta,
|
|
1003
1030
|
asMicroXL1,
|
|
1004
1031
|
asMilliXL1,
|
|
@@ -1008,6 +1035,7 @@ export {
|
|
|
1008
1035
|
asSignedBlockBoundWitnessWithHashMeta,
|
|
1009
1036
|
asSignedBlockBoundWitnessWithStorageMeta,
|
|
1010
1037
|
asSignedHydratedTransaction,
|
|
1038
|
+
asSignedHydratedTransactionWithHashMeta,
|
|
1011
1039
|
asSignedHydratedTransactionWithStorageMeta,
|
|
1012
1040
|
asStepComplete,
|
|
1013
1041
|
asStepIdentity,
|
|
@@ -1024,12 +1052,8 @@ export {
|
|
|
1024
1052
|
asValidStep,
|
|
1025
1053
|
asXL1,
|
|
1026
1054
|
asXL1BlockNumber,
|
|
1027
|
-
asXL1BlockRange,
|
|
1028
1055
|
defaultRewardRatio,
|
|
1029
1056
|
defaultTransactionFees,
|
|
1030
|
-
fromBlockNumberKey,
|
|
1031
|
-
fromEthBlockNumberKey,
|
|
1032
|
-
fromXL1BlockNumberKey,
|
|
1033
1057
|
hasFrom,
|
|
1034
1058
|
isAllowedBlockPayload,
|
|
1035
1059
|
isAllowedBlockPayloadSchema,
|
|
@@ -1054,6 +1078,7 @@ export {
|
|
|
1054
1078
|
isHydratedBoundWitnessValidationError,
|
|
1055
1079
|
isHydratedTransaction,
|
|
1056
1080
|
isHydratedTransactionValidationError,
|
|
1081
|
+
isHydratedTransactionWithHashMeta,
|
|
1057
1082
|
isHydratedTransactionWithStorageMeta,
|
|
1058
1083
|
isInBlockPayloadValidationError,
|
|
1059
1084
|
isMicroXL1,
|
|
@@ -1066,6 +1091,7 @@ export {
|
|
|
1066
1091
|
isSignedBlockBoundWitnessWithHashMeta,
|
|
1067
1092
|
isSignedBlockBoundWitnessWithStorageMeta,
|
|
1068
1093
|
isSignedHydratedTransaction,
|
|
1094
|
+
isSignedHydratedTransactionWithHashMeta,
|
|
1069
1095
|
isSignedHydratedTransactionWithStorageMeta,
|
|
1070
1096
|
isSignedTransactionBoundWitness,
|
|
1071
1097
|
isSignedTransactionBoundWitnessWithHashMeta,
|
|
@@ -1088,14 +1114,17 @@ export {
|
|
|
1088
1114
|
splitOnDecimalToString,
|
|
1089
1115
|
stepSize,
|
|
1090
1116
|
toAttoXL1,
|
|
1091
|
-
|
|
1092
|
-
|
|
1117
|
+
toBlockNumber,
|
|
1118
|
+
toEthBlockNumber,
|
|
1093
1119
|
toFemtoXL1,
|
|
1094
1120
|
toMicroXL1,
|
|
1095
1121
|
toMilliXL1,
|
|
1096
1122
|
toNanoXL1,
|
|
1097
1123
|
toPicoXL1,
|
|
1098
1124
|
toXL1,
|
|
1099
|
-
|
|
1125
|
+
toXL1BlockNumber,
|
|
1126
|
+
zodAsFactory,
|
|
1127
|
+
zodIsFactory,
|
|
1128
|
+
zodToFactory
|
|
1100
1129
|
};
|
|
1101
1130
|
//# sourceMappingURL=index.mjs.map
|