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

Removed NTT views #2

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
772 changes: 739 additions & 33 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions wormhole-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@
"eslint": "^8.31.0",
"eslint-config-prettier": "^8.6.0",
"typescript": "^5.3.3",
"vite": "^5.0.8",
"vite-bundle-visualizer": "^0.11.0",
"vite-plugin-checker": "^0.6.2",
"vite-plugin-dts": "^3.7.3",
"vite": "^5.3.1",
"vite-bundle-visualizer": "^1.2.1",
"vite-plugin-checker": "^0.6.4",
"vite-plugin-dts": "^3.9.1",
"vitest": "^1.5.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion wormhole-connect/scripts/sdkv2.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ for (const workspace of workspaces) {
execSync('npm link', { cwd: sdkPackages[name] });
}

sdkPackages['@wormhole-foundation/sdk-definitions-ntt'] = NTT_SDK_PATH;
//sdkPackages['@wormhole-foundation/sdk-definitions-ntt'] = NTT_SDK_PATH;

execSync(`npm link ${Object.keys(sdkPackages).join(' ')}`, {
cwd: path.join(__dirname, '../../'),
Expand Down
2 changes: 0 additions & 2 deletions wormhole-connect/src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { setRoute } from './store/router';
import { clearWallets } from './store/wallet';
import { clearPorticoBridge } from 'store/porticoBridge';
import { useExternalSearch } from 'hooks/useExternalSearch';
import { clearNtt } from 'store/ntt';
import internalConfig from 'config';

const useStyles = makeStyles()((theme: any) => ({
Expand Down Expand Up @@ -79,7 +78,6 @@ function AppRouter(props: Props) {
if (prevRoute === redeemRoute && route !== redeemRoute) {
dispatch(clearRedeem());
dispatch(clearWallets());
dispatch(clearNtt());
internalConfig.wh.registerProviders(); // reset providers that may have been set during transfer
}
// reset transfer state on leave
Expand Down
2 changes: 0 additions & 2 deletions wormhole-connect/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import routerReducer from './router';
import walletReducer from './wallet';
import porticoBridgeReducer from './porticoBridge';
import tokenPricesReducer from './tokenPrices';
import nttReducer from './ntt';

export const store = configureStore({
reducer: {
Expand All @@ -17,7 +16,6 @@ export const store = configureStore({
relay: relayReducer,
porticoBridge: porticoBridgeReducer,
tokenPrices: tokenPricesReducer,
ntt: nttReducer,
},
});

Expand Down
40 changes: 0 additions & 40 deletions wormhole-connect/src/store/ntt.ts

This file was deleted.

23 changes: 0 additions & 23 deletions wormhole-connect/src/utils/errors.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import config from 'config';
import type { TransferErrorType, TransferError } from 'telemetry/types';
import {
ERR_INSUFFICIENT_ALLOWANCE,
ERR_SWAP_FAILED,
ERR_NOT_ENOUGH_CAPACITY,
ERR_SOURCE_CONTRACT_PAUSED,
ERR_DESTINATION_CONTRACT_PAUSED,
ERR_UNSUPPORTED_ABI_VERSION,
ERR_INSUFFICIENT_GAS,
ERR_TIMEOUT,
ERR_UNKNOWN,
Expand All @@ -16,12 +11,6 @@ import {
ChainName,
InsufficientFundsForGasError,
} from '@wormhole-foundation/wormhole-connect-sdk';
import {
DestinationContractIsPausedError,
NotEnoughCapacityError,
ContractIsPausedError,
UnsupportedContractAbiVersion,
} from 'routes/ntt/errors';
import { SWAP_ERROR } from 'routes/porticoBridge/consts';

// TODO SDKV2
Expand All @@ -44,18 +33,6 @@ export function interpretTransferError(
// Solana timeout
uiErrorMessage = 'Transfer timed out, please try again';
internalErrorCode = ERR_TIMEOUT;
} else if (e?.message === NotEnoughCapacityError.MESSAGE) {
uiErrorMessage = `This transfer would be rate-limited due to high volume on ${config.chains[chain]?.displayName}, please try again later`;
internalErrorCode = ERR_NOT_ENOUGH_CAPACITY;
} else if (e?.message === ContractIsPausedError.MESSAGE) {
uiErrorMessage = e.message;
internalErrorCode = ERR_SOURCE_CONTRACT_PAUSED;
} else if (e?.message === DestinationContractIsPausedError.MESSAGE) {
uiErrorMessage = e.message;
internalErrorCode = ERR_DESTINATION_CONTRACT_PAUSED;
} else if (e?.message === UnsupportedContractAbiVersion.MESSAGE) {
uiErrorMessage = 'Unsupported contract ABI version';
internalErrorCode = ERR_UNSUPPORTED_ABI_VERSION;
} else if (e?.message === InsufficientFundsForGasError.MESSAGE) {
uiErrorMessage = e.message;
internalErrorCode = ERR_INSUFFICIENT_GAS;
Expand Down
5 changes: 3 additions & 2 deletions wormhole-connect/src/utils/vaa.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ethers_contracts } from '@wormhole-foundation/sdk-evm-core';
import { providers, BigNumberish } from 'ethers';
import { providers } from 'ethers';
import axios from 'axios';
import { ChainId, ChainName } from '@wormhole-foundation/wormhole-connect-sdk';
import config, { newWormholeContextV2 } from 'config';
Expand All @@ -18,6 +17,7 @@ export type MessageIdentifier = {
sequence: string;
};

/*
export const NO_VAA_FOUND = 'No message publish found in logs';
export async function getUnsignedVaaEvm(
chain: ChainId | ChainName,
Expand All @@ -42,6 +42,7 @@ export async function getUnsignedVaaEvm(
throw new Error('Failed to parse logs in getUnsignedVaaEvm');
}
}
*/

export async function getWormholeLogEvm(
chain: ChainId | ChainName,
Expand Down
3 changes: 0 additions & 3 deletions wormhole-connect/src/views/Bridge/Bridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import { usePorticoSwapInfo } from 'hooks/usePorticoSwapInfo';
import { usePorticoRelayerFee } from 'hooks/usePorticoRelayerFee';
import { useFetchTokenPrices } from 'hooks/useFetchTokenPrices';
import { useGasSlider } from 'hooks/useGasSlider';
import NttInboundCapacityWarning from './NttInboundCapacityWarning';
import { isNttRoute } from 'routes/utils';
import { useConnectToLastUsedWallet } from 'utils/wallet';
import { useComputeReceiverNativeBalance } from 'hooks/useComputeReceiverNativeBalance';

Expand Down Expand Up @@ -183,7 +181,6 @@ function Bridge() {
<Preview collapsed={!showValidationState ? true : !valid} />

<TransferLimitedWarning fromChain={fromChain} token={token} />
{isNttRoute(route) && <NttInboundCapacityWarning />}
<Send valid={!!valid} />
</div>
</Collapse>
Expand Down
118 changes: 0 additions & 118 deletions wormhole-connect/src/views/Bridge/NttInboundCapacityWarning.tsx

This file was deleted.

Loading
Loading