Skip to content

Commit

Permalink
Merge pull request #302 from mstable/refactor/update-dhedge-and-velod…
Browse files Browse the repository at this point in the history
…rome-links

refactor: rename and update dHEDGE/Velodrome link constants
  • Loading branch information
dimlbc authored May 16, 2024
2 parents 9a2901c + 83a422e commit 8db5a20
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 23 deletions.
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';
Expand Down Expand Up @@ -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"
>
Expand Down Expand Up @@ -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"
Expand Down
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';
Expand Down Expand Up @@ -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"
>
Expand Down
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';
Expand Down Expand Up @@ -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={{
Expand Down
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';

Expand Down Expand Up @@ -55,7 +55,7 @@ export const useFundQuery = (
useQuery<FundQuery, Error>(
['fund', variables.address],
fetcher<FundQuery, FundQueryVariables>(
dHedgeApiEndpoint,
DHEDGE_API_ENDPOINT,
{},
fundQueryDocument,
variables,
Expand Down
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';
Expand Down Expand Up @@ -30,7 +30,7 @@ export const useAllFundsByInvestorQuery = (
useQuery<AllFundsByInvestorQuery, Error>(
['allFundsByInvestor', variables.address],
fetcher<AllFundsByInvestorQuery, AllFundsByInvestorQueryVariables>(
dHedgeApiEndpoint,
DHEDGE_API_ENDPOINT,
{},
allFundsByInvestorQueryDocument,
variables,
Expand Down
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 {
Expand Down Expand Up @@ -36,7 +36,7 @@ export const useCustomCurrencyRoiQuery = (
useQuery<CustomCurrencyRoiQuery, Error>(
['getYieldPnl', variables.vaultAddress, variables.investorAddress],
fetcher<CustomCurrencyRoiQuery, CustomCurrencyRoiVariables>(
dHedgeApiEndpoint,
DHEDGE_API_ENDPOINT,
{},
customCurrencyRoiQueryDocument,
variables,
Expand Down
4 changes: 2 additions & 2 deletions libs/shared/hooks/src/queries/useTokenPriceHistoryQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand All @@ -24,7 +24,7 @@ export const useTokenPriceHistoryQuery = (
useQuery<TokenPriceHistoryQuery, Error>(
['tokenPriceHistory', variables.address, variables.period],
fetcher<TokenPriceHistoryQuery, TokenPriceHistoryQueryVariables>(
dHedgeApiEndpoint,
DHEDGE_API_ENDPOINT,
{},
tokenPriceHistoryQueryDocument,
variables,
Expand Down
4 changes: 2 additions & 2 deletions libs/shared/services/src/simulateTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);

0 comments on commit 8db5a20

Please sign in to comment.