@xyo-network/react-chain-blockchain 1.5.35 → 1.5.37
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 +302 -255
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/block/ChipSkeleton.d.ts +4 -0
- package/dist/types/components/block/ChipSkeleton.d.ts.map +1 -0
- package/dist/types/components/block/ProducerChip.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useDynamicBlockComponents.d.ts +2 -1
- package/dist/types/components/block/hooks/useDynamicBlockComponents.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts +2 -1
- package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts.map +1 -1
- package/dist/types/components/block/index.d.ts +1 -0
- package/dist/types/components/block/index.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/Epoch.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/Hash.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/hooks/useLinkedBlockItem.d.ts.map +1 -1
- package/dist/types/components/block/table/head/TableHead.d.ts.map +1 -1
- package/dist/types/components/chain/render/dynamic/flexbox/variants/WithAnalysis.d.ts.map +1 -1
- package/dist/types/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.d.ts.map +1 -1
- package/dist/types/components/chain/render/static/flexbox/variants/WithAnalysis.d.ts.map +1 -1
- package/dist/types/context/chain/Context.d.ts +3 -3
- package/dist/types/context/chain/State.d.ts +3 -2
- package/dist/types/context/chain/State.d.ts.map +1 -1
- package/dist/types/context/chain/use.d.ts +1 -1
- package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts +2 -1
- package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorParams.d.ts +6 -4
- package/dist/types/hooks/chain-iterator/useChainIteratorParams.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorStore.d.ts +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorStore.d.ts.map +1 -1
- package/dist/types/hooks/useIterateChain.d.ts +2 -1
- package/dist/types/hooks/useIterateChain.d.ts.map +1 -1
- package/dist/types/lib/getChainId.d.ts +4 -0
- package/dist/types/lib/getChainId.d.ts.map +1 -0
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/index.d.ts.map +1 -1
- package/dist/types/stories/ChainInfoContextDecorator.d.ts.map +1 -1
- package/dist/types/types/render/BlockChainRenderProps.d.ts +3 -3
- package/dist/types/types/render/BlockChainRenderProps.d.ts.map +1 -1
- package/package.json +52 -52
- package/src/components/block/ChipSkeleton.tsx +7 -0
- package/src/components/block/ProducerChip.tsx +18 -3
- package/src/components/block/hooks/useDynamicBlockComponents.ts +2 -1
- package/src/components/block/hooks/useStaticBlockComponents.ts +2 -1
- package/src/components/block/index.ts +1 -0
- package/src/components/block/table/cell/Epoch.tsx +2 -1
- package/src/components/block/table/cell/Hash.tsx +18 -20
- package/src/components/block/table/cell/hooks/useLinkedBlockItem.tsx +6 -1
- package/src/components/block/table/head/TableHead.tsx +14 -8
- package/src/components/chain/render/dynamic/flexbox/Flexbox.stories.tsx +1 -1
- package/src/components/chain/render/dynamic/flexbox/Remote.stories.tsx +4 -3
- package/src/components/chain/render/dynamic/flexbox/variants/WithAnalysis.tsx +4 -3
- package/src/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.ts +1 -1
- package/src/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.ts +1 -0
- package/src/components/chain/render/static/flexbox/Flexbox.stories.tsx +2 -2
- package/src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx +4 -3
- package/src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts +1 -1
- package/src/components/chain/render/static/table/Ex.stories.tsx +2 -2
- package/src/context/chain/Provider.tsx +9 -9
- package/src/context/chain/State.ts +3 -2
- package/src/hooks/chain-iterator/ChainIteratorStore.ts +2 -2
- package/src/hooks/chain-iterator/useChainIteratorParams.ts +5 -4
- package/src/hooks/chain-iterator/useChainIteratorStore.ts +1 -1
- package/src/hooks/useIterateChain.ts +3 -4
- package/src/lib/getChainId.ts +8 -0
- package/src/lib/index.ts +1 -1
- package/src/stories/ChainArchivistDecorator.tsx +4 -4
- package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +4 -4
- package/src/stories/ChainInfoContextDecorator.tsx +8 -7
- package/src/types/render/BlockChainRenderProps.ts +6 -4
- package/dist/types/lib/getChainInformation.d.ts +0 -4
- package/dist/types/lib/getChainInformation.d.ts.map +0 -1
- package/src/lib/getChainInformation.ts +0 -9
package/dist/browser/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
5
5
|
import { FlexCol as FlexCol2, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
6
6
|
import { BWVerification, HashHeadingPaper } from "@xyo-network/react-boundwitness-plugin";
|
|
7
7
|
import { usePayloadHash } from "@xyo-network/react-shared";
|
|
8
|
-
import
|
|
8
|
+
import React14 from "react";
|
|
9
9
|
|
|
10
10
|
// src/context/analyzer/context.ts
|
|
11
11
|
import { createContextEx } from "@xylabs/react-shared";
|
|
@@ -66,16 +66,16 @@ var ChainInfoContext = createContextEx2();
|
|
|
66
66
|
|
|
67
67
|
// src/context/chain/Provider.tsx
|
|
68
68
|
import React2, { useMemo as useMemo2, useState as useState2 } from "react";
|
|
69
|
-
var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chainArchivistProp,
|
|
69
|
+
var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chainArchivistProp, chainId: chainIdProp, chainIterator: chainIteratorProp }) => {
|
|
70
70
|
const [chainArchivist, setChainArchivist] = useState2(chainArchivistProp);
|
|
71
|
-
const [
|
|
71
|
+
const [chainId, setChainId] = useState2(chainIdProp);
|
|
72
72
|
const [chainIterator, setChainIterator] = useState2(chainIteratorProp);
|
|
73
73
|
const updateChainArchivist = /* @__PURE__ */ __name((chainArchivist2) => {
|
|
74
74
|
setChainArchivist(chainArchivist2);
|
|
75
75
|
}, "updateChainArchivist");
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
}, "
|
|
76
|
+
const updateChainId = /* @__PURE__ */ __name((chainId2) => {
|
|
77
|
+
setChainId(chainId2);
|
|
78
|
+
}, "updateChainId");
|
|
79
79
|
const updateChainIterator = /* @__PURE__ */ __name((chainIterator2) => {
|
|
80
80
|
setChainIterator(chainIterator2);
|
|
81
81
|
}, "updateChainIterator");
|
|
@@ -85,9 +85,9 @@ var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chai
|
|
|
85
85
|
chainArchivistProp
|
|
86
86
|
]);
|
|
87
87
|
useMemo2(() => {
|
|
88
|
-
|
|
88
|
+
updateChainId(chainIdProp);
|
|
89
89
|
}, [
|
|
90
|
-
|
|
90
|
+
chainIdProp
|
|
91
91
|
]);
|
|
92
92
|
useMemo2(() => {
|
|
93
93
|
updateChainIterator(chainIteratorProp);
|
|
@@ -96,18 +96,18 @@ var ChainInfoProvider = /* @__PURE__ */ __name(({ children, chainArchivist: chai
|
|
|
96
96
|
]);
|
|
97
97
|
const chainState = useMemo2(() => ({
|
|
98
98
|
chainArchivist,
|
|
99
|
-
|
|
99
|
+
chainId,
|
|
100
100
|
chainIterator,
|
|
101
101
|
updateChainArchivist,
|
|
102
|
-
|
|
102
|
+
updateChainId,
|
|
103
103
|
updateChainIterator,
|
|
104
104
|
provided: true
|
|
105
105
|
}), [
|
|
106
106
|
chainArchivist,
|
|
107
|
-
|
|
107
|
+
chainId,
|
|
108
108
|
chainIterator,
|
|
109
109
|
updateChainArchivist,
|
|
110
|
-
|
|
110
|
+
updateChainId,
|
|
111
111
|
updateChainIterator
|
|
112
112
|
]);
|
|
113
113
|
return /* @__PURE__ */ React2.createElement(ChainInfoContext, {
|
|
@@ -341,9 +341,9 @@ import React8, { Fragment, useMemo as useMemo6, useState as useState7 } from "re
|
|
|
341
341
|
|
|
342
342
|
// src/hooks/chain-iterator/ChainIteratorStore.ts
|
|
343
343
|
import { assertEx } from "@xylabs/assert";
|
|
344
|
-
import { hydrateBlock } from "@xyo-network/chain-protocol";
|
|
345
344
|
import { ChainBlockNumberIterationService } from "@xyo-network/chain-services";
|
|
346
345
|
import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
|
|
346
|
+
import { hydrateBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
347
347
|
var ChainIteratorStore = class _ChainIteratorStore {
|
|
348
348
|
static {
|
|
349
349
|
__name(this, "ChainIteratorStore");
|
|
@@ -407,6 +407,7 @@ var ChainIteratorStore = class _ChainIteratorStore {
|
|
|
407
407
|
import { assertEx as assertEx2 } from "@xylabs/assert";
|
|
408
408
|
import { isHash } from "@xylabs/hex";
|
|
409
409
|
import { usePromise } from "@xylabs/react-promise";
|
|
410
|
+
import { isDefined } from "@xylabs/typeof";
|
|
410
411
|
import { BoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
411
412
|
import { isBlockBoundWitness } from "@xyo-network/xl1-protocol";
|
|
412
413
|
var resolveDefinedHead = /* @__PURE__ */ __name(async (head, chainArchivist) => {
|
|
@@ -420,9 +421,9 @@ var resolveDefinedHead = /* @__PURE__ */ __name(async (head, chainArchivist) =>
|
|
|
420
421
|
return assertEx2(isBlockBoundWitness(headPayload) ? headPayload : void 0, () => `Expected a block bound witness: ${JSON.stringify(headPayload)}`);
|
|
421
422
|
}
|
|
422
423
|
}, "resolveDefinedHead");
|
|
423
|
-
var useChainIteratorParams = /* @__PURE__ */ __name(({ chainArchivist,
|
|
424
|
+
var useChainIteratorParams = /* @__PURE__ */ __name(({ chainArchivist, chainId, head, name }) => {
|
|
424
425
|
return usePromise(async () => {
|
|
425
|
-
if (chainArchivist &&
|
|
426
|
+
if (isDefined(chainArchivist) && isDefined(chainId) && isHash(head)) {
|
|
426
427
|
const [result] = await chainArchivist.get([
|
|
427
428
|
head
|
|
428
429
|
]);
|
|
@@ -430,13 +431,14 @@ var useChainIteratorParams = /* @__PURE__ */ __name(({ chainArchivist, chainInfo
|
|
|
430
431
|
const resolvedHead = assertEx2(isBlockBoundWitness(foundResult) ? foundResult : void 0, () => `Head is not a boundwitness: ${JSON.stringify(foundResult)}`);
|
|
431
432
|
return {
|
|
432
433
|
chainArchivist,
|
|
433
|
-
|
|
434
|
-
head: resolvedHead
|
|
434
|
+
chainId,
|
|
435
|
+
head: resolvedHead,
|
|
436
|
+
name
|
|
435
437
|
};
|
|
436
438
|
}
|
|
437
439
|
}, [
|
|
438
440
|
chainArchivist,
|
|
439
|
-
|
|
441
|
+
chainId,
|
|
440
442
|
head
|
|
441
443
|
]);
|
|
442
444
|
}, "useChainIteratorParams");
|
|
@@ -545,10 +547,10 @@ var useChainIteratorStore = /* @__PURE__ */ __name((chainIteratorParams) => {
|
|
|
545
547
|
// src/hooks/useIterateChain.ts
|
|
546
548
|
import { assertEx as assertEx3 } from "@xylabs/assert";
|
|
547
549
|
import { usePromise as usePromise3 } from "@xylabs/react-promise";
|
|
548
|
-
import { hydrateBlock as hydrateBlock2 } from "@xyo-network/chain-protocol";
|
|
549
550
|
import { ChainBlockNumberIterationService as ChainBlockNumberIterationService2 } from "@xyo-network/chain-services";
|
|
550
551
|
import { PayloadBuilder as PayloadBuilder3 } from "@xyo-network/payload-builder";
|
|
551
552
|
import { isBlockBoundWitness as isBlockBoundWitness2 } from "@xyo-network/xl1-protocol";
|
|
553
|
+
import { hydrateBlock as hydrateBlock2 } from "@xyo-network/xl1-protocol-sdk";
|
|
552
554
|
var getHydratedBlock = /* @__PURE__ */ __name(async (chainArchivist, head) => {
|
|
553
555
|
const headHash = await PayloadBuilder3.hash(head);
|
|
554
556
|
return await hydrateBlock2(chainArchivist, headHash);
|
|
@@ -798,14 +800,14 @@ var usePayloadCountsFromBlock = /* @__PURE__ */ __name((block) => {
|
|
|
798
800
|
|
|
799
801
|
// src/components/block/hooks/useStaticBlockComponents.ts
|
|
800
802
|
import { usePromise as usePromise5 } from "@xylabs/react-promise";
|
|
801
|
-
import { isDefined } from "@xylabs/typeof";
|
|
803
|
+
import { isDefined as isDefined2 } from "@xylabs/typeof";
|
|
802
804
|
var useStaticBlockComponents = /* @__PURE__ */ __name((BlockComponent, params, blocks) => {
|
|
803
805
|
const { onBlock } = useChainAnalyzersContext();
|
|
804
806
|
const [blockComponents, blockComponentsError] = usePromise5(async () => {
|
|
805
807
|
const resolvedBlockWithStorage = blocks ?? [];
|
|
806
808
|
if (!params?.chainArchivist) return [];
|
|
807
809
|
return await Promise.all(resolvedBlockWithStorage?.map(async (block) => {
|
|
808
|
-
if (
|
|
810
|
+
if (isDefined2(onBlock)) {
|
|
809
811
|
await onBlock(block);
|
|
810
812
|
}
|
|
811
813
|
const blockComponentProps = {
|
|
@@ -884,22 +886,48 @@ var BlockMenuExpanded = /* @__PURE__ */ __name(({ block }) => {
|
|
|
884
886
|
// src/components/block/ProducerChip.tsx
|
|
885
887
|
import { Chip as Chip2 } from "@mui/material";
|
|
886
888
|
import { EthAddress } from "@xylabs/eth-address";
|
|
889
|
+
import { toAddress } from "@xylabs/hex";
|
|
890
|
+
import { isString, isUndefined as isUndefined2 } from "@xylabs/typeof";
|
|
887
891
|
import { BlockiesAvatar } from "@xyo-network/react-chain-blockies";
|
|
888
|
-
import
|
|
889
|
-
|
|
892
|
+
import React13, { useMemo as useMemo9 } from "react";
|
|
893
|
+
|
|
894
|
+
// src/components/block/ChipSkeleton.tsx
|
|
895
|
+
import { Skeleton } from "@mui/material";
|
|
896
|
+
import React12 from "react";
|
|
897
|
+
var ChipSkeleton = /* @__PURE__ */ __name((props) => {
|
|
898
|
+
return /* @__PURE__ */ React12.createElement(Skeleton, {
|
|
899
|
+
width: 100,
|
|
900
|
+
...props
|
|
901
|
+
});
|
|
902
|
+
}, "ChipSkeleton");
|
|
903
|
+
|
|
904
|
+
// src/components/block/ProducerChip.tsx
|
|
905
|
+
var formatProducerAddress = /* @__PURE__ */ __name((address) => {
|
|
906
|
+
if (isUndefined2(address) || !isString(address)) return void 0;
|
|
907
|
+
const formattedAddress = toAddress(address);
|
|
908
|
+
return EthAddress.parse(formattedAddress)?.toShortString(4);
|
|
909
|
+
}, "formatProducerAddress");
|
|
910
|
+
var BlockProducerChip = /* @__PURE__ */ __name(({ block, sx, ...props }) => {
|
|
890
911
|
const blockProducer2 = block?.[0].addresses[0];
|
|
891
|
-
const shortedBlockProducer = blockProducer2 === void 0 ? null :
|
|
892
|
-
const avatar = useMemo9(() => blockProducer2 === "" ? void 0 : /* @__PURE__ */
|
|
912
|
+
const shortedBlockProducer = blockProducer2 === void 0 ? null : formatProducerAddress(blockProducer2);
|
|
913
|
+
const avatar = useMemo9(() => blockProducer2 === "" ? void 0 : /* @__PURE__ */ React13.createElement(BlockiesAvatar, {
|
|
893
914
|
blockiesOptions: {
|
|
894
915
|
seed: blockProducer2
|
|
895
916
|
}
|
|
896
917
|
}), [
|
|
897
918
|
blockProducer2
|
|
898
919
|
]);
|
|
899
|
-
return /* @__PURE__ */
|
|
920
|
+
return /* @__PURE__ */ React13.createElement(Chip2, {
|
|
900
921
|
avatar,
|
|
901
|
-
label:
|
|
922
|
+
label: shortedBlockProducer ?? /* @__PURE__ */ React13.createElement(ChipSkeleton, {
|
|
923
|
+
width: 115
|
|
924
|
+
}),
|
|
902
925
|
title: `Block producer: ${blockProducer2}`,
|
|
926
|
+
sx: {
|
|
927
|
+
fontFamily: "monospace",
|
|
928
|
+
cursor: "pointer",
|
|
929
|
+
...sx
|
|
930
|
+
},
|
|
903
931
|
...props
|
|
904
932
|
});
|
|
905
933
|
}, "BlockProducerChip");
|
|
@@ -914,12 +942,12 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
914
942
|
event.stopPropagation();
|
|
915
943
|
blockHeadingListener("transaction-count", "click", JSON.stringify(transactions2));
|
|
916
944
|
}, "handleTransactionCountClick");
|
|
917
|
-
return /* @__PURE__ */
|
|
945
|
+
return /* @__PURE__ */ React14.createElement(FlexCol2, {
|
|
918
946
|
className: "block-heading-flexbox",
|
|
919
947
|
alignItems: "stretch",
|
|
920
948
|
ref: blockHeadingRef,
|
|
921
949
|
onClick: /* @__PURE__ */ __name(() => blockHeadingListener("block-hash", "click", hash), "onClick")
|
|
922
|
-
}, /* @__PURE__ */
|
|
950
|
+
}, /* @__PURE__ */ React14.createElement(LinkedDivider, null), /* @__PURE__ */ React14.createElement(HashHeadingPaper, {
|
|
923
951
|
hash,
|
|
924
952
|
heading: block?.[0].block === void 0 ? "" : block?.[0].block.toString(),
|
|
925
953
|
paperProps: {
|
|
@@ -928,24 +956,24 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
928
956
|
width: "100%"
|
|
929
957
|
}
|
|
930
958
|
},
|
|
931
|
-
AdornmentEnd: /* @__PURE__ */
|
|
959
|
+
AdornmentEnd: /* @__PURE__ */ React14.createElement(FlexRow2, {
|
|
932
960
|
gap: 1
|
|
933
|
-
}, /* @__PURE__ */
|
|
961
|
+
}, /* @__PURE__ */ React14.createElement(BlockProducerChip, {
|
|
934
962
|
block
|
|
935
|
-
}), /* @__PURE__ */
|
|
963
|
+
}), /* @__PURE__ */ React14.createElement(TransactionCountChip, {
|
|
936
964
|
onClick: /* @__PURE__ */ __name((e) => handleTransactionCountClick(e, transactions ?? []), "onClick"),
|
|
937
965
|
transactions
|
|
938
|
-
}), /* @__PURE__ */
|
|
966
|
+
}), /* @__PURE__ */ React14.createElement(BWVerification, {
|
|
939
967
|
iconColors: true,
|
|
940
968
|
boundwitness: block?.[0]
|
|
941
|
-
}), /* @__PURE__ */
|
|
969
|
+
}), /* @__PURE__ */ React14.createElement("span", {
|
|
942
970
|
style: {
|
|
943
971
|
// maxWidth is required for css animation to work and 28px is the width of the icon button
|
|
944
972
|
display: "flex",
|
|
945
973
|
transition: "max-width .5s",
|
|
946
974
|
maxWidth: expanded ? "28px" : 0
|
|
947
975
|
}
|
|
948
|
-
}, /* @__PURE__ */
|
|
976
|
+
}, /* @__PURE__ */ React14.createElement(BlockMenuExpanded, {
|
|
949
977
|
block
|
|
950
978
|
}))),
|
|
951
979
|
identiconProps: {
|
|
@@ -957,21 +985,21 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
957
985
|
|
|
958
986
|
// src/components/block/table/cell/BlockNumber.tsx
|
|
959
987
|
import { TableCell, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
960
|
-
import
|
|
988
|
+
import React15 from "react";
|
|
961
989
|
var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
962
990
|
const blockNumber = block?.[0].block;
|
|
963
|
-
return /* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ React15.createElement(TableCell, props, /* @__PURE__ */ React15.createElement(Tooltip, {
|
|
964
992
|
title: `Block Number: ${blockNumber}`
|
|
965
|
-
}, /* @__PURE__ */
|
|
993
|
+
}, /* @__PURE__ */ React15.createElement(Typography3, {
|
|
966
994
|
component: "span",
|
|
967
995
|
variant: "body1"
|
|
968
996
|
}, blockNumber)));
|
|
969
997
|
}, "BlockNumberTableCell");
|
|
970
998
|
|
|
971
999
|
// src/components/block/table/cell/Epoch.tsx
|
|
972
|
-
import { TableCell as TableCell2, Tooltip as Tooltip2, Typography as Typography4 } from "@mui/material";
|
|
973
|
-
import { isDefined as
|
|
974
|
-
import
|
|
1000
|
+
import { Skeleton as Skeleton2, TableCell as TableCell2, Tooltip as Tooltip2, Typography as Typography4 } from "@mui/material";
|
|
1001
|
+
import { isDefined as isDefined3 } from "@xylabs/typeof";
|
|
1002
|
+
import React16 from "react";
|
|
975
1003
|
|
|
976
1004
|
// src/components/block/table/cell/lib/timeFunctions.ts
|
|
977
1005
|
var dateFormat = Intl.DateTimeFormat(globalThis.navigator.language ?? "en-US", {
|
|
@@ -1036,13 +1064,15 @@ var timeAgo = /* @__PURE__ */ __name((epoch, locale = navigator.language ?? "en-
|
|
|
1036
1064
|
var BlockEpochTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1037
1065
|
const epoch = block?.[0]?.$epoch;
|
|
1038
1066
|
const dateTime = dateFormat.format(epoch);
|
|
1039
|
-
const age =
|
|
1040
|
-
return /* @__PURE__ */
|
|
1067
|
+
const age = isDefined3(epoch) ? timeAgo(epoch) : void 0;
|
|
1068
|
+
return /* @__PURE__ */ React16.createElement(TableCell2, props, /* @__PURE__ */ React16.createElement(Tooltip2, {
|
|
1041
1069
|
title: `Block Epoch: ${dateTime}`
|
|
1042
|
-
}, /* @__PURE__ */
|
|
1070
|
+
}, /* @__PURE__ */ React16.createElement(Typography4, {
|
|
1043
1071
|
component: "span",
|
|
1044
1072
|
variant: "body1"
|
|
1045
|
-
}, age
|
|
1073
|
+
}, age ?? /* @__PURE__ */ React16.createElement(Skeleton2, {
|
|
1074
|
+
width: 115
|
|
1075
|
+
}))));
|
|
1046
1076
|
}, "BlockEpochTableCell");
|
|
1047
1077
|
|
|
1048
1078
|
// src/components/block/table/cell/Hash.tsx
|
|
@@ -1050,12 +1080,12 @@ import { Avatar, Chip as Chip3, TableCell as TableCell3, Tooltip as Tooltip3 } f
|
|
|
1050
1080
|
import { isHash as isHash2 } from "@xylabs/hex";
|
|
1051
1081
|
import { Identicon } from "@xylabs/react-identicon";
|
|
1052
1082
|
import { usePayloadRootHash } from "@xyo-network/react-shared";
|
|
1053
|
-
import
|
|
1083
|
+
import React18 from "react";
|
|
1054
1084
|
|
|
1055
1085
|
// src/components/FeatureNotAvailable.tsx
|
|
1056
1086
|
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
1057
|
-
import
|
|
1058
|
-
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */
|
|
1087
|
+
import React17 from "react";
|
|
1088
|
+
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */ React17.createElement(Dialog, props, /* @__PURE__ */ React17.createElement(DialogTitle, null, `${featureName} Not Available`), /* @__PURE__ */ React17.createElement(DialogContent, null, "This feature is not currently available. Either you do not have access to it or it is currently undergoing maintenance."), /* @__PURE__ */ React17.createElement(DialogActions, null, /* @__PURE__ */ React17.createElement(Button2, {
|
|
1059
1089
|
onClick: /* @__PURE__ */ __name((e) => props.onClose?.(e, "backdropClick"), "onClick")
|
|
1060
1090
|
}, "Close"))), "FeatureNotAvailable");
|
|
1061
1091
|
|
|
@@ -1070,7 +1100,11 @@ var useLinkedBlockItem = /* @__PURE__ */ __name((noun, data) => {
|
|
|
1070
1100
|
console.warn("useLinkedBlockItem: noun is required");
|
|
1071
1101
|
return;
|
|
1072
1102
|
}
|
|
1073
|
-
|
|
1103
|
+
const selection = globalThis.getSelection();
|
|
1104
|
+
const isTextSelected = selection && selection.toString().length > 0;
|
|
1105
|
+
if (!isTextSelected) {
|
|
1106
|
+
dispatch(noun, "click", data);
|
|
1107
|
+
}
|
|
1074
1108
|
}, "handleClick");
|
|
1075
1109
|
return [
|
|
1076
1110
|
ref,
|
|
@@ -1082,29 +1116,30 @@ var useLinkedBlockItem = /* @__PURE__ */ __name((noun, data) => {
|
|
|
1082
1116
|
var BlockHashTableCell = /* @__PURE__ */ __name(({ block, identiconProps, notAvailableDialog, linked, ...props }) => {
|
|
1083
1117
|
const hash = usePayloadRootHash(block?.[0]);
|
|
1084
1118
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1085
|
-
const [notAvailable, setNotAvailable] =
|
|
1086
|
-
const shortenedHash = isHash2(hash) ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` :
|
|
1087
|
-
return /* @__PURE__ */
|
|
1119
|
+
const [notAvailable, setNotAvailable] = React18.useState(false);
|
|
1120
|
+
const shortenedHash = isHash2(hash) ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` : void 0;
|
|
1121
|
+
return /* @__PURE__ */ React18.createElement(TableCell3, {
|
|
1088
1122
|
ref,
|
|
1089
1123
|
...props
|
|
1090
|
-
},
|
|
1124
|
+
}, /* @__PURE__ */ React18.createElement(Tooltip3, {
|
|
1091
1125
|
title: `Block Hash: ${hash}`
|
|
1092
|
-
}, /* @__PURE__ */
|
|
1093
|
-
avatar: /* @__PURE__ */
|
|
1126
|
+
}, /* @__PURE__ */ React18.createElement(Chip3, {
|
|
1127
|
+
avatar: /* @__PURE__ */ React18.createElement(Avatar, {
|
|
1094
1128
|
sx: {
|
|
1095
1129
|
background: "white"
|
|
1096
1130
|
}
|
|
1097
|
-
}, /* @__PURE__ */
|
|
1131
|
+
}, /* @__PURE__ */ React18.createElement(Identicon, {
|
|
1098
1132
|
size: 16,
|
|
1099
1133
|
value: hash,
|
|
1100
1134
|
...identiconProps
|
|
1101
1135
|
})),
|
|
1102
1136
|
sx: {
|
|
1103
|
-
cursor: "pointer"
|
|
1137
|
+
cursor: "pointer",
|
|
1138
|
+
fontFamily: "monospace"
|
|
1104
1139
|
},
|
|
1105
|
-
label: shortenedHash,
|
|
1140
|
+
label: shortenedHash ?? /* @__PURE__ */ React18.createElement(ChipSkeleton, null),
|
|
1106
1141
|
onClick: linked ? handleClick : () => setNotAvailable(true)
|
|
1107
|
-
}))
|
|
1142
|
+
})), notAvailableDialog && notAvailable ? /* @__PURE__ */ React18.createElement(FeatureNotAvailable, {
|
|
1108
1143
|
featureName: "Block Details",
|
|
1109
1144
|
open: notAvailable,
|
|
1110
1145
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1119,31 +1154,31 @@ import { isHash as isHash3 } from "@xylabs/hex";
|
|
|
1119
1154
|
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
1120
1155
|
import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
|
|
1121
1156
|
import { usePayloadRootHash as usePayloadRootHash2 } from "@xyo-network/react-shared";
|
|
1122
|
-
import
|
|
1157
|
+
import React19, { useState as useState10 } from "react";
|
|
1123
1158
|
var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
1124
1159
|
const [open, setOpen] = useState10(false);
|
|
1125
1160
|
const onClose = /* @__PURE__ */ __name(() => setOpen(false), "onClose");
|
|
1126
1161
|
const hash = usePayloadRootHash2(block?.[0]);
|
|
1127
1162
|
const title = isHash3(hash) ? `JSON for ${ellipsize(hash, 5)}` : "JSON";
|
|
1128
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ React19.createElement(TableCell4, props, /* @__PURE__ */ React19.createElement(FlexRow3, {
|
|
1129
1164
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1130
1165
|
sx: {
|
|
1131
1166
|
width: "100%"
|
|
1132
1167
|
}
|
|
1133
|
-
}, /* @__PURE__ */
|
|
1168
|
+
}, /* @__PURE__ */ React19.createElement(IconButton2, {
|
|
1134
1169
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1135
|
-
}, /* @__PURE__ */
|
|
1170
|
+
}, /* @__PURE__ */ React19.createElement(DataObject, null)), /* @__PURE__ */ React19.createElement(Dialog2, {
|
|
1136
1171
|
open,
|
|
1137
1172
|
onClose
|
|
1138
|
-
}, /* @__PURE__ */
|
|
1173
|
+
}, /* @__PURE__ */ React19.createElement(DialogTitle2, null, title), /* @__PURE__ */ React19.createElement(DialogContent2, null, /* @__PURE__ */ React19.createElement(JsonViewerEx, {
|
|
1139
1174
|
value: block
|
|
1140
|
-
})), /* @__PURE__ */
|
|
1175
|
+
})), /* @__PURE__ */ React19.createElement(DialogActions2, {
|
|
1141
1176
|
sx: {
|
|
1142
1177
|
display: "flex",
|
|
1143
1178
|
flexDirection: "row",
|
|
1144
1179
|
justifyContent: "end"
|
|
1145
1180
|
}
|
|
1146
|
-
}, /* @__PURE__ */
|
|
1181
|
+
}, /* @__PURE__ */ React19.createElement(Button3, {
|
|
1147
1182
|
variant: "contained",
|
|
1148
1183
|
onClick: onClose
|
|
1149
1184
|
}, "Close")))));
|
|
@@ -1152,7 +1187,7 @@ var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
|
1152
1187
|
// src/components/block/table/cell/PayloadCounts.tsx
|
|
1153
1188
|
import { Error as Error2 } from "@mui/icons-material";
|
|
1154
1189
|
import { Link, TableCell as TableCell5, Tooltip as Tooltip4 } from "@mui/material";
|
|
1155
|
-
import
|
|
1190
|
+
import React20 from "react";
|
|
1156
1191
|
var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1157
1192
|
const [publicPayloads, privatePayloads, error] = usePayloadCountsFromBlock(block);
|
|
1158
1193
|
const data = block && privatePayloads !== void 0 && publicPayloads !== void 0 ? {
|
|
@@ -1162,45 +1197,45 @@ var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...pr
|
|
|
1162
1197
|
} : void 0;
|
|
1163
1198
|
const payloadCount = (publicPayloads ?? 0) + (privatePayloads ?? 0);
|
|
1164
1199
|
const [ref, handleClick] = useLinkedBlockItem("payload-counts", data);
|
|
1165
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ React20.createElement(TableCell5, {
|
|
1166
1201
|
ref,
|
|
1167
1202
|
...props
|
|
1168
|
-
}, /* @__PURE__ */
|
|
1203
|
+
}, /* @__PURE__ */ React20.createElement("span", null, error ? /* @__PURE__ */ React20.createElement(Tooltip4, {
|
|
1169
1204
|
title: error.message
|
|
1170
|
-
}, /* @__PURE__ */
|
|
1205
|
+
}, /* @__PURE__ */ React20.createElement(Error2, {
|
|
1171
1206
|
color: "error"
|
|
1172
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1207
|
+
})) : null, linked ? /* @__PURE__ */ React20.createElement(Tooltip4, {
|
|
1173
1208
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1174
|
-
}, /* @__PURE__ */
|
|
1209
|
+
}, /* @__PURE__ */ React20.createElement(Link, {
|
|
1175
1210
|
onClick: handleClick,
|
|
1176
1211
|
sx: {
|
|
1177
1212
|
cursor: "pointer"
|
|
1178
1213
|
}
|
|
1179
|
-
}, payloadCount)) : /* @__PURE__ */
|
|
1214
|
+
}, payloadCount)) : /* @__PURE__ */ React20.createElement(Tooltip4, {
|
|
1180
1215
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1181
|
-
}, /* @__PURE__ */
|
|
1216
|
+
}, /* @__PURE__ */ React20.createElement("span", null, payloadCount))));
|
|
1182
1217
|
}, "BlockPayloadCountsTableCell");
|
|
1183
1218
|
|
|
1184
1219
|
// src/components/block/table/cell/Producer.tsx
|
|
1185
1220
|
import { TableCell as TableCell6, Tooltip as Tooltip5 } from "@mui/material";
|
|
1186
|
-
import
|
|
1221
|
+
import React21 from "react";
|
|
1187
1222
|
var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
1188
1223
|
const [ref, handleClick] = useLinkedBlockItem("block-producer", JSON.stringify(block));
|
|
1189
1224
|
const producer = useBlockProducer(block);
|
|
1190
|
-
const [notAvailable, setNotAvailable] =
|
|
1191
|
-
return /* @__PURE__ */
|
|
1225
|
+
const [notAvailable, setNotAvailable] = React21.useState(false);
|
|
1226
|
+
return /* @__PURE__ */ React21.createElement(TableCell6, {
|
|
1192
1227
|
ref,
|
|
1193
1228
|
...props
|
|
1194
|
-
}, /* @__PURE__ */
|
|
1229
|
+
}, /* @__PURE__ */ React21.createElement(Tooltip5, {
|
|
1195
1230
|
title: `Block Producer: ${producer}`
|
|
1196
|
-
}, /* @__PURE__ */
|
|
1231
|
+
}, /* @__PURE__ */ React21.createElement(BlockProducerChip, {
|
|
1197
1232
|
sx: {
|
|
1198
1233
|
cursor: "pointer"
|
|
1199
1234
|
},
|
|
1200
1235
|
onClick: linked ? handleClick : () => setNotAvailable(true),
|
|
1201
1236
|
block,
|
|
1202
1237
|
...producerChipProps
|
|
1203
|
-
})), notAvailableDialog && notAvailable ? /* @__PURE__ */
|
|
1238
|
+
})), notAvailableDialog && notAvailable ? /* @__PURE__ */ React21.createElement(FeatureNotAvailable, {
|
|
1204
1239
|
featureName: "Producer Details",
|
|
1205
1240
|
open: notAvailable,
|
|
1206
1241
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1210,7 +1245,7 @@ var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailab
|
|
|
1210
1245
|
// src/components/block/table/cell/TransactionCount.tsx
|
|
1211
1246
|
import { Error as Error3 } from "@mui/icons-material";
|
|
1212
1247
|
import { Link as Link2, TableCell as TableCell7, Tooltip as Tooltip6 } from "@mui/material";
|
|
1213
|
-
import
|
|
1248
|
+
import React22, { useMemo as useMemo10 } from "react";
|
|
1214
1249
|
var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1215
1250
|
const [transactions, error] = useTxsFromBlock(block);
|
|
1216
1251
|
const txHashes = useMemo10(() => transactions?.map(([, hash]) => hash), [
|
|
@@ -1221,14 +1256,14 @@ var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ..
|
|
|
1221
1256
|
block: block[0]._hash
|
|
1222
1257
|
} : void 0;
|
|
1223
1258
|
const [ref, handleClick] = useLinkedBlockItem("transaction-count", data);
|
|
1224
|
-
return /* @__PURE__ */
|
|
1259
|
+
return /* @__PURE__ */ React22.createElement(TableCell7, {
|
|
1225
1260
|
ref,
|
|
1226
1261
|
...props
|
|
1227
|
-
}, /* @__PURE__ */
|
|
1262
|
+
}, /* @__PURE__ */ React22.createElement("span", null, error ? /* @__PURE__ */ React22.createElement(Tooltip6, {
|
|
1228
1263
|
title: error.message
|
|
1229
|
-
}, /* @__PURE__ */
|
|
1264
|
+
}, /* @__PURE__ */ React22.createElement(Error3, {
|
|
1230
1265
|
color: "error"
|
|
1231
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1266
|
+
})) : null, linked ? /* @__PURE__ */ React22.createElement(Link2, {
|
|
1232
1267
|
onClick: handleClick,
|
|
1233
1268
|
sx: {
|
|
1234
1269
|
cursor: "pointer"
|
|
@@ -1241,17 +1276,17 @@ import { CheckCircleOutlineRounded } from "@mui/icons-material";
|
|
|
1241
1276
|
import { TableCell as TableCell8 } from "@mui/material";
|
|
1242
1277
|
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
1243
1278
|
import { BWVerification as BWVerification2 } from "@xyo-network/react-boundwitness-plugin";
|
|
1244
|
-
import
|
|
1279
|
+
import React23 from "react";
|
|
1245
1280
|
var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepValidation, ...props }) => {
|
|
1246
|
-
return /* @__PURE__ */
|
|
1281
|
+
return /* @__PURE__ */ React23.createElement(TableCell8, props, /* @__PURE__ */ React23.createElement(FlexRow4, {
|
|
1247
1282
|
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1248
1283
|
sx: {
|
|
1249
1284
|
width: "100%"
|
|
1250
1285
|
}
|
|
1251
|
-
}, deepValidation ? /* @__PURE__ */
|
|
1286
|
+
}, deepValidation ? /* @__PURE__ */ React23.createElement(BWVerification2, {
|
|
1252
1287
|
iconColors: true,
|
|
1253
1288
|
boundwitness: block?.[0]
|
|
1254
|
-
}) : /* @__PURE__ */
|
|
1289
|
+
}) : /* @__PURE__ */ React23.createElement(CheckCircleOutlineRounded, {
|
|
1255
1290
|
color: "success"
|
|
1256
1291
|
})));
|
|
1257
1292
|
}, "BlockVerificationTableCell");
|
|
@@ -1259,45 +1294,51 @@ var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepVa
|
|
|
1259
1294
|
// src/components/block/table/Ex.tsx
|
|
1260
1295
|
import { TableBody } from "@mui/material";
|
|
1261
1296
|
import { TableEx } from "@xyo-network/react-table";
|
|
1262
|
-
import
|
|
1297
|
+
import React25 from "react";
|
|
1263
1298
|
|
|
1264
1299
|
// src/components/block/table/head/TableHead.tsx
|
|
1265
1300
|
import { InfoOutline } from "@mui/icons-material";
|
|
1266
1301
|
import { TableCell as TableCell9, TableHead, TableRow, Tooltip as Tooltip7, Typography as Typography5 } from "@mui/material";
|
|
1267
1302
|
import { FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
|
1268
|
-
import
|
|
1303
|
+
import React24 from "react";
|
|
1269
1304
|
var ToolTipTableCell = /* @__PURE__ */ __name(({ children, align, title, ...props }) => {
|
|
1270
|
-
return /* @__PURE__ */
|
|
1305
|
+
return /* @__PURE__ */ React24.createElement(TableCell9, {
|
|
1271
1306
|
title,
|
|
1272
1307
|
...props
|
|
1273
|
-
}, /* @__PURE__ */
|
|
1274
|
-
title
|
|
1275
|
-
}, /* @__PURE__ */ React23.createElement(FlexRow5, {
|
|
1308
|
+
}, /* @__PURE__ */ React24.createElement(FlexRow5, {
|
|
1276
1309
|
justifyContent: align
|
|
1277
|
-
}, /* @__PURE__ */
|
|
1310
|
+
}, /* @__PURE__ */ React24.createElement(Typography5, {
|
|
1278
1311
|
variant: "body2"
|
|
1279
|
-
}, children), "\xA0", /* @__PURE__ */
|
|
1312
|
+
}, children), "\xA0", /* @__PURE__ */ React24.createElement(Tooltip7, {
|
|
1313
|
+
title
|
|
1314
|
+
}, /* @__PURE__ */ React24.createElement(InfoOutline, {
|
|
1280
1315
|
fontSize: "small"
|
|
1281
1316
|
}))));
|
|
1282
1317
|
}, "ToolTipTableCell");
|
|
1283
1318
|
var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
1284
|
-
return /* @__PURE__ */
|
|
1319
|
+
return /* @__PURE__ */ React24.createElement(TableHead, null, /* @__PURE__ */ React24.createElement(TableRow, null, /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1285
1320
|
align: "left",
|
|
1286
1321
|
title: "The block number that is included in the block"
|
|
1287
|
-
}, "Block"), /* @__PURE__ */
|
|
1288
|
-
title: "The hash of the block"
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1322
|
+
}, "Block"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1323
|
+
title: "The hash of the block",
|
|
1324
|
+
sx: {
|
|
1325
|
+
width: "20%"
|
|
1326
|
+
}
|
|
1327
|
+
}, "Hash"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1328
|
+
title: "The epoch of the block",
|
|
1329
|
+
sx: {
|
|
1330
|
+
width: "20%"
|
|
1331
|
+
}
|
|
1332
|
+
}, "Epoch"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1292
1333
|
align: "left",
|
|
1293
1334
|
title: "Count of transactions that are included in the block"
|
|
1294
|
-
}, "Transactions"), /* @__PURE__ */
|
|
1335
|
+
}, "Transactions"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1295
1336
|
align: "left",
|
|
1296
1337
|
title: "Count of public and private payload counts for the block"
|
|
1297
|
-
}, "Payloads"), /* @__PURE__ */
|
|
1338
|
+
}, "Payloads"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1298
1339
|
align: "center",
|
|
1299
1340
|
title: "The result of the local validation check for the block"
|
|
1300
|
-
}, "Valid"), /* @__PURE__ */
|
|
1341
|
+
}, "Valid"), /* @__PURE__ */ React24.createElement(ToolTipTableCell, {
|
|
1301
1342
|
align: "center",
|
|
1302
1343
|
title: "Link to display the raw JSON of the block"
|
|
1303
1344
|
}, "JSON")));
|
|
@@ -1305,10 +1346,10 @@ var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
|
1305
1346
|
|
|
1306
1347
|
// src/components/block/table/Ex.tsx
|
|
1307
1348
|
var BlockchainTableEx = /* @__PURE__ */ __name(({ ref, children, ...props }) => {
|
|
1308
|
-
return /* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ React25.createElement(TableEx, {
|
|
1309
1350
|
ref,
|
|
1310
1351
|
...props
|
|
1311
|
-
}, /* @__PURE__ */
|
|
1352
|
+
}, /* @__PURE__ */ React25.createElement(BlockchainTableHead, null), /* @__PURE__ */ React25.createElement(TableBody, null, children));
|
|
1312
1353
|
}, "BlockchainTableEx");
|
|
1313
1354
|
BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
1314
1355
|
|
|
@@ -1316,7 +1357,7 @@ BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
|
1316
1357
|
import { TableRow as TableRow2, useTheme } from "@mui/material";
|
|
1317
1358
|
import { alphaCss } from "@xylabs/react-theme";
|
|
1318
1359
|
import { usePayloadRootHash as usePayloadRootHash3 } from "@xyo-network/react-shared";
|
|
1319
|
-
import
|
|
1360
|
+
import React26, { useMemo as useMemo11 } from "react";
|
|
1320
1361
|
var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaultExpanded, linked, sx, ...props }) => {
|
|
1321
1362
|
const linkedTableCellProps = useMemo11(() => ({
|
|
1322
1363
|
block,
|
|
@@ -1333,7 +1374,7 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1333
1374
|
const hash = usePayloadRootHash3(block?.[0]);
|
|
1334
1375
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1335
1376
|
const theme = useTheme();
|
|
1336
|
-
return /* @__PURE__ */
|
|
1377
|
+
return /* @__PURE__ */ React26.createElement(TableRow2, {
|
|
1337
1378
|
onClick: linked ? handleClick : void 0,
|
|
1338
1379
|
ref,
|
|
1339
1380
|
sx: {
|
|
@@ -1345,54 +1386,54 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
|
|
|
1345
1386
|
...sx
|
|
1346
1387
|
},
|
|
1347
1388
|
...props
|
|
1348
|
-
}, /* @__PURE__ */
|
|
1389
|
+
}, /* @__PURE__ */ React26.createElement(BlockNumberTableCell, {
|
|
1349
1390
|
align: "left",
|
|
1350
1391
|
...linkedTableCellProps
|
|
1351
|
-
}), /* @__PURE__ */
|
|
1392
|
+
}), /* @__PURE__ */ React26.createElement(BlockHashTableCell, {
|
|
1352
1393
|
align: "left",
|
|
1353
1394
|
...linkedTableCellProps
|
|
1354
|
-
}), /* @__PURE__ */
|
|
1395
|
+
}), /* @__PURE__ */ React26.createElement(BlockEpochTableCell, {
|
|
1355
1396
|
align: "left",
|
|
1356
1397
|
...linkedTableCellProps
|
|
1357
|
-
}), /* @__PURE__ */
|
|
1398
|
+
}), /* @__PURE__ */ React26.createElement(BlockTransactionCountTableCell, {
|
|
1358
1399
|
align: "left",
|
|
1359
1400
|
...linkedTableCellProps
|
|
1360
|
-
}), /* @__PURE__ */
|
|
1401
|
+
}), /* @__PURE__ */ React26.createElement(BlockPayloadCountsTableCell, {
|
|
1361
1402
|
align: "left",
|
|
1362
1403
|
...linkedTableCellProps
|
|
1363
|
-
}), /* @__PURE__ */
|
|
1404
|
+
}), /* @__PURE__ */ React26.createElement(BlockVerificationTableCell, {
|
|
1364
1405
|
deepValidation,
|
|
1365
1406
|
...defaultTableCellProps
|
|
1366
|
-
}), /* @__PURE__ */
|
|
1407
|
+
}), /* @__PURE__ */ React26.createElement(BlockJsonViewTableCell, defaultTableCellProps));
|
|
1367
1408
|
}, "BlockChainTableRow");
|
|
1368
1409
|
|
|
1369
1410
|
// src/components/chain/controls/PollingControlsFlexbox.tsx
|
|
1370
1411
|
import { Autorenew, Pause } from "@mui/icons-material";
|
|
1371
1412
|
import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip8 } from "@mui/material";
|
|
1372
1413
|
import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
|
|
1373
|
-
import
|
|
1414
|
+
import React31, { memo } from "react";
|
|
1374
1415
|
|
|
1375
1416
|
// src/components/chain/stats/Dialog.tsx
|
|
1376
1417
|
import { QueryStats } from "@mui/icons-material";
|
|
1377
1418
|
import { Dialog as Dialog3, DialogContent as DialogContent3, DialogTitle as DialogTitle3, IconButton as IconButton3 } from "@mui/material";
|
|
1378
|
-
import
|
|
1419
|
+
import React29, { useState as useState11 } from "react";
|
|
1379
1420
|
|
|
1380
1421
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1381
1422
|
import { ListItem, styled, Typography as Typography6 } from "@mui/material";
|
|
1382
1423
|
import { ErrorRender as ErrorRender3 } from "@xylabs/react-error";
|
|
1383
1424
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
1384
1425
|
import { isChainSummaryProducers } from "@xyo-network/chain-analyze";
|
|
1385
|
-
import
|
|
1426
|
+
import React28, { useMemo as useMemo12 } from "react";
|
|
1386
1427
|
|
|
1387
1428
|
// src/components/chain/stats/producer/Table.tsx
|
|
1388
1429
|
import { Table, TableBody as TableBody2, TableCell as TableCell10, TableHead as TableHead2, TableRow as TableRow3, useTheme as useTheme2 } from "@mui/material";
|
|
1389
1430
|
import { BlockiesAvatar as BlockiesAvatar2 } from "@xyo-network/react-chain-blockies";
|
|
1390
|
-
import
|
|
1431
|
+
import React27 from "react";
|
|
1391
1432
|
var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) => {
|
|
1392
1433
|
const theme = useTheme2();
|
|
1393
|
-
return /* @__PURE__ */
|
|
1434
|
+
return /* @__PURE__ */ React27.createElement(Table, props, /* @__PURE__ */ React27.createElement(TableHead2, null, /* @__PURE__ */ React27.createElement(TableRow3, null, /* @__PURE__ */ React27.createElement(TableCell10, null, "Address"), /* @__PURE__ */ React27.createElement(TableCell10, null, "Blocks Produced"), /* @__PURE__ */ React27.createElement(TableCell10, null, "Rewards Earned Produced"))), /* @__PURE__ */ React27.createElement(TableBody2, null, producers?.map((producer) => /* @__PURE__ */ React27.createElement(TableRow3, {
|
|
1394
1435
|
key: producer.address
|
|
1395
|
-
}, /* @__PURE__ */
|
|
1436
|
+
}, /* @__PURE__ */ React27.createElement(TableCell10, null, /* @__PURE__ */ React27.createElement(BlockiesAvatar2, {
|
|
1396
1437
|
blockiesOptions: {
|
|
1397
1438
|
seed: producer.address
|
|
1398
1439
|
},
|
|
@@ -1400,7 +1441,7 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
|
|
|
1400
1441
|
height: theme.spacing(2.75),
|
|
1401
1442
|
width: theme.spacing(2.75)
|
|
1402
1443
|
}
|
|
1403
|
-
})), /* @__PURE__ */
|
|
1444
|
+
})), /* @__PURE__ */ React27.createElement(TableCell10, null, producer.blocksProduced.toString()), /* @__PURE__ */ React27.createElement(TableCell10, null, producer.rewardsEarned.toString())))));
|
|
1404
1445
|
}, "ChainProducerStatsTable");
|
|
1405
1446
|
|
|
1406
1447
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
@@ -1422,16 +1463,16 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
|
|
|
1422
1463
|
const producersArray = useMemo12(() => Object.values(producer?.producers ?? {}), [
|
|
1423
1464
|
producer
|
|
1424
1465
|
]);
|
|
1425
|
-
return /* @__PURE__ */
|
|
1466
|
+
return /* @__PURE__ */ React28.createElement(FlexCol3, {
|
|
1426
1467
|
alignItems: "start",
|
|
1427
1468
|
gap: 1,
|
|
1428
1469
|
...props
|
|
1429
|
-
}, /* @__PURE__ */
|
|
1470
|
+
}, /* @__PURE__ */ React28.createElement(ErrorRender3, {
|
|
1430
1471
|
error: producerError,
|
|
1431
1472
|
scope: "BlockProducerStatsFlexbox"
|
|
1432
|
-
}), /* @__PURE__ */
|
|
1473
|
+
}), /* @__PURE__ */ React28.createElement(Typography6, {
|
|
1433
1474
|
fontSize: "1rem"
|
|
1434
|
-
}, "Block Producers"), /* @__PURE__ */
|
|
1475
|
+
}, "Block Producers"), /* @__PURE__ */ React28.createElement(ChainProducerStatsTable, {
|
|
1435
1476
|
producers: producersArray
|
|
1436
1477
|
}));
|
|
1437
1478
|
}, "BlockProducerStatsFlexbox");
|
|
@@ -1443,18 +1484,18 @@ var StyledListItem = styled(ListItem)(() => ({
|
|
|
1443
1484
|
// src/components/chain/stats/Dialog.tsx
|
|
1444
1485
|
var ChainAnalyzerStatsDialog = /* @__PURE__ */ __name((props) => {
|
|
1445
1486
|
const { analyzers, statsUpdated } = useChainAnalyzersContext();
|
|
1446
|
-
return /* @__PURE__ */
|
|
1487
|
+
return /* @__PURE__ */ React29.createElement(Dialog3, props, /* @__PURE__ */ React29.createElement(DialogTitle3, null, "Chain Analysis"), /* @__PURE__ */ React29.createElement(DialogContent3, null, statsUpdated > 0 && Object.entries(analyzers).map(([id2, analyzer]) => /* @__PURE__ */ React29.createElement("div", {
|
|
1447
1488
|
key: id2
|
|
1448
|
-
}, id2 === "producers" && /* @__PURE__ */
|
|
1489
|
+
}, id2 === "producers" && /* @__PURE__ */ React29.createElement(BlockProducerStatsFlexbox, {
|
|
1449
1490
|
payload: analyzer.result()
|
|
1450
1491
|
})))));
|
|
1451
1492
|
}, "ChainAnalyzerStatsDialog");
|
|
1452
1493
|
var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
1453
1494
|
const [open, setOpen] = useState11(false);
|
|
1454
1495
|
const handleClose = /* @__PURE__ */ __name(() => setOpen(false), "handleClose");
|
|
1455
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(IconButton3, {
|
|
1456
1497
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1457
|
-
}, /* @__PURE__ */
|
|
1498
|
+
}, /* @__PURE__ */ React29.createElement(QueryStats, null)), /* @__PURE__ */ React29.createElement(ChainAnalyzerStatsDialog, {
|
|
1458
1499
|
onClose: handleClose,
|
|
1459
1500
|
open,
|
|
1460
1501
|
...props
|
|
@@ -1463,19 +1504,19 @@ var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
|
1463
1504
|
|
|
1464
1505
|
// src/components/chain/controls/PulseSvgIcon.tsx
|
|
1465
1506
|
import { createSvgIcon, keyframes, styled as styled2 } from "@mui/material";
|
|
1466
|
-
import
|
|
1467
|
-
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */
|
|
1507
|
+
import React30 from "react";
|
|
1508
|
+
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */ React30.createElement("svg", {
|
|
1468
1509
|
viewBox: "0 0 80 80",
|
|
1469
1510
|
version: "1.1",
|
|
1470
1511
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1471
|
-
}, /* @__PURE__ */
|
|
1512
|
+
}, /* @__PURE__ */ React30.createElement("g", {
|
|
1472
1513
|
transform: "translate(34,34)"
|
|
1473
|
-
}, /* @__PURE__ */
|
|
1514
|
+
}, /* @__PURE__ */ React30.createElement("circle", {
|
|
1474
1515
|
className: "core",
|
|
1475
1516
|
cx: "0",
|
|
1476
1517
|
cy: "0",
|
|
1477
1518
|
r: "6"
|
|
1478
|
-
}), /* @__PURE__ */
|
|
1519
|
+
}), /* @__PURE__ */ React30.createElement("circle", {
|
|
1479
1520
|
className: "radar",
|
|
1480
1521
|
cx: "0",
|
|
1481
1522
|
cy: "0",
|
|
@@ -1539,24 +1580,24 @@ var StyledPulseSvgIcon = styled2(PulseSvgIcon)(({ theme }) => {
|
|
|
1539
1580
|
var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingState, setPollingState }) => {
|
|
1540
1581
|
const paused = pollingState === "paused";
|
|
1541
1582
|
const running = pollingState === "running";
|
|
1542
|
-
return /* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ React31.createElement(FlexRow6, {
|
|
1543
1584
|
justifyContent: "space-between",
|
|
1544
1585
|
width: "100%"
|
|
1545
|
-
}, /* @__PURE__ */
|
|
1586
|
+
}, /* @__PURE__ */ React31.createElement(FlexRow6, {
|
|
1546
1587
|
gap: 2
|
|
1547
|
-
}, running && /* @__PURE__ */
|
|
1588
|
+
}, running && /* @__PURE__ */ React31.createElement(IconButton4, {
|
|
1548
1589
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("paused"), "onClick"),
|
|
1549
1590
|
title: "Pause Block Stream"
|
|
1550
|
-
}, /* @__PURE__ */
|
|
1591
|
+
}, /* @__PURE__ */ React31.createElement(Pause, null)), paused && /* @__PURE__ */ React31.createElement(IconButton4, {
|
|
1551
1592
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick"),
|
|
1552
1593
|
title: "Re-Sync Block Stream"
|
|
1553
|
-
}, /* @__PURE__ */
|
|
1594
|
+
}, /* @__PURE__ */ React31.createElement(Autorenew, null)), /* @__PURE__ */ React31.createElement(ChainAnalyzerStatsDialogFromContext, null)), /* @__PURE__ */ React31.createElement(FlexRow6, {
|
|
1554
1595
|
gap: 2
|
|
1555
|
-
}, /* @__PURE__ */
|
|
1596
|
+
}, /* @__PURE__ */ React31.createElement(Grow, {
|
|
1556
1597
|
in: (blocksBehind ?? 0) > 0
|
|
1557
|
-
}, /* @__PURE__ */
|
|
1598
|
+
}, /* @__PURE__ */ React31.createElement(Tooltip8, {
|
|
1558
1599
|
title: "Click to Re-Sync"
|
|
1559
|
-
}, /* @__PURE__ */
|
|
1600
|
+
}, /* @__PURE__ */ React31.createElement(Alert3, {
|
|
1560
1601
|
sx: {
|
|
1561
1602
|
py: 0,
|
|
1562
1603
|
px: 1,
|
|
@@ -1564,11 +1605,11 @@ var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingStat
|
|
|
1564
1605
|
},
|
|
1565
1606
|
severity: "warning",
|
|
1566
1607
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick")
|
|
1567
|
-
}, /* @__PURE__ */
|
|
1608
|
+
}, /* @__PURE__ */ React31.createElement(AlertTitle2, {
|
|
1568
1609
|
sx: {
|
|
1569
1610
|
mb: 0
|
|
1570
1611
|
}
|
|
1571
|
-
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */
|
|
1612
|
+
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */ React31.createElement(Icon2, null, /* @__PURE__ */ React31.createElement(StyledPulseSvgIcon, {
|
|
1572
1613
|
className: running ? "" : "paused"
|
|
1573
1614
|
}))));
|
|
1574
1615
|
}, "PollingControlsFlexbox");
|
|
@@ -1576,9 +1617,9 @@ var MemoizedPollingControlsFlexbox = /* @__PURE__ */ memo(PollingControlsFlexbox
|
|
|
1576
1617
|
|
|
1577
1618
|
// src/components/chain/dialog/Dialog.tsx
|
|
1578
1619
|
import { Button as Button4, Dialog as Dialog4, DialogActions as DialogActions3, DialogContent as DialogContent4 } from "@mui/material";
|
|
1579
|
-
import
|
|
1620
|
+
import React32 from "react";
|
|
1580
1621
|
var TransactionsDialog = /* @__PURE__ */ __name((props) => {
|
|
1581
|
-
return /* @__PURE__ */
|
|
1622
|
+
return /* @__PURE__ */ React32.createElement(Dialog4, props, /* @__PURE__ */ React32.createElement(DialogContent4, null, "Transactions Dialog"), /* @__PURE__ */ React32.createElement(DialogActions3, null, /* @__PURE__ */ React32.createElement(Button4, {
|
|
1582
1623
|
variant: "outlined",
|
|
1583
1624
|
onClick: /* @__PURE__ */ __name((e) => props?.onClose?.(e, "escapeKeyDown"), "onClick")
|
|
1584
1625
|
}, "Close")));
|
|
@@ -1618,9 +1659,9 @@ var useOnBlock = /* @__PURE__ */ __name((initialHeadNumber, onAddBlock, liveHead
|
|
|
1618
1659
|
|
|
1619
1660
|
// src/components/chain/pagination/BlockChainPagination.tsx
|
|
1620
1661
|
import { TablePaginationActions } from "@xyo-network/react-payload-table";
|
|
1621
|
-
import
|
|
1662
|
+
import React33 from "react";
|
|
1622
1663
|
var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, page, rowsPerPage = 10 }) => {
|
|
1623
|
-
return /* @__PURE__ */
|
|
1664
|
+
return /* @__PURE__ */ React33.createElement(TablePaginationActions, {
|
|
1624
1665
|
count,
|
|
1625
1666
|
onPageChange,
|
|
1626
1667
|
page,
|
|
@@ -1654,11 +1695,11 @@ var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
|
1654
1695
|
// src/components/chain/render/dynamic/flexbox/variants/Base.tsx
|
|
1655
1696
|
import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
|
|
1656
1697
|
import { FlexCol as FlexCol5 } from "@xylabs/react-flexbox";
|
|
1657
|
-
import
|
|
1698
|
+
import React35 from "react";
|
|
1658
1699
|
|
|
1659
1700
|
// src/components/chain/list/Animated.tsx
|
|
1660
1701
|
import { AnimatedList } from "@xylabs/react-animation";
|
|
1661
|
-
import
|
|
1702
|
+
import React34 from "react";
|
|
1662
1703
|
|
|
1663
1704
|
// src/components/chain/styled/BlockListWrapperFlexbox.tsx
|
|
1664
1705
|
import { styled as styled3 } from "@mui/material";
|
|
@@ -1679,10 +1720,10 @@ var BlockListWrapperFlexBox = styled3(FlexCol4, {
|
|
|
1679
1720
|
|
|
1680
1721
|
// src/components/chain/list/Animated.tsx
|
|
1681
1722
|
var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents }) => {
|
|
1682
|
-
return /* @__PURE__ */
|
|
1723
|
+
return /* @__PURE__ */ React34.createElement(BlockListWrapperFlexBox, {
|
|
1683
1724
|
alignItems: "stretch",
|
|
1684
1725
|
width: "100%"
|
|
1685
|
-
}, /* @__PURE__ */
|
|
1726
|
+
}, /* @__PURE__ */ React34.createElement(AnimatedList, {
|
|
1686
1727
|
fullWidth: true,
|
|
1687
1728
|
items: blockChainRenderComponents
|
|
1688
1729
|
}));
|
|
@@ -1692,7 +1733,9 @@ var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents })
|
|
|
1692
1733
|
import { useMemo as useMemo14 } from "react";
|
|
1693
1734
|
var useDynamicBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blockChainRenderProps) => {
|
|
1694
1735
|
const { maxBlocks } = blockChainRenderProps ?? {};
|
|
1695
|
-
const chainIteratorParams = useMemo14(() => blockChainRenderProps ?? {
|
|
1736
|
+
const chainIteratorParams = useMemo14(() => blockChainRenderProps ?? {
|
|
1737
|
+
name: "unknown"
|
|
1738
|
+
}, [
|
|
1696
1739
|
blockChainRenderProps
|
|
1697
1740
|
]);
|
|
1698
1741
|
const [params, paramsError] = useChainIteratorParams(chainIteratorParams);
|
|
@@ -1735,14 +1778,11 @@ var getChainArchivistFromBridge = /* @__PURE__ */ __name(async (params) => {
|
|
|
1735
1778
|
return assertEx4(asArchivistInstance(mod), () => `Module ${chainArchivistModuleId} is not an archivist`);
|
|
1736
1779
|
}, "getChainArchivistFromBridge");
|
|
1737
1780
|
|
|
1738
|
-
// src/lib/
|
|
1781
|
+
// src/lib/getChainId.ts
|
|
1739
1782
|
var id = "ce080bf3043a40c6c8838c7e813c00ab53df1684";
|
|
1740
|
-
var
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
};
|
|
1744
|
-
return chainInformation;
|
|
1745
|
-
}, "getChainInformation");
|
|
1783
|
+
var getChainId = /* @__PURE__ */ __name(() => {
|
|
1784
|
+
return id;
|
|
1785
|
+
}, "getChainId");
|
|
1746
1786
|
|
|
1747
1787
|
// src/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.ts
|
|
1748
1788
|
var useRemoteBlockChainRenderProps = /* @__PURE__ */ __name((chainArchivistModuleId, url, blockChainRenderPropsArg) => {
|
|
@@ -1759,7 +1799,8 @@ var useRemoteBlockChainRenderProps = /* @__PURE__ */ __name((chainArchivistModul
|
|
|
1759
1799
|
]);
|
|
1760
1800
|
const blockChainRenderProps = useMemo15(() => ({
|
|
1761
1801
|
...blockChainRenderPropsArg,
|
|
1762
|
-
chainArchivist
|
|
1802
|
+
chainArchivist,
|
|
1803
|
+
name: "blockChainRenderProps"
|
|
1763
1804
|
}), [
|
|
1764
1805
|
blockChainRenderPropsArg,
|
|
1765
1806
|
chainArchivist
|
|
@@ -1773,39 +1814,40 @@ var useRemoteBlockChainRenderProps = /* @__PURE__ */ __name((chainArchivistModul
|
|
|
1773
1814
|
// src/components/chain/render/dynamic/flexbox/variants/Base.tsx
|
|
1774
1815
|
var DynamicListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1775
1816
|
const { errors, blockChainRenderComponents, blocksWhilePaused, pollingState, updatePollingState } = useDynamicBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1776
|
-
return /* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ React35.createElement(FlexCol5, {
|
|
1777
1818
|
alignItems: "start",
|
|
1778
1819
|
...props
|
|
1779
|
-
}, errors?.map((error) => /* @__PURE__ */
|
|
1820
|
+
}, errors?.map((error) => /* @__PURE__ */ React35.createElement(ErrorRender4, {
|
|
1780
1821
|
error,
|
|
1781
1822
|
key: error?.name,
|
|
1782
1823
|
scope: "DynamicBlockchainRenderFlexboxInner"
|
|
1783
|
-
})), /* @__PURE__ */
|
|
1824
|
+
})), /* @__PURE__ */ React35.createElement(MemoizedPollingControlsFlexbox, {
|
|
1784
1825
|
blocksBehind: blocksWhilePaused?.length,
|
|
1785
1826
|
pollingState,
|
|
1786
1827
|
setPollingState: updatePollingState
|
|
1787
|
-
}), /* @__PURE__ */
|
|
1828
|
+
}), /* @__PURE__ */ React35.createElement(BlockListAnimated, {
|
|
1788
1829
|
blockChainRenderComponents
|
|
1789
1830
|
}));
|
|
1790
1831
|
}, "DynamicListBase");
|
|
1791
1832
|
|
|
1792
1833
|
// src/components/chain/render/dynamic/flexbox/variants/WithAnalysis.tsx
|
|
1834
|
+
import { isAddress } from "@xylabs/hex";
|
|
1793
1835
|
import { ChainProducersAnalyzer } from "@xyo-network/chain-analyze";
|
|
1794
|
-
import
|
|
1836
|
+
import React36, { useMemo as useMemo16 } from "react";
|
|
1795
1837
|
var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1796
|
-
const {
|
|
1838
|
+
const { chainId } = blockChainRenderProps ?? {};
|
|
1797
1839
|
const analyzers = useMemo16(() => {
|
|
1798
|
-
if (
|
|
1840
|
+
if (isAddress(chainId)) {
|
|
1799
1841
|
return {
|
|
1800
1842
|
producers: new ChainProducersAnalyzer()
|
|
1801
1843
|
};
|
|
1802
1844
|
}
|
|
1803
1845
|
}, [
|
|
1804
|
-
|
|
1846
|
+
chainId
|
|
1805
1847
|
]);
|
|
1806
|
-
return /* @__PURE__ */
|
|
1848
|
+
return /* @__PURE__ */ React36.createElement(ChainAnalyzersProvider, {
|
|
1807
1849
|
analyzers
|
|
1808
|
-
}, /* @__PURE__ */
|
|
1850
|
+
}, /* @__PURE__ */ React36.createElement(ChainPollingProvider, null, /* @__PURE__ */ React36.createElement(DynamicListBase, {
|
|
1809
1851
|
blockChainRenderProps,
|
|
1810
1852
|
...props
|
|
1811
1853
|
})));
|
|
@@ -1813,13 +1855,13 @@ var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1813
1855
|
|
|
1814
1856
|
// src/components/chain/render/dynamic/flexbox/variants/WithRemote.tsx
|
|
1815
1857
|
import { ErrorRender as ErrorRender5 } from "@xylabs/react-error";
|
|
1816
|
-
import
|
|
1858
|
+
import React37 from "react";
|
|
1817
1859
|
var WithRemote = /* @__PURE__ */ __name(({ url, chainArchivistModuleId, blockChainRenderProps: blockChainRenderPropsArg, ...props }) => {
|
|
1818
1860
|
const { error, blockChainRenderProps } = useRemoteBlockChainRenderProps(chainArchivistModuleId, url, blockChainRenderPropsArg);
|
|
1819
|
-
return /* @__PURE__ */
|
|
1861
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(ErrorRender5, {
|
|
1820
1862
|
error,
|
|
1821
1863
|
scope: "RemoteChainProviderFlexbox"
|
|
1822
|
-
}), /* @__PURE__ */
|
|
1864
|
+
}), /* @__PURE__ */ React37.createElement(WithAnalysis, {
|
|
1823
1865
|
blockChainRenderProps,
|
|
1824
1866
|
...props
|
|
1825
1867
|
}));
|
|
@@ -1835,7 +1877,7 @@ var DynamicBlockchainRenderFlexbox = {
|
|
|
1835
1877
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1836
1878
|
import { ErrorRender as ErrorRender6 } from "@xylabs/react-error";
|
|
1837
1879
|
import { FlexCol as FlexCol6, FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
1838
|
-
import
|
|
1880
|
+
import React38 from "react";
|
|
1839
1881
|
|
|
1840
1882
|
// src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts
|
|
1841
1883
|
import { exists } from "@xylabs/exists";
|
|
@@ -1844,7 +1886,9 @@ var DEFAULT_PAGE_SIZE = 25;
|
|
|
1844
1886
|
var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blockChainRenderProps) => {
|
|
1845
1887
|
const { maxBlocks } = blockChainRenderProps ?? {};
|
|
1846
1888
|
const pageSize = blockChainRenderProps?.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
1847
|
-
const chainIteratorParams = useMemo17(() => blockChainRenderProps ?? {
|
|
1889
|
+
const chainIteratorParams = useMemo17(() => blockChainRenderProps ?? {
|
|
1890
|
+
name: "unknown"
|
|
1891
|
+
}, [
|
|
1848
1892
|
blockChainRenderProps
|
|
1849
1893
|
]);
|
|
1850
1894
|
const [params, paramsError] = useChainIteratorParams(chainIteratorParams);
|
|
@@ -1868,45 +1912,46 @@ var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blo
|
|
|
1868
1912
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1869
1913
|
var StaticListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1870
1914
|
const { blockComponents, errors, paginatedBlockComponents, onPageChange, page, pageSize } = useStaticBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1871
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ React38.createElement(FlexCol6, {
|
|
1872
1916
|
alignItems: "start",
|
|
1873
1917
|
gap: 2,
|
|
1874
1918
|
width: "100%",
|
|
1875
1919
|
...props
|
|
1876
|
-
}, errors?.map((error) => /* @__PURE__ */
|
|
1920
|
+
}, errors?.map((error) => /* @__PURE__ */ React38.createElement(ErrorRender6, {
|
|
1877
1921
|
error,
|
|
1878
1922
|
key: error.name,
|
|
1879
1923
|
scope: "StaticBlockchainFlexboxInner"
|
|
1880
|
-
})), (paginatedBlockComponents?.length ?? 0) > 0 ? /* @__PURE__ */
|
|
1924
|
+
})), (paginatedBlockComponents?.length ?? 0) > 0 ? /* @__PURE__ */ React38.createElement(FlexGrowRow2, {
|
|
1881
1925
|
justifyContent: "space-between",
|
|
1882
1926
|
width: "100%"
|
|
1883
|
-
}, /* @__PURE__ */
|
|
1927
|
+
}, /* @__PURE__ */ React38.createElement(ChainAnalyzerStatsDialogFromContext, null), /* @__PURE__ */ React38.createElement(BlockChainPagination, {
|
|
1884
1928
|
count: blockComponents?.length ?? 0,
|
|
1885
1929
|
onPageChange,
|
|
1886
1930
|
page,
|
|
1887
1931
|
rowsPerPage: pageSize
|
|
1888
|
-
})) : null, /* @__PURE__ */
|
|
1932
|
+
})) : null, /* @__PURE__ */ React38.createElement(BlockListAnimated, {
|
|
1889
1933
|
blockChainRenderComponents: paginatedBlockComponents
|
|
1890
1934
|
}));
|
|
1891
1935
|
}, "StaticListBase");
|
|
1892
1936
|
|
|
1893
1937
|
// src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx
|
|
1938
|
+
import { isAddress as isAddress2 } from "@xylabs/hex";
|
|
1894
1939
|
import { ChainProducersAnalyzer as ChainProducersAnalyzer2 } from "@xyo-network/chain-analyze";
|
|
1895
|
-
import
|
|
1940
|
+
import React39, { useMemo as useMemo18 } from "react";
|
|
1896
1941
|
var WithAnalysis2 = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1897
|
-
const {
|
|
1942
|
+
const { chainId } = blockChainRenderProps ?? {};
|
|
1898
1943
|
const analyzers = useMemo18(() => {
|
|
1899
|
-
if (
|
|
1944
|
+
if (isAddress2(chainId)) {
|
|
1900
1945
|
return {
|
|
1901
1946
|
producers: new ChainProducersAnalyzer2()
|
|
1902
1947
|
};
|
|
1903
1948
|
}
|
|
1904
1949
|
}, [
|
|
1905
|
-
|
|
1950
|
+
chainId
|
|
1906
1951
|
]);
|
|
1907
|
-
return /* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ React39.createElement(ChainAnalyzersProvider, {
|
|
1908
1953
|
analyzers
|
|
1909
|
-
}, /* @__PURE__ */
|
|
1954
|
+
}, /* @__PURE__ */ React39.createElement(StaticListBase, {
|
|
1910
1955
|
blockChainRenderProps,
|
|
1911
1956
|
...props
|
|
1912
1957
|
}));
|
|
@@ -1921,19 +1966,19 @@ var StaticBlockchainRenderFlexBox = {
|
|
|
1921
1966
|
// src/components/payload/builder/Flexbox.tsx
|
|
1922
1967
|
import { FlexCol as FlexCol7 } from "@xylabs/react-flexbox";
|
|
1923
1968
|
import { JsonViewerEx as JsonViewerEx2 } from "@xyo-network/react-payload-raw-info";
|
|
1924
|
-
import
|
|
1969
|
+
import React40, { useState as useState13 } from "react";
|
|
1925
1970
|
var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild, ...props }) => {
|
|
1926
1971
|
const [payload, setPayload] = useState13();
|
|
1927
1972
|
const onBuildLocal = /* @__PURE__ */ __name((payload2) => {
|
|
1928
1973
|
onBuild?.(payload2);
|
|
1929
1974
|
setPayload(payload2);
|
|
1930
1975
|
}, "onBuildLocal");
|
|
1931
|
-
return /* @__PURE__ */
|
|
1976
|
+
return /* @__PURE__ */ React40.createElement(FlexCol7, {
|
|
1932
1977
|
gap: 2,
|
|
1933
1978
|
...props
|
|
1934
|
-
}, /* @__PURE__ */
|
|
1979
|
+
}, /* @__PURE__ */ React40.createElement(BuilderComponent, {
|
|
1935
1980
|
onBuild: onBuildLocal
|
|
1936
|
-
}), payload && /* @__PURE__ */
|
|
1981
|
+
}), payload && /* @__PURE__ */ React40.createElement(JsonViewerEx2, {
|
|
1937
1982
|
value: payload
|
|
1938
1983
|
}));
|
|
1939
1984
|
}, "PayloadBuilderFlexbox");
|
|
@@ -1941,11 +1986,11 @@ var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild,
|
|
|
1941
1986
|
// src/components/payload/builder/producer-intent/Form.tsx
|
|
1942
1987
|
import { Button as Button5, FormControl as FormControl5 } from "@mui/material";
|
|
1943
1988
|
import { createProducerChainStakeIntent } from "@xyo-network/chain-protocol";
|
|
1944
|
-
import
|
|
1989
|
+
import React43, { useMemo as useMemo20, useState as useState16 } from "react";
|
|
1945
1990
|
|
|
1946
1991
|
// src/components/payload/fields/BlockNumberTextField.tsx
|
|
1947
1992
|
import { FormControl as FormControl3, FormHelperText as FormHelperText2, TextField as TextField3 } from "@mui/material";
|
|
1948
|
-
import
|
|
1993
|
+
import React41, { useState as useState14 } from "react";
|
|
1949
1994
|
var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumberChanged, onChange, ...props }) => {
|
|
1950
1995
|
const [blockNumber, setBlockNumber] = useState14();
|
|
1951
1996
|
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
@@ -1955,15 +2000,15 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1955
2000
|
onChange?.(e);
|
|
1956
2001
|
}, "handleChange");
|
|
1957
2002
|
const errored = errorMessage !== void 0;
|
|
1958
|
-
return /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ React41.createElement(FormControl3, {
|
|
1959
2004
|
fullWidth: true
|
|
1960
|
-
}, /* @__PURE__ */
|
|
2005
|
+
}, /* @__PURE__ */ React41.createElement(TextField3, {
|
|
1961
2006
|
error: errored,
|
|
1962
2007
|
onChange: handleChange,
|
|
1963
2008
|
type: "number",
|
|
1964
2009
|
value: blockNumber ?? "",
|
|
1965
2010
|
...props
|
|
1966
|
-
}), errored && /* @__PURE__ */
|
|
2011
|
+
}), errored && /* @__PURE__ */ React41.createElement(FormHelperText2, {
|
|
1967
2012
|
sx: {
|
|
1968
2013
|
color: "error.main"
|
|
1969
2014
|
}
|
|
@@ -1972,8 +2017,8 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1972
2017
|
|
|
1973
2018
|
// src/components/payload/fields/XyoAddressTextField.tsx
|
|
1974
2019
|
import { FormControl as FormControl4, FormHelperText as FormHelperText3, TextField as TextField4 } from "@mui/material";
|
|
1975
|
-
import { asAddress, isAddress } from "@xylabs/hex";
|
|
1976
|
-
import
|
|
2020
|
+
import { asAddress, isAddress as isAddress3 } from "@xylabs/hex";
|
|
2021
|
+
import React42, { useMemo as useMemo19, useState as useState15 } from "react";
|
|
1977
2022
|
var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange, resetValue, ...props }) => {
|
|
1978
2023
|
const [address, setAddress] = useState15("");
|
|
1979
2024
|
const [addressError, setAddressError] = useState15();
|
|
@@ -1984,7 +2029,7 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
1984
2029
|
const { value } = event.target;
|
|
1985
2030
|
onChange?.(event);
|
|
1986
2031
|
const xyoAddress = asAddress(value);
|
|
1987
|
-
if (
|
|
2032
|
+
if (isAddress3(xyoAddress)) {
|
|
1988
2033
|
onAddressChanged?.(xyoAddress);
|
|
1989
2034
|
}
|
|
1990
2035
|
setAddressError(void 0);
|
|
@@ -1992,20 +2037,20 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
1992
2037
|
}, "handleChange");
|
|
1993
2038
|
const handleBlur = /* @__PURE__ */ __name(() => {
|
|
1994
2039
|
const xyoAddress = asAddress(address);
|
|
1995
|
-
if (!
|
|
2040
|
+
if (!isAddress3(xyoAddress)) {
|
|
1996
2041
|
setAddressError(new Error("Invalid address"));
|
|
1997
2042
|
onAddressChanged?.();
|
|
1998
2043
|
}
|
|
1999
2044
|
}, "handleBlur");
|
|
2000
|
-
return /* @__PURE__ */
|
|
2045
|
+
return /* @__PURE__ */ React42.createElement(FormControl4, {
|
|
2001
2046
|
fullWidth: true
|
|
2002
|
-
}, /* @__PURE__ */
|
|
2047
|
+
}, /* @__PURE__ */ React42.createElement(TextField4, {
|
|
2003
2048
|
error: !!addressError,
|
|
2004
2049
|
onBlur: handleBlur,
|
|
2005
2050
|
onChange: handleChange,
|
|
2006
2051
|
value: address,
|
|
2007
2052
|
...props
|
|
2008
|
-
}), addressError && /* @__PURE__ */
|
|
2053
|
+
}), addressError && /* @__PURE__ */ React42.createElement(FormHelperText3, {
|
|
2009
2054
|
sx: {
|
|
2010
2055
|
color: "error.main"
|
|
2011
2056
|
}
|
|
@@ -2038,33 +2083,33 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2038
2083
|
const onBuildLocal = /* @__PURE__ */ __name(() => {
|
|
2039
2084
|
if (onBuild && intentPayload) onBuild?.(intentPayload);
|
|
2040
2085
|
}, "onBuildLocal");
|
|
2041
|
-
return /* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(FormControl5, {
|
|
2042
2087
|
fullWidth: true
|
|
2043
|
-
}, /* @__PURE__ */
|
|
2088
|
+
}, /* @__PURE__ */ React43.createElement(XyoAddressTextField, {
|
|
2044
2089
|
label: "Delegate",
|
|
2045
2090
|
name: "delegate",
|
|
2046
2091
|
onAddressChanged: setDelegate,
|
|
2047
2092
|
required: true,
|
|
2048
2093
|
size: "small"
|
|
2049
|
-
})), /* @__PURE__ */
|
|
2094
|
+
})), /* @__PURE__ */ React43.createElement(FormControl5, {
|
|
2050
2095
|
fullWidth: true
|
|
2051
|
-
}, /* @__PURE__ */
|
|
2096
|
+
}, /* @__PURE__ */ React43.createElement(BlockNumberTextField, {
|
|
2052
2097
|
errorMessage: blockRangeError?.message,
|
|
2053
2098
|
label: "Expires",
|
|
2054
2099
|
name: "exp",
|
|
2055
2100
|
onBlockNumberChanged: setExp,
|
|
2056
2101
|
required: true,
|
|
2057
2102
|
size: "small"
|
|
2058
|
-
})), /* @__PURE__ */
|
|
2103
|
+
})), /* @__PURE__ */ React43.createElement(FormControl5, {
|
|
2059
2104
|
fullWidth: true
|
|
2060
|
-
}, /* @__PURE__ */
|
|
2105
|
+
}, /* @__PURE__ */ React43.createElement(BlockNumberTextField, {
|
|
2061
2106
|
errorMessage: blockRangeError?.message,
|
|
2062
2107
|
label: "Not Before",
|
|
2063
2108
|
name: "nbf",
|
|
2064
2109
|
onBlockNumberChanged: setNbf,
|
|
2065
2110
|
required: true,
|
|
2066
2111
|
size: "small"
|
|
2067
|
-
})), /* @__PURE__ */
|
|
2112
|
+
})), /* @__PURE__ */ React43.createElement(Button5, {
|
|
2068
2113
|
disabled: !intentPayload,
|
|
2069
2114
|
variant: "contained",
|
|
2070
2115
|
onClick: onBuildLocal
|
|
@@ -2072,34 +2117,34 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2072
2117
|
}, "ProducerIntentBuilderForm");
|
|
2073
2118
|
|
|
2074
2119
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2075
|
-
import
|
|
2120
|
+
import React46 from "react";
|
|
2076
2121
|
|
|
2077
2122
|
// src/components/payload/builder/transfer/Form.tsx
|
|
2078
2123
|
import { Button as Button6, FormControl as FormControl7 } from "@mui/material";
|
|
2079
|
-
import { isAddress as
|
|
2124
|
+
import { isAddress as isAddress5 } from "@xylabs/hex";
|
|
2080
2125
|
import { TransferSchema } from "@xyo-network/xl1-protocol";
|
|
2081
|
-
import
|
|
2126
|
+
import React45, { useMemo as useMemo22, useState as useState18 } from "react";
|
|
2082
2127
|
|
|
2083
2128
|
// src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
|
|
2084
2129
|
import { RemoveCircle } from "@mui/icons-material";
|
|
2085
2130
|
import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 } from "@mui/material";
|
|
2086
|
-
import { isAddress as
|
|
2131
|
+
import { isAddress as isAddress4, toHex as toHex3 } from "@xylabs/hex";
|
|
2087
2132
|
import { FlexRow as FlexRow7 } from "@xylabs/react-flexbox";
|
|
2088
2133
|
import { BigIntInput } from "@xyo-network/react-shared";
|
|
2089
|
-
import
|
|
2134
|
+
import React44, { useEffect as useEffect4, useMemo as useMemo21, useState as useState17 } from "react";
|
|
2090
2135
|
var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated, onRemoveTransfer, singleTransfer, ...props }) => {
|
|
2091
|
-
const [
|
|
2136
|
+
const [toAddress2, setToAddress] = useState17();
|
|
2092
2137
|
const [amount, setAmount] = useState17();
|
|
2093
2138
|
const transferAmount = useMemo21(() => {
|
|
2094
|
-
if (
|
|
2139
|
+
if (isAddress4(toAddress2) && amount !== void 0) {
|
|
2095
2140
|
return {
|
|
2096
2141
|
...singleTransfer,
|
|
2097
2142
|
amount: toHex3(amount),
|
|
2098
|
-
to:
|
|
2143
|
+
to: toAddress2
|
|
2099
2144
|
};
|
|
2100
2145
|
}
|
|
2101
2146
|
}, [
|
|
2102
|
-
|
|
2147
|
+
toAddress2,
|
|
2103
2148
|
amount
|
|
2104
2149
|
]);
|
|
2105
2150
|
useEffect4(() => {
|
|
@@ -2107,29 +2152,29 @@ var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated,
|
|
|
2107
2152
|
}, [
|
|
2108
2153
|
transferAmount
|
|
2109
2154
|
]);
|
|
2110
|
-
return /* @__PURE__ */
|
|
2155
|
+
return /* @__PURE__ */ React44.createElement(FlexRow7, {
|
|
2111
2156
|
alignItems: "start",
|
|
2112
2157
|
gap: 1,
|
|
2113
2158
|
...props
|
|
2114
|
-
}, /* @__PURE__ */
|
|
2159
|
+
}, /* @__PURE__ */ React44.createElement(FormControl6, {
|
|
2115
2160
|
fullWidth: true
|
|
2116
|
-
}, /* @__PURE__ */
|
|
2161
|
+
}, /* @__PURE__ */ React44.createElement(XyoAddressTextField, {
|
|
2117
2162
|
label: "To",
|
|
2118
2163
|
name: "to",
|
|
2119
2164
|
onAddressChanged: setToAddress,
|
|
2120
2165
|
required: true,
|
|
2121
2166
|
size: "small"
|
|
2122
|
-
})), /* @__PURE__ */
|
|
2167
|
+
})), /* @__PURE__ */ React44.createElement(FormControl6, {
|
|
2123
2168
|
fullWidth: true
|
|
2124
|
-
}, /* @__PURE__ */
|
|
2169
|
+
}, /* @__PURE__ */ React44.createElement(BigIntInput.TextField, {
|
|
2125
2170
|
label: "Amount",
|
|
2126
2171
|
name: "amount",
|
|
2127
2172
|
onChangeFixedPoint: setAmount,
|
|
2128
2173
|
required: true,
|
|
2129
2174
|
size: "small"
|
|
2130
|
-
})), /* @__PURE__ */
|
|
2175
|
+
})), /* @__PURE__ */ React44.createElement(IconButton5, {
|
|
2131
2176
|
onClick: /* @__PURE__ */ __name(() => onRemoveTransfer?.(singleTransfer.transferId), "onClick")
|
|
2132
|
-
}, /* @__PURE__ */
|
|
2177
|
+
}, /* @__PURE__ */ React44.createElement(Icon3, null, /* @__PURE__ */ React44.createElement(RemoveCircle, null))));
|
|
2133
2178
|
}, "SingleTransferBuilderFlexbox");
|
|
2134
2179
|
|
|
2135
2180
|
// src/components/payload/builder/transfer/Form.tsx
|
|
@@ -2137,7 +2182,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2137
2182
|
const [fromAddress, setFromAddress] = useState18();
|
|
2138
2183
|
const [transfers, setTransfers] = useState18([]);
|
|
2139
2184
|
const transferPayload = useMemo22(() => {
|
|
2140
|
-
if (
|
|
2185
|
+
if (isAddress5(fromAddress) && transfers.length > 0) {
|
|
2141
2186
|
const transfersRecord = {};
|
|
2142
2187
|
for (const transfer of transfers) {
|
|
2143
2188
|
transfersRecord[transfer.to] = transfer.amount;
|
|
@@ -2178,19 +2223,19 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2178
2223
|
return transfer;
|
|
2179
2224
|
}));
|
|
2180
2225
|
}, "onTransferUpdated");
|
|
2181
|
-
return /* @__PURE__ */
|
|
2226
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(FormControl7, {
|
|
2182
2227
|
fullWidth: true
|
|
2183
|
-
}, /* @__PURE__ */
|
|
2228
|
+
}, /* @__PURE__ */ React45.createElement(XyoAddressTextField, {
|
|
2184
2229
|
label: "From",
|
|
2185
2230
|
name: "from",
|
|
2186
2231
|
onAddressChanged: setFromAddress,
|
|
2187
2232
|
required: true,
|
|
2188
2233
|
size: "small"
|
|
2189
|
-
})), /* @__PURE__ */
|
|
2234
|
+
})), /* @__PURE__ */ React45.createElement(Button6, {
|
|
2190
2235
|
onClick: onTransferAdded,
|
|
2191
2236
|
size: "small",
|
|
2192
2237
|
variant: "contained"
|
|
2193
|
-
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */
|
|
2238
|
+
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */ React45.createElement(SingleTransferBuilderFlexbox, {
|
|
2194
2239
|
key: transfer.transferId,
|
|
2195
2240
|
onTransferUpdated,
|
|
2196
2241
|
onRemoveTransfer: onTransferRemoved,
|
|
@@ -2198,7 +2243,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2198
2243
|
sx: {
|
|
2199
2244
|
width: "100%"
|
|
2200
2245
|
}
|
|
2201
|
-
})), /* @__PURE__ */
|
|
2246
|
+
})), /* @__PURE__ */ React45.createElement(Button6, {
|
|
2202
2247
|
disabled: !transferPayload,
|
|
2203
2248
|
variant: "contained",
|
|
2204
2249
|
onClick: onBuildLocal
|
|
@@ -2206,7 +2251,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2206
2251
|
}, "TransferBuilderForm");
|
|
2207
2252
|
|
|
2208
2253
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2209
|
-
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */
|
|
2254
|
+
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */ React46.createElement(PayloadBuilderFlexbox, {
|
|
2210
2255
|
gap: 4,
|
|
2211
2256
|
alignItems: "start",
|
|
2212
2257
|
BuilderComponent: TransferBuilderForm,
|
|
@@ -2219,9 +2264,9 @@ import { CircularProgress } from "@mui/material";
|
|
|
2219
2264
|
import { usePromise as usePromise7 } from "@xylabs/react-promise";
|
|
2220
2265
|
import { MemoryArchivist } from "@xyo-network/archivist-memory";
|
|
2221
2266
|
import { ArchivistConfigSchema } from "@xyo-network/archivist-model";
|
|
2222
|
-
import { flattenHydratedBlocks } from "@xyo-network/chain-protocol";
|
|
2223
2267
|
import { buildRandomBlockChain } from "@xyo-network/react-chain-shared";
|
|
2224
|
-
import
|
|
2268
|
+
import { flattenHydratedBlocks } from "@xyo-network/xl1-protocol-sdk";
|
|
2269
|
+
import React47, { useEffect as useEffect5 } from "react";
|
|
2225
2270
|
var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2226
2271
|
const [randomBlockChain] = usePromise7(async () => await buildRandomBlockChain(), []);
|
|
2227
2272
|
const [blockChainRenderProps, blockChainRenderPropsError] = usePromise7(async () => {
|
|
@@ -2234,10 +2279,10 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2234
2279
|
});
|
|
2235
2280
|
const flattened = flattenHydratedBlocks(randomBlockChain);
|
|
2236
2281
|
await chainArchivist.insert(flattened);
|
|
2237
|
-
const
|
|
2282
|
+
const chainId = await getChainId();
|
|
2238
2283
|
return {
|
|
2239
2284
|
chainArchivist,
|
|
2240
|
-
|
|
2285
|
+
chainId
|
|
2241
2286
|
};
|
|
2242
2287
|
}
|
|
2243
2288
|
}, [
|
|
@@ -2261,7 +2306,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2261
2306
|
}
|
|
2262
2307
|
}
|
|
2263
2308
|
};
|
|
2264
|
-
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */
|
|
2309
|
+
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React47.createElement(Story, props) : /* @__PURE__ */ React47.createElement(CircularProgress, null);
|
|
2265
2310
|
}, "ChainArchivistDecorator");
|
|
2266
2311
|
|
|
2267
2312
|
// src/stories/ChainArchivistDelayedInsertDecorator.tsx
|
|
@@ -2270,9 +2315,9 @@ import { delay } from "@xylabs/delay";
|
|
|
2270
2315
|
import { usePromise as usePromise8 } from "@xylabs/react-promise";
|
|
2271
2316
|
import { MemoryArchivist as MemoryArchivist2 } from "@xyo-network/archivist-memory";
|
|
2272
2317
|
import { ArchivistConfigSchema as ArchivistConfigSchema2 } from "@xyo-network/archivist-model";
|
|
2273
|
-
import { flattenHydratedBlock } from "@xyo-network/chain-protocol";
|
|
2274
2318
|
import { buildRandomBlockChain as buildRandomBlockChain2 } from "@xyo-network/react-chain-shared";
|
|
2275
|
-
import
|
|
2319
|
+
import { flattenHydratedBlock } from "@xyo-network/xl1-protocol-sdk";
|
|
2320
|
+
import React48, { useEffect as useEffect6, useState as useState19 } from "react";
|
|
2276
2321
|
var chainArchivistRef;
|
|
2277
2322
|
var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2278
2323
|
const [firstBlock, setFirstBlock] = useState19();
|
|
@@ -2311,10 +2356,10 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2311
2356
|
delayedInsertError
|
|
2312
2357
|
]);
|
|
2313
2358
|
const [blockChainRenderProps] = usePromise8(async () => {
|
|
2314
|
-
const
|
|
2359
|
+
const chainId = await getChainId();
|
|
2315
2360
|
return {
|
|
2316
2361
|
chainArchivist,
|
|
2317
|
-
|
|
2362
|
+
chainId
|
|
2318
2363
|
};
|
|
2319
2364
|
}, [
|
|
2320
2365
|
chainArchivist
|
|
@@ -2330,30 +2375,31 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2330
2375
|
}
|
|
2331
2376
|
}
|
|
2332
2377
|
};
|
|
2333
|
-
return firstBlock ? /* @__PURE__ */
|
|
2378
|
+
return firstBlock ? /* @__PURE__ */ React48.createElement(Story, props) : /* @__PURE__ */ React48.createElement(CircularProgress2, null);
|
|
2334
2379
|
}, "ChainArchivistDelayedInsertDecorator");
|
|
2335
2380
|
|
|
2336
2381
|
// src/stories/ChainInfoContextDecorator.tsx
|
|
2337
2382
|
import { assertEx as assertEx5 } from "@xylabs/assert";
|
|
2338
2383
|
import { usePromise as usePromise9 } from "@xylabs/react-promise";
|
|
2384
|
+
import { isDefined as isDefined4 } from "@xylabs/typeof";
|
|
2339
2385
|
import { ChainBlockNumberIterationService as ChainBlockNumberIterationService3 } from "@xyo-network/chain-services";
|
|
2340
2386
|
import { findFirstMatching } from "@xyo-network/chain-utils";
|
|
2341
2387
|
import { isBlockBoundWitness as isBlockBoundWitness3 } from "@xyo-network/xl1-protocol";
|
|
2342
|
-
import
|
|
2388
|
+
import React49 from "react";
|
|
2343
2389
|
var archivistConfig = {
|
|
2344
2390
|
url: "http://localhost:8080",
|
|
2345
2391
|
chainArchivistModuleId: "XYOPublic:XYOChain:Chain"
|
|
2346
2392
|
};
|
|
2347
2393
|
var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2348
|
-
const [
|
|
2349
|
-
return await
|
|
2394
|
+
const [chainIdResponse] = usePromise9(async () => {
|
|
2395
|
+
return await getChainId();
|
|
2350
2396
|
}, []);
|
|
2351
|
-
const
|
|
2397
|
+
const chainId = chainIdResponse;
|
|
2352
2398
|
const [chainArchivist] = usePromise9(async () => {
|
|
2353
2399
|
return await getChainArchivistFromBridge(archivistConfig);
|
|
2354
2400
|
}, []);
|
|
2355
2401
|
const [chainIterator] = usePromise9(async () => {
|
|
2356
|
-
if (chainArchivist &&
|
|
2402
|
+
if (isDefined4(chainArchivist) && isDefined4(chainId)) {
|
|
2357
2403
|
const firstMatch = assertEx5(await findFirstMatching(chainArchivist), () => `No head found in archivist: ${chainArchivist.id} `);
|
|
2358
2404
|
const head = assertEx5(isBlockBoundWitness3(firstMatch) ? firstMatch : void 0, () => `Expected a block bound witness: ${JSON.stringify(firstMatch)}`);
|
|
2359
2405
|
return await ChainBlockNumberIterationService3.create({
|
|
@@ -2363,13 +2409,13 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2363
2409
|
}
|
|
2364
2410
|
}, [
|
|
2365
2411
|
chainArchivist,
|
|
2366
|
-
|
|
2412
|
+
chainId
|
|
2367
2413
|
]);
|
|
2368
|
-
return /* @__PURE__ */
|
|
2414
|
+
return /* @__PURE__ */ React49.createElement(ChainInfoProvider, {
|
|
2369
2415
|
chainArchivist,
|
|
2370
|
-
|
|
2416
|
+
chainId,
|
|
2371
2417
|
chainIterator
|
|
2372
|
-
}, /* @__PURE__ */
|
|
2418
|
+
}, /* @__PURE__ */ React49.createElement(Story, context));
|
|
2373
2419
|
}, "ChainInfoContextDecorator");
|
|
2374
2420
|
export {
|
|
2375
2421
|
BlockChainPagination,
|
|
@@ -2396,6 +2442,7 @@ export {
|
|
|
2396
2442
|
ChainIteratorStore,
|
|
2397
2443
|
ChainTransactionBuilder,
|
|
2398
2444
|
ChainTransactionNetwork,
|
|
2445
|
+
ChipSkeleton,
|
|
2399
2446
|
DynamicBlockchainRenderFlexbox,
|
|
2400
2447
|
FeatureNotAvailable,
|
|
2401
2448
|
MemoizedPollingControlsFlexbox,
|