@xyo-network/react-chain-blockchain 1.3.7 → 1.3.9
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 +99 -98
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/block/ProducerChip.d.ts +1 -1
- package/dist/types/components/block/ProducerChip.d.ts.map +1 -1
- package/dist/types/components/block/helpers/blockProducer.d.ts +1 -1
- package/dist/types/components/block/helpers/blockProducer.d.ts.map +1 -1
- package/dist/types/components/block/helpers/payloadCountsFromBlock.d.ts +1 -1
- package/dist/types/components/block/helpers/payloadCountsFromBlock.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useBlockProducer.d.ts +1 -1
- package/dist/types/components/block/hooks/useBlockProducer.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useDynamicBlockComponents.d.ts +1 -1
- package/dist/types/components/block/hooks/useDynamicBlockComponents.d.ts.map +1 -1
- package/dist/types/components/block/hooks/usePayloadCountsFromBlock.d.ts +1 -1
- package/dist/types/components/block/hooks/usePayloadCountsFromBlock.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts +1 -1
- package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts.map +1 -1
- package/dist/types/components/block/menu/Expanded.d.ts +1 -1
- package/dist/types/components/block/menu/Expanded.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/BlockNumber.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/BlockNumberChip.d.ts +7 -0
- package/dist/types/components/block/table/cell/BlockNumberChip.d.ts.map +1 -0
- package/dist/types/components/block/table/cell/PayloadCounts.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/Producer.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/TransactionCount.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/Verification.d.ts +1 -0
- package/dist/types/components/block/table/cell/Verification.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/hooks/useLinkedBlockItem.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/lib/BlockTableCellProps.d.ts +1 -1
- package/dist/types/components/block/table/cell/lib/BlockTableCellProps.d.ts.map +1 -1
- package/dist/types/components/block/table/row/TableRow.d.ts +1 -0
- package/dist/types/components/block/table/row/TableRow.d.ts.map +1 -1
- package/dist/types/components/chain/hooks/useOnBlock.d.ts +1 -1
- package/dist/types/components/chain/hooks/useOnBlock.d.ts.map +1 -1
- package/dist/types/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.d.ts +1 -1
- package/dist/types/components/transactions/TransactionsQuickTipButton.d.ts +1 -1
- package/dist/types/components/transactions/TransactionsQuickTipButton.d.ts.map +1 -1
- package/dist/types/components/transactions/submit/Builder.d.ts +1 -1
- package/dist/types/components/transactions/submit/Builder.d.ts.map +1 -1
- package/dist/types/context/analyzer/state.d.ts +1 -1
- package/dist/types/context/analyzer/state.d.ts.map +1 -1
- package/dist/types/context/chain/State.d.ts +1 -1
- package/dist/types/context/chain/State.d.ts.map +1 -1
- package/dist/types/helpers/txsFromBlock.d.ts +2 -2
- package/dist/types/helpers/txsFromBlock.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts +1 -1
- package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorParams.d.ts +3 -3
- package/dist/types/hooks/chain-iterator/useChainIteratorParams.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorStore.d.ts +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorStore.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorUpdatingHead.d.ts +1 -1
- package/dist/types/hooks/chain-iterator/useChainIteratorUpdatingHead.d.ts.map +1 -1
- package/dist/types/hooks/useIterateChain.d.ts +1 -1
- package/dist/types/hooks/useIterateChain.d.ts.map +1 -1
- package/dist/types/hooks/useTxsFromBlock.d.ts +2 -2
- package/dist/types/hooks/useTxsFromBlock.d.ts.map +1 -1
- package/dist/types/lib/getChainInformation.d.ts +1 -1
- package/dist/types/lib/getChainInformation.d.ts.map +1 -1
- package/dist/types/stories/buildRandomBlockchain.d.ts +1 -1
- package/dist/types/stories/buildRandomBlockchain.d.ts.map +1 -1
- package/dist/types/types/BlockComponentProps.d.ts +1 -1
- package/dist/types/types/BlockComponentProps.d.ts.map +1 -1
- package/dist/types/types/BlockComponents.d.ts +1 -1
- package/dist/types/types/BlockComponents.d.ts.map +1 -1
- package/dist/types/types/render/BlockChainRenderProps.d.ts +1 -1
- package/dist/types/types/render/BlockChainRenderProps.d.ts.map +1 -1
- package/package.json +37 -36
- package/src/components/block/ProducerChip.tsx +1 -1
- package/src/components/block/helpers/blockProducer.ts +1 -1
- package/src/components/block/helpers/payloadCountsFromBlock.ts +1 -1
- package/src/components/block/hooks/useBlockProducer.ts +1 -1
- package/src/components/block/hooks/useDynamicBlockComponents.ts +1 -1
- package/src/components/block/hooks/usePayloadCountsFromBlock.ts +1 -1
- package/src/components/block/hooks/useStaticBlockComponents.ts +1 -1
- package/src/components/block/menu/Expanded.tsx +1 -1
- package/src/components/block/table/cell/BlockNumber.tsx +8 -15
- package/src/components/block/table/cell/BlockNumberChip.tsx +11 -0
- package/src/components/block/table/cell/JsonView.tsx +13 -13
- package/src/components/block/table/cell/PayloadCounts.tsx +19 -3
- package/src/components/block/table/cell/Producer.tsx +1 -4
- package/src/components/block/table/cell/TransactionCount.tsx +2 -8
- package/src/components/block/table/cell/Verification.tsx +10 -8
- package/src/components/block/table/cell/hooks/useLinkedBlockItem.tsx +1 -0
- package/src/components/block/table/cell/lib/BlockTableCellProps.ts +1 -1
- package/src/components/block/table/head/TableHead.tsx +4 -4
- package/src/components/block/table/row/TableRow.tsx +30 -10
- package/src/components/chain/hooks/useOnBlock.ts +1 -1
- package/src/components/payload/builder/producer-intent/Form.tsx +1 -1
- package/src/components/payload/builder/transfer/Form.tsx +2 -2
- package/src/components/transactions/TransactionsQuickTipButton.tsx +1 -1
- package/src/components/transactions/submit/Builder.tsx +2 -2
- package/src/components/transactions/submit/SubmitChain.tsx +2 -2
- package/src/context/analyzer/Provider.tsx +1 -1
- package/src/context/analyzer/state.ts +1 -1
- package/src/context/chain/State.ts +1 -1
- package/src/helpers/txsFromBlock.ts +2 -2
- package/src/hooks/chain-iterator/ChainIteratorStore.ts +1 -1
- package/src/hooks/chain-iterator/useChainIteratorParams.ts +2 -2
- package/src/hooks/chain-iterator/useChainIteratorStore.ts +1 -1
- package/src/hooks/chain-iterator/useChainIteratorUpdatingHead.ts +1 -1
- package/src/hooks/useIterateChain.ts +2 -2
- package/src/hooks/useTxsFromBlock.ts +1 -1
- package/src/lib/getChainInformation.ts +1 -1
- package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +1 -1
- package/src/stories/ChainInfoContextDecorator.tsx +1 -1
- package/src/stories/buildRandomBlockchain.ts +1 -1
- package/src/types/BlockComponentProps.ts +1 -1
- package/src/types/BlockComponents.ts +1 -1
- package/src/types/render/BlockChainRenderProps.ts +1 -1
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.3.
|
|
4
|
+
"version": "1.3.9",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockchain",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -37,39 +37,40 @@
|
|
|
37
37
|
"package-cycle": "echo Nothing to do"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@xylabs/assert": "^4.8.
|
|
41
|
-
"@xylabs/axios": "^4.8.
|
|
42
|
-
"@xylabs/eth-address": "^4.8.
|
|
43
|
-
"@xylabs/exists": "^4.8.
|
|
44
|
-
"@xylabs/hex": "^4.8.
|
|
45
|
-
"@xylabs/promise": "^4.8.
|
|
46
|
-
"@xylabs/react-animation": "^6.2.
|
|
47
|
-
"@xylabs/react-error": "^6.2.
|
|
48
|
-
"@xylabs/react-flexbox": "^6.2.
|
|
49
|
-
"@xylabs/react-identicon": "^6.2.
|
|
50
|
-
"@xylabs/react-promise": "^6.2.
|
|
51
|
-
"@xylabs/react-quick-tip-button": "^6.2.
|
|
52
|
-
"@
|
|
53
|
-
"@xyo-network/
|
|
54
|
-
"@xyo-network/
|
|
55
|
-
"@xyo-network/
|
|
56
|
-
"@xyo-network/boundwitness-
|
|
57
|
-
"@xyo-network/
|
|
58
|
-
"@xyo-network/
|
|
59
|
-
"@xyo-network/chain-
|
|
60
|
-
"@xyo-network/chain-
|
|
61
|
-
"@xyo-network/
|
|
62
|
-
"@xyo-network/
|
|
63
|
-
"@xyo-network/payload-
|
|
40
|
+
"@xylabs/assert": "^4.8.9",
|
|
41
|
+
"@xylabs/axios": "^4.8.9",
|
|
42
|
+
"@xylabs/eth-address": "^4.8.9",
|
|
43
|
+
"@xylabs/exists": "^4.8.9",
|
|
44
|
+
"@xylabs/hex": "^4.8.9",
|
|
45
|
+
"@xylabs/promise": "^4.8.9",
|
|
46
|
+
"@xylabs/react-animation": "^6.2.13",
|
|
47
|
+
"@xylabs/react-error": "^6.2.13",
|
|
48
|
+
"@xylabs/react-flexbox": "^6.2.13",
|
|
49
|
+
"@xylabs/react-identicon": "^6.2.13",
|
|
50
|
+
"@xylabs/react-promise": "^6.2.13",
|
|
51
|
+
"@xylabs/react-quick-tip-button": "^6.2.13",
|
|
52
|
+
"@xylabs/react-theme": "^6.2.13",
|
|
53
|
+
"@xyo-network/account": "^3.14.15",
|
|
54
|
+
"@xyo-network/api-models": "^3.14.15",
|
|
55
|
+
"@xyo-network/archivist-model": "^3.14.15",
|
|
56
|
+
"@xyo-network/boundwitness-builder": "^3.14.15",
|
|
57
|
+
"@xyo-network/boundwitness-model": "^3.14.15",
|
|
58
|
+
"@xyo-network/bridge-http": "^3.14.15",
|
|
59
|
+
"@xyo-network/chain-ethereum": "^1.3.9",
|
|
60
|
+
"@xyo-network/chain-protocol": "^1.3.9",
|
|
61
|
+
"@xyo-network/chain-services": "^1.3.9",
|
|
62
|
+
"@xyo-network/module-model": "^3.14.15",
|
|
63
|
+
"@xyo-network/payload-builder": "^3.14.15",
|
|
64
|
+
"@xyo-network/payload-model": "^3.14.15",
|
|
64
65
|
"@xyo-network/react-boundwitness-plugin": "^5.2.5",
|
|
65
|
-
"@xyo-network/react-chain-blockies": "^1.3.
|
|
66
|
+
"@xyo-network/react-chain-blockies": "^1.3.9",
|
|
66
67
|
"@xyo-network/react-event": "^5.2.5",
|
|
67
68
|
"@xyo-network/react-payload-raw-info": "^5.2.5",
|
|
68
69
|
"@xyo-network/react-payload-table": "^5.2.5",
|
|
69
70
|
"@xyo-network/react-shared": "^5.2.5",
|
|
70
71
|
"@xyo-network/react-table": "^5.2.5",
|
|
71
|
-
"@xyo-network/xl1-
|
|
72
|
-
"@xyo-network/xl1-protocol": "^1.3.
|
|
72
|
+
"@xyo-network/xl1-protocol": "^1.3.9",
|
|
73
|
+
"@xyo-network/xl1-protocol-sdk": "^1.3.9"
|
|
73
74
|
},
|
|
74
75
|
"devDependencies": {
|
|
75
76
|
"@emotion/react": "^11.14.0",
|
|
@@ -78,16 +79,16 @@
|
|
|
78
79
|
"@mui/material": "^7.0.2",
|
|
79
80
|
"@storybook/react": "^8.6.12",
|
|
80
81
|
"@types/react": "^19.1.2",
|
|
81
|
-
"@xylabs/delay": "^4.8.
|
|
82
|
-
"@xylabs/hex": "^4.8.
|
|
83
|
-
"@xylabs/ts-scripts-yarn3": "^6.
|
|
84
|
-
"@xylabs/tsconfig-react": "^6.
|
|
85
|
-
"@xyo-network/archivist-memory": "^3.14.
|
|
86
|
-
"@xyo-network/chain-utils": "^1.3.
|
|
87
|
-
"knip": "^5.
|
|
82
|
+
"@xylabs/delay": "^4.8.9",
|
|
83
|
+
"@xylabs/hex": "^4.8.9",
|
|
84
|
+
"@xylabs/ts-scripts-yarn3": "^6.4.6",
|
|
85
|
+
"@xylabs/tsconfig-react": "^6.4.6",
|
|
86
|
+
"@xyo-network/archivist-memory": "^3.14.15",
|
|
87
|
+
"@xyo-network/chain-utils": "^1.3.9",
|
|
88
|
+
"knip": "^5.51.0",
|
|
88
89
|
"react": "^19.1.0",
|
|
89
90
|
"react-dom": "^19.1.0",
|
|
90
|
-
"react-router-dom": "^7.5.
|
|
91
|
+
"react-router-dom": "^7.5.3",
|
|
91
92
|
"storybook": "^8.6.12",
|
|
92
93
|
"typescript": "^5.8.3"
|
|
93
94
|
},
|
|
@@ -2,7 +2,7 @@ import type { ChipProps } from '@mui/material'
|
|
|
2
2
|
import { Chip } from '@mui/material'
|
|
3
3
|
import { EthAddress } from '@xylabs/eth-address'
|
|
4
4
|
import { BlockiesAvatar } from '@xyo-network/react-chain-blockies'
|
|
5
|
-
import type { HydratedBlock } from '@xyo-network/xl1-
|
|
5
|
+
import type { HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
6
6
|
import React, { useMemo } from 'react'
|
|
7
7
|
|
|
8
8
|
export interface BlockProducerChipProps extends ChipProps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'
|
|
2
|
-
import { type HydratedBlock, isTransactionBoundWitness } from '@xyo-network/xl1-
|
|
2
|
+
import { type HydratedBlock, isTransactionBoundWitness } from '@xyo-network/xl1-protocol'
|
|
3
3
|
|
|
4
4
|
export const payloadCountsFromBlock = ([block, payloads]: HydratedBlock): [number, number] => {
|
|
5
5
|
const publicPayloads = block.payload_schemas.filter(schema => schema !== BoundWitnessSchema)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usePromise } from '@xylabs/react-promise'
|
|
2
|
-
import type { HydratedBlock, XyoChainIteratorParams } from '@xyo-network/xl1-
|
|
2
|
+
import type { HydratedBlock, XyoChainIteratorParams } from '@xyo-network/xl1-protocol'
|
|
3
3
|
import type { ComponentType } from 'react'
|
|
4
4
|
|
|
5
5
|
import { useChainAnalyzersContext } from '../../../context/index.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MoreVert } from '@mui/icons-material'
|
|
2
2
|
import { IconButton, Menu } from '@mui/material'
|
|
3
3
|
import { BWJsonMenuItem, BWPreviousHashMenuItem } from '@xyo-network/react-boundwitness-plugin'
|
|
4
|
-
import type { HydratedBlock } from '@xyo-network/xl1-
|
|
4
|
+
import type { HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
5
5
|
import React from 'react'
|
|
6
6
|
|
|
7
7
|
import { useAnchorElement } from '../hooks/index.ts'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
TableCell, Tooltip,
|
|
3
|
+
Typography,
|
|
3
4
|
} from '@mui/material'
|
|
4
5
|
import React from 'react'
|
|
5
6
|
|
|
6
|
-
import { useLinkedBlockItem } from './hooks/index.ts'
|
|
7
7
|
import type { BlockTableCellProps } from './lib/index.ts'
|
|
8
8
|
|
|
9
9
|
export interface BlockNumberTableCellProps extends BlockTableCellProps {}
|
|
@@ -11,21 +11,14 @@ export interface BlockNumberTableCellProps extends BlockTableCellProps {}
|
|
|
11
11
|
export const BlockNumberTableCell: React.FC<BlockNumberTableCellProps> = ({
|
|
12
12
|
block, linked, ...props
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const blockNumberBigInt = block ? block[0].block.toString() : ''
|
|
14
|
+
const blockNumber = block?.[0].block
|
|
17
15
|
|
|
18
16
|
return (
|
|
19
|
-
<TableCell
|
|
20
|
-
<Tooltip title={`Block Number: ${
|
|
21
|
-
<span>
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
<Link title={block[0].block.toString()} onClick={handleClick} sx={{ cursor: 'pointer' }}>{block[0].block.toString()}</Link>
|
|
25
|
-
)
|
|
26
|
-
: null}
|
|
27
|
-
{!linked && blockNumberBigInt}
|
|
28
|
-
</span>
|
|
17
|
+
<TableCell {...props}>
|
|
18
|
+
<Tooltip title={`Block Number: ${blockNumber}`}>
|
|
19
|
+
<Typography component="span" variant="body1">
|
|
20
|
+
{blockNumber}
|
|
21
|
+
</Typography>
|
|
29
22
|
</Tooltip>
|
|
30
23
|
</TableCell>
|
|
31
24
|
)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChipProps } from '@mui/material'
|
|
2
|
+
import { Chip } from '@mui/material'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
export interface BlockNumberChipProps extends ChipProps {
|
|
6
|
+
blockNumber?: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const BlockNumberChip: React.FC<BlockNumberChipProps> = ({ blockNumber, ...props }) => {
|
|
10
|
+
return <Chip avatar={<></>} label={blockNumber} {...props} />
|
|
11
|
+
}
|
|
@@ -22,23 +22,23 @@ export const BlockJsonViewTableCell: React.FC<BlockJsonViewTableCellProps> = ({
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<TableCell {...props}>
|
|
25
|
-
<FlexRow sx={{ width: '100%' }}>
|
|
25
|
+
<FlexRow onClick={e => e.stopPropagation()} sx={{ width: '100%' }}>
|
|
26
26
|
<IconButton onClick={() => setOpen(true)}>
|
|
27
27
|
<DataObject />
|
|
28
28
|
</IconButton>
|
|
29
|
+
<Dialog open={open} onClose={onClose}>
|
|
30
|
+
<DialogTitle>{title}</DialogTitle>
|
|
31
|
+
<DialogContent>
|
|
32
|
+
<JsonViewerEx value={block} />
|
|
33
|
+
</DialogContent>
|
|
34
|
+
<DialogActions sx={{
|
|
35
|
+
display: 'flex', flexDirection: 'row', justifyContent: 'end',
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<Button variant="contained" onClick={onClose}>Close</Button>
|
|
39
|
+
</DialogActions>
|
|
40
|
+
</Dialog>
|
|
29
41
|
</FlexRow>
|
|
30
|
-
<Dialog open={open} onClose={onClose}>
|
|
31
|
-
<DialogTitle>{title}</DialogTitle>
|
|
32
|
-
<DialogContent>
|
|
33
|
-
<JsonViewerEx value={block} />
|
|
34
|
-
</DialogContent>
|
|
35
|
-
<DialogActions sx={{
|
|
36
|
-
display: 'flex', flexDirection: 'row', justifyContent: 'end',
|
|
37
|
-
}}
|
|
38
|
-
>
|
|
39
|
-
<Button variant="contained" onClick={onClose}>Close</Button>
|
|
40
|
-
</DialogActions>
|
|
41
|
-
</Dialog>
|
|
42
42
|
</TableCell>
|
|
43
43
|
)
|
|
44
44
|
}
|
|
@@ -28,10 +28,9 @@ export const BlockPayloadCountsTableCell: React.FC<BlockPayloadCountsTableCellPr
|
|
|
28
28
|
block: block[0]._hash,
|
|
29
29
|
}
|
|
30
30
|
: undefined
|
|
31
|
+
const payloadCount = (publicPayloads ?? 0) + (privatePayloads ?? 0)
|
|
31
32
|
const [ref, handleClick] = useLinkedBlockItem('payload-counts', data)
|
|
32
33
|
|
|
33
|
-
const renderText = `${publicPayloads ?? '--'} / ${privatePayloads ?? '--'}`
|
|
34
|
-
|
|
35
34
|
return (
|
|
36
35
|
<TableCell ref={ref} {...props}>
|
|
37
36
|
<span>
|
|
@@ -42,7 +41,24 @@ export const BlockPayloadCountsTableCell: React.FC<BlockPayloadCountsTableCellPr
|
|
|
42
41
|
</Tooltip>
|
|
43
42
|
)
|
|
44
43
|
: null}
|
|
45
|
-
{linked
|
|
44
|
+
{linked
|
|
45
|
+
? (
|
|
46
|
+
<Tooltip title={`Public Payloads: ${publicPayloads ?? '--'} Private Payloads: ${privatePayloads ?? '--'}`}>
|
|
47
|
+
<Link
|
|
48
|
+
onClick={handleClick}
|
|
49
|
+
sx={{ cursor: 'pointer' }}
|
|
50
|
+
>
|
|
51
|
+
{payloadCount}
|
|
52
|
+
</Link>
|
|
53
|
+
</Tooltip>
|
|
54
|
+
)
|
|
55
|
+
: (
|
|
56
|
+
<Tooltip title={`Public Payloads: ${publicPayloads ?? '--'} Private Payloads: ${privatePayloads ?? '--'}`}>
|
|
57
|
+
<span>
|
|
58
|
+
{payloadCount}
|
|
59
|
+
</span>
|
|
60
|
+
</Tooltip>
|
|
61
|
+
)}
|
|
46
62
|
</span>
|
|
47
63
|
</TableCell>
|
|
48
64
|
)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TableCell, Tooltip } from '@mui/material'
|
|
2
|
-
import { FlexRow } from '@xylabs/react-flexbox'
|
|
3
2
|
import React from 'react'
|
|
4
3
|
|
|
5
4
|
import { FeatureNotAvailable } from '../../../FeatureNotAvailable.tsx'
|
|
@@ -24,9 +23,7 @@ export const BlockProducerTableCell: React.FC<BlockProducerTableCell> = ({
|
|
|
24
23
|
return (
|
|
25
24
|
<TableCell ref={ref} {...props}>
|
|
26
25
|
<Tooltip title={`Block Producer: ${producer}`}>
|
|
27
|
-
<
|
|
28
|
-
<BlockProducerChip sx={{ cursor: 'pointer' }} onClick={linked ? handleClick : () => setNotAvailable(true)} block={block} {...producerChipProps} />
|
|
29
|
-
</FlexRow>
|
|
26
|
+
<BlockProducerChip sx={{ cursor: 'pointer' }} onClick={linked ? handleClick : () => setNotAvailable(true)} block={block} {...producerChipProps} />
|
|
30
27
|
</Tooltip>
|
|
31
28
|
{(notAvailableDialog && notAvailable)
|
|
32
29
|
? <FeatureNotAvailable featureName="Producer Details" open={notAvailable} onClick={() => setNotAvailable(false)} />
|
|
@@ -3,11 +3,9 @@ import {
|
|
|
3
3
|
Link, TableCell, Tooltip,
|
|
4
4
|
} from '@mui/material'
|
|
5
5
|
import type { Hash } from '@xylabs/hex'
|
|
6
|
-
import { isTransactionBoundWitness } from '@xyo-network/xl1-model'
|
|
7
6
|
import React, { useMemo } from 'react'
|
|
8
7
|
|
|
9
8
|
import { useTxsFromBlock } from '../../../../hooks/useTxsFromBlock.ts'
|
|
10
|
-
import { TransactionCountChip } from '../../../transactions/index.ts'
|
|
11
9
|
import { useLinkedBlockItem } from './hooks/index.ts'
|
|
12
10
|
import type { BlockTableCellProps } from './lib/index.ts'
|
|
13
11
|
|
|
@@ -46,15 +44,11 @@ export const BlockTransactionCountTableCell: React.FC<BlockTransactionCountTable
|
|
|
46
44
|
{linked
|
|
47
45
|
? (
|
|
48
46
|
<Link onClick={handleClick} sx={{ cursor: 'pointer' }}>
|
|
49
|
-
|
|
50
|
-
transactions={txHashes}
|
|
51
|
-
/>
|
|
47
|
+
{txHashes?.length}
|
|
52
48
|
</Link>
|
|
53
49
|
)
|
|
54
50
|
: (
|
|
55
|
-
|
|
56
|
-
transactions={txHashes}
|
|
57
|
-
/>
|
|
51
|
+
txHashes?.length
|
|
58
52
|
)}
|
|
59
53
|
</span>
|
|
60
54
|
</TableCell>
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
import { CheckCircleOutlineRounded } from '@mui/icons-material'
|
|
1
2
|
import { TableCell } from '@mui/material'
|
|
2
3
|
import { FlexRow } from '@xylabs/react-flexbox'
|
|
3
4
|
import { BWVerification } from '@xyo-network/react-boundwitness-plugin'
|
|
4
5
|
import React from 'react'
|
|
5
6
|
|
|
6
|
-
import { useLinkedBlockItem } from './hooks/index.ts'
|
|
7
7
|
import type { BlockTableCellProps } from './lib/index.ts'
|
|
8
8
|
|
|
9
|
-
export interface BlockVerificationTableCellProps extends BlockTableCellProps {
|
|
9
|
+
export interface BlockVerificationTableCellProps extends BlockTableCellProps {
|
|
10
|
+
deepValidation?: boolean
|
|
11
|
+
}
|
|
10
12
|
|
|
11
13
|
export const BlockVerificationTableCell: React.FC<BlockVerificationTableCellProps> = ({
|
|
12
|
-
block, linked, ...props
|
|
14
|
+
block, linked, deepValidation, ...props
|
|
13
15
|
}) => {
|
|
14
|
-
const [ref, handleClick] = useLinkedBlockItem('block-verification', block?.[0].block.toString())
|
|
15
|
-
|
|
16
16
|
return (
|
|
17
|
-
<TableCell
|
|
18
|
-
<FlexRow sx={{ width: '100%' }}>
|
|
19
|
-
|
|
17
|
+
<TableCell {...props}>
|
|
18
|
+
<FlexRow onClick={e => e.stopPropagation()} sx={{ width: '100%' }}>
|
|
19
|
+
{deepValidation
|
|
20
|
+
? <BWVerification iconColors boundwitness={block?.[0]} />
|
|
21
|
+
: <CheckCircleOutlineRounded color="success" />}
|
|
20
22
|
</FlexRow>
|
|
21
23
|
</TableCell>
|
|
22
24
|
)
|
|
@@ -8,6 +8,7 @@ export const useLinkedBlockItem = (noun?: BlockHeaderEventNouns, data?: string |
|
|
|
8
8
|
|
|
9
9
|
const handleClick = (event: React.MouseEvent) => {
|
|
10
10
|
event.preventDefault()
|
|
11
|
+
event.stopPropagation()
|
|
11
12
|
if (!noun) {
|
|
12
13
|
console.warn('useLinkedBlockItem: noun is required')
|
|
13
14
|
return
|
|
@@ -28,11 +28,11 @@ export const BlockchainTableHead: React.FC = () => {
|
|
|
28
28
|
return (
|
|
29
29
|
<TableHead>
|
|
30
30
|
<TableRow>
|
|
31
|
+
<ToolTipTableCell align="left" title="The block number that is included in the block">Block</ToolTipTableCell>
|
|
31
32
|
<ToolTipTableCell title="The hash of the block">Block Hash</ToolTipTableCell>
|
|
32
|
-
<ToolTipTableCell align="
|
|
33
|
-
<ToolTipTableCell align="
|
|
34
|
-
<ToolTipTableCell align="
|
|
35
|
-
<ToolTipTableCell align="center" title="The address of the block producer that produced the block">Block Producer</ToolTipTableCell>
|
|
33
|
+
{/* <ToolTipTableCell align="left" title="The address of the block producer that produced the block">Block Producer</ToolTipTableCell> */}
|
|
34
|
+
<ToolTipTableCell align="left" title="Count of transactions that are included in the block">Transactions</ToolTipTableCell>
|
|
35
|
+
<ToolTipTableCell align="left" title="Count of public and private payload counts for the block">Payloads</ToolTipTableCell>
|
|
36
36
|
<ToolTipTableCell align="center" title="The result of the local validation check for the block">Valid</ToolTipTableCell>
|
|
37
37
|
<ToolTipTableCell align="center" title="Link to display the raw JSON of the block">JSON</ToolTipTableCell>
|
|
38
38
|
</TableRow>
|
|
@@ -1,31 +1,51 @@
|
|
|
1
1
|
import type { TableRowProps } from '@mui/material'
|
|
2
|
-
import { TableRow } from '@mui/material'
|
|
2
|
+
import { TableRow, useTheme } from '@mui/material'
|
|
3
|
+
import { alphaCss } from '@xylabs/react-theme'
|
|
4
|
+
import { usePayloadRootHash } from '@xyo-network/react-shared'
|
|
5
|
+
import type { Ref } from 'react'
|
|
3
6
|
import React, { useMemo } from 'react'
|
|
4
7
|
|
|
5
8
|
import type { BlockComponentProps } from '../../../../types/index.ts'
|
|
9
|
+
import { useLinkedBlockItem } from '../cell/hooks/index.ts'
|
|
6
10
|
import {
|
|
7
|
-
BlockHashTableCell, BlockJsonViewTableCell, BlockNumberTableCell, BlockPayloadCountsTableCell,
|
|
11
|
+
BlockHashTableCell, BlockJsonViewTableCell, BlockNumberTableCell, BlockPayloadCountsTableCell,
|
|
8
12
|
BlockTransactionCountTableCell,
|
|
9
13
|
BlockVerificationTableCell,
|
|
10
14
|
} from '../cell/index.ts'
|
|
11
15
|
|
|
12
16
|
export interface BlockChainTableRowProps extends BlockComponentProps, TableRowProps {
|
|
17
|
+
deepValidation?: boolean
|
|
13
18
|
linked?: boolean
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
export const BlockChainTableRow: React.FC<BlockChainTableRowProps> = ({
|
|
17
|
-
block, defaultExpanded, linked, sx, ...props
|
|
22
|
+
block, deepValidation, defaultExpanded, linked, sx, ...props
|
|
18
23
|
}) => {
|
|
19
24
|
const linkedTableCellProps = useMemo(() => ({ block, linked }), [block, linked])
|
|
20
25
|
const defaultTableCellProps = useMemo(() => ({ block }), [block])
|
|
26
|
+
const hash = usePayloadRootHash(block?.[0])
|
|
27
|
+
const [ref, handleClick] = useLinkedBlockItem('block-hash', hash)
|
|
28
|
+
const theme = useTheme()
|
|
29
|
+
|
|
21
30
|
return (
|
|
22
|
-
<TableRow
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
<TableRow
|
|
32
|
+
onClick={linked ? handleClick : undefined}
|
|
33
|
+
ref={ref as Ref<HTMLTableRowElement> | undefined}
|
|
34
|
+
sx={{
|
|
35
|
+
'cursor': linked ? 'pointer' : 'default',
|
|
36
|
+
'overflowY': 'scroll',
|
|
37
|
+
'&:hover': { backgroundColor: alphaCss(theme.vars.palette.secondary.light, 0.85) },
|
|
38
|
+
...sx,
|
|
39
|
+
}}
|
|
40
|
+
{...props}
|
|
41
|
+
>
|
|
42
|
+
<BlockNumberTableCell align="left" {...linkedTableCellProps} />
|
|
43
|
+
<BlockHashTableCell align="left" {...linkedTableCellProps} />
|
|
44
|
+
{/* Bring back once we have more data to show that is producer specific */}
|
|
45
|
+
{/* <BlockProducerTableCell align="left" {...linkedTableCellProps} /> */}
|
|
46
|
+
<BlockTransactionCountTableCell align="left" {...linkedTableCellProps} />
|
|
47
|
+
<BlockPayloadCountsTableCell align="left" {...linkedTableCellProps} />
|
|
48
|
+
<BlockVerificationTableCell deepValidation={deepValidation} {...defaultTableCellProps} />
|
|
29
49
|
<BlockJsonViewTableCell {...defaultTableCellProps} />
|
|
30
50
|
</TableRow>
|
|
31
51
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button, FormControl } from '@mui/material'
|
|
2
2
|
import type { Address } from '@xylabs/hex'
|
|
3
3
|
import { createProducerChainStakeIntent } from '@xyo-network/chain-ethereum'
|
|
4
|
-
import type { ChainStakeIntent } from '@xyo-network/xl1-
|
|
4
|
+
import type { ChainStakeIntent } from '@xyo-network/xl1-protocol'
|
|
5
5
|
import type { MouseEventHandler } from 'react'
|
|
6
6
|
import React, { useMemo, useState } from 'react'
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button, FormControl } from '@mui/material'
|
|
2
2
|
import type { Address } from '@xylabs/hex'
|
|
3
|
-
import type { Transfer } from '@xyo-network/xl1-
|
|
4
|
-
import { TransferSchema } from '@xyo-network/xl1-
|
|
3
|
+
import type { Transfer } from '@xyo-network/xl1-protocol'
|
|
4
|
+
import { TransferSchema } from '@xyo-network/xl1-protocol'
|
|
5
5
|
import type { MouseEventHandler } from 'react'
|
|
6
6
|
import React, { useMemo, useState } from 'react'
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '@xylabs/react-flexbox'
|
|
10
10
|
import type { QuickTipButtonProps } from '@xylabs/react-quick-tip-button'
|
|
11
11
|
import { QuickTipButton } from '@xylabs/react-quick-tip-button'
|
|
12
|
-
import type { HydratedBlock } from '@xyo-network/xl1-
|
|
12
|
+
import type { HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
13
13
|
import React, {
|
|
14
14
|
Fragment, useMemo, useState,
|
|
15
15
|
} from 'react'
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
} from '@mui/material'
|
|
4
4
|
import { type Address, toHex } from '@xylabs/hex'
|
|
5
5
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
6
|
-
import type { TransactionBoundWitnessFields } from '@xyo-network/xl1-
|
|
7
|
-
import { defaultFees } from '@xyo-network/xl1-protocol'
|
|
6
|
+
import type { TransactionBoundWitnessFields } from '@xyo-network/xl1-protocol'
|
|
7
|
+
import { defaultFees } from '@xyo-network/xl1-protocol-sdk'
|
|
8
8
|
import React from 'react'
|
|
9
9
|
|
|
10
10
|
export interface ChainTransactionBuilder {
|
|
@@ -11,8 +11,8 @@ import { QueryBoundWitnessBuilder } from '@xyo-network/boundwitness-builder'
|
|
|
11
11
|
import type { ModuleQueryResult } from '@xyo-network/module-model'
|
|
12
12
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
13
13
|
import type { Payload } from '@xyo-network/payload-model'
|
|
14
|
-
import type { TransactionBoundWitnessFields } from '@xyo-network/xl1-
|
|
15
|
-
import { buildTransaction } from '@xyo-network/xl1-protocol'
|
|
14
|
+
import type { TransactionBoundWitnessFields } from '@xyo-network/xl1-protocol'
|
|
15
|
+
import { buildTransaction } from '@xyo-network/xl1-protocol-sdk'
|
|
16
16
|
import React, { useState } from 'react'
|
|
17
17
|
|
|
18
18
|
import { ChainTransactionBuilder } from './Builder.tsx'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
2
2
|
import type { ContextExState } from '@xyo-network/react-shared'
|
|
3
|
-
import type { ChainBlockNumberIterator, ChainInformation } from '@xyo-network/xl1-
|
|
3
|
+
import type { ChainBlockNumberIterator, ChainInformation } from '@xyo-network/xl1-protocol'
|
|
4
4
|
|
|
5
5
|
export interface ChainInfoState extends ContextExState {
|
|
6
6
|
chainArchivist?: ArchivistInstance
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
2
|
-
import type { HydratedBlock } from '@xyo-network/xl1-
|
|
3
|
-
import { isTransactionBoundWitness } from '@xyo-network/xl1-
|
|
2
|
+
import type { HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
3
|
+
import { isTransactionBoundWitness } from '@xyo-network/xl1-protocol'
|
|
4
4
|
|
|
5
5
|
export const txsFromBlock = async (block: HydratedBlock) => {
|
|
6
6
|
const transactionPayloads = block[1].filter(payload => isTransactionBoundWitness(payload))
|
|
@@ -3,8 +3,8 @@ import type { Hash } from '@xylabs/hex'
|
|
|
3
3
|
import { usePromise } from '@xylabs/react-promise'
|
|
4
4
|
import type { ReadArchivist } from '@xyo-network/archivist-model'
|
|
5
5
|
import { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'
|
|
6
|
-
import type { BlockBoundWitness } from '@xyo-network/xl1-
|
|
7
|
-
import { isBlockBoundWitness } from '@xyo-network/xl1-
|
|
6
|
+
import type { BlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
7
|
+
import { isBlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
8
8
|
|
|
9
9
|
import type { BlockChainIterator } from '../../types/index.ts'
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toHex } from '@xylabs/hex'
|
|
2
2
|
import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
3
3
|
import { findMostRecentBlock } from '@xyo-network/chain-protocol'
|
|
4
|
-
import type { ChainBlockNumberIterator } from '@xyo-network/xl1-
|
|
4
|
+
import type { ChainBlockNumberIterator } from '@xyo-network/xl1-protocol'
|
|
5
5
|
import { useEffect, useState } from 'react'
|
|
6
6
|
|
|
7
7
|
export interface ChainIteratorUpdatingHeadParams {
|
|
@@ -6,8 +6,8 @@ import { XyoChainBlockNumberIterator } from '@xyo-network/chain-services'
|
|
|
6
6
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
7
7
|
import type {
|
|
8
8
|
BlockBoundWitness, HydratedBlock, XyoChainIteratorParams,
|
|
9
|
-
} from '@xyo-network/xl1-
|
|
10
|
-
import { isBlockBoundWitness } from '@xyo-network/xl1-
|
|
9
|
+
} from '@xyo-network/xl1-protocol'
|
|
10
|
+
import { isBlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
11
11
|
|
|
12
12
|
const getHydratedBlock = async (chainArchivist: ReadArchivist, head: BlockBoundWitness) => {
|
|
13
13
|
const headHash = await PayloadBuilder.hash(head)
|