@xyo-network/react-chain-blockchain 1.0.11 → 1.0.13

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.
@@ -144,7 +144,9 @@ var useChainPollingContext = /* @__PURE__ */ __name((required = false) => useCon
144
144
 
145
145
  // src/components/transactions/submit/Builder.tsx
146
146
  import { Button, FormControl, TextField } from "@mui/material";
147
+ import { toHex } from "@xylabs/hex";
147
148
  import { FlexCol } from "@xylabs/react-flexbox";
149
+ import { defaultFees } from "@xyo-network/chain-protocol";
148
150
  import React4 from "react";
149
151
  var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
150
152
  const handleSubmit = /* @__PURE__ */ __name(async (event) => {
@@ -152,9 +154,14 @@ var ChainTransactionBuilder = /* @__PURE__ */ __name(({ onSubmitTx }) => {
152
154
  const formData = new FormData(event.currentTarget);
153
155
  const chainTx = {
154
156
  chain: formData.get("chain"),
155
- gas: formData.get("gas"),
156
157
  nbf: Number.parseInt(formData.get("nbf")),
157
158
  exp: Number.parseInt(formData.get("exp")),
159
+ fees: {
160
+ gasLimit: toHex(defaultFees.gasLimit),
161
+ gasPrice: toHex(defaultFees.gasPrice),
162
+ base: toHex(defaultFees.base),
163
+ priority: toHex(defaultFees.priority)
164
+ },
158
165
  nonce: []
159
166
  };
160
167
  await onSubmitTx?.(chainTx);
@@ -239,14 +246,15 @@ import { buildTransaction } from "@xyo-network/chain-protocol";
239
246
  import { PayloadBuilder } from "@xyo-network/payload-builder";
240
247
  import React6, { useState as useState5 } from "react";
241
248
  var BETA_PENDING_TRANSACTIONS_ARCHIVIST = "https://beta.api.chain.xyo.network/8050fee682a2762f504d5449d8269a6f17f0b693";
249
+ var defaultNetwork = new URL(BETA_PENDING_TRANSACTIONS_ARCHIVIST);
242
250
  var SubmitChainTransaction = /* @__PURE__ */ __name(() => {
243
- const [network, setNetwork] = useState5(new URL(BETA_PENDING_TRANSACTIONS_ARCHIVIST));
251
+ const [network, setNetwork] = useState5(defaultNetwork);
244
252
  const [result, setResult] = useState5();
245
253
  const [error, setError] = useState5();
246
254
  const onSubmitTx = /* @__PURE__ */ __name(async (chainTx) => {
247
255
  if (!network) throw new Error("Network not set");
248
256
  const randomAccount = await Account.random();
249
- const [transactionBoundWitness] = await buildTransaction(chainTx.chain, [], BigInt(`0x${chainTx.gas}`), randomAccount, chainTx.nbf, chainTx.exp, []);
257
+ const [transactionBoundWitness] = await buildTransaction(chainTx.chain, [], randomAccount, chainTx.nbf, chainTx.exp, []);
250
258
  const insertQuery = new PayloadBuilder({
251
259
  schema: ArchivistInsertQuerySchema
252
260
  }).build();
@@ -871,6 +879,7 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({
871
879
  block,
872
880
  defaultExpanded,
873
881
  linked,
882
+ sx,
874
883
  ...props
875
884
  }) => {
876
885
  const linkedTableCellProps = useMemo8(() => ({
@@ -885,7 +894,13 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({
885
894
  }), [
886
895
  block
887
896
  ]);
888
- return /* @__PURE__ */ React22.createElement(TableRow2, props, /* @__PURE__ */ React22.createElement(BlockHashTableCell, defaultTableCellProps), /* @__PURE__ */ React22.createElement(BlockNumberTableCell, linkedTableCellProps), /* @__PURE__ */ React22.createElement(BlockTransactionCountTableCell, linkedTableCellProps), /* @__PURE__ */ React22.createElement(BlockProducerTableCell, defaultTableCellProps), /* @__PURE__ */ React22.createElement(BlockVerificationTableCell, defaultTableCellProps), /* @__PURE__ */ React22.createElement(BlockJsonViewTableCell, defaultTableCellProps));
897
+ return /* @__PURE__ */ React22.createElement(TableRow2, {
898
+ sx: {
899
+ overflowY: "scroll",
900
+ ...sx
901
+ },
902
+ ...props
903
+ }, /* @__PURE__ */ React22.createElement(BlockHashTableCell, defaultTableCellProps), /* @__PURE__ */ React22.createElement(BlockNumberTableCell, linkedTableCellProps), /* @__PURE__ */ React22.createElement(BlockTransactionCountTableCell, linkedTableCellProps), /* @__PURE__ */ React22.createElement(BlockProducerTableCell, defaultTableCellProps), /* @__PURE__ */ React22.createElement(BlockVerificationTableCell, defaultTableCellProps), /* @__PURE__ */ React22.createElement(BlockJsonViewTableCell, defaultTableCellProps));
889
904
  }, "BlockChainTableRow");
890
905
 
891
906
  // src/components/chain/controls/PollingControlsFlexbox.tsx
@@ -1319,7 +1334,7 @@ import { usePromise as usePromise4 } from "@xylabs/react-promise";
1319
1334
  import { useEffect as useEffect3, useMemo as useMemo11, useRef as useRef3, useSyncExternalStore } from "react";
1320
1335
 
1321
1336
  // src/hooks/chain-iterator/useChainIteratorUpdatingHead.ts
1322
- import { toHex } from "@xylabs/hex";
1337
+ import { toHex as toHex2 } from "@xylabs/hex";
1323
1338
  import { findMostRecentBlock } from "@xyo-network/chain-protocol";
1324
1339
  import { useEffect as useEffect2, useState as useState12 } from "react";
1325
1340
  var useChainIteratorUpdatingHead = /* @__PURE__ */ __name(({ chainIterator, interval = 500, maxBlocks, chainArchivist }) => {
@@ -1335,10 +1350,10 @@ var useChainIteratorUpdatingHead = /* @__PURE__ */ __name(({ chainIterator, inte
1335
1350
  const currentBlockNumber = currentHead?.block ?? -1;
1336
1351
  const nextBlockNumber = mostRecentBlock.block;
1337
1352
  if (nextBlockNumber > currentBlockNumber) {
1338
- console.debug("Found more recent head:", toHex(nextBlockNumber));
1339
- console.debug("Updating head:", `${toHex(nextBlockNumber)}`);
1353
+ console.debug("Found more recent head:", toHex2(nextBlockNumber));
1354
+ console.debug("Updating head:", `${toHex2(nextBlockNumber)}`);
1340
1355
  await chainIterator.updateHead(mostRecentBlock);
1341
- console.debug("Updated head:", `${toHex(nextBlockNumber)}`);
1356
+ console.debug("Updated head:", `${toHex2(nextBlockNumber)}`);
1342
1357
  }
1343
1358
  }
1344
1359
  } catch (e) {
@@ -1854,7 +1869,7 @@ import React41, { useMemo as useMemo20, useState as useState18 } from "react";
1854
1869
  // src/components/payload/builder/transfer/builder/SingleFlexbox.tsx
1855
1870
  import { RemoveCircle } from "@mui/icons-material";
1856
1871
  import { FormControl as FormControl6, Icon as Icon3, IconButton as IconButton5 } from "@mui/material";
1857
- import { toHex as toHex2 } from "@xylabs/hex";
1872
+ import { toHex as toHex3 } from "@xylabs/hex";
1858
1873
  import { FlexRow as FlexRow7 } from "@xylabs/react-flexbox";
1859
1874
  import { BigIntInput } from "@xyo-network/react-shared";
1860
1875
  import React40, { useEffect as useEffect4, useMemo as useMemo19, useState as useState17 } from "react";
@@ -1865,7 +1880,7 @@ var SingleTransferBuilderFlexbox = /* @__PURE__ */ __name(({ onTransferUpdated,
1865
1880
  if (toAddress && amount) {
1866
1881
  return {
1867
1882
  ...singleTransfer,
1868
- amount: toHex2(amount),
1883
+ amount: toHex3(amount),
1869
1884
  to: toAddress
1870
1885
  };
1871
1886
  }
@@ -2043,7 +2058,7 @@ var ChainArchivistDecorator = /* @__PURE__ */ __name((Story, context) => {
2043
2058
  }
2044
2059
  }
2045
2060
  };
2046
- return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React43.createElement(Story, props) : /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(CircularProgress, null));
2061
+ return blockChainRenderProps?.chainArchivist ? /* @__PURE__ */ React43.createElement(Story, props) : /* @__PURE__ */ React43.createElement(CircularProgress, null);
2047
2062
  }, "ChainArchivistDecorator");
2048
2063
 
2049
2064
  // src/stories/ChainArchivistDelayedInsertDecorator.tsx