@xyo-network/react-chain-blockchain 1.3.8 → 1.3.9
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 +219 -270
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/block/ProducerChip.d.ts +1 -1
- package/dist/types/components/block/ProducerChip.d.ts.map +1 -1
- package/dist/types/components/block/helpers/blockProducer.d.ts +1 -1
- package/dist/types/components/block/helpers/blockProducer.d.ts.map +1 -1
- package/dist/types/components/block/helpers/payloadCountsFromBlock.d.ts +1 -1
- package/dist/types/components/block/helpers/payloadCountsFromBlock.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useBlockProducer.d.ts +1 -1
- package/dist/types/components/block/hooks/useBlockProducer.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useDynamicBlockComponents.d.ts +1 -1
- package/dist/types/components/block/hooks/useDynamicBlockComponents.d.ts.map +1 -1
- package/dist/types/components/block/hooks/usePayloadCountsFromBlock.d.ts +1 -1
- package/dist/types/components/block/hooks/usePayloadCountsFromBlock.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts +1 -1
- package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts.map +1 -1
- package/dist/types/components/block/menu/Expanded.d.ts +1 -1
- package/dist/types/components/block/menu/Expanded.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/BlockNumber.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/PayloadCounts.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/TransactionCount.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/Verification.d.ts +1 -0
- package/dist/types/components/block/table/cell/Verification.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/cell/lib/BlockTableCellProps.d.ts +1 -1
- package/dist/types/components/block/table/cell/lib/BlockTableCellProps.d.ts.map +1 -1
- package/dist/types/components/block/table/row/TableRow.d.ts +1 -0
- package/dist/types/components/block/table/row/TableRow.d.ts.map +1 -1
- package/dist/types/components/chain/hooks/useOnBlock.d.ts +1 -1
- package/dist/types/components/chain/hooks/useOnBlock.d.ts.map +1 -1
- package/dist/types/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.d.ts +1 -1
- package/dist/types/components/transactions/TransactionsQuickTipButton.d.ts +1 -1
- package/dist/types/components/transactions/TransactionsQuickTipButton.d.ts.map +1 -1
- package/dist/types/components/transactions/submit/Builder.d.ts +1 -1
- package/dist/types/components/transactions/submit/Builder.d.ts.map +1 -1
- package/dist/types/context/analyzer/state.d.ts +1 -1
- package/dist/types/context/analyzer/state.d.ts.map +1 -1
- package/dist/types/context/chain/State.d.ts +1 -1
- package/dist/types/context/chain/State.d.ts.map +1 -1
- package/dist/types/helpers/txsFromBlock.d.ts +2 -2
- package/dist/types/helpers/txsFromBlock.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts +1 -1
- package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorParams.d.ts +3 -3
- 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/chain-iterator/useChainIteratorUpdatingHead.d.ts +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorUpdatingHead.d.ts.map +1 -1
- package/dist/types/hooks/useIterateChain.d.ts +1 -1
- package/dist/types/hooks/useIterateChain.d.ts.map +1 -1
- package/dist/types/hooks/useTxsFromBlock.d.ts +2 -2
- package/dist/types/hooks/useTxsFromBlock.d.ts.map +1 -1
- package/dist/types/lib/getChainInformation.d.ts +1 -1
- package/dist/types/lib/getChainInformation.d.ts.map +1 -1
- package/dist/types/stories/buildRandomBlockchain.d.ts +1 -1
- package/dist/types/stories/buildRandomBlockchain.d.ts.map +1 -1
- package/dist/types/types/BlockComponentProps.d.ts +1 -1
- package/dist/types/types/BlockComponentProps.d.ts.map +1 -1
- package/dist/types/types/BlockComponents.d.ts +1 -1
- package/dist/types/types/BlockComponents.d.ts.map +1 -1
- package/dist/types/types/render/BlockChainRenderProps.d.ts +1 -1
- package/dist/types/types/render/BlockChainRenderProps.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/block/ProducerChip.tsx +1 -1
- package/src/components/block/helpers/blockProducer.ts +1 -1
- package/src/components/block/helpers/payloadCountsFromBlock.ts +1 -1
- package/src/components/block/hooks/useBlockProducer.ts +1 -1
- package/src/components/block/hooks/useDynamicBlockComponents.ts +1 -1
- package/src/components/block/hooks/usePayloadCountsFromBlock.ts +1 -1
- package/src/components/block/hooks/useStaticBlockComponents.ts +1 -1
- package/src/components/block/menu/Expanded.tsx +1 -1
- package/src/components/block/table/cell/BlockNumber.tsx +6 -15
- package/src/components/block/table/cell/JsonView.tsx +13 -13
- package/src/components/block/table/cell/PayloadCounts.tsx +7 -14
- package/src/components/block/table/cell/TransactionCount.tsx +2 -7
- package/src/components/block/table/cell/Verification.tsx +10 -8
- package/src/components/block/table/cell/hooks/useLinkedBlockItem.tsx +1 -0
- package/src/components/block/table/cell/lib/BlockTableCellProps.ts +1 -1
- package/src/components/block/table/head/TableHead.tsx +1 -1
- package/src/components/block/table/row/TableRow.tsx +17 -5
- package/src/components/chain/hooks/useOnBlock.ts +1 -1
- package/src/components/payload/builder/producer-intent/Form.tsx +1 -1
- package/src/components/payload/builder/transfer/Form.tsx +2 -2
- package/src/components/transactions/TransactionsQuickTipButton.tsx +1 -1
- package/src/components/transactions/submit/Builder.tsx +2 -2
- package/src/components/transactions/submit/SubmitChain.tsx +2 -2
- package/src/context/analyzer/Provider.tsx +1 -1
- package/src/context/analyzer/state.ts +1 -1
- package/src/context/chain/State.ts +1 -1
- package/src/helpers/txsFromBlock.ts +2 -2
- package/src/hooks/chain-iterator/ChainIteratorStore.ts +1 -1
- package/src/hooks/chain-iterator/useChainIteratorParams.ts +2 -2
- package/src/hooks/chain-iterator/useChainIteratorStore.ts +1 -1
- package/src/hooks/chain-iterator/useChainIteratorUpdatingHead.ts +1 -1
- package/src/hooks/useIterateChain.ts +2 -2
- package/src/hooks/useTxsFromBlock.ts +1 -1
- package/src/lib/getChainInformation.ts +1 -1
- package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +1 -1
- package/src/stories/ChainInfoContextDecorator.tsx +1 -1
- package/src/stories/buildRandomBlockchain.ts +1 -1
- package/src/types/BlockComponentProps.ts +1 -1
- package/src/types/BlockComponents.ts +1 -1
- package/src/types/render/BlockChainRenderProps.ts +1 -1
package/dist/browser/index.mjs
CHANGED
|
@@ -146,7 +146,7 @@ var useChainPollingContext = /* @__PURE__ */ __name((required = false) => useCon
|
|
|
146
146
|
import { Button, FormControl, TextField } from "@mui/material";
|
|
147
147
|
import { toHex } from "@xylabs/hex";
|
|
148
148
|
import { FlexCol } from "@xylabs/react-flexbox";
|
|
149
|
-
import { defaultFees } from "@xyo-network/xl1-protocol";
|
|
149
|
+
import { defaultFees } from "@xyo-network/xl1-protocol-sdk";
|
|
150
150
|
import React4 from "react";
|
|
151
151
|
var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
|
|
152
152
|
const handleSubmit = /* @__PURE__ */ __name(async (event) => {
|
|
@@ -242,7 +242,7 @@ import { Account } from "@xyo-network/account";
|
|
|
242
242
|
import { ArchivistInsertQuerySchema } from "@xyo-network/archivist-model";
|
|
243
243
|
import { QueryBoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
244
244
|
import { PayloadBuilder } from "@xyo-network/payload-builder";
|
|
245
|
-
import { buildTransaction } from "@xyo-network/xl1-protocol";
|
|
245
|
+
import { buildTransaction } from "@xyo-network/xl1-protocol-sdk";
|
|
246
246
|
import React6, { useState as useState5 } from "react";
|
|
247
247
|
var BETA_PENDING_TRANSACTIONS_ARCHIVIST = "https://beta.api.chain.xyo.network/8050fee682a2762f504d5449d8269a6f17f0b693";
|
|
248
248
|
var defaultNetwork = new URL(BETA_PENDING_TRANSACTIONS_ARCHIVIST);
|
|
@@ -405,7 +405,7 @@ var ChainIteratorStore = class _ChainIteratorStore {
|
|
|
405
405
|
import { assertEx as assertEx2 } from "@xylabs/assert";
|
|
406
406
|
import { usePromise } from "@xylabs/react-promise";
|
|
407
407
|
import { BoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
408
|
-
import { isBlockBoundWitness } from "@xyo-network/xl1-
|
|
408
|
+
import { isBlockBoundWitness } from "@xyo-network/xl1-protocol";
|
|
409
409
|
var resolveDefinedHead = /* @__PURE__ */ __name(async (head, chainArchivist) => {
|
|
410
410
|
const [headPayload] = await chainArchivist.get([
|
|
411
411
|
head
|
|
@@ -545,7 +545,7 @@ import { usePromise as usePromise3 } from "@xylabs/react-promise";
|
|
|
545
545
|
import { hydrateBlock as hydrateBlock2 } from "@xyo-network/chain-protocol";
|
|
546
546
|
import { XyoChainBlockNumberIterator as XyoChainBlockNumberIterator2 } from "@xyo-network/chain-services";
|
|
547
547
|
import { PayloadBuilder as PayloadBuilder3 } from "@xyo-network/payload-builder";
|
|
548
|
-
import { isBlockBoundWitness as isBlockBoundWitness2 } from "@xyo-network/xl1-
|
|
548
|
+
import { isBlockBoundWitness as isBlockBoundWitness2 } from "@xyo-network/xl1-protocol";
|
|
549
549
|
var getHydratedBlock = /* @__PURE__ */ __name(async (chainArchivist, head) => {
|
|
550
550
|
const headHash = await PayloadBuilder3.hash(head);
|
|
551
551
|
return await hydrateBlock2(chainArchivist, headHash);
|
|
@@ -591,7 +591,7 @@ import { usePromise as usePromise4 } from "@xylabs/react-promise";
|
|
|
591
591
|
|
|
592
592
|
// src/helpers/txsFromBlock.ts
|
|
593
593
|
import { PayloadBuilder as PayloadBuilder4 } from "@xyo-network/payload-builder";
|
|
594
|
-
import { isTransactionBoundWitness } from "@xyo-network/xl1-
|
|
594
|
+
import { isTransactionBoundWitness } from "@xyo-network/xl1-protocol";
|
|
595
595
|
var txsFromBlock = /* @__PURE__ */ __name(async (block) => {
|
|
596
596
|
const transactionPayloads = block[1].filter((payload) => isTransactionBoundWitness(payload));
|
|
597
597
|
return await PayloadBuilder4.hashPairs(transactionPayloads);
|
|
@@ -732,7 +732,7 @@ var buildBlockChainRenderComponent = /* @__PURE__ */ __name(async (BlockComponen
|
|
|
732
732
|
|
|
733
733
|
// src/components/block/helpers/payloadCountsFromBlock.ts
|
|
734
734
|
import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
|
|
735
|
-
import { isTransactionBoundWitness as isTransactionBoundWitness2 } from "@xyo-network/xl1-
|
|
735
|
+
import { isTransactionBoundWitness as isTransactionBoundWitness2 } from "@xyo-network/xl1-protocol";
|
|
736
736
|
var payloadCountsFromBlock = /* @__PURE__ */ __name(([block, payloads]) => {
|
|
737
737
|
const publicPayloads = block.payload_schemas.filter((schema) => schema !== BoundWitnessSchema);
|
|
738
738
|
const transactionHashes = payloads.filter((payload) => isTransactionBoundWitness2(payload)).flatMap((payload) => payload.payload_hashes);
|
|
@@ -954,19 +954,30 @@ var BlockHeadingFlexbox = /* @__PURE__ */ __name(({ block, defaultExpanded, tran
|
|
|
954
954
|
}, "BlockHeadingFlexbox");
|
|
955
955
|
|
|
956
956
|
// src/components/block/table/cell/BlockNumber.tsx
|
|
957
|
-
import {
|
|
958
|
-
import React15 from "react";
|
|
959
|
-
|
|
960
|
-
// src/components/block/table/cell/BlockNumberChip.tsx
|
|
961
|
-
import { Chip as Chip3 } from "@mui/material";
|
|
957
|
+
import { TableCell, Tooltip, Typography as Typography3 } from "@mui/material";
|
|
962
958
|
import React14 from "react";
|
|
963
|
-
var
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
959
|
+
var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
960
|
+
const blockNumber = block?.[0].block;
|
|
961
|
+
return /* @__PURE__ */ React14.createElement(TableCell, props, /* @__PURE__ */ React14.createElement(Tooltip, {
|
|
962
|
+
title: `Block Number: ${blockNumber}`
|
|
963
|
+
}, /* @__PURE__ */ React14.createElement(Typography3, {
|
|
964
|
+
component: "span",
|
|
965
|
+
variant: "body1"
|
|
966
|
+
}, blockNumber)));
|
|
967
|
+
}, "BlockNumberTableCell");
|
|
968
|
+
|
|
969
|
+
// src/components/block/table/cell/Hash.tsx
|
|
970
|
+
import { Avatar, Chip as Chip3, TableCell as TableCell2, Tooltip as Tooltip2 } from "@mui/material";
|
|
971
|
+
import { Identicon } from "@xylabs/react-identicon";
|
|
972
|
+
import { usePayloadRootHash } from "@xyo-network/react-shared";
|
|
973
|
+
import React16 from "react";
|
|
974
|
+
|
|
975
|
+
// src/components/FeatureNotAvailable.tsx
|
|
976
|
+
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
977
|
+
import React15 from "react";
|
|
978
|
+
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, {
|
|
979
|
+
onClick: /* @__PURE__ */ __name((e) => props.onClose?.(e, "backdropClick"), "onClick")
|
|
980
|
+
}, "Close"))), "FeatureNotAvailable");
|
|
970
981
|
|
|
971
982
|
// src/components/block/table/cell/hooks/useLinkedBlockItem.tsx
|
|
972
983
|
import { useEvent as useEvent2 } from "@xyo-network/react-event";
|
|
@@ -974,6 +985,7 @@ var useLinkedBlockItem = /* @__PURE__ */ __name((noun, data) => {
|
|
|
974
985
|
const [ref, dispatch] = useEvent2();
|
|
975
986
|
const handleClick = /* @__PURE__ */ __name((event) => {
|
|
976
987
|
event.preventDefault();
|
|
988
|
+
event.stopPropagation();
|
|
977
989
|
if (!noun) {
|
|
978
990
|
console.warn("useLinkedBlockItem: noun is required");
|
|
979
991
|
return;
|
|
@@ -986,60 +998,23 @@ var useLinkedBlockItem = /* @__PURE__ */ __name((noun, data) => {
|
|
|
986
998
|
];
|
|
987
999
|
}, "useLinkedBlockItem");
|
|
988
1000
|
|
|
989
|
-
// src/components/block/table/cell/BlockNumber.tsx
|
|
990
|
-
var BlockNumberTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
991
|
-
const blockNumber = block?.[0].block;
|
|
992
|
-
const [ref, handleClick] = useLinkedBlockItem("block-number", blockNumber?.toString());
|
|
993
|
-
return /* @__PURE__ */ React15.createElement(TableCell, {
|
|
994
|
-
ref,
|
|
995
|
-
...props
|
|
996
|
-
}, /* @__PURE__ */ React15.createElement(Tooltip, {
|
|
997
|
-
title: `Block Number: ${blockNumber}`
|
|
998
|
-
}, /* @__PURE__ */ React15.createElement("span", null, linked && blockNumber !== void 0 ? /* @__PURE__ */ React15.createElement(Link, {
|
|
999
|
-
title: blockNumber?.toString(),
|
|
1000
|
-
onClick: handleClick,
|
|
1001
|
-
sx: {
|
|
1002
|
-
cursor: "pointer"
|
|
1003
|
-
}
|
|
1004
|
-
}, /* @__PURE__ */ React15.createElement(BlockNumberChip, {
|
|
1005
|
-
blockNumber,
|
|
1006
|
-
size: "small"
|
|
1007
|
-
})) : null, !linked && /* @__PURE__ */ React15.createElement(BlockNumberChip, {
|
|
1008
|
-
blockNumber,
|
|
1009
|
-
size: "small"
|
|
1010
|
-
}))));
|
|
1011
|
-
}, "BlockNumberTableCell");
|
|
1012
|
-
|
|
1013
|
-
// src/components/block/table/cell/Hash.tsx
|
|
1014
|
-
import { Avatar, Chip as Chip4, TableCell as TableCell2, Tooltip as Tooltip2 } from "@mui/material";
|
|
1015
|
-
import { Identicon } from "@xylabs/react-identicon";
|
|
1016
|
-
import { usePayloadRootHash } from "@xyo-network/react-shared";
|
|
1017
|
-
import React17 from "react";
|
|
1018
|
-
|
|
1019
|
-
// src/components/FeatureNotAvailable.tsx
|
|
1020
|
-
import { Button as Button2, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
1021
|
-
import React16 from "react";
|
|
1022
|
-
var FeatureNotAvailable = /* @__PURE__ */ __name(({ featureName = "Feature", ...props }) => /* @__PURE__ */ React16.createElement(Dialog, props, /* @__PURE__ */ React16.createElement(DialogTitle, null, `${featureName} Not Available`), /* @__PURE__ */ React16.createElement(DialogContent, null, "This feature is not currently available. Either you do not have access to it or it is currently undergoing maintenance."), /* @__PURE__ */ React16.createElement(DialogActions, null, /* @__PURE__ */ React16.createElement(Button2, {
|
|
1023
|
-
onClick: /* @__PURE__ */ __name((e) => props.onClose?.(e, "backdropClick"), "onClick")
|
|
1024
|
-
}, "Close"))), "FeatureNotAvailable");
|
|
1025
|
-
|
|
1026
1001
|
// src/components/block/table/cell/Hash.tsx
|
|
1027
1002
|
var BlockHashTableCell = /* @__PURE__ */ __name(({ block, identiconProps, notAvailableDialog, linked, ...props }) => {
|
|
1028
1003
|
const hash = usePayloadRootHash(block?.[0]);
|
|
1029
1004
|
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1030
|
-
const [notAvailable, setNotAvailable] =
|
|
1005
|
+
const [notAvailable, setNotAvailable] = React16.useState(false);
|
|
1031
1006
|
const shortenedHash = hash ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` : "";
|
|
1032
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ React16.createElement(TableCell2, {
|
|
1033
1008
|
ref,
|
|
1034
1009
|
...props
|
|
1035
|
-
}, hash ? /* @__PURE__ */
|
|
1010
|
+
}, hash ? /* @__PURE__ */ React16.createElement(Tooltip2, {
|
|
1036
1011
|
title: `Block Hash: ${hash}`
|
|
1037
|
-
}, /* @__PURE__ */
|
|
1038
|
-
avatar: /* @__PURE__ */
|
|
1012
|
+
}, /* @__PURE__ */ React16.createElement(Chip3, {
|
|
1013
|
+
avatar: /* @__PURE__ */ React16.createElement(Avatar, {
|
|
1039
1014
|
sx: {
|
|
1040
1015
|
background: "white"
|
|
1041
1016
|
}
|
|
1042
|
-
}, /* @__PURE__ */
|
|
1017
|
+
}, /* @__PURE__ */ React16.createElement(Identicon, {
|
|
1043
1018
|
size: 16,
|
|
1044
1019
|
value: hash,
|
|
1045
1020
|
...identiconProps
|
|
@@ -1049,7 +1024,7 @@ var BlockHashTableCell = /* @__PURE__ */ __name(({ block, identiconProps, notAva
|
|
|
1049
1024
|
},
|
|
1050
1025
|
label: shortenedHash,
|
|
1051
1026
|
onClick: linked ? handleClick : () => setNotAvailable(true)
|
|
1052
|
-
})) : null, notAvailableDialog && notAvailable ? /* @__PURE__ */
|
|
1027
|
+
})) : null, notAvailableDialog && notAvailable ? /* @__PURE__ */ React16.createElement(FeatureNotAvailable, {
|
|
1053
1028
|
featureName: "Block Details",
|
|
1054
1029
|
open: notAvailable,
|
|
1055
1030
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1063,40 +1038,40 @@ import { ellipsize } from "@xylabs/eth-address";
|
|
|
1063
1038
|
import { FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
1064
1039
|
import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
|
|
1065
1040
|
import { usePayloadRootHash as usePayloadRootHash2 } from "@xyo-network/react-shared";
|
|
1066
|
-
import
|
|
1041
|
+
import React17, { useState as useState10 } from "react";
|
|
1067
1042
|
var BlockJsonViewTableCell = /* @__PURE__ */ __name(({ block, ...props }) => {
|
|
1068
1043
|
const [open, setOpen] = useState10(false);
|
|
1069
1044
|
const onClose = /* @__PURE__ */ __name(() => setOpen(false), "onClose");
|
|
1070
1045
|
const hash = usePayloadRootHash2(block?.[0]);
|
|
1071
1046
|
const title = hash ? `JSON for ${ellipsize(hash, 5)}` : "JSON";
|
|
1072
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ React17.createElement(TableCell3, props, /* @__PURE__ */ React17.createElement(FlexRow3, {
|
|
1048
|
+
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1073
1049
|
sx: {
|
|
1074
1050
|
width: "100%"
|
|
1075
1051
|
}
|
|
1076
|
-
}, /* @__PURE__ */
|
|
1052
|
+
}, /* @__PURE__ */ React17.createElement(IconButton2, {
|
|
1077
1053
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1078
|
-
}, /* @__PURE__ */
|
|
1054
|
+
}, /* @__PURE__ */ React17.createElement(DataObject, null)), /* @__PURE__ */ React17.createElement(Dialog2, {
|
|
1079
1055
|
open,
|
|
1080
1056
|
onClose
|
|
1081
|
-
}, /* @__PURE__ */
|
|
1057
|
+
}, /* @__PURE__ */ React17.createElement(DialogTitle2, null, title), /* @__PURE__ */ React17.createElement(DialogContent2, null, /* @__PURE__ */ React17.createElement(JsonViewerEx, {
|
|
1082
1058
|
value: block
|
|
1083
|
-
})), /* @__PURE__ */
|
|
1059
|
+
})), /* @__PURE__ */ React17.createElement(DialogActions2, {
|
|
1084
1060
|
sx: {
|
|
1085
1061
|
display: "flex",
|
|
1086
1062
|
flexDirection: "row",
|
|
1087
1063
|
justifyContent: "end"
|
|
1088
1064
|
}
|
|
1089
|
-
}, /* @__PURE__ */
|
|
1065
|
+
}, /* @__PURE__ */ React17.createElement(Button3, {
|
|
1090
1066
|
variant: "contained",
|
|
1091
1067
|
onClick: onClose
|
|
1092
|
-
}, "Close"))));
|
|
1068
|
+
}, "Close")))));
|
|
1093
1069
|
}, "BlockJsonViewTableCell");
|
|
1094
1070
|
|
|
1095
1071
|
// src/components/block/table/cell/PayloadCounts.tsx
|
|
1096
|
-
import { Error as Error2
|
|
1097
|
-
import {
|
|
1098
|
-
import
|
|
1099
|
-
import React19 from "react";
|
|
1072
|
+
import { Error as Error2 } from "@mui/icons-material";
|
|
1073
|
+
import { Link, TableCell as TableCell4, Tooltip as Tooltip3 } from "@mui/material";
|
|
1074
|
+
import React18 from "react";
|
|
1100
1075
|
var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1101
1076
|
const [publicPayloads, privatePayloads, error] = usePayloadCountsFromBlock(block);
|
|
1102
1077
|
const data = block && privatePayloads !== void 0 && publicPayloads !== void 0 ? {
|
|
@@ -1104,71 +1079,47 @@ var BlockPayloadCountsTableCell = /* @__PURE__ */ __name(({ block, linked, ...pr
|
|
|
1104
1079
|
privatePayloads,
|
|
1105
1080
|
block: block[0]._hash
|
|
1106
1081
|
} : void 0;
|
|
1082
|
+
const payloadCount = (publicPayloads ?? 0) + (privatePayloads ?? 0);
|
|
1107
1083
|
const [ref, handleClick] = useLinkedBlockItem("payload-counts", data);
|
|
1108
|
-
return /* @__PURE__ */
|
|
1084
|
+
return /* @__PURE__ */ React18.createElement(TableCell4, {
|
|
1109
1085
|
ref,
|
|
1110
1086
|
...props
|
|
1111
|
-
}, /* @__PURE__ */
|
|
1087
|
+
}, /* @__PURE__ */ React18.createElement("span", null, error ? /* @__PURE__ */ React18.createElement(Tooltip3, {
|
|
1112
1088
|
title: error.message
|
|
1113
|
-
}, /* @__PURE__ */
|
|
1089
|
+
}, /* @__PURE__ */ React18.createElement(Error2, {
|
|
1114
1090
|
color: "error"
|
|
1115
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1091
|
+
})) : null, linked ? /* @__PURE__ */ React18.createElement(Tooltip3, {
|
|
1116
1092
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1117
|
-
}, /* @__PURE__ */
|
|
1093
|
+
}, /* @__PURE__ */ React18.createElement(Link, {
|
|
1118
1094
|
onClick: handleClick,
|
|
1119
1095
|
sx: {
|
|
1120
|
-
cursor: "pointer"
|
|
1121
|
-
display: "inline-flex",
|
|
1122
|
-
gap: 0.5
|
|
1096
|
+
cursor: "pointer"
|
|
1123
1097
|
}
|
|
1124
|
-
}, /* @__PURE__ */
|
|
1125
|
-
avatar: /* @__PURE__ */ React19.createElement(Public, {
|
|
1126
|
-
fontSize: "small"
|
|
1127
|
-
}),
|
|
1128
|
-
label: publicPayloads ?? "--"
|
|
1129
|
-
}), /* @__PURE__ */ React19.createElement(Chip5, {
|
|
1130
|
-
avatar: /* @__PURE__ */ React19.createElement(PublicOff, {
|
|
1131
|
-
fontSize: "small"
|
|
1132
|
-
}),
|
|
1133
|
-
label: privatePayloads ?? "--"
|
|
1134
|
-
}))) : /* @__PURE__ */ React19.createElement(Tooltip3, {
|
|
1098
|
+
}, payloadCount)) : /* @__PURE__ */ React18.createElement(Tooltip3, {
|
|
1135
1099
|
title: `Public Payloads: ${publicPayloads ?? "--"} Private Payloads: ${privatePayloads ?? "--"}`
|
|
1136
|
-
}, /* @__PURE__ */
|
|
1137
|
-
gap: 0.5,
|
|
1138
|
-
justifyContent: "left"
|
|
1139
|
-
}, /* @__PURE__ */ React19.createElement(Chip5, {
|
|
1140
|
-
avatar: /* @__PURE__ */ React19.createElement(Public, {
|
|
1141
|
-
fontSize: "small"
|
|
1142
|
-
}),
|
|
1143
|
-
label: publicPayloads ?? "--"
|
|
1144
|
-
}), /* @__PURE__ */ React19.createElement(Chip5, {
|
|
1145
|
-
avatar: /* @__PURE__ */ React19.createElement(PublicOff, {
|
|
1146
|
-
fontSize: "small"
|
|
1147
|
-
}),
|
|
1148
|
-
label: privatePayloads ?? "--"
|
|
1149
|
-
})))));
|
|
1100
|
+
}, /* @__PURE__ */ React18.createElement("span", null, payloadCount))));
|
|
1150
1101
|
}, "BlockPayloadCountsTableCell");
|
|
1151
1102
|
|
|
1152
1103
|
// src/components/block/table/cell/Producer.tsx
|
|
1153
1104
|
import { TableCell as TableCell5, Tooltip as Tooltip4 } from "@mui/material";
|
|
1154
|
-
import
|
|
1105
|
+
import React19 from "react";
|
|
1155
1106
|
var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailableDialog, producerChipProps, ...props }) => {
|
|
1156
1107
|
const [ref, handleClick] = useLinkedBlockItem("block-producer", JSON.stringify(block));
|
|
1157
1108
|
const producer = useBlockProducer(block);
|
|
1158
|
-
const [notAvailable, setNotAvailable] =
|
|
1159
|
-
return /* @__PURE__ */
|
|
1109
|
+
const [notAvailable, setNotAvailable] = React19.useState(false);
|
|
1110
|
+
return /* @__PURE__ */ React19.createElement(TableCell5, {
|
|
1160
1111
|
ref,
|
|
1161
1112
|
...props
|
|
1162
|
-
}, /* @__PURE__ */
|
|
1113
|
+
}, /* @__PURE__ */ React19.createElement(Tooltip4, {
|
|
1163
1114
|
title: `Block Producer: ${producer}`
|
|
1164
|
-
}, /* @__PURE__ */
|
|
1115
|
+
}, /* @__PURE__ */ React19.createElement(BlockProducerChip, {
|
|
1165
1116
|
sx: {
|
|
1166
1117
|
cursor: "pointer"
|
|
1167
1118
|
},
|
|
1168
1119
|
onClick: linked ? handleClick : () => setNotAvailable(true),
|
|
1169
1120
|
block,
|
|
1170
1121
|
...producerChipProps
|
|
1171
|
-
})), notAvailableDialog && notAvailable ? /* @__PURE__ */
|
|
1122
|
+
})), notAvailableDialog && notAvailable ? /* @__PURE__ */ React19.createElement(FeatureNotAvailable, {
|
|
1172
1123
|
featureName: "Producer Details",
|
|
1173
1124
|
open: notAvailable,
|
|
1174
1125
|
onClick: /* @__PURE__ */ __name(() => setNotAvailable(false), "onClick")
|
|
@@ -1177,8 +1128,8 @@ var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailab
|
|
|
1177
1128
|
|
|
1178
1129
|
// src/components/block/table/cell/TransactionCount.tsx
|
|
1179
1130
|
import { Error as Error3 } from "@mui/icons-material";
|
|
1180
|
-
import { Link as
|
|
1181
|
-
import
|
|
1131
|
+
import { Link as Link2, TableCell as TableCell6, Tooltip as Tooltip5 } from "@mui/material";
|
|
1132
|
+
import React20, { useMemo as useMemo10 } from "react";
|
|
1182
1133
|
var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1183
1134
|
const [transactions, error] = useTxsFromBlock(block);
|
|
1184
1135
|
const txHashes = useMemo10(() => transactions?.map(([, hash]) => hash), [
|
|
@@ -1189,89 +1140,81 @@ var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ..
|
|
|
1189
1140
|
block: block[0]._hash
|
|
1190
1141
|
} : void 0;
|
|
1191
1142
|
const [ref, handleClick] = useLinkedBlockItem("transaction-count", data);
|
|
1192
|
-
return /* @__PURE__ */
|
|
1143
|
+
return /* @__PURE__ */ React20.createElement(TableCell6, {
|
|
1193
1144
|
ref,
|
|
1194
1145
|
...props
|
|
1195
|
-
}, /* @__PURE__ */
|
|
1146
|
+
}, /* @__PURE__ */ React20.createElement("span", null, error ? /* @__PURE__ */ React20.createElement(Tooltip5, {
|
|
1196
1147
|
title: error.message
|
|
1197
|
-
}, /* @__PURE__ */
|
|
1148
|
+
}, /* @__PURE__ */ React20.createElement(Error3, {
|
|
1198
1149
|
color: "error"
|
|
1199
|
-
})) : null, linked ? /* @__PURE__ */
|
|
1150
|
+
})) : null, linked ? /* @__PURE__ */ React20.createElement(Link2, {
|
|
1200
1151
|
onClick: handleClick,
|
|
1201
1152
|
sx: {
|
|
1202
1153
|
cursor: "pointer"
|
|
1203
1154
|
}
|
|
1204
|
-
},
|
|
1205
|
-
transactions: txHashes
|
|
1206
|
-
})) : /* @__PURE__ */ React21.createElement(TransactionCountChip, {
|
|
1207
|
-
transactions: txHashes
|
|
1208
|
-
})));
|
|
1155
|
+
}, txHashes?.length) : txHashes?.length));
|
|
1209
1156
|
}, "BlockTransactionCountTableCell");
|
|
1210
1157
|
|
|
1211
1158
|
// src/components/block/table/cell/Verification.tsx
|
|
1159
|
+
import { CheckCircleOutlineRounded } from "@mui/icons-material";
|
|
1212
1160
|
import { TableCell as TableCell7 } from "@mui/material";
|
|
1213
|
-
import { FlexRow as
|
|
1161
|
+
import { FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
|
|
1214
1162
|
import { BWVerification as BWVerification2 } from "@xyo-network/react-boundwitness-plugin";
|
|
1215
|
-
import
|
|
1216
|
-
var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
ref,
|
|
1220
|
-
...props
|
|
1221
|
-
}, /* @__PURE__ */ React22.createElement(FlexRow5, {
|
|
1163
|
+
import React21 from "react";
|
|
1164
|
+
var BlockVerificationTableCell = /* @__PURE__ */ __name(({ block, linked, deepValidation, ...props }) => {
|
|
1165
|
+
return /* @__PURE__ */ React21.createElement(TableCell7, props, /* @__PURE__ */ React21.createElement(FlexRow4, {
|
|
1166
|
+
onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick"),
|
|
1222
1167
|
sx: {
|
|
1223
1168
|
width: "100%"
|
|
1224
1169
|
}
|
|
1225
|
-
}, /* @__PURE__ */
|
|
1226
|
-
onClick: linked ? handleClick : void 0,
|
|
1170
|
+
}, deepValidation ? /* @__PURE__ */ React21.createElement(BWVerification2, {
|
|
1227
1171
|
iconColors: true,
|
|
1228
1172
|
boundwitness: block?.[0]
|
|
1173
|
+
}) : /* @__PURE__ */ React21.createElement(CheckCircleOutlineRounded, {
|
|
1174
|
+
color: "success"
|
|
1229
1175
|
})));
|
|
1230
1176
|
}, "BlockVerificationTableCell");
|
|
1231
1177
|
|
|
1232
1178
|
// src/components/block/table/Ex.tsx
|
|
1233
1179
|
import { TableBody } from "@mui/material";
|
|
1234
1180
|
import { TableEx } from "@xyo-network/react-table";
|
|
1235
|
-
import
|
|
1181
|
+
import React23 from "react";
|
|
1236
1182
|
|
|
1237
1183
|
// src/components/block/table/head/TableHead.tsx
|
|
1238
1184
|
import { InfoOutline } from "@mui/icons-material";
|
|
1239
|
-
import { TableCell as TableCell8, TableHead, TableRow, Tooltip as Tooltip6, Typography as
|
|
1240
|
-
import { FlexRow as
|
|
1241
|
-
import
|
|
1185
|
+
import { TableCell as TableCell8, TableHead, TableRow, Tooltip as Tooltip6, Typography as Typography4 } from "@mui/material";
|
|
1186
|
+
import { FlexRow as FlexRow5 } from "@xylabs/react-flexbox";
|
|
1187
|
+
import React22 from "react";
|
|
1242
1188
|
var ToolTipTableCell = /* @__PURE__ */ __name(({ children, align, title, ...props }) => {
|
|
1243
|
-
return /* @__PURE__ */
|
|
1189
|
+
return /* @__PURE__ */ React22.createElement(TableCell8, {
|
|
1244
1190
|
title,
|
|
1245
1191
|
...props
|
|
1246
|
-
}, /* @__PURE__ */
|
|
1192
|
+
}, /* @__PURE__ */ React22.createElement(Tooltip6, {
|
|
1247
1193
|
title
|
|
1248
|
-
}, /* @__PURE__ */
|
|
1194
|
+
}, /* @__PURE__ */ React22.createElement(FlexRow5, {
|
|
1249
1195
|
justifyContent: align
|
|
1250
|
-
}, /* @__PURE__ */
|
|
1196
|
+
}, /* @__PURE__ */ React22.createElement(Typography4, {
|
|
1251
1197
|
variant: "body2"
|
|
1252
|
-
}, children), "\xA0", /* @__PURE__ */
|
|
1198
|
+
}, children), "\xA0", /* @__PURE__ */ React22.createElement(InfoOutline, {
|
|
1253
1199
|
fontSize: "small"
|
|
1254
1200
|
}))));
|
|
1255
1201
|
}, "ToolTipTableCell");
|
|
1256
1202
|
var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
1257
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ React22.createElement(TableHead, null, /* @__PURE__ */ React22.createElement(TableRow, null, /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1258
1204
|
align: "left",
|
|
1259
1205
|
title: "The block number that is included in the block"
|
|
1260
|
-
}, "Block"), /* @__PURE__ */
|
|
1206
|
+
}, "Block"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1261
1207
|
title: "The hash of the block"
|
|
1262
|
-
}, "Block Hash"), /* @__PURE__ */
|
|
1263
|
-
align: "left",
|
|
1264
|
-
title: "The address of the block producer that produced the block"
|
|
1265
|
-
}, "Block Producer"), /* @__PURE__ */ React23.createElement(ToolTipTableCell, {
|
|
1208
|
+
}, "Block Hash"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1266
1209
|
align: "left",
|
|
1267
1210
|
title: "Count of transactions that are included in the block"
|
|
1268
|
-
}, "Transactions"), /* @__PURE__ */
|
|
1211
|
+
}, "Transactions"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1269
1212
|
align: "left",
|
|
1270
1213
|
title: "Count of public and private payload counts for the block"
|
|
1271
|
-
}, "Payloads"), /* @__PURE__ */
|
|
1214
|
+
}, "Payloads"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1272
1215
|
align: "center",
|
|
1273
1216
|
title: "The result of the local validation check for the block"
|
|
1274
|
-
}, "Valid"), /* @__PURE__ */
|
|
1217
|
+
}, "Valid"), /* @__PURE__ */ React22.createElement(ToolTipTableCell, {
|
|
1275
1218
|
align: "center",
|
|
1276
1219
|
title: "Link to display the raw JSON of the block"
|
|
1277
1220
|
}, "JSON")));
|
|
@@ -1279,18 +1222,19 @@ var BlockchainTableHead = /* @__PURE__ */ __name(() => {
|
|
|
1279
1222
|
|
|
1280
1223
|
// src/components/block/table/Ex.tsx
|
|
1281
1224
|
var BlockchainTableEx = /* @__PURE__ */ __name(({ ref, children, ...props }) => {
|
|
1282
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ React23.createElement(TableEx, {
|
|
1283
1226
|
ref,
|
|
1284
1227
|
...props
|
|
1285
|
-
}, /* @__PURE__ */
|
|
1228
|
+
}, /* @__PURE__ */ React23.createElement(BlockchainTableHead, null), /* @__PURE__ */ React23.createElement(TableBody, null, children));
|
|
1286
1229
|
}, "BlockchainTableEx");
|
|
1287
1230
|
BlockchainTableEx.displayName = "BlockchainTableEx";
|
|
1288
1231
|
|
|
1289
1232
|
// src/components/block/table/row/TableRow.tsx
|
|
1290
1233
|
import { TableRow as TableRow2, useTheme } from "@mui/material";
|
|
1291
1234
|
import { alphaCss } from "@xylabs/react-theme";
|
|
1292
|
-
import
|
|
1293
|
-
|
|
1235
|
+
import { usePayloadRootHash as usePayloadRootHash3 } from "@xyo-network/react-shared";
|
|
1236
|
+
import React24, { useMemo as useMemo11 } from "react";
|
|
1237
|
+
var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaultExpanded, linked, sx, ...props }) => {
|
|
1294
1238
|
const linkedTableCellProps = useMemo11(() => ({
|
|
1295
1239
|
block,
|
|
1296
1240
|
linked
|
|
@@ -1303,9 +1247,14 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, defaultExpanded, linke
|
|
|
1303
1247
|
}), [
|
|
1304
1248
|
block
|
|
1305
1249
|
]);
|
|
1250
|
+
const hash = usePayloadRootHash3(block?.[0]);
|
|
1251
|
+
const [ref, handleClick] = useLinkedBlockItem("block-hash", hash);
|
|
1306
1252
|
const theme = useTheme();
|
|
1307
|
-
return /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ React24.createElement(TableRow2, {
|
|
1254
|
+
onClick: linked ? handleClick : void 0,
|
|
1255
|
+
ref,
|
|
1308
1256
|
sx: {
|
|
1257
|
+
"cursor": linked ? "pointer" : "default",
|
|
1309
1258
|
"overflowY": "scroll",
|
|
1310
1259
|
"&:hover": {
|
|
1311
1260
|
backgroundColor: alphaCss(theme.vars.palette.secondary.light, 0.85)
|
|
@@ -1313,51 +1262,51 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, defaultExpanded, linke
|
|
|
1313
1262
|
...sx
|
|
1314
1263
|
},
|
|
1315
1264
|
...props
|
|
1316
|
-
}, /* @__PURE__ */
|
|
1265
|
+
}, /* @__PURE__ */ React24.createElement(BlockNumberTableCell, {
|
|
1317
1266
|
align: "left",
|
|
1318
1267
|
...linkedTableCellProps
|
|
1319
|
-
}), /* @__PURE__ */
|
|
1268
|
+
}), /* @__PURE__ */ React24.createElement(BlockHashTableCell, {
|
|
1320
1269
|
align: "left",
|
|
1321
1270
|
...linkedTableCellProps
|
|
1322
|
-
}), /* @__PURE__ */
|
|
1271
|
+
}), /* @__PURE__ */ React24.createElement(BlockTransactionCountTableCell, {
|
|
1323
1272
|
align: "left",
|
|
1324
1273
|
...linkedTableCellProps
|
|
1325
|
-
}), /* @__PURE__ */
|
|
1274
|
+
}), /* @__PURE__ */ React24.createElement(BlockPayloadCountsTableCell, {
|
|
1326
1275
|
align: "left",
|
|
1327
1276
|
...linkedTableCellProps
|
|
1328
|
-
}), /* @__PURE__ */
|
|
1329
|
-
|
|
1330
|
-
...
|
|
1331
|
-
}), /* @__PURE__ */
|
|
1277
|
+
}), /* @__PURE__ */ React24.createElement(BlockVerificationTableCell, {
|
|
1278
|
+
deepValidation,
|
|
1279
|
+
...defaultTableCellProps
|
|
1280
|
+
}), /* @__PURE__ */ React24.createElement(BlockJsonViewTableCell, defaultTableCellProps));
|
|
1332
1281
|
}, "BlockChainTableRow");
|
|
1333
1282
|
|
|
1334
1283
|
// src/components/chain/controls/PollingControlsFlexbox.tsx
|
|
1335
1284
|
import { Autorenew, Pause } from "@mui/icons-material";
|
|
1336
1285
|
import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip7 } from "@mui/material";
|
|
1337
|
-
import { FlexRow as
|
|
1338
|
-
import
|
|
1286
|
+
import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
|
|
1287
|
+
import React29, { memo } from "react";
|
|
1339
1288
|
|
|
1340
1289
|
// src/components/chain/stats/Dialog.tsx
|
|
1341
1290
|
import { QueryStats } from "@mui/icons-material";
|
|
1342
1291
|
import { Dialog as Dialog3, DialogContent as DialogContent3, DialogTitle as DialogTitle3, IconButton as IconButton3 } from "@mui/material";
|
|
1343
|
-
import
|
|
1292
|
+
import React27, { useState as useState11 } from "react";
|
|
1344
1293
|
|
|
1345
1294
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
1346
|
-
import { ListItem, styled, Typography as
|
|
1295
|
+
import { ListItem, styled, Typography as Typography5 } from "@mui/material";
|
|
1347
1296
|
import { ErrorRender as ErrorRender3 } from "@xylabs/react-error";
|
|
1348
1297
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
1349
1298
|
import { isChainSummaryProducers } from "@xyo-network/chain-protocol";
|
|
1350
|
-
import
|
|
1299
|
+
import React26, { useMemo as useMemo12 } from "react";
|
|
1351
1300
|
|
|
1352
1301
|
// src/components/chain/stats/producer/Table.tsx
|
|
1353
1302
|
import { Table, TableBody as TableBody2, TableCell as TableCell9, TableHead as TableHead2, TableRow as TableRow3, useTheme as useTheme2 } from "@mui/material";
|
|
1354
1303
|
import { BlockiesAvatar as BlockiesAvatar2 } from "@xyo-network/react-chain-blockies";
|
|
1355
|
-
import
|
|
1304
|
+
import React25 from "react";
|
|
1356
1305
|
var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) => {
|
|
1357
1306
|
const theme = useTheme2();
|
|
1358
|
-
return /* @__PURE__ */
|
|
1307
|
+
return /* @__PURE__ */ React25.createElement(Table, props, /* @__PURE__ */ React25.createElement(TableHead2, null, /* @__PURE__ */ React25.createElement(TableRow3, null, /* @__PURE__ */ React25.createElement(TableCell9, null, "Address"), /* @__PURE__ */ React25.createElement(TableCell9, null, "Blocks Produced"), /* @__PURE__ */ React25.createElement(TableCell9, null, "Rewards Earned Produced"))), /* @__PURE__ */ React25.createElement(TableBody2, null, producers?.map((producer) => /* @__PURE__ */ React25.createElement(TableRow3, {
|
|
1359
1308
|
key: producer.address
|
|
1360
|
-
}, /* @__PURE__ */
|
|
1309
|
+
}, /* @__PURE__ */ React25.createElement(TableCell9, null, /* @__PURE__ */ React25.createElement(BlockiesAvatar2, {
|
|
1361
1310
|
blockiesOptions: {
|
|
1362
1311
|
seed: producer.address
|
|
1363
1312
|
},
|
|
@@ -1365,7 +1314,7 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
|
|
|
1365
1314
|
height: theme.spacing(2.75),
|
|
1366
1315
|
width: theme.spacing(2.75)
|
|
1367
1316
|
}
|
|
1368
|
-
})), /* @__PURE__ */
|
|
1317
|
+
})), /* @__PURE__ */ React25.createElement(TableCell9, null, producer.blocksProduced.toString()), /* @__PURE__ */ React25.createElement(TableCell9, null, producer.rewardsEarned.toString())))));
|
|
1369
1318
|
}, "ChainProducerStatsTable");
|
|
1370
1319
|
|
|
1371
1320
|
// src/components/chain/stats/producer/ProducerFlexbox.tsx
|
|
@@ -1387,16 +1336,16 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
|
|
|
1387
1336
|
const producersArray = useMemo12(() => Object.values(producer?.producers ?? {}), [
|
|
1388
1337
|
producer
|
|
1389
1338
|
]);
|
|
1390
|
-
return /* @__PURE__ */
|
|
1339
|
+
return /* @__PURE__ */ React26.createElement(FlexCol3, {
|
|
1391
1340
|
alignItems: "start",
|
|
1392
1341
|
gap: 1,
|
|
1393
1342
|
...props
|
|
1394
|
-
}, /* @__PURE__ */
|
|
1343
|
+
}, /* @__PURE__ */ React26.createElement(ErrorRender3, {
|
|
1395
1344
|
error: producerError,
|
|
1396
1345
|
scope: "BlockProducerStatsFlexbox"
|
|
1397
|
-
}), /* @__PURE__ */
|
|
1346
|
+
}), /* @__PURE__ */ React26.createElement(Typography5, {
|
|
1398
1347
|
fontSize: "1rem"
|
|
1399
|
-
}, "Block Producers"), /* @__PURE__ */
|
|
1348
|
+
}, "Block Producers"), /* @__PURE__ */ React26.createElement(ChainProducerStatsTable, {
|
|
1400
1349
|
producers: producersArray
|
|
1401
1350
|
}));
|
|
1402
1351
|
}, "BlockProducerStatsFlexbox");
|
|
@@ -1408,18 +1357,18 @@ var StyledListItem = styled(ListItem)(() => ({
|
|
|
1408
1357
|
// src/components/chain/stats/Dialog.tsx
|
|
1409
1358
|
var ChainAnalyzerStatsDialog = /* @__PURE__ */ __name((props) => {
|
|
1410
1359
|
const { analyzers, statsUpdated } = useChainAnalyzersContext();
|
|
1411
|
-
return /* @__PURE__ */
|
|
1360
|
+
return /* @__PURE__ */ React27.createElement(Dialog3, props, /* @__PURE__ */ React27.createElement(DialogTitle3, null, "Chain Analysis"), /* @__PURE__ */ React27.createElement(DialogContent3, null, !!statsUpdated && Object.entries(analyzers).map(([id2, analyzer]) => /* @__PURE__ */ React27.createElement("div", {
|
|
1412
1361
|
key: id2
|
|
1413
|
-
}, id2 === "producers" && /* @__PURE__ */
|
|
1362
|
+
}, id2 === "producers" && /* @__PURE__ */ React27.createElement(BlockProducerStatsFlexbox, {
|
|
1414
1363
|
payload: analyzer.result()
|
|
1415
1364
|
})))));
|
|
1416
1365
|
}, "ChainAnalyzerStatsDialog");
|
|
1417
1366
|
var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
1418
1367
|
const [open, setOpen] = useState11(false);
|
|
1419
1368
|
const handleClose = /* @__PURE__ */ __name(() => setOpen(false), "handleClose");
|
|
1420
|
-
return /* @__PURE__ */
|
|
1369
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(IconButton3, {
|
|
1421
1370
|
onClick: /* @__PURE__ */ __name(() => setOpen(true), "onClick")
|
|
1422
|
-
}, /* @__PURE__ */
|
|
1371
|
+
}, /* @__PURE__ */ React27.createElement(QueryStats, null)), /* @__PURE__ */ React27.createElement(ChainAnalyzerStatsDialog, {
|
|
1423
1372
|
onClose: handleClose,
|
|
1424
1373
|
open,
|
|
1425
1374
|
...props
|
|
@@ -1428,19 +1377,19 @@ var ChainAnalyzerStatsDialogFromContext = /* @__PURE__ */ __name((props) => {
|
|
|
1428
1377
|
|
|
1429
1378
|
// src/components/chain/controls/PulseSvgIcon.tsx
|
|
1430
1379
|
import { createSvgIcon, keyframes, styled as styled2 } from "@mui/material";
|
|
1431
|
-
import
|
|
1432
|
-
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */
|
|
1380
|
+
import React28 from "react";
|
|
1381
|
+
var PulseSvgIcon = createSvgIcon(/* @__PURE__ */ React28.createElement("svg", {
|
|
1433
1382
|
viewBox: "0 0 80 80",
|
|
1434
1383
|
version: "1.1",
|
|
1435
1384
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1436
|
-
}, /* @__PURE__ */
|
|
1385
|
+
}, /* @__PURE__ */ React28.createElement("g", {
|
|
1437
1386
|
transform: "translate(34,34)"
|
|
1438
|
-
}, /* @__PURE__ */
|
|
1387
|
+
}, /* @__PURE__ */ React28.createElement("circle", {
|
|
1439
1388
|
className: "core",
|
|
1440
1389
|
cx: "0",
|
|
1441
1390
|
cy: "0",
|
|
1442
1391
|
r: "6"
|
|
1443
|
-
}), /* @__PURE__ */
|
|
1392
|
+
}), /* @__PURE__ */ React28.createElement("circle", {
|
|
1444
1393
|
className: "radar",
|
|
1445
1394
|
cx: "0",
|
|
1446
1395
|
cy: "0",
|
|
@@ -1504,24 +1453,24 @@ var StyledPulseSvgIcon = styled2(PulseSvgIcon)(({ theme }) => {
|
|
|
1504
1453
|
var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingState, setPollingState }) => {
|
|
1505
1454
|
const paused = pollingState === "paused";
|
|
1506
1455
|
const running = pollingState === "running";
|
|
1507
|
-
return /* @__PURE__ */
|
|
1456
|
+
return /* @__PURE__ */ React29.createElement(FlexRow6, {
|
|
1508
1457
|
justifyContent: "space-between",
|
|
1509
1458
|
width: "100%"
|
|
1510
|
-
}, /* @__PURE__ */
|
|
1459
|
+
}, /* @__PURE__ */ React29.createElement(FlexRow6, {
|
|
1511
1460
|
gap: 2
|
|
1512
|
-
}, running && /* @__PURE__ */
|
|
1461
|
+
}, running && /* @__PURE__ */ React29.createElement(IconButton4, {
|
|
1513
1462
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("paused"), "onClick"),
|
|
1514
1463
|
title: "Pause Block Stream"
|
|
1515
|
-
}, /* @__PURE__ */
|
|
1464
|
+
}, /* @__PURE__ */ React29.createElement(Pause, null)), paused && /* @__PURE__ */ React29.createElement(IconButton4, {
|
|
1516
1465
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick"),
|
|
1517
1466
|
title: "Re-Sync Block Stream"
|
|
1518
|
-
}, /* @__PURE__ */
|
|
1467
|
+
}, /* @__PURE__ */ React29.createElement(Autorenew, null)), /* @__PURE__ */ React29.createElement(ChainAnalyzerStatsDialogFromContext, null)), /* @__PURE__ */ React29.createElement(FlexRow6, {
|
|
1519
1468
|
gap: 2
|
|
1520
|
-
}, /* @__PURE__ */
|
|
1469
|
+
}, /* @__PURE__ */ React29.createElement(Grow, {
|
|
1521
1470
|
in: (blocksBehind ?? 0) > 0
|
|
1522
|
-
}, /* @__PURE__ */
|
|
1471
|
+
}, /* @__PURE__ */ React29.createElement(Tooltip7, {
|
|
1523
1472
|
title: "Click to Re-Sync"
|
|
1524
|
-
}, /* @__PURE__ */
|
|
1473
|
+
}, /* @__PURE__ */ React29.createElement(Alert3, {
|
|
1525
1474
|
sx: {
|
|
1526
1475
|
py: 0,
|
|
1527
1476
|
px: 1,
|
|
@@ -1529,11 +1478,11 @@ var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingStat
|
|
|
1529
1478
|
},
|
|
1530
1479
|
severity: "warning",
|
|
1531
1480
|
onClick: /* @__PURE__ */ __name(() => setPollingState?.("running"), "onClick")
|
|
1532
|
-
}, /* @__PURE__ */
|
|
1481
|
+
}, /* @__PURE__ */ React29.createElement(AlertTitle2, {
|
|
1533
1482
|
sx: {
|
|
1534
1483
|
mb: 0
|
|
1535
1484
|
}
|
|
1536
|
-
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */
|
|
1485
|
+
}, "Behind:", " ", blocksBehind)))), /* @__PURE__ */ React29.createElement(Icon2, null, /* @__PURE__ */ React29.createElement(StyledPulseSvgIcon, {
|
|
1537
1486
|
className: running ? "" : "paused"
|
|
1538
1487
|
}))));
|
|
1539
1488
|
}, "PollingControlsFlexbox");
|
|
@@ -1541,9 +1490,9 @@ var MemoizedPollingControlsFlexbox = /* @__PURE__ */ memo(PollingControlsFlexbox
|
|
|
1541
1490
|
|
|
1542
1491
|
// src/components/chain/dialog/Dialog.tsx
|
|
1543
1492
|
import { Button as Button4, Dialog as Dialog4, DialogActions as DialogActions3, DialogContent as DialogContent4 } from "@mui/material";
|
|
1544
|
-
import
|
|
1493
|
+
import React30 from "react";
|
|
1545
1494
|
var TransactionsDialog = /* @__PURE__ */ __name((props) => {
|
|
1546
|
-
return /* @__PURE__ */
|
|
1495
|
+
return /* @__PURE__ */ React30.createElement(Dialog4, props, /* @__PURE__ */ React30.createElement(DialogContent4, null, "Transactions Dialog"), /* @__PURE__ */ React30.createElement(DialogActions3, null, /* @__PURE__ */ React30.createElement(Button4, {
|
|
1547
1496
|
variant: "outlined",
|
|
1548
1497
|
onClick: /* @__PURE__ */ __name((e) => props?.onClose?.(e, "escapeKeyDown"), "onClick")
|
|
1549
1498
|
}, "Close")));
|
|
@@ -1583,9 +1532,9 @@ var useOnBlock = /* @__PURE__ */ __name((initialHeadNumber, onAddBlock, liveHead
|
|
|
1583
1532
|
|
|
1584
1533
|
// src/components/chain/pagination/BlockChainPagination.tsx
|
|
1585
1534
|
import { TablePaginationActions } from "@xyo-network/react-payload-table";
|
|
1586
|
-
import
|
|
1535
|
+
import React31 from "react";
|
|
1587
1536
|
var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, page, rowsPerPage = 10 }) => {
|
|
1588
|
-
return /* @__PURE__ */
|
|
1537
|
+
return /* @__PURE__ */ React31.createElement(TablePaginationActions, {
|
|
1589
1538
|
count,
|
|
1590
1539
|
onPageChange,
|
|
1591
1540
|
page,
|
|
@@ -1619,11 +1568,11 @@ var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
|
|
|
1619
1568
|
// src/components/chain/render/dynamic/flexbox/variants/Base.tsx
|
|
1620
1569
|
import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
|
|
1621
1570
|
import { FlexCol as FlexCol5 } from "@xylabs/react-flexbox";
|
|
1622
|
-
import
|
|
1571
|
+
import React33 from "react";
|
|
1623
1572
|
|
|
1624
1573
|
// src/components/chain/list/Animated.tsx
|
|
1625
1574
|
import { AnimatedList } from "@xylabs/react-animation";
|
|
1626
|
-
import
|
|
1575
|
+
import React32 from "react";
|
|
1627
1576
|
|
|
1628
1577
|
// src/components/chain/styled/BlockListWrapperFlexbox.tsx
|
|
1629
1578
|
import { styled as styled3 } from "@mui/material";
|
|
@@ -1644,10 +1593,10 @@ var BlockListWrapperFlexBox = styled3(FlexCol4, {
|
|
|
1644
1593
|
|
|
1645
1594
|
// src/components/chain/list/Animated.tsx
|
|
1646
1595
|
var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents }) => {
|
|
1647
|
-
return /* @__PURE__ */
|
|
1596
|
+
return /* @__PURE__ */ React32.createElement(BlockListWrapperFlexBox, {
|
|
1648
1597
|
alignItems: "stretch",
|
|
1649
1598
|
width: "100%"
|
|
1650
|
-
}, /* @__PURE__ */
|
|
1599
|
+
}, /* @__PURE__ */ React32.createElement(AnimatedList, {
|
|
1651
1600
|
fullWidth: true,
|
|
1652
1601
|
items: blockChainRenderComponents
|
|
1653
1602
|
}));
|
|
@@ -1738,25 +1687,25 @@ var useRemoteBlockChainRenderProps = /* @__PURE__ */ __name((chainArchivistModul
|
|
|
1738
1687
|
// src/components/chain/render/dynamic/flexbox/variants/Base.tsx
|
|
1739
1688
|
var DynamicListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1740
1689
|
const { errors, blockChainRenderComponents, blocksWhilePaused, pollingState, updatePollingState } = useDynamicBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1741
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ React33.createElement(FlexCol5, {
|
|
1742
1691
|
alignItems: "start",
|
|
1743
1692
|
...props
|
|
1744
|
-
}, errors?.map((error) => /* @__PURE__ */
|
|
1693
|
+
}, errors?.map((error) => /* @__PURE__ */ React33.createElement(ErrorRender4, {
|
|
1745
1694
|
error,
|
|
1746
1695
|
key: error?.name,
|
|
1747
1696
|
scope: "DynamicBlockchainRenderFlexboxInner"
|
|
1748
|
-
})), /* @__PURE__ */
|
|
1697
|
+
})), /* @__PURE__ */ React33.createElement(MemoizedPollingControlsFlexbox, {
|
|
1749
1698
|
blocksBehind: blocksWhilePaused?.length,
|
|
1750
1699
|
pollingState,
|
|
1751
1700
|
setPollingState: updatePollingState
|
|
1752
|
-
}), /* @__PURE__ */
|
|
1701
|
+
}), /* @__PURE__ */ React33.createElement(BlockListAnimated, {
|
|
1753
1702
|
blockChainRenderComponents
|
|
1754
1703
|
}));
|
|
1755
1704
|
}, "DynamicListBase");
|
|
1756
1705
|
|
|
1757
1706
|
// src/components/chain/render/dynamic/flexbox/variants/WithAnalysis.tsx
|
|
1758
1707
|
import { ChainProducersAnalyzer } from "@xyo-network/chain-protocol";
|
|
1759
|
-
import
|
|
1708
|
+
import React34, { useMemo as useMemo16 } from "react";
|
|
1760
1709
|
var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1761
1710
|
const { chainInformation } = blockChainRenderProps ?? {};
|
|
1762
1711
|
const analyzers = useMemo16(() => {
|
|
@@ -1768,9 +1717,9 @@ var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1768
1717
|
}, [
|
|
1769
1718
|
chainInformation
|
|
1770
1719
|
]);
|
|
1771
|
-
return /* @__PURE__ */
|
|
1720
|
+
return /* @__PURE__ */ React34.createElement(ChainAnalyzersProvider, {
|
|
1772
1721
|
analyzers
|
|
1773
|
-
}, /* @__PURE__ */
|
|
1722
|
+
}, /* @__PURE__ */ React34.createElement(ChainPollingProvider, null, /* @__PURE__ */ React34.createElement(DynamicListBase, {
|
|
1774
1723
|
blockChainRenderProps,
|
|
1775
1724
|
...props
|
|
1776
1725
|
})));
|
|
@@ -1778,13 +1727,13 @@ var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1778
1727
|
|
|
1779
1728
|
// src/components/chain/render/dynamic/flexbox/variants/WithRemote.tsx
|
|
1780
1729
|
import { ErrorRender as ErrorRender5 } from "@xylabs/react-error";
|
|
1781
|
-
import
|
|
1730
|
+
import React35 from "react";
|
|
1782
1731
|
var WithRemote = /* @__PURE__ */ __name(({ url, chainArchivistModuleId, blockChainRenderProps: blockChainRenderPropsArg, ...props }) => {
|
|
1783
1732
|
const { error, blockChainRenderProps } = useRemoteBlockChainRenderProps(chainArchivistModuleId, url, blockChainRenderPropsArg);
|
|
1784
|
-
return /* @__PURE__ */
|
|
1733
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(ErrorRender5, {
|
|
1785
1734
|
error,
|
|
1786
1735
|
scope: "RemoteChainProviderFlexbox"
|
|
1787
|
-
}), /* @__PURE__ */
|
|
1736
|
+
}), /* @__PURE__ */ React35.createElement(WithAnalysis, {
|
|
1788
1737
|
blockChainRenderProps,
|
|
1789
1738
|
...props
|
|
1790
1739
|
}));
|
|
@@ -1800,7 +1749,7 @@ var DynamicBlockchainRenderFlexbox = {
|
|
|
1800
1749
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1801
1750
|
import { ErrorRender as ErrorRender6 } from "@xylabs/react-error";
|
|
1802
1751
|
import { FlexCol as FlexCol6, FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
|
|
1803
|
-
import
|
|
1752
|
+
import React36 from "react";
|
|
1804
1753
|
|
|
1805
1754
|
// src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts
|
|
1806
1755
|
import { exists } from "@xylabs/exists";
|
|
@@ -1833,31 +1782,31 @@ var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blo
|
|
|
1833
1782
|
// src/components/chain/render/static/flexbox/variants/Base.tsx
|
|
1834
1783
|
var StaticListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1835
1784
|
const { blockComponents, errors, paginatedBlockComponents, onPageChange, page, pageSize } = useStaticBlockRenderComponents(BlockHeadingFlexbox, blockChainRenderProps);
|
|
1836
|
-
return /* @__PURE__ */
|
|
1785
|
+
return /* @__PURE__ */ React36.createElement(FlexCol6, {
|
|
1837
1786
|
alignItems: "start",
|
|
1838
1787
|
gap: 2,
|
|
1839
1788
|
width: "100%",
|
|
1840
1789
|
...props
|
|
1841
|
-
}, errors?.map((error) => /* @__PURE__ */
|
|
1790
|
+
}, errors?.map((error) => /* @__PURE__ */ React36.createElement(ErrorRender6, {
|
|
1842
1791
|
error,
|
|
1843
1792
|
key: error.name,
|
|
1844
1793
|
scope: "StaticBlockchainFlexboxInner"
|
|
1845
|
-
})), paginatedBlockComponents?.length ? /* @__PURE__ */
|
|
1794
|
+
})), paginatedBlockComponents?.length ? /* @__PURE__ */ React36.createElement(FlexGrowRow2, {
|
|
1846
1795
|
justifyContent: "space-between",
|
|
1847
1796
|
width: "100%"
|
|
1848
|
-
}, /* @__PURE__ */
|
|
1797
|
+
}, /* @__PURE__ */ React36.createElement(ChainAnalyzerStatsDialogFromContext, null), /* @__PURE__ */ React36.createElement(BlockChainPagination, {
|
|
1849
1798
|
count: blockComponents?.length ?? 0,
|
|
1850
1799
|
onPageChange,
|
|
1851
1800
|
page,
|
|
1852
1801
|
rowsPerPage: pageSize
|
|
1853
|
-
})) : null, /* @__PURE__ */
|
|
1802
|
+
})) : null, /* @__PURE__ */ React36.createElement(BlockListAnimated, {
|
|
1854
1803
|
blockChainRenderComponents: paginatedBlockComponents
|
|
1855
1804
|
}));
|
|
1856
1805
|
}, "StaticListBase");
|
|
1857
1806
|
|
|
1858
1807
|
// src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx
|
|
1859
1808
|
import { ChainProducersAnalyzer as ChainProducersAnalyzer2 } from "@xyo-network/chain-protocol";
|
|
1860
|
-
import
|
|
1809
|
+
import React37, { useMemo as useMemo18 } from "react";
|
|
1861
1810
|
var WithAnalysis2 = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
|
|
1862
1811
|
const { chainInformation } = blockChainRenderProps ?? {};
|
|
1863
1812
|
const analyzers = useMemo18(() => {
|
|
@@ -1869,9 +1818,9 @@ var WithAnalysis2 = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props })
|
|
|
1869
1818
|
}, [
|
|
1870
1819
|
chainInformation
|
|
1871
1820
|
]);
|
|
1872
|
-
return /* @__PURE__ */
|
|
1821
|
+
return /* @__PURE__ */ React37.createElement(ChainAnalyzersProvider, {
|
|
1873
1822
|
analyzers
|
|
1874
|
-
}, /* @__PURE__ */
|
|
1823
|
+
}, /* @__PURE__ */ React37.createElement(StaticListBase, {
|
|
1875
1824
|
blockChainRenderProps,
|
|
1876
1825
|
...props
|
|
1877
1826
|
}));
|
|
@@ -1886,19 +1835,19 @@ var StaticBlockchainRenderFlexBox = {
|
|
|
1886
1835
|
// src/components/payload/builder/Flexbox.tsx
|
|
1887
1836
|
import { FlexCol as FlexCol7 } from "@xylabs/react-flexbox";
|
|
1888
1837
|
import { JsonViewerEx as JsonViewerEx2 } from "@xyo-network/react-payload-raw-info";
|
|
1889
|
-
import
|
|
1838
|
+
import React38, { useState as useState13 } from "react";
|
|
1890
1839
|
var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild, ...props }) => {
|
|
1891
1840
|
const [payload, setPayload] = useState13();
|
|
1892
1841
|
const onBuildLocal = /* @__PURE__ */ __name((payload2) => {
|
|
1893
1842
|
onBuild?.(payload2);
|
|
1894
1843
|
setPayload(payload2);
|
|
1895
1844
|
}, "onBuildLocal");
|
|
1896
|
-
return /* @__PURE__ */
|
|
1845
|
+
return /* @__PURE__ */ React38.createElement(FlexCol7, {
|
|
1897
1846
|
gap: 2,
|
|
1898
1847
|
...props
|
|
1899
|
-
}, /* @__PURE__ */
|
|
1848
|
+
}, /* @__PURE__ */ React38.createElement(BuilderComponent, {
|
|
1900
1849
|
onBuild: onBuildLocal
|
|
1901
|
-
}), payload && /* @__PURE__ */
|
|
1850
|
+
}), payload && /* @__PURE__ */ React38.createElement(JsonViewerEx2, {
|
|
1902
1851
|
value: payload
|
|
1903
1852
|
}));
|
|
1904
1853
|
}, "PayloadBuilderFlexbox");
|
|
@@ -1906,11 +1855,11 @@ var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild,
|
|
|
1906
1855
|
// src/components/payload/builder/producer-intent/Form.tsx
|
|
1907
1856
|
import { Button as Button5, FormControl as FormControl5 } from "@mui/material";
|
|
1908
1857
|
import { createProducerChainStakeIntent } from "@xyo-network/chain-ethereum";
|
|
1909
|
-
import
|
|
1858
|
+
import React41, { useMemo as useMemo20, useState as useState16 } from "react";
|
|
1910
1859
|
|
|
1911
1860
|
// src/components/payload/fields/BlockNumberTextField.tsx
|
|
1912
1861
|
import { FormControl as FormControl3, FormHelperText as FormHelperText2, TextField as TextField3 } from "@mui/material";
|
|
1913
|
-
import
|
|
1862
|
+
import React39, { useState as useState14 } from "react";
|
|
1914
1863
|
var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumberChanged, onChange, ...props }) => {
|
|
1915
1864
|
const [blockNumber, setBlockNumber] = useState14();
|
|
1916
1865
|
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
@@ -1919,15 +1868,15 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1919
1868
|
onBlockNumberChanged?.(Number.parseInt(value));
|
|
1920
1869
|
onChange?.(e);
|
|
1921
1870
|
}, "handleChange");
|
|
1922
|
-
return /* @__PURE__ */
|
|
1871
|
+
return /* @__PURE__ */ React39.createElement(FormControl3, {
|
|
1923
1872
|
fullWidth: true
|
|
1924
|
-
}, /* @__PURE__ */
|
|
1873
|
+
}, /* @__PURE__ */ React39.createElement(TextField3, {
|
|
1925
1874
|
error: !!errorMessage,
|
|
1926
1875
|
onChange: handleChange,
|
|
1927
1876
|
type: "number",
|
|
1928
1877
|
value: blockNumber ?? "",
|
|
1929
1878
|
...props
|
|
1930
|
-
}), errorMessage && /* @__PURE__ */
|
|
1879
|
+
}), errorMessage && /* @__PURE__ */ React39.createElement(FormHelperText2, {
|
|
1931
1880
|
sx: {
|
|
1932
1881
|
color: "error.main"
|
|
1933
1882
|
}
|
|
@@ -1937,7 +1886,7 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
|
|
|
1937
1886
|
// src/components/payload/fields/XyoAddressTextField.tsx
|
|
1938
1887
|
import { FormControl as FormControl4, FormHelperText as FormHelperText3, TextField as TextField4 } from "@mui/material";
|
|
1939
1888
|
import { asAddress } from "@xylabs/hex";
|
|
1940
|
-
import
|
|
1889
|
+
import React40, { useMemo as useMemo19, useState as useState15 } from "react";
|
|
1941
1890
|
var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange, resetValue, ...props }) => {
|
|
1942
1891
|
const [address, setAddress] = useState15("");
|
|
1943
1892
|
const [addressError, setAddressError] = useState15();
|
|
@@ -1961,15 +1910,15 @@ var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange,
|
|
|
1961
1910
|
onAddressChanged?.();
|
|
1962
1911
|
}
|
|
1963
1912
|
}, "handleBlur");
|
|
1964
|
-
return /* @__PURE__ */
|
|
1913
|
+
return /* @__PURE__ */ React40.createElement(FormControl4, {
|
|
1965
1914
|
fullWidth: true
|
|
1966
|
-
}, /* @__PURE__ */
|
|
1915
|
+
}, /* @__PURE__ */ React40.createElement(TextField4, {
|
|
1967
1916
|
error: !!addressError,
|
|
1968
1917
|
onBlur: handleBlur,
|
|
1969
1918
|
onChange: handleChange,
|
|
1970
1919
|
value: address,
|
|
1971
1920
|
...props
|
|
1972
|
-
}), addressError && /* @__PURE__ */
|
|
1921
|
+
}), addressError && /* @__PURE__ */ React40.createElement(FormHelperText3, {
|
|
1973
1922
|
sx: {
|
|
1974
1923
|
color: "error.main"
|
|
1975
1924
|
}
|
|
@@ -2002,33 +1951,33 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2002
1951
|
const onBuildLocal = /* @__PURE__ */ __name(() => {
|
|
2003
1952
|
if (onBuild && intentPayload) onBuild?.(intentPayload);
|
|
2004
1953
|
}, "onBuildLocal");
|
|
2005
|
-
return /* @__PURE__ */
|
|
1954
|
+
return /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
2006
1955
|
fullWidth: true
|
|
2007
|
-
}, /* @__PURE__ */
|
|
1956
|
+
}, /* @__PURE__ */ React41.createElement(XyoAddressTextField, {
|
|
2008
1957
|
label: "Delegate",
|
|
2009
1958
|
name: "delegate",
|
|
2010
1959
|
onAddressChanged: setDelegate,
|
|
2011
1960
|
required: true,
|
|
2012
1961
|
size: "small"
|
|
2013
|
-
})), /* @__PURE__ */
|
|
1962
|
+
})), /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
2014
1963
|
fullWidth: true
|
|
2015
|
-
}, /* @__PURE__ */
|
|
1964
|
+
}, /* @__PURE__ */ React41.createElement(BlockNumberTextField, {
|
|
2016
1965
|
errorMessage: blockRangeError?.message,
|
|
2017
1966
|
label: "Expires",
|
|
2018
1967
|
name: "exp",
|
|
2019
1968
|
onBlockNumberChanged: setExp,
|
|
2020
1969
|
required: true,
|
|
2021
1970
|
size: "small"
|
|
2022
|
-
})), /* @__PURE__ */
|
|
1971
|
+
})), /* @__PURE__ */ React41.createElement(FormControl5, {
|
|
2023
1972
|
fullWidth: true
|
|
2024
|
-
}, /* @__PURE__ */
|
|
1973
|
+
}, /* @__PURE__ */ React41.createElement(BlockNumberTextField, {
|
|
2025
1974
|
errorMessage: blockRangeError?.message,
|
|
2026
1975
|
label: "Not Before",
|
|
2027
1976
|
name: "nbf",
|
|
2028
1977
|
onBlockNumberChanged: setNbf,
|
|
2029
1978
|
required: true,
|
|
2030
1979
|
size: "small"
|
|
2031
|
-
})), /* @__PURE__ */
|
|
1980
|
+
})), /* @__PURE__ */ React41.createElement(Button5, {
|
|
2032
1981
|
disabled: !intentPayload,
|
|
2033
1982
|
variant: "contained",
|
|
2034
1983
|
onClick: onBuildLocal
|
|
@@ -2036,20 +1985,20 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2036
1985
|
}, "ProducerIntentBuilderForm");
|
|
2037
1986
|
|
|
2038
1987
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2039
|
-
import
|
|
1988
|
+
import React44 from "react";
|
|
2040
1989
|
|
|
2041
1990
|
// src/components/payload/builder/transfer/Form.tsx
|
|
2042
1991
|
import { Button as Button6, FormControl as FormControl7 } from "@mui/material";
|
|
2043
|
-
import { TransferSchema } from "@xyo-network/xl1-
|
|
2044
|
-
import
|
|
1992
|
+
import { TransferSchema } from "@xyo-network/xl1-protocol";
|
|
1993
|
+
import React43, { useMemo as useMemo22, useState as useState18 } from "react";
|
|
2045
1994
|
|
|
2046
1995
|
// src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
|
|
2047
1996
|
import { RemoveCircle } from "@mui/icons-material";
|
|
2048
1997
|
import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 } from "@mui/material";
|
|
2049
1998
|
import { toHex as toHex3 } from "@xylabs/hex";
|
|
2050
|
-
import { FlexRow as
|
|
1999
|
+
import { FlexRow as FlexRow7 } from "@xylabs/react-flexbox";
|
|
2051
2000
|
import { BigIntInput } from "@xyo-network/react-shared";
|
|
2052
|
-
import
|
|
2001
|
+
import React42, { useEffect as useEffect4, useMemo as useMemo21, useState as useState17 } from "react";
|
|
2053
2002
|
var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated, onRemoveTransfer, singleTransfer, ...props }) => {
|
|
2054
2003
|
const [toAddress, setToAddress] = useState17();
|
|
2055
2004
|
const [amount, setAmount] = useState17();
|
|
@@ -2070,29 +2019,29 @@ var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated,
|
|
|
2070
2019
|
}, [
|
|
2071
2020
|
transferAmount
|
|
2072
2021
|
]);
|
|
2073
|
-
return /* @__PURE__ */
|
|
2022
|
+
return /* @__PURE__ */ React42.createElement(FlexRow7, {
|
|
2074
2023
|
alignItems: "start",
|
|
2075
2024
|
gap: 1,
|
|
2076
2025
|
...props
|
|
2077
|
-
}, /* @__PURE__ */
|
|
2026
|
+
}, /* @__PURE__ */ React42.createElement(FormControl6, {
|
|
2078
2027
|
fullWidth: true
|
|
2079
|
-
}, /* @__PURE__ */
|
|
2028
|
+
}, /* @__PURE__ */ React42.createElement(XyoAddressTextField, {
|
|
2080
2029
|
label: "To",
|
|
2081
2030
|
name: "to",
|
|
2082
2031
|
onAddressChanged: setToAddress,
|
|
2083
2032
|
required: true,
|
|
2084
2033
|
size: "small"
|
|
2085
|
-
})), /* @__PURE__ */
|
|
2034
|
+
})), /* @__PURE__ */ React42.createElement(FormControl6, {
|
|
2086
2035
|
fullWidth: true
|
|
2087
|
-
}, /* @__PURE__ */
|
|
2036
|
+
}, /* @__PURE__ */ React42.createElement(BigIntInput.TextField, {
|
|
2088
2037
|
label: "Amount",
|
|
2089
2038
|
name: "amount",
|
|
2090
2039
|
onChangeFixedPoint: setAmount,
|
|
2091
2040
|
required: true,
|
|
2092
2041
|
size: "small"
|
|
2093
|
-
})), /* @__PURE__ */
|
|
2042
|
+
})), /* @__PURE__ */ React42.createElement(IconButton5, {
|
|
2094
2043
|
onClick: /* @__PURE__ */ __name(() => onRemoveTransfer?.(singleTransfer.transferId), "onClick")
|
|
2095
|
-
}, /* @__PURE__ */
|
|
2044
|
+
}, /* @__PURE__ */ React42.createElement(Icon3, null, /* @__PURE__ */ React42.createElement(RemoveCircle, null))));
|
|
2096
2045
|
}, "SingleTransferBuilderFlexbox");
|
|
2097
2046
|
|
|
2098
2047
|
// src/components/payload/builder/transfer/Form.tsx
|
|
@@ -2141,19 +2090,19 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2141
2090
|
return transfer;
|
|
2142
2091
|
}));
|
|
2143
2092
|
}, "onTransferUpdated");
|
|
2144
|
-
return /* @__PURE__ */
|
|
2093
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(FormControl7, {
|
|
2145
2094
|
fullWidth: true
|
|
2146
|
-
}, /* @__PURE__ */
|
|
2095
|
+
}, /* @__PURE__ */ React43.createElement(XyoAddressTextField, {
|
|
2147
2096
|
label: "From",
|
|
2148
2097
|
name: "from",
|
|
2149
2098
|
onAddressChanged: setFromAddress,
|
|
2150
2099
|
required: true,
|
|
2151
2100
|
size: "small"
|
|
2152
|
-
})), /* @__PURE__ */
|
|
2101
|
+
})), /* @__PURE__ */ React43.createElement(Button6, {
|
|
2153
2102
|
onClick: onTransferAdded,
|
|
2154
2103
|
size: "small",
|
|
2155
2104
|
variant: "contained"
|
|
2156
|
-
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */
|
|
2105
|
+
}, "Add Transfer"), transfers.map((transfer) => /* @__PURE__ */ React43.createElement(SingleTransferBuilderFlexbox, {
|
|
2157
2106
|
key: transfer.transferId,
|
|
2158
2107
|
onTransferUpdated,
|
|
2159
2108
|
onRemoveTransfer: onTransferRemoved,
|
|
@@ -2161,7 +2110,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2161
2110
|
sx: {
|
|
2162
2111
|
width: "100%"
|
|
2163
2112
|
}
|
|
2164
|
-
})), /* @__PURE__ */
|
|
2113
|
+
})), /* @__PURE__ */ React43.createElement(Button6, {
|
|
2165
2114
|
disabled: !transferPayload,
|
|
2166
2115
|
variant: "contained",
|
|
2167
2116
|
onClick: onBuildLocal
|
|
@@ -2169,7 +2118,7 @@ var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
|
|
|
2169
2118
|
}, "TransferBuilderForm");
|
|
2170
2119
|
|
|
2171
2120
|
// src/components/payload/builder/transfer/Flexbox.tsx
|
|
2172
|
-
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */
|
|
2121
|
+
var TransferBuilderFlexbox = /* @__PURE__ */ __name(({ onBuild, ...props }) => /* @__PURE__ */ React44.createElement(PayloadBuilderFlexbox, {
|
|
2173
2122
|
gap: 4,
|
|
2174
2123
|
alignItems: "start",
|
|
2175
2124
|
BuilderComponent: TransferBuilderForm,
|
|
@@ -2196,7 +2145,7 @@ import { usePromise as usePromise7 } from "@xylabs/react-promise";
|
|
|
2196
2145
|
import { MemoryArchivist } from "@xyo-network/archivist-memory";
|
|
2197
2146
|
import { ArchivistConfigSchema } from "@xyo-network/archivist-model";
|
|
2198
2147
|
import { flattenHydratedBlocks } from "@xyo-network/chain-protocol";
|
|
2199
|
-
import
|
|
2148
|
+
import React45, { useEffect as useEffect5 } from "react";
|
|
2200
2149
|
var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2201
2150
|
const [randomBlockChain] = usePromise7(async () => await buildRandomBlockChain(), []);
|
|
2202
2151
|
const [blockChainRenderProps, blockChainRenderPropsError] = usePromise7(async () => {
|
|
@@ -2236,7 +2185,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2236
2185
|
}
|
|
2237
2186
|
}
|
|
2238
2187
|
};
|
|
2239
|
-
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */
|
|
2188
|
+
return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React45.createElement(Story, props) : /* @__PURE__ */ React45.createElement(CircularProgress, null);
|
|
2240
2189
|
}, "ChainArchivistDecorator");
|
|
2241
2190
|
|
|
2242
2191
|
// src/stories/ChainArchivistDelayedInsertDecorator.tsx
|
|
@@ -2246,7 +2195,7 @@ import { usePromise as usePromise8 } from "@xylabs/react-promise";
|
|
|
2246
2195
|
import { MemoryArchivist as MemoryArchivist2 } from "@xyo-network/archivist-memory";
|
|
2247
2196
|
import { ArchivistConfigSchema as ArchivistConfigSchema2 } from "@xyo-network/archivist-model";
|
|
2248
2197
|
import { flattenHydratedBlock } from "@xyo-network/chain-protocol";
|
|
2249
|
-
import
|
|
2198
|
+
import React46, { useEffect as useEffect6, useState as useState19 } from "react";
|
|
2250
2199
|
var chainArchivistRef;
|
|
2251
2200
|
var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
2252
2201
|
const [firstBlock, setFirstBlock] = useState19();
|
|
@@ -2304,7 +2253,7 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
|
|
|
2304
2253
|
}
|
|
2305
2254
|
}
|
|
2306
2255
|
};
|
|
2307
|
-
return firstBlock ? /* @__PURE__ */
|
|
2256
|
+
return firstBlock ? /* @__PURE__ */ React46.createElement(Story, props) : /* @__PURE__ */ React46.createElement(CircularProgress2, null);
|
|
2308
2257
|
}, "ChainArchivistDelayedInsertDecorator");
|
|
2309
2258
|
|
|
2310
2259
|
// src/stories/ChainInfoContextDecorator.tsx
|
|
@@ -2312,8 +2261,8 @@ import { assertEx as assertEx5 } from "@xylabs/assert";
|
|
|
2312
2261
|
import { usePromise as usePromise9 } from "@xylabs/react-promise";
|
|
2313
2262
|
import { XyoChainBlockNumberIterator as XyoChainBlockNumberIterator3 } from "@xyo-network/chain-services";
|
|
2314
2263
|
import { findFirstMatching } from "@xyo-network/chain-utils";
|
|
2315
|
-
import { isBlockBoundWitness as isBlockBoundWitness3 } from "@xyo-network/xl1-
|
|
2316
|
-
import
|
|
2264
|
+
import { isBlockBoundWitness as isBlockBoundWitness3 } from "@xyo-network/xl1-protocol";
|
|
2265
|
+
import React47 from "react";
|
|
2317
2266
|
var archivistConfig = {
|
|
2318
2267
|
url: "http://localhost:8080",
|
|
2319
2268
|
chainArchivistModuleId: "XYOPublic:XYOChain:Chain"
|
|
@@ -2339,11 +2288,11 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
|
|
|
2339
2288
|
chainArchivist,
|
|
2340
2289
|
chainInformation
|
|
2341
2290
|
]);
|
|
2342
|
-
return /* @__PURE__ */
|
|
2291
|
+
return /* @__PURE__ */ React47.createElement(ChainInfoProvider, {
|
|
2343
2292
|
chainArchivist,
|
|
2344
2293
|
chainInformation,
|
|
2345
2294
|
chainIterator
|
|
2346
|
-
}, /* @__PURE__ */
|
|
2295
|
+
}, /* @__PURE__ */ React47.createElement(Story, context));
|
|
2347
2296
|
}, "ChainInfoContextDecorator");
|
|
2348
2297
|
export {
|
|
2349
2298
|
BlockChainPagination,
|