@xyo-network/react-chain-blockchain 1.16.12 → 1.16.14

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.
Files changed (43) hide show
  1. package/dist/browser/components/account/BalanceHistoryFlexbox.d.ts.map +1 -1
  2. package/dist/browser/components/account/helpers/formatBalanceMagnitude.d.ts +3 -0
  3. package/dist/browser/components/account/helpers/formatBalanceMagnitude.d.ts.map +1 -0
  4. package/dist/browser/components/account/helpers/index.d.ts +2 -0
  5. package/dist/browser/components/account/helpers/index.d.ts.map +1 -0
  6. package/dist/browser/components/account/index.d.ts +1 -0
  7. package/dist/browser/components/account/index.d.ts.map +1 -1
  8. package/dist/browser/components/account/table/BalanceHistoryTableEx.d.ts +9 -0
  9. package/dist/browser/components/account/table/BalanceHistoryTableEx.d.ts.map +1 -0
  10. package/dist/browser/components/account/table/{BalanceHistoryTable.stories.d.ts → BalanceHistoryTableEx.stories.d.ts} +3 -3
  11. package/dist/browser/components/account/table/BalanceHistoryTableEx.stories.d.ts.map +1 -0
  12. package/dist/browser/components/account/table/BalanceHistoryTableRow.d.ts.map +1 -1
  13. package/dist/browser/components/account/table/cell/AddressTableCell.d.ts.map +1 -0
  14. package/dist/browser/components/account/table/cell/HashTableCell.d.ts +9 -0
  15. package/dist/browser/components/account/table/cell/HashTableCell.d.ts.map +1 -0
  16. package/dist/browser/components/account/table/cell/index.d.ts +3 -0
  17. package/dist/browser/components/account/table/cell/index.d.ts.map +1 -0
  18. package/dist/browser/components/account/table/index.d.ts +2 -2
  19. package/dist/browser/components/account/table/index.d.ts.map +1 -1
  20. package/dist/browser/components/account/table/types/index.d.ts +1 -1
  21. package/dist/browser/components/account/table/types/index.d.ts.map +1 -1
  22. package/dist/browser/index.mjs +98 -65
  23. package/dist/browser/index.mjs.map +1 -1
  24. package/dist/browser/stories/ChainArchivistDelayedInsertDecorator.d.ts.map +1 -1
  25. package/package.json +25 -25
  26. package/src/components/account/BalanceHistoryFlexbox.tsx +4 -16
  27. package/src/components/account/helpers/formatBalanceMagnitude.ts +14 -0
  28. package/src/components/account/helpers/index.ts +1 -0
  29. package/src/components/account/index.ts +1 -0
  30. package/src/components/account/table/{BalanceHistoryTable.stories.tsx → BalanceHistoryTableEx.stories.tsx} +7 -7
  31. package/src/components/account/table/{BalanceHistoryTable.tsx → BalanceHistoryTableEx.tsx} +7 -6
  32. package/src/components/account/table/BalanceHistoryTableRow.tsx +4 -2
  33. package/src/components/account/table/{AddressTableCell.tsx → cell/AddressTableCell.tsx} +1 -1
  34. package/src/components/account/table/cell/HashTableCell.tsx +44 -0
  35. package/src/components/account/table/cell/index.ts +2 -0
  36. package/src/components/account/table/index.ts +2 -2
  37. package/src/components/account/table/types/index.ts +1 -1
  38. package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +3 -2
  39. package/dist/browser/components/account/table/AddressTableCell.d.ts.map +0 -1
  40. package/dist/browser/components/account/table/BalanceHistoryTable.d.ts +0 -9
  41. package/dist/browser/components/account/table/BalanceHistoryTable.d.ts.map +0 -1
  42. package/dist/browser/components/account/table/BalanceHistoryTable.stories.d.ts.map +0 -1
  43. /package/dist/browser/components/account/table/{AddressTableCell.d.ts → cell/AddressTableCell.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"BalanceHistoryFlexbox.d.ts","sourceRoot":"","sources":["../../../../src/components/account/BalanceHistoryFlexbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAK7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,iCAAkC,SAAQ,YAAY;IACrE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CA6CpF,CAAA"}
1
+ {"version":3,"file":"BalanceHistoryFlexbox.d.ts","sourceRoot":"","sources":["../../../../src/components/account/BalanceHistoryFlexbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAK7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,WAAW,iCAAkC,SAAQ,YAAY;IACrE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CAgCpF,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { type AttoXL1 } from '@xyo-network/xl1-protocol';
2
+ export declare const formatBalanceMagnitude: (set: [AttoXL1, AttoXL1]) => string;
3
+ //# sourceMappingURL=formatBalanceMagnitude.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatBalanceMagnitude.d.ts","sourceRoot":"","sources":["../../../../../src/components/account/helpers/formatBalanceMagnitude.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAa,MAAM,2BAA2B,CAAA;AAEnE,eAAO,MAAM,sBAAsB,GAAI,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,WAI7D,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './formatBalanceMagnitude.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/account/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
@@ -1,3 +1,4 @@
1
1
  export * from './BalanceHistoryFlexbox.tsx';
2
+ export * from './helpers/index.ts';
2
3
  export * from './table/index.ts';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/account/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/account/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { AccountBalanceHistoryItemFormatted } from '@xyo-network/react-chain-provider';
2
+ import type { TableExProps } from '@xyo-network/react-table';
3
+ import React from 'react';
4
+ export interface AccountBalanceHistoryTableExProps extends TableExProps {
5
+ history?: AccountBalanceHistoryItemFormatted[];
6
+ linked?: boolean;
7
+ }
8
+ export declare const AccountBalanceHistoryTableEx: React.FC<AccountBalanceHistoryTableExProps>;
9
+ //# sourceMappingURL=BalanceHistoryTableEx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BalanceHistoryTableEx.d.ts","sourceRoot":"","sources":["../../../../../src/components/account/table/BalanceHistoryTableEx.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAA;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,MAAM,WAAW,iCAAkC,SAAQ,YAAY;IACrE,OAAO,CAAC,EAAE,kCAAkC,EAAE,CAAA;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CAmBpF,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import type { Meta } from '@storybook/react-vite';
2
2
  declare const _default: Meta;
3
3
  export default _default;
4
- declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./BalanceHistoryTable.tsx").AccountBalanceHistoryTableProps>;
5
- declare const WithLinked: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./BalanceHistoryTable.tsx").AccountBalanceHistoryTableProps>;
4
+ declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./BalanceHistoryTableEx.tsx").AccountBalanceHistoryTableExProps>;
5
+ declare const WithLinked: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, import("./BalanceHistoryTableEx.tsx").AccountBalanceHistoryTableExProps>;
6
6
  export { Default, WithLinked };
7
- //# sourceMappingURL=BalanceHistoryTable.stories.d.ts.map
7
+ //# sourceMappingURL=BalanceHistoryTableEx.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BalanceHistoryTableEx.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/account/table/BalanceHistoryTableEx.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;wBAcrD,IAAI;AAHT,wBAGS;AAmDT,QAAA,MAAM,OAAO,sKAAoB,CAAA;AAGjC,QAAA,MAAM,UAAU,sKAA0B,CAAA;AAG1C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"BalanceHistoryTableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/account/table/BalanceHistoryTableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,EACgB,KAAK,aAAa,EACxC,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAA;AAS3F,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,kCAAkC,CAAA;CACxC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAuBxE,CAAA"}
1
+ {"version":3,"file":"BalanceHistoryTableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/account/table/BalanceHistoryTableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,EACgB,KAAK,aAAa,EACxC,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAA;AAW3F,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,kCAAkC,CAAA;CACxC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAuBxE,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddressTableCell.d.ts","sourceRoot":"","sources":["../../../../../../src/components/account/table/cell/AddressTableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAMnD,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAY5D,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { TableCellProps } from '@mui/material';
2
+ import { type Hash } from '@xylabs/sdk-js';
3
+ export interface HashTableCellProps extends TableCellProps {
4
+ hash?: Hash;
5
+ linked?: boolean;
6
+ toolTipTitle?: string;
7
+ }
8
+ export declare const HashTableCell: React.FC<HashTableCellProps>;
9
+ //# sourceMappingURL=HashTableCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HashTableCell.d.ts","sourceRoot":"","sources":["../../../../../../src/components/account/table/cell/HashTableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAKnD,OAAO,EACM,KAAK,IAAI,EACrB,MAAM,gBAAgB,CAAA;AAKvB,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAyBtD,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './AddressTableCell.tsx';
2
+ export * from './HashTableCell.tsx';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/account/table/cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA"}
@@ -1,5 +1,5 @@
1
- export * from './AddressTableCell.tsx';
2
- export * from './BalanceHistoryTable.tsx';
1
+ export * from './BalanceHistoryTableEx.tsx';
3
2
  export * from './BalanceHistoryTableRow.tsx';
3
+ export * from './cell/index.ts';
4
4
  export * from './types/index.ts';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/account/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/account/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import type { AccountBalanceHistoryItemFormatted } from '@xyo-network/react-chain-provider';
2
2
  import type { ExtendEventNoun } from '@xyo-network/react-event';
3
- export type BalanceHistoryEventNouns = ExtendEventNoun<'amount' | 'blockNumber'>;
3
+ export type BalanceHistoryEventNouns = ExtendEventNoun<'amount' | 'blockNumber' | 'tx-hash'>;
4
4
  export type TableHeadingLabels = 'Tx Hash' | 'BlockNumber' | 'Timestamp' | 'From' | 'To' | 'Amount' | 'Debug';
5
5
  export type TableHeadings = {
6
6
  [key in keyof AccountBalanceHistoryItemFormatted]: TableHeadingLabels;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/account/table/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,QAAQ,GAAG,aAAa,CAAC,CAAA;AAEhF,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAA;AAC7G,MAAM,MAAM,aAAa,GAAG;KAAG,GAAG,IAAI,MAAM,kCAAkC,GAAG,kBAAkB;CAAE,CAAA;AAErG,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,EAQzC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/account/table/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAC,CAAA;AAE5F,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAA;AAC7G,MAAM,MAAM,aAAa,GAAG;KAAG,GAAG,IAAI,MAAM,kCAAkC,GAAG,kBAAkB;CAAE,CAAA;AAErG,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,EAQzC,CAAA"}
@@ -2,17 +2,42 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
4
  // src/components/account/BalanceHistoryFlexbox.tsx
5
- import { Typography as Typography6 } from "@mui/material";
5
+ import { Typography as Typography7 } from "@mui/material";
6
6
  import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
7
- import { isDefined as isDefined6 } from "@xylabs/sdk-js";
7
+ import { isDefined as isDefined7 } from "@xylabs/sdk-js";
8
8
  import { useAccountBalanceHistory } from "@xyo-network/react-chain-provider";
9
9
  import { ErrorRender as ErrorRender3 } from "@xyo-network/react-error";
10
- import { AttoXL1, XL1Amount as XL1Amount2 } from "@xyo-network/xl1-protocol";
10
+ import { AttoXL1 } from "@xyo-network/xl1-protocol";
11
11
  import React28 from "react";
12
12
 
13
- // src/components/account/table/AddressTableCell.tsx
14
- import { TableCell as TableCell10, Tooltip as Tooltip8 } from "@mui/material";
15
- import { useEvent as useEvent4 } from "@xyo-network/react-event";
13
+ // src/components/account/helpers/formatBalanceMagnitude.ts
14
+ import { XL1Amount } from "@xyo-network/xl1-protocol";
15
+ var formatBalanceMagnitude = /* @__PURE__ */ __name((set) => {
16
+ const [received, sent] = set;
17
+ const netBalance = received - sent;
18
+ return netBalance < 0n ? `-${formatBalance(sent - received)}` : formatBalance(netBalance);
19
+ }, "formatBalanceMagnitude");
20
+ var formatBalance = /* @__PURE__ */ __name((balance) => {
21
+ const xl1Amount = new XL1Amount(balance);
22
+ return xl1Amount.toString(void 0, {
23
+ places: 18,
24
+ maxDecimal: 12,
25
+ maxCharacters: 12,
26
+ minDecimals: 1,
27
+ locale: navigator.language
28
+ });
29
+ }, "formatBalance");
30
+
31
+ // src/components/account/table/BalanceHistoryTableEx.tsx
32
+ import { TableBody as TableBody2, TableCell as TableCell14, TableHead as TableHead2, TableRow as TableRow4 } from "@mui/material";
33
+ import { isDefined as isDefined6 } from "@xylabs/sdk-js";
34
+ import { TableEx as TableEx2 } from "@xyo-network/react-table";
35
+ import React27 from "react";
36
+
37
+ // src/components/account/table/BalanceHistoryTableRow.tsx
38
+ import { TableCell as TableCell13, TableRow as TableRow3 } from "@mui/material";
39
+ import { RawInfoIconButton } from "@xyo-network/react-payload-raw-info";
40
+ import { useMemo as useMemo10 } from "react";
16
41
 
17
42
  // src/components/block/BlockHeadingFlexbox.tsx
18
43
  import { FlexCol as FlexCol2, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
@@ -1388,7 +1413,9 @@ var BlockChainTableRow = /* @__PURE__ */ __name(({ block, deepValidation, defaul
1388
1413
  }), /* @__PURE__ */ React26.createElement(BlockJsonViewTableCell, defaultTableCellProps));
1389
1414
  }, "BlockChainTableRow");
1390
1415
 
1391
- // src/components/account/table/AddressTableCell.tsx
1416
+ // src/components/account/table/cell/AddressTableCell.tsx
1417
+ import { TableCell as TableCell10, Tooltip as Tooltip8 } from "@mui/material";
1418
+ import { useEvent as useEvent4 } from "@xyo-network/react-event";
1392
1419
  var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle, sx, ...props }) => {
1393
1420
  const [ref, dispatch] = useEvent4();
1394
1421
  const handleClick = /* @__PURE__ */ __name(() => dispatch("address", "click", address), "handleClick");
@@ -1407,29 +1434,43 @@ var AddressTableCell = /* @__PURE__ */ __name(({ address, linked, toolTipTitle,
1407
1434
  })));
1408
1435
  }, "AddressTableCell");
1409
1436
 
1410
- // src/components/account/table/BalanceHistoryTable.tsx
1411
- import { Table, TableBody as TableBody2, TableCell as TableCell13, TableHead as TableHead2, TableRow as TableRow4 } from "@mui/material";
1412
- import { isDefined as isDefined5 } from "@xylabs/sdk-js";
1413
- import React27 from "react";
1414
-
1415
- // src/components/account/table/BalanceHistoryTableRow.tsx
1416
- import { TableCell as TableCell12, TableRow as TableRow3 } from "@mui/material";
1417
- import { RawInfoIconButton } from "@xyo-network/react-payload-raw-info";
1418
- import { useMemo as useMemo10 } from "react";
1437
+ // src/components/account/table/cell/HashTableCell.tsx
1438
+ import { Link as Link5, TableCell as TableCell11, Tooltip as Tooltip9, Typography as Typography6 } from "@mui/material";
1439
+ import { ellipsize as ellipsize2, isDefined as isDefined4 } from "@xylabs/sdk-js";
1440
+ import { useEvent as useEvent5 } from "@xyo-network/react-event";
1441
+ var HashTableCell = /* @__PURE__ */ __name(({ hash, linked, toolTipTitle, sx, ...props }) => {
1442
+ const [ref, dispatch] = useEvent5();
1443
+ const handleClick = /* @__PURE__ */ __name(() => dispatch("tx-hash", "click", hash), "handleClick");
1444
+ const shortenedHash = isDefined4(hash) ? ellipsize2(hash, 6) : "N/A";
1445
+ return /* @__PURE__ */ React.createElement(TableCell11, {
1446
+ ref,
1447
+ ...props
1448
+ }, hash ? /* @__PURE__ */ React.createElement(Tooltip9, {
1449
+ title: toolTipTitle
1450
+ }, /* @__PURE__ */ React.createElement(Typography6, {
1451
+ component: "span",
1452
+ variant: "body1"
1453
+ }, linked ? /* @__PURE__ */ React.createElement(Link5, {
1454
+ onClick: handleClick,
1455
+ sx: {
1456
+ cursor: "pointer"
1457
+ }
1458
+ }, shortenedHash) : shortenedHash)) : "N/A");
1459
+ }, "HashTableCell");
1419
1460
 
1420
1461
  // src/components/account/table/RawAmountTableCell.tsx
1421
- import { Link as Link5, TableCell as TableCell11, Tooltip as Tooltip9 } from "@mui/material";
1422
- import { isDefined as isDefined4, toHex as toHex3 } from "@xylabs/sdk-js";
1423
- import { useEvent as useEvent5 } from "@xyo-network/react-event";
1424
- import { XL1Amount } from "@xyo-network/xl1-protocol";
1462
+ import { Link as Link6, TableCell as TableCell12, Tooltip as Tooltip10 } from "@mui/material";
1463
+ import { isDefined as isDefined5, toHex as toHex3 } from "@xylabs/sdk-js";
1464
+ import { useEvent as useEvent6 } from "@xyo-network/react-event";
1465
+ import { XL1Amount as XL1Amount2 } from "@xyo-network/xl1-protocol";
1425
1466
  var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...props }) => {
1426
- const [ref, dispatch] = useEvent5();
1427
- const handleClick = /* @__PURE__ */ __name(() => dispatch("amount", "click", isDefined4(amount) ? toHex3(amount) : ""), "handleClick");
1467
+ const [ref, dispatch] = useEvent6();
1468
+ const handleClick = /* @__PURE__ */ __name(() => dispatch("amount", "click", isDefined5(amount) ? toHex3(amount) : ""), "handleClick");
1428
1469
  const formatAmount = /* @__PURE__ */ __name((amount2) => {
1429
- if (!isDefined4(amount2)) {
1470
+ if (!isDefined5(amount2)) {
1430
1471
  return "N/A";
1431
1472
  }
1432
- const xl1Amount = new XL1Amount(amount2);
1473
+ const xl1Amount = new XL1Amount2(amount2);
1433
1474
  return xl1Amount.toString(void 0, {
1434
1475
  places: 18,
1435
1476
  maxDecimal: 12,
@@ -1438,12 +1479,12 @@ var RawAmountTableCell = /* @__PURE__ */ __name(({ amount, linked, sx, type, ...
1438
1479
  locale: navigator.language
1439
1480
  });
1440
1481
  }, "formatAmount");
1441
- return /* @__PURE__ */ React.createElement(TableCell11, {
1482
+ return /* @__PURE__ */ React.createElement(TableCell12, {
1442
1483
  ref,
1443
1484
  ...props
1444
- }, /* @__PURE__ */ React.createElement(Tooltip9, {
1485
+ }, /* @__PURE__ */ React.createElement(Tooltip10, {
1445
1486
  title: `Raw Amount: ${amount}`
1446
- }, linked ? /* @__PURE__ */ React.createElement(Link5, {
1487
+ }, linked ? /* @__PURE__ */ React.createElement(Link6, {
1447
1488
  onClick: handleClick,
1448
1489
  sx: {
1449
1490
  cursor: "pointer"
@@ -1462,7 +1503,11 @@ var BalanceHistoryTableRow = /* @__PURE__ */ __name(({ linked, row, ...props })
1462
1503
  return /* @__PURE__ */ React.createElement(TableRow3, {
1463
1504
  key,
1464
1505
  ...props
1465
- }, /* @__PURE__ */ React.createElement(TableCell12, null, txHash || "N/A"), /* @__PURE__ */ React.createElement(BlockNumberTableCellInner, {
1506
+ }, /* @__PURE__ */ React.createElement(HashTableCell, {
1507
+ hash: txHash,
1508
+ toolTipTitle: `Transaction Hash: ${txHash}`,
1509
+ ...linkedTableCallProps
1510
+ }), /* @__PURE__ */ React.createElement(BlockNumberTableCellInner, {
1466
1511
  blockNumber,
1467
1512
  ...linkedTableCallProps
1468
1513
  }), /* @__PURE__ */ React.createElement(BlockEpochTableCellInner, {
@@ -1479,7 +1524,7 @@ var BalanceHistoryTableRow = /* @__PURE__ */ __name(({ linked, row, ...props })
1479
1524
  }), /* @__PURE__ */ React.createElement(RawAmountTableCell, {
1480
1525
  amount,
1481
1526
  type
1482
- }), /* @__PURE__ */ React.createElement(TableCell12, null, /* @__PURE__ */ React.createElement(RawInfoIconButton, {
1527
+ }), /* @__PURE__ */ React.createElement(TableCell13, null, /* @__PURE__ */ React.createElement(RawInfoIconButton, {
1483
1528
  rawValue: debug
1484
1529
  })));
1485
1530
  }, "BalanceHistoryTableRow");
@@ -1495,16 +1540,16 @@ var TableHeadingLabels = [
1495
1540
  "Debug"
1496
1541
  ];
1497
1542
 
1498
- // src/components/account/table/BalanceHistoryTable.tsx
1499
- var AccountBalanceHistoryTable = /* @__PURE__ */ __name(({ history, linked, ...props }) => {
1500
- return isDefined5(history) ? /* @__PURE__ */ React27.createElement(Table, props, /* @__PURE__ */ React27.createElement(TableHead2, null, /* @__PURE__ */ React27.createElement(TableRow4, null, TableHeadingLabels.map((heading) => /* @__PURE__ */ React27.createElement(TableCell13, {
1543
+ // src/components/account/table/BalanceHistoryTableEx.tsx
1544
+ var AccountBalanceHistoryTableEx = /* @__PURE__ */ __name(({ history, linked, ...props }) => {
1545
+ return isDefined6(history) ? /* @__PURE__ */ React27.createElement(TableEx2, props, /* @__PURE__ */ React27.createElement(TableHead2, null, /* @__PURE__ */ React27.createElement(TableRow4, null, TableHeadingLabels.map((heading) => /* @__PURE__ */ React27.createElement(TableCell14, {
1501
1546
  key: heading
1502
1547
  }, heading)))), /* @__PURE__ */ React27.createElement(TableBody2, null, history?.map((row) => /* @__PURE__ */ React27.createElement(BalanceHistoryTableRow, {
1503
1548
  key: row.key,
1504
1549
  linked,
1505
1550
  row
1506
1551
  })))) : null;
1507
- }, "AccountBalanceHistoryTable");
1552
+ }, "AccountBalanceHistoryTableEx");
1508
1553
 
1509
1554
  // src/components/account/BalanceHistoryFlexbox.tsx
1510
1555
  var AccountBalanceHistoryFlexBox = /* @__PURE__ */ __name(({ address, refresh, viewer, ...props }) => {
@@ -1516,38 +1561,23 @@ var AccountBalanceHistoryFlexBox = /* @__PURE__ */ __name(({ address, refresh, v
1516
1561
  ],
1517
1562
  history: void 0
1518
1563
  };
1519
- const formatBalance = /* @__PURE__ */ __name((balance2) => {
1520
- const xl1Amount = new XL1Amount2(balance2);
1521
- return xl1Amount.toString(void 0, {
1522
- places: 18,
1523
- maxDecimal: 12,
1524
- maxCharacters: 12,
1525
- minDecimals: 1,
1526
- locale: navigator.language
1527
- });
1528
- }, "formatBalance");
1529
- const formatBalanceMagnitude = /* @__PURE__ */ __name((set) => {
1530
- const [received, sent] = set;
1531
- const netBalance = received - sent;
1532
- return netBalance < 0n ? `-${formatBalance(sent - received)}` : formatBalance(netBalance);
1533
- }, "formatBalanceMagnitude");
1534
- return isDefined6(history) && isDefined6(address) ? /* @__PURE__ */ React28.createElement(FlexCol3, props, /* @__PURE__ */ React28.createElement(ErrorRender3, {
1564
+ return isDefined7(history) && isDefined7(address) ? /* @__PURE__ */ React28.createElement(FlexCol3, props, /* @__PURE__ */ React28.createElement(ErrorRender3, {
1535
1565
  error,
1536
1566
  scope: "AccountBalanceHistoryTable"
1537
- }), /* @__PURE__ */ React28.createElement(Typography6, {
1567
+ }), /* @__PURE__ */ React28.createElement(Typography7, {
1538
1568
  variant: "h6",
1539
1569
  gutterBottom: true
1540
- }, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */ React28.createElement(Typography6, {
1570
+ }, formatBalanceMagnitude(balance)), truncated ? /* @__PURE__ */ React28.createElement(Typography7, {
1541
1571
  variant: "caption",
1542
1572
  gutterBottom: true
1543
- }, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */ React28.createElement(AccountBalanceHistoryTable, {
1573
+ }, "Ranged Balance from", " ", history.at(-1).blockNumber, " ", "-", " ", history[0].blockNumber) : null, /* @__PURE__ */ React28.createElement(AccountBalanceHistoryTableEx, {
1544
1574
  history
1545
1575
  })) : null;
1546
1576
  }, "AccountBalanceHistoryFlexBox");
1547
1577
 
1548
1578
  // src/components/chain/controls/PollingControlsFlexbox.tsx
1549
1579
  import { Autorenew, Pause } from "@mui/icons-material";
1550
- import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip10 } from "@mui/material";
1580
+ import { Alert as Alert3, AlertTitle as AlertTitle2, Grow, Icon as Icon2, IconButton as IconButton4, Tooltip as Tooltip11 } from "@mui/material";
1551
1581
  import { FlexRow as FlexRow6 } from "@xylabs/react-flexbox";
1552
1582
  import React33, { memo } from "react";
1553
1583
 
@@ -1557,21 +1587,21 @@ import { Dialog as Dialog3, DialogContent as DialogContent3, DialogTitle as Dial
1557
1587
  import React31, { useState as useState12 } from "react";
1558
1588
 
1559
1589
  // src/components/chain/stats/producer/ProducerFlexbox.tsx
1560
- import { ListItem, styled, Typography as Typography7 } from "@mui/material";
1590
+ import { ListItem, styled, Typography as Typography8 } from "@mui/material";
1561
1591
  import { ErrorRender as ErrorRender4 } from "@xylabs/react-error";
1562
1592
  import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
1563
1593
  import { isChainSummaryProducers } from "@xyo-network/chain-analyze";
1564
1594
  import React30, { useMemo as useMemo11 } from "react";
1565
1595
 
1566
1596
  // src/components/chain/stats/producer/Table.tsx
1567
- import { Table as Table2, TableBody as TableBody3, TableCell as TableCell14, TableHead as TableHead3, TableRow as TableRow5, useTheme as useTheme2 } from "@mui/material";
1597
+ import { Table, TableBody as TableBody3, TableCell as TableCell15, TableHead as TableHead3, TableRow as TableRow5, useTheme as useTheme2 } from "@mui/material";
1568
1598
  import { BlockiesAvatar as BlockiesAvatar2 } from "@xyo-network/react-chain-blockies";
1569
1599
  import React29 from "react";
1570
1600
  var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) => {
1571
1601
  const theme = useTheme2();
1572
- return /* @__PURE__ */ React29.createElement(Table2, props, /* @__PURE__ */ React29.createElement(TableHead3, null, /* @__PURE__ */ React29.createElement(TableRow5, null, /* @__PURE__ */ React29.createElement(TableCell14, null, "Address"), /* @__PURE__ */ React29.createElement(TableCell14, null, "Blocks Produced"), /* @__PURE__ */ React29.createElement(TableCell14, null, "Rewards Earned Produced"))), /* @__PURE__ */ React29.createElement(TableBody3, null, producers?.map((producer) => /* @__PURE__ */ React29.createElement(TableRow5, {
1602
+ return /* @__PURE__ */ React29.createElement(Table, props, /* @__PURE__ */ React29.createElement(TableHead3, null, /* @__PURE__ */ React29.createElement(TableRow5, null, /* @__PURE__ */ React29.createElement(TableCell15, null, "Address"), /* @__PURE__ */ React29.createElement(TableCell15, null, "Blocks Produced"), /* @__PURE__ */ React29.createElement(TableCell15, null, "Rewards Earned Produced"))), /* @__PURE__ */ React29.createElement(TableBody3, null, producers?.map((producer) => /* @__PURE__ */ React29.createElement(TableRow5, {
1573
1603
  key: producer.address
1574
- }, /* @__PURE__ */ React29.createElement(TableCell14, null, /* @__PURE__ */ React29.createElement(BlockiesAvatar2, {
1604
+ }, /* @__PURE__ */ React29.createElement(TableCell15, null, /* @__PURE__ */ React29.createElement(BlockiesAvatar2, {
1575
1605
  blockiesOptions: {
1576
1606
  seed: producer.address
1577
1607
  },
@@ -1579,7 +1609,7 @@ var ChainProducerStatsTable = /* @__PURE__ */ __name(({ producers, ...props }) =
1579
1609
  height: theme.spacing(2.75),
1580
1610
  width: theme.spacing(2.75)
1581
1611
  }
1582
- })), /* @__PURE__ */ React29.createElement(TableCell14, null, producer.blocksProduced.toString()), /* @__PURE__ */ React29.createElement(TableCell14, null, producer.rewardsEarned.toString())))));
1612
+ })), /* @__PURE__ */ React29.createElement(TableCell15, null, producer.blocksProduced.toString()), /* @__PURE__ */ React29.createElement(TableCell15, null, producer.rewardsEarned.toString())))));
1583
1613
  }, "ChainProducerStatsTable");
1584
1614
 
1585
1615
  // src/components/chain/stats/producer/ProducerFlexbox.tsx
@@ -1608,7 +1638,7 @@ var BlockProducerStatsFlexbox = /* @__PURE__ */ __name(({ payload, ...props }) =
1608
1638
  }, /* @__PURE__ */ React30.createElement(ErrorRender4, {
1609
1639
  error: producerError,
1610
1640
  scope: "BlockProducerStatsFlexbox"
1611
- }), /* @__PURE__ */ React30.createElement(Typography7, {
1641
+ }), /* @__PURE__ */ React30.createElement(Typography8, {
1612
1642
  fontSize: "1rem"
1613
1643
  }, "Block Producers"), /* @__PURE__ */ React30.createElement(ChainProducerStatsTable, {
1614
1644
  producers: producersArray
@@ -1733,7 +1763,7 @@ var PollingControlsFlexbox = /* @__PURE__ */ __name(({ blocksBehind, pollingStat
1733
1763
  gap: 2
1734
1764
  }, /* @__PURE__ */ React33.createElement(Grow, {
1735
1765
  in: (blocksBehind ?? 0) > 0
1736
- }, /* @__PURE__ */ React33.createElement(Tooltip10, {
1766
+ }, /* @__PURE__ */ React33.createElement(Tooltip11, {
1737
1767
  title: "Click to Re-Sync"
1738
1768
  }, /* @__PURE__ */ React33.createElement(Alert3, {
1739
1769
  sx: {
@@ -2384,12 +2414,13 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
2384
2414
  }, [
2385
2415
  chainArchivist
2386
2416
  ]);
2417
+ const { args } = context;
2387
2418
  const props = {
2388
2419
  ...context,
2389
2420
  args: {
2390
- ...context.args,
2421
+ ...args,
2391
2422
  blockChainRenderProps: {
2392
- ...context.args.blockChainRenderProps,
2423
+ ...args.blockChainRenderProps,
2393
2424
  ...blockChainRenderProps,
2394
2425
  head: randomBlockChain?.[0][0]?._hash
2395
2426
  }
@@ -2400,7 +2431,7 @@ var ChainArchivistDelayedInsertDecorator = /* @__PURE__ */ __name((Story, contex
2400
2431
 
2401
2432
  // src/stories/ChainInfoContextDecorator.tsx
2402
2433
  import { usePromise as usePromise7 } from "@xylabs/react-promise";
2403
- import { assertEx as assertEx5, isDefined as isDefined7 } from "@xylabs/sdk-js";
2434
+ import { assertEx as assertEx5, isDefined as isDefined8 } from "@xylabs/sdk-js";
2404
2435
  import { ChainBlockNumberIterationService as ChainBlockNumberIterationService3 } from "@xyo-network/chain-services";
2405
2436
  import { findFirstMatching } from "@xyo-network/chain-utils";
2406
2437
  import { isBlockBoundWitness as isBlockBoundWitness3 } from "@xyo-network/xl1-protocol";
@@ -2419,7 +2450,7 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
2419
2450
  return await getChainArchivistFromBridge(archivistConfig);
2420
2451
  }, []);
2421
2452
  const [chainIterator] = usePromise7(async () => {
2422
- if (isDefined7(chainArchivist) && isDefined7(chainId)) {
2453
+ if (isDefined8(chainArchivist) && isDefined8(chainId)) {
2423
2454
  const firstMatch = assertEx5(await findFirstMatching(chainArchivist), () => `No head found in archivist: ${chainArchivist.id} `);
2424
2455
  const head = assertEx5(isBlockBoundWitness3(firstMatch) ? firstMatch : void 0, () => `Expected a block bound witness: ${JSON.stringify(firstMatch)}`);
2425
2456
  const chainMap = readPayloadMapFromStore(chainArchivist);
@@ -2440,7 +2471,7 @@ var ChainInfoContextDecorator = /* @__PURE__ */ __name((Story, context) => {
2440
2471
  }, "ChainInfoContextDecorator");
2441
2472
  export {
2442
2473
  AccountBalanceHistoryFlexBox,
2443
- AccountBalanceHistoryTable,
2474
+ AccountBalanceHistoryTableEx,
2444
2475
  AddressTableCell,
2445
2476
  BalanceHistoryTableRow,
2446
2477
  BlockAddressChip,
@@ -2473,6 +2504,7 @@ export {
2473
2504
  ChainTransactionNetwork,
2474
2505
  ChipSkeleton,
2475
2506
  FeatureNotAvailable,
2507
+ HashTableCell,
2476
2508
  MemoizedPollingControlsFlexbox,
2477
2509
  PayloadBuilderFlexbox,
2478
2510
  PollingControlsFlexbox,
@@ -2490,6 +2522,7 @@ export {
2490
2522
  XyoAddressTextField,
2491
2523
  blockProducer,
2492
2524
  buildBlockChainRenderComponent,
2525
+ formatBalanceMagnitude,
2493
2526
  payloadCountsFromBlock,
2494
2527
  resolveDefinedHead,
2495
2528
  useAnchorElement,