diff --git a/src/api/borrow.ts b/src/api/borrow.ts index 1c95ed1ac7..e2a727a21c 100644 --- a/src/api/borrow.ts +++ b/src/api/borrow.ts @@ -1,7 +1,7 @@ import { UiPoolDataProvider } from "@aave/contract-helpers" import { formatReserves, formatUserSummary } from "@aave/math-utils" import { useQuery } from "@tanstack/react-query" -import { isTestnetRpcUrl } from "api/provider" +import { isPaseoRpcUrl, isTestnetRpcUrl } from "api/provider" import { useRpcProvider } from "providers/rpcProvider" import { useMemo } from "react" import { @@ -18,6 +18,9 @@ export const useBorrowContractAddresses = () => { return useMemo(() => { if (!isLoaded) return null + if (isPaseoRpcUrl(evm.connection.url)) { + return AaveV3HydrationMainnet + } const isTestnet = isTestnetRpcUrl(evm.connection.url) return isTestnet ? AaveV3HydrationTestnet : AaveV3HydrationMainnet }, [evm, isLoaded]) diff --git a/src/api/provider.ts b/src/api/provider.ts index 847544396f..40656fdcc3 100644 --- a/src/api/provider.ts +++ b/src/api/provider.ts @@ -41,7 +41,7 @@ export type TFeatureFlags = { dispatchPermit: boolean } & { [key: string]: boolean } -export const PASEO_WS_URL = "paseo-rpc.play.hydration.cloud" +export const PASEO_WS_URL = "wss://paseo-rpc.play.hydration.cloud" const defaultProvider: Omit = { indexerUrl: "https://explorer.hydradx.cloud/graphql", @@ -130,7 +130,7 @@ export const PROVIDERS: ProviderProps[] = [ }, { name: "Paseo", - url: `wss://${PASEO_WS_URL}`, + url: PASEO_WS_URL, indexerUrl: "https://explorer.hydradx.cloud/graphql", squidUrl: "https://galacticcouncil.squids.live/hydration-paseo-pools:prod/api/graphql", @@ -163,6 +163,8 @@ export const isTestnetRpcUrl = (rpcUrl: string) => { return dataEnv === "testnet" } +export const isPaseoRpcUrl = (rpcUrl: string) => rpcUrl === PASEO_WS_URL + export async function getBestProvider(): Promise { const controller = new AbortController() const signal = controller.signal diff --git a/src/components/Toast/sidebar/referendums/ToastSidebarReferendums.utils.ts b/src/components/Toast/sidebar/referendums/ToastSidebarReferendums.utils.ts index 05ccb294eb..025d850d6b 100644 --- a/src/components/Toast/sidebar/referendums/ToastSidebarReferendums.utils.ts +++ b/src/components/Toast/sidebar/referendums/ToastSidebarReferendums.utils.ts @@ -1,4 +1,5 @@ import { OpenGovReferendum, TAccountVote } from "api/democracy" +import { groupBy } from "utils/rx" type OpenGovReferendumWithVoted = OpenGovReferendum & { readonly hasVoted: boolean @@ -16,7 +17,7 @@ export const splitReferendaByVoted = ( }, ) - const openGovGroup = Object.groupBy(openGovWithVoted, (referendum) => + const openGovGroup = groupBy(openGovWithVoted, (referendum) => String(referendum.hasVoted), ) diff --git a/src/sections/lending/ui/reserve-overview/BorrowInfo.tsx b/src/sections/lending/ui/reserve-overview/BorrowInfo.tsx index 2009c12a99..1f82296fdf 100644 --- a/src/sections/lending/ui/reserve-overview/BorrowInfo.tsx +++ b/src/sections/lending/ui/reserve-overview/BorrowInfo.tsx @@ -218,7 +218,9 @@ export const BorrowInfo = ({   diff --git a/src/sections/lending/ui/table/borrow-assets/BorrowAssetsTable.tsx b/src/sections/lending/ui/table/borrow-assets/BorrowAssetsTable.tsx index 8a2898f5b4..7369ea267a 100644 --- a/src/sections/lending/ui/table/borrow-assets/BorrowAssetsTable.tsx +++ b/src/sections/lending/ui/table/borrow-assets/BorrowAssetsTable.tsx @@ -24,6 +24,7 @@ import { } from "sections/lending/ui/table/borrow-assets/BorrowAssetsTable.utils" import { useAccount } from "sections/web3-connect/Web3Connect.utils" import { theme } from "theme" +import { groupBy } from "utils/rx" export const BorrowAssetsTable = () => { const { t } = useTranslation() @@ -35,7 +36,7 @@ export const BorrowAssetsTable = () => { const { account } = useAccount() const { hollar = [], assets = [] } = useMemo(() => { - return Object.groupBy(data, (reserve) => + return groupBy(data, (reserve) => displayGho({ symbol: reserve.symbol, currentMarket }) ? "hollar" : "assets", diff --git a/src/sections/lending/utils/marketsAndNetworksConfig.ts b/src/sections/lending/utils/marketsAndNetworksConfig.ts index 1274442120..a6777f1065 100644 --- a/src/sections/lending/utils/marketsAndNetworksConfig.ts +++ b/src/sections/lending/utils/marketsAndNetworksConfig.ts @@ -17,7 +17,11 @@ import { } from "sections/lending/ui-config/networksConfig" import { RotationProvider } from "./rotationProvider" import { ProviderWithSend, wssToHttps } from "sections/lending/utils/utils" -import { isTestnetRpcUrl, useProviderRpcUrlStore } from "api/provider" +import { + isPaseoRpcUrl, + isTestnetRpcUrl, + useProviderRpcUrlStore, +} from "api/provider" import { useProtocolDataContext } from "sections/lending/hooks/useProtocolDataContext" import { useEffect } from "react" @@ -69,7 +73,13 @@ export const availableMarkets = Object.keys(marketsData).filter((key) => ) as CustomMarket[] export const getInitialMarket = () => { - const isTestnet = isTestnetRpcUrl(getRpcUrls()[0]) + const bestRpcUrl = getRpcUrls()[0] + + if (isPaseoRpcUrl(bestRpcUrl)) { + return CustomMarket.hydration_v3 + } + + const isTestnet = isTestnetRpcUrl(bestRpcUrl) return isTestnet ? CustomMarket.hydration_testnet_v3 : CustomMarket.hydration_v3