@xyo-network/react-chain-blockchain 1.5.11 → 1.5.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.
Files changed (42) hide show
  1. package/dist/browser/index.mjs +256 -173
  2. package/dist/browser/index.mjs.map +1 -1
  3. package/dist/types/components/block/table/cell/Epoch.d.ts +6 -0
  4. package/dist/types/components/block/table/cell/Epoch.d.ts.map +1 -0
  5. package/dist/types/components/block/table/cell/{BlockNumberChip.d.ts → NumberChip.d.ts} +1 -1
  6. package/dist/types/components/block/table/cell/NumberChip.d.ts.map +1 -0
  7. package/dist/types/components/block/table/cell/index.d.ts +1 -0
  8. package/dist/types/components/block/table/cell/index.d.ts.map +1 -1
  9. package/dist/types/components/block/table/cell/lib/index.d.ts +1 -0
  10. package/dist/types/components/block/table/cell/lib/index.d.ts.map +1 -1
  11. package/dist/types/components/block/table/cell/lib/timeFunctions.d.ts +3 -0
  12. package/dist/types/components/block/table/cell/lib/timeFunctions.d.ts.map +1 -0
  13. package/dist/types/components/block/table/head/TableHead.d.ts.map +1 -1
  14. package/dist/types/components/block/table/row/TableRow.d.ts.map +1 -1
  15. package/dist/types/stories/ChainArchivistDecorator.d.ts +1 -1
  16. package/dist/types/stories/ChainArchivistDecorator.d.ts.map +1 -1
  17. package/dist/types/stories/ChainArchivistDelayedInsertDecorator.d.ts +1 -1
  18. package/dist/types/stories/ChainArchivistDelayedInsertDecorator.d.ts.map +1 -1
  19. package/dist/types/stories/ChainInfoContextDecorator.d.ts +1 -1
  20. package/dist/types/stories/ChainInfoContextDecorator.d.ts.map +1 -1
  21. package/package.json +39 -40
  22. package/src/components/block/BlockHeadingFlexbox.stories.tsx +1 -1
  23. package/src/components/block/table/Ex.stories.tsx +1 -1
  24. package/src/components/block/table/cell/Epoch.tsx +30 -0
  25. package/src/components/block/table/cell/index.ts +1 -0
  26. package/src/components/block/table/cell/lib/index.ts +1 -0
  27. package/src/components/block/table/cell/lib/timeFunctions.ts +44 -0
  28. package/src/components/block/table/head/TableHead.tsx +2 -1
  29. package/src/components/block/table/row/TableRow.stories.tsx +1 -1
  30. package/src/components/block/table/row/TableRow.tsx +3 -2
  31. package/src/components/chain/render/dynamic/flexbox/Flexbox.stories.tsx +1 -1
  32. package/src/components/chain/render/dynamic/flexbox/Remote.stories.tsx +1 -1
  33. package/src/components/chain/render/static/flexbox/Flexbox.stories.tsx +1 -1
  34. package/src/components/chain/render/static/table/Ex.stories.tsx +1 -1
  35. package/src/components/payload/builder/producer-intent/Flexbox.stories.tsx +1 -1
  36. package/src/components/payload/builder/transfer/Flexbox.stories.tsx +1 -1
  37. package/src/components/transactions/submit/SubmitChain.stories.tsx +1 -1
  38. package/src/stories/ChainArchivistDecorator.tsx +1 -1
  39. package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +1 -1
  40. package/src/stories/ChainInfoContextDecorator.tsx +1 -1
  41. package/dist/types/components/block/table/cell/BlockNumberChip.d.ts.map +0 -1
  42. /package/src/components/block/table/cell/{BlockNumberChip.tsx → NumberChip.tsx} +0 -0
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { type BlockTableCellProps } from './lib/index.ts';
3
+ export interface BlockEpochTableCellProps extends BlockTableCellProps {
4
+ }
5
+ export declare const BlockEpochTableCell: React.FC<BlockEpochTableCellProps>;
6
+ //# sourceMappingURL=Epoch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Epoch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/Epoch.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EACL,KAAK,mBAAmB,EACzB,MAAM,gBAAgB,CAAA;AAEvB,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;CAAG;AAExE,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAiBlE,CAAA"}
@@ -4,4 +4,4 @@ export interface BlockNumberChipProps extends ChipProps {
4
4
  blockNumber?: number;
5
5
  }
