@interchain-kit/react 0.0.1-beta.50 → 0.0.1-beta.52

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.
@@ -4,6 +4,7 @@ export const useCurrentChainWallet = () => {
4
4
  const walletManager = useWalletManager();
5
5
  const { currentChainName, currentWalletName } = walletManager;
6
6
  const chainWallet = walletManager.getWalletRepositoryByName(currentWalletName)?.getChainAccountByName(currentChainName);
7
+ console.log('chainWallet', currentChainName, currentWalletName, chainWallet);
7
8
  if (chainWallet) {
8
9
  return bindAllMethodsToContext(chainWallet);
9
10
  }
@@ -14,12 +14,13 @@ export const WalletModal = () => {
14
14
  const currentWallet = walletManager
15
15
  .getWalletRepositoryByName(wallet.info.name)
16
16
  .getChainAccountByName(walletManager.currentChainName);
17
+ console.log(wallet.info.name, walletManager.currentChainName, Boolean(currentWallet));
17
18
  setModalView({
18
19
  header: _jsx(ConnectingHeader, { wallet: wallet, onBack: gotoWalletList }),
19
20
  content: _jsx(ConnectingContent, { wallet: wallet }),
20
21
  });
21
- if (currentWallet.wallet?.info.mode === "extension" &&
22
- !currentWallet.wallet.isExtensionInstalled) {
22
+ if (currentWallet?.wallet?.info.mode === "extension" &&
23
+ !(currentWallet?.wallet).isExtensionInstalled) {
23
24
  setModalView({
24
25
  header: (_jsx(NotExistHeader, { wallet: currentWallet, onBack: gotoWalletList })),
25
26
  content: _jsx(NotExistContent, { wallet: currentWallet }),
@@ -27,17 +28,17 @@ export const WalletModal = () => {
27
28
  return;
28
29
  }
29
30
  try {
30
- if (currentWallet.wallet?.info.mode === "wallet-connect") {
31
- currentWallet.wallet.setOnPairingUriCreatedCallback(() => {
31
+ if (currentWallet?.wallet?.info.mode === "wallet-connect") {
32
+ (currentWallet?.wallet).setOnPairingUriCreatedCallback(() => {
32
33
  setModalView({
33
34
  header: _jsx(QRCodeHeader, { onBack: gotoWalletList }),
34
35
  content: _jsx(QRCodeContent, {}),
35
36
  });
36
37
  });
37
- currentWallet.wallet.setPairingToConnect(wallet.pairing);
38
+ (currentWallet?.wallet).setPairingToConnect(wallet.pairing);
38
39
  }
39
- await currentWallet.connect();
40
- await currentWallet.getAccount();
40
+ await currentWallet?.connect();
41
+ await currentWallet?.getAccount();
41
42
  setModalView({
42
43
  header: _jsx(ConnectedHeader, { onBack: gotoWalletList }),
43
44
  content: _jsx(ConnectedContent, {}),
@@ -1,8 +1,8 @@
1
1
  export const getWalletInfo = (wallet) => {
2
2
  return {
3
- name: wallet.info.name,
4
- prettyName: wallet.info.prettyName,
5
- logo: wallet.info.logo,
3
+ name: wallet.info?.name,
4
+ prettyName: wallet.info?.prettyName,
5
+ logo: wallet.info?.logo,
6
6
  mobileDisabled: true,
7
7
  };
8
8
  };
@@ -7,6 +7,7 @@ const useCurrentChainWallet = () => {
7
7
  const walletManager = (0, useWalletManager_1.useWalletManager)();
8
8
  const { currentChainName, currentWalletName } = walletManager;
9
9
  const chainWallet = walletManager.getWalletRepositoryByName(currentWalletName)?.getChainAccountByName(currentChainName);
10
+ console.log('chainWallet', currentChainName, currentWalletName, chainWallet);
10
11
  if (chainWallet) {
11
12
  return (0, helpers_1.bindAllMethodsToContext)(chainWallet);
12
13
  }
package/modal/modal.js CHANGED
@@ -17,12 +17,13 @@ const WalletModal = () => {
17
17
  const currentWallet = walletManager
18
18
  .getWalletRepositoryByName(wallet.info.name)
19
19
  .getChainAccountByName(walletManager.currentChainName);
20
+ console.log(wallet.info.name, walletManager.currentChainName, Boolean(currentWallet));
20
21
  setModalView({
21
22
  header: (0, jsx_runtime_1.jsx)(views_1.ConnectingHeader, { wallet: wallet, onBack: gotoWalletList }),
22
23
  content: (0, jsx_runtime_1.jsx)(views_1.ConnectingContent, { wallet: wallet }),
23
24
  });
24
- if (currentWallet.wallet?.info.mode === "extension" &&
25
- !currentWallet.wallet.isExtensionInstalled) {
25
+ if (currentWallet?.wallet?.info.mode === "extension" &&
26
+ !(currentWallet?.wallet).isExtensionInstalled) {
26
27
  setModalView({
27
28
  header: ((0, jsx_runtime_1.jsx)(views_1.NotExistHeader, { wallet: currentWallet, onBack: gotoWalletList })),
28
29
  content: (0, jsx_runtime_1.jsx)(views_1.NotExistContent, { wallet: currentWallet }),
@@ -30,17 +31,17 @@ const WalletModal = () => {
30
31
  return;
31
32
  }
32
33
  try {
33
- if (currentWallet.wallet?.info.mode === "wallet-connect") {
34
- currentWallet.wallet.setOnPairingUriCreatedCallback(() => {
34
+ if (currentWallet?.wallet?.info.mode === "wallet-connect") {
35
+ (currentWallet?.wallet).setOnPairingUriCreatedCallback(() => {
35
36
  setModalView({
36
37
  header: (0, jsx_runtime_1.jsx)(views_1.QRCodeHeader, { onBack: gotoWalletList }),
37
38
  content: (0, jsx_runtime_1.jsx)(views_1.QRCodeContent, {}),
38
39
  });
39
40
  });
40
- currentWallet.wallet.setPairingToConnect(wallet.pairing);
41
+ (currentWallet?.wallet).setPairingToConnect(wallet.pairing);
41
42
  }
42
- await currentWallet.connect();
43
- await currentWallet.getAccount();
43
+ await currentWallet?.connect();
44
+ await currentWallet?.getAccount();
44
45
  setModalView({
45
46
  header: (0, jsx_runtime_1.jsx)(views_1.ConnectedHeader, { onBack: gotoWalletList }),
46
47
  content: (0, jsx_runtime_1.jsx)(views_1.ConnectedContent, {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interchain-kit/react",
3
- "version": "0.0.1-beta.50",
3
+ "version": "0.0.1-beta.52",
4
4
  "author": "cosmology-tech <developers@cosmology.zone>",
5
5
  "description": "interchain-kit wallet connector react package",
6
6
  "main": "index.js",
@@ -33,7 +33,7 @@
33
33
  "keywords": [],
34
34
  "dependencies": {
35
35
  "@chain-registry/v2-types": "^0.53.40",
36
- "@interchain-kit/core": "0.0.1-beta.50",
36
+ "@interchain-kit/core": "0.0.1-beta.52",
37
37
  "@interchain-ui/react": "1.26.1",
38
38
  "@interchainjs/cosmos": "1.6.3",
39
39
  "@interchainjs/cosmos-types": "1.6.3",
@@ -48,5 +48,5 @@
48
48
  "react": "^18.3.1",
49
49
  "react-dom": "^18.3.1"
50
50
  },
51
- "gitHead": "c8799c021ad3b801da6e1ef1c05f073908fb0bde"
51
+ "gitHead": "b88068536c1230bf52e8288237862416a42adf7c"
52
52
  }
package/utils/wallet.js CHANGED
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWalletInfo = void 0;
4
4
  const getWalletInfo = (wallet) => {
5
5
  return {
6
- name: wallet.info.name,
7
- prettyName: wallet.info.prettyName,
8
- logo: wallet.info.logo,
6
+ name: wallet.info?.name,
7
+ prettyName: wallet.info?.prettyName,
8
+ logo: wallet.info?.logo,
9
9
  mobileDisabled: true,
10
10
  };
11
11
  };