From 8d251e9aa91615d4e72911e47204dbcb22dd53f0 Mon Sep 17 00:00:00 2001 From: June Date: Mon, 17 Oct 2022 17:07:08 +0800 Subject: [PATCH] update --- examples/contracts/components/wallet.tsx | 57 ++-- examples/contracts/package.json | 4 +- examples/contracts/pages/_app.tsx | 4 +- examples/juno/components/wallet.tsx | 57 ++-- examples/juno/package.json | 8 +- examples/juno/pages/_app.tsx | 4 +- .../osmosis-cosmwasm/components/wallet.tsx | 57 ++-- examples/osmosis-cosmwasm/package.json | 8 +- examples/osmosis-cosmwasm/pages/_app.tsx | 4 +- examples/osmosis/components/wallet.tsx | 57 ++-- examples/osmosis/config/defaults.ts | 4 +- examples/osmosis/package.json | 8 +- examples/osmosis/pages/_app.tsx | 7 +- examples/send-tokens/components/wallet.tsx | 57 ++-- examples/send-tokens/package.json | 8 +- examples/send-tokens/pages/_app.tsx | 4 +- examples/stargaze/components/wallet.tsx | 57 ++-- examples/stargaze/package.json | 8 +- examples/stargaze/pages/_app.tsx | 4 +- .../tailwindcss/components/react/index.ts | 1 + .../tailwindcss/components/react/modal.tsx | 12 +- examples/tailwindcss/components/wallet.tsx | 271 ++++++++---------- examples/tailwindcss/config/chain-infos.ts | 19 -- examples/tailwindcss/package.json | 8 +- examples/telescope/components/wallet.tsx | 57 ++-- examples/telescope/package.json | 4 +- examples/telescope/pages/_app.tsx | 4 +- package.json | 2 +- templates/connect-chain/components/wallet.tsx | 56 ++-- templates/connect-chain/package.json | 8 +- templates/connect-chain/pages/_app.tsx | 4 +- .../connect-multi-chain/components/wallet.tsx | 41 +-- templates/connect-multi-chain/package.json | 8 +- yarn.lock | 46 +-- 34 files changed, 383 insertions(+), 575 deletions(-) delete mode 100644 examples/tailwindcss/config/chain-infos.ts diff --git a/examples/contracts/components/wallet.tsx b/examples/contracts/components/wallet.tsx index ecb7170b5..c1ada72ee 100644 --- a/examples/contracts/components/wallet.tsx +++ b/examples/contracts/components/wallet.tsx @@ -9,7 +9,7 @@ import { useColorModeValue, Text } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -27,9 +27,8 @@ import { WalletConnectComponent, ChainCard } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; +import { chainName } from '../config'; + export const WalletSection = () => { const walletManager = useWallet(); @@ -41,32 +40,22 @@ export const WalletSection = () => { address, message, currentChainName, - currentWalletName, - chains + currentWallet, + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -104,17 +93,13 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> @@ -123,7 +108,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } @@ -140,10 +125,10 @@ export const WalletSection = () => { alignItems="center" justifyContent="center" > - {chainName && ( + {currentChainName && ( diff --git a/examples/contracts/package.json b/examples/contracts/package.json index e6a5024dc..fe449e6f1 100644 --- a/examples/contracts/package.json +++ b/examples/contracts/package.json @@ -16,7 +16,7 @@ "@chakra-ui/react": "^2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/react": "0.18.6", "@cosmos-kit/types": "^0.11.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", @@ -42,4 +42,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/examples/contracts/pages/_app.tsx b/examples/contracts/pages/_app.tsx index daa2735e0..841948ba4 100644 --- a/examples/contracts/pages/_app.tsx +++ b/examples/contracts/pages/_app.tsx @@ -38,8 +38,8 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) { return ( chain.chain_name === chainName)} - assetLists={assets.filter(asset => asset.chain_name === chainName)} + chains={chains} + assetLists={assets} wallets={wallets} signerOptions={signerOptions} > diff --git a/examples/juno/components/wallet.tsx b/examples/juno/components/wallet.tsx index ecb7170b5..c1ada72ee 100644 --- a/examples/juno/components/wallet.tsx +++ b/examples/juno/components/wallet.tsx @@ -9,7 +9,7 @@ import { useColorModeValue, Text } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -27,9 +27,8 @@ import { WalletConnectComponent, ChainCard } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; +import { chainName } from '../config'; + export const WalletSection = () => { const walletManager = useWallet(); @@ -41,32 +40,22 @@ export const WalletSection = () => { address, message, currentChainName, - currentWalletName, - chains + currentWallet, + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -104,17 +93,13 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> @@ -123,7 +108,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } @@ -140,10 +125,10 @@ export const WalletSection = () => { alignItems="center" justifyContent="center" > - {chainName && ( + {currentChainName && ( diff --git a/examples/juno/package.json b/examples/juno/package.json index c6150ae25..efaf918b6 100644 --- a/examples/juno/package.json +++ b/examples/juno/package.json @@ -14,9 +14,9 @@ "@chakra-ui/react": "2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/core": "0.19.3", - "@cosmos-kit/keplr": "0.19.3", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/core": "0.19.9", + "@cosmos-kit/keplr": "0.19.7", + "@cosmos-kit/react": "0.18.6", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", "@juno-network/assets": "0.11.1", @@ -37,4 +37,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/examples/juno/pages/_app.tsx b/examples/juno/pages/_app.tsx index 4834a5a24..5a3389841 100644 --- a/examples/juno/pages/_app.tsx +++ b/examples/juno/pages/_app.tsx @@ -29,8 +29,8 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) { return ( chain.chain_name === chainName)} - assetLists={assets.filter(asset => asset.chain_name === chainName)} + chains={chains} + assetLists={assets} wallets={wallets} signerOptions={signerOptions} > diff --git a/examples/osmosis-cosmwasm/components/wallet.tsx b/examples/osmosis-cosmwasm/components/wallet.tsx index ecb7170b5..c1ada72ee 100644 --- a/examples/osmosis-cosmwasm/components/wallet.tsx +++ b/examples/osmosis-cosmwasm/components/wallet.tsx @@ -9,7 +9,7 @@ import { useColorModeValue, Text } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -27,9 +27,8 @@ import { WalletConnectComponent, ChainCard } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; +import { chainName } from '../config'; + export const WalletSection = () => { const walletManager = useWallet(); @@ -41,32 +40,22 @@ export const WalletSection = () => { address, message, currentChainName, - currentWalletName, - chains + currentWallet, + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -104,17 +93,13 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> @@ -123,7 +108,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } @@ -140,10 +125,10 @@ export const WalletSection = () => { alignItems="center" justifyContent="center" > - {chainName && ( + {currentChainName && ( diff --git a/examples/osmosis-cosmwasm/package.json b/examples/osmosis-cosmwasm/package.json index 8b8082091..08e322cbd 100644 --- a/examples/osmosis-cosmwasm/package.json +++ b/examples/osmosis-cosmwasm/package.json @@ -16,9 +16,9 @@ "@chakra-ui/react": "2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/core": "0.19.3", - "@cosmos-kit/keplr": "0.19.3", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/core": "0.19.9", + "@cosmos-kit/keplr": "0.19.7", + "@cosmos-kit/react": "0.18.6", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", "bignumber.js": "9.1.0", @@ -39,4 +39,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/examples/osmosis-cosmwasm/pages/_app.tsx b/examples/osmosis-cosmwasm/pages/_app.tsx index 86c4cd59e..b986861b4 100644 --- a/examples/osmosis-cosmwasm/pages/_app.tsx +++ b/examples/osmosis-cosmwasm/pages/_app.tsx @@ -30,8 +30,8 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) { return ( chain.chain_name === chainName)} - assetLists={assets.filter(asset => asset.chain_name === chainName)} + chains={chains} + assetLists={assets} wallets={wallets} signerOptions={signerOptions} endpointOptions={{ diff --git a/examples/osmosis/components/wallet.tsx b/examples/osmosis/components/wallet.tsx index ecb7170b5..ce942a65e 100644 --- a/examples/osmosis/components/wallet.tsx +++ b/examples/osmosis/components/wallet.tsx @@ -9,7 +9,7 @@ import { useColorModeValue, Text } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect, useMemo } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -27,9 +27,8 @@ import { WalletConnectComponent, ChainCard } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; +import { chainName } from '../config'; + export const WalletSection = () => { const walletManager = useWallet(); @@ -41,32 +40,22 @@ export const WalletSection = () => { address, message, currentChainName, - currentWalletName, - chains + currentWallet, + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -104,17 +93,13 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> @@ -123,7 +108,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } @@ -140,10 +125,10 @@ export const WalletSection = () => { alignItems="center" justifyContent="center" > - {chainName && ( + {currentChainName && ( diff --git a/examples/osmosis/config/defaults.ts b/examples/osmosis/config/defaults.ts index 664c35337..d3f8e3f55 100644 --- a/examples/osmosis/config/defaults.ts +++ b/examples/osmosis/config/defaults.ts @@ -4,8 +4,8 @@ import { AssetList, Asset } from '@chain-registry/types'; import { SigningStargateClient } from '@cosmjs/stargate'; import { cosmos } from 'osmojs'; -// export const chainName = 'osmosis'; -export const chainName = 'osmosistestnet'; +export const chainName = 'osmosis'; +// export const chainName = 'osmosistestnet'; export const chainassets: AssetList = assets.find( (chain) => chain.chain_name === chainName diff --git a/examples/osmosis/package.json b/examples/osmosis/package.json index 04ff6d9ea..c55fa7554 100644 --- a/examples/osmosis/package.json +++ b/examples/osmosis/package.json @@ -15,9 +15,9 @@ "@chakra-ui/react": "2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/core": "0.19.3", - "@cosmos-kit/keplr": "0.19.3", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/core": "0.19.9", + "@cosmos-kit/keplr": "0.19.7", + "@cosmos-kit/react": "0.18.6", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", "bignumber.js": "9.1.0", @@ -37,4 +37,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/examples/osmosis/pages/_app.tsx b/examples/osmosis/pages/_app.tsx index c3556e79e..c54d93cd4 100644 --- a/examples/osmosis/pages/_app.tsx +++ b/examples/osmosis/pages/_app.tsx @@ -11,9 +11,6 @@ import { GasPrice } from '@cosmjs/stargate'; import { SignerOptions } from '@cosmos-kit/core'; import { Chain } from '@chain-registry/types'; -// const chainName = 'osmosis'; -const chainName = 'osmosistestnet'; - function CreateCosmosApp({ Component, pageProps }: AppProps) { const signerOptions: SignerOptions = { stargate: (_chain: Chain) => { @@ -33,8 +30,8 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) { return ( chain.chain_name === chainName)} - assetLists={assets.filter(asset => asset.chain_name === chainName)} + chains={chains} + assetLists={assets} wallets={wallets} signerOptions={signerOptions} > diff --git a/examples/send-tokens/components/wallet.tsx b/examples/send-tokens/components/wallet.tsx index ecb7170b5..c1ada72ee 100644 --- a/examples/send-tokens/components/wallet.tsx +++ b/examples/send-tokens/components/wallet.tsx @@ -9,7 +9,7 @@ import { useColorModeValue, Text } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -27,9 +27,8 @@ import { WalletConnectComponent, ChainCard } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; +import { chainName } from '../config'; + export const WalletSection = () => { const walletManager = useWallet(); @@ -41,32 +40,22 @@ export const WalletSection = () => { address, message, currentChainName, - currentWalletName, - chains + currentWallet, + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -104,17 +93,13 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> @@ -123,7 +108,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } @@ -140,10 +125,10 @@ export const WalletSection = () => { alignItems="center" justifyContent="center" > - {chainName && ( + {currentChainName && ( diff --git a/examples/send-tokens/package.json b/examples/send-tokens/package.json index 0d218117b..c63ae851e 100644 --- a/examples/send-tokens/package.json +++ b/examples/send-tokens/package.json @@ -14,9 +14,9 @@ "@chakra-ui/react": "2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/core": "0.19.3", - "@cosmos-kit/keplr": "0.19.3", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/core": "0.19.9", + "@cosmos-kit/keplr": "0.19.7", + "@cosmos-kit/react": "0.18.6", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", "bignumber.js": "9.1.0", @@ -36,4 +36,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/examples/send-tokens/pages/_app.tsx b/examples/send-tokens/pages/_app.tsx index 6b8ff203e..68a09556a 100644 --- a/examples/send-tokens/pages/_app.tsx +++ b/examples/send-tokens/pages/_app.tsx @@ -20,8 +20,8 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) { return ( chain.chain_name === chainName)} - assetLists={assets.filter(asset => asset.chain_name === chainName)} + chains={chains} + assetLists={assets} wallets={wallets} signerOptions={signerOptions} > diff --git a/examples/stargaze/components/wallet.tsx b/examples/stargaze/components/wallet.tsx index ecb7170b5..c1ada72ee 100644 --- a/examples/stargaze/components/wallet.tsx +++ b/examples/stargaze/components/wallet.tsx @@ -9,7 +9,7 @@ import { useColorModeValue, Text } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -27,9 +27,8 @@ import { WalletConnectComponent, ChainCard } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; +import { chainName } from '../config'; + export const WalletSection = () => { const walletManager = useWallet(); @@ -41,32 +40,22 @@ export const WalletSection = () => { address, message, currentChainName, - currentWalletName, - chains + currentWallet, + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -104,17 +93,13 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> @@ -123,7 +108,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } @@ -140,10 +125,10 @@ export const WalletSection = () => { alignItems="center" justifyContent="center" > - {chainName && ( + {currentChainName && ( diff --git a/examples/stargaze/package.json b/examples/stargaze/package.json index f179ef32d..74d9321be 100644 --- a/examples/stargaze/package.json +++ b/examples/stargaze/package.json @@ -14,9 +14,9 @@ "@chakra-ui/react": "2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/core": "0.19.3", - "@cosmos-kit/keplr": "0.19.3", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/core": "0.19.9", + "@cosmos-kit/keplr": "0.19.7", + "@cosmos-kit/react": "0.18.6", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", "bignumber.js": "9.1.0", @@ -36,4 +36,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/examples/stargaze/pages/_app.tsx b/examples/stargaze/pages/_app.tsx index 5af61d592..af9513c62 100644 --- a/examples/stargaze/pages/_app.tsx +++ b/examples/stargaze/pages/_app.tsx @@ -30,8 +30,8 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) { return ( chain.chain_name === chainName)} - assetLists={assets.filter(asset => asset.chain_name === chainName)} + chains={chains} + assetLists={assets} wallets={wallets} signerOptions={signerOptions} > diff --git a/examples/tailwindcss/components/react/index.ts b/examples/tailwindcss/components/react/index.ts index ac1dc7dd7..c9a7498d1 100644 --- a/examples/tailwindcss/components/react/index.ts +++ b/examples/tailwindcss/components/react/index.ts @@ -1,2 +1,3 @@ export * from './chain-card'; export * from './modal'; +export * from './views'; diff --git a/examples/tailwindcss/components/react/modal.tsx b/examples/tailwindcss/components/react/modal.tsx index dbb93b263..56cd9d6d6 100644 --- a/examples/tailwindcss/components/react/modal.tsx +++ b/examples/tailwindcss/components/react/modal.tsx @@ -12,7 +12,7 @@ import { QRCode, WalletList } from './views'; -import { wallets } from '@cosmos-kit/config'; +import { wallets } from '@cosmos-kit/keplr'; import { useRouter } from 'next/router'; import Bowser from 'bowser'; @@ -43,16 +43,14 @@ export const TailwindModal = ({ isOpen, setOpen }: WalletModalProps) => { }); }, []); - const { setCurrentWallet, connect, walletStatus, currentWalletName } = + const { setCurrentWallet, connect, walletStatus, currentWalletName, currentWallet, getWallet } = useWallet(); const [currentView, setCurrentView] = useState( ModalView.WalletList ); - const currentWalletData = useMemo(() => { - return wallets.find((wallet) => wallet.name === currentWalletName); - }, [currentWalletName]); + const currentWalletData = currentWallet?.walletInfo; useEffect(() => { if (isOpen) { @@ -86,11 +84,11 @@ export const TailwindModal = ({ isOpen, setOpen }: WalletModalProps) => { // 1ms timeout prevents _render from determining the view to show first setTimeout(() => { - if (wallets.find((wallet) => wallet.name === name)?.isQRCode) + if (getWallet(name)?.walletInfo.isQRCode) setCurrentView(ModalView.QRCode); }, 1); }, - [setCurrentWallet, connect] + [setCurrentWallet, connect, getWallet] ); const onCloseModal = useCallback(() => { diff --git a/examples/tailwindcss/components/wallet.tsx b/examples/tailwindcss/components/wallet.tsx index ecb7170b5..54a865db0 100644 --- a/examples/tailwindcss/components/wallet.tsx +++ b/examples/tailwindcss/components/wallet.tsx @@ -1,72 +1,67 @@ -import { useWallet } from '@cosmos-kit/react'; +/* eslint-disable react-hooks/exhaustive-deps */ +import { MouseEventHandler, useEffect, useMemo } from 'react' +import { ChainCard } from '../components' +import { Address, truncate } from './react/views' import { - Box, - Center, - Grid, - GridItem, - Icon, - Stack, - useColorModeValue, - Text -} from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; -import { FiAlertTriangle } from 'react-icons/fi'; -import { - Astronaut, - Error, - Connected, - ConnectedShowAddress, - ConnectedUserInfo, - Connecting, - ConnectStatusWarn, - CopyAddressBtn, - Disconnected, - NotExist, - Rejected, - RejectedWarn, - WalletConnectComponent, - ChainCard -} from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; + ArrowPathIcon, + ArrowDownTrayIcon, + WalletIcon, +} from '@heroicons/react/24/outline' +import { useWallet } from '@cosmos-kit/react' +import { WalletStatus } from '@cosmos-kit/core' +import { chainName } from '../config'; + +const buttons = { + Disconnected: { + icon: WalletIcon, + title: 'Connect Wallet' + }, + Connected: { + icon: WalletIcon, + title: 'My Wallet', + }, + Rejected: { + icon: ArrowPathIcon, + title: 'Reconnect', + }, + Error: { + icon: ArrowPathIcon, + title: 'Change Wallet', + }, + NotExist: { + icon: ArrowDownTrayIcon, + title: 'Install Wallet', + }, +} export const WalletSection = () => { - const walletManager = useWallet(); + const walletManager = useWallet() const { connect, openView, walletStatus, username, address, - message, currentChainName, - currentWalletName, - chains + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); + + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + useEffect(() => { + setCurrentChain(chainName) + }, [setCurrentChain]) // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -75,102 +70,90 @@ export const WalletSection = () => { }; const onClickOpenView: MouseEventHandler = (e) => { - e.preventDefault(); - openView(); - }; + e.preventDefault() + openView() + } - // Components - const connectWalletButton = ( - - } - connecting={} - connected={ - - } - rejected={} - error={} - notExist={ - - } - /> - ); + const _renderConnectButton = useMemo(() => { + // Spinner + if (walletStatus === WalletStatus.Connecting) { + return ( + + ) + } - const connectWalletWarn = ( - } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} - /> - } - error={ - } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} - /> - } - /> - ); + let onClick + if ( + walletStatus === WalletStatus.Disconnected || + walletStatus === WalletStatus.Rejected + ) + onClick = onClickConnect + else onClick = onClickOpenView - const userInfo = ( - } /> - ); - const addressBtn = chainName && ( - } - /> - ); + const buttonData = buttons[walletStatus] - return ( -
- + + {buttonData.title} + + ) + }, [onClickConnect, onClickOpenView, walletStatus]) + + return ( +
+
{chainName && ( - +
- +
)} - - - {userInfo} - {addressBtn} - - {connectWalletButton} - - {connectWalletWarn} - - - -
- ); -}; +
+
+
+ {username && ( +
+
+

+ {username} +

+
+ )} +
+ {address ?
{truncate(address)}
: <>} +
+ {_renderConnectButton} +
+
+
+ + + ) +} \ No newline at end of file diff --git a/examples/tailwindcss/config/chain-infos.ts b/examples/tailwindcss/config/chain-infos.ts deleted file mode 100644 index 3a5de4712..000000000 --- a/examples/tailwindcss/config/chain-infos.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ChooseChainInfo } from '../components'; -import { chains as chainsBase, assets as chainAssets } from 'chain-registry'; - -export const chainInfos: ChooseChainInfo[] = chainsBase - .filter((chain) => chain.network_type !== 'testnet') - .map((chain) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chain.chain_name - )?.assets; - return { - chainName: chain.chain_name, - label: chain.pretty_name, - value: chain.chain_name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - }); diff --git a/examples/tailwindcss/package.json b/examples/tailwindcss/package.json index 295cda310..9742a783b 100644 --- a/examples/tailwindcss/package.json +++ b/examples/tailwindcss/package.json @@ -11,9 +11,9 @@ "dependencies": { "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/core": "0.19.3", - "@cosmos-kit/keplr": "0.19.3", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/core": "0.19.9", + "@cosmos-kit/keplr": "0.19.7", + "@cosmos-kit/react": "0.18.6", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", "@headlessui/react": "^1.7.2", @@ -43,4 +43,4 @@ "tailwind-scrollbar-hide": "^1.1.7", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/examples/telescope/components/wallet.tsx b/examples/telescope/components/wallet.tsx index ecb7170b5..c1ada72ee 100644 --- a/examples/telescope/components/wallet.tsx +++ b/examples/telescope/components/wallet.tsx @@ -9,7 +9,7 @@ import { useColorModeValue, Text } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -27,9 +27,8 @@ import { WalletConnectComponent, ChainCard } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; +import { chainName } from '../config'; + export const WalletSection = () => { const walletManager = useWallet(); @@ -41,32 +40,22 @@ export const WalletSection = () => { address, message, currentChainName, - currentWalletName, - chains + currentWallet, + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -104,17 +93,13 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> @@ -123,7 +108,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } @@ -140,10 +125,10 @@ export const WalletSection = () => { alignItems="center" justifyContent="center" > - {chainName && ( + {currentChainName && ( diff --git a/examples/telescope/package.json b/examples/telescope/package.json index ca99b4031..bd2ecee34 100644 --- a/examples/telescope/package.json +++ b/examples/telescope/package.json @@ -15,7 +15,7 @@ "@chakra-ui/react": "^2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/react": "0.18.6", "@cosmos-kit/types": "^0.11.0", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", @@ -41,4 +41,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/examples/telescope/pages/_app.tsx b/examples/telescope/pages/_app.tsx index 83f24dc78..9cd279d04 100644 --- a/examples/telescope/pages/_app.tsx +++ b/examples/telescope/pages/_app.tsx @@ -37,8 +37,8 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) { return ( chain.chain_name === chainName)} - assetLists={assets.filter(asset => asset.chain_name === chainName)} + chains={chains} + assetLists={assets} wallets={wallets} signerOptions={signerOptions} > diff --git a/package.json b/package.json index f4d7517b5..8119f9f0b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lint": "lerna run lint", "format": "lerna run format", "test": "lerna run test --stream", - "upgrade": "yarn upgrade-interactive --latest" + "update": "yarn upgrade-interactive --latest" }, "devDependencies": { "@babel/cli": "7.18.10", diff --git a/templates/connect-chain/components/wallet.tsx b/templates/connect-chain/components/wallet.tsx index ecb7170b5..9f549cfb6 100644 --- a/templates/connect-chain/components/wallet.tsx +++ b/templates/connect-chain/components/wallet.tsx @@ -9,7 +9,7 @@ import { useColorModeValue, Text } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect, useMemo } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -27,9 +27,7 @@ import { WalletConnectComponent, ChainCard } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; -import { ChainRecord } from '@cosmos-kit/core'; +import { chainName } from '../config'; export const WalletSection = () => { const walletManager = useWallet(); @@ -41,32 +39,22 @@ export const WalletSection = () => { address, message, currentChainName, - currentWalletName, - chains + currentWallet, + currentChainRecord, + getChainLogo, + setCurrentChain } = walletManager; - const chainName = currentChainName; + useEffect(() => { + setCurrentChain(chainName); + }, [setCurrentChain]); - const chain = useMemo( - () => { - const getChain = (chainRecord: ChainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; - return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false - }; - } - return getChain(chains[0]); - }, - [chains] - ); + const chain = { + chainName: currentChainName, + label: currentChainRecord?.chain.pretty_name, + value: currentChainName, + icon: getChainLogo(currentChainName) + } // Events const onClickConnect: MouseEventHandler = async (e) => { @@ -104,17 +92,13 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> @@ -123,7 +107,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } @@ -140,10 +124,10 @@ export const WalletSection = () => { alignItems="center" justifyContent="center" > - {chainName && ( + {currentChainName && ( diff --git a/templates/connect-chain/package.json b/templates/connect-chain/package.json index 59ba13184..274aa29b7 100644 --- a/templates/connect-chain/package.json +++ b/templates/connect-chain/package.json @@ -13,9 +13,9 @@ "@chakra-ui/react": "2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/core": "0.19.3", - "@cosmos-kit/keplr": "0.19.3", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/core": "0.19.9", + "@cosmos-kit/keplr": "0.19.7", + "@cosmos-kit/react": "0.18.6", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", "chain-registry": "1.0.0", @@ -33,4 +33,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/templates/connect-chain/pages/_app.tsx b/templates/connect-chain/pages/_app.tsx index ad6ace545..23cfc60fc 100644 --- a/templates/connect-chain/pages/_app.tsx +++ b/templates/connect-chain/pages/_app.tsx @@ -18,8 +18,8 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) { return ( chain.chain_name === chainName)} - assetLists={assets.filter(asset => asset.chain_name === chainName)} + chains={chains} + assetLists={assets} wallets={wallets} signerOptions={signerOptions} > diff --git a/templates/connect-multi-chain/components/wallet.tsx b/templates/connect-multi-chain/components/wallet.tsx index 72264be26..2fddcc7d4 100644 --- a/templates/connect-multi-chain/components/wallet.tsx +++ b/templates/connect-multi-chain/components/wallet.tsx @@ -8,7 +8,7 @@ import { Stack, useColorModeValue } from '@chakra-ui/react'; -import { MouseEventHandler, useMemo } from 'react'; +import { MouseEventHandler, useEffect, useMemo } from 'react'; import { FiAlertTriangle } from 'react-icons/fi'; import { Astronaut, @@ -28,41 +28,34 @@ import { RejectedWarn, WalletConnectComponent } from '../components'; -import { getWalletPrettyName } from '@cosmos-kit/config'; -import { assets as chainAssets } from 'chain-registry'; export const WalletSection = () => { const walletManager = useWallet(); const { connect, openView, - setCurrentChain, walletStatus, username, address, message, - currentChainName: chainName, - currentWalletName, - chains + currentChainName, + currentWallet, + chains, + getChainLogo, + setCurrentChain } = walletManager; const chainOptions = useMemo( () => chains.map((chainRecord) => { - const assets = chainAssets.find( - (_chain) => _chain.chain_name === chainRecord.name - )?.assets; return { - chainName: chainRecord.name, - label: chainRecord.chain.pretty_name, - value: chainRecord.name, - icon: assets - ? assets[0]?.logo_URIs?.svg || assets[0]?.logo_URIs?.png - : undefined, - disabled: false + chainName: chainRecord?.name, + label: chainRecord?.chain.pretty_name, + value: chainRecord?.name, + icon: getChainLogo(chainRecord.name) }; }), - [chains] + [chains, getChainLogo] ); // Events @@ -108,24 +101,20 @@ export const WalletSection = () => { rejected={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } error={ } - wordOfWarning={`${getWalletPrettyName( - currentWalletName - )}: ${message}`} + wordOfWarning={`${currentWallet?.walletInfo.prettyName}: ${message}`} /> } /> ); const chooseChain = ( @@ -134,7 +123,7 @@ export const WalletSection = () => { const userInfo = ( } /> ); - const addressBtn = chainName && ( + const addressBtn = currentChainName && ( } diff --git a/templates/connect-multi-chain/package.json b/templates/connect-multi-chain/package.json index b3718bddf..c4c4ba028 100644 --- a/templates/connect-multi-chain/package.json +++ b/templates/connect-multi-chain/package.json @@ -14,9 +14,9 @@ "@chakra-ui/react": "2.3.4", "@cosmjs/cosmwasm-stargate": "0.29.0", "@cosmjs/stargate": "0.29.0", - "@cosmos-kit/core": "0.19.3", - "@cosmos-kit/keplr": "0.19.3", - "@cosmos-kit/react": "0.18.4", + "@cosmos-kit/core": "0.19.9", + "@cosmos-kit/keplr": "0.19.7", + "@cosmos-kit/react": "0.18.6", "@emotion/react": "11.10.4", "@emotion/styled": "11.10.4", "chain-registry": "1.0.0", @@ -36,4 +36,4 @@ "eslint-config-next": "12.2.5", "typescript": "4.7.4" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index b8adf5520..45af03c6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2922,10 +2922,10 @@ "@cosmos-kit/core" "^0.16.2" "@cosmos-kit/keplr" "^0.16.2" -"@cosmos-kit/core@0.19.3", "@cosmos-kit/core@^0.19.3": - version "0.19.3" - resolved "https://registry.npmjs.org/@cosmos-kit/core/-/core-0.19.3.tgz#1c065956e4c84c3a912ad1fce98028de01d4494a" - integrity sha512-0YqThC5hoLIFKmQdJn7BEI/og+4YlSxr/Rytmt29dICr8FXLIfdfjMHb/W+MqBUo7y0lLAal1l6RIcFbq2qKCg== +"@cosmos-kit/core@0.19.9", "@cosmos-kit/core@^0.19.9": + version "0.19.9" + resolved "https://registry.npmjs.org/@cosmos-kit/core/-/core-0.19.9.tgz#7c984dc3bea19d6e520ae3872667326f6492211e" + integrity sha512-f59sKsu/T3tsGvpbdUmUeXcUAYMZq3/sz6NcwebD/Zpjml5kES4lj7s/LUX5O7Njs8cD5GNbmIcBtJanS6dKBA== dependencies: "@babel/runtime" "^7.11.2" "@chain-registry/types" "^0.11.0" @@ -2940,16 +2940,16 @@ "@chain-registry/types" "^0.11.0" chain-registry "^0.14.0" -"@cosmos-kit/keplr@0.19.3": - version "0.19.3" - resolved "https://registry.npmjs.org/@cosmos-kit/keplr/-/keplr-0.19.3.tgz#fbbaad6dc5139883a89ac1f75aeb9b845727fad9" - integrity sha512-lm5jKrAVL8sWFCwo5jfqN4QrTwCYNgLoTdnQPi7+IqgsX8FAZke7qSkfSHyd32ST55RWnfgz5jAgLlWzIzlz4Q== +"@cosmos-kit/keplr@0.19.7": + version "0.19.7" + resolved "https://registry.npmjs.org/@cosmos-kit/keplr/-/keplr-0.19.7.tgz#7d2499706775f2e828c4ec31589a63fd736a62f8" + integrity sha512-lsm54F7Zi1YH3BhuiddA7Q+D6tLrmvG5GvN86duOhqIAt6zQ96iK6Z0r1ZzBHJpELob40OZYpLJkXRq6UDo2PQ== dependencies: "@babel/runtime" "^7.11.2" "@chain-registry/keplr" "1.0.0" "@chain-registry/types" "^0.11.0" "@chakra-ui/react" "^2.2.9" - "@cosmos-kit/core" "^0.19.3" + "@cosmos-kit/core" "^0.19.9" "@emotion/react" "^11" "@emotion/styled" "^11" "@keplr-wallet/types" "^0.11.3" @@ -2980,30 +2980,10 @@ react-dom "18.2.0" react-icons "^4.4.0" -"@cosmos-kit/leap@0.1.2": - version "0.1.2" - resolved "https://registry.npmjs.org/@cosmos-kit/leap/-/leap-0.1.2.tgz#7ddb6f809f64cc043f0f44265bff5c39c22f2a61" - integrity sha512-mh0BHlgmDoNoJf8i5Jp6q8GTMGCHSky4gnyulG9vCza/CXyvbjc9mFnQjLT0dKs8sJ7NGFtx1L42Hwzgr4mPng== - dependencies: - "@babel/runtime" "^7.11.2" - "@chain-registry/keplr" "1.0.0" - "@chain-registry/types" "^0.11.0" - "@chakra-ui/react" "^2.2.9" - "@cosmos-kit/core" "^0.19.3" - "@emotion/react" "^11" - "@emotion/styled" "^11" - "@keplr-wallet/types" "^0.11.3" - "@keplr-wallet/wc-client" "^0.11.3" - "@walletconnect/client" "1.8.0" - events "3.3.0" - react "18.2.0" - react-dom "18.2.0" - react-icons "^4.4.0" - -"@cosmos-kit/react@0.18.4": - version "0.18.4" - resolved "https://registry.npmjs.org/@cosmos-kit/react/-/react-0.18.4.tgz#f02cf5939a08595b8b7db82c388d3ccfb36be956" - integrity sha512-gRAPFE7Ln4CMiyKq3YxW5hqUbLvyqFAT1CUlvBFtb+wdrM3g+7JhdNLKZLV7I68gWYW3rO4ORC6jZxsgqmmsNg== +"@cosmos-kit/react@0.18.6": + version "0.18.6" + resolved "https://registry.npmjs.org/@cosmos-kit/react/-/react-0.18.6.tgz#617d351803311faa96295cce3a9fb6072f872d71" + integrity sha512-WrecEa4GHwoao/fDtt2+UA1aWSvRLOlSz78AgoecxIBZASsfRMPS0dxL6gyXij0gvXvCgPna9Re3Lmgu2Umozw== dependencies: "@babel/runtime" "^7.11.2" "@chain-registry/types" "^0.11.0"