Skip to content

Commit

Permalink
Add custom coingecko url (#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinoConti authored Feb 20, 2025
1 parent 00dac07 commit 061a3cc
Show file tree
Hide file tree
Showing 8 changed files with 9,779 additions and 15,176 deletions.
24,911 changes: 9,739 additions & 15,172 deletions apps/connect/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@mui/material": "^5.12.1",
"@tanstack/react-query": "^5.14.2",
"@wormhole-foundation/sdk": "^1.7.0",
"@wormhole-foundation/wormhole-connect": "^2.1.0-beta.0-development",
"@wormhole-foundation/wormhole-connect": "^2.1.0-beta.4-development",
"bech32": "^2.0.0",
"dompurify": "^3.0.6",
"ethers": "^5.6.8",
Expand Down
2 changes: 0 additions & 2 deletions apps/connect/src/env/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const CLUSTER = envVars.VITE_APP_CLUSTER || "Testnet";
export const wormholeConnectConfigCommon: Partial<WormholeConnectConfig> = {
ui: {
title: "",
// cctpWarning: "",
walletConnectProjectId: envVars.VITE_APP_WALLET_CONNECT_PROJECT_ID || "",
explorer: {
href: `https://wormholescan.io/#/txs?address={:address}&network=${CLUSTER}`,
Expand All @@ -53,7 +52,6 @@ export const wormholeConnectConfigCommon: Partial<WormholeConnectConfig> = {
showInProgressWidget: true,
},
network: CLUSTER,
coinGeckoApiKey: "CG-7gk3AnREWCyuM7EsWSqWPDLW",
rpcs: {},
};

Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/env/token-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const ENV: Env = {
// href: ADVANCE_TOOLS_HREF_TEMPLATE,
// },
// },
chains: [...chains, "Solana", "Injective", "Klaytn"],
chains: [...chains, "Solana", "Injective", "Klaytn", "Berachain"],
moreNetworks: {
href: ADVANCE_TOOLS_HREF_TEMPLATE,
target: "_blank",
Expand Down
1 change: 1 addition & 0 deletions apps/connect/src/env/usdc-bridge.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const ENV: Env = {
"Sui",
"Aptos",
"Unichain",
"Berachain",
],
}
),
Expand Down
1 change: 1 addition & 0 deletions apps/connect/src/env/usdc-bridge.testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const ENV: Env = {
"Sui",
"Aptos",
"Unichain",
"Berachain",
],
}
),
Expand Down
3 changes: 3 additions & 0 deletions apps/connect/src/hooks/useConnectConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export const useConnectConfig = () => {
const config = useMemo(
() => ({
...defaultConfig,
coingecko: {
customUrl: "https://bff.wormholescan.io/coingeckoCall",
},
chains: networks!,
ui: {
...(defaultConfig.ui as NonNullable<WormholeConnectConfig["ui"]>),
Expand Down
33 changes: 33 additions & 0 deletions apps/connect/src/hooks/useFormatAssetParam.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
import { renderHook } from "@testing-library/react";
import { useFormatAssetParam } from "./useFormatAssetParam";

// Mock the wormhole-connect package
jest.mock("@wormhole-foundation/wormhole-connect", () => ({
MAINNET: {
tokens: [
{
symbol: "ETH",
tokenId: {
address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756CKA",
},
},
{
symbol: "WETH",
tokenId: {
address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
},
},
],
},
TESTNET: {
tokens: [],
},
}));

// Mock the ENV import
jest.mock("@env", () => ({
ENV: {
wormholeConnectConfig: {
network: "Mainnet",
tokensConfig: {},
},
},
}));

describe("useFormatAssetParam", () => {
it("should get a formatted asset when key has an exact match", () => {
const { result } = renderHook(() => useFormatAssetParam("ETH"));
Expand Down

0 comments on commit 061a3cc

Please sign in to comment.