@xyo-network/react-chain-blockchain 1.1.6 → 1.2.0

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 (83) hide show
  1. package/dist/browser/index.mjs +9 -10
  2. package/dist/browser/index.mjs.map +1 -1
  3. package/dist/types/components/block/ProducerChip.d.ts +1 -1
  4. package/dist/types/components/block/ProducerChip.d.ts.map +1 -1
  5. package/dist/types/components/block/helpers/blockProducer.d.ts +1 -1
  6. package/dist/types/components/block/helpers/blockProducer.d.ts.map +1 -1
  7. package/dist/types/components/block/helpers/tsxFromBlock.d.ts +2 -2
  8. package/dist/types/components/block/helpers/tsxFromBlock.d.ts.map +1 -1
  9. package/dist/types/components/block/hooks/useBlockProducer.d.ts +1 -1
  10. package/dist/types/components/block/hooks/useBlockProducer.d.ts.map +1 -1
  11. package/dist/types/components/block/hooks/useDynamicBlockComponents.d.ts +1 -1
  12. package/dist/types/components/block/hooks/useDynamicBlockComponents.d.ts.map +1 -1
  13. package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts +1 -1
  14. package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts.map +1 -1
  15. package/dist/types/components/block/hooks/useTxsFromBlock.d.ts +2 -2
  16. package/dist/types/components/block/hooks/useTxsFromBlock.d.ts.map +1 -1
  17. package/dist/types/components/block/menu/Expanded.d.ts +1 -1
  18. package/dist/types/components/block/menu/Expanded.d.ts.map +1 -1
  19. package/dist/types/components/block/table/cell/lib/BlockTableCellProps.d.ts +1 -1
  20. package/dist/types/components/block/table/cell/lib/BlockTableCellProps.d.ts.map +1 -1
  21. package/dist/types/components/chain/hooks/useOnBlock.d.ts +1 -1
  22. package/dist/types/components/chain/hooks/useOnBlock.d.ts.map +1 -1
  23. package/dist/types/components/chain/render/dynamic/hooks/useDynamicBlockRenderComponents.d.ts +1 -1
  24. package/dist/types/components/payload/builder/transfer/Form.d.ts.map +1 -1
  25. package/dist/types/components/transactions/TransactionsQuickTipButton.d.ts +1 -1
  26. package/dist/types/components/transactions/TransactionsQuickTipButton.d.ts.map +1 -1
  27. package/dist/types/components/transactions/submit/Builder.d.ts +1 -1
  28. package/dist/types/components/transactions/submit/Builder.d.ts.map +1 -1
  29. package/dist/types/context/analyzer/state.d.ts +1 -1
  30. package/dist/types/context/analyzer/state.d.ts.map +1 -1
  31. package/dist/types/context/chain/State.d.ts +1 -1
  32. package/dist/types/context/chain/State.d.ts.map +1 -1
  33. package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts +1 -1
  34. package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts.map +1 -1
  35. package/dist/types/hooks/chain-iterator/useChainIteratorParams.d.ts +3 -3
  36. package/dist/types/hooks/chain-iterator/useChainIteratorParams.d.ts.map +1 -1
  37. package/dist/types/hooks/chain-iterator/useChainIteratorStore.d.ts +1 -1
  38. package/dist/types/hooks/chain-iterator/useChainIteratorStore.d.ts.map +1 -1
  39. package/dist/types/hooks/chain-iterator/useChainIteratorUpdatingHead.d.ts +1 -1
  40. package/dist/types/hooks/chain-iterator/useChainIteratorUpdatingHead.d.ts.map +1 -1
  41. package/dist/types/hooks/useIterateChain.d.ts +1 -1
  42. package/dist/types/hooks/useIterateChain.d.ts.map +1 -1
  43. package/dist/types/lib/getChainInformation.d.ts +1 -1
  44. package/dist/types/lib/getChainInformation.d.ts.map +1 -1
  45. package/dist/types/stories/buildRandomBlockchain.d.ts +1 -1
  46. package/dist/types/stories/buildRandomBlockchain.d.ts.map +1 -1
  47. package/dist/types/types/BlockComponentProps.d.ts +1 -1
  48. package/dist/types/types/BlockComponentProps.d.ts.map +1 -1
  49. package/dist/types/types/BlockComponents.d.ts +1 -1
  50. package/dist/types/types/BlockComponents.d.ts.map +1 -1
  51. package/dist/types/types/render/BlockChainRenderProps.d.ts +1 -1
  52. package/dist/types/types/render/BlockChainRenderProps.d.ts.map +1 -1
  53. package/package.json +41 -41
  54. package/src/components/block/ProducerChip.tsx +1 -1
  55. package/src/components/block/helpers/blockProducer.ts +1 -1
  56. package/src/components/block/helpers/tsxFromBlock.ts +1 -1
  57. package/src/components/block/hooks/useBlockProducer.ts +1 -1
  58. package/src/components/block/hooks/useDynamicBlockComponents.ts +1 -1
  59. package/src/components/block/hooks/useStaticBlockComponents.ts +1 -1
  60. package/src/components/block/hooks/useTxsFromBlock.ts +1 -1
  61. package/src/components/block/menu/Expanded.tsx +1 -1
  62. package/src/components/block/table/cell/lib/BlockTableCellProps.ts +1 -1
  63. package/src/components/chain/hooks/useOnBlock.ts +1 -1
  64. package/src/components/payload/builder/producer-intent/Form.tsx +1 -1
  65. package/src/components/payload/builder/transfer/Form.tsx +6 -6
  66. package/src/components/transactions/TransactionsQuickTipButton.tsx +1 -1
  67. package/src/components/transactions/submit/Builder.tsx +1 -2
  68. package/src/components/transactions/submit/SubmitChain.tsx +2 -2
  69. package/src/context/analyzer/Provider.tsx +1 -1
  70. package/src/context/analyzer/state.ts +1 -1
  71. package/src/context/chain/State.ts +1 -1
  72. package/src/hooks/chain-iterator/ChainIteratorStore.ts +4 -4
  73. package/src/hooks/chain-iterator/useChainIteratorParams.ts +2 -2
  74. package/src/hooks/chain-iterator/useChainIteratorStore.ts +1 -1
  75. package/src/hooks/chain-iterator/useChainIteratorUpdatingHead.ts +1 -1
  76. package/src/hooks/useIterateChain.ts +4 -4
  77. package/src/lib/getChainInformation.ts +1 -1
  78. package/src/stories/ChainArchivistDelayedInsertDecorator.tsx +1 -1
  79. package/src/stories/ChainInfoContextDecorator.tsx +1 -1
  80. package/src/stories/buildRandomBlockchain.ts +1 -1
  81. package/src/types/BlockComponentProps.ts +1 -1
  82. package/src/types/BlockComponents.ts +1 -1
  83. package/src/types/render/BlockChainRenderProps.ts +1 -1
