fix: testnet explorer url

This commit is contained in:
DIYgod
2024-10-21 03:54:36 +08:00
parent c1582f9e95
commit 133a067840
4 changed files with 17 additions and 6 deletions
+10
View File
@@ -313,3 +313,13 @@ export const getLevelMultiplier = (level: number) => {
return (poolMultiplier / rangeMultiplier).toFixed(0)
}
export const getBlockchainExplorerUrl = () => {
const serverConfigs = getServerConfigs()
if (serverConfigs?.IS_RSS3_TESTNET) {
return `https://scan.testnet.rss3.io`
} else {
return `https://scan.rss3.io`
}
}
@@ -8,7 +8,7 @@ import { Divider } from "~/components/ui/divider"
import { LoadingWithIcon } from "~/components/ui/loading"
import { Tooltip, TooltipContent, TooltipPortal, TooltipTrigger } from "~/components/ui/tooltip"
import { apiClient } from "~/lib/api-fetch"
import { cn } from "~/lib/utils"
import { cn, getBlockchainExplorerUrl } from "~/lib/utils"
import { SettingSectionTitle } from "~/modules/settings/section"
import { ActivityPoints } from "~/modules/wallet/activity-points"
import { Balance } from "~/modules/wallet/balance"
@@ -66,7 +66,7 @@ export const MyWalletSection = () => {
<a
className="underline"
target="_blank"
href="https://scan.rss3.io/token/0xE06Af68F0c9e819513a6CD083EF6848E76C28CD8"
href={`${getBlockchainExplorerUrl()}/token/0xE06Af68F0c9e819513a6CD083EF6848E76C28CD8`}
rel="noreferrer noopener"
/>
),
@@ -76,7 +76,7 @@ export const MyWalletSection = () => {
<SettingSectionTitle margin="compact" title={t("wallet.address.title")} />
<div className="group flex items-center gap-2 text-sm">
<a
href={`https://scan.rss3.io/address/${myWallet.address}`}
href={`${getBlockchainExplorerUrl()}/address/${myWallet.address}`}
target="_blank"
className="underline"
>
@@ -19,7 +19,7 @@ import { Tabs, TabsList, TabsTrigger } from "~/components/ui/tabs"
import { Tooltip, TooltipContent, TooltipPortal, TooltipTrigger } from "~/components/ui/tooltip"
import { EllipsisHorizontalTextWithTooltip } from "~/components/ui/typography"
import { replaceImgUrlIfNeed } from "~/lib/img-proxy"
import { cn } from "~/lib/utils"
import { cn, getBlockchainExplorerUrl } from "~/lib/utils"
import { TransactionTypes } from "~/models/types"
import { usePresentUserProfileModal } from "~/modules/profile/hooks"
import { SettingSectionTitle } from "~/modules/settings/section"
@@ -103,7 +103,7 @@ export const TransactionsSection: Component = ({ className }) => {
<TooltipTrigger>
<a
target="_blank"
href={`https://scan.rss3.io/tx/${row.hash}`}
href={`${getBlockchainExplorerUrl()}/tx/${row.hash}`}
className="underline"
>
{row.hash.slice(0, 10)}...
@@ -122,7 +122,7 @@ export const TransactionsSection: Component = ({ className }) => {
{!!transactions.data?.length && (
<a
className="my-2 w-full text-sm text-zinc-400 underline"
href={`https://scan.rss3.io/address/${myWallet.address}`}
href={`${getBlockchainExplorerUrl()}/address/${myWallet.address}`}
target="_blank"
>
{t("wallet.transactions.more")}
+1
View File
@@ -4454,6 +4454,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
INVITATION_INTERVAL_DAYS: number;
INVITATION_PRICE: number;
DAILY_POWER_SUPPLY: number;
IS_RSS3_TESTNET: boolean;
};
};
outputFormat: "json" | "text";