Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename and update dHEDGE/Velodrome link constants #302

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: rename and update dHEDGE/Velodrome link constants
dimlbc committed Apr 11, 2024
commit 83a422e2ef0d18308d6af1bae2c4df16864093c7
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
TREASURY_YIELD_VAULT_LINK,
VELODROME_DAPP_LINK,
} from '@frontend/shared-constants';
import { Warning } from '@frontend/shared-icons';
import { OpenAccountModalButton } from '@frontend/shared-providers';
import { MotionStack } from '@frontend/shared-ui';
@@ -39,7 +43,7 @@ export const InputStep = (props: MotionStackProps) => {
{
yield: (
<Link
href="https://app.dhedge.org/vault/0x0f6eae52ae1f94bc759ed72b201a2fdb14891485"
href={TREASURY_YIELD_VAULT_LINK}
target="_blank"
rel="noopener noreferrer"
>
@@ -91,7 +95,7 @@ export const InputStep = (props: MotionStackProps) => {
})}
</Typography>
<Button
href="https://app.velodrome.finance/swap?from=0x929b939f8524c3be977af57a4a0ad3fb1e374b50&to=0x7f5c764cbc14f9669b88837ca1490cca17c31607"
href={`${VELODROME_DAPP_LINK}/swap?from=0x929b939f8524c3be977af57a4a0ad3fb1e374b50&to=0x7f5c764cbc14f9669b88837ca1490cca17c31607`}
target="_blank"
rel="noopener noreferrer"
size="large"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { TREASURY_YIELD_VAULT_LINK } from '@frontend/shared-constants';
import { MotionStack } from '@frontend/shared-ui';
import { Button, Stack, Typography } from '@mui/material';
import { useIntl } from 'react-intl';
@@ -35,7 +36,7 @@ export const WithdrawStep = (props: MotionStackProps) => {
</Typography>
<Stack direction="row" my={4} justifyContent="center" alignItems="center">
<Button
href="https://app.dhedge.org/vault/0x0f6eae52ae1f94bc759ed72b201a2fdb14891485"
href={TREASURY_YIELD_VAULT_LINK}
target="_blank"
rel="noopener noreferrer"
>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useIsDhedgePool } from '@dhedge/core-ui-kit/hooks/pool';
import { torosDappLink } from '@frontend/shared-constants';
import { TOROS_DAPP_LINK } from '@frontend/shared-constants';
import { Toros } from '@frontend/shared-icons';
import { AddressLabel, TokenIconRevamp } from '@frontend/shared-ui';
import { Grid, Link, Stack, Typography, useTheme } from '@mui/material';
@@ -57,7 +57,7 @@ export const TokenItem: FC<AssetItemProps> = ({
assets and strategy.
</Typography>
<Link
href={`${torosDappLink}/vault/${tokenAddress}`}
href={`${TOROS_DAPP_LINK}/vault/${tokenAddress}`}
target="_blank"
rel="noreferrer"
sx={{
4 changes: 2 additions & 2 deletions libs/mstable/vault/src/queries.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dHedgeApiEndpoint } from '@frontend/shared-constants';
import { DHEDGE_API_ENDPOINT } from '@frontend/shared-constants';
import { fetcher } from '@frontend/shared-utils';
import { useQuery } from '@tanstack/react-query';

@@ -55,7 +55,7 @@ export const useFundQuery = (
useQuery<FundQuery, Error>(
['fund', variables.address],
fetcher<FundQuery, FundQueryVariables>(
dHedgeApiEndpoint,
DHEDGE_API_ENDPOINT,
{},
fundQueryDocument,
variables,
7 changes: 4 additions & 3 deletions libs/shared/constants/src/dhedge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const dHedgeApiEndpoint = 'https://api-v2.dhedge.org/graphql';
export const DHEDGE_API_ENDPOINT = 'https://api-v2.dhedge.org/graphql';

export const torosDappLink = 'https://toros.finance';
export const dHEDGEDappLink = 'https://app.dhedge.org';
export const TOROS_DAPP_LINK = 'https://toros.finance';
export const DHEDGE_DAPP_LINK = 'https://dhedge.org';
export const TREASURY_YIELD_VAULT_LINK = `${DHEDGE_DAPP_LINK}/vault/0x0f6eae52ae1f94bc759ed72b201a2fdb14891485`;
6 changes: 1 addition & 5 deletions libs/shared/constants/src/velodrome.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
export const VELODROME_PAIRS_API_ENDPOINT =
'https://api.velodrome.finance/api/v1/pairs';

export const VELODROME_ASSETS_API_ENDPOINT =
'https://api.velodrome.finance/api/v1/assets';
export const VELODROME_DAPP_LINK = 'https://velodrome.finance/';
4 changes: 2 additions & 2 deletions libs/shared/hooks/src/queries/useAllFundsByInvestorQuery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dHedgeApiEndpoint } from '@frontend/shared-constants';
import { DHEDGE_API_ENDPOINT } from '@frontend/shared-constants';
import { FundByInvestor } from '@frontend/shared-types';
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
import { Address } from '@dhedge/core-ui-kit/types';
@@ -30,7 +30,7 @@ export const useAllFundsByInvestorQuery = (
useQuery<AllFundsByInvestorQuery, Error>(
['allFundsByInvestor', variables.address],
fetcher<AllFundsByInvestorQuery, AllFundsByInvestorQueryVariables>(
dHedgeApiEndpoint,
DHEDGE_API_ENDPOINT,
{},
allFundsByInvestorQueryDocument,
variables,
4 changes: 2 additions & 2 deletions libs/shared/hooks/src/queries/useCustomCurrencyRoiQuery.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
import { dHedgeApiEndpoint } from '@frontend/shared-constants';
import { DHEDGE_API_ENDPOINT } from '@frontend/shared-constants';
import { fetcher } from '@frontend/shared-utils';

interface CustomCurrencyRoiVariables {
@@ -36,7 +36,7 @@ export const useCustomCurrencyRoiQuery = (
useQuery<CustomCurrencyRoiQuery, Error>(
['getYieldPnl', variables.vaultAddress, variables.investorAddress],
fetcher<CustomCurrencyRoiQuery, CustomCurrencyRoiVariables>(
dHedgeApiEndpoint,
DHEDGE_API_ENDPOINT,
{},
customCurrencyRoiQueryDocument,
variables,
4 changes: 2 additions & 2 deletions libs/shared/hooks/src/queries/useTokenPriceHistoryQuery.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import type {
TokenPriceHistoryQuery,
TokenPriceHistoryQueryVariables,
} from '@frontend/shared-types';
import { dHedgeApiEndpoint } from '@frontend/shared-constants';
import { DHEDGE_API_ENDPOINT } from '@frontend/shared-constants';
import { fetcher } from '@frontend/shared-utils';

export const tokenPriceHistoryQueryDocument = `
@@ -24,7 +24,7 @@ export const useTokenPriceHistoryQuery = (
useQuery<TokenPriceHistoryQuery, Error>(
['tokenPriceHistory', variables.address, variables.period],
fetcher<TokenPriceHistoryQuery, TokenPriceHistoryQueryVariables>(
dHedgeApiEndpoint,
DHEDGE_API_ENDPOINT,
{},
tokenPriceHistoryQueryDocument,
variables,
4 changes: 2 additions & 2 deletions libs/shared/services/src/simulateTransaction.ts
Original file line number Diff line number Diff line change
@@ -3,10 +3,10 @@ import {
SimulateTransactionParams,
SimulateTransactionResponse,
} from '@dhedge/core-ui-kit/types';
import { torosDappLink } from '@frontend/shared-constants';
import { TOROS_DAPP_LINK } from '@frontend/shared-constants';

export const simulateTransaction = (body: SimulateTransactionParams) =>
axios.post<{ data: SimulateTransactionResponse; message: string }>(
`${torosDappLink}/api/simulate-transaction`,
`${TOROS_DAPP_LINK}/api/simulate-transaction`,
body,
);