6
6
  export declare const BlockNumberChip: React.FC<BlockNumberChipProps>;
7
- //# sourceMappingURL=BlockNumberChip.d.ts.map
7
+ //# sourceMappingURL=NumberChip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberChip.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/NumberChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAE1D,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export * from './BlockNumber.tsx';
2
+ export * from './Epoch.tsx';
2
3
  export * from './Hash.tsx';
3
4
  export * from './JsonView.tsx';
4
5
  export * from './PayloadCounts.tsx';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export * from './BlockTableCellProps.ts';
2
+ export * from './timeFunctions.ts';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/block/table/cell/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/block/table/cell/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const dateFormat: Intl.DateTimeFormat;
2
+ export declare const timeAgo: (epoch: number, locale?: string) => string | undefined;
3
+ //# sourceMappingURL=timeFunctions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeFunctions.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/block/table/cell/lib/timeFunctions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,qBAOrB,CAAA;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,eAAsC,uBAkC5E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableHead.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/head/TableHead.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAkBzB,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAcvC,CAAA"}
1
+ {"version":3,"file":"TableHead.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/head/TableHead.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAkBzB,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAevC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/row/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAKlD,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAQrE,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB,EAAE,aAAa;IACjF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+BhE,CAAA"}
1
+ {"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/row/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAKlD,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAQrE,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB,EAAE,aAAa;IACjF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAgChE,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { Decorator } from '@storybook/react';
1
+ import type { Decorator } from '@storybook/react-vite';
2
2
  export declare const ChainArchivistDecorator: Decorator;
3
3
  //# sourceMappingURL=ChainArchivistDecorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChainArchivistDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainArchivistDecorator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAWjD,eAAO,MAAM,uBAAuB,EAAE,SA+BrC,CAAA"}
1
+ {"version":3,"file":"ChainArchivistDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainArchivistDecorator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAWtD,eAAO,MAAM,uBAAuB,EAAE,SA+BrC,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { Decorator } from '@storybook/react';
1
+ import type { Decorator } from '@storybook/react-vite';
2
2
  export declare const ChainArchivistDelayedInsertDecorator: Decorator;
3
3
  //# sourceMappingURL=ChainArchivistDelayedInsertDecorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChainArchivistDelayedInsertDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainArchivistDelayedInsertDecorator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAejD,eAAO,MAAM,oCAAoC,EAAE,SAsDlD,CAAA"}
1
+ {"version":3,"file":"ChainArchivistDelayedInsertDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainArchivistDelayedInsertDecorator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAetD,eAAO,MAAM,oCAAoC,EAAE,SAsDlD,CAAA"}
@@ -1,3 +1,3 @@
1
- import type { Decorator } from '@storybook/react';
1
+ import type { Decorator } from '@storybook/react-vite';
2
2
  export declare const ChainInfoContextDecorator: Decorator;
3
3
  //# sourceMappingURL=ChainInfoContextDecorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChainInfoContextDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainInfoContextDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAiBjD,eAAO,MAAM,yBAAyB,EAAE,SAwBvC,CAAA"}
1
+ {"version":3,"file":"ChainInfoContextDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainInfoContextDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAiBtD,eAAO,MAAM,yBAAyB,EAAE,SAwBvC,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/react-chain-blockchain",
4
- "version": "1.5.11",
4
+ "version": "1.5.13",
5
5
  "description": "XYO Layer One React SDK Blockchain",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -37,14 +37,13 @@
37
37
  "package-cycle": "echo Nothing to do"
38
38
  },
39
39
  "dependencies": {
40
- "@storybook/react": "^8.6.14",
41
- "@xylabs/assert": "^4.11.10",
42
- "@xylabs/axios": "^4.11.10",
43
- "@xylabs/delay": "^4.11.10",
44
- "@xylabs/eth-address": "^4.11.10",
45
- "@xylabs/exists": "^4.11.10",
46
- "@xylabs/hex": "^4.11.10",
47
- "@xylabs/promise": "^4.11.10",
40
+ "@xylabs/assert": "^4.11.11",
41
+ "@xylabs/axios": "^4.11.11",
42
+ "@xylabs/delay": "^4.11.11",
43
+ "@xylabs/eth-address": "^4.11.11",
44
+ "@xylabs/exists": "^4.11.11",
45
+ "@xylabs/hex": "^4.11.11",
46
+ "@xylabs/promise": "^4.11.11",
48
47
  "@xylabs/react-animation": "^6.3.4",
49
48
  "@xylabs/react-error": "^6.3.4",
50
49
  "@xylabs/react-flexbox": "^6.3.4",
@@ -53,31 +52,31 @@
53
52
  "@xylabs/react-quick-tip-button": "^6.3.4",
54
53
  "@xylabs/react-shared": "^6.3.4",
55
54
  "@xylabs/react-theme": "^6.3.4",
56
- "@xylabs/typeof": "^4.11.10",
57
- "@xyo-network/account": "^3.18.0",
58
- "@xyo-network/archivist-memory": "^3.18.0",
59
- "@xyo-network/archivist-model": "^3.18.0",
60
- "@xyo-network/boundwitness-builder": "^3.18.0",
61
- "@xyo-network/boundwitness-model": "^3.18.0",
62
- "@xyo-network/bridge-http": "^3.18.0",
63
- "@xyo-network/chain-analyze": "^1.5.11",
64
- "@xyo-network/chain-protocol": "^1.5.11",
65
- "@xyo-network/chain-services": "^1.5.11",
66
- "@xyo-network/chain-utils": "^1.5.11",
67
- "@xyo-network/chain-wrappers": "^1.5.11",
68
- "@xyo-network/module-model": "^3.18.0",
69
- "@xyo-network/payload-builder": "^3.18.0",
70
- "@xyo-network/payload-model": "^3.18.0",
71
- "@xyo-network/react-boundwitness-plugin": "^5.3.6",
72
- "@xyo-network/react-chain-blockies": "^1.5.11",
73
- "@xyo-network/react-chain-shared": "^1.5.11",
74
- "@xyo-network/react-event": "^5.3.6",
75
- "@xyo-network/react-payload-raw-info": "^5.3.6",
76
- "@xyo-network/react-payload-table": "^5.3.6",
77
- "@xyo-network/react-shared": "^5.3.6",
78
- "@xyo-network/react-table": "^5.3.6",
55
+ "@xylabs/typeof": "^4.11.11",
56
+ "@xyo-network/account": "^3.18.2",
57
+ "@xyo-network/archivist-memory": "^3.18.2",
58
+ "@xyo-network/archivist-model": "^3.18.2",
59
+ "@xyo-network/boundwitness-builder": "^3.18.2",
60
+ "@xyo-network/boundwitness-model": "^3.18.2",
61
+ "@xyo-network/bridge-http": "^3.18.2",
62
+ "@xyo-network/chain-analyze": "^1.5.13",
63
+ "@xyo-network/chain-protocol": "^1.5.13",
64
+ "@xyo-network/chain-services": "^1.5.13",
65
+ "@xyo-network/chain-utils": "^1.5.13",
66
+ "@xyo-network/chain-wrappers": "^1.5.13",
67
+ "@xyo-network/module-model": "^3.18.2",
68
+ "@xyo-network/payload-builder": "^3.18.2",
69
+ "@xyo-network/payload-model": "^3.18.2",
70
+ "@xyo-network/react-boundwitness-plugin": "^5.3.7",
71
+ "@xyo-network/react-chain-blockies": "^1.5.13",
72
+ "@xyo-network/react-chain-shared": "^1.5.13",
73
+ "@xyo-network/react-event": "^5.3.7",
74
+ "@xyo-network/react-payload-raw-info": "^5.3.7",
75
+ "@xyo-network/react-payload-table": "^5.3.7",
76
+ "@xyo-network/react-shared": "^5.3.7",
77
+ "@xyo-network/react-table": "^5.3.7",
79
78
  "@xyo-network/xl1-protocol": "^1.4.16",
80
- "@xyo-network/xl1-protocol-sdk": "^1.5.11"
79
+ "@xyo-network/xl1-protocol-sdk": "^1.5.13"
81
80
  },
82
81
  "devDependencies": {
83
82
  "@emotion/react": "^11.14.0",
@@ -85,15 +84,15 @@
85
84
  "@mui/icons-material": "^7.1.1",
86
85
  "@mui/material": "^7.1.1",
87
86
  "@types/react": "^19.1.6",
88
- "@xylabs/hex": "^4.11.10",
89
- "@xylabs/ts-scripts-yarn3": "^6.5.7",
90
- "@xylabs/tsconfig-react": "^6.5.7",
91
- "@xyo-network/api-models": "^3.18.0",
92
- "knip": "^5.59.1",
87
+ "@xylabs/hex": "^4.11.11",
88
+ "@xylabs/ts-scripts-yarn3": "^6.5.8",
89
+ "@xylabs/tsconfig-react": "^6.5.8",
90
+ "@xyo-network/api-models": "^3.18.2",
91
+ "knip": "^5.60.0",
93
92
  "react": "^19.1.0",
94
93
  "react-dom": "^19.1.0",
95
- "react-router-dom": "^7.6.1",
96
- "storybook": "^8.6.14",
94
+ "react-router-dom": "^7.6.2",
95
+ "storybook": "^9.0.4",
97
96
  "typescript": "^5.8.3"
98
97
  },
99
98
  "peerDependencies": {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Alert, AlertTitle, List, ListItem, Stack,
3
3
  } from '@mui/material'
4
- import type { Meta, StoryFn } from '@storybook/react'
4
+ import type { Meta, StoryFn } from '@storybook/react-vite'
5
5
  import { buildRandomBlockChainBlocksOnly } from '@xyo-network/react-chain-shared'
6
6
  import React, { useState } from 'react'
7
7
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Alert, AlertTitle, Snackbar,
3
3
  } from '@mui/material'
4
- import type { Meta, StoryFn } from '@storybook/react'
4
+ import type { Meta, StoryFn } from '@storybook/react-vite'
5
5
  import { buildRandomBlockChain } from '@xyo-network/react-chain-shared'
6
6
  import type { Event } from '@xyo-network/react-event'
7
7
  import React, { useState } from 'react'
@@ -0,0 +1,30 @@
1
+ import {
2
+ TableCell, Tooltip, Typography,
3
+ } from '@mui/material'
4
+ import { isDefined } from '@xylabs/typeof'
5
+ import React from 'react'
6
+
7
+ import {
8
+ type BlockTableCellProps, dateFormat, timeAgo,
9
+ } from './lib/index.ts'
10
+
11
+ export interface BlockEpochTableCellProps extends BlockTableCellProps {}
12
+
13
+ export const BlockEpochTableCell: React.FC<BlockEpochTableCellProps> = ({
14
+ block, linked, ...props
15
+ }) => {
16
+ const epoch = block?.[0]?.$epoch
17
+
18
+ const dateTime = dateFormat.format(epoch)
19
+ const age = isDefined(epoch) ? timeAgo(epoch) : undefined
20
+
21
+ return (
22
+ <TableCell {...props}>
23
+ <Tooltip title={`Block Epoch: ${dateTime}`}>
24
+ <Typography component="span" variant="body1">
25
+ {age}
26
+ </Typography>
27
+ </Tooltip>
28
+ </TableCell>
29
+ )
30
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './BlockNumber.tsx'
2
+ export * from './Epoch.tsx'
2
3
  export * from './Hash.tsx'
3
4
  export * from './JsonView.tsx'
4
5
  export * from './PayloadCounts.tsx'
@@ -1 +1,2 @@
1
1
  export * from './BlockTableCellProps.ts'
2
+ export * from './timeFunctions.ts'
@@ -0,0 +1,44 @@
1
+ export const dateFormat = Intl.DateTimeFormat(globalThis.navigator.language ?? 'en-US', {
2
+ year: 'numeric',
3
+ month: '2-digit',
4
+ day: '2-digit',
5
+ hour: '2-digit',
6
+ minute: '2-digit',
7
+ second: '2-digit',
8
+ })
9
+
10
+ export const timeAgo = (epoch: number, locale = navigator.language ?? 'en-US') => {
11
+ const now = Date.now()
12
+ const diffInSeconds = Math.floor((now - epoch) / 1000)
13
+
14
+ const units: { max: number; name: Intl.RelativeTimeFormatUnit; value: number }[] = [
15
+ {
16
+ max: 60, value: 1, name: 'second',
17
+ },
18
+ {
19
+ max: 3600, value: 60, name: 'minute',
20
+ },
21
+ {
22
+ max: 86_400, value: 3600, name: 'hour',
23
+ },
24
+ {
25
+ max: 604_800, value: 86_400, name: 'day',
26
+ },
27
+ {
28
+ max: 2_620_800, value: 604_800, name: 'week',
29
+ },
30
+ {
31
+ max: 31_449_600, value: 2_620_800, name: 'month',
32
+ },
33
+ {
34
+ max: Infinity, value: 31_449_600, name: 'year',
35
+ },
36
+ ]
37
+
38
+ for (const unit of units) {
39
+ if (Math.abs(diffInSeconds) < unit.max) {
40
+ const value = Math.round(diffInSeconds / unit.value)
41
+ return new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(-value, unit.name)
42
+ }
43
+ }
44
+ }
@@ -29,7 +29,8 @@ export const BlockchainTableHead: React.FC = () => {
29
29
  <TableHead>
30
30
  <TableRow>
31
31
  <ToolTipTableCell align="left" title="The block number that is included in the block">Block</ToolTipTableCell>
32
- <ToolTipTableCell title="The hash of the block">Block Hash</ToolTipTableCell>
32
+ <ToolTipTableCell title="The hash of the block">Hash</ToolTipTableCell>
33
+ <ToolTipTableCell title="The epoch of the block">Epoch</ToolTipTableCell>
33
34
  {/* <ToolTipTableCell align="left" title="The address of the block producer that produced the block">Block Producer</ToolTipTableCell> */}
34
35
  <ToolTipTableCell align="left" title="Count of transactions that are included in the block">Transactions</ToolTipTableCell>
35
36
  <ToolTipTableCell align="left" title="Count of public and private payload counts for the block">Payloads</ToolTipTableCell>
@@ -1,5 +1,5 @@
1
1
  import { Table, TableBody } from '@mui/material'
2
- import type { Meta, StoryFn } from '@storybook/react'
2
+ import type { Meta, StoryFn } from '@storybook/react-vite'
3
3
  import { buildRandomBlockChainBlocksOnly } from '@xyo-network/react-chain-shared'
4
4
  import React from 'react'
5
5
 
@@ -8,9 +8,9 @@ import React, { useMemo } from 'react'
8
8
  import type { BlockComponentProps } from '../../../../types/index.ts'
9
9
  import { useLinkedBlockItem } from '../cell/hooks/index.ts'
10
10
  import {
11
+ BlockEpochTableCell,
11
12
  BlockHashTableCell, BlockJsonViewTableCell, BlockNumberTableCell, BlockPayloadCountsTableCell,
12
- BlockTransactionCountTableCell,
13
- BlockVerificationTableCell,
13
+ BlockTransactionCountTableCell, BlockVerificationTableCell,
14
14
  } from '../cell/index.ts'
15
15
 
16
16
  export interface BlockChainTableRowProps extends BlockComponentProps, TableRowProps {
@@ -41,6 +41,7 @@ export const BlockChainTableRow: React.FC<BlockChainTableRowProps> = ({
41
41
  >
42
42
  <BlockNumberTableCell align="left" {...linkedTableCellProps} />
43
43
  <BlockHashTableCell align="left" {...linkedTableCellProps} />
44
+ <BlockEpochTableCell align="left" {...linkedTableCellProps} />
44
45
  {/* Bring back once we have more data to show that is producer specific */}
45
46
  {/* <BlockProducerTableCell align="left" {...linkedTableCellProps} /> */}
46
47
  <BlockTransactionCountTableCell align="left" {...linkedTableCellProps} />
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryFn } from '@storybook/react'
1
+ import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import React from 'react'
3
3
 
4
4
  import { ChainArchivistDelayedInsertDecorator } from '../../../../../stories/index.ts'
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryFn } from '@storybook/react'
1
+ import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import React from 'react'
3
3
 
4
4
  import { getChainInformation } from '../../../../../lib/index.ts'
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryFn } from '@storybook/react'
1
+ import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import React from 'react'
3
3
 
4
4
  import { ChainArchivistDecorator } from '../../../../../stories/index.ts'
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryFn } from '@storybook/react'
1
+ import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import React from 'react'
3
3
 
4
4
  import { ChainArchivistDecorator } from '../../../../../stories/index.ts'
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryFn } from '@storybook/react'
1
+ import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import React from 'react'
3
3
 
4
4
  import { ProducerIntentBuilderFlexbox } from './Flexbox.tsx'
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryFn } from '@storybook/react'
1
+ import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import React from 'react'
3
3
 
