diff --git a/package.json b/package.json
index 2191972c..4f18c00e 100644
--- a/package.json
+++ b/package.json
@@ -20,10 +20,6 @@
"engines": {
"node": ">=20.0.0"
},
- "peerDependencies": {
- "react": "^18.2.0",
- "react-dom": "^18.2.0"
- },
"dependencies": {
"@apollo/client": "^3.7.17",
"@coinbase/wallet-sdk": "^3.7.1",
@@ -31,8 +27,8 @@
"@ethersproject/address": "^5.0.10",
"@ethersproject/experimental": "5.4.0",
"@ethersproject/providers": "5.4.5",
- "@opendollar/sdk": "1.7.4-rc.1",
- "@opendollar/svg-generator": "1.0.5",
+ "@opendollar/sdk": "1.7.4-rc.3",
+ "@opendollar/svg-generator": "1.7.4",
"@react-spring/web": "^9.7.3",
"@sentry/cli": "^2.31.0",
"@sentry/integrations": "^7.112.2",
@@ -58,23 +54,23 @@
"easy-peasy": "^5.1.0",
"ethers": "5.4.7",
"graphql": "^16.8.1",
- "i18next": "^19.7.0",
+ "i18next": "^23.11.5",
"jazzicon": "^1.5.0",
"numeral": "^2.0.6",
- "react": "^17.0.1",
+ "react": "^18.3.1",
"react-confetti": "^6.0.1",
"react-cookie-consent": "^5.2.0",
"react-copy-to-clipboard": "^5.0.2",
"react-custom-scrollbars": "^4.2.1",
"react-device-detect": "^1.13.1",
- "react-dom": "^17.0.1",
+ "react-dom": "^18.3.1",
"react-feather": "^2.0.9",
"react-helmet-async": "^1.0.7",
"react-i18next": "^11.7.2",
"react-loading-skeleton": "^3.4.0",
"react-number-format": "^5.2.2",
"react-paginate": "^6.5.0",
- "react-router-dom": "^5.3.0",
+ "react-router-dom": "^6.24.1",
"react-scripts": "5.0.1",
"react-toastify": "^6.0.9",
"react-tooltip": "^5.21.1",
@@ -82,6 +78,7 @@
"siwe": "^2.3.2",
"styled-components": "^5.2.0",
"terser-webpack-plugin": "^5.3.10",
+ "tiny-invariant": "^1.3.3",
"typescript": "^4.4.3"
},
"devDependencies": {
diff --git a/public/index.html b/public/index.html
index bd43f768..2dea807c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -8,7 +8,7 @@
script-src 'self' blob: https://kb.wowto.ai https://app.wowto.ai http://cdn.matomo.cloud/usekeyp.matomo.cloud/matomo.js https://cdn.matomo.cloud/usekeyp.matomo.cloud/matomo.js https://cdn.matomo.cloud/matomo.js https://usekeyp.matomo.cloud/matomo.js;
media-src 'self';
img-src 'self' data: blob: https://explorer-api.walletconnect.com https://usekeyp.matomo.cloud https://app.opendollar.com;
- connect-src 'self' blob: https://eth-pokt.nodies.app http://localhost:3000 https://*.quiknode.pro https://api.opensea.io https://api.fuul.xyz https://api.camelot.exchange https://opt-mainnet.g.alchemy.com https://arb-mainnet.g.alchemy.com https://mainnet.optimism.io/ https://eth.llamarpc.com https://base.llamarpc.com https://polygon-bor-rpc.publicnode.com https://eth-pokt.nodies.app https://polygon-pokt.nodies.app https://op-pokt.nodies.app https://arb-pokt.nodies.app https://holy-damp-firefly.arbitrum-mainnet.quiknode.pro https://api.studio.thegraph.com https://od-subgraph-node-image.onrender.com https://usekeyp.matomo.cloud https://o1016103.ingest.us.sentry.io/api/4507153379295232/envelope/ https://o1016103.ingest.us.sentry.io/api/4507153379295232/security/ https://arbitrum-sepolia.infura.io https://arbitrum-sepolia.blockpi.network/v1/rpc/public https://arbitrum.blockpi.network/v1/rpc/public https://optimism.blockpi.network wss://relay.walletconnect.com/ https://verify.walletconnect.org wss://www.walletlink.org/rpc https://explorer-api.walletconnect.com https://chain-proxy.wallet.coinbase.com https://rpc.walletconnect.com https://bot.opendollar.com https://bot.dev.opendollar.com https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai https://api.country.is/ ;
+ connect-src 'self' blob: https://virtual.arbitrum.rpc.tenderly.co https://eth-pokt.nodies.app http://localhost:3000 https://*.quiknode.pro https://api.opensea.io https://api.fuul.xyz https://api.camelot.exchange https://opt-mainnet.g.alchemy.com https://arb-mainnet.g.alchemy.com https://mainnet.optimism.io/ https://eth.llamarpc.com https://base.llamarpc.com https://polygon-bor-rpc.publicnode.com https://eth-pokt.nodies.app https://polygon-pokt.nodies.app https://op-pokt.nodies.app https://arb-pokt.nodies.app https://holy-damp-firefly.arbitrum-mainnet.quiknode.pro https://api.studio.thegraph.com https://od-subgraph-node-image.onrender.com https://usekeyp.matomo.cloud https://o1016103.ingest.us.sentry.io/api/4507153379295232/envelope/ https://o1016103.ingest.us.sentry.io/api/4507153379295232/security/ https://arbitrum-sepolia.infura.io https://arbitrum-sepolia.blockpi.network/v1/rpc/public https://arbitrum.blockpi.network/v1/rpc/public https://optimism.blockpi.network wss://relay.walletconnect.com/ https://verify.walletconnect.org wss://www.walletlink.org/rpc https://explorer-api.walletconnect.com https://chain-proxy.wallet.coinbase.com https://rpc.walletconnect.com https://bot.opendollar.com https://bot.dev.opendollar.com https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai https://api.country.is/ ;
object-src 'self' blob:;
form-action 'self';
font-src 'self' data: https://fonts.gstatic.com;
@@ -61,7 +61,7 @@
-
+
diff --git a/src/App.tsx b/src/App.tsx
index 03a634a8..a077dd92 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,7 +1,7 @@
import React, { useEffect, lazy, Suspense } from 'react'
import i18next from 'i18next'
import { I18nextProvider } from 'react-i18next'
-import { Redirect, Route, Switch, useLocation } from 'react-router-dom'
+import { Route, Routes, useLocation } from 'react-router-dom'
import { ThemeProvider } from 'styled-components'
import ErrorBoundary from './ErrorBoundary'
import GlobalStyle from './GlobalStyle'
@@ -15,7 +15,6 @@ import { lightTheme } from './utils/themes/light'
import { StatsProvider } from './hooks/useStats'
import { ApolloProvider } from '@apollo/client'
import { client } from './utils/graph'
-import GoogleTagManager from './components/Analytics/GoogleTagManager'
import CreateVault from './containers/Vaults/CreateVault'
import Auctions from './containers/Auctions'
import Analytics from './containers/Analytics'
@@ -73,46 +72,43 @@ const App = () => {
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ } path="/404" />
+ } path={'/'} />
+ } path={'/maintenance'} />
+ } path={'/earn'} />
+ } path={'/bolts'} />
+ } path={'/stats'} />
+ } path={'/explore'} />
}
+ path={'/geoblock'}
/>
+ } path={'/auctions'} />
+ } path={'/marketplace'} />
}
+ path={'/vaults/create'}
/>
-
-
-
-
+ } path={'/bridge'} />
}
+ path={'/vaults/:id/deposit'}
/>
-
-
+ } path={'/vaults/:id/withdraw'} />
+ } path={'/vaults/:id'} />
+ } path={'/earn/:id'} />
+ } path={'/vaults'} />
+ } path={'/:address'} />
+ } path={'/deposit/:token/deposit'} />
+ } />
+
diff --git a/src/assets/grt.svg b/src/assets/grt.svg
new file mode 100644
index 00000000..c9c33753
--- /dev/null
+++ b/src/assets/grt.svg
@@ -0,0 +1,11 @@
+
diff --git a/src/chains.ts b/src/chains.ts
index 47783e05..51a60f47 100644
--- a/src/chains.ts
+++ b/src/chains.ts
@@ -28,7 +28,7 @@ const ETH: AddEthereumChainParameter['nativeCurrency'] = {
export const RPC_URL_ETHEREUM = process.env.REACT_APP_RPC_URL_ETHEREUM
? process.env.REACT_APP_RPC_URL_ETHEREUM
: 'https://eth.llamarpc.com'
-export const RPC_URL_ARBITRUM = 'https://arbitrum.blockpi.network/v1/rpc/public'
+export const RPC_URL_ARBITRUM = RPC_URL || 'https://arbitrum.blockpi.network/v1/rpc/public'
export const RPC_URL_OPTIMISM = 'https://op-pokt.nodies.app'
export const RPC_URL_POLYGON = 'https://polygon-bor-rpc.publicnode.com'
export const RPC_URL_BASE = 'https://base.llamarpc.com'
diff --git a/src/components/Analytics/GoogleTagManager.tsx b/src/components/Analytics/GoogleTagManager.tsx
index cd748f93..1bc47162 100644
--- a/src/components/Analytics/GoogleTagManager.tsx
+++ b/src/components/Analytics/GoogleTagManager.tsx
@@ -1,8 +1,7 @@
import React from 'react'
import { Helmet } from 'react-helmet-async'
-import { RouteComponentProps } from 'react-router-dom'
-const GoogleTagManager = ({ location: { pathname } }: RouteComponentProps) => {
+const GoogleTagManager = ({ location: { pathname } }: { location: { pathname: string } }) => {
return (
{process.env.REACT_APP_GOOGLE_ANALYTICS_ID ? (
diff --git a/src/components/CreateVaultStep.tsx b/src/components/CreateVaultStep.tsx
index 924cad3a..e7d8bd9c 100644
--- a/src/components/CreateVaultStep.tsx
+++ b/src/components/CreateVaultStep.tsx
@@ -10,11 +10,11 @@ interface Props {
btnText: string
handleClick: () => void
isDisabled: boolean
- isLoading: boolean
+ isStepLoading: boolean
id: string
}
-const CreateVaultStep = ({ stepNumber, title, text, isDisabled, isLoading, btnText, handleClick }: Props) => {
+const CreateVaultStep = ({ stepNumber, title, text, isDisabled, isStepLoading, btnText, handleClick }: Props) => {
const { t } = useTranslation()
return (
@@ -27,8 +27,8 @@ const CreateVaultStep = ({ stepNumber, title, text, isDisabled, isLoading, btnTe
diff --git a/src/components/SideMenu.tsx b/src/components/SideMenu.tsx
index b4c97bf2..4438d9c7 100644
--- a/src/components/SideMenu.tsx
+++ b/src/components/SideMenu.tsx
@@ -21,6 +21,7 @@ import WalletIcon from '~/assets/wallet-icon.svg'
import DollarValueInner from './DollarValueInner'
import parachuteIcon from '../assets/parachute-icon.svg'
import { useAddress } from '~/hooks/useAddress'
+import Skeleton from 'react-loading-skeleton'
const SideMenu = () => {
const nodeRef = React.useRef(null)
@@ -47,7 +48,7 @@ const SideMenu = () => {
} = useStoreState((state) => state)
const poolData = usePoolData()
const analyticsData = useAnalyticsData()
- const address = useAddress(account)
+ let address = useAddress(account)
const handleWalletConnect = () => popupsActions.setIsConnectorsWalletOpen(true)
@@ -135,7 +136,6 @@ const SideMenu = () => {
console.log('Error adding ODG to the wallet:', error)
}
}
-
useEffect(() => {
if (chainId !== 421614 && chainId !== 42161 && chainId !== 10) return
if (poolData && analyticsData) {
@@ -180,7 +180,6 @@ const SideMenu = () => {
useEffect(() => {
setIsOpen(popupsState.showSideMenu)
}, [popupsState.showSideMenu])
-
return isOpen ? (
{
>
- {address}
+ {address || }
{`$ ${renderBalance()}`}
diff --git a/src/components/Steps.tsx b/src/components/Steps.tsx
index d7959c18..69a8e346 100644
--- a/src/components/Steps.tsx
+++ b/src/components/Steps.tsx
@@ -1,6 +1,6 @@
import styled from 'styled-components'
import { useTranslation } from 'react-i18next'
-import { useHistory } from 'react-router-dom'
+import { useNavigate } from 'react-router-dom'
import {
useActiveWeb3React,
handleTransactionError,
@@ -21,7 +21,7 @@ const Steps = () => {
const { account, provider, chainId } = useActiveWeb3React()
const geb = useGeb()
const blocksSinceCheck = use10BlocksConfirmations()
- const history = useHistory()
+ const navigate = useNavigate()
const { connectWalletModel: connectWalletState } = useStoreState((state) => state)
const { popupsModel: popupsActions, connectWalletModel: connectWalletActions } = useStoreActions((state) => state)
@@ -65,7 +65,7 @@ const Steps = () => {
const hasGasToken = await checkUserGasBalance(account, provider)
if (!hasGasToken) {
// bridgeModelActions.setReason('No funds for gas fee, please bridge some funds.')
- popupsActions.setIsLowGasModalOpen(true)
+ // popupsActions.setIsLowGasModalOpen(true)
}
connectWalletActions.setIsStepLoading(false)
handleTransactionError(e)
@@ -74,7 +74,7 @@ const Steps = () => {
}
const handleCreateSafe = () => {
- history.push('/vaults/create')
+ navigate('/vaults/create')
}
const returnSteps = (stepNumber: number) => {
diff --git a/src/components/VaultBlock.tsx b/src/components/VaultBlock.tsx
index 43ad3632..dc37c457 100644
--- a/src/components/VaultBlock.tsx
+++ b/src/components/VaultBlock.tsx
@@ -3,48 +3,74 @@ import styled from 'styled-components'
import { returnState, COIN_TICKER, getTokenLogo, formatWithCommas } from '~/utils'
-const VaultBlock = ({ ...props }) => {
+interface VaultBlockProps {
+ id: string
+ riskState: number
+ collateralName: string
+ collateral: string
+ totalDebt: string
+ collateralRatio: string
+ liquidationPrice: string
+ className?: string
+ internalCollateralBalance: string
+}
+
+const VaultBlock = ({
+ id,
+ riskState,
+ collateralName,
+ collateral,
+ totalDebt,
+ collateralRatio,
+ liquidationPrice,
+ className,
+ internalCollateralBalance,
+}: VaultBlockProps) => {
+ const stateClass = returnState(riskState) ? returnState(riskState).toLowerCase() : 'dimmed'
+
return (
-
-
-
+
+
+
-
+
- Vault #{props.id}
+ Vault #{id}
-
-
- {formatWithCommas(props.collateral)}
+
+ {formatWithCommas(collateral)}
-
- {formatWithCommas(props.totalDebt)}
+ {formatWithCommas(totalDebt)}
-
- {`${formatWithCommas(props.collateralRatio)}%`}
+ {`${formatWithCommas(collateralRatio)}%`}
-
- ${formatWithCommas(props.liquidationPrice)}
+ ${formatWithCommas(liquidationPrice)}
- -
+
-
-
{returnState(props.riskState) ? returnState(props.riskState) : 'Closed'}
+ {returnState(riskState) ? returnState(riskState) : 'Closed'}
+ {Number(internalCollateralBalance) > 0 && (
+ -
+
+ {formatWithCommas(internalCollateralBalance)}
+
+ )}
diff --git a/src/components/VaultManager.tsx b/src/components/VaultManager.tsx
index ca8884d5..2c2fd551 100644
--- a/src/components/VaultManager.tsx
+++ b/src/components/VaultManager.tsx
@@ -1,7 +1,7 @@
import { useState } from 'react'
import { isAddress } from '@ethersproject/address'
import { useTranslation } from 'react-i18next'
-import { useHistory } from 'react-router-dom'
+import { useNavigate } from 'react-router-dom'
import styled from 'styled-components'
import { useStoreActions, useStoreState } from '~/store'
@@ -18,7 +18,7 @@ const VaultManager = () => {
const [error, setError] = useState('')
const [value, setValue] = useState('')
- const history = useHistory()
+ const navigate = useNavigate()
const { popupsModel: popupsActions } = useStoreActions((state) => state)
const { tokensData } = useStoreState((state) => state.connectWalletModel)
@@ -49,7 +49,7 @@ const VaultManager = () => {
if (window?.location) {
window.location.assign(`/${value}`)
} else {
- history.push(`/${value}`)
+ navigate(`/${value}`)
}
handleCancel()
await timeout(3000)
diff --git a/src/components/VaultStats.tsx b/src/components/VaultStats.tsx
index 913b2f18..755216ea 100644
--- a/src/components/VaultStats.tsx
+++ b/src/components/VaultStats.tsx
@@ -1,4 +1,4 @@
-import { useMemo } from 'react'
+import React, { useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
import { ExternalLink, Info } from 'react-feather'
@@ -21,6 +21,9 @@ import { generateSvg } from '@opendollar/svg-generator'
import { useWeb3React } from '@web3-react/core'
import { useAddress } from '~/hooks/useAddress'
+import useGeb from '~/hooks/useGeb'
+import Skeleton from 'react-loading-skeleton'
+
const VaultStats = ({
isModifying,
isDeposit,
@@ -38,6 +41,7 @@ const VaultStats = ({
liquidationPrice: newLiquidationPrice,
account,
} = useSafeInfo(isModifying ? (isDeposit ? 'deposit_borrow' : 'repay_withdraw') : 'info')
+ const geb = useGeb()
const { safeModel: safeState } = useStoreState((state) => state)
const { singleSafe, liquidationData } = safeState
@@ -88,7 +92,7 @@ const VaultStats = ({
)
const svg = useMemo(() => generateSvg(statsForSVG), [statsForSVG])
- const address = useAddress(singleSafe?.ownerAddress || account!)
+ let address = useAddress(singleSafe?.ownerAddress || account!)
const returnRedRate = () => {
const currentRedemptionRate = singleSafe ? getRatePercentage(singleSafe.currentRedemptionRate, 10) : '0'
@@ -110,6 +114,21 @@ const VaultStats = ({
return false
}, [isModifying, parsedAmounts.leftInput, parsedAmounts.rightInput])
+ const handleClaimClick = async () => {
+ if (!account) return
+ try {
+ const proxy = await geb.getProxyAction(account)
+ await proxy.collectTokenCollateral(
+ geb.contracts.safeManager.address,
+ geb.contracts.tokenCollateralJoin[collateralName].address,
+ Number(singleSafe?.id),
+ Number(singleSafe?.internalCollateralBalance)
+ )
+ } catch (e) {
+ console.debug(e, 'Error in claiming internal balance')
+ }
+ }
+
return (
<>
@@ -253,10 +272,10 @@ const VaultStats = ({
- {chainId && (
+ {address ? (
{address}
+ ) : (
+
)}
@@ -330,6 +351,23 @@ const VaultStats = ({
{`${returnRedRate()}%`}
+ {Number(singleSafe?.internalCollateralBalance) > 0 ? (
+
+ Internal Balance
+
+
+
+ CLAIM
+
+ {formatWithCommas(singleSafe?.internalCollateralBalance || '0', 2, 2)}
+
+
+ ) : (
+ <>>
+ )}
@@ -531,3 +569,13 @@ const InfoIcon = styled.div`
margin-top: 4px;
}
`
+
+const ClaimLink = styled.span`
+ cursor: pointer;
+ font-family: 'Open Sans', sans-serif;
+ font-size: ${(props) => props.theme.font.xxSmall};
+ text-decoration: underline;
+ color: ${(props) => props.theme.colors.blueish};
+ margin-left: 5px;
+ padding-top: 1px;
+`
diff --git a/src/components/connectorCards/WalletConnectV2Card.tsx b/src/components/connectorCards/WalletConnectV2Card.tsx
index 4853825d..a39f7bb4 100644
--- a/src/components/connectorCards/WalletConnectV2Card.tsx
+++ b/src/components/connectorCards/WalletConnectV2Card.tsx
@@ -19,7 +19,6 @@ import { useEffect, useState } from 'react'
import { MAINNET_CHAINS } from '../../chains'
import { hooks, walletConnectV2 } from '../../connectors/walletConnectV2'
import { Card } from './Card'
-import { useActiveWeb3React } from '~/hooks'
import { useStoreActions } from '~/store'
const CHAIN_IDS = Object.keys(MAINNET_CHAINS).map(Number)
@@ -38,7 +37,6 @@ export default function WalletConnectV2Card({ error, setError }: WalletConnectV2
const isActive = useIsActive()
const provider = useProvider()
const { popupsModel: popupsActions } = useStoreActions((state) => state)
- const { connector } = useActiveWeb3React()
// attempt to connect eagerly on mount
useEffect(() => {
@@ -47,7 +45,7 @@ export default function WalletConnectV2Card({ error, setError }: WalletConnectV2
.then(() => userInitiatedConnection && popupsActions.setIsConnectorsWalletOpen(false))
.catch(() => {})
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [connector])
+ }, [])
// log URI when available
useEffect(() => {
diff --git a/src/containers/Auctions/index.tsx b/src/containers/Auctions/index.tsx
index 4e2a45fe..e288070f 100644
--- a/src/containers/Auctions/index.tsx
+++ b/src/containers/Auctions/index.tsx
@@ -1,8 +1,8 @@
import { useEffect, useState } from 'react'
-import { RouteComponentProps, useHistory } from 'react-router-dom'
+import { useNavigate, useParams, useLocation } from 'react-router-dom'
import styled from 'styled-components'
-import { useActiveWeb3React, handleTransactionError, useStartAuction, useQuery, useGetAuctions } from '~/hooks'
+import { useActiveWeb3React, handleTransactionError, useStartAuction, useGetAuctions } from '~/hooks'
import AlertLabel from '~/components/AlertLabel'
import { AuctionEventType } from '~/types'
import { useStoreActions, useStoreState } from '~/store'
@@ -12,33 +12,26 @@ import { formatNumber } from '~/utils'
import useGeb from '~/hooks/useGeb'
import CollateralAuctionsList from './CollateralAuctions/CollateralAuctionsList'
-const Auctions = ({
- match: {
- params: { auctionType },
- },
-}: RouteComponentProps<{ auctionType?: string }>) => {
- const { account } = useActiveWeb3React()
- const { auctionModel: auctionsActions, popupsModel: popupsActions } = useStoreActions((state) => state)
- const { auctionModel: auctionsState, connectWalletModel: connectWalletState } = useStoreState((state) => state)
- const query = useQuery()
+interface AuctionsProps {
+ className?: string
+}
+
+const Auctions = ({ className }: AuctionsProps) => {
+ const { id } = useParams<{ id: string }>()
+ const auctionType = id ?? ''
+ const location = useLocation()
+ const query = new URLSearchParams(location.search)
const queryType = query.get('type') as AuctionEventType | null
const [type, setType] = useState(queryType || 'COLLATERAL')
const [error, setError] = useState('')
const [isLoading, setIsLoading] = useState(false)
const [selectedItem, setSelectedItem] = useState('WSTETH')
+ const navigate = useNavigate()
+ const { account } = useActiveWeb3React()
const geb = useGeb()
- const history = useHistory()
-
- const getText = () => {
- switch (type) {
- case 'COLLATERAL':
- return 'Collateral auctions are meant to sell collateral that was seized from a vault in exchange for OD. The OD that is received by an auction is burned.'
- case 'SURPLUS':
- return 'Surplus auctions sell OD that has accrued inside the protocol in exchange for ODG. The ODG that is received by an auction is burned.'
- case 'DEBT':
- return 'Debt auctions mint and auction new ODG in exchange for OD. The OD that is received by an auction will be used to eliminate bad (uncovered) debt from the system.'
- }
- }
+ const { auctionModel: auctionsActions, popupsModel: popupsActions } = useStoreActions((state) => state)
+ const { auctionModel: auctionsState, connectWalletModel: connectWalletState } = useStoreState((state) => state)
+ const { proxyAddress } = connectWalletState
const {
startSurplusAcution,
@@ -55,7 +48,16 @@ const Auctions = ({
surplusCooldownDone,
} = useStartAuction()
- const { proxyAddress } = connectWalletState
+ const getText = () => {
+ switch (type) {
+ case 'COLLATERAL':
+ return 'Collateral auctions are meant to sell collateral that was seized from a vault in exchange for OD. The OD that is received by an auction is burned.'
+ case 'SURPLUS':
+ return 'Surplus auctions sell OD that has accrued inside the protocol in exchange for ODG. The ODG that is received by an auction is burned.'
+ case 'DEBT':
+ return 'Debt auctions mint and auction new ODG in exchange for OD. The OD that is received by an auction will be used to eliminate bad (uncovered) debt from the system.'
+ }
+ }
const handleStartSurplusAuction = async () => {
setIsLoading(true)
@@ -93,12 +95,10 @@ const Auctions = ({
const onTabClick = (type: AuctionEventType) => {
const params = new URLSearchParams()
- if (query) {
+ if (type) {
params.append('type', type)
- } else {
- params.delete('type')
}
- history.push({ search: params.toString() })
+ navigate({ search: params.toString() })
setType(type)
}
@@ -144,7 +144,7 @@ const Auctions = ({
}, [auctionsActions, geb, proxyAddress, auctionsState.auctionsData])
return (
-
+
{error ? : null}
Auctions
@@ -262,7 +262,6 @@ const Title = styled.div`
font-size: 34px;
font-weight: 700;
font-family: ${(props) => props.theme.family.headers};
-
color: ${(props) => props.theme.colors.accent};
min-width: 180px;
`
@@ -273,15 +272,12 @@ const Content = styled.div`
button {
display: flex;
align-items: center;
-
min-width: 100px;
padding: 4px 12px;
-
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 2px;
-
color: ${(props) => props.theme.colors.accent};
}
`
diff --git a/src/containers/Bolts/quests.tsx b/src/containers/Bolts/quests.tsx
index 3c8cd215..8247336c 100644
--- a/src/containers/Bolts/quests.tsx
+++ b/src/containers/Bolts/quests.tsx
@@ -5,8 +5,8 @@ import zealyLogo from '~/assets/zealy.svg'
import galxeLogo from '~/assets/galxe.svg'
import camelotLogo from '~/assets/camelot.svg'
import odLogo from '~/assets/od-full-logo-light.svg'
+import { useNavigate } from 'react-router-dom'
import turtleClubLogo from '~/assets/turtle-club.png'
-import { useHistory } from 'react-router-dom'
import TokenIcon from '~/components/TokenIcon'
const StyledAnchor = styled.a`
@@ -96,8 +96,8 @@ const TokensGroup = styled.span`
`
const InternalLinkButton = ({ url }: { url: string }) => {
- const history = useHistory()
- const onClick = () => history.push(url)
+ const navigate = useNavigate()
+ const onClick = () => navigate(url)
return (