@@ -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/chain-model'
4
+ import type { ChainStakeIntent } from '@xyo-network/xl1-model'
5
5
  import type { MouseEventHandler } from 'react'
6
6
  import React, { useMemo, useState } from 'react'
7
7
 
@@ -1,8 +1,7 @@
1
1
  import { Button, FormControl } from '@mui/material'
2
2
  import type { Address } from '@xylabs/hex'
3
- import type { Elevated, Transfer } from '@xyo-network/chain-model'
4
- import { TransferSchema } from '@xyo-network/chain-model'
5
- import { elevate } from '@xyo-network/chain-protocol'
3
+ import type { Transfer } from '@xyo-network/xl1-model'
4
+ import { TransferSchema } from '@xyo-network/xl1-model'
6
5
  import type { MouseEventHandler } from 'react'
7
6
  import React, { useMemo, useState } from 'react'
8
7
 
@@ -17,18 +16,19 @@ export const TransferBuilderForm: React.FC<TransferBuilderFormProps> = ({ onBuil
17
16
  const [fromAddress, setFromAddress] = useState<Address>()
18
17
  const [transfers, setTransfers] = useState<TransferAmount[]>([])
19
18
 
20
- const transferPayload: Elevated<Transfer> | undefined = useMemo(() => {
19
+ const transferPayload: Transfer | undefined = useMemo(() => {
21
20
  if (fromAddress && transfers.length > 0) {
22
21
  const transfersRecord = {} as Transfer['transfers']
23
22
  for (const transfer of transfers) {
24
23
  transfersRecord[transfer.to] = transfer.amount
25
24
  }
26
25
 
27
- return elevate({
26
+ return {
27
+ from: fromAddress,
28
28
  schema: TransferSchema,
29
29
  transfers: transfersRecord,
30
30
  epoch: Date.now(),
31
- }, fromAddress)
31
+ }
32
32
  }
33
33
  }, [fromAddress, transfers])
34
34
 
@@ -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/chain-model'
12
+ import type { HydratedBlock } from '@xyo-network/xl1-model'
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/chain-model'
7
6
  import { defaultFees } from '@xyo-network/chain-protocol'
7
+ import type { TransactionBoundWitnessFields } from '@xyo-network/xl1-model'
8
8
  import React from 'react'
9
9
 
10
10
  export interface ChainTransactionBuilder {
@@ -27,7 +27,6 @@ export const ChainTransactionBuilder: React.FC<ChainTransactionBuilder> = ({ onS
27
27
  base: toHex(defaultFees.base),
28
28
  priority: toHex(defaultFees.priority),
29
29
  },
30
- nonce: [],
31
30
  }
32
31
 
33
32
  await onSubmitTx?.(chainTx)
@@ -8,11 +8,11 @@ import { Account } from '@xyo-network/account'
8
8
  import type { ApiEnvelope } from '@xyo-network/api-models'
9
9
  import { ArchivistInsertQuerySchema } from '@xyo-network/archivist-model'
10
10
  import { QueryBoundWitnessBuilder } from '@xyo-network/boundwitness-builder'
11
- import type { TransactionBoundWitnessFields } from '@xyo-network/chain-model'
12
11
  import { buildTransaction } from '@xyo-network/chain-protocol'
13
12
  import type { ModuleQueryResult } from '@xyo-network/module-model'
14
13
  import { PayloadBuilder } from '@xyo-network/payload-builder'
15
14
  import type { Payload } from '@xyo-network/payload-model'
15
+ import type { TransactionBoundWitnessFields } from '@xyo-network/xl1-model'
16
16
  import React, { useState } from 'react'
17
17
 
18
18
  import { ChainTransactionBuilder } from './Builder.tsx'
@@ -32,10 +32,10 @@ export const SubmitChainTransaction: React.FC = () => {
32
32
  const [transactionBoundWitness] = await buildTransaction(
33
33
  chainTx.chain,
34
34
  [],
35
+ [],
35
36
  randomAccount,
36
37
  chainTx.nbf,
37
38
  chainTx.exp,
38
- [],
39
39
  )
40
40
 
41
41
  const insertQuery = new PayloadBuilder({ schema: ArchivistInsertQuerySchema }).build()
@@ -1,4 +1,4 @@
1
- import type { HydratedBlock } from '@xyo-network/chain-model'
1
+ import type { HydratedBlock } from '@xyo-network/xl1-model'
2
2
  import type { PropsWithChildren } from 'react'
3
3
  import React, {
4
4
  useCallback, useMemo, useState,
@@ -1,5 +1,5 @@
1
- import type { ChainAnalyzer, HydratedBlock } from '@xyo-network/chain-model'
2
1
  import type { ContextExState } from '@xyo-network/react-shared'
2
+ import type { ChainAnalyzer, HydratedBlock } from '@xyo-network/xl1-model'
3
3
 
4
4
  export type ChainAnalyzerIds = 'producers'
5
5
 
@@ -1,6 +1,6 @@
1
1
  import type { ArchivistInstance } from '@xyo-network/archivist-model'
2
- import type { ChainBlockNumberIterator, ChainInformation } from '@xyo-network/chain-model'
3
2
  import type { ContextExState } from '@xyo-network/react-shared'
3
+ import type { ChainBlockNumberIterator, ChainInformation } from '@xyo-network/xl1-model'
4
4
 
5
5
  export interface ChainInfoState extends ContextExState {
6
6
  chainArchivist?: ArchivistInstance
@@ -1,12 +1,12 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
+ import { hydrateBlock } from '@xyo-network/chain-protocol'
3
+ import { XyoChainBlockNumberIterator } from '@xyo-network/chain-services'
4
+ import { PayloadBuilder } from '@xyo-network/payload-builder'
2
5
  import type {
3
6
  EventingChainBlockNumberIterator, HeadEventArgs,
4
7
  HydratedBlock,
5
8
  XyoChainIteratorParams,
6
- } from '@xyo-network/chain-model'
7
- import { hydrateBlock } from '@xyo-network/chain-protocol'
8
- import { XyoChainBlockNumberIterator } from '@xyo-network/chain-services'
9
- import { PayloadBuilder } from '@xyo-network/payload-builder'
9
+ } from '@xyo-network/xl1-model'
10
10
 
11
11
  export type Listener = (...args: Array<unknown>) => void
12
12
 
@@ -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/chain-model'
7
- import { isBlockBoundWitness } from '@xyo-network/chain-model'
6
+ import type { BlockBoundWitness } from '@xyo-network/xl1-model'
7
+ import { isBlockBoundWitness } from '@xyo-network/xl1-model'
8
8
 
9
9
  import type { BlockChainIterator } from '../../types/index.ts'
10
10
 
@@ -1,5 +1,5 @@
1
1
  import { usePromise } from '@xylabs/react-promise'
2
- import type { XyoChainIteratorParams } from '@xyo-network/chain-model'
2
+ import type { XyoChainIteratorParams } from '@xyo-network/xl1-model'
3
3
  import {
4
4
  useEffect,
5
5
  useMemo, useRef, useSyncExternalStore,
@@ -1,7 +1,7 @@
1
1
  import { toHex } from '@xylabs/hex'
2
2
  import type { ArchivistInstance } from '@xyo-network/archivist-model'
3
- import type { ChainBlockNumberIterator } from '@xyo-network/chain-model'
4
3
  import { findMostRecentBlock } from '@xyo-network/chain-protocol'
4
+ import type { ChainBlockNumberIterator } from '@xyo-network/xl1-model'
5
5
  import { useEffect, useState } from 'react'
6
6
 
7
7
  export interface ChainIteratorUpdatingHeadParams {
@@ -1,13 +1,13 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import { usePromise } from '@xylabs/react-promise'
3
3
  import type { ReadArchivist } from '@xyo-network/archivist-model'
4
- import type {
5
- BlockBoundWitness, HydratedBlock, XyoChainIteratorParams,
6
- } from '@xyo-network/chain-model'
7
- import { isBlockBoundWitness } from '@xyo-network/chain-model'
8
4
  import { hydrateBlock } from '@xyo-network/chain-protocol'
9
5
  import { XyoChainBlockNumberIterator } from '@xyo-network/chain-services'
10
6
  import { PayloadBuilder } from '@xyo-network/payload-builder'
7
+ import type {
8
+ BlockBoundWitness, HydratedBlock, XyoChainIteratorParams,
9
+ } from '@xyo-network/xl1-model'
10
+ import { isBlockBoundWitness } from '@xyo-network/xl1-model'
11
11
 
12
12
  const getHydratedBlock = async (chainArchivist: ReadArchivist, head: BlockBoundWitness) => {
13
13
  const headHash = await PayloadBuilder.hash(head)
@@ -1,5 +1,5 @@
1
1
  import type { Promisable } from '@xylabs/promise'
2
- import type { ChainInformation } from '@xyo-network/chain-model'
2
+ import type { ChainInformation } from '@xyo-network/xl1-model'
3
3
 
4
4
  const id = 'ce080bf3043a40c6c8838c7e813c00ab53df1684'
5
5
 
@@ -4,8 +4,8 @@ import { delay } from '@xylabs/delay'
4
4
  import { usePromise } from '@xylabs/react-promise'
5
5
  import { MemoryArchivist } from '@xyo-network/archivist-memory'
6
6
  import { ArchivistConfigSchema } from '@xyo-network/archivist-model'
7
- import type { BlockBoundWitness } from '@xyo-network/chain-model'
8
7
  import { flattenHydratedBlock } from '@xyo-network/chain-protocol'
8
+ import type { BlockBoundWitness } from '@xyo-network/xl1-model'
9
9
  import React, { useEffect, useState } from 'react'
10
10
 
11
11
  import { getChainInformation } from '../lib/index.ts'
@@ -1,9 +1,9 @@
1
1
  import type { Decorator } from '@storybook/react'
2
2
  import { assertEx } from '@xylabs/assert'
3
3
  import { usePromise } from '@xylabs/react-promise'
4
- import { isBlockBoundWitness } from '@xyo-network/chain-model'
5
4
  import { XyoChainBlockNumberIterator } from '@xyo-network/chain-services'
6
5
  import { findFirstMatching } from '@xyo-network/chain-utils'
6
+ import { isBlockBoundWitness } from '@xyo-network/xl1-model'
7
7
  import React from 'react'
8
8
 
9
9
  import { ChainInfoProvider } from '../context/index.ts'
@@ -1,6 +1,6 @@
1
1
  import { Account } from '@xyo-network/account'
2
2
  import { buildRandomChain } from '@xyo-network/chain-ethereum'
3
- import type { HydratedBlock } from '@xyo-network/chain-model'
3
+ import type { HydratedBlock } from '@xyo-network/xl1-model'
4
4
 
5
5
  export const buildRandomBlockChain = async (blockCount = 10) => {
6
6
  // Create a producer
@@ -1,5 +1,5 @@
1
1
  import type { Hash } from '@xylabs/hex'
2
- import type { HydratedBlock } from '@xyo-network/chain-model'
2
+ import type { HydratedBlock } from '@xyo-network/xl1-model'
3
3
 
4
4
  /** Interface for all components that render a single block */
5
5
  export interface BlockComponentProps {
@@ -1,5 +1,5 @@
1
1
  import type { NodesWithKeys } from '@xylabs/react-animation'
2
- import type { HydratedBlock } from '@xyo-network/chain-model'
2
+ import type { HydratedBlock } from '@xyo-network/xl1-model'
3
3
 
4
4
  /** Interface for all block components meant to be rendered in a chain */
5
5
  export interface BlockChainRenderComponent extends NodesWithKeys {
@@ -1,6 +1,6 @@
1
1
  import type { Hash } from '@xylabs/hex'
2
2
  import type { ArchivistInstance } from '@xyo-network/archivist-model'
3
- import type { ChainInformation } from '@xyo-network/chain-model'
3
+ import type { ChainInformation } from '@xyo-network/xl1-model'
4
4
 
5
5
  /** Props that control the rendering (not blockchain specific) */
6
6
  export interface RenderProps {