@xyo-network/react-chain-blockchain 1.16.24 → 1.16.26
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/components/block/hooks/useDynamicBlockComponents.d.ts +2 -2
- package/dist/browser/components/block/hooks/useDynamicBlockComponents.d.ts.map +1 -1
- package/dist/browser/components/block/hooks/useStaticBlockComponents.d.ts +2 -2
- package/dist/browser/components/block/hooks/useStaticBlockComponents.d.ts.map +1 -1
- package/dist/browser/components/block/table/cell/lib/BlockTableCellProps.d.ts +2 -2
- package/dist/browser/components/block/table/cell/lib/BlockTableCellProps.d.ts.map +1 -1
- package/dist/browser/components/chain/hooks/useOnBlock.d.ts +18 -1
- package/dist/browser/components/chain/hooks/useOnBlock.d.ts.map +1 -1
- package/dist/browser/components/payload/builder/producer-intent/Form.d.ts.map +1 -1
- package/dist/browser/components/payload/fields/BlockNumberTextField.d.ts +2 -1
- package/dist/browser/components/payload/fields/BlockNumberTextField.d.ts.map +1 -1
- package/dist/browser/components/transactions/TransactionsQuickTipButton.d.ts +2 -2
- package/dist/browser/components/transactions/TransactionsQuickTipButton.d.ts.map +1 -1
- package/dist/browser/components/transactions/submit/Builder.d.ts +1 -1
- package/dist/browser/components/transactions/submit/Builder.d.ts.map +1 -1
- package/dist/browser/helpers/txsFromBlock.d.ts +22 -2
- package/dist/browser/helpers/txsFromBlock.d.ts.map +1 -1
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts +57 -6
- package/dist/browser/hooks/chain-iterator/useChainIteratorParams.d.ts.map +1 -1
- package/dist/browser/hooks/useIterateChain.d.ts +22 -2
- package/dist/browser/hooks/useIterateChain.d.ts.map +1 -1
- package/dist/browser/hooks/useTxsFromBlock.d.ts +22 -2
- package/dist/browser/hooks/useTxsFromBlock.d.ts.map +1 -1
- package/dist/browser/index.mjs +25 -23
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/types/BlockComponentProps.d.ts +2 -2
- package/dist/browser/types/BlockComponentProps.d.ts.map +1 -1
- package/package.json +34 -34
- package/src/components/block/hooks/useDynamicBlockComponents.ts +2 -2
- package/src/components/block/hooks/useStaticBlockComponents.ts +2 -2
- package/src/components/block/table/cell/lib/BlockTableCellProps.ts +2 -2
- package/src/components/payload/builder/producer-intent/Form.tsx +7 -6
- package/src/components/payload/fields/BlockNumberTextField.tsx +3 -2
- package/src/components/transactions/TransactionsQuickTipButton.tsx +2 -2
- package/src/components/transactions/submit/Builder.tsx +5 -5
- package/src/components/transactions/submit/SubmitChain.tsx +1 -1
- package/src/helpers/txsFromBlock.ts +2 -2
- package/src/hooks/useIterateChain.ts +2 -2
- package/src/hooks/useTxsFromBlock.ts +2 -2
- package/src/types/BlockComponentProps.ts +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol';
|
|
3
3
|
/** Interface for all components that render a single block */
|
|
4
4
|
export interface BlockComponentProps {
|
|
5
|
-
block:
|
|
5
|
+
block: HydratedBlockWithHashMeta;
|
|
6
6
|
defaultExpanded?: boolean;
|
|
7
7
|
}
|
|
8
8
|
/** Interface for all components that render a single block with transactions */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockComponentProps.d.ts","sourceRoot":"","sources":["../../../src/types/BlockComponentProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BlockComponentProps.d.ts","sourceRoot":"","sources":["../../../src/types/BlockComponentProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAE1E,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,yBAAyB,CAAA;IAChC,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED,gFAAgF;AAChF,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB;IACrE,YAAY,EAAE,IAAI,EAAE,CAAA;CACrB"}
|
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.16.
|
|
4
|
+
"version": "1.16.26",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockchain",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@storybook/react-vite": "~10.0.8",
|
|
51
|
-
"@xylabs/axios": "~5.0.
|
|
51
|
+
"@xylabs/axios": "~5.0.46",
|
|
52
52
|
"@xylabs/react-animation": "~7.1.8",
|
|
53
53
|
"@xylabs/react-error": "~7.1.8",
|
|
54
54
|
"@xylabs/react-flexbox": "~7.1.8",
|
|
@@ -56,49 +56,49 @@
|
|
|
56
56
|
"@xylabs/react-quick-tip-button": "~7.1.8",
|
|
57
57
|
"@xylabs/react-shared": "~7.1.8",
|
|
58
58
|
"@xylabs/react-theme": "~7.1.8",
|
|
59
|
-
"@xylabs/sdk-js": "~5.0.
|
|
60
|
-
"@xyo-network/account": "~5.
|
|
61
|
-
"@xyo-network/archivist-memory": "~5.
|
|
62
|
-
"@xyo-network/archivist-model": "~5.
|
|
63
|
-
"@xyo-network/boundwitness-builder": "~5.
|
|
64
|
-
"@xyo-network/boundwitness-model": "~5.
|
|
65
|
-
"@xyo-network/bridge-http": "~5.
|
|
66
|
-
"@xyo-network/chain-analyze": "~1.16.
|
|
67
|
-
"@xyo-network/chain-protocol": "~1.16.
|
|
68
|
-
"@xyo-network/chain-services": "~1.16.
|
|
69
|
-
"@xyo-network/chain-utils": "~1.16.
|
|
70
|
-
"@xyo-network/chain-wrappers": "~1.16.
|
|
71
|
-
"@xyo-network/module-model": "~5.
|
|
72
|
-
"@xyo-network/payload-builder": "~5.
|
|
73
|
-
"@xyo-network/payload-model": "~5.
|
|
74
|
-
"@xyo-network/react-boundwitness-plugin": "~7.
|
|
75
|
-
"@xyo-network/react-chain-blockies": "~1.16.
|
|
76
|
-
"@xyo-network/react-chain-provider": "~1.16.
|
|
77
|
-
"@xyo-network/react-chain-shared": "~1.16.
|
|
78
|
-
"@xyo-network/react-error": "~7.
|
|
79
|
-
"@xyo-network/react-event": "~7.
|
|
80
|
-
"@xyo-network/react-payload-raw-info": "~7.
|
|
81
|
-
"@xyo-network/react-payload-table": "~7.
|
|
82
|
-
"@xyo-network/react-shared": "~7.
|
|
83
|
-
"@xyo-network/react-table": "~7.
|
|
84
|
-
"@xyo-network/xl1-protocol": "~1.
|
|
85
|
-
"@xyo-network/xl1-protocol-sdk": "~1.16.
|
|
59
|
+
"@xylabs/sdk-js": "~5.0.46",
|
|
60
|
+
"@xyo-network/account": "~5.2.10",
|
|
61
|
+
"@xyo-network/archivist-memory": "~5.2.10",
|
|
62
|
+
"@xyo-network/archivist-model": "~5.2.10",
|
|
63
|
+
"@xyo-network/boundwitness-builder": "~5.2.10",
|
|
64
|
+
"@xyo-network/boundwitness-model": "~5.2.10",
|
|
65
|
+
"@xyo-network/bridge-http": "~5.2.10",
|
|
66
|
+
"@xyo-network/chain-analyze": "~1.16.26",
|
|
67
|
+
"@xyo-network/chain-protocol": "~1.16.26",
|
|
68
|
+
"@xyo-network/chain-services": "~1.16.26",
|
|
69
|
+
"@xyo-network/chain-utils": "~1.16.26",
|
|
70
|
+
"@xyo-network/chain-wrappers": "~1.16.26",
|
|
71
|
+
"@xyo-network/module-model": "~5.2.10",
|
|
72
|
+
"@xyo-network/payload-builder": "~5.2.10",
|
|
73
|
+
"@xyo-network/payload-model": "~5.2.10",
|
|
74
|
+
"@xyo-network/react-boundwitness-plugin": "~7.4.0",
|
|
75
|
+
"@xyo-network/react-chain-blockies": "~1.16.26",
|
|
76
|
+
"@xyo-network/react-chain-provider": "~1.16.26",
|
|
77
|
+
"@xyo-network/react-chain-shared": "~1.16.26",
|
|
78
|
+
"@xyo-network/react-error": "~7.4.0",
|
|
79
|
+
"@xyo-network/react-event": "~7.4.0",
|
|
80
|
+
"@xyo-network/react-payload-raw-info": "~7.4.0",
|
|
81
|
+
"@xyo-network/react-payload-table": "~7.4.0",
|
|
82
|
+
"@xyo-network/react-shared": "~7.4.0",
|
|
83
|
+
"@xyo-network/react-table": "~7.4.0",
|
|
84
|
+
"@xyo-network/xl1-protocol": "~1.14.15",
|
|
85
|
+
"@xyo-network/xl1-protocol-sdk": "~1.16.26"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@emotion/react": "~11.14.0",
|
|
89
89
|
"@emotion/styled": "~11.14.1",
|
|
90
90
|
"@mui/icons-material": "~7.3.5",
|
|
91
91
|
"@mui/material": "~7.3.5",
|
|
92
|
-
"@types/react": "~19.2.
|
|
92
|
+
"@types/react": "~19.2.7",
|
|
93
93
|
"@xylabs/react-button": "~7.1.8",
|
|
94
|
-
"@xylabs/sdk-js": "~5.0.
|
|
94
|
+
"@xylabs/sdk-js": "~5.0.46",
|
|
95
95
|
"@xylabs/ts-scripts-yarn3": "~7.2.8",
|
|
96
96
|
"@xylabs/tsconfig": "~7.2.8",
|
|
97
97
|
"@xylabs/tsconfig-dom": "~7.2.8",
|
|
98
98
|
"@xylabs/tsconfig-react": "~7.2.8",
|
|
99
|
-
"@xyo-network/api-models": "~5.
|
|
100
|
-
"@xyo-network/xl1-network-model": "~1.16.
|
|
101
|
-
"@xyo-network/xl1-rpc": "~1.16.
|
|
99
|
+
"@xyo-network/api-models": "~5.2.10",
|
|
100
|
+
"@xyo-network/xl1-network-model": "~1.16.26",
|
|
101
|
+
"@xyo-network/xl1-rpc": "~1.16.26",
|
|
102
102
|
"axios": "^1.13.2",
|
|
103
103
|
"eslint": "^9.39.1",
|
|
104
104
|
"react": "~19.2.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { XyoChainIteratorParams } from '@xyo-network/chain-services'
|
|
2
|
-
import type {
|
|
2
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol'
|
|
3
3
|
import type { ComponentType } from 'react'
|
|
4
4
|
import { useState } from 'react'
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ export const useDynamicBlockComponents = (BlockComponent: ComponentType<BlockCom
|
|
|
16
16
|
|
|
17
17
|
const { onBlock } = useChainAnalyzersContext()
|
|
18
18
|
|
|
19
|
-
const onAddBlock = async (block:
|
|
19
|
+
const onAddBlock = async (block: HydratedBlockWithHashMeta | undefined) => {
|
|
20
20
|
if (!block || !chainMap) return
|
|
21
21
|
|
|
22
22
|
const blockComponentProps: BlockComponentProps = { block }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePromise } from '@xylabs/react-promise'
|
|
2
2
|
import { isDefined } from '@xylabs/sdk-js'
|
|
3
3
|
import type { XyoChainIteratorParams } from '@xyo-network/chain-services'
|
|
4
|
-
import type {
|
|
4
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol'
|
|
5
5
|
import type { ComponentType } from 'react'
|
|
6
6
|
|
|
7
7
|
import { useChainAnalyzersContext } from '../../../context/index.ts'
|
|
@@ -11,7 +11,7 @@ import { buildBlockChainRenderComponent } from '../helpers/index.ts'
|
|
|
11
11
|
export const useStaticBlockComponents = (
|
|
12
12
|
BlockComponent: ComponentType<BlockComponentWithTxsProps>,
|
|
13
13
|
params?: XyoChainIteratorParams,
|
|
14
|
-
blocks?:
|
|
14
|
+
blocks?: HydratedBlockWithHashMeta[],
|
|
15
15
|
) => {
|
|
16
16
|
const { onBlock } = useChainAnalyzersContext()
|
|
17
17
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TableCellProps } from '@mui/material'
|
|
2
|
-
import type {
|
|
2
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol'
|
|
3
3
|
|
|
4
4
|
export interface BlockTableCellProps extends TableCellProps {
|
|
5
|
-
block?:
|
|
5
|
+
block?: HydratedBlockWithHashMeta
|
|
6
6
|
linked?: boolean
|
|
7
7
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Button, FormControl } from '@mui/material'
|
|
2
|
+
import { usePromise } from '@xylabs/react-promise'
|
|
2
3
|
import type { Address } from '@xylabs/sdk-js'
|
|
3
4
|
import { createProducerChainStakeIntent } from '@xyo-network/chain-protocol'
|
|
4
|
-
import type {
|
|
5
|
+
import type { XL1BlockNumber } from '@xyo-network/xl1-protocol'
|
|
5
6
|
import type { MouseEventHandler } from 'react'
|
|
6
|
-
import React, {
|
|
7
|
+
import React, { useState } from 'react'
|
|
7
8
|
|
|
8
9
|
import { BlockNumberTextField, XyoAddressTextField } from '../../fields/index.ts'
|
|
9
10
|
import type { PayloadBuilderComponentProps } from '../BuilderComponentProps.ts'
|
|
@@ -12,11 +13,11 @@ export interface ProducerIntentBuilderFormProps extends PayloadBuilderComponentP
|
|
|
12
13
|
|
|
13
14
|
export const ProducerIntentBuilderForm: React.FC<ProducerIntentBuilderFormProps> = ({ onBuild }) => {
|
|
14
15
|
const [delegate, setDelegate] = useState<Address>()
|
|
15
|
-
const [exp, setExp] = useState<
|
|
16
|
-
const [nbf, setNbf] = useState<
|
|
16
|
+
const [exp, setExp] = useState<XL1BlockNumber>()
|
|
17
|
+
const [nbf, setNbf] = useState<XL1BlockNumber>()
|
|
17
18
|
const [blockRangeError, setBlockRangeError] = useState<Error>()
|
|
18
19
|
|
|
19
|
-
const intentPayload
|
|
20
|
+
const [intentPayload] = usePromise(async () => {
|
|
20
21
|
// confirm we have values for all fields
|
|
21
22
|
if (exp !== undefined && nbf !== undefined) {
|
|
22
23
|
// validate that expires is greater than not before
|
|
@@ -26,7 +27,7 @@ export const ProducerIntentBuilderForm: React.FC<ProducerIntentBuilderFormProps>
|
|
|
26
27
|
setBlockRangeError(undefined)
|
|
27
28
|
if (delegate !== undefined) {
|
|
28
29
|
// create the payload
|
|
29
|
-
const payload = createProducerChainStakeIntent(delegate, exp, nbf)
|
|
30
|
+
const payload = await createProducerChainStakeIntent(delegate, exp, nbf)
|
|
30
31
|
return payload
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -2,12 +2,13 @@ import type { StandardTextFieldProps } from '@mui/material'
|
|
|
2
2
|
import {
|
|
3
3
|
FormControl, FormHelperText, TextField,
|
|
4
4
|
} from '@mui/material'
|
|
5
|
+
import { toXL1BlockNumber, type XL1BlockNumber } from '@xyo-network/xl1-protocol'
|
|
5
6
|
import type { ChangeEventHandler } from 'react'
|
|
6
7
|
import React, { useState } from 'react'
|
|
7
8
|
|
|
8
9
|
interface BlockNumberTextFieldProps extends StandardTextFieldProps {
|
|
9
10
|
errorMessage?: string
|
|
10
|
-
onBlockNumberChanged?: (blockNumber?:
|
|
11
|
+
onBlockNumberChanged?: (blockNumber?: XL1BlockNumber) => void
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export const BlockNumberTextField: React.FC<BlockNumberTextFieldProps> = ({
|
|
@@ -18,7 +19,7 @@ export const BlockNumberTextField: React.FC<BlockNumberTextFieldProps> = ({
|
|
|
18
19
|
const handleChange: ChangeEventHandler<HTMLInputElement> = (e) => {
|
|
19
20
|
const value = e.target.value.replaceAll(/\D/g, '') // Remove non-digit characters
|
|
20
21
|
setBlockNumber(value.length > 0 ? Number(value) : undefined)
|
|
21
|
-
onBlockNumberChanged?.(
|
|
22
|
+
onBlockNumberChanged?.(toXL1BlockNumber(value))
|
|
22
23
|
onChange?.(e)
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import type { QuickTipButtonProps } from '@xylabs/react-quick-tip-button'
|
|
10
10
|
import { QuickTipButton } from '@xylabs/react-quick-tip-button'
|
|
11
11
|
import type { Hash } from '@xylabs/sdk-js'
|
|
12
|
-
import type {
|
|
12
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol'
|
|
13
13
|
import React, {
|
|
14
14
|
Fragment, useMemo, useState,
|
|
15
15
|
} from 'react'
|
|
@@ -17,7 +17,7 @@ import React, {
|
|
|
17
17
|
import { useTxsFromBlock } from '../../hooks/index.ts'
|
|
18
18
|
|
|
19
19
|
export interface TransactionsQuickTipButtonQuickTipButtonProps extends QuickTipButtonProps {
|
|
20
|
-
block?:
|
|
20
|
+
block?: HydratedBlockWithHashMeta
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const TransactionsQuickTipButton: React.FC<TransactionsQuickTipButtonQuickTipButtonProps> = ({ block, ...props }) => {
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
import { FlexCol } from '@xylabs/react-flexbox'
|
|
5
5
|
import { toHex } from '@xylabs/sdk-js'
|
|
6
6
|
import type { ChainId, TransactionBoundWitnessFields } from '@xyo-network/xl1-protocol'
|
|
7
|
-
import { defaultTransactionFees } from '@xyo-network/xl1-protocol'
|
|
7
|
+
import { defaultTransactionFees, toXL1BlockNumber } from '@xyo-network/xl1-protocol'
|
|
8
8
|
import React from 'react'
|
|
9
9
|
|
|
10
10
|
export interface ChainTransactionBuilder {
|
|
11
|
-
onSubmitTx?: (chainTx: TransactionBoundWitnessFields) => Promise<void>
|
|
11
|
+
onSubmitTx?: (chainTx: Omit<TransactionBoundWitnessFields, 'from'>) => Promise<void>
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export const ChainTransactionBuilder: React.FC<ChainTransactionBuilder> = ({ onSubmitTx }) => {
|
|
@@ -17,10 +17,10 @@ export const ChainTransactionBuilder: React.FC<ChainTransactionBuilder> = ({ onS
|
|
|
17
17
|
const formData = new FormData(event.currentTarget)
|
|
18
18
|
|
|
19
19
|
// TODO - more field level validation
|
|
20
|
-
const chainTx: TransactionBoundWitnessFields = {
|
|
20
|
+
const chainTx: Omit<TransactionBoundWitnessFields, 'from'> = {
|
|
21
21
|
chain: formData.get('chain') as ChainId,
|
|
22
|
-
nbf:
|
|
23
|
-
exp:
|
|
22
|
+
nbf: toXL1BlockNumber(formData.get('nbf'), true),
|
|
23
|
+
exp: toXL1BlockNumber(formData.get('exp'), true),
|
|
24
24
|
fees: {
|
|
25
25
|
gasLimit: toHex(defaultTransactionFees.gasLimit),
|
|
26
26
|
gasPrice: toHex(defaultTransactionFees.gasPrice),
|
|
@@ -27,7 +27,7 @@ export const SubmitChainTransaction: React.FC = () => {
|
|
|
27
27
|
const [result, setResult] = useState<ModuleQueryResult>()
|
|
28
28
|
const [error, setError] = useState<Error>()
|
|
29
29
|
|
|
30
|
-
const onSubmitTx = async (chainTx: TransactionBoundWitnessFields) => {
|
|
30
|
+
const onSubmitTx = async (chainTx: Omit<TransactionBoundWitnessFields, 'from'>) => {
|
|
31
31
|
if (network) {
|
|
32
32
|
const randomAccount = await Account.random()
|
|
33
33
|
const [transactionBoundWitness] = await buildTransaction(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HydratedBlockWrapper } from '@xyo-network/chain-wrappers'
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
-
import {
|
|
3
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol'
|
|
4
4
|
|
|
5
|
-
export const txsFromBlock = async (block:
|
|
5
|
+
export const txsFromBlock = async (block: HydratedBlockWithHashMeta) => {
|
|
6
6
|
const wrapper = await HydratedBlockWrapper.parse(block)
|
|
7
7
|
const txs = wrapper.transactions
|
|
8
8
|
const txPayloads = txs.map(tx => tx.boundWitness)
|
|
@@ -4,7 +4,7 @@ import type { XyoChainIteratorParams } from '@xyo-network/chain-services'
|
|
|
4
4
|
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services'
|
|
5
5
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
6
6
|
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
7
|
-
import type { BlockBoundWitness,
|
|
7
|
+
import type { BlockBoundWitness, HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol'
|
|
8
8
|
import { isBlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
9
9
|
import type { PayloadMapRead } from '@xyo-network/xl1-protocol-sdk'
|
|
10
10
|
import { hydrateBlock } from '@xyo-network/xl1-protocol-sdk'
|
|
@@ -27,7 +27,7 @@ const iterateChain = async (chainIteratorParams?: XyoChainIteratorParams, maxDep
|
|
|
27
27
|
let block = await getHydratedBlock(chainMap, chainHead)
|
|
28
28
|
|
|
29
29
|
// create the blocks array
|
|
30
|
-
const blocks:
|
|
30
|
+
const blocks: HydratedBlockWithHashMeta[] = [block]
|
|
31
31
|
|
|
32
32
|
// track the depth
|
|
33
33
|
let depth = 1
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { usePromise } from '@xylabs/react-promise'
|
|
2
|
-
import {
|
|
2
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol'
|
|
3
3
|
|
|
4
4
|
import { txsFromBlock } from '../helpers/index.ts'
|
|
5
5
|
|
|
6
|
-
export const useTxsFromBlock = (block?:
|
|
6
|
+
export const useTxsFromBlock = (block?: HydratedBlockWithHashMeta) => {
|
|
7
7
|
return usePromise(async () => {
|
|
8
8
|
if (block) {
|
|
9
9
|
return await txsFromBlock(block)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js'
|
|
2
|
-
import type {
|
|
2
|
+
import type { HydratedBlockWithHashMeta } from '@xyo-network/xl1-protocol'
|
|
3
3
|
|
|
4
4
|
/** Interface for all components that render a single block */
|
|
5
5
|
export interface BlockComponentProps {
|
|
6
|
-
block:
|
|
6
|
+
block: HydratedBlockWithHashMeta
|
|
7
7
|
defaultExpanded?: boolean
|
|
8
8
|
}
|
|
9
9
|
|