@xyo-network/react-chain-blockchain 1.20.14 → 1.20.16
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/README.md +9 -8854
- package/dist/browser/components/account/table/types/index.d.ts +1 -1
- package/dist/browser/components/account/table/types/index.d.ts.map +1 -1
- package/dist/browser/components/block/table/cell/NumberChip.d.ts.map +1 -1
- package/dist/browser/components/chain/controls/PulseSvgIcon.d.ts +5 -2
- package/dist/browser/components/chain/controls/PulseSvgIcon.d.ts.map +1 -1
- package/dist/browser/components/chain/hooks/useOnBlock.d.ts +7 -7
- package/dist/browser/components/chain/styled/BlockListWrapperFlexbox.d.ts +6 -1
- package/dist/browser/components/chain/styled/BlockListWrapperFlexbox.d.ts.map +1 -1
- package/dist/browser/components/table/StyledLinkableTableRow.d.ts +5 -4
- package/dist/browser/components/table/StyledLinkableTableRow.d.ts.map +1 -1
- package/dist/browser/context/analyzer/context.d.ts +3 -3
- package/dist/browser/context/analyzer/use.d.ts +1 -1
- package/dist/browser/context/chain/Context.d.ts +3 -3
- package/dist/browser/context/chain/use.d.ts +1 -1
- package/dist/browser/hooks/useBaseContext.d.ts +2 -8
- package/dist/browser/hooks/useBaseContext.d.ts.map +1 -1
- package/dist/browser/hooks/useTxsFromBlock.d.ts +1 -1
- package/dist/browser/hooks/useTxsFromBlock.d.ts.map +1 -1
- package/dist/browser/index.mjs +3 -3
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +167 -58
- package/src/components/FeatureNotAvailable.tsx +0 -20
- package/src/components/account/BalanceHistoryFlexbox.stories.tsx +0 -25
- package/src/components/account/BalanceHistoryFlexbox.tsx +0 -53
- package/src/components/account/helpers/formatBalanceMagnitude.ts +0 -14
- package/src/components/account/helpers/index.ts +0 -1
- package/src/components/account/hooks/index.ts +0 -1
- package/src/components/account/hooks/usePagedAccountBalanceHistory.ts +0 -39
- package/src/components/account/index.ts +0 -4
- package/src/components/account/table/BalanceHistoryTableEx.stories.tsx +0 -111
- package/src/components/account/table/BalanceHistoryTableEx.tsx +0 -37
- package/src/components/account/table/BalanceHistoryTableRow.stories.tsx +0 -52
- package/src/components/account/table/BalanceHistoryTableRow.tsx +0 -60
- package/src/components/account/table/RawAmountTableCell.tsx +0 -53
- package/src/components/account/table/cell/AddressTableCell.tsx +0 -27
- package/src/components/account/table/cell/BlockNumber.tsx +0 -39
- package/src/components/account/table/cell/HashTableCell.tsx +0 -46
- package/src/components/account/table/cell/index.ts +0 -3
- package/src/components/account/table/hooks/index.ts +0 -1
- package/src/components/account/table/hooks/useLinkedBalanceHistoryItem.tsx +0 -29
- package/src/components/account/table/index.ts +0 -5
- package/src/components/account/table/types/index.ts +0 -18
- package/src/components/block/BlockHeadingFlexbox.stories.tsx +0 -75
- package/src/components/block/BlockHeadingFlexbox.tsx +0 -56
- package/src/components/block/ChipSkeleton.tsx +0 -7
- package/src/components/block/LinkedDivider.tsx +0 -27
- package/src/components/block/ProducerChip.tsx +0 -45
- package/src/components/block/helpers/blockProducer.ts +0 -5
- package/src/components/block/helpers/buildBlockChainRenderComponent.tsx +0 -32
- package/src/components/block/helpers/index.ts +0 -3
- package/src/components/block/helpers/payloadCountsFromBlock.ts +0 -10
- package/src/components/block/hooks/index.ts +0 -4
- package/src/components/block/hooks/useAnchorElement.ts +0 -19
- package/src/components/block/hooks/useBlockHeadingEvents.ts +0 -11
- package/src/components/block/hooks/useBlockProducer.ts +0 -11
- package/src/components/block/hooks/usePayloadCountsFromBlock.ts +0 -13
- package/src/components/block/index.ts +0 -6
- package/src/components/block/menu/Expanded.tsx +0 -34
- package/src/components/block/menu/index.ts +0 -1
- package/src/components/block/table/Ex.stories.tsx +0 -64
- package/src/components/block/table/Ex.tsx +0 -21
- package/src/components/block/table/cell/BlockNumber.tsx +0 -35
- package/src/components/block/table/cell/Epoch.tsx +0 -46
- package/src/components/block/table/cell/Hash.tsx +0 -46
- package/src/components/block/table/cell/JsonView.tsx +0 -44
- package/src/components/block/table/cell/NumberChip.tsx +0 -12
- package/src/components/block/table/cell/PayloadCounts.tsx +0 -65
- package/src/components/block/table/cell/Producer.tsx +0 -63
- package/src/components/block/table/cell/TransactionCount.tsx +0 -56
- package/src/components/block/table/cell/Verification.tsx +0 -25
- package/src/components/block/table/cell/helpers/index.ts +0 -1
- package/src/components/block/table/cell/helpers/timeFunctions.ts +0 -44
- package/src/components/block/table/cell/hooks/index.ts +0 -1
- package/src/components/block/table/cell/hooks/useLinkedBlockItem.tsx +0 -25
- package/src/components/block/table/cell/index.ts +0 -8
- package/src/components/block/table/cell/lib/BlockTableCellProps.ts +0 -7
- package/src/components/block/table/cell/lib/index.ts +0 -1
- package/src/components/block/table/head/TableHead.tsx +0 -48
- package/src/components/block/table/head/index.ts +0 -1
- package/src/components/block/table/index.ts +0 -4
- package/src/components/block/table/row/TableRow.stories.tsx +0 -34
- package/src/components/block/table/row/TableRow.tsx +0 -46
- package/src/components/block/table/row/index.ts +0 -1
- package/src/components/chain/controls/PollingControlsFlexbox.tsx +0 -76
- package/src/components/chain/controls/PulseSvgIcon.tsx +0 -71
- package/src/components/chain/controls/index.ts +0 -2
- package/src/components/chain/dialog/Dialog.tsx +0 -20
- package/src/components/chain/dialog/index.ts +0 -1
- package/src/components/chain/hooks/index.ts +0 -1
- package/src/components/chain/hooks/useOnBlock.ts +0 -55
- package/src/components/chain/index.ts +0 -6
- package/src/components/chain/list/Animated.tsx +0 -19
- package/src/components/chain/list/TableEx.tsx +0 -12
- package/src/components/chain/list/index.ts +0 -2
- package/src/components/chain/pagination/BlockChainPagination.tsx +0 -11
- package/src/components/chain/pagination/hooks/index.ts +0 -1
- package/src/components/chain/pagination/hooks/usePagination.tsx +0 -22
- package/src/components/chain/pagination/index.ts +0 -2
- package/src/components/chain/stats/Dialog.tsx +0 -49
- package/src/components/chain/stats/index.ts +0 -1
- package/src/components/chain/stats/producer/ProducerFlexbox.tsx +0 -32
- package/src/components/chain/stats/producer/Table.tsx +0 -39
- package/src/components/chain/stats/producer/index.ts +0 -2
- package/src/components/chain/styled/BlockListWrapperFlexbox.tsx +0 -15
- package/src/components/chain/styled/index.ts +0 -1
- package/src/components/index.ts +0 -7
- package/src/components/payload/builder/BuilderComponentProps.ts +0 -5
- package/src/components/payload/builder/Flexbox.tsx +0 -30
- package/src/components/payload/builder/index.ts +0 -4
- package/src/components/payload/builder/producer-intent/Flexbox.stories.tsx +0 -14
- package/src/components/payload/builder/producer-intent/Flexbox.tsx +0 -15
- package/src/components/payload/builder/producer-intent/Form.tsx +0 -69
- package/src/components/payload/builder/producer-intent/index.ts +0 -1
- package/src/components/payload/builder/transfer/Flexbox.stories.tsx +0 -14
- package/src/components/payload/builder/transfer/Flexbox.tsx +0 -15
- package/src/components/payload/builder/transfer/Form.tsx +0 -82
- package/src/components/payload/builder/transfer/Transfer.ts +0 -3
- package/src/components/payload/builder/transfer/builder/SingleFlexbox.tsx +0 -51
- package/src/components/payload/builder/transfer/builder/index.ts +0 -1
- package/src/components/payload/builder/transfer/index.ts +0 -2
- package/src/components/payload/fields/BlockNumberTextField.tsx +0 -40
- package/src/components/payload/fields/XyoAddressTextField.tsx +0 -71
- package/src/components/payload/fields/index.ts +0 -2
- package/src/components/payload/index.ts +0 -2
- package/src/components/rate/SpanTypography.tsx +0 -20
- package/src/components/rate/SpeedTypography.tsx +0 -17
- package/src/components/rate/TimeTypography.tsx +0 -17
- package/src/components/rate/flexbox/FlexBox.stories.tsx +0 -46
- package/src/components/rate/flexbox/FlexBox.tsx +0 -31
- package/src/components/rate/flexbox/index.ts +0 -1
- package/src/components/rate/gauge/Container.stories.tsx +0 -80
- package/src/components/rate/gauge/Container.tsx +0 -75
- package/src/components/rate/gauge/Pointer.tsx +0 -67
- package/src/components/rate/gauge/Ticks.tsx +0 -122
- package/src/components/rate/gauge/WithLabel.stories.tsx +0 -73
- package/src/components/rate/gauge/WithLabel.tsx +0 -20
- package/src/components/rate/gauge/helpers/blockRateConversions.ts +0 -104
- package/src/components/rate/gauge/helpers/index.ts +0 -1
- package/src/components/rate/gauge/index.ts +0 -4
- package/src/components/rate/index.ts +0 -6
- package/src/components/rate/support/MetricTypography.tsx +0 -78
- package/src/components/rate/support/index.ts +0 -1
- package/src/components/table/StyledLinkableTableRow.tsx +0 -12
- package/src/components/table/index.ts +0 -1
- package/src/components/transactions/TransactionCountChip.tsx +0 -34
- package/src/components/transactions/TransactionsQuickTipButton.tsx +0 -86
- package/src/components/transactions/index.ts +0 -3
- package/src/components/transactions/submit/Builder.tsx +0 -55
- package/src/components/transactions/submit/Network.tsx +0 -36
- package/src/components/transactions/submit/SubmitChain.stories.tsx +0 -14
- package/src/components/transactions/submit/SubmitChain.tsx +0 -91
- package/src/components/transactions/submit/index.ts +0 -3
- package/src/context/analyzer/Provider.tsx +0 -41
- package/src/context/analyzer/context.ts +0 -5
- package/src/context/analyzer/index.ts +0 -5
- package/src/context/analyzer/state.ts +0 -13
- package/src/context/analyzer/use.ts +0 -6
- package/src/context/chain/Context.ts +0 -5
- package/src/context/chain/Provider.tsx +0 -49
- package/src/context/chain/State.ts +0 -8
- package/src/context/chain/index.ts +0 -4
- package/src/context/chain/use.ts +0 -6
- package/src/context/index.ts +0 -3
- package/src/context/polling/Provider.tsx +0 -27
- package/src/context/polling/context.ts +0 -5
- package/src/context/polling/index.ts +0 -4
- package/src/context/polling/state.ts +0 -8
- package/src/context/polling/use.ts +0 -5
- package/src/helpers/index.ts +0 -1
- package/src/helpers/rate/index.ts +0 -1
- package/src/helpers/rate/rateUnitToLabel.ts +0 -27
- package/src/helpers/txsFromBlock.ts +0 -12
- package/src/hooks/chain-iterator/index.ts +0 -1
- package/src/hooks/chain-iterator/useChainIteratorParams.ts +0 -55
- package/src/hooks/index.ts +0 -3
- package/src/hooks/useBaseContext.ts +0 -8
- package/src/hooks/useTxsFromBlock.ts +0 -12
- package/src/index.ts +0 -3
- package/src/lib/getChainArchivist.ts +0 -20
- package/src/lib/getChainId.ts +0 -8
- package/src/lib/index.ts +0 -2
- package/src/stories/ChainArchivistDecorator.tsx +0 -43
- package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +0 -71
- package/src/stories/index.ts +0 -2
- package/src/types/BlockComponentProps.ts +0 -13
- package/src/types/BlockComponents.ts +0 -7
- package/src/types/BlockListComponentProps.ts +0 -6
- package/src/types/global.d.ts +0 -1
- package/src/types/index.ts +0 -4
- package/src/types/render/BlockChainRenderProps.ts +0 -28
- package/src/types/render/RemoteArchivistProps.ts +0 -5
- package/src/types/render/flexbox/BlockChainRenderFlexboxProps.ts +0 -8
- package/src/types/render/flexbox/RenderFlexboxProps.ts +0 -5
- package/src/types/render/flexbox/index.ts +0 -2
- package/src/types/render/index.ts +0 -4
- package/src/types/render/table/BlockChainRenderTableExProps.ts +0 -8
- package/src/types/render/table/RenderTableProps.ts +0 -5
- package/src/types/render/table/index.ts +0 -2
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { CircularProgress } from '@mui/material'
|
|
2
|
-
import type { Decorator } from '@storybook/react-vite'
|
|
3
|
-
import { usePromise } from '@xylabs/react-promise'
|
|
4
|
-
import { delay } from '@xylabs/sdk-js'
|
|
5
|
-
import { buildRandomBlockChain } from '@xyo-network/react-chain-shared'
|
|
6
|
-
import { ArchivistConfigSchema, MemoryArchivist } from '@xyo-network/sdk-js'
|
|
7
|
-
import type { BlockBoundWitness } from '@xyo-network/xl1-sdk'
|
|
8
|
-
import { flattenHydratedBlock } from '@xyo-network/xl1-sdk'
|
|
9
|
-
import React, { useEffect, useState } from 'react'
|
|
10
|
-
|
|
11
|
-
import { getChainId } from '../lib/index.ts'
|
|
12
|
-
import type { BlockChainRenderBaseProps } from '../types/index.ts'
|
|
13
|
-
|
|
14
|
-
let chainArchivistRef: MemoryArchivist | undefined
|
|
15
|
-
|
|
16
|
-
export const ChainArchivistDelayedInsertDecorator: Decorator = (Story, context) => {
|
|
17
|
-
const [firstBlock, setFirstBlock] = useState<BlockBoundWitness>()
|
|
18
|
-
|
|
19
|
-
const [randomBlockChain] = usePromise(async () => await buildRandomBlockChain(), [])
|
|
20
|
-
const [chainArchivist] = usePromise(async () => {
|
|
21
|
-
if (chainArchivistRef) {
|
|
22
|
-
return chainArchivistRef
|
|
23
|
-
} else {
|
|
24
|
-
chainArchivistRef = await MemoryArchivist.create({ config: { schema: ArchivistConfigSchema, name: 'ChainArchivist' } })
|
|
25
|
-
return chainArchivistRef
|
|
26
|
-
}
|
|
27
|
-
}, [])
|
|
28
|
-
|
|
29
|
-
const [, delayedInsertError] = usePromise(async () => {
|
|
30
|
-
if (chainArchivist && randomBlockChain) {
|
|
31
|
-
// TODO - use buildRandomChain helper
|
|
32
|
-
for (const hydratedBlock of randomBlockChain) {
|
|
33
|
-
const flattened = flattenHydratedBlock(hydratedBlock)
|
|
34
|
-
// insert the block and subsequent payloads
|
|
35
|
-
await chainArchivist.insert(flattened)
|
|
36
|
-
|
|
37
|
-
// confirm the first block was inserted and set state so the story can load
|
|
38
|
-
setFirstBlock(prev => prev ?? hydratedBlock[0])
|
|
39
|
-
|
|
40
|
-
// we know we are gonna get a new block, so simulate the delay
|
|
41
|
-
await delay(1000)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}, [chainArchivist, randomBlockChain])
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
if (delayedInsertError) {
|
|
48
|
-
console.error(delayedInsertError)
|
|
49
|
-
}
|
|
50
|
-
}, [delayedInsertError])
|
|
51
|
-
|
|
52
|
-
const [blockChainRenderProps] = usePromise(async () => {
|
|
53
|
-
const chainId = await getChainId()
|
|
54
|
-
return { chainArchivist, chainId }
|
|
55
|
-
}, [chainArchivist])
|
|
56
|
-
const { args } = context
|
|
57
|
-
|
|
58
|
-
const props = {
|
|
59
|
-
...context,
|
|
60
|
-
args: {
|
|
61
|
-
...args,
|
|
62
|
-
blockChainRenderProps: {
|
|
63
|
-
...(args.blockChainRenderProps as BlockChainRenderBaseProps),
|
|
64
|
-
...blockChainRenderProps,
|
|
65
|
-
head: randomBlockChain?.[0][0]?._hash,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return firstBlock ? <Story {...props} /> : <CircularProgress />
|
|
71
|
-
}
|
package/src/stories/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/sdk-js'
|
|
2
|
-
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-sdk'
|
|
3
|
-
|
|
4
|
-
/** Interface for all components that render a single block */
|
|
5
|
-
export interface BlockComponentProps {
|
|
6
|
-
block: HydratedBlockWithHashMeta
|
|
7
|
-
defaultExpanded?: boolean
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/** Interface for all components that render a single block with transactions */
|
|
11
|
-
export interface BlockComponentWithTxsProps extends BlockComponentProps {
|
|
12
|
-
transactions: Hash[]
|
|
13
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NodesWithKeys } from '@xylabs/react-animation'
|
|
2
|
-
import type { HydratedBlock } from '@xyo-network/xl1-sdk'
|
|
3
|
-
|
|
4
|
-
/** Interface for all block components meant to be rendered in a chain */
|
|
5
|
-
export interface BlockChainRenderComponent extends NodesWithKeys {
|
|
6
|
-
block: HydratedBlock
|
|
7
|
-
}
|
package/src/types/global.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@mui/material/themeCssVarsAugmentation'
|
package/src/types/index.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { CreatableName, Hash } from '@xylabs/sdk-js'
|
|
2
|
-
import type { Payload, WithStorageMeta } from '@xyo-network/sdk-js'
|
|
3
|
-
import type { ChainId, PayloadMapRead } from '@xyo-network/xl1-sdk'
|
|
4
|
-
|
|
5
|
-
/** Props that control the rendering (not blockchain specific) */
|
|
6
|
-
export interface RenderProps {
|
|
7
|
-
maxBlocks?: number
|
|
8
|
-
pageSize?: number
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** Fields needed to talk to a block chain iterator */
|
|
12
|
-
export interface BlockChainIterator {
|
|
13
|
-
chainId?: ChainId
|
|
14
|
-
chainMap?: PayloadMapRead<WithStorageMeta<Payload>>
|
|
15
|
-
head?: Hash
|
|
16
|
-
name: CreatableName
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** Props for rendering a blockchain */
|
|
20
|
-
export interface BlockChainRenderProps extends BlockChainIterator, RenderProps {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** Base interface for encapsulating blockChainRenderProps for easy extension */
|
|
25
|
-
export interface BlockChainRenderBaseProps {
|
|
26
|
-
blockChainRenderProps?: BlockChainRenderProps
|
|
27
|
-
error?: Error
|
|
28
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
2
|
-
|
|
3
|
-
import type { BlockChainRenderBaseProps } from '../BlockChainRenderProps.ts'
|
|
4
|
-
import type { RemoteArchivistProps } from '../RemoteArchivistProps.ts'
|
|
5
|
-
|
|
6
|
-
export interface BlockChainRenderFlexboxProps extends BlockChainRenderBaseProps, FlexBoxProps {}
|
|
7
|
-
|
|
8
|
-
export interface RemoteBlockChainRenderFlexboxProps extends BlockChainRenderBaseProps, RemoteArchivistProps, FlexBoxProps {}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { TableExProps } from '@xyo-network/react-table'
|
|
2
|
-
|
|
3
|
-
import type { BlockChainRenderBaseProps } from '../BlockChainRenderProps.ts'
|
|
4
|
-
import type { RemoteArchivistProps } from '../RemoteArchivistProps.ts'
|
|
5
|
-
|
|
6
|
-
export interface BlockChainRenderTableExProps extends BlockChainRenderBaseProps, TableExProps {}
|
|
7
|
-
|
|
8
|
-
export interface RemoteBlockChainRenderTableExProps extends BlockChainRenderBaseProps, RemoteArchivistProps, TableExProps {}
|