@xyo-network/react-chain-blockchain 1.5.29 → 1.5.31
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 +8 -8
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/helpers/txsFromBlock.d.ts +1 -1
- package/dist/types/helpers/txsFromBlock.d.ts.map +1 -1
- package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts +2 -2
- package/dist/types/hooks/chain-iterator/ChainIteratorStore.d.ts.map +1 -1
- package/dist/types/hooks/useTxsFromBlock.d.ts +1 -1
- package/dist/types/hooks/useTxsFromBlock.d.ts.map +1 -1
- package/dist/types/stories/ChainInfoContextDecorator.d.ts.map +1 -1
- package/package.json +39 -39
- package/src/helpers/txsFromBlock.ts +2 -2
- package/src/hooks/chain-iterator/ChainIteratorStore.ts +3 -3
- package/src/hooks/useIterateChain.ts +2 -2
- package/src/stories/ChainInfoContextDecorator.tsx +6 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type HydratedBlock } from '@xyo-network/xl1-protocol';
|
|
2
|
-
export declare const txsFromBlock: (block: HydratedBlock) => Promise<[import("@xyo-network/xl1-protocol").TransactionBoundWitness
|
|
2
|
+
export declare const txsFromBlock: (block: HydratedBlock) => Promise<[import("@xyo-network/payload-model").WithStorageMeta<import("@xyo-network/boundwitness-model").Signed<import("@xyo-network/xl1-protocol").TransactionBoundWitness>>, Lowercase<string>][]>;
|
|
3
3
|
//# sourceMappingURL=txsFromBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txsFromBlock.d.ts","sourceRoot":"","sources":["../../../src/helpers/txsFromBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,eAAO,MAAM,YAAY,GAAU,OAAO,aAAa,
|
|
1
|
+
{"version":3,"file":"txsFromBlock.d.ts","sourceRoot":"","sources":["../../../src/helpers/txsFromBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,eAAO,MAAM,YAAY,GAAU,OAAO,aAAa,wMAKtD,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services';
|
|
2
2
|
import type { EventingChainBlockNumberIterator, HydratedBlock, XyoChainIteratorParams } from '@xyo-network/xl1-protocol';
|
|
3
3
|
export type Listener = (...args: Array<unknown>) => void;
|
|
4
4
|
export type ChainIteratorStoreValues = {
|
|
5
|
-
chainIterator:
|
|
5
|
+
chainIterator: ChainBlockNumberIterationService;
|
|
6
6
|
error?: Error;
|
|
7
7
|
head: HydratedBlock;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainIteratorStore.d.ts","sourceRoot":"","sources":["../../../../src/hooks/chain-iterator/ChainIteratorStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ChainIteratorStore.d.ts","sourceRoot":"","sources":["../../../../src/hooks/chain-iterator/ChainIteratorStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAA;AAE9E,OAAO,KAAK,EACV,gCAAgC,EAChC,aAAa,EACb,sBAAsB,EACvB,MAAM,2BAA2B,CAAA;AAElC,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;AAExD,MAAM,MAAM,wBAAwB,GAAG;IAAE,aAAa,EAAE,gCAAgC,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAA;AAE9H,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,kBAAkB,CAAiB;IAC3C,OAAO,CAAC,qBAAqB,CAA4B;IACzD,OAAO,CAAC,OAAO,CAAsC;IAErD,IAAI,aAAa,IAAI,gCAAgC,CAEpD;IAED,IAAI,MAAM,IAAI,wBAAwB,CAErC;WAEY,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAqChF,OAAO;IAOP,WAAW,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAIhD,SAAS,CAAC,aAAa,EAAE,QAAQ;IAOjC,OAAO,CAAC,UAAU;CAKnB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type HydratedBlock } from '@xyo-network/xl1-protocol';
|
|
2
|
-
export declare const useTxsFromBlock: (block?: HydratedBlock) => [[import("@xyo-network/xl1-protocol").TransactionBoundWitness
|
|
2
|
+
export declare const useTxsFromBlock: (block?: HydratedBlock) => [[import("@xyo-network/payload-model").WithStorageMeta<import("@xyo-network/boundwitness-model").Signed<import("@xyo-network/xl1-protocol").TransactionBoundWitness>>, Lowercase<string>][] | undefined, Error | undefined, import("@xylabs/react-promise").UsePromiseState | undefined];
|
|
3
3
|
//# sourceMappingURL=useTxsFromBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTxsFromBlock.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTxsFromBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAI9D,eAAO,MAAM,eAAe,GAAI,QAAQ,aAAa,
|
|
1
|
+
{"version":3,"file":"useTxsFromBlock.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTxsFromBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAI9D,eAAO,MAAM,eAAe,GAAI,QAAQ,aAAa,6RAMpD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChainInfoContextDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainInfoContextDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"ChainInfoContextDecorator.d.ts","sourceRoot":"","sources":["../../../src/stories/ChainInfoContextDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAkBtD,eAAO,MAAM,yBAAyB,EAAE,SA0BvC,CAAA"}
|
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.5.
|
|
4
|
+
"version": "1.5.31",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockchain",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"package-cycle": "echo Nothing to do"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@storybook/react-vite": "^9.0.
|
|
41
|
-
"@xylabs/assert": "^4.11.
|
|
42
|
-
"@xylabs/axios": "^4.11.
|
|
43
|
-
"@xylabs/delay": "^4.11.
|
|
44
|
-
"@xylabs/eth-address": "^4.11.
|
|
45
|
-
"@xylabs/exists": "^4.11.
|
|
46
|
-
"@xylabs/hex": "^4.11.
|
|
47
|
-
"@xylabs/promise": "^4.11.
|
|
40
|
+
"@storybook/react-vite": "^9.0.9",
|
|
41
|
+
"@xylabs/assert": "^4.11.20",
|
|
42
|
+
"@xylabs/axios": "^4.11.20",
|
|
43
|
+
"@xylabs/delay": "^4.11.20",
|
|
44
|
+
"@xylabs/eth-address": "^4.11.20",
|
|
45
|
+
"@xylabs/exists": "^4.11.20",
|
|
46
|
+
"@xylabs/hex": "^4.11.20",
|
|
47
|
+
"@xylabs/promise": "^4.11.20",
|
|
48
48
|
"@xylabs/react-animation": "^6.3.4",
|
|
49
49
|
"@xylabs/react-error": "^6.3.4",
|
|
50
50
|
"@xylabs/react-flexbox": "^6.3.4",
|
|
@@ -53,47 +53,47 @@
|
|
|
53
53
|
"@xylabs/react-quick-tip-button": "^6.3.4",
|
|
54
54
|
"@xylabs/react-shared": "^6.3.4",
|
|
55
55
|
"@xylabs/react-theme": "^6.3.4",
|
|
56
|
-
"@xylabs/typeof": "^4.11.
|
|
57
|
-
"@xyo-network/account": "^3.18.
|
|
58
|
-
"@xyo-network/archivist-memory": "^3.18.
|
|
59
|
-
"@xyo-network/archivist-model": "^3.18.
|
|
60
|
-
"@xyo-network/boundwitness-builder": "^3.18.
|
|
61
|
-
"@xyo-network/boundwitness-model": "^3.18.
|
|
62
|
-
"@xyo-network/bridge-http": "^3.18.
|
|
63
|
-
"@xyo-network/chain-analyze": "^1.5.
|
|
64
|
-
"@xyo-network/chain-protocol": "^1.5.
|
|
65
|
-
"@xyo-network/chain-services": "^1.5.
|
|
66
|
-
"@xyo-network/chain-utils": "^1.5.
|
|
67
|
-
"@xyo-network/chain-wrappers": "^1.5.
|
|
68
|
-
"@xyo-network/module-model": "^3.18.
|
|
69
|
-
"@xyo-network/payload-builder": "^3.18.
|
|
70
|
-
"@xyo-network/payload-model": "^3.18.
|
|
71
|
-
"@xyo-network/react-boundwitness-plugin": "^5.3.
|
|
72
|
-
"@xyo-network/react-chain-blockies": "^1.5.
|
|
73
|
-
"@xyo-network/react-chain-shared": "^1.5.
|
|
74
|
-
"@xyo-network/react-event": "^5.3.
|
|
75
|
-
"@xyo-network/react-payload-raw-info": "^5.3.
|
|
76
|
-
"@xyo-network/react-payload-table": "^5.3.
|
|
77
|
-
"@xyo-network/react-shared": "^5.3.
|
|
78
|
-
"@xyo-network/react-table": "^5.3.
|
|
79
|
-
"@xyo-network/xl1-protocol": "^1.4.
|
|
80
|
-
"@xyo-network/xl1-protocol-sdk": "^1.5.
|
|
56
|
+
"@xylabs/typeof": "^4.11.20",
|
|
57
|
+
"@xyo-network/account": "^3.18.8",
|
|
58
|
+
"@xyo-network/archivist-memory": "^3.18.8",
|
|
59
|
+
"@xyo-network/archivist-model": "^3.18.8",
|
|
60
|
+
"@xyo-network/boundwitness-builder": "^3.18.8",
|
|
61
|
+
"@xyo-network/boundwitness-model": "^3.18.8",
|
|
62
|
+
"@xyo-network/bridge-http": "^3.18.8",
|
|
63
|
+
"@xyo-network/chain-analyze": "^1.5.31",
|
|
64
|
+
"@xyo-network/chain-protocol": "^1.5.31",
|
|
65
|
+
"@xyo-network/chain-services": "^1.5.31",
|
|
66
|
+
"@xyo-network/chain-utils": "^1.5.31",
|
|
67
|
+
"@xyo-network/chain-wrappers": "^1.5.31",
|
|
68
|
+
"@xyo-network/module-model": "^3.18.8",
|
|
69
|
+
"@xyo-network/payload-builder": "^3.18.8",
|
|
70
|
+
"@xyo-network/payload-model": "^3.18.8",
|
|
71
|
+
"@xyo-network/react-boundwitness-plugin": "^5.3.8",
|
|
72
|
+
"@xyo-network/react-chain-blockies": "^1.5.31",
|
|
73
|
+
"@xyo-network/react-chain-shared": "^1.5.31",
|
|
74
|
+
"@xyo-network/react-event": "^5.3.8",
|
|
75
|
+
"@xyo-network/react-payload-raw-info": "^5.3.8",
|
|
76
|
+
"@xyo-network/react-payload-table": "^5.3.8",
|
|
77
|
+
"@xyo-network/react-shared": "^5.3.8",
|
|
78
|
+
"@xyo-network/react-table": "^5.3.8",
|
|
79
|
+
"@xyo-network/xl1-protocol": "^1.4.33",
|
|
80
|
+
"@xyo-network/xl1-protocol-sdk": "^1.5.31"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@emotion/react": "^11.14.0",
|
|
84
84
|
"@emotion/styled": "^11.14.0",
|
|
85
85
|
"@mui/icons-material": "^7.1.1",
|
|
86
86
|
"@mui/material": "^7.1.1",
|
|
87
|
-
"@types/react": "^19.1.
|
|
88
|
-
"@xylabs/hex": "^4.11.
|
|
87
|
+
"@types/react": "^19.1.8",
|
|
88
|
+
"@xylabs/hex": "^4.11.20",
|
|
89
89
|
"@xylabs/ts-scripts-yarn3": "^6.5.8",
|
|
90
90
|
"@xylabs/tsconfig-react": "^6.5.8",
|
|
91
|
-
"@xyo-network/api-models": "^3.18.
|
|
92
|
-
"knip": "^5.
|
|
91
|
+
"@xyo-network/api-models": "^3.18.8",
|
|
92
|
+
"knip": "^5.61.0",
|
|
93
93
|
"react": "^19.1.0",
|
|
94
94
|
"react-dom": "^19.1.0",
|
|
95
95
|
"react-router-dom": "^7.6.2",
|
|
96
|
-
"storybook": "^9.0.
|
|
96
|
+
"storybook": "^9.0.9",
|
|
97
97
|
"typescript": "^5.8.3"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HydratedBlockWrapper } from '@xyo-network/chain-wrappers'
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
3
|
import { type HydratedBlock } from '@xyo-network/xl1-protocol'
|
|
4
4
|
|
|
5
5
|
export const txsFromBlock = async (block: HydratedBlock) => {
|
|
6
|
-
const wrapper = await
|
|
6
|
+
const wrapper = await HydratedBlockWrapper.parse(block)
|
|
7
7
|
const txs = wrapper.transactions
|
|
8
8
|
const txPayloads = txs.map(tx => tx.boundWitness)
|
|
9
9
|
return await PayloadBuilder.hashPairs(txPayloads)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/assert'
|
|
2
2
|
import { hydrateBlock } from '@xyo-network/chain-protocol'
|
|
3
|
-
import {
|
|
3
|
+
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services'
|
|
4
4
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
5
5
|
import type {
|
|
6
6
|
EventingChainBlockNumberIterator, HeadEventArgs,
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
|
|
11
11
|
export type Listener = (...args: Array<unknown>) => void
|
|
12
12
|
|
|
13
|
-
export type ChainIteratorStoreValues = { chainIterator:
|
|
13
|
+
export type ChainIteratorStoreValues = { chainIterator: ChainBlockNumberIterationService; error?: Error; head: HydratedBlock }
|
|
14
14
|
|
|
15
15
|
export class ChainIteratorStore {
|
|
16
16
|
private _chainIterator: EventingChainBlockNumberIterator | undefined
|
|
@@ -29,7 +29,7 @@ export class ChainIteratorStore {
|
|
|
29
29
|
static async create(params: XyoChainIteratorParams): Promise<ChainIteratorStore> {
|
|
30
30
|
// create the classes
|
|
31
31
|
const instance = new ChainIteratorStore()
|
|
32
|
-
const chainIterator = await
|
|
32
|
+
const chainIterator = await ChainBlockNumberIterationService.create(params)
|
|
33
33
|
|
|
34
34
|
// set the chainIterator
|
|
35
35
|
instance._chainIterator = chainIterator
|
|
@@ -2,7 +2,7 @@ import { assertEx } from '@xylabs/assert'
|
|
|
2
2
|
import { usePromise } from '@xylabs/react-promise'
|
|
3
3
|
import type { ReadArchivist } from '@xyo-network/archivist-model'
|
|
4
4
|
import { hydrateBlock } from '@xyo-network/chain-protocol'
|
|
5
|
-
import {
|
|
5
|
+
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services'
|
|
6
6
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
7
7
|
import type {
|
|
8
8
|
BlockBoundWitness, HydratedBlock, XyoChainIteratorParams,
|
|
@@ -20,7 +20,7 @@ const iterateChain = async (chainIteratorParams?: XyoChainIteratorParams, maxDep
|
|
|
20
20
|
// confirm the head is a block
|
|
21
21
|
const headBlockBoundWitness = assertEx(isBlockBoundWitness(headPayload) ? headPayload : null, () => 'Invalid head block')
|
|
22
22
|
// create the chain iterator
|
|
23
|
-
const chainIterator = await
|
|
23
|
+
const chainIterator = await ChainBlockNumberIterationService.create({ head: headBlockBoundWitness, chainArchivist })
|
|
24
24
|
|
|
25
25
|
// get head of the chain
|
|
26
26
|
const chainHead = await chainIterator.head()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Decorator } from '@storybook/react-vite'
|
|
2
2
|
import { assertEx } from '@xylabs/assert'
|
|
3
3
|
import { usePromise } from '@xylabs/react-promise'
|
|
4
|
-
import {
|
|
4
|
+
import { ChainBlockNumberIterationService } from '@xyo-network/chain-services'
|
|
5
5
|
import { findFirstMatching } from '@xyo-network/chain-utils'
|
|
6
|
+
import type { BlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
6
7
|
import { isBlockBoundWitness } from '@xyo-network/xl1-protocol'
|
|
7
8
|
import React from 'react'
|
|
8
9
|
|
|
@@ -29,8 +30,10 @@ export const ChainInfoContextDecorator: Decorator = (Story, context) => {
|
|
|
29
30
|
const [chainIterator] = usePromise(async () => {
|
|
30
31
|
if (chainArchivist && chainInformation) {
|
|
31
32
|
const firstMatch = assertEx(await findFirstMatching(chainArchivist), () => `No head found in archivist: ${chainArchivist.id} `)
|
|
32
|
-
const head = assertEx(isBlockBoundWitness(firstMatch)
|
|
33
|
-
|
|
33
|
+
const head: BlockBoundWitness = assertEx(isBlockBoundWitness(firstMatch)
|
|
34
|
+
? firstMatch
|
|
35
|
+
: undefined, () => `Expected a block bound witness: ${JSON.stringify(firstMatch)}`)
|
|
36
|
+
return await ChainBlockNumberIterationService.create({ chainArchivist, head })
|
|
34
37
|
}
|
|
35
38
|
}, [chainArchivist, chainInformation])
|
|
36
39
|
|