4
4
  import { TransferBuilderFlexbox } from './Flexbox.tsx'
@@ -1,4 +1,4 @@
1
- import type { Meta, StoryFn } from '@storybook/react'
1
+ import type { Meta, StoryFn } from '@storybook/react-vite'
2
2
  import React from 'react'
3
3
 
4
4
  import { SubmitChainTransaction } from './SubmitChain.tsx'
@@ -1,5 +1,5 @@
1
1
  import { CircularProgress } from '@mui/material'
2
- import type { Decorator } from '@storybook/react'
2
+ import type { Decorator } from '@storybook/react-vite'
3
3
  import { usePromise } from '@xylabs/react-promise'
4
4
  import { MemoryArchivist } from '@xyo-network/archivist-memory'
5
5
  import { ArchivistConfigSchema } from '@xyo-network/archivist-model'
@@ -1,5 +1,5 @@
1
1
  import { CircularProgress } from '@mui/material'
2
- import type { Decorator } from '@storybook/react'
2
+ import type { Decorator } from '@storybook/react-vite'
3
3
  import { delay } from '@xylabs/delay'
4
4
  import { usePromise } from '@xylabs/react-promise'
5
5
  import { MemoryArchivist } from '@xyo-network/archivist-memory'
@@ -1,4 +1,4 @@
1
- import type { Decorator } from '@storybook/react'
1
+ import type { Decorator } from '@storybook/react-vite'
2
2
  import { assertEx } from '@xylabs/assert'
3
3
  import { usePromise } from '@xylabs/react-promise'
4
4
  import { XyoChainBlockNumberIterator } from '@xyo-network/chain-services'
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlockNumberChip.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/BlockNumberChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAE1D,CAAA"}