@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.
- package/dist/browser/index.mjs +9 -10
- 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/tsxFromBlock.d.ts +2 -2
- package/dist/types/components/block/helpers/tsxFromBlock.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/useStaticBlockComponents.d.ts +1 -1
- package/dist/types/components/block/hooks/useStaticBlockComponents.d.ts.map +1 -1
- package/dist/types/components/block/hooks/useTxsFromBlock.d.ts +2 -2
- package/dist/types/components/block/hooks/useTxsFromBlock.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/lib/BlockTableCellProps.d.ts +1 -1
- package/dist/types/components/block/table/cell/lib/BlockTableCellProps.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/payload/builder/transfer/Form.d.ts.map +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/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/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 +41 -41
- package/src/components/block/ProducerChip.tsx +1 -1
- package/src/components/block/helpers/blockProducer.ts +1 -1
- package/src/components/block/helpers/tsxFromBlock.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/useStaticBlockComponents.ts +1 -1
- package/src/components/block/hooks/useTxsFromBlock.ts +1 -1
- package/src/components/block/menu/Expanded.tsx +1 -1
- package/src/components/block/table/cell/lib/BlockTableCellProps.ts +1 -1
- 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 +6 -6
- package/src/components/transactions/TransactionsQuickTipButton.tsx +1 -1
- package/src/components/transactions/submit/Builder.tsx +1 -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/hooks/chain-iterator/ChainIteratorStore.ts +4 -4
- 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 +4 -4
- 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
|
@@ -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/
|
|
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 {
|
|
4
|
-
import { TransferSchema } from '@xyo-network/
|
|
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:
|
|
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
|
|
26
|
+
return {
|
|
27
|
+
from: fromAddress,
|
|
28
28
|
schema: TransferSchema,
|
|
29
29
|
transfers: transfersRecord,
|
|
30
30
|
epoch: Date.now(),
|
|
31
|
-
}
|
|
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/
|
|
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,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/
|
|
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/
|
|
7
|
-
import { isBlockBoundWitness } from '@xyo-network/
|
|
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,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)
|
|
@@ -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/
|
|
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/
|
|
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/
|
|
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/
|
|
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 {
|