@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.
Files changed (199) hide show
  1. package/README.md +9 -8854
  2. package/dist/browser/components/account/table/types/index.d.ts +1 -1
  3. package/dist/browser/components/account/table/types/index.d.ts.map +1 -1
  4. package/dist/browser/components/block/table/cell/NumberChip.d.ts.map +1 -1
  5. package/dist/browser/components/chain/controls/PulseSvgIcon.d.ts +5 -2
  6. package/dist/browser/components/chain/controls/PulseSvgIcon.d.ts.map +1 -1
  7. package/dist/browser/components/chain/hooks/useOnBlock.d.ts +7 -7
  8. package/dist/browser/components/chain/styled/BlockListWrapperFlexbox.d.ts +6 -1
  9. package/dist/browser/components/chain/styled/BlockListWrapperFlexbox.d.ts.map +1 -1
  10. package/dist/browser/components/table/StyledLinkableTableRow.d.ts +5 -4
  11. package/dist/browser/components/table/StyledLinkableTableRow.d.ts.map +1 -1
  12. package/dist/browser/context/analyzer/context.d.ts +3 -3
  13. package/dist/browser/context/analyzer/use.d.ts +1 -1
  14. package/dist/browser/context/chain/Context.d.ts +3 -3
  15. package/dist/browser/context/chain/use.d.ts +1 -1
  16. package/dist/browser/hooks/useBaseContext.d.ts +2 -8
  17. package/dist/browser/hooks/useBaseContext.d.ts.map +1 -1
  18. package/dist/browser/hooks/useTxsFromBlock.d.ts +1 -1
  19. package/dist/browser/hooks/useTxsFromBlock.d.ts.map +1 -1
  20. package/dist/browser/index.mjs +3 -3
  21. package/dist/browser/index.mjs.map +1 -1
  22. package/package.json +167 -58
  23. package/src/components/FeatureNotAvailable.tsx +0 -20
  24. package/src/components/account/BalanceHistoryFlexbox.stories.tsx +0 -25
  25. package/src/components/account/BalanceHistoryFlexbox.tsx +0 -53
  26. package/src/components/account/helpers/formatBalanceMagnitude.ts +0 -14
  27. package/src/components/account/helpers/index.ts +0 -1
  28. package/src/components/account/hooks/index.ts +0 -1
  29. package/src/components/account/hooks/usePagedAccountBalanceHistory.ts +0 -39
  30. package/src/components/account/index.ts +0 -4
  31. package/src/components/account/table/BalanceHistoryTableEx.stories.tsx +0 -111
  32. package/src/components/account/table/BalanceHistoryTableEx.tsx +0 -37
  33. package/src/components/account/table/BalanceHistoryTableRow.stories.tsx +0 -52
  34. package/src/components/account/table/BalanceHistoryTableRow.tsx +0 -60
  35. package/src/components/account/table/RawAmountTableCell.tsx +0 -53
  36. package/src/components/account/table/cell/AddressTableCell.tsx +0 -27
  37. package/src/components/account/table/cell/BlockNumber.tsx +0 -39
  38. package/src/components/account/table/cell/HashTableCell.tsx +0 -46
  39. package/src/components/account/table/cell/index.ts +0 -3
  40. package/src/components/account/table/hooks/index.ts +0 -1
  41. package/src/components/account/table/hooks/useLinkedBalanceHistoryItem.tsx +0 -29
  42. package/src/components/account/table/index.ts +0 -5
  43. package/src/components/account/table/types/index.ts +0 -18
  44. package/src/components/block/BlockHeadingFlexbox.stories.tsx +0 -75
  45. package/src/components/block/BlockHeadingFlexbox.tsx +0 -56
  46. package/src/components/block/ChipSkeleton.tsx +0 -7
  47. package/src/components/block/LinkedDivider.tsx +0 -27
  48. package/src/components/block/ProducerChip.tsx +0 -45
  49. package/src/components/block/helpers/blockProducer.ts +0 -5
  50. package/src/components/block/helpers/buildBlockChainRenderComponent.tsx +0 -32
  51. package/src/components/block/helpers/index.ts +0 -3
  52. package/src/components/block/helpers/payloadCountsFromBlock.ts +0 -10
  53. package/src/components/block/hooks/index.ts +0 -4
  54. package/src/components/block/hooks/useAnchorElement.ts +0 -19
  55. package/src/components/block/hooks/useBlockHeadingEvents.ts +0 -11
  56. package/src/components/block/hooks/useBlockProducer.ts +0 -11
  57. package/src/components/block/hooks/usePayloadCountsFromBlock.ts +0 -13
  58. package/src/components/block/index.ts +0 -6
  59. package/src/components/block/menu/Expanded.tsx +0 -34
  60. package/src/components/block/menu/index.ts +0 -1
  61. package/src/components/block/table/Ex.stories.tsx +0 -64
  62. package/src/components/block/table/Ex.tsx +0 -21
  63. package/src/components/block/table/cell/BlockNumber.tsx +0 -35
  64. package/src/components/block/table/cell/Epoch.tsx +0 -46
  65. package/src/components/block/table/cell/Hash.tsx +0 -46
  66. package/src/components/block/table/cell/JsonView.tsx +0 -44
  67. package/src/components/block/table/cell/NumberChip.tsx +0 -12
  68. package/src/components/block/table/cell/PayloadCounts.tsx +0 -65
  69. package/src/components/block/table/cell/Producer.tsx +0 -63
  70. package/src/components/block/table/cell/TransactionCount.tsx +0 -56
  71. package/src/components/block/table/cell/Verification.tsx +0 -25
  72. package/src/components/block/table/cell/helpers/index.ts +0 -1
  73. package/src/components/block/table/cell/helpers/timeFunctions.ts +0 -44
  74. package/src/components/block/table/cell/hooks/index.ts +0 -1
  75. package/src/components/block/table/cell/hooks/useLinkedBlockItem.tsx +0 -25
  76. package/src/components/block/table/cell/index.ts +0 -8
  77. package/src/components/block/table/cell/lib/BlockTableCellProps.ts +0 -7
  78. package/src/components/block/table/cell/lib/index.ts +0 -1
  79. package/src/components/block/table/head/TableHead.tsx +0 -48
  80. package/src/components/block/table/head/index.ts +0 -1
  81. package/src/components/block/table/index.ts +0 -4
  82. package/src/components/block/table/row/TableRow.stories.tsx +0 -34
  83. package/src/components/block/table/row/TableRow.tsx +0 -46
  84. package/src/components/block/table/row/index.ts +0 -1
  85. package/src/components/chain/controls/PollingControlsFlexbox.tsx +0 -76
  86. package/src/components/chain/controls/PulseSvgIcon.tsx +0 -71
  87. package/src/components/chain/controls/index.ts +0 -2
  88. package/src/components/chain/dialog/Dialog.tsx +0 -20
  89. package/src/components/chain/dialog/index.ts +0 -1
  90. package/src/components/chain/hooks/index.ts +0 -1
  91. package/src/components/chain/hooks/useOnBlock.ts +0 -55
  92. package/src/components/chain/index.ts +0 -6
  93. package/src/components/chain/list/Animated.tsx +0 -19
  94. package/src/components/chain/list/TableEx.tsx +0 -12
  95. package/src/components/chain/list/index.ts +0 -2
  96. package/src/components/chain/pagination/BlockChainPagination.tsx +0 -11
  97. package/src/components/chain/pagination/hooks/index.ts +0 -1
  98. package/src/components/chain/pagination/hooks/usePagination.tsx +0 -22
  99. package/src/components/chain/pagination/index.ts +0 -2
  100. package/src/components/chain/stats/Dialog.tsx +0 -49
  101. package/src/components/chain/stats/index.ts +0 -1
  102. package/src/components/chain/stats/producer/ProducerFlexbox.tsx +0 -32
  103. package/src/components/chain/stats/producer/Table.tsx +0 -39
  104. package/src/components/chain/stats/producer/index.ts +0 -2
  105. package/src/components/chain/styled/BlockListWrapperFlexbox.tsx +0 -15
  106. package/src/components/chain/styled/index.ts +0 -1
  107. package/src/components/index.ts +0 -7
  108. package/src/components/payload/builder/BuilderComponentProps.ts +0 -5
  109. package/src/components/payload/builder/Flexbox.tsx +0 -30
  110. package/src/components/payload/builder/index.ts +0 -4
  111. package/src/components/payload/builder/producer-intent/Flexbox.stories.tsx +0 -14
  112. package/src/components/payload/builder/producer-intent/Flexbox.tsx +0 -15
  113. package/src/components/payload/builder/producer-intent/Form.tsx +0 -69
  114. package/src/components/payload/builder/producer-intent/index.ts +0 -1
  115. package/src/components/payload/builder/transfer/Flexbox.stories.tsx +0 -14
  116. package/src/components/payload/builder/transfer/Flexbox.tsx +0 -15
  117. package/src/components/payload/builder/transfer/Form.tsx +0 -82
  118. package/src/components/payload/builder/transfer/Transfer.ts +0 -3
  119. package/src/components/payload/builder/transfer/builder/SingleFlexbox.tsx +0 -51
  120. package/src/components/payload/builder/transfer/builder/index.ts +0 -1
  121. package/src/components/payload/builder/transfer/index.ts +0 -2
  122. package/src/components/payload/fields/BlockNumberTextField.tsx +0 -40
  123. package/src/components/payload/fields/XyoAddressTextField.tsx +0 -71
  124. package/src/components/payload/fields/index.ts +0 -2
  125. package/src/components/payload/index.ts +0 -2
  126. package/src/components/rate/SpanTypography.tsx +0 -20
  127. package/src/components/rate/SpeedTypography.tsx +0 -17
  128. package/src/components/rate/TimeTypography.tsx +0 -17
  129. package/src/components/rate/flexbox/FlexBox.stories.tsx +0 -46
  130. package/src/components/rate/flexbox/FlexBox.tsx +0 -31
  131. package/src/components/rate/flexbox/index.ts +0 -1
  132. package/src/components/rate/gauge/Container.stories.tsx +0 -80
  133. package/src/components/rate/gauge/Container.tsx +0 -75
  134. package/src/components/rate/gauge/Pointer.tsx +0 -67
  135. package/src/components/rate/gauge/Ticks.tsx +0 -122
  136. package/src/components/rate/gauge/WithLabel.stories.tsx +0 -73
  137. package/src/components/rate/gauge/WithLabel.tsx +0 -20
  138. package/src/components/rate/gauge/helpers/blockRateConversions.ts +0 -104
  139. package/src/components/rate/gauge/helpers/index.ts +0 -1
  140. package/src/components/rate/gauge/index.ts +0 -4
  141. package/src/components/rate/index.ts +0 -6
  142. package/src/components/rate/support/MetricTypography.tsx +0 -78
  143. package/src/components/rate/support/index.ts +0 -1
  144. package/src/components/table/StyledLinkableTableRow.tsx +0 -12
  145. package/src/components/table/index.ts +0 -1
  146. package/src/components/transactions/TransactionCountChip.tsx +0 -34
  147. package/src/components/transactions/TransactionsQuickTipButton.tsx +0 -86
  148. package/src/components/transactions/index.ts +0 -3
  149. package/src/components/transactions/submit/Builder.tsx +0 -55
  150. package/src/components/transactions/submit/Network.tsx +0 -36
  151. package/src/components/transactions/submit/SubmitChain.stories.tsx +0 -14
  152. package/src/components/transactions/submit/SubmitChain.tsx +0 -91
  153. package/src/components/transactions/submit/index.ts +0 -3
  154. package/src/context/analyzer/Provider.tsx +0 -41
  155. package/src/context/analyzer/context.ts +0 -5
  156. package/src/context/analyzer/index.ts +0 -5
  157. package/src/context/analyzer/state.ts +0 -13
  158. package/src/context/analyzer/use.ts +0 -6
  159. package/src/context/chain/Context.ts +0 -5
  160. package/src/context/chain/Provider.tsx +0 -49
  161. package/src/context/chain/State.ts +0 -8
  162. package/src/context/chain/index.ts +0 -4
  163. package/src/context/chain/use.ts +0 -6
  164. package/src/context/index.ts +0 -3
  165. package/src/context/polling/Provider.tsx +0 -27
  166. package/src/context/polling/context.ts +0 -5
  167. package/src/context/polling/index.ts +0 -4
  168. package/src/context/polling/state.ts +0 -8
  169. package/src/context/polling/use.ts +0 -5
  170. package/src/helpers/index.ts +0 -1
  171. package/src/helpers/rate/index.ts +0 -1
  172. package/src/helpers/rate/rateUnitToLabel.ts +0 -27
  173. package/src/helpers/txsFromBlock.ts +0 -12
  174. package/src/hooks/chain-iterator/index.ts +0 -1
  175. package/src/hooks/chain-iterator/useChainIteratorParams.ts +0 -55
  176. package/src/hooks/index.ts +0 -3
  177. package/src/hooks/useBaseContext.ts +0 -8
  178. package/src/hooks/useTxsFromBlock.ts +0 -12
  179. package/src/index.ts +0 -3
  180. package/src/lib/getChainArchivist.ts +0 -20
  181. package/src/lib/getChainId.ts +0 -8
  182. package/src/lib/index.ts +0 -2
  183. package/src/stories/ChainArchivistDecorator.tsx +0 -43
  184. package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +0 -71
  185. package/src/stories/index.ts +0 -2
  186. package/src/types/BlockComponentProps.ts +0 -13
  187. package/src/types/BlockComponents.ts +0 -7
  188. package/src/types/BlockListComponentProps.ts +0 -6
  189. package/src/types/global.d.ts +0 -1
  190. package/src/types/index.ts +0 -4
  191. package/src/types/render/BlockChainRenderProps.ts +0 -28
  192. package/src/types/render/RemoteArchivistProps.ts +0 -5
  193. package/src/types/render/flexbox/BlockChainRenderFlexboxProps.ts +0 -8
  194. package/src/types/render/flexbox/RenderFlexboxProps.ts +0 -5
  195. package/src/types/render/flexbox/index.ts +0 -2
  196. package/src/types/render/index.ts +0 -4
  197. package/src/types/render/table/BlockChainRenderTableExProps.ts +0 -8
  198. package/src/types/render/table/RenderTableProps.ts +0 -5
  199. 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
