@interchain-kit/react 0.3.43 → 0.3.45
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/store/stateful-wallet.js +16 -6
- package/package.json +7 -7
- package/store/stateful-wallet.js +16 -6
|
@@ -47,14 +47,24 @@ export class StatefulWallet extends BaseWallet {
|
|
|
47
47
|
return errors.length > 0 ? errors[0] : '';
|
|
48
48
|
}
|
|
49
49
|
async init() {
|
|
50
|
-
this.originalWallet.events.on('accountChanged', async () => {
|
|
51
|
-
const chains = Array.from(this.originalWallet.chainMap.values());
|
|
52
|
-
for (const chain of chains) {
|
|
53
|
-
await this.getAccount(chain.chainId);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
50
|
try {
|
|
57
51
|
await this.originalWallet.init();
|
|
52
|
+
this.originalWallet.events.on('accountChanged', async () => {
|
|
53
|
+
const chains = Array.from(this.originalWallet.chainMap.values());
|
|
54
|
+
for (const chain of chains) {
|
|
55
|
+
await this.getAccount(chain.chainId);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
this.originalWallet.events.on('disconnect', () => {
|
|
59
|
+
// Update all chains for this wallet to disconnected state
|
|
60
|
+
this.store.chains.forEach(chain => {
|
|
61
|
+
this.store.updateChainWalletState(this.walletName, chain.chainName, {
|
|
62
|
+
walletState: WalletState.Disconnected,
|
|
63
|
+
account: null,
|
|
64
|
+
errorMessage: ''
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
58
68
|
this.store.chains.forEach(chain => {
|
|
59
69
|
const lastChainWalletState = this.store.getChainWalletState(this.walletName, chain.chainName)?.walletState;
|
|
60
70
|
if (lastChainWalletState === WalletState.NotExist) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interchain-kit/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.45",
|
|
4
4
|
"author": "Hyperweb <developers@hyperweb.io>",
|
|
5
5
|
"description": "interchain-kit wallet connector react package",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,14 +35,14 @@
|
|
|
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.45",
|
|
39
39
|
"@interchain-ui/react": "^1.26.3",
|
|
40
|
-
"@interchainjs/cosmos": "1.
|
|
41
|
-
"@interchainjs/cosmos-types": "1.
|
|
42
|
-
"@interchainjs/types": "1.
|
|
40
|
+
"@interchainjs/cosmos": "1.13.0",
|
|
41
|
+
"@interchainjs/cosmos-types": "1.13.0",
|
|
42
|
+
"@interchainjs/types": "1.13.0",
|
|
43
43
|
"@react-icons/all-files": "^4.1.0",
|
|
44
44
|
"@walletconnect/types": "^2.17.3",
|
|
45
|
-
"interchainjs": "1.
|
|
45
|
+
"interchainjs": "1.13.0",
|
|
46
46
|
"jest-transform-stub": "^2.0.0",
|
|
47
47
|
"postcss": "^8.5.6",
|
|
48
48
|
"postcss-cli": "^11.0.1",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"react": "^19.0.0",
|
|
70
70
|
"react-dom": "^19.0.0"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "00f3b85927a9e19f4d5b20e775f9c15412e22f38"
|
|
73
73
|
}
|
package/store/stateful-wallet.js
CHANGED
|
@@ -50,14 +50,24 @@ class StatefulWallet extends core_1.BaseWallet {
|
|
|
50
50
|
return errors.length > 0 ? errors[0] : '';
|
|
51
51
|
}
|
|
52
52
|
async init() {
|
|
53
|
-
this.originalWallet.events.on('accountChanged', async () => {
|
|
54
|
-
const chains = Array.from(this.originalWallet.chainMap.values());
|
|
55
|
-
for (const chain of chains) {
|
|
56
|
-
await this.getAccount(chain.chainId);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
53
|
try {
|
|
60
54
|
await this.originalWallet.init();
|
|
55
|
+
this.originalWallet.events.on('accountChanged', async () => {
|
|
56
|
+
const chains = Array.from(this.originalWallet.chainMap.values());
|
|
57
|
+
for (const chain of chains) {
|
|
58
|
+
await this.getAccount(chain.chainId);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
this.originalWallet.events.on('disconnect', () => {
|
|
62
|
+
// Update all chains for this wallet to disconnected state
|
|
63
|
+
this.store.chains.forEach(chain => {
|
|
64
|
+
this.store.updateChainWalletState(this.walletName, chain.chainName, {
|
|
65
|
+
walletState: core_1.WalletState.Disconnected,
|
|
66
|
+
account: null,
|
|
67
|
+
errorMessage: ''
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
61
71
|
this.store.chains.forEach(chain => {
|
|
62
72
|
const lastChainWalletState = this.store.getChainWalletState(this.walletName, chain.chainName)?.walletState;
|
|
63
73
|
if (lastChainWalletState === core_1.WalletState.NotExist) {
|