diff --git a/explorer/package.json b/explorer/package.json index 3ed4002d8d0..7a3ac0e785e 100644 --- a/explorer/package.json +++ b/explorer/package.json @@ -19,8 +19,8 @@ }, "dependencies": { "@cosmjs/math": "^0.26.2", - "@cosmos-kit/keplr": "^2.4.4", - "@cosmos-kit/react": "^2.9.3", + "@cosmos-kit/keplr": "^2.3.11", + "@cosmos-kit/react": "^2.8.2", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@mui/icons-material": "^5.0.0", @@ -33,7 +33,7 @@ "@nymproject/react": "^1.0.0", "big.js": "^6.2.1", "buffer": "^6.0.3", - "chain-registry": "^1.20.0", + "chain-registry": "^1.19.0", "d3-scale": "^4.0.0", "date-fns": "^2.24.0", "i18n-iso-countries": "^6.8.0", @@ -114,6 +114,9 @@ "webpack-favicons": "^1.3.8", "webpack-merge": "^5.8.0" }, + + + "browserslist": { "production": [ ">0.2%", diff --git a/explorer/src/components/ConnectKeplrWallet.tsx b/explorer/src/components/ConnectKeplrWallet.tsx index d802f7d39b8..9541b6fcf9c 100644 --- a/explorer/src/components/ConnectKeplrWallet.tsx +++ b/explorer/src/components/ConnectKeplrWallet.tsx @@ -1,9 +1,11 @@ -import { useChain, useWallet, ChainProvider } from '@cosmos-kit/react'; +import { useChain } from '@cosmos-kit/react'; import { Box, Button, Card } from '@mui/material'; import Big from 'big.js'; import { useEffect, useState, useMemo } from 'react'; +import '@interchain-ui/react/styles'; + export function useIsClient() { const [isClient, setIsClient] = useState(false); @@ -28,17 +30,10 @@ export const uNYMtoNYM = (unym: string, rounding = 6) => { }; export default function ConnectKeplrWallet() { - const { username, connect, disconnect, wallet, openView, address, getCosmWasmClient } = useChain('nyx'); - const { status: globalStatus, mainWallet } = useWallet(); // status here is the global wallet status for all activated chains (chain is activated when call useChain) + const { username, connect, disconnect, wallet, openView, address, getCosmWasmClient, isWalletConnected } = + useChain('nyx'); const isClient = useIsClient(); - useEffect(() => { - const fn = async () => { - await mainWallet?.connect(); - }; - fn(); - }, []); - const [balance, setBalance] = useState<{ status: 'loading' | 'success'; data?: string; @@ -65,10 +60,10 @@ export default function ConnectKeplrWallet() { if (!isClient) return null; const getGlobalbutton = () => { - if (globalStatus === 'Connecting') { - return ; - } - if (globalStatus === 'Connected') { + // if (globalStatus === 'Connecting') { + // return ; + // } + if (isWalletConnected) { return (