@interchain-kit/react 0.0.1-beta.25 → 0.0.1-beta.27
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/README.md +1 -1
- package/esm/hooks/useChain.js +1 -2
- package/esm/hooks/useChainWallet.js +1 -2
- package/esm/hooks/useCurrentWallet.js +0 -2
- package/esm/utils/index.js +0 -1
- package/hooks/useChain.js +1 -2
- package/hooks/useChainWallet.js +1 -2
- package/hooks/useCurrentWallet.js +0 -2
- package/package.json +4 -4
- package/utils/index.d.ts +0 -1
- package/utils/index.js +0 -1
- package/esm/utils/chain.js +0 -3
- package/utils/chain.d.ts +0 -2
- package/utils/chain.js +0 -7
package/README.md
CHANGED
package/esm/hooks/useChain.js
CHANGED
|
@@ -4,7 +4,6 @@ import { useCurrentWallet } from './useCurrentWallet';
|
|
|
4
4
|
import { useInterchainClient } from './useInterchainClient';
|
|
5
5
|
import { useWalletModal } from "../modal";
|
|
6
6
|
import { ChainNameNotExist } from "@interchain-kit/core";
|
|
7
|
-
import { getChainLogoUrl } from "../utils";
|
|
8
7
|
export const useChain = (chainName) => {
|
|
9
8
|
const walletManager = useWalletManager();
|
|
10
9
|
const chainToShow = walletManager.chains.find((c) => c.chainName === chainName);
|
|
@@ -33,7 +32,7 @@ export const useChain = (chainName) => {
|
|
|
33
32
|
getSigningCosmosClient: () => walletManager.getSigningCosmosClient(currentWallet.option.name, chainName),
|
|
34
33
|
};
|
|
35
34
|
return {
|
|
36
|
-
logoUrl: getChainLogoUrl(
|
|
35
|
+
logoUrl: walletManager.getChainLogoUrl(chainName),
|
|
37
36
|
chain: chainToShow,
|
|
38
37
|
assetList,
|
|
39
38
|
address: account?.address,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useWalletManager } from "./useWalletManager";
|
|
2
2
|
import { useAccount } from "./useAccount";
|
|
3
3
|
import { useInterchainClient } from "./useInterchainClient";
|
|
4
|
-
import { getChainLogoUrl } from "../utils";
|
|
5
4
|
export const useChainWallet = (chainName, walletName) => {
|
|
6
5
|
const walletManager = useWalletManager();
|
|
7
6
|
const chainToShow = walletManager.chains.find((c) => c.chainName === chainName);
|
|
@@ -10,7 +9,7 @@ export const useChainWallet = (chainName, walletName) => {
|
|
|
10
9
|
const account = useAccount(chainName, walletName);
|
|
11
10
|
const interchainClient = useInterchainClient(chainName, walletName);
|
|
12
11
|
return {
|
|
13
|
-
logoUrl: getChainLogoUrl(
|
|
12
|
+
logoUrl: walletManager.getChainLogoUrl(chainName),
|
|
14
13
|
chain: chainToShow,
|
|
15
14
|
assetList,
|
|
16
15
|
address: account?.address,
|
|
@@ -6,9 +6,7 @@ export const useCurrentWallet = () => {
|
|
|
6
6
|
const walletManager = useWalletManager();
|
|
7
7
|
const { open } = useWalletModal();
|
|
8
8
|
useEffect(() => {
|
|
9
|
-
console.log(walletManager.currentWalletName, walletManager.state);
|
|
10
9
|
if (!walletManager.currentWalletName && walletManager.state === WalletManagerState.Initialized) {
|
|
11
|
-
console.log('do i open this ?');
|
|
12
10
|
open();
|
|
13
11
|
}
|
|
14
12
|
}, [walletManager.currentWalletName, walletManager.state]);
|
package/esm/utils/index.js
CHANGED
package/hooks/useChain.js
CHANGED
|
@@ -7,7 +7,6 @@ const useCurrentWallet_1 = require("./useCurrentWallet");
|
|
|
7
7
|
const useInterchainClient_1 = require("./useInterchainClient");
|
|
8
8
|
const modal_1 = require("../modal");
|
|
9
9
|
const core_1 = require("@interchain-kit/core");
|
|
10
|
-
const utils_1 = require("../utils");
|
|
11
10
|
const useChain = (chainName) => {
|
|
12
11
|
const walletManager = (0, useWalletManager_1.useWalletManager)();
|
|
13
12
|
const chainToShow = walletManager.chains.find((c) => c.chainName === chainName);
|
|
@@ -36,7 +35,7 @@ const useChain = (chainName) => {
|
|
|
36
35
|
getSigningCosmosClient: () => walletManager.getSigningCosmosClient(currentWallet.option.name, chainName),
|
|
37
36
|
};
|
|
38
37
|
return {
|
|
39
|
-
logoUrl:
|
|
38
|
+
logoUrl: walletManager.getChainLogoUrl(chainName),
|
|
40
39
|
chain: chainToShow,
|
|
41
40
|
assetList,
|
|
42
41
|
address: account?.address,
|
package/hooks/useChainWallet.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.useChainWallet = void 0;
|
|
|
4
4
|
const useWalletManager_1 = require("./useWalletManager");
|
|
5
5
|
const useAccount_1 = require("./useAccount");
|
|
6
6
|
const useInterchainClient_1 = require("./useInterchainClient");
|
|
7
|
-
const utils_1 = require("../utils");
|
|
8
7
|
const useChainWallet = (chainName, walletName) => {
|
|
9
8
|
const walletManager = (0, useWalletManager_1.useWalletManager)();
|
|
10
9
|
const chainToShow = walletManager.chains.find((c) => c.chainName === chainName);
|
|
@@ -13,7 +12,7 @@ const useChainWallet = (chainName, walletName) => {
|
|
|
13
12
|
const account = (0, useAccount_1.useAccount)(chainName, walletName);
|
|
14
13
|
const interchainClient = (0, useInterchainClient_1.useInterchainClient)(chainName, walletName);
|
|
15
14
|
return {
|
|
16
|
-
logoUrl:
|
|
15
|
+
logoUrl: walletManager.getChainLogoUrl(chainName),
|
|
17
16
|
chain: chainToShow,
|
|
18
17
|
assetList,
|
|
19
18
|
address: account?.address,
|
|
@@ -9,9 +9,7 @@ const useCurrentWallet = () => {
|
|
|
9
9
|
const walletManager = (0, useWalletManager_1.useWalletManager)();
|
|
10
10
|
const { open } = (0, modal_1.useWalletModal)();
|
|
11
11
|
(0, react_1.useEffect)(() => {
|
|
12
|
-
console.log(walletManager.currentWalletName, walletManager.state);
|
|
13
12
|
if (!walletManager.currentWalletName && walletManager.state === core_1.WalletManagerState.Initialized) {
|
|
14
|
-
console.log('do i open this ?');
|
|
15
13
|
open();
|
|
16
14
|
}
|
|
17
15
|
}, [walletManager.currentWalletName, walletManager.state]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interchain-kit/react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.27",
|
|
4
4
|
"author": "cosmology-tech <developers@cosmology.zone>",
|
|
5
5
|
"description": "interchain-kit wallet connector react package",
|
|
6
6
|
"main": "index.js",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"keywords": [],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@chain-registry/v2-types": "^0.
|
|
36
|
-
"@interchain-kit/core": "0.0.1-beta.
|
|
35
|
+
"@chain-registry/v2-types": "^0.53.0",
|
|
36
|
+
"@interchain-kit/core": "0.0.1-beta.27",
|
|
37
37
|
"@interchain-ui/react": "1.24.0",
|
|
38
38
|
"@interchainjs/cosmos-types": "0.0.1-beta.9",
|
|
39
39
|
"@interchainjs/injective": "0.0.1-beta.13",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"react": "^18.3.1",
|
|
44
44
|
"react-dom": "^18.3.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "af71854ddd46303972013955e68509a441d47421"
|
|
47
47
|
}
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
package/esm/utils/chain.js
DELETED
package/utils/chain.d.ts
DELETED
package/utils/chain.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getChainLogoUrl = void 0;
|
|
4
|
-
const getChainLogoUrl = (assetList) => {
|
|
5
|
-
return assetList.assets?.[0].logoURIs.png || assetList.assets?.[0].logoURIs.svg || undefined;
|
|
6
|
-
};
|
|
7
|
-
exports.getChainLogoUrl = getChainLogoUrl;
|