@xyo-network/react-chain-blockchain 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.mjs +175 -147
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/FeatureNotAvailable.d.ts +6 -0
- package/dist/types/components/FeatureNotAvailable.d.ts.map +1 -0
- package/dist/types/components/block/table/cell/Hash.d.ts +1 -0
- package/dist/types/components/block/table/cell/Hash.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/JsonView.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/Producer.d.ts +1 -0
- package/dist/types/components/block/table/cell/Producer.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/components/FeatureNotAvailable.tsx +20 -0
- package/src/components/block/table/cell/Hash.tsx +9 -2
- package/src/components/block/table/cell/JsonView.tsx +2 -0
- package/src/components/block/table/cell/Producer.tsx +8 -2
- package/src/components/block/table/row/TableRow.tsx +2 -2
- package/src/components/index.ts +1 -0
package/dist/browser/index.mjs
CHANGED
|
@@ -716,62 +716,81 @@ var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props })
|
|
|
716
716
|
import { Avatar, Chip as Chip3, TableCell as TableCell2, Tooltip as Tooltip2 } from "@mui/material";
|
|
717
717
|
import { Identicon } from "@xylabs/react-identicon";
|
|
718
718
|
import { usePayloadHash as usePayloadHash2 } from "@xyo-network/react-shared";
|
|
719
|
+
import React16 from "react";
|
|
720
|
+
|
|
721
|
+
// src/components/FeatureNotAvailable.tsx
|
|
722
|
+
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
719
723
|
import React15 from "react";
|
|
720
|
-
var
|
|
724
|
+
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */ React15.createElement(Dialog, props, /* @__PURE__ */ React15.createElement(DialogTitle, null, `${featureName} Not Available`), /* @__PURE__ */ React15.createElement(DialogContent, null, "This feature is not currently available. Either you do not have access to it or it is currently undergoing maintenance."), /* @__PURE__ */ React15.createElement(DialogActions, null, /* @__PURE__ */ React15.createElement(Button2, {
|
|
725
|
+
onClick: /* @__PURE__ */ __name((e) => props.onClose?.(e, "backdropClick"), "onClick")
|
|
726
|
+
}, "Close"))), "FeatureNotAvailable");
|
|
727
|
+
|
|
728
|
+
// src/components/block/table/cell/Hash.tsx
|
|
729
|
+
var BlockHashTableCell = /* @__PURE__ */ __name(({ block, identiconProps, notAvailableDialog, linked, ...props }) => {
|
|
721
730
|
const hash = usePayloadHash2(block?.[0]);
|
|
722
731
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
732
|
+
const [notAvailable, setNotAvailable] = React16.useState(false);
|
|
723
733
|
const shortenedHash = hash ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` : "";
|
|
724
|
-
return /* @__PURE__ */
|
|
734
|
+
return /* @__PURE__ */ React16.createElement(TableCell2, {
|
|
725
735
|
ref,
|
|
726
736
|
...props
|
|
727
|
-
}, hash ? /* @__PURE__ */
|
|
737
|
+
}, hash ? /* @__PURE__ */ React16.createElement(Tooltip2, {
|
|
728
738
|
title: `Block Hash: ${hash}`
|
|
729
|
-
}, /* @__PURE__ */
|
|
730
|
-
avatar: /* @__PURE__ */
|
|
739
|
+
}, /* @__PURE__ */ React16.createElement(Chip3, {
|
|
740
|
+
avatar: /* @__PURE__ */ React16.createElement(Avatar, {
|
|
731
741
|
sx: {
|
|
732
742
|
background: "white"
|
|
733
743
|
}
|
|
734
|
-
}, /* @__PURE__ */
|
|
744
|
+
}, /* @__PURE__ */ React16.createElement(Identicon, {
|
|
735
745
|
size: 16,
|
|
736
746
|
value: hash,
|
|
737
747
|
...identiconProps
|
|
738
748
|
})),
|
|
749
|
+
sx: {
|
|
750
|
+
cursor: "pointer"
|
|
751
|
+
},
|
|
739
752
|
label: shortenedHash,
|
|
740
|
-
onClick: linked ? handleClick :
|
|
741
|
-
})) : null
|
|
753
|
+
onClick: linked ? handleClick : () => setNotAvailable(true)
|
|
754
|
+
})) : null, notAvailableDialog && notAvailable ? /* @__PURE__ */ React16.createElement(FeatureNotAvailable, {
|
|
755
|
+
featureName: "Block Details",
|
|
756
|
+
open: notAvailable,
|
|
757
|
+
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
758
|
+
}) : null);
|
|
742
759
|
}, "BlockHashTableCell");
|
|
743
760
|
|
|
744
761
|
// src/components/block/table/cell/JsonView.tsx
|
|
745
762
|
import { Code } from "@mui/icons-material";
|
|
746
|
-
import { Button as
|
|
763
|
+
import { Button as Button3, Dialog as Dialog2, DialogActions as DialogActions2, DialogContent as DialogContent2, DialogTitle as DialogTitle2, IconButton as IconButton2, TableCell as TableCell3 } from "@mui/material";
|
|
747
764
|
import { ellipsize } from "@xylabs/eth-address";
|
|
748
765
|
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
766
|
+
import { useIsDark } from "@xylabs/react-theme";
|
|
749
767
|
import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
|
|
750
768
|
import { usePayloadHash as usePayloadHash3 } from "@xyo-network/react-shared";
|
|
751
|
-
import
|
|
769
|
+
import React17, { useState as useState9 } from "react";
|
|
752
770
|
var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
753
771
|
const [open, setOpen] = useState9(false);
|
|
754
772
|
const onClose = /* @__PURE__ */ __name(() => setOpen(false), "onClose");
|
|
773
|
+
const isDark = useIsDark();
|
|
755
774
|
const hash = usePayloadHash3(block?.[0]);
|
|
756
775
|
const title = hash ? `JSON for ${ellipsize(hash, 5)}` : "JSON";
|
|
757
|
-
return /* @__PURE__ */
|
|
776
|
+
return /* @__PURE__ */ React17.createElement(TableCell3, props, /* @__PURE__ */ React17.createElement(FlexRow3, {
|
|
758
777
|
sx: {
|
|
759
778
|
width: "100%"
|
|
760
779
|
}
|
|
761
|
-
}, /* @__PURE__ */
|
|
780
|
+
}, /* @__PURE__ */ React17.createElement(IconButton2, {
|
|
762
781
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
763
|
-
}, /* @__PURE__ */
|
|
782
|
+
}, /* @__PURE__ */ React17.createElement(Code, null))), /* @__PURE__ */ React17.createElement(Dialog2, {
|
|
764
783
|
open,
|
|
765
784
|
onClose
|
|
766
|
-
}, /* @__PURE__ */
|
|
785
|
+
}, /* @__PURE__ */ React17.createElement(DialogTitle2, null, title), /* @__PURE__ */ React17.createElement(DialogContent2, null, /* @__PURE__ */ React17.createElement(JsonViewerEx, {
|
|
767
786
|
value: block
|
|
768
|
-
})), /* @__PURE__ */
|
|
787
|
+
})), /* @__PURE__ */ React17.createElement(DialogActions2, {
|
|
769
788
|
sx: {
|
|
770
789
|
display: "flex",
|
|
771
790
|
flexDirection: "row",
|
|
772
791
|
justifyContent: "end"
|
|
773
792
|
}
|
|
774
|
-
}, /* @__PURE__ */
|
|
793
|
+
}, /* @__PURE__ */ React17.createElement(Button3, {
|
|
775
794
|
variant: "contained",
|
|
776
795
|
onClick: onClose
|
|
777
796
|
}, "Close"))));
|
|
@@ -780,41 +799,49 @@ var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
780
799
|
// src/components/block/table/cell/Producer.tsx
|
|
781
800
|
import { TableCell as TableCell4, Tooltip as Tooltip3 } from "@mui/material";
|
|
782
801
|
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
783
|
-
import
|
|
784
|
-
var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, producerChipProps, ...props }) => {
|
|
802
|
+
import React18 from "react";
|
|
803
|
+
var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
785
804
|
const [ref, handleClick] = useLinkedBlockItem("block-producer", JSON.stringify(block));
|
|
786
805
|
const producer = useBlockProducer(block);
|
|
787
|
-
|
|
806
|
+
const [notAvailable, setNotAvailable] = React18.useState(false);
|
|
807
|
+
return /* @__PURE__ */ React18.createElement(TableCell4, {
|
|
788
808
|
ref,
|
|
789
809
|
...props
|
|
790
|
-
}, /* @__PURE__ */
|
|
810
|
+
}, /* @__PURE__ */ React18.createElement(Tooltip3, {
|
|
791
811
|
title: `Block Producer: ${producer}`
|
|
792
|
-
}, /* @__PURE__ */
|
|
812
|
+
}, /* @__PURE__ */ React18.createElement(FlexRow4, {
|
|
793
813
|
sx: {
|
|
794
814
|
width: "100%"
|
|
795
815
|
}
|
|
796
|
-
}, /* @__PURE__ */
|
|
797
|
-
|
|
816
|
+
}, /* @__PURE__ */ React18.createElement(BlockProducerChip, {
|
|
817
|
+
sx: {
|
|
818
|
+
cursor: "pointer"
|
|
819
|
+
},
|
|
820
|
+
onClick: linked ? handleClick : () => setNotAvailable(true),
|
|
798
821
|
block,
|
|
799
822
|
...producerChipProps
|
|
800
|
-
})))
|
|
823
|
+
}))), notAvailableDialog && notAvailable ? /* @__PURE__ */ React18.createElement(FeatureNotAvailable, {
|
|
824
|
+
featureName: "Producer Details",
|
|
825
|
+
open: notAvailable,
|
|
826
|
+
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
827
|
+
}) : null);
|
|
801
828
|
}, "BlockProducerTableCell");
|
|
802
829
|
|
|
803
830
|
// src/components/block/table/cell/TransactionCount.tsx
|
|
804
831
|
import { Error as Error2 } from "@mui/icons-material";
|
|
805
832
|
import { Link as Link2, TableCell as TableCell5, Tooltip as Tooltip4 } from "@mui/material";
|
|
806
|
-
import
|
|
833
|
+
import React19 from "react";
|
|
807
834
|
var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
808
835
|
const [txs, error] = useTxsFromBlock(block);
|
|
809
836
|
const [ref, handleClick] = useLinkedBlockItem("transaction-count", JSON.stringify(txs ?? null));
|
|
810
|
-
return /* @__PURE__ */
|
|
837
|
+
return /* @__PURE__ */ React19.createElement(TableCell5, {
|
|
811
838
|
ref,
|
|
812
839
|
...props
|
|
813
|
-
}, /* @__PURE__ */
|
|
840
|
+
}, /* @__PURE__ */ React19.createElement("span", null, error ? /* @__PURE__ */ React19.createElement(Tooltip4, {
|
|
814
841
|
title: error.message
|
|
815
|
-
}, /* @__PURE__ */
|
|
842
|
+
}, /* @__PURE__ */ React19.createElement(Error2, {
|
|
816
843
|
color: "error"
|
|
817
|
-
})) : null, linked ? /* @__PURE__ */
|
|
844
|
+
})) : null, linked ? /* @__PURE__ */ React19.createElement(Link2, {
|
|
818
845
|
onClick: handleClick,
|
|
819
846
|
sx: {
|
|
820
847
|
cursor: "pointer"
|
|
@@ -826,17 +853,17 @@ var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ..
|
|
|
826
853
|
import { TableCell as TableCell6 } from "@mui/material";
|
|
827
854
|
import { FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
|
828
855
|
import { BWVerification as BWVerification2 } from "@xyo-network/react-chain-boundwitness";
|
|
829
|
-
import
|
|
856
|
+
import React20 from "react";
|
|
830
857
|
var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
831
858
|
const [ref, handleClick] = useLinkedBlockItem("block-verification", block?.[0].block.toString());
|
|
832
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ React20.createElement(TableCell6, {
|
|
833
860
|
ref,
|
|
834
861
|
...props
|
|
835
|
-
}, /* @__PURE__ */
|
|
862
|
+
}, /* @__PURE__ */ React20.createElement(FlexRow5, {
|
|
836
863
|
sx: {
|
|
837
864
|
width: "100%"
|
|
838
865
|
}
|
|
839
|
-
}, /* @__PURE__ */
|
|
866
|
+
}, /* @__PURE__ */ React20.createElement(BWVerification2, {
|
|
840
867
|
onClick: linked ? handleClick : void 0,
|
|
841
868
|
iconColors: true,
|
|
842
869
|
boundwitness: block?.[0]
|
|
@@ -846,33 +873,33 @@ var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, ...pro
|
|
|
846
873
|
// src/components/block/table/Ex.tsx
|
|
847
874
|
import { TableBody } from "@mui/material";
|
|
848
875
|
import { TableEx } from "@xyo-network/react-table";
|
|
849
|
-
import
|
|
876
|
+
import React22 from "react";
|
|
850
877
|
|
|
851
878
|
// src/components/block/table/head/TableHead.tsx
|
|
852
879
|
import { TableCell as TableCell7, TableHead, TableRow } from "@mui/material";
|
|
853
|
-
import
|
|
880
|
+
import React21 from "react";
|
|
854
881
|
var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
855
|
-
return /* @__PURE__ */
|
|
882
|
+
return /* @__PURE__ */ React21.createElement(TableHead, null, /* @__PURE__ */ React21.createElement(TableRow, null, /* @__PURE__ */ React21.createElement(TableCell7, null, "Block Hash"), /* @__PURE__ */ React21.createElement(TableCell7, null, "Block Number"), /* @__PURE__ */ React21.createElement(TableCell7, null, "Transaction Count"), /* @__PURE__ */ React21.createElement(TableCell7, {
|
|
856
883
|
align: "center"
|
|
857
|
-
}, "Block Producer"), /* @__PURE__ */
|
|
884
|
+
}, "Block Producer"), /* @__PURE__ */ React21.createElement(TableCell7, {
|
|
858
885
|
align: "center"
|
|
859
|
-
}, "Valid"), /* @__PURE__ */
|
|
886
|
+
}, "Valid"), /* @__PURE__ */ React21.createElement(TableCell7, {
|
|
860
887
|
align: "center"
|
|
861
888
|
}, "JSON")));
|
|
862
889
|
}, "BlockchainTableHead");
|
|
863
890
|
|
|
864
891
|
// src/components/block/table/Ex.tsx
|
|
865
892
|
var BlockchainTableEx = /* @__PURE__ */ __name(({ ref, children, ...props }) => {
|
|
866
|
-
return /* @__PURE__ */
|
|
893
|
+
return /* @__PURE__ */ React22.createElement(TableEx, {
|
|
867
894
|
ref,
|
|
868
895
|
...props
|
|
869
|
-
}, /* @__PURE__ */
|
|
896
|
+
}, /* @__PURE__ */ React22.createElement(BlockchainTableHead, null), /* @__PURE__ */ React22.createElement(TableBody, null, children));
|
|
870
897
|
}, "BlockchainTableEx");
|
|
871
898
|
BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
872
899
|
|
|
873
900
|
// src/components/block/table/row/TableRow.tsx
|
|
874
901
|
import { TableRow as TableRow2 } from "@mui/material";
|
|
875
|
-
import
|
|
902
|
+
import React23, { useMemo as useMemo8 } from "react";
|
|
876
903
|
var BlockChainTableRow = /* @__PURE__ */ __name(({ block, defaultExpanded, linked, sx, ...props }) => {
|
|
877
904
|
const linkedTableCellProps = useMemo8(() => ({
|
|
878
905
|
block,
|
|
@@ -886,42 +913,42 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, defaultExpanded, linke
|
|
|
886
913
|
}), [
|
|
887
914
|
block
|
|
888
915
|
]);
|
|
889
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ React23.createElement(TableRow2, {
|
|
890
917
|
sx: {
|
|
891
918
|
overflowY: "scroll",
|
|
892
919
|
...sx
|
|
893
920
|
},
|
|
894
921
|
...props
|
|
895
|
-
}, /* @__PURE__ */
|
|
922
|
+
}, /* @__PURE__ */ React23.createElement(BlockHashTableCell, linkedTableCellProps), /* @__PURE__ */ React23.createElement(BlockNumberTableCell, linkedTableCellProps), /* @__PURE__ */ React23.createElement(BlockTransactionCountTableCell, linkedTableCellProps), /* @__PURE__ */ React23.createElement(BlockProducerTableCell, linkedTableCellProps), /* @__PURE__ */ React23.createElement(BlockVerificationTableCell, defaultTableCellProps), /* @__PURE__ */ React23.createElement(BlockJsonViewTableCell, defaultTableCellProps));
|
|
896
923
|
}, "BlockChainTableRow");
|
|
897
924
|
|
|
898
925
|
// src/components/chain/controls/PollingControlsFlexbox.tsx
|
|
899
926
|
import { Autorenew, Pause } from "@mui/icons-material";
|
|
900
927
|
import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip5 } from "@mui/material";
|
|
901
928
|
import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
|
|
902
|
-
import
|
|
929
|
+
import React28, { memo } from "react";
|
|
903
930
|
|
|
904
931
|
// src/components/chain/stats/Dialog.tsx
|
|
905
932
|
import { QueryStats } from "@mui/icons-material";
|
|
906
|
-
import { Dialog as
|
|
907
|
-
import
|
|
933
|
+
import { Dialog as Dialog3, DialogContent as DialogContent3, DialogTitle as DialogTitle3, IconButton as IconButton3 } from "@mui/material";
|
|
934
|
+
import React26, { useState as useState10 } from "react";
|
|
908
935
|
|
|
909
936
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
910
937
|
import { ListItem, styled, Typography as Typography3 } from "@mui/material";
|
|
911
938
|
import { ErrorRender as ErrorRender3 } from "@xylabs/react-error";
|
|
912
939
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
913
940
|
import { isChainSummaryProducers } from "@xyo-network/chain-protocol";
|
|
914
|
-
import
|
|
941
|
+
import React25, { useMemo as useMemo9 } from "react";
|
|
915
942
|
|
|
916
943
|
// src/components/chain/stats/producer/Table.tsx
|
|
917
944
|
import { Table, TableBody as TableBody2, TableCell as TableCell8, TableHead as TableHead2, TableRow as TableRow3, useTheme } from "@mui/material";
|
|
918
945
|
import { BlockiesAvatar as BlockiesAvatar2 } from "@xyo-network/react-chain-blockies";
|
|
919
|
-
import
|
|
946
|
+
import React24 from "react";
|
|
920
947
|
var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) => {
|
|
921
948
|
const theme = useTheme();
|
|
922
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ React24.createElement(Table, props, /* @__PURE__ */ React24.createElement(TableHead2, null, /* @__PURE__ */ React24.createElement(TableRow3, null, /* @__PURE__ */ React24.createElement(TableCell8, null, "Address"), /* @__PURE__ */ React24.createElement(TableCell8, null, "Blocks Produced"), /* @__PURE__ */ React24.createElement(TableCell8, null, "Rewards Earned Produced"))), /* @__PURE__ */ React24.createElement(TableBody2, null, producers?.map((producer) => /* @__PURE__ */ React24.createElement(TableRow3, {
|
|
923
950
|
key: producer.address
|
|
924
|
-
}, /* @__PURE__ */
|
|
951
|
+
}, /* @__PURE__ */ React24.createElement(TableCell8, null, /* @__PURE__ */ React24.createElement(BlockiesAvatar2, {
|
|
925
952
|
blockiesOptions: {
|
|
926
953
|
seed: producer.address
|
|
927
954
|
},
|
|
@@ -929,7 +956,7 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
|
|
|
929
956
|
height: theme.spacing(2.75),
|
|
930
957
|
width: theme.spacing(2.75)
|
|
931
958
|
}
|
|
932
|
-
})), /* @__PURE__ */
|
|
959
|
+
})), /* @__PURE__ */ React24.createElement(TableCell8, null, producer.blocksProduced.toString()), /* @__PURE__ */ React24.createElement(TableCell8, null, producer.rewardsEarned.toString())))));
|
|
933
960
|
}, "ChainProducerStatsTable");
|
|
934
961
|
|
|
935
962
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
@@ -951,16 +978,16 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
|
|
|
951
978
|
const producersArray = useMemo9(() => Object.values(producer?.producers ?? {}), [
|
|
952
979
|
producer
|
|
953
980
|
]);
|
|
954
|
-
return /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ React25.createElement(FlexCol3, {
|
|
955
982
|
alignItems: "start",
|
|
956
983
|
gap: 1,
|
|
957
984
|
...props
|
|
958
|
-
}, /* @__PURE__ */
|
|
985
|
+
}, /* @__PURE__ */ React25.createElement(ErrorRender3, {
|
|
959
986
|
error: producerError,
|
|
960
987
|
scope: "BlockProducerStatsFlexbox"
|
|
961
|
-
}), /* @__PURE__ */
|
|
988
|
+
}), /* @__PURE__ */ React25.createElement(Typography3, {
|
|
962
989
|
fontSize: "1rem"
|
|
963
|
-
}, "Block Producers"), /* @__PURE__ */
|
|
990
|
+
}, "Block Producers"), /* @__PURE__ */ React25.createElement(ChainProducerStatsTable, {
|
|
964
991
|
producers: producersArray
|
|
965
992
|
}));
|
|
966
993
|
}, "BlockProducerStatsFlexbox");
|
|
@@ -972,18 +999,18 @@ var StyledListItem = styled(ListItem)(() => ({
|
|
|
972
999
|
// src/components/chain/stats/Dialog.tsx
|
|
973
1000
|
var ChainAnalyzerStatsDialog = /* @__PURE__ */ __name((props) => {
|
|
974
1001
|
const { analyzers, statsUpdated } = useChainAnalyzersContext();
|
|
975
|
-
return /* @__PURE__ */
|
|
1002
|
+
return /* @__PURE__ */ React26.createElement(Dialog3, props, /* @__PURE__ */ React26.createElement(DialogTitle3, null, "Chain Analysis"), /* @__PURE__ */ React26.createElement(DialogContent3, null, !!statsUpdated && Object.entries(analyzers).map(([id2, analyzer]) => /* @__PURE__ */ React26.createElement("div", {
|
|
976
1003
|
key: id2
|
|
977
|
-
}, id2 === "producers" && /* @__PURE__ */
|
|
1004
|
+
}, id2 === "producers" && /* @__PURE__ */ React26.createElement(BlockProducerStatsFlexbox, {
|
|
978
1005
|
payload: analyzer.result()
|
|
979
1006
|
})))));
|
|
980
1007
|
}, "ChainAnalyzerStatsDialog");
|
|
981
1008
|
var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
982
1009
|
const [open, setOpen] = useState10(false);
|
|
983
1010
|
const handleClose = /* @__PURE__ */ __name(() => setOpen(false), "handleClose");
|
|
984
|
-
return /* @__PURE__ */
|
|
1011
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(IconButton3, {
|
|
985
1012
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
986
|
-
}, /* @__PURE__ */
|
|
1013
|
+
}, /* @__PURE__ */ React26.createElement(QueryStats, null)), /* @__PURE__ */ React26.createElement(ChainAnalyzerStatsDialog, {
|
|
987
1014
|
onClose: handleClose,
|
|
988
1015
|
open,
|
|
989
1016
|
...props
|
|
@@ -992,19 +1019,19 @@ var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
|
992
1019
|
|
|
993
1020
|
// src/components/chain/controls/PulseSvgIcon.tsx
|
|
994
1021
|
import { alpha, createSvgIcon, keyframes, styled as styled2 } from "@mui/material";
|
|
995
|
-
import
|
|
996
|
-
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */
|
|
1022
|
+
import React27 from "react";
|
|
1023
|
+
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */ React27.createElement("svg", {
|
|
997
1024
|
viewBox: "0 0 80 80",
|
|
998
1025
|
version: "1.1",
|
|
999
1026
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1000
|
-
}, /* @__PURE__ */
|
|
1027
|
+
}, /* @__PURE__ */ React27.createElement("g", {
|
|
1001
1028
|
transform: "translate(34,34)"
|
|
1002
|
-
}, /* @__PURE__ */
|
|
1029
|
+
}, /* @__PURE__ */ React27.createElement("circle", {
|
|
1003
1030
|
className: "core",
|
|
1004
1031
|
cx: "0",
|
|
1005
1032
|
cy: "0",
|
|
1006
1033
|
r: "6"
|
|
1007
|
-
}), /* @__PURE__ */
|
|
1034
|
+
}), /* @__PURE__ */ React27.createElement("circle", {
|
|
1008
1035
|
className: "radar",
|
|
1009
1036
|
cx: "0",
|
|
1010
1037
|
cy: "0",
|
|
@@ -1068,24 +1095,24 @@ var StyledPulseSvgIcon = styled2(PulseSvgIcon)(({ theme }) => {
|
|
|
1068
1095
|
var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingState, setPollingState }) => {
|
|
1069
1096
|
const paused = pollingState === "paused";
|
|
1070
1097
|
const running = pollingState === "running";
|
|
1071
|
-
return /* @__PURE__ */
|
|
1098
|
+
return /* @__PURE__ */ React28.createElement(FlexRow6, {
|
|
1072
1099
|
justifyContent: "space-between",
|
|
1073
1100
|
width: "100%"
|
|
1074
|
-
}, /* @__PURE__ */
|
|
1101
|
+
}, /* @__PURE__ */ React28.createElement(FlexRow6, {
|
|
1075
1102
|
gap: 2
|
|
1076
|
-
}, running && /* @__PURE__ */
|
|
1103
|
+
}, running && /* @__PURE__ */ React28.createElement(IconButton4, {
|
|
1077
1104
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("paused"), "onClick"),
|
|
1078
1105
|
title: "Pause Block Stream"
|
|
1079
|
-
}, /* @__PURE__ */
|
|
1106
|
+
}, /* @__PURE__ */ React28.createElement(Pause, null)), paused && /* @__PURE__ */ React28.createElement(IconButton4, {
|
|
1080
1107
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick"),
|
|
1081
1108
|
title: "Re-Sync Block Stream"
|
|
1082
|
-
}, /* @__PURE__ */
|
|
1109
|
+
}, /* @__PURE__ */ React28.createElement(Autorenew, null)), /* @__PURE__ */ React28.createElement(ChainAnalyzerStatsDialogFromContext, null)), /* @__PURE__ */ React28.createElement(FlexRow6, {
|
|
1083
1110
|
gap: 2
|
|
1084
|
-
}, /* @__PURE__ */
|
|
1111
|
+
}, /* @__PURE__ */ React28.createElement(Grow, {
|
|
1085
1112
|
in: (blocksBehind ?? 0) > 0
|
|
1086
|
-
}, /* @__PURE__ */
|
|
1113
|
+
}, /* @__PURE__ */ React28.createElement(Tooltip5, {
|
|
1087
1114
|
title: "Click to Re-Sync"
|
|
1088
|
-
}, /* @__PURE__ */
|
|
1115
|
+
}, /* @__PURE__ */ React28.createElement(Alert3, {
|
|
1089
1116
|
sx: {
|
|
1090
1117
|
py: 0,
|
|
1091
1118
|
px: 1,
|
|
@@ -1093,21 +1120,21 @@ var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingStat
|
|
|
1093
1120
|
},
|
|
1094
1121
|
severity: "warning",
|
|
1095
1122
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick")
|
|
1096
|
-
}, /* @__PURE__ */
|
|
1123
|
+
}, /* @__PURE__ */ React28.createElement(AlertTitle2, {
|
|
1097
1124
|
sx: {
|
|
1098
1125
|
mb: 0
|
|
1099
1126
|
}
|
|
1100
|
-
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */
|
|
1127
|
+
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */ React28.createElement(Icon2, null, /* @__PURE__ */ React28.createElement(StyledPulseSvgIcon, {
|
|
1101
1128
|
className: running ? "" : "paused"
|
|
1102
1129
|
}))));
|
|
1103
1130
|
}, "PollingControlsFlexbox");
|
|
1104
1131
|
var MemoizedPollingControlsFlexbox = /* @__PURE__ */ memo(PollingControlsFlexbox);
|
|
1105
1132
|
|
|
1106
1133
|
// src/components/chain/dialog/Dialog.tsx
|
|
1107
|
-
import { Button as
|
|
1108
|
-
import
|
|
1134
|
+
import { Button as Button4, Dialog as Dialog4, DialogActions as DialogActions3, DialogContent as DialogContent4 } from "@mui/material";
|
|
1135
|
+
import React29 from "react";
|
|
1109
1136
|
var TransactionsDialog = /* @__PURE__ */ __name((props) => {
|
|
1110
|
-
return /* @__PURE__ */
|
|
1137
|
+
return /* @__PURE__ */ React29.createElement(Dialog4, props, /* @__PURE__ */ React29.createElement(DialogContent4, null, "Transactions Dialog"), /* @__PURE__ */ React29.createElement(DialogActions3, null, /* @__PURE__ */ React29.createElement(Button4, {
|
|
1111
1138
|
variant: "outlined",
|
|
1112
1139
|
onClick: /* @__PURE__ */ __name((e) => props?.onClose?.(e, "escapeKeyDown"), "onClick")
|
|
1113
1140
|
}, "Close")));
|
|
@@ -1147,9 +1174,9 @@ var useOnBlock = /* @__PURE__ */ __name((initialHeadNumber, onAddBlock, liveHead
|
|
|
1147
1174
|
|
|
1148
1175
|
// src/components/chain/pagination/BlockChainPagination.tsx
|
|
1149
1176
|
import { TablePaginationActions } from "@xyo-network/react-payload-table";
|
|
1150
|
-
import
|
|
1177
|
+
import React30 from "react";
|
|
1151
1178
|
var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, page, rowsPerPage = 10 }) => {
|
|
1152
|
-
return /* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ React30.createElement(TablePaginationActions, {
|
|
1153
1180
|
count,
|
|
1154
1181
|
onPageChange,
|
|
1155
1182
|
page,
|
|
@@ -1183,11 +1210,11 @@ var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
|
1183
1210
|
// src/components/chain/render/dynamic/flexbox/variants/Base.tsx
|
|
1184
1211
|
import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
|
|
1185
1212
|
import { FlexCol as FlexCol5 } from "@xylabs/react-flexbox";
|
|
1186
|
-
import
|
|
1213
|
+
import React32 from "react";
|
|
1187
1214
|
|
|
1188
1215
|
// src/components/chain/list/Animated.tsx
|
|
1189
1216
|
import { AnimatedList } from "@xylabs/react-animation";
|
|
1190
|
-
import
|
|
1217
|
+
import React31 from "react";
|
|
1191
1218
|
|
|
1192
1219
|
// src/components/chain/styled/BlockListWrapperFlexbox.tsx
|
|
1193
1220
|
import { styled as styled3 } from "@mui/material";
|
|
@@ -1208,10 +1235,10 @@ var BlockListWrapperFlexBox = styled3(FlexCol4, {
|
|
|
1208
1235
|
|
|
1209
1236
|
// src/components/chain/list/Animated.tsx
|
|
1210
1237
|
var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents }) => {
|
|
1211
|
-
return /* @__PURE__ */
|
|
1238
|
+
return /* @__PURE__ */ React31.createElement(BlockListWrapperFlexBox, {
|
|
1212
1239
|
alignItems: "stretch",
|
|
1213
1240
|
width: "100%"
|
|
1214
|
-
}, /* @__PURE__ */
|
|
1241
|
+
}, /* @__PURE__ */ React31.createElement(AnimatedList, {
|
|
1215
1242
|
fullWidth: true,
|
|
1216
1243
|
items: blockChainRenderComponents
|
|
1217
1244
|
}));
|
|
@@ -1553,25 +1580,25 @@ var useRemoteBlockChainRenderProps = /* @__PURE__ */ __name((chainArchivistModul
|
|
|
1553
1580
|
// src/components/chain/render/dynamic/flexbox/variants/Base.tsx
|
|
1554
1581
|
var DynamicListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1555
1582
|
const { errors, blockChainRenderComponents, blocksWhilePaused, pollingState, updatePollingState } = useDynamicBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1556
|
-
return /* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ React32.createElement(FlexCol5, {
|
|
1557
1584
|
alignItems: "start",
|
|
1558
1585
|
...props
|
|
1559
|
-
}, errors?.map((error) => /* @__PURE__ */
|
|
1586
|
+
}, errors?.map((error) => /* @__PURE__ */ React32.createElement(ErrorRender4, {
|
|
1560
1587
|
error,
|
|
1561
1588
|
key: error?.name,
|
|
1562
1589
|
scope: "DynamicBlockchainRenderFlexboxInner"
|
|
1563
|
-
})), /* @__PURE__ */
|
|
1590
|
+
})), /* @__PURE__ */ React32.createElement(MemoizedPollingControlsFlexbox, {
|
|
1564
1591
|
blocksBehind: blocksWhilePaused?.length,
|
|
1565
1592
|
pollingState,
|
|
1566
1593
|
setPollingState: updatePollingState
|
|
1567
|
-
}), /* @__PURE__ */
|
|
1594
|
+
}), /* @__PURE__ */ React32.createElement(BlockListAnimated, {
|
|
1568
1595
|
blockChainRenderComponents
|
|
1569
1596
|
}));
|
|
1570
1597
|
}, "DynamicListBase");
|
|
1571
1598
|
|
|
1572
1599
|
// src/components/chain/render/dynamic/flexbox/variants/WithAnalysis.tsx
|
|
1573
1600
|
import { ChainProducersAnalyzer } from "@xyo-network/chain-protocol";
|
|
1574
|
-
import
|
|
1601
|
+
import React33, { useMemo as useMemo14 } from "react";
|
|
1575
1602
|
var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1576
1603
|
const { chainInformation } = blockChainRenderProps ?? {};
|
|
1577
1604
|
const analyzers = useMemo14(() => {
|
|
@@ -1583,9 +1610,9 @@ var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1583
1610
|
}, [
|
|
1584
1611
|
chainInformation
|
|
1585
1612
|
]);
|
|
1586
|
-
return /* @__PURE__ */
|
|
1613
|
+
return /* @__PURE__ */ React33.createElement(ChainAnalyzersProvider, {
|
|
1587
1614
|
analyzers
|
|
1588
|
-
}, /* @__PURE__ */
|
|
1615
|
+
}, /* @__PURE__ */ React33.createElement(ChainPollingProvider, null, /* @__PURE__ */ React33.createElement(DynamicListBase, {
|
|
1589
1616
|
blockChainRenderProps,
|
|
1590
1617
|
...props
|
|
1591
1618
|
})));
|
|
@@ -1593,13 +1620,13 @@ var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1593
1620
|
|
|
1594
1621
|
// src/components/chain/render/dynamic/flexbox/variants/WithRemote.tsx
|
|
1595
1622
|
import { ErrorRender as ErrorRender5 } from "@xylabs/react-error";
|
|
1596
|
-
import
|
|
1623
|
+
import React34 from "react";
|
|
1597
1624
|
var WithRemote = /* @__PURE__ */ __name(({ url, chainArchivistModuleId, blockChainRenderProps: blockChainRenderPropsArg, ...props }) => {
|
|
1598
1625
|
const { error, blockChainRenderProps } = useRemoteBlockChainRenderProps(chainArchivistModuleId, url, blockChainRenderPropsArg);
|
|
1599
|
-
return /* @__PURE__ */
|
|
1626
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(ErrorRender5, {
|
|
1600
1627
|
error,
|
|
1601
1628
|
scope: "RemoteChainProviderFlexbox"
|
|
1602
|
-
}), /* @__PURE__ */
|
|
1629
|
+
}), /* @__PURE__ */ React34.createElement(WithAnalysis, {
|
|
1603
1630
|
blockChainRenderProps,
|
|
1604
1631
|
...props
|
|
1605
1632
|
}));
|
|
@@ -1615,7 +1642,7 @@ var DynamicBlockchainRenderFlexbox = {
|
|
|
1615
1642
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1616
1643
|
import { ErrorRender as ErrorRender6 } from "@xylabs/react-error";
|
|
1617
1644
|
import { FlexCol as FlexCol6, FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
1618
|
-
import
|
|
1645
|
+
import React35 from "react";
|
|
1619
1646
|
|
|
1620
1647
|
// src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts
|
|
1621
1648
|
import { exists } from "@xylabs/exists";
|
|
@@ -1648,31 +1675,31 @@ var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blo
|
|
|
1648
1675
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1649
1676
|
var StaticListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1650
1677
|
const { blockComponents, errors, paginatedBlockComponents, onPageChange, page, pageSize } = useStaticBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1651
|
-
return /* @__PURE__ */
|
|
1678
|
+
return /* @__PURE__ */ React35.createElement(FlexCol6, {
|
|
1652
1679
|
alignItems: "start",
|
|
1653
1680
|
gap: 2,
|
|
1654
1681
|
width: "100%",
|
|
1655
1682
|
...props
|
|
1656
|
-
}, errors?.map((error) => /* @__PURE__ */
|
|
1683
|
+
}, errors?.map((error) => /* @__PURE__ */ React35.createElement(ErrorRender6, {
|
|
1657
1684
|
error,
|
|
1658
1685
|
key: error.name,
|
|
1659
1686
|
scope: "StaticBlockchainFlexboxInner"
|
|
1660
|
-
})), paginatedBlockComponents?.length ? /* @__PURE__ */
|
|
1687
|
+
})), paginatedBlockComponents?.length ? /* @__PURE__ */ React35.createElement(FlexGrowRow2, {
|
|
1661
1688
|
justifyContent: "space-between",
|
|
1662
1689
|
width: "100%"
|
|
1663
|
-
}, /* @__PURE__ */
|
|
1690
|
+
}, /* @__PURE__ */ React35.createElement(ChainAnalyzerStatsDialogFromContext, null), /* @__PURE__ */ React35.createElement(BlockChainPagination, {
|
|
1664
1691
|
count: blockComponents?.length ?? 0,
|
|
1665
1692
|
onPageChange,
|
|
1666
1693
|
page,
|
|
1667
1694
|
rowsPerPage: pageSize
|
|
1668
|
-
})) : null, /* @__PURE__ */
|
|
1695
|
+
})) : null, /* @__PURE__ */ React35.createElement(BlockListAnimated, {
|
|
1669
1696
|
blockChainRenderComponents: paginatedBlockComponents
|
|
1670
1697
|
}));
|
|
1671
1698
|
}, "StaticListBase");
|
|
1672
1699
|
|
|
1673
1700
|
// src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx
|
|
1674
1701
|
import { ChainProducersAnalyzer as ChainProducersAnalyzer2 } from "@xyo-network/chain-protocol";
|
|
1675
|
-
import
|
|
1702
|
+
import React36, { useMemo as useMemo16 } from "react";
|
|
1676
1703
|
var WithAnalysis2 = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1677
1704
|
const { chainInformation } = blockChainRenderProps ?? {};
|
|
1678
1705
|
const analyzers = useMemo16(() => {
|
|
@@ -1684,9 +1711,9 @@ var WithAnalysis2 = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1684
1711
|
}, [
|
|
1685
1712
|
chainInformation
|
|
1686
1713
|
]);
|
|
1687
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ React36.createElement(ChainAnalyzersProvider, {
|
|
1688
1715
|
analyzers
|
|
1689
|
-
}, /* @__PURE__ */
|
|
1716
|
+
}, /* @__PURE__ */ React36.createElement(StaticListBase, {
|
|
1690
1717
|
blockChainRenderProps,
|
|
1691
1718
|
...props
|
|
1692
1719
|
}));
|
|
@@ -1701,31 +1728,31 @@ var StaticBlockchainRenderFlexBox = {
|
|
|
1701
1728
|
// src/components/payload/builder/Flexbox.tsx
|
|
1702
1729
|
import { FlexCol as FlexCol7 } from "@xylabs/react-flexbox";
|
|
1703
1730
|
import { JsonViewerEx as JsonViewerEx2 } from "@xyo-network/react-payload-raw-info";
|
|
1704
|
-
import
|
|
1731
|
+
import React37, { useState as useState13 } from "react";
|
|
1705
1732
|
var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild, ...props }) => {
|
|
1706
1733
|
const [payload, setPayload] = useState13();
|
|
1707
1734
|
const onBuildLocal = /* @__PURE__ */ __name((payload2) => {
|
|
1708
1735
|
onBuild?.(payload2);
|
|
1709
1736
|
setPayload(payload2);
|
|
1710
1737
|
}, "onBuildLocal");
|
|
1711
|
-
return /* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ React37.createElement(FlexCol7, {
|
|
1712
1739
|
gap: 2,
|
|
1713
1740
|
...props
|
|
1714
|
-
}, /* @__PURE__ */
|
|
1741
|
+
}, /* @__PURE__ */ React37.createElement(BuilderComponent, {
|
|
1715
1742
|
onBuild: onBuildLocal
|
|
1716
|
-
}), payload && /* @__PURE__ */
|
|
1743
|
+
}), payload && /* @__PURE__ */ React37.createElement(JsonViewerEx2, {
|
|
1717
1744
|
value: payload
|
|
1718
1745
|
}));
|
|
1719
1746
|
}, "PayloadBuilderFlexbox");
|
|
1720
1747
|
|
|
1721
1748
|
// src/components/payload/builder/producer-intent/Form.tsx
|
|
1722
|
-
import { Button as
|
|
1749
|
+
import { Button as Button5, FormControl as FormControl5 } from "@mui/material";
|
|
1723
1750
|
import { createProducerChainStakeIntent } from "@xyo-network/chain-ethereum";
|
|
1724
|
-
import
|
|
1751
|
+
import React40, { useMemo as useMemo18, useState as useState16 } from "react";
|
|
1725
1752
|
|
|
1726
1753
|
// src/components/payload/fields/BlockNumberTextField.tsx
|
|
1727
1754
|
import { FormControl as FormControl3, FormHelperText as FormHelperText2, TextField as TextField3 } from "@mui/material";
|
|
1728
|
-
import
|
|
1755
|
+
import React38, { useState as useState14 } from "react";
|
|
1729
1756
|
var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumberChanged, onChange, ...props }) => {
|
|
1730
1757
|
const [blockNumber, setBlockNumber] = useState14();
|
|
1731
1758
|
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
@@ -1734,15 +1761,15 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1734
1761
|
onBlockNumberChanged?.(Number.parseInt(value));
|
|
1735
1762
|
onChange?.(e);
|
|
1736
1763
|
}, "handleChange");
|
|
1737
|
-
return /* @__PURE__ */
|
|
1764
|
+
return /* @__PURE__ */ React38.createElement(FormControl3, {
|
|
1738
1765
|
fullWidth: true
|
|
1739
|
-
}, /* @__PURE__ */
|
|
1766
|
+
}, /* @__PURE__ */ React38.createElement(TextField3, {
|
|
1740
1767
|
error: !!errorMessage,
|
|
1741
1768
|
onChange: handleChange,
|
|
1742
1769
|
type: "number",
|
|
1743
1770
|
value: blockNumber ?? "",
|
|
1744
1771
|
...props
|
|
1745
|
-
}), errorMessage && /* @__PURE__ */
|
|
1772
|
+
}), errorMessage && /* @__PURE__ */ React38.createElement(FormHelperText2, {
|
|
1746
1773
|
sx: {
|
|
1747
1774
|
color: /* @__PURE__ */ __name((theme) => theme.palette.error.main, "color")
|
|
1748
1775
|
}
|
|
@@ -1752,7 +1779,7 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1752
1779
|
// src/components/payload/fields/XyoAddressTextField.tsx
|
|
1753
1780
|
import { FormControl as FormControl4, FormHelperText as FormHelperText3, TextField as TextField4 } from "@mui/material";
|
|
1754
1781
|
import { asAddress } from "@xylabs/hex";
|
|
1755
|
-
import
|
|
1782
|
+
import React39, { useMemo as useMemo17, useState as useState15 } from "react";
|
|
1756
1783
|
var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange, resetValue, ...props }) => {
|
|
1757
1784
|
const [address, setAddress] = useState15("");
|
|
1758
1785
|
const [addressError, setAddressError] = useState15();
|
|
@@ -1776,15 +1803,15 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
1776
1803
|
onAddressChanged?.();
|
|
1777
1804
|
}
|
|
1778
1805
|
}, "handleBlur");
|
|
1779
|
-
return /* @__PURE__ */
|
|
1806
|
+
return /* @__PURE__ */ React39.createElement(FormControl4, {
|
|
1780
1807
|
fullWidth: true
|
|
1781
|
-
}, /* @__PURE__ */
|
|
1808
|
+
}, /* @__PURE__ */ React39.createElement(TextField4, {
|
|
1782
1809
|
error: !!addressError,
|
|
1783
1810
|
onBlur: handleBlur,
|
|
1784
1811
|
onChange: handleChange,
|
|
1785
1812
|
value: address,
|
|
1786
1813
|
...props
|
|
1787
|
-
}), addressError && /* @__PURE__ */
|
|
1814
|
+
}), addressError && /* @__PURE__ */ React39.createElement(FormHelperText3, {
|
|
1788
1815
|
sx: {
|
|
1789
1816
|
color: /* @__PURE__ */ __name((theme) => theme.palette.error.main, "color")
|
|
1790
1817
|
}
|
|
@@ -1817,33 +1844,33 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1817
1844
|
const onBuildLocal = /* @__PURE__ */ __name(() => {
|
|
1818
1845
|
if (onBuild && intentPayload) onBuild?.(intentPayload);
|
|
1819
1846
|
}, "onBuildLocal");
|
|
1820
|
-
return /* @__PURE__ */
|
|
1847
|
+
return /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(FormControl5, {
|
|
1821
1848
|
fullWidth: true
|
|
1822
|
-
}, /* @__PURE__ */
|
|
1849
|
+
}, /* @__PURE__ */ React40.createElement(XyoAddressTextField, {
|
|
1823
1850
|
label: "Delegate",
|
|
1824
1851
|
name: "delegate",
|
|
1825
1852
|
onAddressChanged: setDelegate,
|
|
1826
1853
|
required: true,
|
|
1827
1854
|
size: "small"
|
|
1828
|
-
})), /* @__PURE__ */
|
|
1855
|
+
})), /* @__PURE__ */ React40.createElement(FormControl5, {
|
|
1829
1856
|
fullWidth: true
|
|
1830
|
-
}, /* @__PURE__ */
|
|
1857
|
+
}, /* @__PURE__ */ React40.createElement(BlockNumberTextField, {
|
|
1831
1858
|
errorMessage: blockRangeError?.message,
|
|
1832
1859
|
label: "Expires",
|
|
1833
1860
|
name: "exp",
|
|
1834
1861
|
onBlockNumberChanged: setExp,
|
|
1835
1862
|
required: true,
|
|
1836
1863
|
size: "small"
|
|
1837
|
-
})), /* @__PURE__ */
|
|
1864
|
+
})), /* @__PURE__ */ React40.createElement(FormControl5, {
|
|
1838
1865
|
fullWidth: true
|
|
1839
|
-
}, /* @__PURE__ */
|
|
1866
|
+
}, /* @__PURE__ */ React40.createElement(BlockNumberTextField, {
|
|
1840
1867
|
errorMessage: blockRangeError?.message,
|
|
1841
1868
|
label: "Not Before",
|
|
1842
1869
|
name: "nbf",
|
|
1843
1870
|
onBlockNumberChanged: setNbf,
|
|
1844
1871
|
required: true,
|
|
1845
1872
|
size: "small"
|
|
1846
|
-
})), /* @__PURE__ */
|
|
1873
|
+
})), /* @__PURE__ */ React40.createElement(Button5, {
|
|
1847
1874
|
disabled: !intentPayload,
|
|
1848
1875
|
variant: "contained",
|
|
1849
1876
|
onClick: onBuildLocal
|
|
@@ -1851,12 +1878,12 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1851
1878
|
}, "ProducerIntentBuilderForm");
|
|
1852
1879
|
|
|
1853
1880
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
1854
|
-
import
|
|
1881
|
+
import React43 from "react";
|
|
1855
1882
|
|
|
1856
1883
|
// src/components/payload/builder/transfer/Form.tsx
|
|
1857
|
-
import { Button as
|
|
1884
|
+
import { Button as Button6, FormControl as FormControl7 } from "@mui/material";
|
|
1858
1885
|
import { TransferSchema } from "@xyo-network/xl1-model";
|
|
1859
|
-
import
|
|
1886
|
+
import React42, { useMemo as useMemo20, useState as useState18 } from "react";
|
|
1860
1887
|
|
|
1861
1888
|
// src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
|
|
1862
1889
|
import { RemoveCircle } from "@mui/icons-material";
|
|
@@ -1864,7 +1891,7 @@ import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 }
|
|
|
1864
1891
|
import { toHex as toHex3 } from "@xylabs/hex";
|
|
1865
1892
|
import { FlexRow as FlexRow7 } from "@xylabs/react-flexbox";
|
|
1866
1893
|
import { BigIntInput } from "@xyo-network/react-shared";
|
|
1867
|
-
import
|
|
1894
|
+
import React41, { useEffect as useEffect4, useMemo as useMemo19, useState as useState17 } from "react";
|
|
1868
1895
|
var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated, onRemoveTransfer, singleTransfer, ...props }) => {
|
|
1869
1896
|
const [toAddress, setToAddress] = useState17();
|
|
1870
1897
|
const [amount, setAmount] = useState17();
|
|
@@ -1885,29 +1912,29 @@ var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated,
|
|
|
1885
1912
|
}, [
|
|
1886
1913
|
transferAmount
|
|
1887
1914
|
]);
|
|
1888
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ React41.createElement(FlexRow7, {
|
|
1889
1916
|
alignItems: "start",
|
|
1890
1917
|
gap: 1,
|
|
1891
1918
|
...props
|
|
1892
|
-
}, /* @__PURE__ */
|
|
1919
|
+
}, /* @__PURE__ */ React41.createElement(FormControl6, {
|
|
1893
1920
|
fullWidth: true
|
|
1894
|
-
}, /* @__PURE__ */
|
|
1921
|
+
}, /* @__PURE__ */ React41.createElement(XyoAddressTextField, {
|
|
1895
1922
|
label: "To",
|
|
1896
1923
|
name: "to",
|
|
1897
1924
|
onAddressChanged: setToAddress,
|
|
1898
1925
|
required: true,
|
|
1899
1926
|
size: "small"
|
|
1900
|
-
})), /* @__PURE__ */
|
|
1927
|
+
})), /* @__PURE__ */ React41.createElement(FormControl6, {
|
|
1901
1928
|
fullWidth: true
|
|
1902
|
-
}, /* @__PURE__ */
|
|
1929
|
+
}, /* @__PURE__ */ React41.createElement(BigIntInput.TextField, {
|
|
1903
1930
|
label: "Amount",
|
|
1904
1931
|
name: "amount",
|
|
1905
1932
|
onChangeFixedPoint: setAmount,
|
|
1906
1933
|
required: true,
|
|
1907
1934
|
size: "small"
|
|
1908
|
-
})), /* @__PURE__ */
|
|
1935
|
+
})), /* @__PURE__ */ React41.createElement(IconButton5, {
|
|
1909
1936
|
onClick: /* @__PURE__ */ __name(() => onRemoveTransfer?.(singleTransfer.transferId), "onClick")
|
|
1910
|
-
}, /* @__PURE__ */
|
|
1937
|
+
}, /* @__PURE__ */ React41.createElement(Icon3, null, /* @__PURE__ */ React41.createElement(RemoveCircle, null))));
|
|
1911
1938
|
}, "SingleTransferBuilderFlexbox");
|
|
1912
1939
|
|
|
1913
1940
|
// src/components/payload/builder/transfer/Form.tsx
|
|
@@ -1956,19 +1983,19 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1956
1983
|
return transfer;
|
|
1957
1984
|
}));
|
|
1958
1985
|
}, "onTransferUpdated");
|
|
1959
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(FormControl7, {
|
|
1960
1987
|
fullWidth: true
|
|
1961
|
-
}, /* @__PURE__ */
|
|
1988
|
+
}, /* @__PURE__ */ React42.createElement(XyoAddressTextField, {
|
|
1962
1989
|
label: "From",
|
|
1963
1990
|
name: "from",
|
|
1964
1991
|
onAddressChanged: setFromAddress,
|
|
1965
1992
|
required: true,
|
|
1966
1993
|
size: "small"
|
|
1967
|
-
})), /* @__PURE__ */
|
|
1994
|
+
})), /* @__PURE__ */ React42.createElement(Button6, {
|
|
1968
1995
|
onClick: onTransferAdded,
|
|
1969
1996
|
size: "small",
|
|
1970
1997
|
variant: "contained"
|
|
1971
|
-
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */
|
|
1998
|
+
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */ React42.createElement(SingleTransferBuilderFlexbox, {
|
|
1972
1999
|
key: transfer.transferId,
|
|
1973
2000
|
onTransferUpdated,
|
|
1974
2001
|
onRemoveTransfer: onTransferRemoved,
|
|
@@ -1976,7 +2003,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1976
2003
|
sx: {
|
|
1977
2004
|
width: "100%"
|
|
1978
2005
|
}
|
|
1979
|
-
})), /* @__PURE__ */
|
|
2006
|
+
})), /* @__PURE__ */ React42.createElement(Button6, {
|
|
1980
2007
|
disabled: !transferPayload,
|
|
1981
2008
|
variant: "contained",
|
|
1982
2009
|
onClick: onBuildLocal
|
|
@@ -1984,7 +2011,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
1984
2011
|
}, "TransferBuilderForm");
|
|
1985
2012
|
|
|
1986
2013
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
1987
|
-
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */
|
|
2014
|
+
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */ React43.createElement(PayloadBuilderFlexbox, {
|
|
1988
2015
|
gap: 4,
|
|
1989
2016
|
alignItems: "start",
|
|
1990
2017
|
BuilderComponent: TransferBuilderForm,
|
|
@@ -2011,7 +2038,7 @@ import { usePromise as usePromise7 } from "@xylabs/react-promise";
|
|
|
2011
2038
|
import { MemoryArchivist } from "@xyo-network/archivist-memory";
|
|
2012
2039
|
import { ArchivistConfigSchema } from "@xyo-network/archivist-model";
|
|
2013
2040
|
import { flattenHydratedBlocks } from "@xyo-network/chain-protocol";
|
|
2014
|
-
import
|
|
2041
|
+
import React44, { useEffect as useEffect5 } from "react";
|
|
2015
2042
|
var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2016
2043
|
const [randomBlockChain] = usePromise7(async () => await buildRandomBlockChain(), []);
|
|
2017
2044
|
const [blockChainRenderProps, blockChainRenderPropsError] = usePromise7(async () => {
|
|
@@ -2051,7 +2078,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2051
2078
|
}
|
|
2052
2079
|
}
|
|
2053
2080
|
};
|
|
2054
|
-
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */
|
|
2081
|
+
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React44.createElement(Story, props) : /* @__PURE__ */ React44.createElement(CircularProgress, null);
|
|
2055
2082
|
}, "ChainArchivistDecorator");
|
|
2056
2083
|
|
|
2057
2084
|
// src/stories/ChainArchivistDelayedInsertDecorator.tsx
|
|
@@ -2061,7 +2088,7 @@ import { usePromise as usePromise8 } from "@xylabs/react-promise";
|
|
|
2061
2088
|
import { MemoryArchivist as MemoryArchivist2 } from "@xyo-network/archivist-memory";
|
|
2062
2089
|
import { ArchivistConfigSchema as ArchivistConfigSchema2 } from "@xyo-network/archivist-model";
|
|
2063
2090
|
import { flattenHydratedBlock } from "@xyo-network/chain-protocol";
|
|
2064
|
-
import
|
|
2091
|
+
import React45, { useEffect as useEffect6, useState as useState19 } from "react";
|
|
2065
2092
|
var chainArchivistRef;
|
|
2066
2093
|
var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2067
2094
|
const [firstBlock, setFirstBlock] = useState19();
|
|
@@ -2119,7 +2146,7 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2119
2146
|
}
|
|
2120
2147
|
}
|
|
2121
2148
|
};
|
|
2122
|
-
return firstBlock ? /* @__PURE__ */
|
|
2149
|
+
return firstBlock ? /* @__PURE__ */ React45.createElement(Story, props) : /* @__PURE__ */ React45.createElement(CircularProgress2, null);
|
|
2123
2150
|
}, "ChainArchivistDelayedInsertDecorator");
|
|
2124
2151
|
|
|
2125
2152
|
// src/stories/ChainInfoContextDecorator.tsx
|
|
@@ -2128,7 +2155,7 @@ import { usePromise as usePromise9 } from "@xylabs/react-promise";
|
|
|
2128
2155
|
import { XyoChainBlockNumberIterator as XyoChainBlockNumberIterator3 } from "@xyo-network/chain-services";
|
|
2129
2156
|
import { findFirstMatching } from "@xyo-network/chain-utils";
|
|
2130
2157
|
import { isBlockBoundWitness as isBlockBoundWitness3 } from "@xyo-network/xl1-model";
|
|
2131
|
-
import
|
|
2158
|
+
import React46 from "react";
|
|
2132
2159
|
var archivistConfig = {
|
|
2133
2160
|
url: "http://localhost:8080",
|
|
2134
2161
|
chainArchivistModuleId: "XYOPublic:XYOChain:Chain"
|
|
@@ -2154,11 +2181,11 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2154
2181
|
chainArchivist,
|
|
2155
2182
|
chainInformation
|
|
2156
2183
|
]);
|
|
2157
|
-
return /* @__PURE__ */
|
|
2184
|
+
return /* @__PURE__ */ React46.createElement(ChainInfoProvider, {
|
|
2158
2185
|
chainArchivist,
|
|
2159
2186
|
chainInformation,
|
|
2160
2187
|
chainIterator
|
|
2161
|
-
}, /* @__PURE__ */
|
|
2188
|
+
}, /* @__PURE__ */ React46.createElement(Story, context));
|
|
2162
2189
|
}, "ChainInfoContextDecorator");
|
|
2163
2190
|
export {
|
|
2164
2191
|
BlockChainPagination,
|
|
@@ -2184,6 +2211,7 @@ export {
|
|
|
2184
2211
|
ChainTransactionBuilder,
|
|
2185
2212
|
ChainTransactionNetwork,
|
|
2186
2213
|
DynamicBlockchainRenderFlexbox,
|
|
2214
|
+
FeatureNotAvailable,
|
|
2187
2215
|
MemoizedPollingControlsFlexbox,
|
|
2188
2216
|
PayloadBuilderFlexbox,
|
|
2189
2217
|
PollingControlsFlexbox,
|