Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
yuli-ferna committed Sep 10, 2024
1 parent 277deac commit 494d580
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 3,464 deletions.
3,417 changes: 0 additions & 3,417 deletions apps/common-library/package-lock.json

This file was deleted.

5 changes: 2 additions & 3 deletions apps/common-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
"preview": "vite preview"
},
"dependencies": {
"@mui/icons-material": "^6.0.2",
"@mui/material": "^6.0.2",
"@mui/system": "^6.0.2",
"@mui/icons-material": "^5.16.7",
"@mui/material": "^5.16.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.2",
Expand Down
2 changes: 0 additions & 2 deletions apps/connect-v1/src/env/usdc-bridge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
DEFAULT_ROUTES,
type WormholeConnectConfig,
} from "@wormhole-foundation/wormhole-connect";
import { Env, PUBLIC_URL, wormholeConnectConfigCommon } from "./common";
Expand Down Expand Up @@ -28,7 +27,6 @@ export const ENV: Env = {
text: "USDC Transfer",
align: "center",
},
routes: [...DEFAULT_ROUTES],
tokens: [
"USDCeth",
"USDCavax",
Expand Down
14 changes: 12 additions & 2 deletions apps/connect/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { Route, Routes } from "react-router-dom";
import { PrivacyPolicyPath } from "./utils/constants";
import { Footer, Main, messages as messageConfig, NavBar, NewsBar, Wrapper } from "@xlabs/common-library";
import {
Footer,
Main,
messages as messageConfig,
NavBar,
NewsBar,
Wrapper,
} from "@xlabs/common-library";
import PrivacyPolicy from "./components/pages/PrivacyPolicy";
import { Connect } from "./components/atoms/Connect";
import { ENV } from "@env";
Expand All @@ -16,7 +23,10 @@ export const App = () => {
<Wrapper>
<NewsBar message={message} banners={banners} />
<Main>
<NavBar navBar={[...ENV.navBar]} env={ENV.wormholeConnectConfig.env || "mainnet"} />
<NavBar
navBar={[...ENV.navBar]}
env={ENV.wormholeConnectConfig.env || "mainnet"}
/>
<Routes>
<Route path={PrivacyPolicyPath} element={<PrivacyPolicy />} />
<Route path="*" element={<Connect />} />
Expand Down
2 changes: 1 addition & 1 deletion apps/connect/src/components/pages/PrivacyPolicy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ const PrivacyPolicy = () => {
and whether we disclosed that personal information for a business
purpose (e.g., to a service provider) in the preceding 12 months.
California residents can find this information by visiting:{" "}
<Link to="https://www.oag.ca.gov/privacy/ccpa" target="_blank">
<Link href="https://www.oag.ca.gov/privacy/ccpa" target="_blank">
https://www.oag.ca.gov/privacy/ccpa
</Link>
.
Expand Down
7 changes: 2 additions & 5 deletions apps/connect/src/hooks/useFormatAssetParam.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { ENV } from "@env";
import {
MAINNET,
TESTNET
} from "@wormhole-foundation/wormhole-connect";
import { MAINNET, TESTNET } from "@wormhole-foundation/wormhole-connect";
import { useMemo } from "react";

const tokensList =
ENV.wormholeConnectConfig.env === "mainnet" ? MAINNET.tokens : TESTNET.tokens;
function getFormatedAsset(asset: string | null): string | null {
const allTokens = {
...tokensList,
...(ENV.wormholeConnectConfig?.tokensConfig),
...ENV.wormholeConnectConfig?.tokensConfig,
};
if (allTokens && asset) {
const tokenParam = Object.values(allTokens).find((config) =>
Expand Down
5 changes: 4 additions & 1 deletion apps/connect/src/providers/sanctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ import {
isEVMChain,
} from "@certusone/wormhole-sdk";
import { Chain, toChainId } from "@wormhole-foundation/sdk";
import { ExtendedTransferDetails } from "node_modules/@wormhole-foundation/wormhole-connect/lib/src/config/types";
import { toChainNameFormat } from "../utils/transferVerification";
import { WormholeConnectConfig } from "@wormhole-foundation/wormhole-connect";

export type ExtendedTransferDetails = Parameters<
NonNullable<WormholeConnectConfig["validateTransferHandler"]>
>[0];
export interface SanctionResponse {
addressRiskIndicators: { categoryRiskScoreLevel: number; riskType: string }[];
entities: { riskScoreLevel: number }[];
Expand Down
14 changes: 9 additions & 5 deletions apps/connect/src/utils/transferVerification.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import {
ExtendedTransferDetails,
ValidateTransferResult,
} from "node_modules/@wormhole-foundation/wormhole-connect/lib/src/config/types";
import { isValidAddress } from "./isValidAddress";
import { isSanctionedAddress } from "../../src/providers/sanctions";
import { ChainName } from "@certusone/wormhole-sdk";
import { Chain } from "@wormhole-foundation/sdk";
import { WormholeConnectConfig } from "@wormhole-foundation/wormhole-connect";

export type ExtendedTransferDetails = Parameters<
NonNullable<WormholeConnectConfig["validateTransferHandler"]>
>[0];

export type ValidateTransferResult = ReturnType<
NonNullable<WormholeConnectConfig["validateTransferHandler"]>
>;
export const validateTransfer = async (
tx: ExtendedTransferDetails
): Promise<ValidateTransferResult> => {
): ValidateTransferResult => {
try {
// Check OFAC (sanctioned)
const isSanctioned = await isSanctionedAddress(tx);
Expand Down
Loading

0 comments on commit 494d580

Please sign in to comment.