@interchain-kit/react 0.3.41 → 0.3.42
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/esm/provider.js +4 -4
- package/package.json +3 -3
- package/provider.js +4 -4
package/esm/provider.js
CHANGED
|
@@ -6,11 +6,11 @@ import { ModalRenderer } from "./modal";
|
|
|
6
6
|
import { createInterchainStore } from "./store";
|
|
7
7
|
const InterchainWalletContext = createContext(null);
|
|
8
8
|
export const ChainProvider = ({ chains, assetLists, wallets, signerOptions, endpointOptions, children, walletModal: ProviderWalletModal, }) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const store = useRef(null);
|
|
10
|
+
if (!store.current) {
|
|
11
|
+
store.current = createInterchainStore(new WalletManager(chains, assetLists, wallets, signerOptions, endpointOptions));
|
|
12
|
+
}
|
|
12
13
|
useEffect(() => {
|
|
13
|
-
// walletManager.init();
|
|
14
14
|
store.current.getState().init();
|
|
15
15
|
}, []);
|
|
16
16
|
return (_jsxs(InterchainWalletContext.Provider, { value: store.current, children: [children, ProviderWalletModal && (_jsx(ModalRenderer, { walletModal: ProviderWalletModal }))] }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interchain-kit/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.42",
|
|
4
4
|
"author": "Hyperweb <developers@hyperweb.io>",
|
|
5
5
|
"description": "interchain-kit wallet connector react package",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"keywords": [],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@chain-registry/types": "^2.0.1",
|
|
38
|
-
"@interchain-kit/core": "0.3.
|
|
38
|
+
"@interchain-kit/core": "0.3.42",
|
|
39
39
|
"@interchain-ui/react": "^1.26.3",
|
|
40
40
|
"@interchainjs/cosmos": "1.11.11",
|
|
41
41
|
"@interchainjs/cosmos-types": "1.11.11",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"react": "^19.0.0",
|
|
70
70
|
"react-dom": "^19.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "545a2335540e09e1450dc76aa3999e90f24c655f"
|
|
73
73
|
}
|
package/provider.js
CHANGED
|
@@ -9,11 +9,11 @@ const modal_1 = require("./modal");
|
|
|
9
9
|
const store_1 = require("./store");
|
|
10
10
|
const InterchainWalletContext = (0, react_2.createContext)(null);
|
|
11
11
|
const ChainProvider = ({ chains, assetLists, wallets, signerOptions, endpointOptions, children, walletModal: ProviderWalletModal, }) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const store = (0, react_1.useRef)(null);
|
|
13
|
+
if (!store.current) {
|
|
14
|
+
store.current = (0, store_1.createInterchainStore)(new core_1.WalletManager(chains, assetLists, wallets, signerOptions, endpointOptions));
|
|
15
|
+
}
|
|
15
16
|
(0, react_1.useEffect)(() => {
|
|
16
|
-
// walletManager.init();
|
|
17
17
|
store.current.getState().init();
|
|
18
18
|
}, []);
|
|
19
19
|
return ((0, jsx_runtime_1.jsxs)(InterchainWalletContext.Provider, { value: store.current, children: [children, ProviderWalletModal && ((0, jsx_runtime_1.jsx)(modal_1.ModalRenderer, { walletModal: ProviderWalletModal }))] }));
|