@interchain-kit/react 0.0.1-beta.24 → 0.0.1-beta.26

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.
@@ -1,13 +1,14 @@
1
1
  import { useEffect } from "react";
2
2
  import { useWalletManager } from "./useWalletManager";
3
3
  import { useWalletModal } from "../modal";
4
+ import { WalletManagerState } from "@interchain-kit/core";
4
5
  export const useCurrentWallet = () => {
5
6
  const walletManager = useWalletManager();
6
7
  const { open } = useWalletModal();
7
8
  useEffect(() => {
8
- if (!walletManager.currentWalletName) {
9
+ if (!walletManager.currentWalletName && walletManager.state === WalletManagerState.Initialized) {
9
10
  open();
10
11
  }
11
- }, [walletManager.currentWalletName]);
12
+ }, [walletManager.currentWalletName, walletManager.state]);
12
13
  return walletManager.getCurrentWallet();
13
14
  };
package/esm/provider.js CHANGED
@@ -3,6 +3,7 @@ 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";
6
7
  const InterchainWalletContext = createContext(null);
7
8
  export const ChainProvider = ({ chains, assetLists, wallets, signerOptions, endpointOptions, children, }) => {
8
9
  const [_, forceRender] = useState({});
@@ -4,14 +4,15 @@ exports.useCurrentWallet = void 0;
4
4
  const react_1 = require("react");
5
5
  const useWalletManager_1 = require("./useWalletManager");
6
6
  const modal_1 = require("../modal");
7
+ const core_1 = require("@interchain-kit/core");
7
8
  const useCurrentWallet = () => {
8
9
  const walletManager = (0, useWalletManager_1.useWalletManager)();
9
10
  const { open } = (0, modal_1.useWalletModal)();
10
11
  (0, react_1.useEffect)(() => {
11
- if (!walletManager.currentWalletName) {
12
+ if (!walletManager.currentWalletName && walletManager.state === core_1.WalletManagerState.Initialized) {
12
13
  open();
13
14
  }
14
- }, [walletManager.currentWalletName]);
15
+ }, [walletManager.currentWalletName, walletManager.state]);
15
16
  return walletManager.getCurrentWallet();
16
17
  };
17
18
  exports.useCurrentWallet = useCurrentWallet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interchain-kit/react",
3
- "version": "0.0.1-beta.24",
3
+ "version": "0.0.1-beta.26",
4
4
  "author": "cosmology-tech <developers@cosmology.zone>",
5
5
  "description": "interchain-kit wallet connector react package",
6
6
  "main": "index.js",
@@ -27,12 +27,13 @@
27
27
  "build:dev": "npm run clean; tsc --declarationMap; tsc -p tsconfig.esm.json; npm run copy",
28
28
  "lint": "eslint . --fix",
29
29
  "test": "jest",
30
- "test:watch": "jest --watch"
30
+ "test:watch": "jest --watch",
31
+ "dev": "tsc -w --preserveWatchOutput -p tsconfig.esm.json"
31
32
  },
32
33
  "keywords": [],
33
34
  "dependencies": {
34
35
  "@chain-registry/v2-types": "^0.49.6",
35
- "@interchain-kit/core": "0.0.1-beta.24",
36
+ "@interchain-kit/core": "0.0.1-beta.26",
36
37
  "@interchain-ui/react": "1.24.0",
37
38
  "@interchainjs/cosmos-types": "0.0.1-beta.9",
38
39
  "@interchainjs/injective": "0.0.1-beta.13",
@@ -42,5 +43,5 @@
42
43
  "react": "^18.3.1",
43
44
  "react-dom": "^18.3.1"
44
45
  },
45
- "gitHead": "0c66e771b9fb5e32d4f13f0e62ce65542ecbaeff"
46
+ "gitHead": "3f531ca46617882f4c3c8f0ea431155223236570"
46
47
  }
package/provider.d.ts CHANGED
@@ -1,6 +1,7 @@
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";
4
5
  type InterchainWalletContextType = {
5
6
  walletManager: WalletManager;
6
7
  };
package/provider.js CHANGED
@@ -6,6 +6,7 @@ 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");
9
10
  const InterchainWalletContext = (0, react_2.createContext)(null);
10
11
  const ChainProvider = ({ chains, assetLists, wallets, signerOptions, endpointOptions, children, }) => {
11
12
  const [_, forceRender] = (0, react_1.useState)({});