@interchain-kit/react 0.0.1-beta.26 → 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 CHANGED
@@ -106,7 +106,7 @@ console.log(balance)
106
106
 
107
107
  ```
108
108
 
109
- ## useChainWallet
109
+ ### useChainWallet
110
110
  ```js
111
111
  import { keplrWallet } from "@interchain-kit/keplr-extension";
112
112
  import { leapWallet } from "@interchain-kit/leap-extension";
@@ -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(assetList),
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(assetList),
12
+ logoUrl: walletManager.getChainLogoUrl(chainName),
14
13
  chain: chainToShow,
15
14
  assetList,
16
15
  address: account?.address,
package/esm/provider.js CHANGED
@@ -3,7 +3,6 @@ import { useEffect, useMemo, useState } from "react";
3
3
  import { createContext, useContext } from "react";
4
4
  import { WalletManager, } from "@interchain-kit/core";
5
5
  import { WalletModalProvider } from "./modal";
6
- import "@interchain-ui/react/styles";
7
6
  const InterchainWalletContext = createContext(null);
8
7
  export const ChainProvider = ({ chains, assetLists, wallets, signerOptions, endpointOptions, children, }) => {
9
8
  const [_, forceRender] = useState({});
@@ -1,2 +1 @@
1
1
  export * from './wallet';
2
- export * from './chain';
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: (0, utils_1.getChainLogoUrl)(assetList),
38
+ logoUrl: walletManager.getChainLogoUrl(chainName),
40
39
  chain: chainToShow,
41
40
  assetList,
42
41
  address: account?.address,
@@ -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: (0, utils_1.getChainLogoUrl)(assetList),
15
+ logoUrl: walletManager.getChainLogoUrl(chainName),
17
16
  chain: chainToShow,
18
17
  assetList,
19
18
  address: account?.address,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interchain-kit/react",
3
- "version": "0.0.1-beta.26",
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.49.6",
36
- "@interchain-kit/core": "0.0.1-beta.26",
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": "3f531ca46617882f4c3c8f0ea431155223236570"
46
+ "gitHead": "af71854ddd46303972013955e68509a441d47421"
47
47
  }
package/provider.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import { BaseWallet, SignerOptions, WalletManager, EndpointOptions } from "@interchain-kit/core";
3
3
  import { AssetList, Chain } from "@chain-registry/v2-types";
4
- import "@interchain-ui/react/styles";
5
4
  type InterchainWalletContextType = {
6
5
  walletManager: WalletManager;
7
6
  };
package/provider.js CHANGED
@@ -6,7 +6,6 @@ const react_1 = require("react");
6
6
  const react_2 = require("react");
7
7
  const core_1 = require("@interchain-kit/core");
8
8
  const modal_1 = require("./modal");
9
- require("@interchain-ui/react/styles");
10
9
  const InterchainWalletContext = (0, react_2.createContext)(null);
11
10
  const ChainProvider = ({ chains, assetLists, wallets, signerOptions, endpointOptions, children, }) => {
12
11
  const [_, forceRender] = (0, react_1.useState)({});
package/utils/index.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export * from './wallet';
2
- export * from './chain';
package/utils/index.js CHANGED
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./wallet"), exports);
18
- __exportStar(require("./chain"), exports);
@@ -1,3 +0,0 @@
1
- export const getChainLogoUrl = (assetList) => {
2
- return assetList.assets?.[0].logoURIs.png || assetList.assets?.[0].logoURIs.svg || undefined;
3
- };
package/utils/chain.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { AssetList } from "@chain-registry/v2-types";
2
- export declare const getChainLogoUrl: (assetList: AssetList) => string | undefined;
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;