@xyo-network/react-chain-blockchain 1.3.5 → 1.3.7

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.
@@ -305,7 +305,7 @@ var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
305
305
  }, "SubmitChainTransaction");
306
306
 
307
307
  // src/components/transactions/TransactionCountChip.tsx
308
- import { Difference } from "@mui/icons-material";
308
+ import CompareArrowsIcon from "@mui/icons-material/CompareArrows";
309
309
  import { Chip, Icon } from "@mui/material";
310
310
  import React7, { useMemo as useMemo4 } from "react";
311
311
  var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props }) => {
@@ -316,8 +316,8 @@ var TransactionCountChip = /* @__PURE__ */ __name(({ transactions, sx, ...props
316
316
  transactions
317
317
  ]);
318
318
  return /* @__PURE__ */ React7.createElement(Chip, {
319
- avatar: /* @__PURE__ */ React7.createElement(Icon, null, /* @__PURE__ */ React7.createElement(Difference, null)),
320
- label: `tx: ${label}`,
319
+ avatar: /* @__PURE__ */ React7.createElement(Icon, null, /* @__PURE__ */ React7.createElement(CompareArrowsIcon, null)),
320
+ label,
321
321
  title: transactions ? `Block contains ${transactions.length} transactions` : void 0,
322
322
  sx: {
323
323
  display: "inline-flex",
@@ -1137,9 +1137,12 @@ var BlockProducerTableCell = /* @__PURE__ */ __name(({ block, linked, notAvailab
1137
1137
  // src/components/block/table/cell/TransactionCount.tsx
1138
1138
  import { Error as Error3 } from "@mui/icons-material";
1139
1139
  import { Link as Link3, TableCell as TableCell6, Tooltip as Tooltip5 } from "@mui/material";
1140
- import React20 from "react";
1140
+ import React20, { useMemo as useMemo10 } from "react";
1141
1141
  var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ...props }) => {
1142
1142
  const [transactions, error] = useTxsFromBlock(block);
1143
+ const txHashes = useMemo10(() => transactions?.map(([, hash]) => hash), [
1144
+ transactions
1145
+ ]);
1143
1146
  const data = block && transactions !== void 0 ? {
1144
1147
  transactions: transactions.length,
1145
1148
  block: block[0]._hash
@@ -1157,7 +1160,11 @@ var BlockTransactionCountTableCell = /* @__PURE__ */ __name(({ block, linked, ..
1157
1160
  sx: {
1158
1161
  cursor: "pointer"
1159
1162
  }
1160
- }, transactions?.length ?? "--") : transactions?.length ?? "--"));
1163
+ }, /* @__PURE__ */ React20.createElement(TransactionCountChip, {
1164
+ transactions: txHashes
1165
+ })) : /* @__PURE__ */ React20.createElement(TransactionCountChip, {
1166
+ transactions: txHashes
1167
+ })));
1161
1168
  }, "BlockTransactionCountTableCell");
1162
1169
 
1163
1170
  // src/components/block/table/cell/Verification.tsx
@@ -1240,16 +1247,16 @@ BlockchainTableEx.displayName = "BlockchainTableEx";
1240
1247
 
1241
1248
  // src/components/block/table/row/TableRow.tsx
1242
1249
  import { TableRow as TableRow2 } from "@mui/material";
1243
- import React24, { useMemo as useMemo10 } from "react";
1250
+ import React24, { useMemo as useMemo11 } from "react";
1244
1251
  var BlockChainTableRow = /* @__PURE__ */ __name(({ block, defaultExpanded, linked, sx, ...props }) => {
1245
- const linkedTableCellProps = useMemo10(() => ({
1252
+ const linkedTableCellProps = useMemo11(() => ({
1246
1253
  block,
1247
1254
  linked
1248
1255
  }), [
1249
1256
  block,
1250
1257
  linked
1251
1258
  ]);
1252
- const defaultTableCellProps = useMemo10(() => ({
1259
+ const defaultTableCellProps = useMemo11(() => ({
1253
1260
  block
1254
1261
  }), [
1255
1262
  block
@@ -1288,7 +1295,7 @@ import { ListItem, styled, Typography as Typography4 } from "@mui/material";
1288
1295
  import { ErrorRender as ErrorRender3 } from "@xylabs/react-error";
1289
1296
  import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
1290
1297
  import { isChainSummaryProducers } from "@xyo-network/chain-protocol";
1291
- import React26, { useMemo as useMemo11 } from "react";
1298
+ import React26, { useMemo as useMemo12 } from "react";
1292
1299
 
1293
1300
  // src/components/chain/stats/producer/Table.tsx
1294
1301
  import { Table, TableBody as TableBody2, TableCell as TableCell9, TableHead as TableHead2, TableRow as TableRow3, useTheme } from "@mui/material";
@@ -1311,7 +1318,7 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
1311
1318
 
1312
1319
  // src/components/chain/stats/producer/ProducerFlexbox.tsx
1313
1320
  var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) => {
1314
- const [producer, producerError] = useMemo11(() => {
1321
+ const [producer, producerError] = useMemo12(() => {
1315
1322
  if (payload) {
1316
1323
  return isChainSummaryProducers(payload) ? [
1317
1324
  payload
@@ -1325,7 +1332,7 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
1325
1332
  }, [
1326
1333
  payload
1327
1334
  ]);
1328
- const producersArray = useMemo11(() => Object.values(producer?.producers ?? {}), [
1335
+ const producersArray = useMemo12(() => Object.values(producer?.producers ?? {}), [
1329
1336
  producer
1330
1337
  ]);
1331
1338
  return /* @__PURE__ */ React26.createElement(FlexCol3, {
@@ -1535,10 +1542,10 @@ var BlockChainPagination = /* @__PURE__ */ __name(({ count = 0, onPageChange, pa
1535
1542
  }, "BlockChainPagination");
1536
1543
 
1537
1544
  // src/components/chain/pagination/hooks/usePagination.tsx
1538
- import { useMemo as useMemo12, useState as useState12 } from "react";
1545
+ import { useMemo as useMemo13, useState as useState12 } from "react";
1539
1546
  var useChainPagination = /* @__PURE__ */ __name((pageSize, blockComponents) => {
1540
1547
  const [page, setPage] = useState12(0);
1541
- const paginatedBlockComponents = useMemo12(() => {
1548
+ const paginatedBlockComponents = useMemo13(() => {
1542
1549
  const startIndex = page * pageSize;
1543
1550
  const endIndex = startIndex + pageSize;
1544
1551
  return blockComponents?.slice(startIndex, endIndex);
@@ -1595,10 +1602,10 @@ var BlockListAnimated = /* @__PURE__ */ __name(({ blockChainRenderComponents })
1595
1602
  }, "BlockListAnimated");
1596
1603
 
1597
1604
  // src/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.ts
1598
- import { useMemo as useMemo13 } from "react";
1605
+ import { useMemo as useMemo14 } from "react";
1599
1606
  var useDynamicBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blockChainRenderProps) => {
1600
1607
  const { maxBlocks } = blockChainRenderProps ?? {};
1601
- const chainIteratorParams = useMemo13(() => blockChainRenderProps ?? {}, [
1608
+ const chainIteratorParams = useMemo14(() => blockChainRenderProps ?? {}, [
1602
1609
  blockChainRenderProps
1603
1610
  ]);
1604
1611
  const [params, paramsError] = useChainIteratorParams(chainIteratorParams);
@@ -1619,7 +1626,7 @@ var useDynamicBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, bl
1619
1626
 
1620
1627
  // src/components/chain/render/dynamic/hooks/useRemoteBlockChainRenderProps.ts
1621
1628
  import { usePromise as usePromise6 } from "@xylabs/react-promise";
1622
- import { useMemo as useMemo14 } from "react";
1629
+ import { useMemo as useMemo15 } from "react";
1623
1630
 
1624
1631
  // src/lib/getChainArchivist.ts
1625
1632
  import { assertEx as assertEx4 } from "@xylabs/assert";
@@ -1663,7 +1670,7 @@ var useRemoteBlockChainRenderProps = /* @__PURE__ */ __name((chainArchivistModul
1663
1670
  url,
1664
1671
  chainArchivistModuleId
1665
1672
  ]);
1666
- const blockChainRenderProps = useMemo14(() => ({
1673
+ const blockChainRenderProps = useMemo15(() => ({
1667
1674
  ...blockChainRenderPropsArg,
1668
1675
  chainArchivist
1669
1676
  }), [
@@ -1697,10 +1704,10 @@ var DynamicListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props
1697
1704
 
1698
1705
  // src/components/chain/render/dynamic/flexbox/variants/WithAnalysis.tsx
1699
1706
  import { ChainProducersAnalyzer } from "@xyo-network/chain-protocol";
1700
- import React34, { useMemo as useMemo15 } from "react";
1707
+ import React34, { useMemo as useMemo16 } from "react";
1701
1708
  var WithAnalysis = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
1702
1709
  const { chainInformation } = blockChainRenderProps ?? {};
1703
- const analyzers = useMemo15(() => {
1710
+ const analyzers = useMemo16(() => {
1704
1711
  if (chainInformation) {
1705
1712
  return {
1706
1713
  producers: new ChainProducersAnalyzer()
@@ -1745,12 +1752,12 @@ import React36 from "react";
1745
1752
 
1746
1753
  // src/components/chain/render/static/hooks/useStaticBlockRenderComponents.ts
1747
1754
  import { exists } from "@xylabs/exists";
1748
- import { useMemo as useMemo16 } from "react";
1755
+ import { useMemo as useMemo17 } from "react";
1749
1756
  var DEFAULT_PAGE_SIZE = 25;
1750
1757
  var useStaticBlockRenderComponents = /* @__PURE__ */ __name((BlockComponent, blockChainRenderProps) => {
1751
1758
  const { maxBlocks } = blockChainRenderProps ?? {};
1752
1759
  const pageSize = blockChainRenderProps?.pageSize ?? DEFAULT_PAGE_SIZE;
1753
- const chainIteratorParams = useMemo16(() => blockChainRenderProps ?? {}, [
1760
+ const chainIteratorParams = useMemo17(() => blockChainRenderProps ?? {}, [
1754
1761
  blockChainRenderProps
1755
1762
  ]);
1756
1763
  const [params, paramsError] = useChainIteratorParams(chainIteratorParams);
@@ -1798,10 +1805,10 @@ var StaticListBase = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }
1798
1805
 
1799
1806
  // src/components/chain/render/static/flexbox/variants/WithAnalysis.tsx
1800
1807
  import { ChainProducersAnalyzer as ChainProducersAnalyzer2 } from "@xyo-network/chain-protocol";
1801
- import React37, { useMemo as useMemo17 } from "react";
1808
+ import React37, { useMemo as useMemo18 } from "react";
1802
1809
  var WithAnalysis2 = /* @__PURE__ */ __name(({ blockChainRenderProps, ...props }) => {
1803
1810
  const { chainInformation } = blockChainRenderProps ?? {};
1804
- const analyzers = useMemo17(() => {
1811
+ const analyzers = useMemo18(() => {
1805
1812
  if (chainInformation) {
1806
1813
  return {
1807
1814
  producers: new ChainProducersAnalyzer2()
@@ -1847,7 +1854,7 @@ var PayloadBuilderFlexbox = /* @__PURE__ */ __name(({ BuilderComponent, onBuild,
1847
1854
  // src/components/payload/builder/producer-intent/Form.tsx
1848
1855
  import { Button as Button5, FormControl as FormControl5 } from "@mui/material";
1849
1856
  import { createProducerChainStakeIntent } from "@xyo-network/chain-ethereum";
1850
- import React41, { useMemo as useMemo19, useState as useState16 } from "react";
1857
+ import React41, { useMemo as useMemo20, useState as useState16 } from "react";
1851
1858
 
1852
1859
  // src/components/payload/fields/BlockNumberTextField.tsx
1853
1860
  import { FormControl as FormControl3, FormHelperText as FormHelperText2, TextField as TextField3 } from "@mui/material";
@@ -1878,11 +1885,11 @@ var BlockNumberTextField = /* @__PURE__ */ __name(({ errorMessage, onBlockNumber
1878
1885
  // src/components/payload/fields/XyoAddressTextField.tsx
1879
1886
  import { FormControl as FormControl4, FormHelperText as FormHelperText3, TextField as TextField4 } from "@mui/material";
1880
1887
  import { asAddress } from "@xylabs/hex";
1881
- import React40, { useMemo as useMemo18, useState as useState15 } from "react";
1888
+ import React40, { useMemo as useMemo19, useState as useState15 } from "react";
1882
1889
  var XyoAddressTextField = /* @__PURE__ */ __name(({ onAddressChanged, onChange, resetValue, ...props }) => {
1883
1890
  const [address, setAddress] = useState15("");
1884
1891
  const [addressError, setAddressError] = useState15();
1885
- useMemo18(() => setAddress(""), [
1892
+ useMemo19(() => setAddress(""), [
1886
1893
  resetValue
1887
1894
  ]);
1888
1895
  const handleChange = /* @__PURE__ */ __name((event) => {
@@ -1923,7 +1930,7 @@ var ProducerIntentBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
1923
1930
  const [exp, setExp] = useState16();
1924
1931
  const [nbf, setNbf] = useState16();
1925
1932
  const [blockRangeError, setBlockRangeError] = useState16();
1926
- const intentPayload = useMemo19(() => {
1933
+ const intentPayload = useMemo20(() => {
1927
1934
  if (exp !== void 0 && nbf !== void 0) {
1928
1935
  if (exp <= nbf) {
1929
1936
  setBlockRangeError(new Error("Expires must be greater than Not Before"));
@@ -1982,7 +1989,7 @@ import React44 from "react";
1982
1989
  // src/components/payload/builder/transfer/Form.tsx
1983
1990
  import { Button as Button6, FormControl as FormControl7 } from "@mui/material";
1984
1991
  import { TransferSchema } from "@xyo-network/xl1-model";
1985
- import React43, { useMemo as useMemo21, useState as useState18 } from "react";
1992
+ import React43, { useMemo as useMemo22, useState as useState18 } from "react";
1986
1993
 
1987
1994
  // src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
1988
1995
  import { RemoveCircle } from "@mui/icons-material";
@@ -1990,11 +1997,11 @@ import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 }
1990
1997
  import { toHex as toHex3 } from "@xylabs/hex";
1991
1998
  import { FlexRow as FlexRow8 } from "@xylabs/react-flexbox";
1992
1999
  import { BigIntInput } from "@xyo-network/react-shared";
1993
- import React42, { useEffect as useEffect4, useMemo as useMemo20, useState as useState17 } from "react";
2000
+ import React42, { useEffect as useEffect4, useMemo as useMemo21, useState as useState17 } from "react";
1994
2001
  var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated, onRemoveTransfer, singleTransfer, ...props }) => {
1995
2002
  const [toAddress, setToAddress] = useState17();
1996
2003
  const [amount, setAmount] = useState17();
1997
- const transferAmount = useMemo20(() => {
2004
+ const transferAmount = useMemo21(() => {
1998
2005
  if (toAddress && amount) {
1999
2006
  return {
2000
2007
  ...singleTransfer,
@@ -2040,7 +2047,7 @@ var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated,
2040
2047
  var TransferBuilderForm = /* @__PURE__ */ __name(({ onBuild }) => {
2041
2048
  const [fromAddress, setFromAddress] = useState18();
2042
2049
  const [transfers, setTransfers] = useState18([]);
2043
- const transferPayload = useMemo21(() => {
2050
+ const transferPayload = useMemo22(() => {
2044
2051
  if (fromAddress && transfers.length > 0) {
2045
2052
  const transfersRecord = {};
2046
2053
  for (const transfer of transfers) {