@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.
- package/dist/browser/index.mjs +256 -173
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/block/table/cell/Epoch.d.ts +6 -0
- package/dist/types/components/block/table/cell/Epoch.d.ts.map +1 -0
- package/dist/types/components/block/table/cell/{BlockNumberChip.d.ts → NumberChip.d.ts} +1 -1
- package/dist/types/components/block/table/cell/NumberChip.d.ts.map +1 -0
- package/dist/types/components/block/table/cell/index.d.ts +1 -0
- package/dist/types/components/block/table/cell/index.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/lib/index.d.ts +1 -0
- package/dist/types/components/block/table/cell/lib/index.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/lib/timeFunctions.d.ts +3 -0
- package/dist/types/components/block/table/cell/lib/timeFunctions.d.ts.map +1 -0
- package/dist/types/components/block/table/head/TableHead.d.ts.map +1 -1
- package/dist/types/components/block/table/row/TableRow.d.ts.map +1 -1
- package/dist/types/stories/ChainArchivistDecorator.d.ts +1 -1
- package/dist/types/stories/ChainArchivistDecorator.d.ts.map +1 -1
- package/dist/types/stories/ChainArchivistDelayedInsertDecorator.d.ts +1 -1
- package/dist/types/stories/ChainArchivistDelayedInsertDecorator.d.ts.map +1 -1
- package/dist/types/stories/ChainInfoContextDecorator.d.ts +1 -1
- package/dist/types/stories/ChainInfoContextDecorator.d.ts.map +1 -1
- package/package.json +39 -40
- package/src/components/block/BlockHeadingFlexbox.stories.tsx +1 -1
- package/src/components/block/table/Ex.stories.tsx +1 -1
- package/src/components/block/table/cell/Epoch.tsx +30 -0
- package/src/components/block/table/cell/index.ts +1 -0
- package/src/components/block/table/cell/lib/index.ts +1 -0
- package/src/components/block/table/cell/lib/timeFunctions.ts +44 -0
- package/src/components/block/table/head/TableHead.tsx +2 -1
- package/src/components/block/table/row/TableRow.stories.tsx +1 -1
- package/src/components/block/table/row/TableRow.tsx +3 -2
- package/src/components/chain/render/dynamic/flexbox/Flexbox.stories.tsx +1 -1
- package/src/components/chain/render/dynamic/flexbox/Remote.stories.tsx +1 -1
- package/src/components/chain/render/static/flexbox/Flexbox.stories.tsx +1 -1
- package/src/components/chain/render/static/table/Ex.stories.tsx +1 -1
- package/src/components/payload/builder/producer-intent/Flexbox.stories.tsx +1 -1
- package/src/components/payload/builder/transfer/Flexbox.stories.tsx +1 -1
- package/src/components/transactions/submit/SubmitChain.stories.tsx +1 -1
- package/src/stories/ChainArchivistDecorator.tsx +1 -1
- package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +1 -1
- package/src/stories/ChainInfoContextDecorator.tsx +1 -1
- package/dist/types/components/block/table/cell/BlockNumberChip.d.ts.map +0 -1
- /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"}
|
|
@@ -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 +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 +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 @@
|
|
|
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,
|
|
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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainArchivistDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainArchivistDecorator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainArchivistDelayedInsertDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainArchivistDelayedInsertDecorator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainInfoContextDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainInfoContextDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
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.
|
|
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
|
-
"@
|
|
41
|
-
"@xylabs/
|
|
42
|
-
"@xylabs/
|
|
43
|
-
"@xylabs/
|
|
44
|
-
"@xylabs/
|
|
45
|
-
"@xylabs/
|
|
46
|
-
"@xylabs/
|
|
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.
|
|
57
|
-
"@xyo-network/account": "^3.18.
|
|
58
|
-
"@xyo-network/archivist-memory": "^3.18.
|
|
59
|
-
"@xyo-network/archivist-model": "^3.18.
|
|
60
|
-
"@xyo-network/boundwitness-builder": "^3.18.
|
|
61
|
-
"@xyo-network/boundwitness-model": "^3.18.
|
|
62
|
-
"@xyo-network/bridge-http": "^3.18.
|
|
63
|
-
"@xyo-network/chain-analyze": "^1.5.
|
|
64
|
-
"@xyo-network/chain-protocol": "^1.5.
|
|
65
|
-
"@xyo-network/chain-services": "^1.5.
|
|
66
|
-
"@xyo-network/chain-utils": "^1.5.
|
|
67
|
-
"@xyo-network/chain-wrappers": "^1.5.
|
|
68
|
-
"@xyo-network/module-model": "^3.18.
|
|
69
|
-
"@xyo-network/payload-builder": "^3.18.
|
|
70
|
-
"@xyo-network/payload-model": "^3.18.
|
|
71
|
-
"@xyo-network/react-boundwitness-plugin": "^5.3.
|
|
72
|
-
"@xyo-network/react-chain-blockies": "^1.5.
|
|
73
|
-
"@xyo-network/react-chain-shared": "^1.5.
|
|
74
|
-
"@xyo-network/react-event": "^5.3.
|
|
75
|
-
"@xyo-network/react-payload-raw-info": "^5.3.
|
|
76
|
-
"@xyo-network/react-payload-table": "^5.3.
|
|
77
|
-
"@xyo-network/react-shared": "^5.3.
|
|
78
|
-
"@xyo-network/react-table": "^5.3.
|
|
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.
|
|
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.
|
|
89
|
-
"@xylabs/ts-scripts-yarn3": "^6.5.
|
|
90
|
-
"@xylabs/tsconfig-react": "^6.5.
|
|
91
|
-
"@xyo-network/api-models": "^3.18.
|
|
92
|
-
"knip": "^5.
|
|
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.
|
|
96
|
-
"storybook": "^
|
|
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
|
+
}
|
|
@@ -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">
|
|
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,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"}
|
|
File without changes
|