From 991ac7537ca251f80eff8e4f80bcb8fa35e5ff5b Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Tue, 13 Dec 2022 14:13:17 +0200 Subject: [PATCH 01/11] improved login UX & disabling network choice menu --- index.html | 34 +- package.json | 7 +- src/App.tsx | 18 +- src/assets/vectors/link-icon-fillable.svg | 4 + .../Dialog/ReusableModal/helpers.tsx | 22 +- src/components/Layout/Networkinfo.tsx | 86 +++-- src/components/Layout/Userinfo.tsx | 30 +- src/components/Layout/styles.ts | 3 +- .../ConnectWallet/ConnectWallet.tsx | 180 ++++++++--- src/containers/ConnectWallet/styles.ts | 2 +- src/store/user.ts | 6 +- src/utils/config.ts | 32 +- src/utils/constants.tsx | 12 +- src/utils/styles.ts | 26 +- types/global.d.ts | 1 + yarn.lock | 297 +++++++++++++++++- 16 files changed, 582 insertions(+), 178 deletions(-) create mode 100644 src/assets/vectors/link-icon-fillable.svg diff --git a/index.html b/index.html index 74e3087..d6a147a 100644 --- a/index.html +++ b/index.html @@ -1,15 +1,23 @@ - - - - - CUDOS MultiSig Wallet - - - -
- - - - + + + + + + CUDOS MultiSig Wallet + + + + + +
+ + + + + \ No newline at end of file diff --git a/package.json b/package.json index 6d3307c..ecd1628 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,9 @@ "appollo": "^0.1.13", "axios": "^0.27.2", "bignumber.js": "^9.0.2", + "buffer": "^6.0.3", "csstype": "^3.0.10", - "cudosjs": "^1.1.0", + "cudosjs": "^1.2.6", "firebase": "^9.9.1", "goober": "^2.1.1", "graphql": "^16.5.0", @@ -42,7 +43,9 @@ "redux-persist": "^6.0.0", "rollup": "^2.0.0", "styled-components": "^5.3.5", - "swiper": "^8.3.1" + "svg-loaders-react": "^2.2.1", + "swiper": "^8.3.1", + "ts-node": "^10.9.1" }, "devDependencies": { "@babel/preset-env": "^7.18.2", diff --git a/src/App.tsx b/src/App.tsx index f02d4da..e86a0f4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,6 @@ import { ThemeProvider } from '@mui/material/styles' import { useDispatch, useSelector } from 'react-redux' import { CssBaseline, Container } from '@mui/material' import { Routes, Route, useLocation, Navigate } from 'react-router-dom' - import Layout from 'components/Layout' import RequireLedger from 'components/RequireLedger/RequireLedger' import ConnectWallet from 'containers/ConnectWallet/ConnectWallet' @@ -13,15 +12,14 @@ import { RootState } from 'store' import { useCallback, useEffect } from 'react' import { ApolloProvider } from '@apollo/client' import { useApollo } from './graphql/client' - -import '@fontsource/poppins' import { updateUser } from 'store/user' import WalletDetails from 'containers/WalletDetails' import RequireWallet from 'components/RequireWallet/RequireWallet' -import { COSMOSTATION_LEDGER, KEPLR_LEDGER } from 'utils/constants' import { connectUser } from 'utils/config' import { initialState as initialUserState } from 'store/user' import { updateModalState } from 'store/modals' +import { isExtensionEnabled, SUPPORTED_WALLET } from 'cudosjs' +import '@fontsource/poppins' const App = () => { const location = useLocation() @@ -29,7 +27,7 @@ const App = () => { const themeColor = useSelector((state: RootState) => state.settings.theme) const dispatch = useDispatch() - const connectAccount = useCallback(async (ledgerType: string) => { + const connectAccount = useCallback(async (walletName: SUPPORTED_WALLET) => { try { dispatch(updateModalState({ @@ -37,7 +35,7 @@ const App = () => { loadingType: true })) dispatch(updateUser(initialUserState)) - const connectedUser = await connectUser(ledgerType) + const connectedUser = await connectUser(walletName) dispatch(updateUser(connectedUser)) } catch (error) { @@ -52,18 +50,18 @@ const App = () => { useEffect(() => { - if (window.keplr) { + if (isExtensionEnabled(SUPPORTED_WALLET.Keplr)) { window.addEventListener("keplr_keystorechange", async () => { - await connectAccount(KEPLR_LEDGER) + await connectAccount(SUPPORTED_WALLET.Keplr) return }); } - if (window.cosmostation) { + if (isExtensionEnabled(SUPPORTED_WALLET.Cosmostation)) { window.cosmostation.cosmos.on("accountChanged", async () => { - await connectAccount(COSMOSTATION_LEDGER) + await connectAccount(SUPPORTED_WALLET.Cosmostation) return }); } diff --git a/src/assets/vectors/link-icon-fillable.svg b/src/assets/vectors/link-icon-fillable.svg new file mode 100644 index 0000000..6ee011e --- /dev/null +++ b/src/assets/vectors/link-icon-fillable.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/Dialog/ReusableModal/helpers.tsx b/src/components/Dialog/ReusableModal/helpers.tsx index a2640f4..4faf11e 100644 --- a/src/components/Dialog/ReusableModal/helpers.tsx +++ b/src/components/Dialog/ReusableModal/helpers.tsx @@ -11,7 +11,6 @@ import copy from "copy-to-clipboard" import EditIcon from 'assets/vectors/blue-edit-icon.svg' import ToolTipIcon from 'assets/vectors/tooltip-icon.svg' import { getSigningClient } from "utils/config" -import { Coin, DeliverTxResponse, EncodeObject, GasPrice, StdFee } from "cudosjs" import { convertVotingPeriodToSeconds, formatAddress } from "utils/helpers" import { createArrayOfCoinsFromMapper, createArrayOfRecipients, HtmlTooltip, multisendRow, MultiSendUser, totalAmountDue } from "utils/multiSendTableHelper" import { Fragment, useState } from "react" @@ -30,11 +29,20 @@ import { NATIVE_TOKEN_DENOM } from "utils/constants" +import { + Coin, + DeliverTxResponse, + EncodeObject, + GasPrice, + StdFee, + SUPPORTED_WALLET +} from "cudosjs" + export const executeMsgs = async ( signer: string, msgs: EncodeObject[], fee: StdFee, - connectedLedger: string + connectedLedger: SUPPORTED_WALLET ): Promise => { @@ -51,7 +59,7 @@ export const getMultiSendMsgAndFees = async ( multisendRows: multisendRow[], walletAddress: string, signerAddress: string, - connectedLedger: string + connectedLedger: SUPPORTED_WALLET ): Promise<{ msg: EncodeObject; fee: StdFee; @@ -81,7 +89,7 @@ export const getSingleSendMsgAndFees = async ( amount: Coin[], walletAddress: string, signerAddress: string, - connectedLedger: string + connectedLedger: SUPPORTED_WALLET ): Promise<{ msg: EncodeObject; fee: StdFee; @@ -104,7 +112,7 @@ export const getMembersUpdateMsgAndFees = async ( walletId: number, walletAddress: string, signerAddress: string, - connectedLedger: string + connectedLedger: SUPPORTED_WALLET ): Promise<{ msg: EncodeObject; fee: StdFee; @@ -127,7 +135,7 @@ export const getWalletDecisionPolicyUpdateMsgAndFees = async ( votingPeriod: number, walletAddress: string, signerAddress: string, - connectedLedger: string + connectedLedger: SUPPORTED_WALLET ): Promise<{ msg: EncodeObject; fee: StdFee; @@ -155,7 +163,7 @@ export const getWalletMetadataUpdateMsgAndFees = async ( walletId: number, walletAddress: string, signerAddress: string, - connectedLedger: string + connectedLedger: SUPPORTED_WALLET ): Promise<{ msg: EncodeObject; fee: StdFee; diff --git a/src/components/Layout/Networkinfo.tsx b/src/components/Layout/Networkinfo.tsx index 095ee95..a9ea76a 100644 --- a/src/components/Layout/Networkinfo.tsx +++ b/src/components/Layout/Networkinfo.tsx @@ -8,62 +8,60 @@ import grayGlobusIcon from 'assets/vectors/gray-globus-icon.svg' import { OpenInNewRounded as OpenInNewRoundedIcon } from '@mui/icons-material' import { Typography, Box, Collapse } from '@mui/material' +enum CHAIN_IDS { + local = 'cudos-local-network', + dev = 'cudos-dev-test-network', + private = 'cudos-testnet-private-3', + public = 'cudos-testnet-public-3', + mainnet = 'cudos-1' +} + const chainDetails = { - local: { aliasName: 'CUDOS Local Testnet' }, - private: { aliasName: 'CUDOS Private Testnet' }, - public: { - aliasName: 'CUDOS Public Testnet', - link: 'http://multisig.testnet.cudos.org' - }, - mainnet: { - aliasName: 'CUDOS Main Network', - link: 'http://multisig.cudos.org' + CHAIN_IDS: { + [CHAIN_IDS.local]: { aliasName: 'CUDOS Local Testnet' }, + [CHAIN_IDS.dev]: { aliasName: 'CUDOS Dev Environment' }, + [CHAIN_IDS.private]: { aliasName: 'CUDOS Private Testnet' }, + [CHAIN_IDS.public]: { aliasName: 'CUDOS Public Testnet' }, + [CHAIN_IDS.mainnet]: { aliasName: 'CUDOS Main Network' }, }, + LINKS: { + [CHAIN_IDS.public]: 'http://multisig.testnet.cudos.org', + [CHAIN_IDS.mainnet]: 'http://multisig.cudos.org' + } } export const chainIDToAlias = (chainID: string): string => { - - if (chainID.toLowerCase().includes('local')) { - return chainDetails.local.aliasName - } - - if (chainID.toLowerCase().includes('private')) { - return chainDetails.private.aliasName - } - - if (chainID.toLowerCase().includes('public')) { - return chainDetails.public.aliasName - } - - if (chainID.toLowerCase() === 'cudos-1' || chainID.toLowerCase().includes('mainnet')) { - return chainDetails.mainnet.aliasName - } - - return "Unidentified Network" + return chainDetails.CHAIN_IDS[chainID].aliasName || "Unidentified Network" } const NetworkInfo = () => { - const networksToDisplayInMenu = [chainDetails.public, chainDetails.mainnet] + const networksToDisplayInMenu = [CHAIN_IDS.public, CHAIN_IDS.mainnet] const [open, setOpen] = useState(false) + // Disabling network selection menu + const collapsable = false + return ( - - setOpen(!open)} style={styles.userContainer}> + + { } : () => setOpen(true)} style={styles.userContainer}> globus-icon {chainIDToAlias(CHAIN_ID)} - - Arrow Icon - + {collapsable ? + + Arrow Icon + : null} { const [hovered, setHovered] = useState(false) return ( - chainIDToAlias(CHAIN_ID) !== network.aliasName ? + CHAIN_ID !== network ? setHovered(true)} onMouseOut={() => setHovered(false)}> - + { /> - {network.aliasName} + {chainDetails.CHAIN_IDS[network].aliasName} { } - + ) } diff --git a/src/components/Layout/Userinfo.tsx b/src/components/Layout/Userinfo.tsx index b6915a0..4b8f667 100644 --- a/src/components/Layout/Userinfo.tsx +++ b/src/components/Layout/Userinfo.tsx @@ -21,7 +21,7 @@ import { initialState as initialWalletObject, updateWalletObjectState } from 'st import { initialState as initialModalState, updateModalState } from 'store/modals' import { initialState as initialWalletCreationState, updateWalletCreationState } from 'store/walletCreation' import { updateSendFunds } from 'store/sendFunds' -import { COSMOSTATION_LEDGER, KEPLR_LEDGER } from 'utils/constants' +import { SUPPORTED_WALLET } from 'cudosjs' import { Typography, @@ -59,7 +59,7 @@ const UserInfo = () => { dispatch(updateUser({ ...initialUserState })) dispatch(updateWalletObjectState({ ...initialWalletObject })) dispatch(updateModalState({ ...initialModalState })) - dispatch(updateWalletCreationState({...initialWalletCreationState})) + dispatch(updateWalletCreationState({ ...initialWalletCreationState })) dispatch(updateSendFunds({ ...initialSendFundsState })) navigate("/") } @@ -71,7 +71,7 @@ const UserInfo = () => { Cudos logo
-
+
{ @@ -106,7 +106,7 @@ const UserInfo = () => { setOpen(false)} - style={{marginTop: '-28px', zIndex: '-1' }} + style={{ marginTop: '-28px', zIndex: '-1' }} in={open} > @@ -120,17 +120,17 @@ const UserInfo = () => { flexDirection: 'column' }} > - {isAdmin? + {isAdmin ? - CUDOS NETWORK ADMIN - - :null} + sx={{ color: 'chocolate', fontSize: '12px', marginBottom: '10px' }} + > + CUDOS NETWORK ADMIN + + : null} {formatAddress(address!, 20)} @@ -164,7 +164,7 @@ const UserInfo = () => { marginTop: '30px' }} > - diff --git a/src/components/Layout/styles.ts b/src/components/Layout/styles.ts index 621baba..1df5d42 100644 --- a/src/components/Layout/styles.ts +++ b/src/components/Layout/styles.ts @@ -99,8 +99,7 @@ export const StyledNetwork = styled(Box)(({ theme }) => ({ height: '35px', marginRight: '20px', backgroundColor: theme.custom.backgrounds.primary, - zIndex: '10', - cursor: 'pointer' + zIndex: '10' })) export const StyledUser = styled(Box)(({ theme }) => ({ diff --git a/src/containers/ConnectWallet/ConnectWallet.tsx b/src/containers/ConnectWallet/ConnectWallet.tsx index c2b4a45..70fdb90 100644 --- a/src/containers/ConnectWallet/ConnectWallet.tsx +++ b/src/containers/ConnectWallet/ConnectWallet.tsx @@ -1,7 +1,5 @@ -import { Box, Typography } from '@mui/material' +import { Box, Tooltip, Typography } from '@mui/material' import InfoIcon from 'assets/vectors/info-icon.svg' -import KeplrLogo from 'assets/vectors/keplr-logo.svg' -import CosmostationLogo from 'assets/vectors/cosmostation-logo.svg' import BackgroundImage from 'assets/vectors/background.svg' import { styles } from './styles' import { Navigate, useLocation, useNavigate } from 'react-router-dom' @@ -12,16 +10,29 @@ import { updateUser } from 'store/user' import { RootState } from 'store' import Header from 'components/Layout/Header' import { connectUser } from 'utils/config' -import { useState } from 'react' +import { Fragment, useEffect, useState } from 'react' import LoadingButton from '@mui/lab/LoadingButton' +import { ReactComponent as LinkIcon } from 'assets/vectors/link-icon-fillable.svg' +import { ThreeDots as ThreeDotsLoading } from 'svg-loaders-react' import { - COSMOSTATION_LEDGER, DEFAULT_LOGIN_FAILURE_MSG, - KEPLR_LEDGER, - LOGIN_FAIL_TITLE + LOGIN_FAIL_TITLE, + SUPPORTED_WALLET_LOGOS } from 'utils/constants' +import { + detectUserBrowser, + getExtensionUrlForBrowser, + getSupportedBrowsersForWallet, + getSupportedWallets, + isExtensionAvailableForBrowser, + isExtensionEnabled, + isSupportedBrowser, + SUPPORTED_BROWSER, + SUPPORTED_WALLET +} from 'cudosjs' + const ConnectWallet = () => { const dispatch = useDispatch() @@ -29,12 +40,19 @@ const ConnectWallet = () => { const location = useLocation() const { address } = useSelector((state: RootState) => state.userState) const [loading, setLoading] = useState(new Map()) + const [userBrowser, setUserBrowser] = useState(undefined) + + const redirectToExtension = (extensionUrl: string | undefined) => { + if (extensionUrl) { + window.open(extensionUrl, '_blank')?.focus() + } + } - const connect = async (ledgerType: string) => { + const connect = async (walletName: SUPPORTED_WALLET) => { try { - setLoading(new Map(loading.set(ledgerType, true))) - const connectedUser = await connectUser(ledgerType) + setLoading(new Map(loading.set(walletName, true))) + const connectedUser = await connectUser(walletName) dispatch(updateUser(connectedUser)) navigate('/welcome') @@ -51,6 +69,95 @@ const ConnectWallet = () => { } } + const btnTooltip = (walletName: SUPPORTED_WALLET): string => { + let tooltipText = '' + + if (!isExtensionAvailableForBrowser(walletName, userBrowser!)) { + tooltipText = `${walletName} supports: ${getSupportedBrowsersForWallet(walletName).map((browser) => { + return ` ${browser}` + })}` + } + + return tooltipText + } + + const isDisabledBtn = (walletName: SUPPORTED_WALLET): boolean => { + + // Disabling the Btn if into loading state + if (loading.get(walletName)) { + return true + } + + // Disabling the btn, when other btn is loading + if (loading.size > 0) { + return true + } + + // Disabling the btn if no extension is available for the current user browser + if (!isExtensionAvailableForBrowser(walletName, userBrowser!)) { + return true + } + + return false + } + + const click = (walletName: SUPPORTED_WALLET) => { + + if (isExtensionEnabled(walletName)) { + connect(walletName) + return + } + + const extensionUrl = getExtensionUrlForBrowser(walletName, userBrowser!) + redirectToExtension(extensionUrl) + } + + const displayLogo = (walletName: SUPPORTED_WALLET): JSX.Element => { + if (loading.get(walletName)) { + return + } + return SUPPORTED_WALLET_LOGOS[walletName] || + } + + const btnText = (walletName: SUPPORTED_WALLET): string | JSX.Element => { + + if (loading.get(walletName)) { + return '' + } + + if (isExtensionEnabled(walletName)) { + return `Connect ${walletName.toUpperCase()}` + } + + if (isExtensionAvailableForBrowser(walletName, userBrowser!)) { + return ( + + {`Get ${walletName} plugin`} + + + ) + } + + return 'Unsupported browser' + } + + const LoadingButtonComponent = (): JSX.Element => { + return ( + + ) + } + + useEffect(() => { + const userBrowser = detectUserBrowser() + if (isSupportedBrowser(userBrowser)) { + setUserBrowser(userBrowser as SUPPORTED_BROWSER) + return + } + setUserBrowser(undefined) + }, []) + return address ? () : @@ -79,39 +186,26 @@ const ConnectWallet = () => { - connect(KEPLR_LEDGER)} - sx={styles.connectButton} - > - - {`Connect ${KEPLR_LEDGER.toUpperCase()}`} - - connect(COSMOSTATION_LEDGER)} - sx={styles.connectButton} - > - - {`Connect ${COSMOSTATION_LEDGER.toUpperCase()}`} - + {getSupportedWallets().map((wallet, idx) => { + return ( + + + } + disabled={isDisabledBtn(wallet)} + loading={loading.get(wallet)} + variant="contained" + color="primary" + onClick={() => click(wallet)} + sx={styles.connectButton} + > + {displayLogo(wallet)} + {btnText(wallet)} + + + + ) + })} Info diff --git a/src/containers/ConnectWallet/styles.ts b/src/containers/ConnectWallet/styles.ts index 4745b0f..6d75fbe 100644 --- a/src/containers/ConnectWallet/styles.ts +++ b/src/containers/ConnectWallet/styles.ts @@ -17,7 +17,7 @@ export const styles = { }, connectButton: { height: '50px', - width: '250px', + width: '255px', marginBottom: '40px' }, pluginWarning: { diff --git a/src/store/user.ts b/src/store/user.ts index 2271c98..27bfafa 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -1,4 +1,4 @@ -import { Coin } from 'cudosjs' +import { Coin, SUPPORTED_WALLET } from 'cudosjs' import { createSlice, PayloadAction } from '@reduxjs/toolkit' import { Member } from './walletObject' @@ -35,7 +35,7 @@ export interface userState { selectedWallet?: Wallet addressBook?: AddressBook chosenBalance?: Coin - connectedLedger?: string + connectedLedger?: SUPPORTED_WALLET | undefined newAddedAddress?: string } @@ -67,7 +67,7 @@ export const initialState: userState = { selectedWallet: emptyWallet, addressBook: {}, chosenBalance: { denom: '', amount: '' }, - connectedLedger: '', + connectedLedger: undefined, newAddedAddress: '' } diff --git a/src/utils/config.ts b/src/utils/config.ts index 5684968..39ae24e 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,7 +1,7 @@ -import { OfflineSigner, StargateClient } from "cudosjs"; +import { isExtensionEnabled, OfflineSigner, StargateClient, SUPPORTED_WALLET } from "cudosjs"; import { SigningStargateClient } from "cudosjs"; import { getOfflineSigner as cosmostationSigner } from "@cosmostation/cosmos-client"; -import { CHAIN_ID, COSMOSTATION_LEDGER, KEPLR_LEDGER, RPC_ADDRESS } from "./constants"; +import { CHAIN_ID, RPC_ADDRESS } from "./constants"; import { userState } from "store/user"; import { connectKeplrLedger } from "ledgers/KeplrLedger"; import { connectCosmostationLedger } from "ledgers/CosmostationLedger"; @@ -14,24 +14,24 @@ export const queryClient = (async (): Promise => { return client })() -const getOfflineSignerByType = async (ledgerType: string): Promise => { +const getOfflineSignerByType = async (walletName: SUPPORTED_WALLET): Promise => { - if (ledgerType === KEPLR_LEDGER) { + if (walletName === SUPPORTED_WALLET.Keplr) { return window.getOfflineSigner!(CHAIN_ID) } - if (ledgerType === COSMOSTATION_LEDGER) { + if (walletName === SUPPORTED_WALLET.Cosmostation) { return cosmostationSigner(CHAIN_ID) } return undefined } -export const getSigningClient = async (ledgerType: string): Promise => { +export const getSigningClient = async (walletName: SUPPORTED_WALLET): Promise => { - const offlineSigner = await getOfflineSignerByType(ledgerType) + const offlineSigner = await getOfflineSignerByType(walletName) - if (window.keplr) { + if (isExtensionEnabled(walletName)) { window.keplr.defaultOptions = { sign: { preferNoSetFee: true, @@ -46,22 +46,22 @@ export const getSigningClient = async (ledgerType: string): Promise { +const connectLedgerByType = async (walletName: SUPPORTED_WALLET) => { - if (ledgerType === KEPLR_LEDGER) { + if (walletName === SUPPORTED_WALLET.Keplr) { return connectKeplrLedger() } - if (ledgerType === COSMOSTATION_LEDGER) { + if (walletName === SUPPORTED_WALLET.Cosmostation) { return connectCosmostationLedger() } return { address: '', accountName: '' } } -export const getConnectedUserAddressAndName = async (ledgerType: string): Promise<{ address: string; accountName: string; }> => { +export const getConnectedUserAddressAndName = async (walletName: SUPPORTED_WALLET): Promise<{ address: string; accountName: string; }> => { - const { address, accountName } = await connectLedgerByType(ledgerType) + const { address, accountName } = await connectLedgerByType(walletName) if (!isValidCudosAddress(address)) { throw new Error("Invalid ledger"); @@ -70,9 +70,9 @@ export const getConnectedUserAddressAndName = async (ledgerType: string): Promis return { address: address, accountName: accountName } } -export const connectUser = async (ledgerType: string): Promise => { +export const connectUser = async (walletName: SUPPORTED_WALLET): Promise => { - const { address, accountName } = await getConnectedUserAddressAndName(ledgerType) + const { address, accountName } = await getConnectedUserAddressAndName(walletName) const currentBalances = await getAccountBalances(address) const admin = checkForAdminToken(currentBalances) const userBalance = getNativeBalance(currentBalances) @@ -86,7 +86,7 @@ export const connectUser = async (ledgerType: string): Promise => { nativeBalance: userBalance, isAdmin: admin, addressBook: addressBook, - connectedLedger: ledgerType, + connectedLedger: walletName, } return connectedUser diff --git a/src/utils/constants.tsx b/src/utils/constants.tsx index 4d1f53b..5a7b269 100644 --- a/src/utils/constants.tsx +++ b/src/utils/constants.tsx @@ -13,6 +13,10 @@ import { ReactComponent as MediumIcon } from 'assets/vectors/medium.svg' import { ReactComponent as YouTubeIcon } from 'assets/vectors/youtube.svg' import { ReactComponent as FacebookIcon } from 'assets/vectors/facebook.svg' import { ReactComponent as SpotifyIcon } from 'assets/vectors/spotify.svg' +import KeplrLogo from 'assets/vectors/keplr-logo.svg' +import CosmostationLogo from 'assets/vectors/cosmostation-logo.svg' +import { SUPPORTED_WALLET } from 'cudosjs' +import { styles } from './styles' // ENV export const RPC_ADDRESS = import.meta.env.VITE_APP_RPC || process.env.VITE_APP_RPC || "" @@ -40,8 +44,12 @@ export const DEFAULT_MEMO = 'Created with CUDOS MultiSig' export const DEFAULT_VOTING_WEIGHT = 1 export const DEFAULT_MULTIPLIER = 1.3 export const MINIMUM_GAS_FEE = 0.5 -export const KEPLR_LEDGER = 'Keplr' -export const COSMOSTATION_LEDGER = 'Cosmostation' + +export const SUPPORTED_WALLET_LOGOS = { + [SUPPORTED_WALLET.Keplr]: Keplr Logo, + [SUPPORTED_WALLET.Cosmostation]: Cosmostation Logo +} + export const FOOTER = { LEFT_LINKS: [ { text: 'Terms & Conditions', url: 'https://www.cudos.org/terms-and-conditions/' }, diff --git a/src/utils/styles.ts b/src/utils/styles.ts index d47f3d8..e2cba17 100644 --- a/src/utils/styles.ts +++ b/src/utils/styles.ts @@ -1,16 +1,16 @@ export const styles = { csvBtn: { - background: 'none', - marginTop:'8px' + background: 'none', + marginTop: '8px' }, assetsIconHolder: { - padding: '10px 25px', + padding: '10px 25px', marginTop: '3px', - marginBottom: '10px', - display: 'flex', - height: '10%', - alignItems: 'center', - borderRadius: '10px', + marginBottom: '10px', + display: 'flex', + height: '10%', + alignItems: 'center', + borderRadius: '10px', width: '100%', }, addressBookIcon: { @@ -22,5 +22,13 @@ export const styles = { position: 'relative', marginRight: '10px', height: 'fit-content' - }, + }, + keplrLogo: { + marginRight: '10px' + }, + cosmostationLogo: { + marginRight: '10px', + width: '30px', + height: '30px' + }, } as const diff --git a/types/global.d.ts b/types/global.d.ts index e013885..cade998 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -27,6 +27,7 @@ declare module '@mui/material/styles' { declare global { interface Window extends KeplrWindow { + keplr: any, cosmostation: any } diff --git a/yarn.lock b/yarn.lock index 0992ac3..a4d20c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1324,11 +1324,29 @@ "@walletconnect/client" "^1.7.8" "@walletconnect/utils" "^1.6.5" +"@cosmostation/cosmos-client@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@cosmostation/cosmos-client/-/cosmos-client-0.0.4.tgz#9dc82df2a0da2c3d4fc4f36535961f0f35a9ed44" + integrity sha512-zYScOoPB20vleklvL6qJ2eglzYhIqtleJJXtXdCMSLf3mn/BuZ9rLecgETrPZDGPPEOcxJ9VgFOoZz0i2nfviw== + dependencies: + "@cosmjs/amino" "^0.28.4" + "@cosmjs/proto-signing" "^0.28.4" + "@cosmostation/extension-client" "^0.1.3" + "@cosmostation/wc-modal" "^0.0.4" + "@walletconnect/browser-utils" "^1.6.5" + "@walletconnect/client" "^1.7.8" + "@walletconnect/utils" "^1.6.5" + "@cosmostation/extension-client@^0.0.6": version "0.0.6" resolved "https://registry.yarnpkg.com/@cosmostation/extension-client/-/extension-client-0.0.6.tgz#a04420c1c3d68b83d197e48e79787a3484fb8d2c" integrity sha512-3N7NOz8JMOpJlVaGS++zha4AZoijJTnPkq8djEfpk/mJ6+laUNo4a1/mxANFm9i1KUZcU9HX6GKKx9v9nL/VDg== +"@cosmostation/extension-client@^0.1.3", "@cosmostation/extension-client@^0.1.9": + version "0.1.15" + resolved "https://registry.yarnpkg.com/@cosmostation/extension-client/-/extension-client-0.1.15.tgz#cdc6d8fce42217704c1c0d5814f0ee7ce27e8dab" + integrity sha512-HlXYJjFrNpjiV/GUKhri1UL8/bhlOIFFLpRF78YDSqq16x0+plIqx5CAvEusFcKTDpVfpeD5sfUHiKvP7euNFg== + "@cosmostation/extension-client@^0.1.7": version "0.1.11" resolved "https://registry.yarnpkg.com/@cosmostation/extension-client/-/extension-client-0.1.11.tgz#d6b447cfd9cf7613ec485b57327819b14735cf13" @@ -1345,6 +1363,17 @@ react "^16.14.0" react-dom "^16.14.0" +"@cosmostation/wc-modal@^0.0.4": + version "0.0.4" + resolved "https://registry.yarnpkg.com/@cosmostation/wc-modal/-/wc-modal-0.0.4.tgz#61442b0c51201dda9ee90cfcb3002848eadc7ba2" + integrity sha512-/SkbFKKQxUCMI8ZnULVTsWLFUx9pG+p7MFvv/Ifgz+xBAPe9nBCJlJ/LdvJ6HuAIPajc1vcXB2/OzGL9TjMpNw== + dependencies: + "@walletconnect/browser-utils" "^1.6.5" + "@walletconnect/types" "^1.6.5" + qrcode.react "^1.0.1" + react "^16.14.0" + react-dom "^16.14.0" + "@cspotcode/source-map-support@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" @@ -1480,6 +1509,54 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz#de2a4be678bd4d0d1ffbb86e6de779cde5999028" integrity sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw== +"@ethersproject/address@^5.6.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/keccak256@^5.5.0", "@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@firebase/analytics-compat@0.1.13": version "0.1.13" resolved "https://registry.yarnpkg.com/@firebase/analytics-compat/-/analytics-compat-0.1.13.tgz#61e1d6f9e4d033c3ed9943d91530eb3e0f382f92" @@ -2569,6 +2646,63 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@keplr-wallet/common@0.11.23": + version "0.11.23" + resolved "https://registry.yarnpkg.com/@keplr-wallet/common/-/common-0.11.23.tgz#0ea4f94e31de3403319ebc8bc20f8afff5945f96" + integrity sha512-rWze1zbeCVNCj2a9sceM2oQMCiKzHIajfvnl3VZ2hF+kp/DW8F+DEvl6bafr83tR1qmH3iRRn3QPneJFI6smqw== + dependencies: + "@keplr-wallet/crypto" "0.11.23" + buffer "^6.0.3" + delay "^4.4.0" + +"@keplr-wallet/cosmos@^0.11.23": + version "0.11.23" + resolved "https://registry.yarnpkg.com/@keplr-wallet/cosmos/-/cosmos-0.11.23.tgz#dd8bc600ef126ebefe32d9f7b7321dd1a61ecde9" + integrity sha512-8MVsv/lp6W1Eyux9jIu9jTxX5pBY+qRvoKyiOWu507tUsKX4/+NSFTDllaumzjNFWaqyqubJaVcXjhO0zmNBGA== + dependencies: + "@ethersproject/address" "^5.6.0" + "@keplr-wallet/common" "0.11.23" + "@keplr-wallet/crypto" "0.11.23" + "@keplr-wallet/proto-types" "0.11.23" + "@keplr-wallet/types" "0.11.23" + "@keplr-wallet/unit" "0.11.23" + axios "^0.27.2" + bech32 "^1.1.4" + buffer "^6.0.3" + long "^4.0.0" + protobufjs "^6.11.2" + +"@keplr-wallet/crypto@0.11.23": + version "0.11.23" + resolved "https://registry.yarnpkg.com/@keplr-wallet/crypto/-/crypto-0.11.23.tgz#8f7b7627301c52faf57421575cd6ba0cec4e2f22" + integrity sha512-QYrazCi4uuWvGqmC1YjsQSaviMTF98mCcXlO55h6GnZ95j/xqmT3VZKPBWgpSuMm07CvROt5ix3yHMLuoTYEvg== + dependencies: + "@ethersproject/keccak256" "^5.5.0" + bip32 "^2.0.6" + bip39 "^3.0.3" + bs58check "^2.1.2" + buffer "^6.0.3" + crypto-js "^4.0.0" + elliptic "^6.5.3" + sha.js "^2.4.11" + +"@keplr-wallet/proto-types@0.11.23": + version "0.11.23" + resolved "https://registry.yarnpkg.com/@keplr-wallet/proto-types/-/proto-types-0.11.23.tgz#7060f9d981bfe2a461452d45da33965a9f9d37e2" + integrity sha512-B3zrT9Zw+vBAUVWuFW3FZnB4l65X3TYv0V66fo3niDX1LXWfOusf8MkvrC7GTThpPcXCZPZjbGfTXYGr3TkVSw== + dependencies: + long "^4.0.0" + protobufjs "^6.11.2" + +"@keplr-wallet/types@0.11.23": + version "0.11.23" + resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.11.23.tgz#bc2810b9dd8742b3ff100a215b67250c695c6192" + integrity sha512-2abfPXx7qmcuE828UvmNYPWfw4l6dtO1hgtoAL/ySZRcbFB7UaowaHQN7SkHW/QKMS55wglMiP/L/6LUmp36Rg== + dependencies: + axios "^0.27.2" + long "^4.0.0" + secretjs "0.17.7" + "@keplr-wallet/types@^0.10.14": version "0.10.24" resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.10.24.tgz#b795f3f45ccad852803c726812625c61ff2b4a29" @@ -2580,6 +2714,15 @@ long "^4.0.0" secretjs "^0.17.0" +"@keplr-wallet/unit@0.11.23": + version "0.11.23" + resolved "https://registry.yarnpkg.com/@keplr-wallet/unit/-/unit-0.11.23.tgz#afbe7d0a03ab0b2ea69ebca3ed072deb61f25ff6" + integrity sha512-eSszm7Bado1YE/52LymZLQk5svgW2uFfk/VRc5k3a4zyALHDCNmtEyUzXQSdIZUpgVyFFE1Ns57/OdjK+j8A0w== + dependencies: + "@keplr-wallet/types" "0.11.23" + big-integer "^1.6.48" + utility-types "^3.10.0" + "@mui/base@5.0.0-alpha.99": version "5.0.0-alpha.99" resolved "https://registry.yarnpkg.com/@mui/base/-/base-5.0.0-alpha.99.tgz#52589c72b6bf69e016e5811292529d60f81537ad" @@ -3131,6 +3274,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.23.tgz#75c580983846181ebe5f4abc40fe9dfb2d65665f" integrity sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg== +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + "@types/node@11.11.6": version "11.11.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" @@ -3810,6 +3958,13 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base-x@^3.0.2: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + base64-js@^1.0.2, base64-js@^1.3.0, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" @@ -3825,6 +3980,11 @@ bech32@^2.0.0: resolved "https://registry.yarnpkg.com/bech32/-/bech32-2.0.0.tgz#078d3686535075c8c79709f054b1b226a133b355" integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== +big-integer@^1.6.48: + version "1.6.51" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== + bignumber.js@^9.0.2: version "9.1.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.0.tgz#8d340146107fe3a6cb8d40699643c302e8773b62" @@ -3835,7 +3995,27 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bip39@^3.0.2: +bindings@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +bip32@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" + integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== + dependencies: + "@types/node" "10.12.18" + bs58check "^2.1.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + tiny-secp256k1 "^1.1.3" + typeforce "^1.11.5" + wif "^2.0.6" + +bip39@^3.0.2, bip39@^3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== @@ -3864,7 +4044,7 @@ bn.js@^4.11.8, bn.js@^4.11.9: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.2.0: +bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== @@ -3904,6 +4084,22 @@ browserslist@^4.21.3, browserslist@^4.21.4: node-releases "^2.0.6" update-browserslist-db "^1.0.9" +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +bs58check@<3.0.0, bs58check@^2.1.1, bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -3921,7 +4117,7 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer@6.0.3: +buffer@6.0.3, buffer@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== @@ -4299,7 +4495,7 @@ cosmjs-types@^0.4.0: long "^4.0.0" protobufjs "~6.11.2" -create-hash@^1.1.0, create-hash@^1.1.2: +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== @@ -4310,7 +4506,7 @@ create-hash@^1.1.0, create-hash@^1.1.2: ripemd160 "^2.0.1" sha.js "^2.4.0" -create-hmac@^1.1.4: +create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== @@ -4348,6 +4544,11 @@ crypt@~0.0.1: resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== +crypto-js@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" + integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== + css-color-keywords@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05" @@ -4389,17 +4590,21 @@ csstype@^3.0.10, csstype@^3.0.2, csstype@^3.1.1: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== -cudosjs@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/cudosjs/-/cudosjs-1.1.0.tgz#5f127894b8aad518adc70983639fcc90a1f097f2" - integrity sha512-rMiIEMSPkUs7R1P5ytERODBw0kZBx0pzAeYFoUexaezD0GSNZppLJvUcFr5vVtZ5VA/5B1c9AXQCPX5DEWrcPw== +cudosjs@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/cudosjs/-/cudosjs-1.2.6.tgz#82bfc8701293e54cc6e7e50f866736022e1e1747" + integrity sha512-jYqt3Ajbmp04JF2/JtcMOEtESaJ+Dx7w2p9JIb0aB8QpXgLhHimX1eV5OTn2hEHRrhCPiEKGL1c4bsPyYfNKbg== dependencies: "@cosmjs/cosmwasm-stargate" "^0.28.4" "@cosmjs/crypto" "^0.28.4" "@cosmjs/proto-signing" "^0.28.4" "@cosmjs/stargate" "^0.28.4" "@cosmjs/tendermint-rpc" "^0.28.4" + "@cosmostation/cosmos-client" "^0.0.4" + "@cosmostation/extension-client" "^0.1.9" + "@keplr-wallet/cosmos" "^0.11.23" bignumber.js "^9.0.2" + detect-browser "^5.3.0" yarn "^1.22.19" curve25519-js@0.0.4: @@ -4478,6 +4683,11 @@ define-properties@^1.1.3, define-properties@^1.1.4: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +delay@^4.4.0: + version "4.4.1" + resolved "https://registry.yarnpkg.com/delay/-/delay-4.4.1.tgz#6e02d02946a1b6ab98b39262ced965acba2ac4d1" + integrity sha512-aL3AhqtfhOlT/3ai6sWXeqwnw63ATNpnUiN4HL7x9q+My5QtHlO3OIkasmug9LKzpheLdmUKGRKnYXYAS7FQkQ== + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -4493,6 +4703,11 @@ detect-browser@5.2.0: resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.2.0.tgz#c9cd5afa96a6a19fda0bbe9e9be48a6b6e1e9c97" integrity sha512-tr7XntDAu50BVENgQfajMLzacmSe34D+qZc4zjnniz0ZVuw/TZcLcyxHQjYpJTM36sGEkZZlYLnIM1hH7alTMA== +detect-browser@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.3.0.tgz#9705ef2bddf46072d0f7265a1fe300e36fe7ceca" + integrity sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w== + detect-indent@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" @@ -4949,6 +5164,11 @@ figures@^3.0.0: dependencies: escape-string-regexp "^1.0.5" +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -6555,6 +6775,11 @@ mute-stream@0.0.8: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +nan@^2.13.2: + version "2.17.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" + integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== + nanoid@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" @@ -6952,7 +7177,7 @@ prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" -protobufjs@6.11.3, protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: +protobufjs@6.11.3, protobufjs@^6.11.2, protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: version "6.11.3" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== @@ -7510,6 +7735,23 @@ scuid@^1.1.0: resolved "https://registry.yarnpkg.com/scuid/-/scuid-1.1.0.tgz#d3f9f920956e737a60f72d0e4ad280bf324d5dab" integrity sha512-MuCAyrGZcTLfQoH2XoBlQ8C6bzwN88XT/0slOGz0pn8+gIP85BOAfYa44ZXQUTOwRwPU0QvgU+V+OSajl/59Xg== +secretjs@0.17.7: + version "0.17.7" + resolved "https://registry.yarnpkg.com/secretjs/-/secretjs-0.17.7.tgz#a1aef5866a35cf673be9ddd717d20729afd056ac" + integrity sha512-j39l9+vR2A8067QBqDDejS7LmRLgdkG4uRw2Ar6HMfzDGo26eTh7cIXVlVu/yHBumxtQzKun20epOXwuYHXjQg== + dependencies: + "@iov/crypto" "2.1.0" + "@iov/encoding" "2.1.0" + "@iov/utils" "2.0.2" + axios "0.21.1" + curve25519-js "0.0.4" + fast-deep-equal "3.1.1" + js-crypto-hkdf "0.7.3" + miscreant "0.3.2" + pako "1.0.11" + protobufjs "6.11.3" + secure-random "1.1.2" + secretjs@^0.17.0: version "0.17.8" resolved "https://registry.yarnpkg.com/secretjs/-/secretjs-0.17.8.tgz#a7158ebf492727da8297f9b80cf9c83597e70cc9" @@ -7842,6 +8084,11 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +svg-loaders-react@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/svg-loaders-react/-/svg-loaders-react-2.2.1.tgz#d546cea2a895144cfd652e1bd846166d8a07d2ed" + integrity sha512-ATfg5pAMOla2GqPcwGRDrNTLlTQzl2fMvfW290j20qH7qpB61C3SQAnu+T9t8Z+V4IKKN2Bm1d/SaCv5IR1DDA== + svg-parser@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/svg-parser/-/svg-parser-2.0.4.tgz#fdc2e29e13951736140b76cb122c8ee6630eb6b5" @@ -7899,6 +8146,17 @@ through@^2.3.6, through@^2.3.8: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== +tiny-secp256k1@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" + integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== + dependencies: + bindings "^1.3.0" + bn.js "^4.11.8" + create-hmac "^1.1.7" + elliptic "^6.4.0" + nan "^2.13.2" + title-case@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/title-case/-/title-case-3.0.3.tgz#bc689b46f02e411f1d1e1d081f7c3deca0489982" @@ -7981,7 +8239,7 @@ ts-mixer@^5.4.1: resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-5.4.1.tgz#b90db9ced48531aa17ce9184a2890d1e3c99b1e5" integrity sha512-Zo9HgPCtNouDgJ+LGtrzVOjSg8+7WGQktIKLwAfaNrlOK1mWGlz1ejsAF/YqUEqAGjUTeB5fEg8gH9Aui6w9xA== -ts-node@^10.8.1: +ts-node@^10.8.1, ts-node@^10.9.1: version "10.9.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== @@ -8048,6 +8306,11 @@ typedarray-to-buffer@3.1.5: dependencies: is-typedarray "^1.0.0" +typeforce@^1.11.5: + version "1.18.0" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.18.0.tgz#d7416a2c5845e085034d70fcc5b6cc4a90edbfdc" + integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== + typescript@^4.6.3: version "4.8.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" @@ -8148,6 +8411,11 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== +utility-types@^3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b" + integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg== + v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" @@ -8323,6 +8591,13 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +wif@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" + integrity sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ== + dependencies: + bs58check "<3.0.0" + word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" From cf72bfc5af678b7405948b3c7e877a9d51e73890 Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Mon, 20 Mar 2023 10:59:19 +0200 Subject: [PATCH 02/11] bump cudosjs version --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ecd1628..f3f2bd4 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "bignumber.js": "^9.0.2", "buffer": "^6.0.3", "csstype": "^3.0.10", - "cudosjs": "^1.2.6", + "cudosjs": "^1.2.7", "firebase": "^9.9.1", "goober": "^2.1.1", "graphql": "^16.5.0", diff --git a/yarn.lock b/yarn.lock index a4d20c0..c2ce10d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4590,10 +4590,10 @@ csstype@^3.0.10, csstype@^3.0.2, csstype@^3.1.1: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== -cudosjs@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/cudosjs/-/cudosjs-1.2.6.tgz#82bfc8701293e54cc6e7e50f866736022e1e1747" - integrity sha512-jYqt3Ajbmp04JF2/JtcMOEtESaJ+Dx7w2p9JIb0aB8QpXgLhHimX1eV5OTn2hEHRrhCPiEKGL1c4bsPyYfNKbg== +cudosjs@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/cudosjs/-/cudosjs-1.2.7.tgz#cf51f301e8e9c884eaaba122d3c5d68f2c80ee47" + integrity sha512-c2Pcfe2sQpdkbDzBnpF6eN0HfOEa1zpc49uW0OsHpdz1d9+01G0FuP3pun30znTonhwSE8E3myPTS8kXds0sVg== dependencies: "@cosmjs/cosmwasm-stargate" "^0.28.4" "@cosmjs/crypto" "^0.28.4" From f720639fe61dd1c7eb0509720b22b0a78a8427a3 Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Mon, 20 Mar 2023 10:59:51 +0200 Subject: [PATCH 03/11] fix: TS error --- types/custom.d.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/types/custom.d.ts b/types/custom.d.ts index fb6849f..4629ebc 100644 --- a/types/custom.d.ts +++ b/types/custom.d.ts @@ -1,8 +1,9 @@ declare module '*.svg' { - import React = require('react'); - - export const ReactComponent: React.SFC>; - const src: string; - export default src; - } - \ No newline at end of file + import React = require('react'); + + export const ReactComponent: React.SFC>; + const src: string; + export default src; +} + +declare module 'svg-loaders-react' From 033a1054089fdfefb545464c8d049c341550e178 Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Mon, 20 Mar 2023 11:00:07 +0200 Subject: [PATCH 04/11] CUDOS-2370-show-app-version-in-footer --- example.env.file | 3 ++- src/utils/constants.tsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/example.env.file b/example.env.file index 973f7da..88012ea 100644 --- a/example.env.file +++ b/example.env.file @@ -12,4 +12,5 @@ VITE_APP_FIREBASE_AUTH_DOMAIN="address-book-123.firebaseapp.com" VITE_APP_FIREBASE_PROJECT_ID="address-book-123" VITE_APP_FIREBASE_AUTH_EMAIL="admin@multisig.cudos" VITE_APP_FIREBASE_AUTH_PASSWORD="123123" -VITE_APP_FIREBASE_COLLECTION_NAME="address-book" \ No newline at end of file +VITE_APP_FIREBASE_COLLECTION_NAME="address-book" +VITE_APP_DEPLOYMENT_VERSION='v1.2.3' \ No newline at end of file diff --git a/src/utils/constants.tsx b/src/utils/constants.tsx index 5a7b269..d8a75d1 100644 --- a/src/utils/constants.tsx +++ b/src/utils/constants.tsx @@ -34,6 +34,7 @@ export const FIREBASE_PROJECT_ID = import.meta.env.VITE_APP_FIREBASE_PROJECT_ID export const FIREBASE_AUTH_EMAIL = import.meta.env.VITE_APP_FIREBASE_AUTH_EMAIL || process.env.VITE_APP_FIREBASE_AUTH_EMAIL || "" export const FIREBASE_AUTH_PASSWORD = import.meta.env.VITE_APP_FIREBASE_AUTH_PASSWORD || process.env.VITE_APP_FIREBASE_AUTH_PASSWORD || "" export const FIREBASE_COLLECTION_NAME = import.meta.env.VITE_APP_FIREBASE_COLLECTION_NAME || process.env.VITE_APP_FIREBASE_COLLECTION_NAME || "" +export const DEPLOYMENT_VERSION = import.meta.env.VITE_APP_DEPLOYMENT_VERSION || process.env.VITE_APP_DEPLOYMENT_VERSION || "" // General config export const ADMIN_TOKEN_DENOM = 'cudosAdmin' @@ -55,7 +56,8 @@ export const FOOTER = { { text: 'Terms & Conditions', url: 'https://www.cudos.org/terms-and-conditions/' }, { text: 'Privacy Policy', url: 'https://www.cudos.org/privacy-policy' }, { text: 'cudos.org', url: 'https://www.cudos.org/' }, - { text: `License © 2018 - ${moment().year()}`, url: 'https://www.cudos.org/' } + { text: `License © 2018 - ${moment().year()}`, url: 'https://www.cudos.org/' }, + { text: `${DEPLOYMENT_VERSION}`, url: `https://github.com/CudoVentures/cudos-multisig-v2/releases/tag/${DEPLOYMENT_VERSION}` } ], RIGHT_LINKS: [ { icon: , url: 'https://twitter.com/CUDOS_' }, From b985c8f5205173666de1614b4243293902473785 Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Wed, 19 Jul 2023 13:56:34 +0300 Subject: [PATCH 05/11] address DOM error --- src/components/Layout/Networkinfo.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Layout/Networkinfo.tsx b/src/components/Layout/Networkinfo.tsx index a9ea76a..916850a 100644 --- a/src/components/Layout/Networkinfo.tsx +++ b/src/components/Layout/Networkinfo.tsx @@ -71,12 +71,12 @@ const NetworkInfo = () => { > { - networksToDisplayInMenu.map((network) => { + networksToDisplayInMenu.map((network, idx) => { const [hovered, setHovered] = useState(false) return ( CHAIN_ID !== network ? - setHovered(true)} onMouseOut={() => setHovered(false)}> + setHovered(true)} onMouseOut={() => setHovered(false)}> Date: Wed, 19 Jul 2023 14:22:33 +0300 Subject: [PATCH 06/11] CUDOS-2569 improve error handling --- src/containers/ConnectWallet/ConnectWallet.tsx | 4 ---- src/utils/config.ts | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/containers/ConnectWallet/ConnectWallet.tsx b/src/containers/ConnectWallet/ConnectWallet.tsx index bb09614..629884b 100644 --- a/src/containers/ConnectWallet/ConnectWallet.tsx +++ b/src/containers/ConnectWallet/ConnectWallet.tsx @@ -55,10 +55,6 @@ const ConnectWallet = () => { setLoading(new Map(loading.set(walletName, true))) const connectedUser = await connectUser(walletName) dispatch(updateUser(connectedUser)) - - const firebaseToken = await authenticate(connectedUser.address!, ledgerType); - dispatch(updateUser({firebaseToken: firebaseToken})); - navigate('/welcome') } catch (error) { diff --git a/src/utils/config.ts b/src/utils/config.ts index 4fce2a3..8173d65 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -7,6 +7,7 @@ import { connectKeplrLedger } from "ledgers/KeplrLedger"; import { connectCosmostationLedger } from "ledgers/CosmostationLedger"; import { checkForAdminToken, getAccountBalances, getNativeBalance } from "./helpers"; import { isValidCudosAddress } from "./validation"; +import { authenticate } from "./firebase"; export const queryClient = (async (): Promise => { const client = await StargateClient.connect(RPC_ADDRESS) @@ -73,6 +74,7 @@ export const connectUser = async (walletName: SUPPORTED_WALLET): Promise Date: Wed, 19 Jul 2023 16:29:07 +0300 Subject: [PATCH 07/11] CUDOS-2570 move to Firebase V2 auth --- src/utils/config.ts | 4 ++-- src/utils/firebase.ts | 16 ++++++++-------- src/utils/helpers.ts | 25 +++++++++++++++++++++++-- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/utils/config.ts b/src/utils/config.ts index 8173d65..b4b21ad 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,7 +1,7 @@ import { isExtensionEnabled, OfflineSigner, StargateClient, SUPPORTED_WALLET } from "cudosjs"; import { SigningStargateClient } from "cudosjs"; import { getOfflineSigner as cosmostationSigner } from "@cosmostation/cosmos-client"; -import { CHAIN_ID, RPC_ADDRESS } from "./constants"; +import { CHAIN_ID, FIREBASE_ADDRESS_BOOK_COLLECTION, RPC_ADDRESS } from "./constants"; import { userState } from "store/user"; import { connectKeplrLedger } from "ledgers/KeplrLedger"; import { connectCosmostationLedger } from "ledgers/CosmostationLedger"; @@ -74,7 +74,7 @@ export const connectUser = async (walletName: SUPPORTED_WALLET): Promise { +export const authenticate = async (address: string, collection: string, connectedWallet: SUPPORTED_WALLET) => { try { - const nonceRes = await axios.post(FIREBASE_AUTH_NONCE_URL, { address }); - const client = await getSigningClient(connectedLedger!); - const { signature, chainId, sequence, accountNumber } = await client.signNonceMsg(address!, nonceRes.data.nonce); - const verifyRes = await axios.post(FIREBASE_AUTH_VERIFY_URL, { address, signature, chainId, sequence, accountNumber }); + const nonceRes = await axios.post(FIREBASE_AUTH_NONCE_URL, { address, collection }); + const { signature } = await signArbitrary(connectedWallet, address, nonceRes.data.nonce); + const verifyRes = await axios.post(FIREBASE_AUTH_VERIFY_URL, { address, signature, collection }); return verifyRes.data.token; - } catch { - throw new Error("Error while getting address book from Firebase") + } catch (error) { + throw new Error("Firebase authentication error") } } diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 8b610c4..09c62f6 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -5,12 +5,12 @@ import { queryClient } from "./config" import { getCurrencyRate } from "api/calls" import { emptyWallet, Wallet } from "store/user" import { handleFullBalanceToPrecision, separateDecimals, separateFractions } from "./regexFormatting" -import { ADMIN_TOKEN_DENOM, GAS_PRICE, NATIVE_TOKEN_DENOM } from "./constants" +import { ADMIN_TOKEN_DENOM, CHAIN_ID, GAS_PRICE, NATIVE_TOKEN_DENOM } from "./constants" import cudosLogo from 'assets/vectors/balances/cudos.svg' import cudosAdminLogo from 'assets/vectors/balances/cudos-admin.svg' import { votingPeriod } from "store/walletObject" -import { Coin, StdFee } from "cudosjs" +import { Coin, StdFee, StdSignature, SUPPORTED_WALLET } from "cudosjs" export const formatDateTime = (dateTimeString: string): string => { const localTimeString: string = moment(dateTimeString).parseZone().toLocaleString() @@ -165,3 +165,24 @@ export const denomToAlias = { 'acudos': "CUDOS", 'cudosAdmin': 'ADMIN TOKENS' } + +export const signArbitrary = async ( + walletType: SUPPORTED_WALLET, + signingAddress: string, + message: string + ): + Promise<{ signature: StdSignature }> => { + let signature: StdSignature = { + pub_key: { type: '', value: '' }, + signature: "" + } + if (walletType === SUPPORTED_WALLET.Keplr) { + signature = await window.keplr!.signArbitrary(CHAIN_ID, signingAddress, message) + } + + if (walletType === SUPPORTED_WALLET.Cosmostation) { + signature = await window.cosmostation.providers.keplr.signArbitrary(CHAIN_ID, signingAddress, message) + } + return { signature } + } + \ No newline at end of file From eacd941fdea5d6788126a8371d6fad6a4b68e62c Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Wed, 19 Jul 2023 17:58:12 +0300 Subject: [PATCH 08/11] CUDOS-2571 avoid document nonce overwritting --- src/utils/firebase.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/firebase.ts b/src/utils/firebase.ts index 65e5a02..e47501f 100644 --- a/src/utils/firebase.ts +++ b/src/utils/firebase.ts @@ -27,11 +27,11 @@ export const authenticate = async (address: string, collection: string, connecte } } -export const getAddressBook = async (address): Promise => { +export const getAddressBook = async (address: string): Promise => { try { const addressBookDoc = await getDoc(doc(firestore, FIREBASE_ADDRESS_BOOK_COLLECTION, address)); return addressBookDoc.data()?.addressBook ?? {}; - } catch { + } catch (error) { throw new Error("Error while getting address book from Firebase") } }; @@ -39,7 +39,7 @@ export const getAddressBook = async (address): Promise => { export const saveAddressBook = async (address: string, addressBook: AddressBook): Promise => { try { const addressBookDoc = doc(firestore, FIREBASE_ADDRESS_BOOK_COLLECTION, address); - return setDoc(addressBookDoc, { addressBook }); + return setDoc(addressBookDoc, { addressBook }, { merge: true }); } catch { throw new Error("Error while saving address book to Firebase") } From 28eb0204a2b2c1d9bc5bb39b6d319ebdd889ff04 Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Wed, 19 Jul 2023 18:08:33 +0300 Subject: [PATCH 09/11] change edit record icon color --- src/assets/vectors/edit-icon.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/vectors/edit-icon.svg b/src/assets/vectors/edit-icon.svg index 0f85013..9bf1778 100644 --- a/src/assets/vectors/edit-icon.svg +++ b/src/assets/vectors/edit-icon.svg @@ -1,3 +1,3 @@ - - + + From 00acc06189455f9f5d2fa0b4f01f761e5ea12a9e Mon Sep 17 00:00:00 2001 From: SpaghettiOverload Date: Thu, 20 Jul 2023 10:28:38 +0300 Subject: [PATCH 10/11] update header home nav behaviour --- src/components/Layout/Header.tsx | 8 ++++---- src/store/user.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Layout/Header.tsx b/src/components/Layout/Header.tsx index fdcb963..920a042 100644 --- a/src/components/Layout/Header.tsx +++ b/src/components/Layout/Header.tsx @@ -8,10 +8,10 @@ const Header = () => { const location = useLocation() return ( - - - - logo + + + + logo {location.pathname === '/' ? null : ( Date: Thu, 20 Jul 2023 11:38:51 +0300 Subject: [PATCH 11/11] CUDOS-1208 migrate to cudosjs getOfflineSigner --- package.json | 6 +- src/utils/config.ts | 18 +--- yarn.lock | 237 +++++++++++++++++++++++++------------------- 3 files changed, 139 insertions(+), 122 deletions(-) diff --git a/package.json b/package.json index f3f2bd4..67b7045 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "name": "cudos-multisig-v2", + "license": "MIT", "private": true, - "version": "0.0.0", + "version": "1.0.0", "scripts": { "dev": "vite", "build": "tsc && vite build", @@ -12,7 +13,6 @@ "dependencies": { "@apollo/client": "^3.6.9", "@babel/core": "^7.0.0-0", - "@cosmostation/cosmos-client": "^0.0.1", "@cosmostation/extension-client": "^0.1.7", "@emotion/react": "^11.9.3", "@emotion/styled": "^11.9.3", @@ -25,7 +25,7 @@ "bignumber.js": "^9.0.2", "buffer": "^6.0.3", "csstype": "^3.0.10", - "cudosjs": "^1.2.7", + "cudosjs": "1.3.4", "firebase": "^9.9.1", "goober": "^2.1.1", "graphql": "^16.5.0", diff --git a/src/utils/config.ts b/src/utils/config.ts index b4b21ad..96488af 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,6 +1,5 @@ -import { isExtensionEnabled, OfflineSigner, StargateClient, SUPPORTED_WALLET } from "cudosjs"; +import { getOfflineSignerByType, isExtensionEnabled, OfflineSigner, StargateClient, SUPPORTED_WALLET } from "cudosjs"; import { SigningStargateClient } from "cudosjs"; -import { getOfflineSigner as cosmostationSigner } from "@cosmostation/cosmos-client"; import { CHAIN_ID, FIREBASE_ADDRESS_BOOK_COLLECTION, RPC_ADDRESS } from "./constants"; import { userState } from "store/user"; import { connectKeplrLedger } from "ledgers/KeplrLedger"; @@ -14,22 +13,9 @@ export const queryClient = (async (): Promise => { return client })() -const getOfflineSignerByType = async (walletName: SUPPORTED_WALLET): Promise => { - - if (walletName === SUPPORTED_WALLET.Keplr) { - return window.getOfflineSigner!(CHAIN_ID) - } - - if (walletName === SUPPORTED_WALLET.Cosmostation) { - return cosmostationSigner(CHAIN_ID) - } - - return undefined -} - export const getSigningClient = async (walletName: SUPPORTED_WALLET): Promise => { - const offlineSigner = await getOfflineSignerByType(walletName) + const offlineSigner = await getOfflineSignerByType(walletName, CHAIN_ID) if (isExtensionEnabled(walletName)) { window.keplr.defaultOptions = { diff --git a/yarn.lock b/yarn.lock index f4dc187..fdc0153 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1107,24 +1107,35 @@ "@cosmjs/math" "0.28.13" "@cosmjs/utils" "0.28.13" -"@cosmjs/cosmwasm-stargate@^0.28.4": - version "0.28.13" - resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.28.13.tgz#bea77bc999aaafdb677f446465f648cd000c5b4a" - integrity sha512-dVZNOiRd8btQreRUabncGhVXGCS2wToXqxi9l3KEHwCJQ2RWTshuqV+EZAdCaYHE5W6823s2Ol2W/ukA9AXJPw== - dependencies: - "@cosmjs/amino" "0.28.13" - "@cosmjs/crypto" "0.28.13" - "@cosmjs/encoding" "0.28.13" - "@cosmjs/math" "0.28.13" - "@cosmjs/proto-signing" "0.28.13" - "@cosmjs/stargate" "0.28.13" - "@cosmjs/tendermint-rpc" "0.28.13" - "@cosmjs/utils" "0.28.13" +"@cosmjs/amino@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.28.6.tgz#519039d893186bad17b9e00a361d26329feb7c48" + integrity sha512-i25BgQI2por2j6IGQsd3OxJYauxDt/7mtyywLMfKqHYu30/V5niiXsWoPSrn6P4bbprY5pB9di4vWpk5lBAnqA== + dependencies: + "@cosmjs/crypto" "0.28.6" + "@cosmjs/encoding" "0.28.6" + "@cosmjs/math" "0.28.6" + "@cosmjs/utils" "0.28.6" + +"@cosmjs/cosmwasm-stargate@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.28.6.tgz#932ac448e2d79fe3b52f2a0b36d4fba3fdddbff2" + integrity sha512-Q3hxHnyP47GI04UV1DRbb7egL0Jc9xhFfWS0xM/sYddrOnv0tw9tNhNID+MiOEpWaqNEdF8E8Kox41jBSmA9rg== + dependencies: + "@cosmjs/amino" "0.28.6" + "@cosmjs/crypto" "0.28.6" + "@cosmjs/encoding" "0.28.6" + "@cosmjs/math" "0.28.6" + "@cosmjs/proto-signing" "0.28.6" + "@cosmjs/stargate" "0.28.6" + "@cosmjs/tendermint-rpc" "0.28.6" + "@cosmjs/utils" "0.28.6" cosmjs-types "^0.4.0" long "^4.0.0" pako "^2.0.2" + protobufjs "~6.11.3" -"@cosmjs/crypto@0.28.13", "@cosmjs/crypto@^0.28.4": +"@cosmjs/crypto@0.28.13": version "0.28.13" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.28.13.tgz#541b6a36f616b2da5a568ead46d4e83841ceb412" integrity sha512-ynKfM0q/tMBQMHJby6ad8lR3gkgBKaelQhIsCZTjClsnuC7oYT9y3ThSZCUWr7Pa9h0J8ahU2YV2oFWFVWJQzQ== @@ -1137,6 +1148,19 @@ elliptic "^6.5.3" libsodium-wrappers "^0.7.6" +"@cosmjs/crypto@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.28.6.tgz#66c54537fc2cbd8ac9644e9456acad2032632f84" + integrity sha512-7cKtPXZVRSeNkHJnahQ3jODWMG/5u2fTK2UZj0ouYD7TayjGs9fs1VnDY3aq7NMSwEN+UZlpp/tlYvK/MjPqig== + dependencies: + "@cosmjs/encoding" "0.28.6" + "@cosmjs/math" "0.28.6" + "@cosmjs/utils" "0.28.6" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.3" + libsodium-wrappers "^0.7.6" + "@cosmjs/crypto@^0.24.1": version "0.24.1" resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.24.1.tgz#62da59c32b26344f26b10dd31a02b93655586d04" @@ -1164,6 +1188,15 @@ bech32 "^1.1.4" readonly-date "^1.0.0" +"@cosmjs/encoding@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.28.6.tgz#e4778fffe1657fbbb5334454087d4f09a79c2f60" + integrity sha512-ELTMFZRrcT+fd3bs9a7YTgQIwurtq1jz7cmSITxCMLAiiasr4c72soNsVaw7QRfvW/Rweo4nQVhR+f9cJY6f2A== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/encoding@^0.20.0": version "0.20.1" resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.20.1.tgz#1d1162b3eca51b7244cd45102e313612cea77281" @@ -1182,12 +1215,12 @@ bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/json-rpc@0.28.13": - version "0.28.13" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.28.13.tgz#ff3f0c4a2f363b1a2c6779f8624a897e217fe297" - integrity sha512-fInSvg7x9P6p+GWqet+TMhrMTM3OWWdLJOGS5w2ryubMjgpR1rLiAx77MdTNkArW+/6sUwku0sN4veM4ENQu6A== +"@cosmjs/json-rpc@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.28.6.tgz#2d3b03002ab68f7320008e889323117d9af72ca0" + integrity sha512-3nVDGiap57E+nvHyD3f0CiZT0rco3ouhlvIYyiHVUQsZAdwD8P158qOeI0Xjq7Ku5QX57qAbRYRZ/fyKYdZwvQ== dependencies: - "@cosmjs/stream" "0.28.13" + "@cosmjs/stream" "0.28.6" xstream "^11.14.0" "@cosmjs/launchpad@^0.24.0-alpha.25", "@cosmjs/launchpad@^0.24.1": @@ -1209,6 +1242,13 @@ dependencies: bn.js "^5.2.0" +"@cosmjs/math@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.28.6.tgz#1fc8a48dc5b79dd7a3fc5405ef32e6b162b960c2" + integrity sha512-vk0g7f8UGXd2gj5IdeOqim/ZnMe9pJ9fxBISXkM1gJzJ+Tw09sdLA44Dp+yP6qyscb9mv5/CsIC+QA7+c27HkA== + dependencies: + bn.js "^5.2.0" + "@cosmjs/math@^0.20.0": version "0.20.1" resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.20.1.tgz#c3c2be821b8b5dbbb9b2c0401bd9f1472e821f2a" @@ -1223,18 +1263,19 @@ dependencies: bn.js "^4.11.8" -"@cosmjs/proto-signing@0.28.13", "@cosmjs/proto-signing@^0.28.4": - version "0.28.13" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.28.13.tgz#95ac12f0da0f0814f348f5ae996c3e96d015df61" - integrity sha512-nSl/2ZLsUJYz3Ad0RY3ihZUgRHIow2OnYqKsESMu+3RA/jTi9bDYhiBu8mNMHI0xrEJry918B2CyI56pOUHdPQ== +"@cosmjs/proto-signing@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.28.6.tgz#0962cd9af2ef797d4118a021acb4d881a0e43752" + integrity sha512-DOuUgmvC/x1tjMv2iC8mD6RnU6S3ffFRMpWvjPMLiHmlxaXlGjlI9apYcg28WEowxJUmLlgvAsKxsDm3OetiBw== dependencies: - "@cosmjs/amino" "0.28.13" - "@cosmjs/crypto" "0.28.13" - "@cosmjs/encoding" "0.28.13" - "@cosmjs/math" "0.28.13" - "@cosmjs/utils" "0.28.13" + "@cosmjs/amino" "0.28.6" + "@cosmjs/crypto" "0.28.6" + "@cosmjs/encoding" "0.28.6" + "@cosmjs/math" "0.28.6" + "@cosmjs/utils" "0.28.6" cosmjs-types "^0.4.0" long "^4.0.0" + protobufjs "~6.11.3" "@cosmjs/proto-signing@^0.24.0-alpha.25": version "0.24.1" @@ -1245,53 +1286,66 @@ long "^4.0.0" protobufjs "~6.10.2" -"@cosmjs/socket@0.28.13": +"@cosmjs/proto-signing@^0.28.4": version "0.28.13" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.28.13.tgz#d8443ad6e91d080fc6b80a7e9cf297a56b1f6833" - integrity sha512-lavwGxQ5VdeltyhpFtwCRVfxeWjH5D5mmN7jgx9nuCf3XSFbTcOYxrk2pQ4usenu1Q1KZdL4Yl5RCNrJuHD9Ug== + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.28.13.tgz#95ac12f0da0f0814f348f5ae996c3e96d015df61" + integrity sha512-nSl/2ZLsUJYz3Ad0RY3ihZUgRHIow2OnYqKsESMu+3RA/jTi9bDYhiBu8mNMHI0xrEJry918B2CyI56pOUHdPQ== + dependencies: + "@cosmjs/amino" "0.28.13" + "@cosmjs/crypto" "0.28.13" + "@cosmjs/encoding" "0.28.13" + "@cosmjs/math" "0.28.13" + "@cosmjs/utils" "0.28.13" + cosmjs-types "^0.4.0" + long "^4.0.0" + +"@cosmjs/socket@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.28.6.tgz#09d170d3d0c86738e18f75bb61e3774918e48a75" + integrity sha512-p1AhkfcI7bOuPSS/BSVavsGBBCi+fDveR3vJfDtf4WI13seRk0MNzBDyVMUCTjr4A/wn25YOwmkQGCRlJDdswA== dependencies: - "@cosmjs/stream" "0.28.13" + "@cosmjs/stream" "0.28.6" isomorphic-ws "^4.0.1" ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@0.28.13", "@cosmjs/stargate@^0.28.4": - version "0.28.13" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.28.13.tgz#a73d837a46ee8944e6eafe162f2ff6943c14350e" - integrity sha512-dVBMazDz8/eActHsRcZjDHHptOBMqvibj5CFgEtZBp22gP6ASzoAUXTlkSVk5FBf4sfuUHoff6st134/+PGMAg== +"@cosmjs/stargate@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.28.6.tgz#29dd674dca146aefba8f48886ec5aae0baa641a0" + integrity sha512-72A/qGCt7+1Ce+R53U3SGYllTyJ0JWgewZV/HVcQosVLA+vIf1Pb1Dmd8vd6K2sbb4qdRWaqPHvtjhPUmyrZPQ== dependencies: "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "0.28.13" - "@cosmjs/encoding" "0.28.13" - "@cosmjs/math" "0.28.13" - "@cosmjs/proto-signing" "0.28.13" - "@cosmjs/stream" "0.28.13" - "@cosmjs/tendermint-rpc" "0.28.13" - "@cosmjs/utils" "0.28.13" + "@cosmjs/amino" "0.28.6" + "@cosmjs/encoding" "0.28.6" + "@cosmjs/math" "0.28.6" + "@cosmjs/proto-signing" "0.28.6" + "@cosmjs/stream" "0.28.6" + "@cosmjs/tendermint-rpc" "0.28.6" + "@cosmjs/utils" "0.28.6" cosmjs-types "^0.4.0" long "^4.0.0" protobufjs "~6.11.3" xstream "^11.14.0" -"@cosmjs/stream@0.28.13": - version "0.28.13" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.28.13.tgz#1e79d1116fda1e63e5ecddbd9d803d403942b1fa" - integrity sha512-AnjtfwT8NwPPkd3lhZhjOlOzT0Kn9bgEu2IPOZjQ1nmG2bplsr6TJmnwn0dJxHT7UGtex17h6whKB5N4wU37Wg== +"@cosmjs/stream@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.28.6.tgz#6cafa4675f69c31b126fa09b80c5cc2a9d0b7fcd" + integrity sha512-I8/AAbV6Ax4PEFtx6Lr8rj/0Vl0be6OozlefOJ2WJxA7yk5n1lCGfc8nIDb5b7sdk/wif5H/Xpm/IOV1SIWLqA== dependencies: xstream "^11.14.0" -"@cosmjs/tendermint-rpc@0.28.13", "@cosmjs/tendermint-rpc@^0.28.4": - version "0.28.13" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.28.13.tgz#0bf587ae66fa3f88319edbd258492d28e73f9f29" - integrity sha512-GB+ZmfuJIGQm0hsRtLYjeR3lOxF7Z6XyCBR0cX5AAYOZzSEBJjevPgUHD6tLn8zIhvzxaW3/VKnMB+WmlxdH4w== - dependencies: - "@cosmjs/crypto" "0.28.13" - "@cosmjs/encoding" "0.28.13" - "@cosmjs/json-rpc" "0.28.13" - "@cosmjs/math" "0.28.13" - "@cosmjs/socket" "0.28.13" - "@cosmjs/stream" "0.28.13" - "@cosmjs/utils" "0.28.13" +"@cosmjs/tendermint-rpc@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.28.6.tgz#067e5fab42874881858438ea1e6add52303f9c92" + integrity sha512-vyUym5AbYUitBZwl72URXXoFbXvhsuMUBi/x1ZSzubFifAlU6+WsTEFpC0HYlGeHNQfd8zwI2sO8dnfsiRS/pw== + dependencies: + "@cosmjs/crypto" "0.28.6" + "@cosmjs/encoding" "0.28.6" + "@cosmjs/json-rpc" "0.28.6" + "@cosmjs/math" "0.28.6" + "@cosmjs/socket" "0.28.6" + "@cosmjs/stream" "0.28.6" + "@cosmjs/utils" "0.28.6" axios "^0.21.2" readonly-date "^1.0.0" xstream "^11.14.0" @@ -1301,6 +1355,11 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.28.13.tgz#2fd2844ec832d7833811e2ae1691305d09791a08" integrity sha512-dVeMBiyg+46x7XBZEfJK8yTihphbCFpjVYmLJVqmTsHfJwymQ65cpyW/C+V/LgWARGK8hWQ/aX9HM5Ao8QmMSg== +"@cosmjs/utils@0.28.6": + version "0.28.6" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.28.6.tgz#3cb967cce55ef341229c755a7703e7c25b0f0164" + integrity sha512-ct5JPjCo+uI7O2Z7Xb8BxPYK39N0ykNhVsCG6I31z6ns6cGHD8Q3J5iVvSKkkJGRuBSrRk7yO8YY5etws3pinw== + "@cosmjs/utils@^0.20.0": version "0.20.1" resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.20.1.tgz#4d239b7d93c15523cdf109f225cbf61326fb69cd" @@ -1311,19 +1370,6 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.24.1.tgz#0adfefe63b7f17222bc2bc12f71296f35e7ad378" integrity sha512-VA3WFx1lMFb7esp9BqHWkDgMvHoA3D9w+uDRvWhVRpUpDc7RYHxMbWExASjz+gNblTCg556WJGzF64tXnf9tdQ== -"@cosmostation/cosmos-client@^0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@cosmostation/cosmos-client/-/cosmos-client-0.0.1.tgz#7b12411ff5d467b01d97abdf59596a2ade564a08" - integrity sha512-GmtQCyOazGxGdudSrLC0lW4B5FAVEWTuPg75uz79sLbyXbCDtB4Tfx8/wGjEtPyWHAKLnAvvCbi5fjGWldYOuw== - dependencies: - "@cosmjs/amino" "^0.28.4" - "@cosmjs/proto-signing" "^0.28.4" - "@cosmostation/extension-client" "^0.0.6" - "@cosmostation/wc-modal" "^0.0.1" - "@walletconnect/browser-utils" "^1.6.5" - "@walletconnect/client" "^1.7.8" - "@walletconnect/utils" "^1.6.5" - "@cosmostation/cosmos-client@^0.0.4": version "0.0.4" resolved "https://registry.yarnpkg.com/@cosmostation/cosmos-client/-/cosmos-client-0.0.4.tgz#9dc82df2a0da2c3d4fc4f36535961f0f35a9ed44" @@ -1337,31 +1383,15 @@ "@walletconnect/client" "^1.7.8" "@walletconnect/utils" "^1.6.5" -"@cosmostation/extension-client@^0.0.6": - version "0.0.6" - resolved "https://registry.yarnpkg.com/@cosmostation/extension-client/-/extension-client-0.0.6.tgz#a04420c1c3d68b83d197e48e79787a3484fb8d2c" - integrity sha512-3N7NOz8JMOpJlVaGS++zha4AZoijJTnPkq8djEfpk/mJ6+laUNo4a1/mxANFm9i1KUZcU9HX6GKKx9v9nL/VDg== - -"@cosmostation/extension-client@^0.1.3", "@cosmostation/extension-client@^0.1.9": - version "0.1.15" - resolved "https://registry.yarnpkg.com/@cosmostation/extension-client/-/extension-client-0.1.15.tgz#cdc6d8fce42217704c1c0d5814f0ee7ce27e8dab" - integrity sha512-HlXYJjFrNpjiV/GUKhri1UL8/bhlOIFFLpRF78YDSqq16x0+plIqx5CAvEusFcKTDpVfpeD5sfUHiKvP7euNFg== - -"@cosmostation/extension-client@^0.1.7": +"@cosmostation/extension-client@0.1.11", "@cosmostation/extension-client@^0.1.7": version "0.1.11" resolved "https://registry.yarnpkg.com/@cosmostation/extension-client/-/extension-client-0.1.11.tgz#d6b447cfd9cf7613ec485b57327819b14735cf13" integrity sha512-CkmNPmYn07UhP0z3PxGRRpgTcBJ/gS1ay/J2jfYsBi/4gnXvpQ3xOZdMU0qdxhFOjh1Xt7kflYsztk9ljMnJcw== -"@cosmostation/wc-modal@^0.0.1": - version "0.0.1" - resolved "https://registry.yarnpkg.com/@cosmostation/wc-modal/-/wc-modal-0.0.1.tgz#33a6001a426d24f05e31c8b68716cd5dcf92f922" - integrity sha512-Y88onIqSKzMzrSROI7myK+BON8AbfoMAXaTOftzboJ7Cfnj3+g43tZ4F6jWFA2zr9hQlnRYmYbcN39HlUxRYIg== - dependencies: - "@walletconnect/browser-utils" "^1.6.5" - "@walletconnect/types" "^1.6.5" - qrcode.react "^1.0.1" - react "^16.14.0" - react-dom "^16.14.0" +"@cosmostation/extension-client@^0.1.3": + version "0.1.15" + resolved "https://registry.yarnpkg.com/@cosmostation/extension-client/-/extension-client-0.1.15.tgz#cdc6d8fce42217704c1c0d5814f0ee7ce27e8dab" + integrity sha512-HlXYJjFrNpjiV/GUKhri1UL8/bhlOIFFLpRF78YDSqq16x0+plIqx5CAvEusFcKTDpVfpeD5sfUHiKvP7euNFg== "@cosmostation/wc-modal@^0.0.4": version "0.0.4" @@ -4595,19 +4625,20 @@ csstype@^3.0.10, csstype@^3.0.2, csstype@^3.1.1: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== -cudosjs@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/cudosjs/-/cudosjs-1.2.7.tgz#cf51f301e8e9c884eaaba122d3c5d68f2c80ee47" - integrity sha512-c2Pcfe2sQpdkbDzBnpF6eN0HfOEa1zpc49uW0OsHpdz1d9+01G0FuP3pun30znTonhwSE8E3myPTS8kXds0sVg== +cudosjs@1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/cudosjs/-/cudosjs-1.3.4.tgz#795112e900f9ff6355e624f74d6379cc08db571e" + integrity sha512-SdUYY/6P/vczJqx/Vq5ryY4kXqGl9LsaFXCFVB+6a17h+rMyP3gE8GffR7szVJyIDl+uLcczJ0ytWmx9RkX4/Q== dependencies: - "@cosmjs/cosmwasm-stargate" "^0.28.4" - "@cosmjs/crypto" "^0.28.4" - "@cosmjs/proto-signing" "^0.28.4" - "@cosmjs/stargate" "^0.28.4" - "@cosmjs/tendermint-rpc" "^0.28.4" + "@cosmjs/cosmwasm-stargate" "0.28.6" + "@cosmjs/crypto" "0.28.6" + "@cosmjs/proto-signing" "0.28.6" + "@cosmjs/stargate" "0.28.6" + "@cosmjs/tendermint-rpc" "0.28.6" "@cosmostation/cosmos-client" "^0.0.4" - "@cosmostation/extension-client" "^0.1.9" + "@cosmostation/extension-client" "0.1.11" "@keplr-wallet/cosmos" "^0.11.23" + bech32 "^2.0.0" bignumber.js "^9.0.2" detect-browser "^5.3.0" yarn "^1.22.19"