diff --git a/.env.example b/.env.example index 5eb59ecd..157c8e96 100644 --- a/.env.example +++ b/.env.example @@ -1,16 +1,16 @@ +## Mandatory Environment Variables NEXT_PUBLIC_NETWORK=mainnet +NEXT_PUBLIC_WALLET_CONNECT_ID=abcdefghijklmnopqrstuvwxyz -NEXT_PUBLIC_OSMOSIS_RPC=https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-rpc-front/ -NEXT_PUBLIC_OSMOSIS_REST=https://osmosis-node.marsprotocol.io/GGSFGSFGFG34/osmosis-lcd-front/ +### Optional Environment Variables +NEXT_PUBLIC_OSMOSIS_RPC=https://rpc-osmosis.blockapsis.com/ +NEXT_PUBLIC_OSMOSIS_REST=https://lcd-osmosis.blockapsis.com/ NEXT_PUBLIC_OSMOSIS_TEST_RPC=https://rpc.devnet.osmosis.zone/ NEXT_PUBLIC_OSMOSIS_TEST_REST=https://lcd.devnet.osmosis.zone/ NEXT_PUBLIC_NEUTRON_TEST_RPC=https://rpc-palvus.pion-1.ntrn.tech/ NEXT_PUBLIC_NEUTRON_TEST_REST=https://rest-palvus.pion-1.ntrn.tech/ -NEXT_PUBLIC_WALLET_CONNECT_ID=d93fdffb159bae5ec87d8fee4cdbb045 +### Enable the following environment variables if you have access to the charting library CHARTING_LIBRARY_USERNAME=git_username CHARTING_LIBRARY_ACCESS_TOKEN=access_token -CHARTING_LIBRARY_REPOSITORY=github.com/tradingview/charting_library/ - -NEXT_PUBLIC_PYTH_API=https://mars.rpc.p2p.world/api - +CHARTING_LIBRARY_REPOSITORY=github.com/tradingview/charting_library/ \ No newline at end of file diff --git a/package.json b/package.json index 9731ddba..f0fced92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mars-v2-frontend", - "version": "2.2.1", + "version": "2.2.2", "private": true, "scripts": { "build": "yarn validate-env && next build", @@ -25,9 +25,9 @@ "@keplr-wallet/cosmos": "^0.12.42", "@sentry/nextjs": "^7.94.1", "@splinetool/react-spline": "^2.2.6", - "@splinetool/runtime": "^0.9.521", + "@splinetool/runtime": "^1.0.47", "@tailwindcss/container-queries": "^0.1.1", - "@tanstack/react-table": "^8.10.6", + "@tanstack/react-table": "^8.11.8", "@tippyjs/react": "^4.2.6", "bignumber.js": "^9.1.2", "classnames": "^2.3.2", @@ -45,7 +45,7 @@ "react-qr-code": "^2.0.12", "react-router-dom": "^6.21.3", "react-spring": "^9.7.3", - "react-toastify": "^9.1.3", + "react-toastify": "^10.0.4", "react-use-clipboard": "^1.0.9", "recharts": "^2.10.1", "sharp": "^0.33.2", @@ -60,7 +60,7 @@ "@types/lodash.throttle": "^4.1.8", "@types/node": "^20.10.6", "@types/react": "18.2.41", - "@types/react-dom": "18.2.15", + "@types/react-dom": "18.2.18", "@types/react-helmet": "^6.1.11", "autoprefixer": "^10.4.17", "dotenv": "^16.4.1", @@ -75,6 +75,6 @@ "prettier-plugin-tailwindcss": "^0.5.11", "shelljs": "^0.8.5", "tailwindcss": "^3.3.3", - "typescript": "5.2.2" + "typescript": "5.3.3" } } diff --git a/src/components/Modals/AssetAmountSelectActionModal.tsx b/src/components/Modals/AssetAmountSelectActionModal.tsx index a8f1f2c2..dfa41d9d 100644 --- a/src/components/Modals/AssetAmountSelectActionModal.tsx +++ b/src/components/Modals/AssetAmountSelectActionModal.tsx @@ -1,7 +1,7 @@ import { useCallback, useState } from 'react' import Modal from 'components/Modals/Modal' -import CurrentAccountSummary from 'components/account/CurrentAccountSummary' +import AccountSummaryInModal from 'components/account/AccountSummary/AccountSummaryInModal' import Button from 'components/common/Button' import Card from 'components/common/Card' import Divider from 'components/common/Divider' @@ -10,6 +10,7 @@ import Text from 'components/common/Text' import TokenInputWithSlider from 'components/common/TokenInput/TokenInputWithSlider' import AssetImage from 'components/common/assets/AssetImage' import { BN_ZERO } from 'constants/math' +import useCurrentAccount from 'hooks/accounts/useCurrentAccount' import { BNCoin } from 'types/classes/BNCoin' import { byDenom } from 'utils/array' import { BN } from 'utils/helpers' @@ -38,7 +39,7 @@ export default function AssetAmountSelectActionModal(props: Props) { } = props const [amount, setAmount] = useState(BN_ZERO) const maxAmount = BN(coinBalances.find(byDenom(asset.denom))?.amount ?? 0) - + const account = useCurrentAccount() const handleAmountChange = useCallback( (value: BigNumber) => { setAmount(value) @@ -51,6 +52,7 @@ export default function AssetAmountSelectActionModal(props: Props) { onAction(amount, amount.isEqualTo(maxAmount)) }, [amount, maxAmount, onAction]) + if (!account) return return ( } /> - + ) diff --git a/src/components/Modals/BorrowModal.tsx b/src/components/Modals/BorrowModal.tsx index a526c0f2..1f943315 100644 --- a/src/components/Modals/BorrowModal.tsx +++ b/src/components/Modals/BorrowModal.tsx @@ -29,6 +29,7 @@ import { byDenom } from 'utils/array' import { formatPercent } from 'utils/formatters' import { BN } from 'utils/helpers' import { getDebtAmountWithInterest } from 'utils/tokens' +import AccountSummaryInModal from 'components/account/AccountSummary/AccountSummaryInModal' interface Props { account: Account @@ -347,7 +348,7 @@ function BorrowModal(props: Props) { rightIcon={} /> - + ) diff --git a/src/components/Modals/HLS/Deposit/SubTitles.tsx b/src/components/Modals/HLS/Deposit/SubTitles.tsx index 987f2bac..550d0fae 100644 --- a/src/components/Modals/HLS/Deposit/SubTitles.tsx +++ b/src/components/Modals/HLS/Deposit/SubTitles.tsx @@ -1,5 +1,4 @@ import classNames from 'classnames' -import React from 'react' import DisplayCurrency from 'components/common/DisplayCurrency' import { ExclamationMarkTriangle } from 'components/common/Icons' @@ -40,8 +39,10 @@ export function CollateralSubTitle(props: CollateralSubTitleProps) { if (!props.isOpen && props.amount.isZero()) { return (
- - +
+ +
+ You have not provided any collateral.
@@ -111,8 +112,10 @@ export function SelectAccountSubTitle(props: SelectAccountSubTitleProps) { if (!props.selectedAccountId && props.isSummaryOpen) { return (
- - +
+ +
+ You need to {props.type} an account
diff --git a/src/components/Modals/ModalContentWithSummary.tsx b/src/components/Modals/ModalContentWithSummary.tsx index c06dfbda..e1df5cbd 100644 --- a/src/components/Modals/ModalContentWithSummary.tsx +++ b/src/components/Modals/ModalContentWithSummary.tsx @@ -1,10 +1,10 @@ import classNames from 'classnames' import React from 'react' -import AccountSummary from 'components/account/AccountSummary' import Card from 'components/common/Card' import { CircularProgress } from 'components/common/CircularProgress' import Modal, { ModalProps } from 'components/Modals/Modal' +import AccountSummaryInModal from 'components/account/AccountSummary/AccountSummaryInModal' interface Props extends ModalProps { isHls?: boolean @@ -46,7 +46,7 @@ export default function ModalContentWithSummary(props: Props) { > {props.subHeader && props.subHeader} {modalContent(props.content, props.isContentCard, props.account)} - {props.account && } + {props.account && } ) } diff --git a/src/components/Modals/Vault/VaultModalContent.tsx b/src/components/Modals/Vault/VaultModalContent.tsx index 4a11fb10..83a003a5 100644 --- a/src/components/Modals/Vault/VaultModalContent.tsx +++ b/src/components/Modals/Vault/VaultModalContent.tsx @@ -1,11 +1,11 @@ import { useCallback, useMemo, useState } from 'react' -import Accordion from 'components/common/Accordion' -import AccountSummary from 'components/account/AccountSummary' import VaultBorrowings from 'components/Modals/Vault/VaultBorrowings' import VaultBorrowingsSubTitle from 'components/Modals/Vault/VaultBorrowingsSubTitle' import VaultDeposit from 'components/Modals/Vault/VaultDeposits' import VaultDepositSubTitle from 'components/Modals/Vault/VaultDepositsSubTitle' +import AccountSummaryInModal from 'components/account/AccountSummary/AccountSummaryInModal' +import Accordion from 'components/common/Accordion' import Text from 'components/common/Text' import { BN_ZERO } from 'constants/math' import useAllAssets from 'hooks/assets/useAllAssets' @@ -177,8 +177,7 @@ export default function VaultModalContent(props: Props) { }, ]} /> - - + ) } diff --git a/src/components/Wallet/WalletConnectButton.tsx b/src/components/Wallet/WalletConnectButton.tsx index 54c71755..08bb00ef 100644 --- a/src/components/Wallet/WalletConnectButton.tsx +++ b/src/components/Wallet/WalletConnectButton.tsx @@ -28,7 +28,7 @@ export default function WalletConnectButton(props: Props) { return (