- }
@@ -1,2 +0,0 @@
1
- export * from './ChainArchivistDecorator.tsx'
2
- export * from './ChainArchivistDelayedInsertDecorator.tsx'
@@ -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
- }
@@ -1,6 +0,0 @@
1
- import type { BlockChainRenderComponent } from './BlockComponents.ts'
2
-
3
- /** Props for components that can render a list of blocks, i.e. Table, Animated */
4
- export interface BlockListComponentProps {
5
- blockChainRenderComponents?: BlockChainRenderComponent[]
6
- }
@@ -1 +0,0 @@
1
- import '@mui/material/themeCssVarsAugmentation'
@@ -1,4 +0,0 @@
1
- export * from './BlockComponentProps.ts'
2
- export * from './BlockComponents.ts'
3
- export * from './BlockListComponentProps.ts'
4
- export * from './render/index.ts'
@@ -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,5 +0,0 @@
1
- /** Props needed to resolve remote Archivist for renderer */
2
- export interface RemoteArchivistProps {
3
- chainArchivistModuleId?: string
4
- url?: string
5
- }
@@ -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,5 +0,0 @@
1
- import type { FlexBoxProps } from '@xylabs/react-flexbox'
2
-
3
- import type { RenderProps } from '../BlockChainRenderProps.ts'
4
-
5
- export interface RenderFlexboxProps extends RenderProps, FlexBoxProps {}
@@ -1,2 +0,0 @@
1
- export * from './BlockChainRenderFlexboxProps.ts'
2
- export * from './RenderFlexboxProps.ts'
@@ -1,4 +0,0 @@
1
- export * from './BlockChainRenderProps.ts'
2
- export * from './flexbox/index.ts'
3
- export * from './RemoteArchivistProps.ts'
4
- export * from './table/index.ts'
@@ -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 {}
@@ -1,5 +0,0 @@
1
- import type { TableProps } from '@mui/material'
2
-
3
- import type { RenderProps } from '../BlockChainRenderProps.ts'
4
-
5
- export interface RenderTableProps extends RenderProps, TableProps {}
@@ -1,2 +0,0 @@
1
- export * from './BlockChainRenderTableExProps.ts'
2
- export * from './RenderTableProps.ts'