diff --git a/.env.example b/.env.example
index 0decfa7..a1eeca2 100644
--- a/.env.example
+++ b/.env.example
@@ -1,71 +1,16 @@
-# LOCAL
-VITE_APP_LOCAL_CAPTCHA_SITE_KEY=''
-VITE_APP_LOCAL_FAUCET_URL=''
-VITE_APP_LOCAL_FAUCET_ADDRESS=''
-VITE_APP_LOCAL_BRIDGE_URL=''
-VITE_APP_LOCAL_GRAPHQL_URL=''
-VITE_APP_LOCAL_GRAPHQL_WS=''
-VITE_APP_LOCAL_RPC=''
-VITE_APP_LOCAL_API=''
-VITE_APP_LOCAL_EXPLORER_URL=''
-VITE_APP_LOCAL_STAKING_URL=''
-VITE_APP_LOCAL_CHAIN_NAME=''
-VITE_APP_LOCAL_CHAIN_ID=''
-
-# DEV
-VITE_APP_DEV_CAPTCHA_SITE_KEY=''
-VITE_APP_DEV_FAUCET_URL=''
-VITE_APP_DEV_FAUCET_ADDRESS=''
-VITE_APP_DEV_BRIDGE_URL=''
-VITE_APP_DEV_GRAPHQL_URL=''
-VITE_APP_DEV_GRAPHQL_WS=''
-VITE_APP_DEV_RPC=''
-VITE_APP_DEV_API=''
-VITE_APP_DEV_EXPLORER_URL=''
-VITE_APP_DEV_STAKING_URL=''
-VITE_APP_DEV_CHAIN_NAME=''
-VITE_APP_DEV_CHAIN_ID=''
-
-# PRIVATE
-VITE_APP_PRIVATE_CAPTCHA_SITE_KEY=''
-VITE_APP_PRIVATE_FAUCET_URL=''
-VITE_APP_PRIVATE_FAUCET_ADDRESS=''
-VITE_APP_PRIVATE_BRIDGE_URL=''
-VITE_APP_PRIVATE_GRAPHQL_URL=''
-VITE_APP_PRIVATE_GRAPHQL_WS=''
-VITE_APP_PRIVATE_RPC=''
-VITE_APP_PRIVATE_API=''
-VITE_APP_PRIVATE_EXPLORER_URL=''
-VITE_APP_PRIVATE_STAKING_URL=''
-VITE_APP_PRIVATE_CHAIN_NAME=''
-VITE_APP_PRIVATE_CHAIN_ID=''
-
-# PUBLIC
-VITE_APP_PUBLIC_CAPTCHA_SITE_KEY=''
-VITE_APP_PUBLIC_FAUCET_URL=''
-VITE_APP_PUBLIC_FAUCET_ADDRESS=''
-VITE_APP_PUBLIC_BRIDGE_URL=''
-VITE_APP_PUBLIC_GRAPHQL_UR=''
-VITE_APP_PUBLIC_GRAPHQL_WS=''
-VITE_APP_PUBLIC_RPC=''
-VITE_APP_PUBLIC_API=''
-VITE_APP_PUBLIC_EXPLORER_URL=''
-VITE_APP_PUBLIC_STAKING_URL=''
-VITE_APP_PUBLIC_CHAIN_NAME=''
-VITE_APP_PUBLIC_CHAIN_ID=''
-
-# MAINNET
-VITE_APP_MAINNET_BRIDGE_URL=''
-VITE_APP_MAINNET_GRAPHQL_URL=''
-VITE_APP_MAINNET_GRAPHQL_WS=''
-VITE_APP_MAINNET_RPC=''
-VITE_APP_MAINNET_API=''
-VITE_APP_MAINNET_EXPLORER_URL=''
-VITE_APP_MAINNET_STAKING_URL=''
-VITE_APP_MAINNET_CHAIN_NAME=''
-VITE_APP_MAINNET_CHAIN_ID=''
-
-# GENERAL SETTINGS
-VITE_NODE_ENV='' #Production or empty
-VITE_APP_DEFAULT_NETWORK='' # LOCAL | PRIVATE | PUBLIC | MAINNET
+# APP SETTINGS
+VITE_APP_DEPLOYMENT_VERSION='' #v0.0.1 format
+VITE_APP_NODE_ENV='' #Production or empty
VITE_APP_GAS_PRICE=5000000000000
+VITE_APP_CAPTCHA_SITE_KEY=''
+VITE_APP_FAUCET_URL=''
+VITE_APP_FAUCET_ADDRESS=''
+VITE_APP_BRIDGE_URL=''
+VITE_APP_GRAPHQL_URL=''
+VITE_APP_GRAPHQL_WS=''
+VITE_APP_RPC=''
+VITE_APP_API=''
+VITE_APP_STAKING_URL=''
+VITE_APP_EXPLORER_URL=''
+VITE_APP_CHAIN_NAME=''
+VITE_APP_CHAIN_ID=''
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 6384559..45ea252 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -4,6 +4,14 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
+ {
+ "name": "Launch Edge",
+ "request": "launch",
+ "type": "pwa-msedge",
+ "url": "http://localhost:3000",
+ "webRoot": "${workspaceFolder}",
+ "userDataDir": false
+ },
{
"type": "pwa-chrome",
"request": "launch",
diff --git a/index.html b/index.html
index 6c4f905..96e382f 100644
--- a/index.html
+++ b/index.html
@@ -9,6 +9,10 @@
+
diff --git a/package.json b/package.json
index 26d59fc..769ca5b 100644
--- a/package.json
+++ b/package.json
@@ -22,9 +22,10 @@
"bech32": "^2.0.0",
"big.js": "^6.1.1",
"bignumber.js": "^9.0.2",
+ "buffer": "^6.0.3",
"copy-to-clipboard": "^3.3.1",
"cosmjs-types": "^0.4.1",
- "cudosjs": "^1.2.5",
+ "cudosjs": "^1.2.7",
"detect-browser": "^5.3.0",
"dompurify": "^2.3.8",
"graphql": "^16.3.0",
diff --git a/src/App.tsx b/src/App.tsx
index f55deeb..06a2181 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,14 +1,13 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
-import { useCallback, useEffect, useState } from 'react'
+import { useCallback, useEffect } from 'react'
import { ThemeProvider } from '@mui/material/styles'
import { useDispatch, useSelector } from 'react-redux'
import { Box, CssBaseline } from '@mui/material'
-import { ApolloClient, ApolloProvider, NormalizedCacheObject } from '@apollo/client'
+import { ApolloProvider } from '@apollo/client'
import { Routes, Route, useLocation, Navigate } from 'react-router-dom'
import { updateUser } from 'store/profile'
import { updateUserTransactions } from 'store/userTransactions'
import NotificationPopup from 'components/NotificationPopup'
-import CosmosNetworkConfig from 'ledgers/CosmosNetworkConfig'
import { switchLedgerType } from 'ledgers/utils'
import { connectUser } from './utils/projectUtils'
import { useApollo } from './graphql/client'
@@ -25,7 +24,7 @@ import theme from './theme'
import { RootState } from './store'
import '@fontsource/poppins'
-import { ApolloLinks, defaultApolloLinks } from 'graphql/helpers'
+import { defaultApolloLinks } from 'graphql/helpers'
import { CHAIN_DETAILS } from 'utils/constants'
import NetworkChangingLoading from 'components/NetworkChangeLoading'
import { networkLoadingStyles } from 'components/NetworkChangeLoading/styles'
@@ -35,22 +34,20 @@ const App = () => {
const location = useLocation()
const themeColor = useSelector((state: RootState) => state.settings.theme)
const newApolloClient = useApollo(null)
- const [currentApolloClient, setCurrentApolloClient] = useState>(
- newApolloClient(defaultApolloLinks)
- )
+ const isMainnet = CHAIN_DETAILS.CHAIN_ID === 'cudos-1'
+
const {
lastLoggedAddress,
- chosenNetwork: currentNetwork,
connectedLedger,
loadingState
} = useSelector((state: RootState) => state.profile)
const dispatch = useDispatch()
- const connectAccount = useCallback(async (chosenNetwork: string, walletName: SUPPORTED_WALLET) => {
+ const connectAccount = useCallback(async (walletName: SUPPORTED_WALLET) => {
try {
- const { address } = await switchLedgerType(chosenNetwork!, walletName)
+ const { address } = await switchLedgerType(walletName)
if (address !== lastLoggedAddress || lastLoggedAddress === '') {
dispatch(
updateUserTransactions({
@@ -62,7 +59,7 @@ const App = () => {
)
}
- const connectedUser = await connectUser(chosenNetwork, walletName)
+ const connectedUser = await connectUser(walletName)
dispatch(updateUser(connectedUser))
} catch (e) {
@@ -82,46 +79,27 @@ const App = () => {
})
)
- await connectAccount(currentNetwork, SUPPORTED_WALLET.Keplr)
+ await connectAccount(SUPPORTED_WALLET.Keplr)
})
if (isExtensionEnabled(SUPPORTED_WALLET.Cosmostation)) {
window.cosmostation.cosmos.on('accountChanged', async () => {
- await connectAccount(currentNetwork, SUPPORTED_WALLET.Cosmostation)
+ await connectAccount(SUPPORTED_WALLET.Cosmostation)
})
}
return () => {
window.removeEventListener('keplr_keystorechange', async () => {
- await connectAccount(currentNetwork, SUPPORTED_WALLET.Keplr)
+ await connectAccount(SUPPORTED_WALLET.Keplr)
})
window.removeEventListener('accountChanged', async () => {
- await connectAccount(currentNetwork, SUPPORTED_WALLET.Cosmostation)
+ await connectAccount(SUPPORTED_WALLET.Cosmostation)
})
}
}, [])
-
- useEffect(() => {
- dispatch(updateUser({ loadingState: true })
- )
- const newApolloLinks: ApolloLinks = {
- uri: CHAIN_DETAILS.GRAPHQL_URL[currentNetwork! as keyof typeof CHAIN_DETAILS.GRAPHQL_URL],
- url: CHAIN_DETAILS.GRAPHQL_WS[currentNetwork! as keyof typeof CHAIN_DETAILS.GRAPHQL_WS]
- }
-
- setCurrentApolloClient(newApolloClient(newApolloLinks))
-
- if (connectedLedger) {
- connectAccount(currentNetwork, connectedLedger)
- }
-
- setTimeout(() => { dispatch(updateUser({ loadingState: false })) }, 4000)
-
- }, [currentNetwork])
-
return (
-
+
{location.pathname !== '/' ? null : (
@@ -150,13 +128,11 @@ const App = () => {
} />
- {
- CHAIN_DETAILS.CHAIN_ID[currentNetwork! as keyof typeof CHAIN_DETAILS.CHAIN_ID]
- === CHAIN_DETAILS.CHAIN_ID.MAINNET ? null : (
-
- } />
-
- )}
+ {isMainnet ? null : (
+
+ } />
+
+ )}
} />
diff --git a/src/api/getAccountDelegations.ts b/src/api/getAccountDelegations.ts
index abba20c..2230112 100644
--- a/src/api/getAccountDelegations.ts
+++ b/src/api/getAccountDelegations.ts
@@ -3,7 +3,6 @@ import { CHAIN_DETAILS } from 'utils/constants'
import { AccountDelegationsDocument } from '../graphql/account_actions'
export const fetchDelegations = async (
- chosenNetwork: string,
address: string,
signal?: AbortSignal
) => {
@@ -11,7 +10,7 @@ export const fetchDelegations = async (
try {
const { data } = await axios.post(
- CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork! as keyof typeof CHAIN_DETAILS.GRAPHQL_URL].toString(),
+ CHAIN_DETAILS.GRAPHQL_URL,
{
variables: { address },
query: AccountDelegationsDocument
diff --git a/src/api/getAccountRedelegations.ts b/src/api/getAccountRedelegations.ts
index ec0915c..a4ddb36 100644
--- a/src/api/getAccountRedelegations.ts
+++ b/src/api/getAccountRedelegations.ts
@@ -4,7 +4,6 @@ import { CHAIN_DETAILS } from 'utils/constants'
import { AccountRedelegationsDocument } from '../graphql/account_actions'
export const fetchRedelegations = async (
- chosenNetwork: string,
address: string,
signal?: AbortSignal
) => {
@@ -16,7 +15,7 @@ export const fetchRedelegations = async (
try {
const { data } = await axios.post(
- CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork! as keyof typeof CHAIN_DETAILS.GRAPHQL_URL].toString(),
+ CHAIN_DETAILS.GRAPHQL_URL,
{
variables: { address },
query: AccountRedelegationsDocument
diff --git a/src/api/getAccountUndelegations.ts b/src/api/getAccountUndelegations.ts
index 55739f2..ddb5941 100644
--- a/src/api/getAccountUndelegations.ts
+++ b/src/api/getAccountUndelegations.ts
@@ -3,7 +3,6 @@ import { CHAIN_DETAILS } from 'utils/constants'
import { AccountUndelegationsDocument } from '../graphql/account_actions'
export const fetchUndedelegations = async (
- chosenNetwork: string,
address: string,
signal?: AbortSignal
) => {
@@ -15,7 +14,7 @@ export const fetchUndedelegations = async (
try {
const { data } = await axios.post(
- CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork! as keyof typeof CHAIN_DETAILS.GRAPHQL_URL].toString(),
+ CHAIN_DETAILS.GRAPHQL_URL,
{
variables: { address },
query: AccountUndelegationsDocument
diff --git a/src/api/getRewards.ts b/src/api/getRewards.ts
index 8d92dc8..a0ed657 100644
--- a/src/api/getRewards.ts
+++ b/src/api/getRewards.ts
@@ -5,13 +5,13 @@ import { formatBigNum } from '../utils/projectUtils'
import { AccountDelegationRewardsDocument } from '../graphql/account_actions'
import { CHAIN_DETAILS } from 'utils/constants'
-export const fetchRewards = async (chosenNetwork: string, address: string, signal?: AbortSignal) => {
+export const fetchRewards = async (address: string, signal?: AbortSignal) => {
const defaultReturnValue = new BigNumber(0)
const rewardArray: Array = []
const validatorArray: { address: string; amount: string }[] = []
try {
const { data } = await axios.post(
- CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork! as keyof typeof CHAIN_DETAILS.GRAPHQL_URL].toString(),
+ CHAIN_DETAILS.GRAPHQL_URL,
{
variables: { address },
query: AccountDelegationRewardsDocument
diff --git a/src/api/getUnbondingBalance.ts b/src/api/getUnbondingBalance.ts
index 64d458f..c7ce64f 100644
--- a/src/api/getUnbondingBalance.ts
+++ b/src/api/getUnbondingBalance.ts
@@ -5,7 +5,6 @@ import { formatBigNum } from 'utils/projectUtils'
import { AccountUnbondingBalanceDocument } from '../graphql/account_actions'
export const getUnbondingBalance = async (
- chosenNetwork: string,
address: string,
signal?: AbortSignal
) => {
@@ -14,7 +13,7 @@ export const getUnbondingBalance = async (
try {
const { data } = await axios.post(
- CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork! as keyof typeof CHAIN_DETAILS.GRAPHQL_URL]?.toString(),
+ CHAIN_DETAILS.GRAPHQL_URL,
{
variables: { address },
query: AccountUnbondingBalanceDocument
diff --git a/src/components/Dialog/components/DelegationModal/Delegation.tsx b/src/components/Dialog/components/DelegationModal/Delegation.tsx
index 7094072..d1d5913 100644
--- a/src/components/Dialog/components/DelegationModal/Delegation.tsx
+++ b/src/components/Dialog/components/DelegationModal/Delegation.tsx
@@ -58,7 +58,7 @@ const Delegation: React.FC = ({ modalProps, handleModal }) => {
const [delegationAmount, setDelegationAmount] = useState('')
const { validator, amount, fee } = modalProps
- const { address, connectedLedger, chosenNetwork } = useSelector(
+ const { address, connectedLedger } = useSelector(
({ profile }: RootState) => profile
)
const dispatch = useDispatch()
@@ -66,7 +66,7 @@ const Delegation: React.FC = ({ modalProps, handleModal }) => {
useEffect(() => {
let isMounted = true
const loadBalance = async () => {
- const client = await signingClient(chosenNetwork, connectedLedger!)
+ const client = await signingClient(connectedLedger!)
const walletBalance = await client.getBalance(
address,
@@ -104,7 +104,7 @@ const Delegation: React.FC = ({ modalProps, handleModal }) => {
value: msg
}
- const client = await signingClient(chosenNetwork, connectedLedger!)
+ const client = await signingClient(connectedLedger!)
const gasUsed = await client.simulate(address, [msgAny], 'memo')
@@ -162,7 +162,6 @@ const Delegation: React.FC = ({ modalProps, handleModal }) => {
try {
const delegationResult = await delegate(
- chosenNetwork,
address,
validator?.address || '',
amount || '',
@@ -176,13 +175,11 @@ const Delegation: React.FC = ({ modalProps, handleModal }) => {
txHash: delegationResult.transactionHash
})
- const walletBalance = await getWalletBalance(chosenNetwork!, address)
+ const walletBalance = await getWalletBalance(address)
const { delegationsArray } = await fetchDelegations(
- chosenNetwork!,
address
)
const stakedAmountBalance = await getStakedBalance(
- chosenNetwork!,
address
)
@@ -256,11 +253,7 @@ const Delegation: React.FC = ({ modalProps, handleModal }) => {
fontWeight={700}
color="primary.main"
>
- {
- CHAIN_DETAILS.CHAIN_NAME[
- chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_NAME
- ]
- }
+ {CHAIN_DETAILS.CHAIN_NAME}
diff --git a/src/components/Dialog/components/DelegationModal/Success.tsx b/src/components/Dialog/components/DelegationModal/Success.tsx
index accefe8..69d3dc9 100644
--- a/src/components/Dialog/components/DelegationModal/Success.tsx
+++ b/src/components/Dialog/components/DelegationModal/Success.tsx
@@ -4,8 +4,6 @@ import { DelegationModalProps, initialDelegationModalState } from 'store/modal'
import numeral from 'numeral'
import SuccessIcon from 'assets/vectors/success.svg'
import { ModalContainer, CancelRoundedIcon } from '../styles'
-import { RootState } from 'store'
-import { useSelector } from 'react-redux'
import { CHAIN_DETAILS } from 'utils/constants'
type SuccessProps = {
@@ -15,7 +13,6 @@ type SuccessProps = {
const Success: React.FC = ({ modalProps, handleModal }) => {
const { validator, gasUsed, txHash, fee } = modalProps
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
const handleClose = () => {
handleModal({
@@ -78,9 +75,7 @@ const Success: React.FC = ({ modalProps, handleModal }) => {
onClick={() =>
window
.open(
- `${
- CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]
- }/transactions/${txHash}`,
+ `${CHAIN_DETAILS.EXPLORER_URL}/transactions/${txHash}`,
'_blank'
)
?.focus()
diff --git a/src/components/Layout/Footer.tsx b/src/components/Layout/Footer.tsx
index ef56242..cab3287 100644
--- a/src/components/Layout/Footer.tsx
+++ b/src/components/Layout/Footer.tsx
@@ -8,6 +8,7 @@ import MediumIcon from 'assets/vectors/medium.svg?component'
import YouTubeIcon from 'assets/vectors/youtube.svg?component'
import FacebookIcon from 'assets/vectors/facebook.svg?component'
import SpotifyIcon from 'assets/vectors/spotify.svg?component'
+import { APP_DETAILS } from 'utils/constants'
import { styles } from './styles'
const linksLeft = [
@@ -17,7 +18,8 @@ const linksLeft = [
},
{ 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: `${APP_DETAILS.DEPLOYMENT_VERSION}`, url: `https://github.com/CudoVentures/cudos-dashboard/releases/tag/${APP_DETAILS.DEPLOYMENT_VERSION}` }
]
const linksRight = [
diff --git a/src/components/Layout/Header.tsx b/src/components/Layout/Header.tsx
index e6d9381..6c7e97b 100644
--- a/src/components/Layout/Header.tsx
+++ b/src/components/Layout/Header.tsx
@@ -19,8 +19,8 @@ const Header = () => {
const nagivate = useNavigate()
const isMidLowewRes = useMidLowerResCheck()
const isMidLowRes = useMidlowResCheck()
- const { chosenNetwork, loadingState } = useSelector((state: RootState) => state.profile)
- const isMainnet = CHAIN_DETAILS.CHAIN_ID[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_ID] === CHAIN_DETAILS.CHAIN_ID.MAINNET
+ const { loadingState } = useSelector((state: RootState) => state.profile)
+ const isMainnet = CHAIN_DETAILS.CHAIN_ID === 'cudos-1'
const isWelcomePage = location.pathname === '/'
const [logoComponent, setLogoComponent] = useState()
@@ -51,7 +51,7 @@ const Header = () => {
gap={1}
sx={headerStyles.linkHolder}
onClick={() => window
- .open(CHAIN_DETAILS.BRIDGE_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.BRIDGE_URL], '_blank')
+ .open(CHAIN_DETAILS.BRIDGE_URL, '_blank')
?.focus()}
>
diff --git a/src/components/Layout/LeftMenu.tsx b/src/components/Layout/LeftMenu.tsx
index d37d7d9..e638651 100644
--- a/src/components/Layout/LeftMenu.tsx
+++ b/src/components/Layout/LeftMenu.tsx
@@ -11,15 +11,15 @@ import { styles } from './styles'
const Menu = () => {
const [selected, setSelected] = useState(0)
const [menuItems, setMenuItems] = useState([])
- const { chosenNetwork, loadingState } = useSelector((state: RootState) => state.profile)
+ const { loadingState } = useSelector((state: RootState) => state.profile)
const { pathname } = useLocation()
const isScreenWidthLessThan1440px = useIsScreenLessThan('1440px', 'width')
useEffect(() => {
- setMenuItems(getMenuItems(chosenNetwork, loadingState))
+ setMenuItems(getMenuItems(loadingState))
- }, [chosenNetwork, loadingState])
+ }, [loadingState])
useEffect(() => {
diff --git a/src/components/Layout/NetworkInfo.tsx b/src/components/Layout/NetworkInfo.tsx
index fc9c0ae..17852e9 100644
--- a/src/components/Layout/NetworkInfo.tsx
+++ b/src/components/Layout/NetworkInfo.tsx
@@ -1,75 +1,20 @@
-import { useState } from 'react'
import { StyledNetwork, styles } from './networkStyles'
-import ArrowIcon from 'assets/vectors/arrow-down.svg?component'
import { CHAIN_DETAILS } from 'utils/constants'
import { COLORS_DARK_THEME } from 'theme/colors'
import GlobusIcon from 'assets/vectors/globus-icon.svg?component'
-import { Typography, Box, Collapse } from '@mui/material'
+import { Typography, Box } from '@mui/material'
import { RootState } from 'store'
-import { useDispatch, useSelector } from 'react-redux'
-import { handleAvailableNetworks } from 'utils/projectUtils'
-import { updateUser } from 'store/profile'
-import Card from 'components/Card'
-
-const NetworkLinkComponent = ({ network, setChosenNetwork }: {
- network: networkToDisplay,
- setChosenNetwork: (selectedNetwork: string) => void
-}): JSX.Element => {
-
- const [hovered, setHovered] = useState(false)
-
- return (
- setHovered(true)}
- onMouseOut={() => setHovered(false)}
- onClick={() => setChosenNetwork(network.SHORT_NAMES[0].toUpperCase())}
- >
-
-
- {network.ALIAS_NAME}
-
-
- )
-}
+import { useSelector } from 'react-redux'
+import { getChainPrettyName } from 'utils/projectUtils'
const NetworkInfo = () => {
- const dispatch = useDispatch()
- const [open, setOpen] = useState(false)
- const { chosenNetwork, loadingState } = useSelector((state: RootState) => state.profile)
- const aliasChainName = CHAIN_DETAILS[chosenNetwork as keyof typeof CHAIN_DETAILS].ALIAS_NAME
- const networksToDisplayInMenu = handleAvailableNetworks(CHAIN_DETAILS.DEFAULT_NETWORK)
-
- const setChosenNetwork = (selectedNetwork: string) => {
- dispatch(updateUser({ chosenNetwork: selectedNetwork }))
- setOpen(false)
- }
-
- // const collapsable = networksToDisplayInMenu.length > 1
- const collapsable = false
+ const { loadingState } = useSelector((state: RootState) => state.profile)
+ const aliasChainName = getChainPrettyName(CHAIN_DETAILS.CHAIN_ID)
return (
-
-
- { } : () => setOpen(true)}
- onMouseLeave={() => setOpen(false)}
- style={styles.userContainer}
- >
+
+
{
{aliasChainName}
}
- {collapsable ?
-
-
- : null}
- { } : () => setOpen(true)}
- onMouseLeave={() => setOpen(false)}
- style={{ marginTop: '-28px', zIndex: '-1' }}
- in={open}
- >
-
- {networksToDisplayInMenu.map((NETWORK, idx) => {
- return aliasChainName !== NETWORK.ALIAS_NAME ?
- : null
- })}
-
-
)
}
diff --git a/src/components/Layout/UserInfo.tsx b/src/components/Layout/UserInfo.tsx
index 68cd016..3a330b1 100644
--- a/src/components/Layout/UserInfo.tsx
+++ b/src/components/Layout/UserInfo.tsx
@@ -21,7 +21,7 @@ import { styles } from './styles'
const UserInfo = () => {
const navigate = useNavigate()
const dispatch = useDispatch()
- const { address, accountName, connectedLedger, chosenNetwork } = useSelector(
+ const { address, accountName, connectedLedger } = useSelector(
(state: RootState) => state.profile
)
@@ -38,7 +38,7 @@ const UserInfo = () => {
}
const handleExplorer = () => {
- window.open(`${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL].toString()}`, '_blank')
+ window.open(`${CHAIN_DETAILS.EXPLORER_URL}`, '_blank')
}
const handleDisconnect = () => {
@@ -54,8 +54,7 @@ const UserInfo = () => {
delegations: [],
redelegations: [],
undelegations: [],
- connectedLedger: '',
- chosenNetwork: CHAIN_DETAILS.DEFAULT_NETWORK
+ connectedLedger: ''
})
)
navigate('/')
diff --git a/src/components/Layout/menuHelpers.tsx b/src/components/Layout/menuHelpers.tsx
index 38417ce..c62e272 100644
--- a/src/components/Layout/menuHelpers.tsx
+++ b/src/components/Layout/menuHelpers.tsx
@@ -10,7 +10,7 @@ export interface MenuItems {
text: string;
}
-export const getMenuItems = (chosenNetwork: string, loadingState: boolean): MenuItems[] => {
+export const getMenuItems = (loadingState: boolean): MenuItems[] => {
const MenuItems = [
{ icon: , link: '/dashboard', text: 'Dashboard' },
@@ -18,8 +18,8 @@ export const getMenuItems = (chosenNetwork: string, loadingState: boolean): Menu
{ icon: , link: '/proposals', text: 'Proposals' },
]
- if (CHAIN_DETAILS.CHAIN_ID[chosenNetwork! as keyof typeof CHAIN_DETAILS.CHAIN_ID]
- !== CHAIN_DETAILS.CHAIN_ID.MAINNET && !loadingState) {
+ if (CHAIN_DETAILS.CHAIN_ID
+ !== 'cudos-1' && !loadingState) {
MenuItems.push({ icon: , link: '/faucet', text: 'Faucet' })
}
diff --git a/src/components/NetworkChangeLoading/index.tsx b/src/components/NetworkChangeLoading/index.tsx
index eaaccfe..ec64e92 100644
--- a/src/components/NetworkChangeLoading/index.tsx
+++ b/src/components/NetworkChangeLoading/index.tsx
@@ -1,13 +1,11 @@
import { Box, CircularProgress, Typography } from "@mui/material"
import { Fragment } from "react"
-import { useSelector } from "react-redux"
-import { RootState } from "store"
import { CHAIN_DETAILS } from "utils/constants"
+import { getChainPrettyName } from "utils/projectUtils"
const NetworkChangingLoading = () => {
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
- const aliasChainName = CHAIN_DETAILS[chosenNetwork as keyof typeof CHAIN_DETAILS].ALIAS_NAME
+ const aliasChainName = getChainPrettyName(CHAIN_DETAILS.CHAIN_ID)
return (
diff --git a/src/containers/ConnectWallet/ConnectWallet.tsx b/src/containers/ConnectWallet/ConnectWallet.tsx
index 11e1833..957e98d 100644
--- a/src/containers/ConnectWallet/ConnectWallet.tsx
+++ b/src/containers/ConnectWallet/ConnectWallet.tsx
@@ -36,7 +36,7 @@ import { styles } from './styles'
const ConnectWallet = () => {
const dispatch = useDispatch()
const navigate = useNavigate()
- const { lastLoggedAddress, chosenNetwork: currentNetwork } = useSelector((state: RootState) => state.profile)
+ const { lastLoggedAddress } = useSelector((state: RootState) => state.profile)
const { setWarning } = useNotifications()
const [loading, setLoading] = useState(new Map())
const [userBrowser, setUserBrowser] = useState(undefined)
@@ -47,18 +47,18 @@ const ConnectWallet = () => {
}
}
- const connect = async (chosenNetwork: string, walletName: SUPPORTED_WALLET) => {
+ const connect = async (walletName: SUPPORTED_WALLET) => {
try {
setLoading(new Map(loading.set(walletName, true)))
await delay(1000)
- const { address } = await switchLedgerType(chosenNetwork, walletName)
+ const { address } = await switchLedgerType(walletName)
if (address !== lastLoggedAddress) {
dispatch(updateUserTransactions({ offsetCount: 0, data: [] }))
}
- const connectedUser = await connectUser(chosenNetwork, walletName)
+ const connectedUser = await connectUser(walletName)
dispatch(updateUser(connectedUser))
navigate('dashboard')
@@ -75,7 +75,7 @@ const ConnectWallet = () => {
const click = (walletName: SUPPORTED_WALLET) => {
if (isExtensionEnabled(walletName)) {
- connect(currentNetwork, walletName)
+ connect(walletName)
return
}
@@ -178,9 +178,9 @@ const ConnectWallet = () => {
order to continue you need to connect your Keplr Wallet.
- {getSupportedWallets().map((wallet) => {
+ {getSupportedWallets().map((wallet, idx) => {
return (
-
+
diff --git a/src/containers/Dashboard/WalletInformation/components/ClaimRewardsModal/Success.tsx b/src/containers/Dashboard/WalletInformation/components/ClaimRewardsModal/Success.tsx
index 49cc6ac..8702c0b 100644
--- a/src/containers/Dashboard/WalletInformation/components/ClaimRewardsModal/Success.tsx
+++ b/src/containers/Dashboard/WalletInformation/components/ClaimRewardsModal/Success.tsx
@@ -19,8 +19,6 @@ type SuccessProps = {
const Success: React.FC = ({ modalProps, handleModal }) => {
const { gasUsed, txHash, fee, txRestakeHash } = modalProps
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
-
const handleClose = () => {
handleModal({
...initialRewardsModalProps
@@ -80,10 +78,7 @@ const Success: React.FC = ({ modalProps, handleModal }) => {
sx={{ textDecoration: 'underline' }}
onClick={() =>
window
- .open(
- `${
- CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]
- }/transactions/${txHash}`,
+ .open(`${CHAIN_DETAILS.EXPLORER_URL}/transactions/${txHash}`,
'_blank'
)
?.focus()
@@ -111,10 +106,7 @@ const Success: React.FC = ({ modalProps, handleModal }) => {
sx={{ textDecoration: 'underline' }}
onClick={() =>
window
- .open(
- `${
- CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]
- }/transactions/${txRestakeHash}`,
+ .open(`${CHAIN_DETAILS.EXPLORER_URL}/transactions/${txRestakeHash}`,
'_blank'
)
?.focus()
diff --git a/src/containers/Dashboard/WalletInformation/index.tsx b/src/containers/Dashboard/WalletInformation/index.tsx
index 886724b..78d66ff 100644
--- a/src/containers/Dashboard/WalletInformation/index.tsx
+++ b/src/containers/Dashboard/WalletInformation/index.tsx
@@ -49,8 +49,7 @@ const WalletInformation: React.FC = () => {
unbondingBalance,
address,
stakedValidators,
- lastLoggedAddress,
- chosenNetwork
+ lastLoggedAddress
} = state
const dispatch = useDispatch()
const { setError } = useNotifications()
@@ -80,13 +79,12 @@ const WalletInformation: React.FC = () => {
const fetchData = async () => {
try {
const { totalRewards, validatorArray } = await fetchRewards(
- chosenNetwork!,
address,
controller.signal
)
- const walletBalance = await getWalletBalance(chosenNetwork!, address)
- const stakedAmountBalance = await getStakedBalance(chosenNetwork!, address)
- const { unbondingBalance } = await getUnbondingBalance(chosenNetwork!, address)
+ const walletBalance = await getWalletBalance(address)
+ const stakedAmountBalance = await getStakedBalance(address)
+ const { unbondingBalance } = await getUnbondingBalance(address)
dispatch(
updateUser({
@@ -110,7 +108,7 @@ const WalletInformation: React.FC = () => {
clearInterval(timer)
controller?.abort()
}
- }, [address, dispatch, lastLoggedAddress, chosenNetwork])
+ }, [address, dispatch, lastLoggedAddress])
return (
{
title="Go to Explorer"
onClick={() =>
window
- .open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]
- }/accounts/${address}`,
+ .open(`${CHAIN_DETAILS.EXPLORER_URL}/accounts/${address}`,
'_blank'
)
?.focus()
diff --git a/src/containers/Faucet/components/Activity/hooks.ts b/src/containers/Faucet/components/Activity/hooks.ts
index 1216059..44ad18e 100644
--- a/src/containers/Faucet/components/Activity/hooks.ts
+++ b/src/containers/Faucet/components/Activity/hooks.ts
@@ -5,14 +5,11 @@ import {
useGetMessagesByAddressQuery
} from 'graphql/types'
import { ActivityState } from './types'
-import { useSelector } from 'react-redux'
-import { RootState } from 'store'
import { CHAIN_DETAILS } from 'utils/constants'
const LIMIT = 50
export const useActivity = () => {
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
const [state, setState] = useState({
items: [],
loading: false
@@ -48,7 +45,7 @@ export const useActivity = () => {
}
})
.filter(
- (item: any) => item.address !== CHAIN_DETAILS.FAUCET_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.FAUCET_ADDRESS]
+ (item: any) => item.address !== CHAIN_DETAILS.FAUCET_ADDRESS
)
return formattedItems
@@ -58,7 +55,7 @@ export const useActivity = () => {
variables: {
limit: LIMIT,
offset: 0,
- address: `{${CHAIN_DETAILS.FAUCET_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.FAUCET_ADDRESS]}}`,
+ address: `{${CHAIN_DETAILS.FAUCET_ADDRESS}}`,
types: `{cosmos.bank.v1beta1.MsgSend}`
},
onCompleted: (data: any) => {
@@ -77,7 +74,7 @@ export const useActivity = () => {
variables: {
limit: LIMIT + 1,
offset: 0,
- address: `{${CHAIN_DETAILS.FAUCET_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.FAUCET_ADDRESS]}}`
+ address: `{${CHAIN_DETAILS.FAUCET_ADDRESS}}`
},
updateQuery: (prev, { subscriptionData }) => {
if (!subscriptionData.data) return prev
diff --git a/src/containers/Faucet/components/Form/index.tsx b/src/containers/Faucet/components/Form/index.tsx
index cf27efd..2931246 100644
--- a/src/containers/Faucet/components/Form/index.tsx
+++ b/src/containers/Faucet/components/Form/index.tsx
@@ -12,8 +12,6 @@ import { isValidCudosAddress } from 'utils/projectUtils'
import useModal from '../FaucetModal/hooks'
import { styles } from './styles'
import { CHAIN_DETAILS } from 'utils/constants'
-import { useSelector } from 'react-redux'
-import { RootState } from 'store'
const Form = () => {
const captchaRef = useRef(null)
@@ -21,7 +19,6 @@ const Form = () => {
const [amount, setAmount] = useState('')
const [validatedCaptcha, setValidatedCaptcha] = useState(false)
const { setWarning } = useNotifications()
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
const maxAmountAllowed: number = 100
const { handleModal } = useModal()
@@ -85,7 +82,7 @@ const Form = () => {
handleModal({ open: true, status: ModalStatus.LOADING })
const response = await getFaucetTokens(
- CHAIN_DETAILS.FAUCET_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.FAUCET_URL],
+ CHAIN_DETAILS.FAUCET_URL,
data
)
@@ -103,6 +100,7 @@ const Form = () => {
}
captchaRef.current.reset()
+ checkCaptcha()
setAmount('')
} catch (error) {
handleModal({
@@ -114,6 +112,7 @@ const Form = () => {
}
})
captchaRef.current.reset()
+ checkCaptcha()
}
}
@@ -182,7 +181,7 @@ const Form = () => {
theme="dark"
ref={captchaRef}
onChange={checkCaptcha}
- sitekey={CHAIN_DETAILS.CAPTCHA_SITE_KEY[chosenNetwork as keyof typeof CHAIN_DETAILS.CAPTCHA_SITE_KEY]}
+ sitekey={CHAIN_DETAILS.CAPTCHA_SITE_KEY}
/>
diff --git a/src/containers/Proposals/Proposal.tsx b/src/containers/Proposals/Proposal.tsx
index 3e54986..9ba4583 100644
--- a/src/containers/Proposals/Proposal.tsx
+++ b/src/containers/Proposals/Proposal.tsx
@@ -27,7 +27,6 @@ import { styles } from './styles'
const Proposal = () => {
const proposalState = useSelector((state: RootState) => state.proposals)
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
const [searchResults, setSearchResults] = useState(proposalState)
const { handleModal: handleVotingModal } = useVotingModal()
const { handleModal: handleDepositModal } = useDepositModal()
@@ -36,7 +35,7 @@ const Proposal = () => {
const handleExplorer = (address: string) => {
window.open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL].toString()}/accounts/${address}`,
+ `${CHAIN_DETAILS.EXPLORER_URL}/accounts/${address}`,
'_blank'
)
}
diff --git a/src/containers/Proposals/ProposalDetails/components/ProposalInformation/index.tsx b/src/containers/Proposals/ProposalDetails/components/ProposalInformation/index.tsx
index 910c7e4..598e47e 100644
--- a/src/containers/Proposals/ProposalDetails/components/ProposalInformation/index.tsx
+++ b/src/containers/Proposals/ProposalDetails/components/ProposalInformation/index.tsx
@@ -25,13 +25,12 @@ interface Change {
const ProposalInformation = () => {
const { overview } = useSelector((state: RootState) => state.proposalDetails)
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
const { handleModal: handleVotingModal } = useVotingModal()
const { handleModal: handleDepositModal } = useDepositModal()
const handleExplorer = (address: string) => {
window.open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]?.toString()}/accounts/${address}`,
+ `${CHAIN_DETAILS.EXPLORER_URL}/accounts/${address}`,
'_blank'
)
}
diff --git a/src/containers/Proposals/ProposalDetails/components/VotingStatistics/hooks.ts b/src/containers/Proposals/ProposalDetails/components/VotingStatistics/hooks.ts
index 1b52df1..1f306ed 100644
--- a/src/containers/Proposals/ProposalDetails/components/VotingStatistics/hooks.ts
+++ b/src/containers/Proposals/ProposalDetails/components/VotingStatistics/hooks.ts
@@ -6,11 +6,8 @@ import { ProposalDetailsVotesWeightedDocument } from 'graphql/proposal_details_v
import { useParams } from 'react-router-dom'
import { VoteState } from './types'
import { CHAIN_DETAILS } from 'utils/constants'
-import { RootState } from 'store'
-import { useSelector } from 'react-redux'
export const useVotingStatistics = (resetPagination: any) => {
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
const { proposalId } = useParams()
const [state, setState] = useState({
data: [],
@@ -38,8 +35,8 @@ export const useVotingStatistics = (resetPagination: any) => {
})
}
- const fetchWeightedVotes = async (chosenNetwork: string) => {
- return axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const fetchWeightedVotes = async () => {
+ return axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
proposalId
},
@@ -159,7 +156,7 @@ export const useVotingStatistics = (resetPagination: any) => {
proposalId: Number(proposalId)
},
onSubscriptionData: (data) => {
- fetchWeightedVotes(chosenNetwork).then((votesWeightedData) => {
+ fetchWeightedVotes().then((votesWeightedData) => {
const mergedVotesData = mergeRegularVotesWithWeighted(
data.subscriptionData.data?.proposalVote,
votesWeightedData
diff --git a/src/containers/Proposals/components/DepositModal/Deposit.tsx b/src/containers/Proposals/components/DepositModal/Deposit.tsx
index 2f105d4..4457427 100644
--- a/src/containers/Proposals/components/DepositModal/Deposit.tsx
+++ b/src/containers/Proposals/components/DepositModal/Deposit.tsx
@@ -22,7 +22,7 @@ type DepositProps = {
const Deposit: React.FC = ({ handleModal, modalProps }) => {
const [depositAmount, setDepositAmount] = useState('')
- const { address, balance, connectedLedger, chosenNetwork } = useSelector(
+ const { address, balance, connectedLedger } = useSelector(
(state: RootState) => state.profile
)
@@ -47,7 +47,6 @@ const Deposit: React.FC = ({ handleModal, modalProps }) => {
})
const { gasFee, result } = await depositProposal(
- chosenNetwork,
depositorAddress,
proposalId,
amount,
@@ -64,7 +63,7 @@ const Deposit: React.FC = ({ handleModal, modalProps }) => {
hash: result.transactionHash
})
- const walletBalance = await getWalletBalance(chosenNetwork!, address)
+ const walletBalance = await getWalletBalance(address)
dispatch(
updateUser({
diff --git a/src/containers/Proposals/components/DepositModal/Success.tsx b/src/containers/Proposals/components/DepositModal/Success.tsx
index 9be413b..bd8188e 100644
--- a/src/containers/Proposals/components/DepositModal/Success.tsx
+++ b/src/containers/Proposals/components/DepositModal/Success.tsx
@@ -17,7 +17,7 @@ type SuccessProps = {
}
const Success: React.FC = ({ modalProps, handleModal }) => {
- const { address, chosenNetwork } = useSelector(({ profile }: RootState) => profile)
+ const { address } = useSelector(({ profile }: RootState) => profile)
const { title, id, fee, hash, amount } = modalProps
const handleClose = () => {
@@ -91,10 +91,7 @@ const Success: React.FC = ({ modalProps, handleModal }) => {
sx={{ textDecoration: 'underline' }}
onClick={() =>
window
- .open(
- `${
- CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]
- }/transactions/${hash}`,
+ .open(`${CHAIN_DETAILS.EXPLORER_URL}/transactions/${hash}`,
'_blank'
)
?.focus()
diff --git a/src/containers/Proposals/components/ProposalModal/Proposals.tsx b/src/containers/Proposals/components/ProposalModal/Proposals.tsx
index 69c8835..1363a82 100644
--- a/src/containers/Proposals/components/ProposalModal/Proposals.tsx
+++ b/src/containers/Proposals/components/ProposalModal/Proposals.tsx
@@ -34,7 +34,7 @@ type ProposalProps = {
const Proposals: React.FC = ({ handleModal, modalProps }) => {
const { setError } = useNotifications()
- const { address, connectedLedger, chosenNetwork } = useSelector(
+ const { address, connectedLedger } = useSelector(
({ profile }: RootState) => profile
)
@@ -96,7 +96,6 @@ const Proposals: React.FC = ({ handleModal, modalProps }) => {
}
})
const { result, gasFee } = await createProposal(
- chosenNetwork,
proposalData,
proposerAddress,
connectedLedger!
@@ -108,7 +107,7 @@ const Proposals: React.FC = ({ handleModal, modalProps }) => {
hash: result.transactionHash
})
- const walletBalance = await getWalletBalance(chosenNetwork!, address)
+ const walletBalance = await getWalletBalance(address)
dispatch(
updateUser({
@@ -170,7 +169,7 @@ const Proposals: React.FC = ({ handleModal, modalProps }) => {
Network
- {CHAIN_DETAILS.CHAIN_NAME[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_NAME]}
+ {CHAIN_DETAILS.CHAIN_NAME}
diff --git a/src/containers/Proposals/components/ProposalModal/Success.tsx b/src/containers/Proposals/components/ProposalModal/Success.tsx
index aaaaeaa..dad937b 100644
--- a/src/containers/Proposals/components/ProposalModal/Success.tsx
+++ b/src/containers/Proposals/components/ProposalModal/Success.tsx
@@ -17,7 +17,7 @@ type SuccessProps = {
}
const Success: React.FC = ({ modalProps, handleModal }) => {
- const { address, chosenNetwork } = useSelector(({ profile }: RootState) => profile)
+ const { address } = useSelector(({ profile }: RootState) => profile)
const { fee, hash, proposalData } = modalProps
@@ -117,10 +117,7 @@ const Success: React.FC = ({ modalProps, handleModal }) => {
sx={{ textDecoration: 'underline' }}
onClick={() =>
window
- .open(
- `${
- CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]
- }/transactions/${hash}`,
+ .open(`${CHAIN_DETAILS.EXPLORER_URL}/transactions/${hash}`,
'_blank'
)
?.focus()
diff --git a/src/containers/Proposals/components/VotingModal/Success.tsx b/src/containers/Proposals/components/VotingModal/Success.tsx
index bba5133..651ee31 100644
--- a/src/containers/Proposals/components/VotingModal/Success.tsx
+++ b/src/containers/Proposals/components/VotingModal/Success.tsx
@@ -17,7 +17,7 @@ type SuccessProps = {
}
const Success: React.FC = ({ modalProps, handleModal }) => {
- const { address, chosenNetwork } = useSelector(({ profile }: RootState) => profile)
+ const { address } = useSelector(({ profile }: RootState) => profile)
const { type, title, id, fee, hash } = modalProps
const handleClose = () => {
@@ -106,10 +106,7 @@ const Success: React.FC = ({ modalProps, handleModal }) => {
sx={{ textDecoration: 'underline' }}
onClick={() =>
window
- .open(
- `${
- CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]
- }/transactions/${hash}`,
+ .open(`${CHAIN_DETAILS.EXPLORER_URL}/transactions/${hash}`,
'_blank'
)
?.focus()
diff --git a/src/containers/Proposals/components/VotingModal/Vote.tsx b/src/containers/Proposals/components/VotingModal/Vote.tsx
index ea84e06..99eadda 100644
--- a/src/containers/Proposals/components/VotingModal/Vote.tsx
+++ b/src/containers/Proposals/components/VotingModal/Vote.tsx
@@ -23,7 +23,7 @@ const Vote: React.FC = ({ handleModal, modalProps }) => {
const { id, title } = modalProps
- const { address, connectedLedger, chosenNetwork } = useSelector(
+ const { address, connectedLedger } = useSelector(
(state: RootState) => state.profile
)
@@ -38,7 +38,6 @@ const Vote: React.FC = ({ handleModal, modalProps }) => {
})
const { gasFee, result } = await voteProposal(
- chosenNetwork,
voterAddress,
proposalId,
votingOption,
diff --git a/src/containers/ValidatorDetails/components/Activity/components/Table/index.tsx b/src/containers/ValidatorDetails/components/Activity/components/Table/index.tsx
index e14f3ef..630f00b 100644
--- a/src/containers/ValidatorDetails/components/Activity/components/Table/index.tsx
+++ b/src/containers/ValidatorDetails/components/Activity/components/Table/index.tsx
@@ -12,8 +12,6 @@ import getMiddleEllipsis from 'utils/get_middle_ellipsis'
import { defaultMessages, unknownMessage } from 'ledgers/utils'
import numeral from 'numeral'
import { columns } from './utils'
-import { RootState } from 'store'
-import { useSelector } from 'react-redux'
import { CHAIN_DETAILS } from 'utils/constants'
type ActivityTableProps = {
@@ -31,8 +29,6 @@ const ActivityTable: React.FC = ({
hasNextPage = false,
isNextPageLoading = false
}) => {
-
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
const handleScroll = async (e: React.UIEvent) => {
const { scrollHeight, scrollTop, clientHeight } = e.currentTarget
@@ -64,7 +60,7 @@ const ActivityTable: React.FC = ({
onClick={() =>
window
.open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]}/blocks/${tx.height}`,
+ `${CHAIN_DETAILS.EXPLORER_URL}/blocks/${tx.height}`,
'_blank'
)
?.focus()
@@ -85,7 +81,7 @@ const ActivityTable: React.FC = ({
onClick={() =>
window
.open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]}/transactions/${
+ `${CHAIN_DETAILS.EXPLORER_URL}/transactions/${
tx.hash
}`,
'_blank'
diff --git a/src/containers/ValidatorDetails/components/Delegators/components/Delegations/index.tsx b/src/containers/ValidatorDetails/components/Delegators/components/Delegations/index.tsx
index 34f34c9..bcccccd 100644
--- a/src/containers/ValidatorDetails/components/Delegators/components/Delegations/index.tsx
+++ b/src/containers/ValidatorDetails/components/Delegators/components/Delegations/index.tsx
@@ -14,8 +14,6 @@ import CudosLogo from 'assets/vectors/cudos-logo.svg'
import NoData from 'components/NoData'
import { DelegationsType, DelegationType } from '../../types'
import { delegationsColumns } from '../../utils'
-import { useSelector } from 'react-redux'
-import { RootState } from 'store'
import { CHAIN_DETAILS } from 'utils/constants'
type DelegationsProps = {
@@ -26,8 +24,6 @@ type DelegationsProps = {
const Delegations: React.FC = (props) => {
const { delegations, handlePageCallback } = props
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
-
const { page, rowsPerPage, handleChangePage } = usePagination({
pageChangeCallback: handlePageCallback
})
@@ -53,7 +49,7 @@ const Delegations: React.FC = (props) => {
onClick={() =>
window
.open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]}/accounts/${
+ `${CHAIN_DETAILS.EXPLORER_URL}/accounts/${
item.address
}`,
'_blank'
diff --git a/src/containers/ValidatorDetails/components/Delegators/components/Redelegations/index.tsx b/src/containers/ValidatorDetails/components/Delegators/components/Redelegations/index.tsx
index 20b4042..b4f28c8 100644
--- a/src/containers/ValidatorDetails/components/Delegators/components/Redelegations/index.tsx
+++ b/src/containers/ValidatorDetails/components/Delegators/components/Redelegations/index.tsx
@@ -18,8 +18,6 @@ import NoData from 'components/NoData'
import { RedelegationsType, RedelegationType } from '../../types'
import { redelegationsColumns } from '../../utils'
import { CHAIN_DETAILS } from 'utils/constants'
-import { useSelector } from 'react-redux'
-import { RootState } from 'store'
type RedelegationsProps = {
redelegations: RedelegationsType
@@ -29,8 +27,6 @@ type RedelegationsProps = {
const Redelegations: React.FC = (props) => {
const { redelegations, handlePageCallback } = props
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
-
const { page, rowsPerPage, handleChangePage } = usePagination({
pageChangeCallback: handlePageCallback
})
@@ -56,7 +52,7 @@ const Redelegations: React.FC = (props) => {
onClick={() =>
window
.open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]}/accounts/${
+ `${CHAIN_DETAILS.EXPLORER_URL}/accounts/${
item.address
}`,
'_blank'
@@ -82,7 +78,7 @@ const Redelegations: React.FC = (props) => {
onClick={() =>
window
.open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]}/validators/${item.to}`,
+ `${CHAIN_DETAILS.EXPLORER_URL}/validators/${item.to}`,
'_blank'
)
?.focus()
diff --git a/src/containers/ValidatorDetails/components/Delegators/components/Unbondings/index.tsx b/src/containers/ValidatorDetails/components/Delegators/components/Unbondings/index.tsx
index a4f90c2..c761a95 100644
--- a/src/containers/ValidatorDetails/components/Delegators/components/Unbondings/index.tsx
+++ b/src/containers/ValidatorDetails/components/Delegators/components/Unbondings/index.tsx
@@ -17,8 +17,6 @@ import NoData from 'components/NoData'
import { UnbondingsType, UnbondingType } from '../../types'
import { unbondingsColumns } from '../../utils'
import { CHAIN_DETAILS } from 'utils/constants'
-import { RootState } from 'store'
-import { useSelector } from 'react-redux'
type UnbondingsProps = {
unbondings: UnbondingsType
@@ -28,8 +26,6 @@ type UnbondingsProps = {
const Unbondings: React.FC = (props) => {
const { unbondings, handlePageCallback } = props
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
-
const { page, rowsPerPage, handleChangePage } = usePagination({
pageChangeCallback: handlePageCallback
})
@@ -55,7 +51,7 @@ const Unbondings: React.FC = (props) => {
onClick={() =>
window
.open(
- `${CHAIN_DETAILS.EXPLORER_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL]}/accounts/${
+ `${CHAIN_DETAILS.EXPLORER_URL}/accounts/${
item.address
}`,
'_blank'
diff --git a/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/components/RedelegationModal/Redelegation.tsx b/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/components/RedelegationModal/Redelegation.tsx
index d33ca3c..25374ab 100644
--- a/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/components/RedelegationModal/Redelegation.tsx
+++ b/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/components/RedelegationModal/Redelegation.tsx
@@ -52,7 +52,7 @@ const Redelegation: React.FC = ({
const { validator, amount, fee } = modalProps
const dispatch = useDispatch()
- const { address, connectedLedger, chosenNetwork } = useSelector(
+ const { address, connectedLedger } = useSelector(
({ profile }: RootState) => profile
)
const validators = useSelector(({ validator }: RootState) => validator.items)
@@ -87,7 +87,7 @@ const Redelegation: React.FC = ({
useEffect(() => {
const loadBalance = async () => {
- const client = await signingClient(chosenNetwork, connectedLedger!)
+ const client = await signingClient(connectedLedger!)
const walletBalance = await client.getDelegation(
address,
@@ -128,7 +128,7 @@ const Redelegation: React.FC = ({
value: msg
}
- const client = await signingClient(chosenNetwork, connectedLedger!)
+ const client = await signingClient(connectedLedger!)
const gasUsed = await client.simulate(address, [msgAny], 'memo')
@@ -174,7 +174,7 @@ const Redelegation: React.FC = ({
value: msg
}
- const client = await signingClient(chosenNetwork, connectedLedger!)
+ const client = await signingClient(connectedLedger!)
const gasUsed = await client.simulate(address, [msgAny], 'memo')
@@ -221,7 +221,6 @@ const Redelegation: React.FC = ({
try {
const redelegationResult = await redelegate(
- chosenNetwork,
address,
validator?.address || '',
redelegationAddress,
@@ -236,7 +235,7 @@ const Redelegation: React.FC = ({
txHash: redelegationResult.transactionHash
})
- const { redelegationsArray } = await fetchRedelegations(chosenNetwork!, address)
+ const { redelegationsArray } = await fetchRedelegations(address)
dispatch(
updateUser({
redelegations: redelegationsArray
@@ -302,7 +301,7 @@ const Redelegation: React.FC = ({
fontWeight={700}
color="primary.main"
>
- {CHAIN_DETAILS.CHAIN_NAME[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_NAME]}
+ {CHAIN_DETAILS.CHAIN_NAME}
diff --git a/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/components/UndelegationModal/Undelegation.tsx b/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/components/UndelegationModal/Undelegation.tsx
index ef4af84..46dfa57 100644
--- a/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/components/UndelegationModal/Undelegation.tsx
+++ b/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/components/UndelegationModal/Undelegation.tsx
@@ -50,13 +50,13 @@ const Undelegation: React.FC = ({
const { validator, amount, fee } = modalProps
const dispatch = useDispatch()
- const { address, connectedLedger, chosenNetwork } = useSelector(
+ const { address, connectedLedger } = useSelector(
({ profile }: RootState) => profile
)
useEffect(() => {
const loadBalance = async () => {
- const client = await signingClient(chosenNetwork, connectedLedger!)
+ const client = await signingClient(connectedLedger!)
const walletBalance = await client.getDelegation(
address,
@@ -91,7 +91,7 @@ const Undelegation: React.FC = ({
value: msg
}
- const client = await signingClient(chosenNetwork, connectedLedger!)
+ const client = await signingClient(connectedLedger!)
const gasUsed = await client.simulate(address, [msgAny], 'memo')
@@ -136,7 +136,7 @@ const Undelegation: React.FC = ({
value: msg
}
- const client = await signingClient(chosenNetwork, connectedLedger!)
+ const client = await signingClient(connectedLedger!)
const gasUsed = await client.simulate(address, [msgAny], 'memo')
@@ -172,7 +172,6 @@ const Undelegation: React.FC = ({
try {
const undelegationResult = await undelegate(
- chosenNetwork,
address,
validator?.address || '',
amount || '',
@@ -185,7 +184,7 @@ const Undelegation: React.FC = ({
gasUsed: undelegationResult.gasUsed,
txHash: undelegationResult.transactionHash
})
- const { undelegationsArray } = await fetchUndedelegations(chosenNetwork!, address)
+ const { undelegationsArray } = await fetchUndedelegations(address)
dispatch(
updateUser({
undelegations: undelegationsArray
@@ -254,7 +253,7 @@ const Undelegation: React.FC = ({
fontWeight={700}
color="primary.main"
>
- {CHAIN_DETAILS.CHAIN_NAME[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_NAME]}
+ {CHAIN_DETAILS.CHAIN_NAME}
diff --git a/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/index.tsx b/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/index.tsx
index 217d0f7..d157e5d 100644
--- a/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/index.tsx
+++ b/src/containers/ValidatorDetails/components/Details/components/ValidatorInfo/index.tsx
@@ -46,7 +46,7 @@ type InfoProps = {
const ValidatorInfo: React.FC = ({ overview, status }) => {
const [openActionsDropdown, setOpenActionsDropdown] = useState(false)
const info = useSelector((state: RootState) => state.notifications.info)
- const { stakedValidators, chosenNetwork } = useSelector(
+ const { stakedValidators } = useSelector(
(state: RootState) => state.profile
)
const { validator } = useSelector(
@@ -110,11 +110,7 @@ const ValidatorInfo: React.FC = ({ overview, status }) => {
onClick={() =>
window
.open(
- `${
- CHAIN_DETAILS.EXPLORER_URL[
- chosenNetwork as keyof typeof CHAIN_DETAILS.EXPLORER_URL
- ]
- }/validators/${overview.operatorAddress}`,
+ `${CHAIN_DETAILS.EXPLORER_URL}/validators/${overview.operatorAddress}`,
'_blank'
)
?.focus()
@@ -412,7 +408,7 @@ const ValidatorInfo: React.FC = ({ overview, status }) => {
borderRadius: '10px',
background:
theme.custom.statuses[
- statusTheme.status as keyof typeof theme.custom.statuses
+ statusTheme.status as keyof typeof theme.custom.statuses
],
fontWeight: 700,
letterSpacing: '2px'
diff --git a/src/containers/ValidatorDetails/components/MyDelegations/index.tsx b/src/containers/ValidatorDetails/components/MyDelegations/index.tsx
index b758d47..422d50d 100644
--- a/src/containers/ValidatorDetails/components/MyDelegations/index.tsx
+++ b/src/containers/ValidatorDetails/components/MyDelegations/index.tsx
@@ -20,8 +20,7 @@ const MyDelegations = () => {
redelegations,
undelegations,
stakedValidators,
- address,
- chosenNetwork
+ address
} = useSelector((state: RootState) => state.profile)
const { validator } = useSelector(
(state: RootState) => state.validatorDetails
@@ -79,23 +78,19 @@ const MyDelegations = () => {
const fetchData = async () => {
try {
const { validatorArray } = await fetchRewards(
- chosenNetwork!,
address,
controller.signal
)
const { redelegationsArray } = await fetchRedelegations(
- chosenNetwork!,
address,
controller.signal
)
const { undelegationsArray } = await fetchUndedelegations(
- chosenNetwork!,
address,
controller.signal
)
const { delegationsArray } = await fetchDelegations(
- chosenNetwork!,
address,
controller.signal
)
diff --git a/src/containers/ValidatorDetails/components/Statistics/hooks.ts b/src/containers/ValidatorDetails/components/Statistics/hooks.ts
index 6faa81d..513b7c8 100644
--- a/src/containers/ValidatorDetails/components/Statistics/hooks.ts
+++ b/src/containers/ValidatorDetails/components/Statistics/hooks.ts
@@ -48,7 +48,6 @@ const initialState: AccountDetailState = {
}
export const useStatistics = () => {
- const { chosenNetwork } = useSelector((state: RootState) => state.profile)
const { validatorId } = useParams()
const [state, setState] = useState(initialState)
const selfDelegateAddress = useSelector(
@@ -183,12 +182,12 @@ export const useStatistics = () => {
const fetchBalance = async () => {
const promises = [
- fetchCommission(chosenNetwork, selfDelegateAddress),
- fetchAvailableBalances(chosenNetwork, selfDelegateAddress),
- fetchDelegationBalance(chosenNetwork, selfDelegateAddress),
- fetchUnbondingBalance(chosenNetwork, selfDelegateAddress),
- fetchRewards(chosenNetwork, selfDelegateAddress),
- fetchVotingPower(chosenNetwork, validatorId!)
+ fetchCommission(selfDelegateAddress),
+ fetchAvailableBalances(selfDelegateAddress),
+ fetchDelegationBalance(selfDelegateAddress),
+ fetchUnbondingBalance(selfDelegateAddress),
+ fetchRewards(selfDelegateAddress),
+ fetchVotingPower(validatorId!)
]
const [commission, available, delegation, unbonding, rewards, votingPower] =
await Promise.allSettled(promises)
diff --git a/src/containers/ValidatorDetails/components/Statistics/utils.ts b/src/containers/ValidatorDetails/components/Statistics/utils.ts
index e9c37d9..6cb6a3d 100644
--- a/src/containers/ValidatorDetails/components/Statistics/utils.ts
+++ b/src/containers/ValidatorDetails/components/Statistics/utils.ts
@@ -13,14 +13,14 @@ import {
} from 'graphql/account_actions'
import { CHAIN_DETAILS } from 'utils/constants'
-export const fetchCommission = async (chosenNetwork: string, address: string) => {
+export const fetchCommission = async (address: string) => {
const defaultReturnValue = {
commission: {
coins: null
}
}
try {
- const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
validatorAddress: toValidatorAddress(address)
},
@@ -32,14 +32,14 @@ export const fetchCommission = async (chosenNetwork: string, address: string) =>
}
}
-export const fetchAccountWithdrawalAddress = async (chosenNetwork: string, address: string) => {
+export const fetchAccountWithdrawalAddress = async (address: string) => {
const defaultReturnValue = {
withdrawalAddress: {
address
}
}
try {
- const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
address
},
@@ -51,14 +51,14 @@ export const fetchAccountWithdrawalAddress = async (chosenNetwork: string, addre
}
}
-export const fetchAvailableBalances = async (chosenNetwork: string, address: string) => {
+export const fetchAvailableBalances = async (address: string) => {
const defaultReturnValue = {
accountBalances: {
coins: []
}
}
try {
- const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
address
},
@@ -70,14 +70,14 @@ export const fetchAvailableBalances = async (chosenNetwork: string, address: str
}
}
-export const fetchDelegationBalance = async (chosenNetwork: string, address: string) => {
+export const fetchDelegationBalance = async (address: string) => {
const defaultReturnValue = {
delegationBalance: {
coins: []
}
}
try {
- const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
address
},
@@ -89,14 +89,14 @@ export const fetchDelegationBalance = async (chosenNetwork: string, address: str
}
}
-export const fetchUnbondingBalance = async (chosenNetwork: string, address: string) => {
+export const fetchUnbondingBalance = async (address: string) => {
const defaultReturnValue = {
unbondingBalance: {
coins: []
}
}
try {
- const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
address
},
@@ -108,12 +108,12 @@ export const fetchUnbondingBalance = async (chosenNetwork: string, address: stri
}
}
-export const fetchRewards = async (chosenNetwork: string, address: string) => {
+export const fetchRewards = async (address: string) => {
const defaultReturnValue = {
delegationRewards: []
}
try {
- const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
address
},
@@ -125,12 +125,12 @@ export const fetchRewards = async (chosenNetwork: string, address: string) => {
}
}
-export const fetchVotingPower = async (chosenNetwork: string, address: string) => {
+export const fetchVotingPower = async (address: string) => {
const defaultVotingPower = {
votingPower: []
}
try {
- const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
address
},
@@ -142,12 +142,12 @@ export const fetchVotingPower = async (chosenNetwork: string, address: string) =
}
}
-export const fetchAccountDelegations = async (chosenNetwork: string, address: string) => {
+export const fetchAccountDelegations = async (address: string) => {
const defaultAccountDelegations = {
accountDelegations: []
}
try {
- const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.GRAPHQL_URL], {
+ const { data } = await axios.post(CHAIN_DETAILS.GRAPHQL_URL, {
variables: {
address
},
diff --git a/src/graphql/helpers.ts b/src/graphql/helpers.ts
index 05ab2f5..3eab727 100644
--- a/src/graphql/helpers.ts
+++ b/src/graphql/helpers.ts
@@ -6,6 +6,6 @@ export interface ApolloLinks {
}
export const defaultApolloLinks: ApolloLinks = {
- uri: CHAIN_DETAILS.GRAPHQL_URL[CHAIN_DETAILS.DEFAULT_NETWORK! as keyof typeof CHAIN_DETAILS.GRAPHQL_URL],
- url: CHAIN_DETAILS.GRAPHQL_WS[CHAIN_DETAILS.DEFAULT_NETWORK! as keyof typeof CHAIN_DETAILS.GRAPHQL_WS]
+ uri: CHAIN_DETAILS.GRAPHQL_URL,
+ url: CHAIN_DETAILS.GRAPHQL_WS
}
diff --git a/src/ledgers/CosmoStationLedger.ts b/src/ledgers/CosmoStationLedger.ts
index 7887317..053fa25 100644
--- a/src/ledgers/CosmoStationLedger.ts
+++ b/src/ledgers/CosmoStationLedger.ts
@@ -2,7 +2,7 @@ import { cosmos, InstallError } from '@cosmostation/extension-client'
import { CHAIN_DETAILS } from 'utils/constants'
import CosmosNetworkConfig from './CosmosNetworkConfig'
-export const connectCosmostationLedger = async (chosenNetwork: string): Promise<{
+export const connectCosmostationLedger = async (): Promise<{
address: string
accountName: string
}> => {
@@ -17,13 +17,13 @@ export const connectCosmostationLedger = async (chosenNetwork: string): Promise<
if (
!activatedChains.includes(
- CHAIN_DETAILS.CHAIN_ID[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_ID].toLowerCase()
+ CHAIN_DETAILS.CHAIN_ID.toLowerCase()
)
) {
await provider.addChain({
- chainId: CHAIN_DETAILS.CHAIN_ID[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_ID],
+ chainId: CHAIN_DETAILS.CHAIN_ID,
- chainName: CHAIN_DETAILS.CHAIN_NAME[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_NAME],
+ chainName: CHAIN_DETAILS.CHAIN_NAME,
addressPrefix: CosmosNetworkConfig.BECH32_PREFIX_ACC_ADDR,
@@ -31,7 +31,7 @@ export const connectCosmostationLedger = async (chosenNetwork: string): Promise<
displayDenom: CosmosNetworkConfig.CURRENCY_DISPLAY_NAME,
- restURL: CHAIN_DETAILS.API_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.API_ADDRESS],
+ restURL: CHAIN_DETAILS.API_ADDRESS,
decimals: 18,
@@ -49,7 +49,7 @@ export const connectCosmostationLedger = async (chosenNetwork: string): Promise<
// Although the method suggests CHAIN_NAME as parameter only, it can work with CHAIN_ID too!
const acccount = await provider.requestAccount(
- CHAIN_DETAILS.CHAIN_ID[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_ID]
+ CHAIN_DETAILS.CHAIN_ID
)
userAccountAddress = acccount.address
diff --git a/src/ledgers/KeplrLedger.tsx b/src/ledgers/KeplrLedger.tsx
index d074e3e..03516bc 100644
--- a/src/ledgers/KeplrLedger.tsx
+++ b/src/ledgers/KeplrLedger.tsx
@@ -12,19 +12,19 @@ declare global {
}
}
-export const connectKeplrLedger = async (chosenNetwork: string) => {
+export const connectKeplrLedger = async () => {
const wallet = new KeplrWallet({
- CHAIN_ID: CHAIN_DETAILS.CHAIN_ID[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_ID],
- CHAIN_NAME: CHAIN_DETAILS.CHAIN_NAME[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_NAME],
- RPC: CHAIN_DETAILS.RPC_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.RPC_ADDRESS],
- API: CHAIN_DETAILS.API_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.API_ADDRESS],
- STAKING: CHAIN_DETAILS.STAKING_URL[chosenNetwork as keyof typeof CHAIN_DETAILS.API_ADDRESS],
- GAS_PRICE: CHAIN_DETAILS.GAS_PRICE
+ CHAIN_ID: CHAIN_DETAILS.CHAIN_ID,
+ CHAIN_NAME: CHAIN_DETAILS.CHAIN_NAME,
+ RPC: CHAIN_DETAILS.RPC_ADDRESS,
+ API: CHAIN_DETAILS.API_ADDRESS,
+ STAKING: CHAIN_DETAILS.STAKING_URL,
+ GAS_PRICE: CHAIN_DETAILS.GAS_PRICE.toString()
})
await wallet.connect()
- const key = await window.keplr.getKey(CHAIN_DETAILS.CHAIN_ID[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_ID])
+ const key = await window.keplr.getKey(CHAIN_DETAILS.CHAIN_ID)
return { address: key.bech32Address, accountName: key.name }
}
diff --git a/src/ledgers/transactions.ts b/src/ledgers/transactions.ts
index 15d68e2..792a1e2 100644
--- a/src/ledgers/transactions.ts
+++ b/src/ledgers/transactions.ts
@@ -71,13 +71,12 @@ export const calculateFee = (gasLimit: number, gasPrice: string | GasPrice) => {
}
export const getFee = async (
- chosenNetwork: string,
address: string,
ledgerType: SUPPORTED_WALLET,
message: any[],
memo: string
) => {
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
const gasUsed = await client.simulate(address, message, memo)
const gasLimit = Math.round(gasUsed * DEFAULT_GAS_MULTIPLIER)
@@ -88,7 +87,6 @@ export const getFee = async (
}
export const delegate = async (
- chosenNetwork: string,
delegatorAddress: string,
validatorAddress: string,
amount: string,
@@ -118,9 +116,9 @@ export const delegate = async (
value: msg
}
- const fee = await getFee(chosenNetwork, delegatorAddress, ledgerType, [msgAny], memo)
+ const fee = await getFee(delegatorAddress, ledgerType, [msgAny], memo)
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
const result = await client.delegateTokens(
delegatorAddress,
@@ -134,7 +132,6 @@ export const delegate = async (
}
export const undelegate = async (
- chosenNetwork: string,
delegatorAddress: string,
validatorAddress: string,
amount: string,
@@ -164,9 +161,9 @@ export const undelegate = async (
value: msg
}
- const fee = await getFee(chosenNetwork, delegatorAddress, ledgerType, [msgAny], memo)
+ const fee = await getFee(delegatorAddress, ledgerType, [msgAny], memo)
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
const result = await client.undelegateTokens(
delegatorAddress,
@@ -180,7 +177,6 @@ export const undelegate = async (
}
export const redelegate = async (
- chosenNetwork: string,
delegatorAddress: string,
validatorSrcAddress: string,
validatorDstAddress: string,
@@ -205,9 +201,9 @@ export const redelegate = async (
value: msg
}
- const fee = await getFee(chosenNetwork, delegatorAddress, ledgerType, [msgAny], memo)
+ const fee = await getFee(delegatorAddress, ledgerType, [msgAny], memo)
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
const result = await client.signAndBroadcast(
delegatorAddress,
@@ -220,7 +216,6 @@ export const redelegate = async (
}
export const claimRewards = async (
- chosenNetwork: string,
stakedValidators: { address: string; amount: string }[],
address: string,
options: {
@@ -280,9 +275,9 @@ export const claimRewards = async (
})
}
- fee = await getFee(chosenNetwork, address, ledgerType, [...msgAny], msgMemo)
+ fee = await getFee(address, ledgerType, [...msgAny], msgMemo)
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
const result = await client.signAndBroadcast(address, msgAny, fee, msgMemo)
@@ -307,9 +302,9 @@ export const claimRewards = async (
}
})
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
- restakeFee = await getFee(chosenNetwork, address, ledgerType, [...msgRestake], msgMemo)
+ restakeFee = await getFee(address, ledgerType, [...msgRestake], msgMemo)
restakeTx = await client.signAndBroadcast(
address,
@@ -329,7 +324,6 @@ export const claimRewards = async (
}
export const voteProposal = async (
- chosenNetwork: string,
voterAddress: string,
proposalId: number | undefined,
votingOption: number,
@@ -348,9 +342,9 @@ export const voteProposal = async (
const memo = 'Sent via CUDOS Dashboard'
- const fee = await getFee(chosenNetwork, voterAddress, ledgerType, [msgAny], memo)
+ const fee = await getFee(voterAddress, ledgerType, [msgAny], memo)
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
const result = await client.signAndBroadcast(
voterAddress,
@@ -366,7 +360,6 @@ export const voteProposal = async (
}
export const depositProposal = async (
- chosenNetwork: string,
depositorAddress: string,
proposalId: number | undefined,
amount: string,
@@ -392,9 +385,9 @@ export const depositProposal = async (
const memo = 'Sent via CUDOS Dashboard'
- const fee = await getFee(chosenNetwork, depositorAddress, ledgerType, [msgAny], memo)
+ const fee = await getFee(depositorAddress, ledgerType, [msgAny], memo)
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
const result = await client.signAndBroadcast(
depositorAddress,
@@ -506,12 +499,11 @@ export const getProposalContent = (proposalData: any) => {
}
export const createProposal = async (
- chosenNetwork: string,
proposalData: any,
proposerAddress: string,
ledgerType: SUPPORTED_WALLET
) => {
- const client = await signingClient(chosenNetwork, ledgerType)
+ const client = await signingClient(ledgerType)
const content = getProposalContent(proposalData)
@@ -535,7 +527,7 @@ export const createProposal = async (
const memo = 'Sent via CUDOS Dashboard'
- const fee = await getFee(chosenNetwork, proposerAddress, ledgerType, [msgAny], memo)
+ const fee = await getFee(proposerAddress, ledgerType, [msgAny], memo)
const result = await client.signAndBroadcast(
proposerAddress,
diff --git a/src/ledgers/utils.ts b/src/ledgers/utils.ts
index 800ebd4..aff20fa 100644
--- a/src/ledgers/utils.ts
+++ b/src/ledgers/utils.ts
@@ -532,27 +532,26 @@ export const unknownMessage = {
displayName: 'Unknown'
}
-export const switchLedgerType = async (chosenNetwork: string, walletName: SUPPORTED_WALLET) => {
+export const switchLedgerType = async (walletName: SUPPORTED_WALLET) => {
const isInstalled = isExtensionEnabled(walletName)
if (walletName === SUPPORTED_WALLET.Keplr && isInstalled) {
- return connectKeplrLedger(chosenNetwork)
+ return connectKeplrLedger()
}
if (walletName === SUPPORTED_WALLET.Cosmostation && isInstalled) {
- return connectCosmostationLedger(chosenNetwork)
+ return connectCosmostationLedger()
}
throw new Error("Invalid ledger")
}
export const getLedgerSigner = async (
- chosenNetwork: string,
connector: Cosmos,
accountInfo: RequestAccountResponse
) => {
- const chainName = CHAIN_DETAILS.CHAIN_NAME[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_NAME]
+ const chainName = CHAIN_DETAILS.CHAIN_NAME
const signer: OfflineAminoSigner = {
getAccounts: async () => {
return [
@@ -582,29 +581,28 @@ export const getLedgerSigner = async (
}
const switchSigningClient = async (
- chosenNetwork: string,
walletName: SUPPORTED_WALLET
): Promise => {
let client
switch (walletName) {
case SUPPORTED_WALLET.Keplr:
client = await window.getOfflineSignerAuto(
- CHAIN_DETAILS.CHAIN_ID[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_ID]
+ CHAIN_DETAILS.CHAIN_ID
)
return client
case SUPPORTED_WALLET.Cosmostation: {
const connector = await cosmos()
const connectedAccount = await connector.requestAccount(
- CHAIN_DETAILS.CHAIN_NAME[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_NAME]
+ CHAIN_DETAILS.CHAIN_NAME
)
if (connectedAccount.isLedger) {
- client = await getLedgerSigner(chosenNetwork, connector, connectedAccount)
+ client = await getLedgerSigner(connector, connectedAccount)
return client
}
- client = await cosmostationSigner(CHAIN_DETAILS.CHAIN_ID[chosenNetwork as keyof typeof CHAIN_DETAILS.CHAIN_ID])
+ client = await cosmostationSigner(CHAIN_DETAILS.CHAIN_ID)
return client
}
@@ -613,8 +611,8 @@ const switchSigningClient = async (
}
}
-export const signingClient = async (chosenNetwork: string, walletName: SUPPORTED_WALLET) => {
- const offlineSigner = await switchSigningClient(chosenNetwork, walletName)
+export const signingClient = async (walletName: SUPPORTED_WALLET) => {
+ const offlineSigner = await switchSigningClient(walletName)
if (isExtensionEnabled(walletName)) {
window.keplr.defaultOptions = {
@@ -629,15 +627,15 @@ export const signingClient = async (chosenNetwork: string, walletName: SUPPORTED
}
return SigningStargateClient.connectWithSigner(
- CHAIN_DETAILS.RPC_ADDRESS[chosenNetwork as keyof typeof CHAIN_DETAILS.RPC_ADDRESS],
+ CHAIN_DETAILS.RPC_ADDRESS,
offlineSigner
)
}
-export const getQueryClient = async (chosenNetwork: string): Promise => {
+export const getQueryClient = async (): Promise => {
try {
- const client = await StargateClient.connect(CHAIN_DETAILS.RPC_ADDRESS[chosenNetwork! as keyof typeof CHAIN_DETAILS.RPC_ADDRESS])
+ const client = await StargateClient.connect(CHAIN_DETAILS.RPC_ADDRESS)
return client
} catch (error) {
diff --git a/src/store/index.ts b/src/store/index.ts
index 2f5747d..35b3b41 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -12,6 +12,7 @@ import userTransactionsReducer from './userTransactions'
import validatorDetailsReducer from './validatorDetails'
import notificationsReducer from './notifications'
import modalReducer from './modal'
+import { APP_DETAILS } from 'utils/constants'
const rootReducer = combineReducers({
profile: profileReducer,
@@ -48,7 +49,7 @@ export const store = configureStore({
getDefaultMiddleware({
serializableCheck: false
}),
- devTools: import.meta.env.NODE_ENV !== 'production'
+ devTools: APP_DETAILS.NODE_ENV.toLowerCase() !== 'production'
})
// Infer the `RootState` and `AppDispatch` types from the store itself
diff --git a/src/store/profile.ts b/src/store/profile.ts
index eb51717..0f0459b 100644
--- a/src/store/profile.ts
+++ b/src/store/profile.ts
@@ -14,7 +14,6 @@ export interface WalletState {
address: string
accountName: string
connectedLedger: SUPPORTED_WALLET | undefined
- chosenNetwork: string
loadingState: boolean
lastLoggedAddress: string
balance: BigNumber
@@ -39,7 +38,6 @@ const initialState: WalletState = {
address: '',
accountName: '',
connectedLedger: undefined,
- chosenNetwork: CHAIN_DETAILS.DEFAULT_NETWORK,
loadingState: false,
lastLoggedAddress: '',
balance: new BigNumber(0),
diff --git a/src/utils/constants.tsx b/src/utils/constants.tsx
index 047087b..159cfc2 100644
--- a/src/utils/constants.tsx
+++ b/src/utils/constants.tsx
@@ -1,114 +1,26 @@
// APP SPECIFIC CHAIN CONFIGURATIONS
export const CHAIN_DETAILS = {
GAS_PRICE: import.meta.env.VITE_APP_GAS_PRICE || process.env.VITE_APP_GAS_PRICE || "",
- DEFAULT_NETWORK: import.meta.env.VITE_APP_DEFAULT_NETWORK || process.env.VITE_APP_DEFAULT_NETWORK || "",
- CAPTCHA_SITE_KEY: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_CAPTCHA_SITE_KEY || process.env.VITE_APP_LOCAL_CAPTCHA_SITE_KEY || "",
- DEV: import.meta.env.VITE_APP_DEV_CAPTCHA_SITE_KEY || process.env.VITE_APP_DEV_CAPTCHA_SITE_KEY || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_CAPTCHA_SITE_KEY || process.env.VITE_APP_PRIVATE_CAPTCHA_SITE_KEY || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_CAPTCHA_SITE_KEY || process.env.VITE_APP_PUBLIC_CAPTCHA_SITE_KEY || "",
- MAINNET: ''
- },
- FAUCET_URL: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_FAUCET_URL || process.env.VITE_APP_LOCAL_FAUCET_URL || "",
- DEV: import.meta.env.VITE_APP_DEV_FAUCET_URL || process.env.VITE_APP_DEV_FAUCET_URL || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_FAUCET_URL || process.env.VITE_APP_PRIVATE_FAUCET_URL || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_FAUCET_URL || process.env.VITE_APP_PUBLIC_FAUCET_URL || "",
- MAINNET: ''
- },
- FAUCET_ADDRESS: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_FAUCET_ADDRESS || process.env.VITE_APP_LOCAL_FAUCET_ADDRESS || "",
- DEV: import.meta.env.VITE_APP_DEV_FAUCET_ADDRESS || process.env.VITE_APP_DEV_FAUCET_ADDRESS || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_FAUCET_ADDRESS || process.env.VITE_APP_PRIVATE_FAUCET_ADDRESS || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_FAUCET_ADDRESS || process.env.VITE_APP_PUBLIC_FAUCET_ADDRESS || "",
- MAINNET: ''
- },
- BRIDGE_URL: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_BRIDGE_URL || process.env.VITE_APP_LOCAL_BRIDGE_URL || "",
- DEV: import.meta.env.VITE_APP_DEV_BRIDGE_URL || process.env.VITE_APP_DEV_BRIDGE_URL || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_BRIDGE_URL || process.env.VITE_APP_PRIVATE_BRIDGE_URL || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_BRIDGE_URL || process.env.VITE_APP_PUBLIC_BRIDGE_URL || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_BRIDGE_URL || process.env.VITE_APP_MAINNET_BRIDGE_URL || "",
- },
- GRAPHQL_URL: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_GRAPHQL_URL || process.env.VITE_APP_LOCAL_GRAPHQL_URL || "",
- DEV: import.meta.env.VITE_APP_DEV_GRAPHQL_URL || process.env.VITE_APP_DEV_GRAPHQL_URL || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_GRAPHQL_URL || process.env.VITE_APP_PRIVATE_GRAPHQL_URL || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_GRAPHQL_URL || process.env.VITE_APP_PUBLIC_GRAPHQL_URL || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_GRAPHQL_URL || process.env.VITE_APP_MAINNET_GRAPHQL_URL || ""
- },
- GRAPHQL_WS: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_GRAPHQL_WS || process.env.VITE_APP_LOCAL_GRAPHQL_WS || "",
- DEV: import.meta.env.VITE_APP_DEV_GRAPHQL_WS || process.env.VITE_APP_DEV_GRAPHQL_WS || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_GRAPHQL_WS || process.env.VITE_APP_PRIVATE_GRAPHQL_WS || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_GRAPHQL_WS || process.env.VITE_APP_PUBLIC_GRAPHQL_WS || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_GRAPHQL_WS || process.env.VITE_APP_MAINNET_GRAPHQL_WS || ""
- },
- RPC_ADDRESS: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_RPC || process.env.VITE_APP_LOCAL_RPC || "",
- DEV: import.meta.env.VITE_APP_DEV_RPC || process.env.VITE_APP_DEV_RPC || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_RPC || process.env.VITE_APP_PRIVATE_RPC || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_RPC || process.env.VITE_APP_PUBLIC_RPC || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_RPC || process.env.VITE_APP_MAINNET_RPC || ""
- },
- API_ADDRESS: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_API || process.env.VITE_APP_LOCAL_API || "",
- DEV: import.meta.env.VITE_APP_DEV_API || process.env.VITE_APP_DEV_API || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_API || process.env.VITE_APP_PRIVATE_API || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_API || process.env.VITE_APP_PUBLIC_API || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_API || process.env.VITE_APP_MAINNET_API || ""
- },
- STAKING_URL: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_STAKING_URL || process.env.VITE_APP_LOCAL_STAKING_URL || "",
- DEV: import.meta.env.VITE_APP_DEV_STAKING_URL || process.env.VITE_APP_DEV_STAKING_URL || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_STAKING_URL || process.env.VITE_APP_PRIVATE_STAKING_URL || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_STAKING_URL || process.env.VITE_APP_PUBLIC_STAKING_URL || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_STAKING_URL || process.env.VITE_APP_MAINNET_STAKING_URL || ""
- },
- EXPLORER_URL: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_EXPLORER_URL || process.env.VITE_APP_LOCAL_EXPLORER_URL || "",
- DEV: import.meta.env.VITE_APP_DEV_EXPLORER_URL || process.env.VITE_APP_DEV_EXPLORER_URL || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_EXPLORER_URL || process.env.VITE_APP_PRIVATE_EXPLORER_URL || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_EXPLORER_URL || process.env.VITE_APP_PUBLIC_EXPLORER_URL || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_EXPLORER_URL || process.env.VITE_APP_MAINNET_EXPLORER_URL || ""
- },
- CHAIN_NAME: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_CHAIN_NAME || process.env.VITE_APP_LOCAL_CHAIN_NAME || "",
- DEV: import.meta.env.VITE_APP_DEV_CHAIN_NAME || process.env.VITE_APP_DEV_CHAIN_NAME || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_CHAIN_NAME || process.env.VITE_APP_PRIVATE_CHAIN_NAME || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_CHAIN_NAME || process.env.VITE_APP_PUBLIC_CHAIN_NAME || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_CHAIN_NAME || process.env.VITE_APP_MAINNET_CHAIN_NAME || ""
- },
- CHAIN_ID: {
- LOCAL: import.meta.env.VITE_APP_LOCAL_CHAIN_ID || process.env.VITE_APP_LOCAL_CHAIN_ID || "",
- DEV: import.meta.env.VITE_APP_DEV_CHAIN_ID || process.env.VITE_APP_DEV_CHAIN_ID || "",
- PRIVATE: import.meta.env.VITE_APP_PRIVATE_CHAIN_ID || process.env.VITE_APP_PRIVATE_CHAIN_ID || "",
- PUBLIC: import.meta.env.VITE_APP_PUBLIC_CHAIN_ID || process.env.VITE_APP_PUBLIC_CHAIN_ID || "",
- MAINNET: import.meta.env.VITE_APP_MAINNET_CHAIN_ID || process.env.VITE_APP_MAINNET_CHAIN_ID || ""
- },
- LOCAL: {
- ALIAS_NAME: 'Local Testnet',
- SHORT_NAMES: ['local']
- },
- DEV: {
- ALIAS_NAME: 'DEV Environment',
- SHORT_NAMES: ['cudos-dev-test-network', 'dev-network']
- },
- PRIVATE: {
- ALIAS_NAME: 'Private Testnet',
- SHORT_NAMES: ['private', 'dev-test']
- },
- PUBLIC: {
- ALIAS_NAME: 'Public Testnet',
- SHORT_NAMES: ['public']
- },
- MAINNET: {
- ALIAS_NAME: 'Main Network',
- SHORT_NAMES: ['mainnet', 'cudos-1']
- }
+ CAPTCHA_SITE_KEY: import.meta.env.VITE_APP_CAPTCHA_SITE_KEY || process.env.VITE_APP_CAPTCHA_SITE_KEY || "",
+ FAUCET_URL: import.meta.env.VITE_APP_FAUCET_URL || process.env.VITE_APP_FAUCET_URL || "",
+ FAUCET_ADDRESS: import.meta.env.VITE_APP_FAUCET_ADDRESS || process.env.VITE_APP_FAUCET_ADDRESS || "",
+ BRIDGE_URL: import.meta.env.VITE_APP_BRIDGE_URL || process.env.VITE_APP_BRIDGE_URL || "",
+ GRAPHQL_URL: import.meta.env.VITE_APP_GRAPHQL_URL || process.env.VITE_APP_GRAPHQL_URL || "",
+ GRAPHQL_WS: import.meta.env.VITE_APP_GRAPHQL_WS || process.env.VITE_APP_GRAPHQL_WS || "",
+ RPC_ADDRESS: import.meta.env.VITE_APP_RPC || process.env.VITE_APP_RPC || "",
+ API_ADDRESS: import.meta.env.VITE_APP_API || process.env.VITE_APP_API || "",
+ STAKING_URL: import.meta.env.VITE_APP_STAKING_URL || process.env.VITE_APP_STAKING_URL || "",
+ EXPLORER_URL: import.meta.env.VITE_APP_EXPLORER_URL || process.env.VITE_APP_EXPLORER_URL || "",
+ CHAIN_NAME: import.meta.env.VITE_APP_CHAIN_NAME || process.env.VITE_APP_CHAIN_NAME || "",
+ CHAIN_ID: import.meta.env.VITE_APP_CHAIN_ID || process.env.VITE_APP_CHAIN_ID || ""
}
// GENERAL APP CONFIGURATIONS
+export const APP_DETAILS = {
+ DEPLOYMENT_VERSION: import.meta.env.VITE_APP_DEPLOYMENT_VERSION || process.env.VITE_APP_DEPLOYMENT_VERSION || "",
+ NODE_ENV: import.meta.env.VITE_APP_NODE_ENV || process.env.VITE_APP_NODE_ENV || "",
+}
+
export const SCREEN_RESOLUTIONS = {
HIGH: 1600,
MID_LOW: 1300,
diff --git a/src/utils/projectUtils.tsx b/src/utils/projectUtils.tsx
index d2eb43d..f255a1b 100644
--- a/src/utils/projectUtils.tsx
+++ b/src/utils/projectUtils.tsx
@@ -9,8 +9,6 @@ import { fetchDelegations } from 'api/getAccountDelegations'
import { fetchRedelegations } from 'api/getAccountRedelegations'
import { fetchUndedelegations } from 'api/getAccountUndelegations'
import { getUnbondingBalance } from 'api/getUnbondingBalance'
-import { CHAIN_DETAILS } from './constants'
-import { detect as detectBrowser } from 'detect-browser'
import CosmostationLogo from 'assets/vectors/cosmostation-logo.svg'
import KeplrLogo from 'assets/vectors/keplr-logo.svg'
import { styles } from 'containers/ConnectWallet/styles'
@@ -45,8 +43,8 @@ export const formatAddress = (text: string, sliceIndex: number): string => {
return `${text.slice(0, sliceIndex)}...${text.slice(len - 4, len)}`
}
-export const getWalletBalance = async (chosenNetwork: string, address: string) => {
- const queryClient = await getQueryClient(chosenNetwork)
+export const getWalletBalance = async (address: string) => {
+ const queryClient = await getQueryClient()
const updateWalletBalance = await queryClient.getBalance(address, CosmosNetworkConfig.CURRENCY_DENOM)
return new BigNumber(updateWalletBalance.amount)
@@ -54,8 +52,8 @@ export const getWalletBalance = async (chosenNetwork: string, address: string) =
.toString(10)
}
-export const getStakedBalance = async (chosenNetwork: string, address: string) => {
- const queryClient = await getQueryClient(chosenNetwork)
+export const getStakedBalance = async (address: string) => {
+ const queryClient = await getQueryClient()
const updateWalletBalance = await queryClient.getBalanceStaked(address)
if (updateWalletBalance === null) {
@@ -94,21 +92,20 @@ export const addEndingEllipsis = (
return input
}
-export const connectUser = async (chosenNetwork: string, walletName: SUPPORTED_WALLET): Promise => {
+export const connectUser = async (walletName: SUPPORTED_WALLET): Promise => {
try {
- const { address, accountName } = await switchLedgerType(chosenNetwork!, walletName)
- const balance = await getWalletBalance(chosenNetwork, address!)
- const stakedAmountBalance = await getStakedBalance(chosenNetwork, address!)
- const { totalRewards, validatorArray } = await fetchRewards(chosenNetwork, address!)
- const { delegationsArray } = await fetchDelegations(chosenNetwork, address)
- const { redelegationsArray } = await fetchRedelegations(chosenNetwork, address)
- const { undelegationsArray } = await fetchUndedelegations(chosenNetwork, address)
- const { unbondingBalance } = await getUnbondingBalance(chosenNetwork, address)
+ const { address, accountName } = await switchLedgerType(walletName)
+ const balance = await getWalletBalance(address!)
+ const stakedAmountBalance = await getStakedBalance(address!)
+ const { totalRewards, validatorArray } = await fetchRewards(address!)
+ const { delegationsArray } = await fetchDelegations(address)
+ const { redelegationsArray } = await fetchRedelegations(address)
+ const { undelegationsArray } = await fetchUndedelegations(address)
+ const { unbondingBalance } = await getUnbondingBalance(address)
const connectedUser = {
- chosenNetwork,
address,
lastLoggedAddress: address,
connectedLedger: walletName,
@@ -131,23 +128,19 @@ export const connectUser = async (chosenNetwork: string, walletName: SUPPORTED_W
}
-export const handleAvailableNetworks = (defaultNetwork: string): networkToDisplay[] => {
+export const getChainPrettyName = (chainId: string): string => {
+ switch (chainId) {
+ case 'cudos-testnet-private-3':
+ return 'Private Testnet'
- if (
- CHAIN_DETAILS[defaultNetwork as keyof typeof CHAIN_DETAILS].ALIAS_NAME ===
- CHAIN_DETAILS.LOCAL.ALIAS_NAME
- ) {
- return [CHAIN_DETAILS.LOCAL]
- }
+ case 'cudos-testnet-public-3':
+ return 'Public Testnet'
- if (
- CHAIN_DETAILS[defaultNetwork as keyof typeof CHAIN_DETAILS].ALIAS_NAME ===
- CHAIN_DETAILS.PRIVATE.ALIAS_NAME
- ) {
- return [CHAIN_DETAILS.PRIVATE]
- }
+ case 'cudos-1':
+ return 'Main Network'
- return [CHAIN_DETAILS.PUBLIC, CHAIN_DETAILS.MAINNET]
+ default: return chainId
+ }
}
export const delay = (ms: number) => {
diff --git a/types/global.d.ts b/types/global.d.ts
index c6d2818..992d9c5 100644
--- a/types/global.d.ts
+++ b/types/global.d.ts
@@ -143,21 +143,21 @@ declare global {
}
interface ImportMetaEnv {
- VITE_APP_CHAIN_ID: string
+ VITE_APP_DEPLOYMENT_VERSION: string
+ VITE_APP_NODE_ENV: string
+ VITE_APP_GAS_PRICE: number
+ VITE_APP_CAPTCHA_SITE_KEY: string
+ VITE_APP_FAUCET_URL: string
+ VITE_APP_FAUCET_ADDRESS: string
+ VITE_APP_BRIDGE_URL: string
+ VITE_APP_GRAPHQL_URL: string
+ VITE_APP_GRAPHQL_WS: string
VITE_APP_RPC: string
- VITE_GRAPHQL_URL: string
- VITE_GRAPHQL_WS: string
- VITE_APP_GAS_PRICE: decimal
- VITE_APP_CHAIN_NAME: string
VITE_APP_API: string
- VITE_APP_EXPLORER_V2: string
- VITE_APP_FEE_MULTIPLIER: number
- VITE_BRIDGE_URL: string
- VITE_FAUCET_ADDRESS: string
- VITE_CHAIN_STATUS: string
- VITE_CAPTCHA_SITE_KEY: string
- VITE_FAUCET_URL: string
VITE_APP_STAKING_URL: string
+ VITE_APP_EXPLORER_URL: string
+ VITE_APP_CHAIN_NAME: string
+ VITE_APP_CHAIN_ID: string
}
interface SxMap {
diff --git a/yarn.lock b/yarn.lock
index b11e242..5712c3c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1159,6 +1159,54 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"
+"@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"
+
"@fontsource/poppins@^4.5.5":
version "4.5.8"
resolved "https://registry.yarnpkg.com/@fontsource/poppins/-/poppins-4.5.8.tgz#65ce9b32f31bda5a25c23001bcebf1c66e440320"
@@ -1618,6 +1666,71 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"
+"@keplr-wallet/common@0.11.48":
+ version "0.11.48"
+ resolved "https://registry.yarnpkg.com/@keplr-wallet/common/-/common-0.11.48.tgz#260ee96596376e8ee3b7fdb5a9dbd81989e8dc27"
+ integrity sha512-dZE22P40WsVlLW3j/aiJOeE7XIRVBM2FhXNBKbcIeYE9tH6fWSfXT08tK0WVbLBeVsN9hG3Nnkaq+mj0OSekhg==
+ dependencies:
+ "@keplr-wallet/crypto" "0.11.48"
+ buffer "^6.0.3"
+ delay "^4.4.0"
+
+"@keplr-wallet/cosmos@^0.11.23":
+ version "0.11.48"
+ resolved "https://registry.yarnpkg.com/@keplr-wallet/cosmos/-/cosmos-0.11.48.tgz#6df656a2757199ab29e24769e3da2495d0c18d43"
+ integrity sha512-c8N+5ty3mtbyZs8sXZIjvBj+ENEL383RBkOt4K9smI14E+VwZoIuG1FK/CVIwQLKX92qXTyzEqYkTcu5tzsZVQ==
+ dependencies:
+ "@ethersproject/address" "^5.6.0"
+ "@keplr-wallet/common" "0.11.48"
+ "@keplr-wallet/crypto" "0.11.48"
+ "@keplr-wallet/proto-types" "0.11.48"
+ "@keplr-wallet/types" "0.11.48"
+ "@keplr-wallet/unit" "0.11.48"
+ 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.48":
+ version "0.11.48"
+ resolved "https://registry.yarnpkg.com/@keplr-wallet/crypto/-/crypto-0.11.48.tgz#5c863b36b07fbd74999018231df291447f0620e3"
+ integrity sha512-E7aH69MH4lO3Wk/6FK01zFwSYZOezafdV4nDh3SF8uu49rKLP8eGR+ByFo/T8vjaj9arjV78mOucJoQ4TDUgXw==
+ 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.48":
+ version "0.11.48"
+ resolved "https://registry.yarnpkg.com/@keplr-wallet/proto-types/-/proto-types-0.11.48.tgz#7c42d5ff8f78219b615c97002d34db05a5e1639e"
+ integrity sha512-42Exfk59O3zIpmkff7pdUMBdPJkrYzzEypcfgeg9KiM3u/VcHwnEMncjdZVmbBIcAVuE8TdQJxPKRd04ANRIWw==
+ dependencies:
+ long "^4.0.0"
+ protobufjs "^6.11.2"
+
+"@keplr-wallet/types@0.11.48":
+ version "0.11.48"
+ resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.11.48.tgz#efef714f42860bb8415e386573ac927c04a05692"
+ integrity sha512-eodb8xQl6lIKSaNuLj+4doWGkv+GYOHrYGHFej5vvqaIcPwlOzJxAWAGPYw+YzGUd/9CVlzzv4q63INbts6UNQ==
+ dependencies:
+ axios "^0.27.2"
+ long "^4.0.0"
+
+"@keplr-wallet/unit@0.11.48":
+ version "0.11.48"
+ resolved "https://registry.yarnpkg.com/@keplr-wallet/unit/-/unit-0.11.48.tgz#b266792c65f4740783a9ce668a7045b1602d989e"
+ integrity sha512-HOyfzm7kvocoqT32k8TNoAKvT6+iTBwfaL9H4EGoRPbnIx2Cy5Z4lUGb3yQapTVm+WuB+SPlowShnoEHt5i69Q==
+ dependencies:
+ "@keplr-wallet/types" "0.11.48"
+ big-integer "^1.6.48"
+ utility-types "^3.10.0"
+
"@mui/base@5.0.0-alpha.79":
version "5.0.0-alpha.79"
resolved "https://registry.yarnpkg.com/@mui/base/-/base-5.0.0-alpha.79.tgz#1994a6382a162b52ec93b66f3c74d193820d2365"
@@ -1715,6 +1828,11 @@
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183"
integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==
+"@noble/hashes@^1.2.0":
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1"
+ integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==
+
"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
@@ -2011,6 +2129,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.31.tgz#a5bb84ecfa27eec5e1c802c6bbf8139bdb163a5d"
integrity sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==
+"@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@^18.11.9":
version "18.11.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
@@ -2710,6 +2833,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.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"
@@ -2725,6 +2855,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==
+
big.js@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.1.1.tgz#63b35b19dc9775c94991ee5db7694880655d5537"
@@ -2740,6 +2875,33 @@ binary-extensions@^2.0.0:
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
+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.3:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.1.0.tgz#c55a418deaf48826a6ceb34ac55b3ee1577e18a3"
+ integrity sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==
+ dependencies:
+ "@noble/hashes" "^1.2.0"
+
bl@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a"
@@ -2754,12 +2916,12 @@ bn.js@4.11.8:
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==
-bn.js@^4.11.9:
+bn.js@^4.11.8, bn.js@^4.11.9:
version "4.12.0"
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==
@@ -2805,6 +2967,22 @@ browserslist@^4.21.3:
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"
@@ -2830,6 +3008,14 @@ buffer@^5.5.0, buffer@^5.7.0:
base64-js "^1.3.1"
ieee754 "^1.1.13"
+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==
+ dependencies:
+ base64-js "^1.3.1"
+ ieee754 "^1.2.1"
+
busboy@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893"
@@ -2999,6 +3185,14 @@ chokidar@^3.5.2:
optionalDependencies:
fsevents "~2.3.2"
+cipher-base@^1.0.1, cipher-base@^1.0.3:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de"
+ integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==
+ dependencies:
+ inherits "^2.0.1"
+ safe-buffer "^5.0.1"
+
clean-stack@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
@@ -3218,6 +3412,29 @@ cosmjs-types@^0.4.0, cosmjs-types@^0.4.1:
long "^4.0.0"
protobufjs "~6.11.2"
+create-hash@^1.1.0, 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==
+ dependencies:
+ cipher-base "^1.0.1"
+ inherits "^2.0.1"
+ md5.js "^1.3.4"
+ ripemd160 "^2.0.1"
+ sha.js "^2.4.0"
+
+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==
+ dependencies:
+ cipher-base "^1.0.3"
+ create-hash "^1.1.0"
+ inherits "^2.0.1"
+ ripemd160 "^2.0.0"
+ safe-buffer "^5.0.1"
+ sha.js "^2.4.8"
+
create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
@@ -3252,6 +3469,11 @@ cross-undici-fetch@^0.4.0:
undici "^5.1.0"
web-streams-polyfill "^3.2.0"
+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-mediaquery@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/css-mediaquery/-/css-mediaquery-0.1.2.tgz#6a2c37344928618631c54bd33cedd301da18bea0"
@@ -3262,10 +3484,10 @@ csstype@^3.0.11, csstype@^3.0.2:
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.11.tgz#d66700c5eacfac1940deb4e3ee5642792d85cd33"
integrity sha512-sa6P2wJ+CAbgyy4KFssIb/JNMLxFvKF1pCYCSXS8ZMuqZnMsrxqI2E5sPyoTpxoPU/gVZMzr2zjOfg8GIZOMsw==
-cudosjs@^1.2.5:
- version "1.2.5"
- resolved "https://registry.yarnpkg.com/cudosjs/-/cudosjs-1.2.5.tgz#b491316aea38399ea7800c0b4bc3d615481fd7e7"
- integrity sha512-LignXN62Ni355FlU+5A8liwoktKkXffV2rHpCKmrRKPljIPEyrRrtjs0YOHFDbbioouqmZXlQb+z2mgfErPknw==
+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"
@@ -3274,6 +3496,7 @@ cudosjs@^1.2.5:
"@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"
@@ -3373,6 +3596,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"
@@ -3497,7 +3725,7 @@ elegant-spinner@^1.0.1:
resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e"
integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=
-elliptic@^6.5.3:
+elliptic@^6.4.0, elliptic@^6.5.3:
version "6.5.4"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==
@@ -4174,6 +4402,11 @@ file-entry-cache@^6.0.1:
dependencies:
flat-cache "^3.0.4"
+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"
@@ -4509,6 +4742,15 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"
+hash-base@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33"
+ integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==
+ dependencies:
+ inherits "^2.0.4"
+ readable-stream "^3.6.0"
+ safe-buffer "^5.2.0"
+
hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42"
@@ -4597,7 +4839,7 @@ iconv-lite@^0.4.24:
dependencies:
safer-buffer ">= 2.1.2 < 3"
-ieee754@^1.1.13:
+ieee754@^1.1.13, ieee754@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
@@ -4658,7 +4900,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
-inherits@2, inherits@^2.0.3, inherits@^2.0.4:
+inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
@@ -5408,6 +5650,15 @@ matchmediaquery@^0.3.0:
dependencies:
css-mediaquery "^0.1.2"
+md5.js@^1.3.4:
+ version "1.3.5"
+ resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
+ integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==
+ dependencies:
+ hash-base "^3.0.0"
+ inherits "^2.0.1"
+ safe-buffer "^5.1.2"
+
mdast-util-definitions@^5.0.0:
version "5.1.1"
resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-5.1.1.tgz#2c1d684b28e53f84938bb06317944bee8efa79db"
@@ -5929,6 +6180,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.3:
version "3.3.4"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"
@@ -6392,7 +6648,7 @@ property-information@^6.0.0:
resolved "https://registry.yarnpkg.com/property-information/-/property-information-6.2.0.tgz#b74f522c31c097b5149e3c3cb8d7f3defd986a1d"
integrity sha512-kma4U7AFCTwpqq5twzC1YVIDXSqg6qQK6JN0smOw8fgRy1OkMi0CYSzFmsy6dnqSenamAtj0CyXMUJ1Mf6oROg==
-protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.3:
+protobufjs@^6.11.2, protobufjs@^6.11.3, protobufjs@^6.8.8, 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==
@@ -6647,6 +6903,15 @@ readable-stream@^3.4.0:
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
+readable-stream@^3.6.0:
+ version "3.6.2"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
+ integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
+ dependencies:
+ inherits "^2.0.3"
+ string_decoder "^1.1.1"
+ util-deprecate "^1.0.1"
+
readdirp@~3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
@@ -6882,6 +7147,14 @@ rimraf@^3.0.2:
dependencies:
glob "^7.1.3"
+ripemd160@^2.0.0, ripemd160@^2.0.1:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c"
+ integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==
+ dependencies:
+ hash-base "^3.0.0"
+ inherits "^2.0.1"
+
rollup@^2.59.0:
version "2.72.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.72.1.tgz#861c94790537b10008f0ca0fbc60e631aabdd045"
@@ -6922,7 +7195,7 @@ sade@^1.7.3:
dependencies:
mri "^1.1.0"
-safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0:
+safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
@@ -6994,6 +7267,14 @@ setimmediate@^1.0.5:
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=
+sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8:
+ version "2.4.11"
+ resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7"
+ integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==
+ dependencies:
+ inherits "^2.0.1"
+ safe-buffer "^5.0.1"
+
shallow-equal@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da"
@@ -7363,6 +7644,17 @@ through@^2.3.6, through@^2.3.8:
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
+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"
@@ -7504,6 +7796,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.5.4:
version "4.6.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9"
@@ -7653,6 +7950,11 @@ util-deprecate@^1.0.1:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
+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==
+
uvu@^0.5.0:
version "0.5.6"
resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.6.tgz#2754ca20bcb0bb59b64e9985e84d2e81058502df"
@@ -7776,6 +8078,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"