@xyo-network/react-chain-blockchain 1.18.4 → 1.18.5
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/context/chain/Context.d.ts +0 -3
- package/dist/browser/context/chain/Context.d.ts.map +1 -1
- package/dist/browser/context/chain/Provider.d.ts.map +1 -1
- package/dist/browser/context/chain/State.d.ts +1 -2
- package/dist/browser/context/chain/State.d.ts.map +1 -1
- package/dist/browser/context/chain/use.d.ts +0 -1
- package/dist/browser/context/chain/use.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/context/chain/Provider.tsx +2 -14
- package/src/context/chain/State.ts +1 -2
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
export declare const ChainInfoContext: import("react").Context<({
|
|
2
2
|
chainArchivist?: import("@xyo-network/archivist-model").ArchivistInstance;
|
|
3
3
|
chainId?: import("@xyo-network/xl1-protocol").ChainId;
|
|
4
|
-
chainIterator?: import("@xyo-network/xl1-protocol-sdk").ChainBlockNumberIteratorService;
|
|
5
4
|
} & {
|
|
6
5
|
provided: true;
|
|
7
6
|
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").ProvidedContextExState<{
|
|
8
7
|
chainArchivist?: import("@xyo-network/archivist-model").ArchivistInstance;
|
|
9
8
|
chainId?: import("@xyo-network/xl1-protocol").ChainId;
|
|
10
|
-
chainIterator?: import("@xyo-network/xl1-protocol-sdk").ChainBlockNumberIteratorService;
|
|
11
9
|
}>, never> & {
|
|
12
10
|
provided: false;
|
|
13
11
|
}) | (import("@xylabs/react-shared").FixedValues<import("@xylabs/react-shared").NotProvidedContextExState<{
|
|
14
12
|
chainArchivist?: import("@xyo-network/archivist-model").ArchivistInstance;
|
|
15
13
|
chainId?: import("@xyo-network/xl1-protocol").ChainId;
|
|
16
|
-
chainIterator?: import("@xyo-network/xl1-protocol-sdk").ChainBlockNumberIteratorService;
|
|
17
14
|
}>, never> & {
|
|
18
15
|
provided: false;
|
|
19
16
|
})>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/context/chain/Context.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/context/chain/Context.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;GAAoC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/context/chain/Provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAEN,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,UAAU,sBAAuB,SAAQ,iBAAiB,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;CAAG;AAE/F,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/context/chain/Provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAEN,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,UAAU,sBAAuB,SAAQ,iBAAiB,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;CAAG;AAE/F,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqC9D,CAAA"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ContextExState } from '@xylabs/react-shared';
|
|
2
2
|
import type { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChainId } from '@xyo-network/xl1-sdk';
|
|
4
4
|
export type ChainInfoState = ContextExState<{
|
|
5
5
|
chainArchivist?: ArchivistInstance;
|
|
6
6
|
chainId?: ChainId;
|
|
7
|
-
chainIterator?: ChainBlockNumberIteratorService;
|
|
8
7
|
}>;
|
|
9
8
|
//# sourceMappingURL=State.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/context/chain/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,KAAK,EAAE
|
|
1
|
+
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/context/chain/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC;IAC1C,cAAc,CAAC,EAAE,iBAAiB,CAAA;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC,CAAA"}
|
|
@@ -2,7 +2,6 @@ import type { ChainInfoState } from './State.ts';
|
|
|
2
2
|
export declare const useChainInfo: (required?: boolean) => Omit<{
|
|
3
3
|
chainArchivist?: import("@xyo-network/archivist-model").ArchivistInstance;
|
|
4
4
|
chainId?: import("@xyo-network/xl1-protocol").ChainId;
|
|
5
|
-
chainIterator?: import("@xyo-network/xl1-protocol-sdk").ChainBlockNumberIteratorService;
|
|
6
5
|
} & {
|
|
7
6
|
provided: true;
|
|
8
7
|
}, "provided"> | Omit<import("@xylabs/react-shared").NotProvidedContextExState<ChainInfoState>, "provided">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/context/chain/use.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,eAAO,MAAM,YAAY,GAAI,kBAAgB
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/context/chain/use.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,eAAO,MAAM,YAAY,GAAI,kBAAgB;;;;;2GAA2E,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.18.
|
|
4
|
+
"version": "1.18.5",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockchain",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -62,23 +62,23 @@
|
|
|
62
62
|
"@xyo-network/archivist-model": "~5.2.25",
|
|
63
63
|
"@xyo-network/boundwitness-builder": "~5.2.25",
|
|
64
64
|
"@xyo-network/boundwitness-model": "~5.2.25",
|
|
65
|
-
"@xyo-network/chain-analyze": "~1.18.
|
|
66
|
-
"@xyo-network/chain-protocol": "~1.18.
|
|
67
|
-
"@xyo-network/chain-wrappers": "~1.18.
|
|
65
|
+
"@xyo-network/chain-analyze": "~1.18.5",
|
|
66
|
+
"@xyo-network/chain-protocol": "~1.18.5",
|
|
67
|
+
"@xyo-network/chain-wrappers": "~1.18.5",
|
|
68
68
|
"@xyo-network/module-model": "~5.2.25",
|
|
69
69
|
"@xyo-network/payload-builder": "~5.2.25",
|
|
70
70
|
"@xyo-network/payload-model": "~5.2.25",
|
|
71
71
|
"@xyo-network/react-boundwitness-plugin": "~7.4.2",
|
|
72
|
-
"@xyo-network/react-chain-blockies": "~1.18.
|
|
73
|
-
"@xyo-network/react-chain-provider": "~1.18.
|
|
74
|
-
"@xyo-network/react-chain-shared": "~1.18.
|
|
72
|
+
"@xyo-network/react-chain-blockies": "~1.18.5",
|
|
73
|
+
"@xyo-network/react-chain-provider": "~1.18.5",
|
|
74
|
+
"@xyo-network/react-chain-shared": "~1.18.5",
|
|
75
75
|
"@xyo-network/react-error": "~7.4.2",
|
|
76
76
|
"@xyo-network/react-event": "~7.4.2",
|
|
77
77
|
"@xyo-network/react-payload-raw-info": "~7.4.2",
|
|
78
78
|
"@xyo-network/react-payload-table": "~7.4.2",
|
|
79
79
|
"@xyo-network/react-shared": "~7.4.2",
|
|
80
80
|
"@xyo-network/react-table": "~7.4.2",
|
|
81
|
-
"@xyo-network/xl1-sdk": "~1.19.
|
|
81
|
+
"@xyo-network/xl1-sdk": "~1.19.6"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@emotion/react": "~11.14.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@xylabs/tsconfig-react": "~7.3.2",
|
|
95
95
|
"@xyo-network/api-models": "~5.2.25",
|
|
96
96
|
"@xyo-network/bridge-http": "~5.2.25",
|
|
97
|
-
"@xyo-network/xl1-sdk": "~1.19.
|
|
97
|
+
"@xyo-network/xl1-sdk": "~1.19.6",
|
|
98
98
|
"axios": "^1.13.3",
|
|
99
99
|
"eslint": "^9.39.2",
|
|
100
100
|
"react": "~19.2.4",
|
|
@@ -10,7 +10,7 @@ import type { ChainInfoState } from './State.ts'
|
|
|
10
10
|
interface ChainInfoProviderProps extends PropsWithChildren, Omit<ChainInfoState, 'provided'> {}
|
|
11
11
|
|
|
12
12
|
export const ChainInfoProvider: React.FC<ChainInfoProviderProps> = ({
|
|
13
|
-
children, chainArchivist: chainArchivistProp, chainId: chainIdProp,
|
|
13
|
+
children, chainArchivist: chainArchivistProp, chainId: chainIdProp,
|
|
14
14
|
}) => {
|
|
15
15
|
const [chainArchivist, setChainArchivist] = useState<ChainInfoState['chainArchivist']>(chainArchivistProp)
|
|
16
16
|
const [previousChainArchivist, setPreviousChainArchivist] = useState<ChainInfoState['chainArchivist']>(chainArchivistProp)
|
|
@@ -26,32 +26,20 @@ export const ChainInfoProvider: React.FC<ChainInfoProviderProps> = ({
|
|
|
26
26
|
setPreviousChainId(chainIdProp)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const [chainIterator, setChainIterator] = useState<ChainInfoState['chainIterator']>(chainIteratorProp)
|
|
30
|
-
const [previousChainIterator, setPreviousChainIterator] = useState<ChainInfoState['chainIterator']>(chainIteratorProp)
|
|
31
|
-
if (isDefined(chainIteratorProp) && chainIteratorProp !== previousChainIterator) {
|
|
32
|
-
setChainIterator(chainIteratorProp)
|
|
33
|
-
setPreviousChainIterator(chainIteratorProp)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
29
|
const updateChainArchivist = useCallback((chainArchivist: ChainInfoState['chainArchivist']) => {
|
|
37
30
|
setChainArchivist(chainArchivist)
|
|
38
31
|
}, [])
|
|
39
32
|
const updateChainId = useCallback((chainId: ChainInfoState['chainId']) => {
|
|
40
33
|
setChainId(chainId)
|
|
41
34
|
}, [])
|
|
42
|
-
const updateChainIterator = useCallback((chainIterator: ChainInfoState['chainIterator']) => {
|
|
43
|
-
setChainIterator(chainIterator)
|
|
44
|
-
}, [])
|
|
45
35
|
|
|
46
36
|
const chainState: ChainInfoState = useMemo(() => ({
|
|
47
37
|
chainArchivist,
|
|
48
38
|
chainId,
|
|
49
|
-
chainIterator,
|
|
50
39
|
updateChainArchivist,
|
|
51
40
|
updateChainId,
|
|
52
|
-
updateChainIterator,
|
|
53
41
|
provided: true,
|
|
54
|
-
}), [chainArchivist, chainId,
|
|
42
|
+
}), [chainArchivist, chainId, updateChainArchivist, updateChainId])
|
|
55
43
|
|
|
56
44
|
return (
|
|
57
45
|
<ChainInfoContext value={chainState}>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ContextExState } from '@xylabs/react-shared'
|
|
2
2
|
import type { ArchivistInstance } from '@xyo-network/archivist-model'
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChainId } from '@xyo-network/xl1-sdk'
|
|
4
4
|
|
|
5
5
|
export type ChainInfoState = ContextExState<{
|
|
6
6
|
chainArchivist?: ArchivistInstance
|
|
7
7
|
chainId?: ChainId
|
|
8
|
-
chainIterator?: ChainBlockNumberIteratorService
|
|
9
8
|
}>
|