From 290ce3fedba462395d20f9036efd09b341507e12 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 2 Jul 2024 14:56:29 -0300 Subject: [PATCH] configure wstETH bridge (#907) * configure wstETH bridge * fix route contant * bump connect version from 0.3.15 to 0.3.16 * update route name + symbol key * fix prettier issue * update route name --- apps/connect/package-lock.json | 8 ++--- apps/connect/package.json | 2 +- apps/connect/src/App.tsx | 15 +++++++++ apps/connect/vite.token-bridge.config.ts | 43 ++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 5 deletions(-) diff --git a/apps/connect/package-lock.json b/apps/connect/package-lock.json index 96c5ce470..e3b5abef4 100644 --- a/apps/connect/package-lock.json +++ b/apps/connect/package-lock.json @@ -24,7 +24,7 @@ "@opentelemetry/resources": "^1.23.0", "@opentelemetry/sdk-trace-web": "^1.23.0", "@tanstack/react-query": "^5.14.2", - "@wormhole-foundation/wormhole-connect": "^0.3.15", + "@wormhole-foundation/wormhole-connect": "^0.3.16", "dompurify": "^3.0.6", "mixpanel-browser": "^2.49.0", "react": "^18.2.0", @@ -16280,9 +16280,9 @@ } }, "node_modules/@wormhole-foundation/wormhole-connect": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/wormhole-connect/-/wormhole-connect-0.3.15.tgz", - "integrity": "sha512-oMn5AZkS722niE6DX+ufvp7t7XvJXSap4IWnGG+2dxVGlwye69m/euBK1KWp1LkBxpnsvlCWd8yBOtoyFx0qYQ==", + "version": "0.3.16", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/wormhole-connect/-/wormhole-connect-0.3.16.tgz", + "integrity": "sha512-vBFNLBbeeb5Zr/7VyNWenO7r9e8cylziOVyyvu6JR8HBkgVmDk8w21VuTsUxyAdNyysDl7QHqJqRHwd/T118FQ==", "dependencies": { "@certusone/wormhole-sdk": "^0.10.10", "@coral-xyz/anchor": "^0.29.0", diff --git a/apps/connect/package.json b/apps/connect/package.json index 0c4e8d296..b234ae283 100644 --- a/apps/connect/package.json +++ b/apps/connect/package.json @@ -31,7 +31,7 @@ "@opentelemetry/resources": "^1.23.0", "@opentelemetry/sdk-trace-web": "^1.23.0", "@tanstack/react-query": "^5.14.2", - "@wormhole-foundation/wormhole-connect": "^0.3.15", + "@wormhole-foundation/wormhole-connect": "^0.3.16", "dompurify": "^3.0.6", "mixpanel-browser": "^2.49.0", "react": "^18.2.0", diff --git a/apps/connect/src/App.tsx b/apps/connect/src/App.tsx index 0ea2918d5..f06eaa5c2 100644 --- a/apps/connect/src/App.tsx +++ b/apps/connect/src/App.tsx @@ -18,6 +18,21 @@ const defaultConfig: WormholeConnectConfig = { window.location.origin.includes("testnet")) && { eventHandler: eventHandler, }), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + isRouteSupportedHandler: async (td: any) => { + // Disable manual NTT for Lido wstETH + if ( + td.route === "nttManual" && + td.fromToken.tokenId !== "native" && + (td.fromToken.tokenId.address === + "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0" || + td.fromToken.tokenId.address === + "0x26c5e01524d2E6280A48F2c50fF6De7e52E9611C") + ) { + return false; + } + return true; + }, }; export default function Root() { diff --git a/apps/connect/vite.token-bridge.config.ts b/apps/connect/vite.token-bridge.config.ts index 2f690de67..8a1d618c9 100644 --- a/apps/connect/vite.token-bridge.config.ts +++ b/apps/connect/vite.token-bridge.config.ts @@ -469,6 +469,22 @@ const MAINNET_TOKEN_CONFIG: WormholeConnectConfig = { default: 18, }, }, + 'wstETH ': { + key: 'wstETH ', + symbol: 'wstETH ', + nativeChain: 'bsc', + tokenId: { + chain: 'bsc', + address: '0x26c5e01524d2E6280A48F2c50fF6De7e52E9611C', + }, + icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3R5bGU9Im1heC1oZWlnaHQ6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2OUMyNTUuOTE0IDM5Mi4xMDggMjU1LjkxNCAzNDIuODggMjU1LjkxNCAyOTcuNzY0WiIgZmlsbD0id2hpdGUiPjwvcGF0aD48cGF0aCBvcGFjaXR5PSIwLjIiIGQ9Ik0yNTYuMDgzIDE2My44MzNWMjY3LjIzM0wzNDYuNDkxIDIxNS41NjZMMjU2LjA4MyAxNjMuODMzWiIgZmlsbD0id2hpdGUiPjwvcGF0aD48cGF0aCBvcGFjaXR5PSIwLjYiIGQ9Ik0yNTYuMDU2IDE2My44MzNMMTY1LjU4MyAyMTUuNTY1TDI1Ni4wNTYgMjY3LjIzM1YxNjMuODMzWiIgZmlsbD0id2hpdGUiPjwvcGF0aD48cGF0aCBkPSJNMjU2LjA1NiA3Ni44NzVMMTY1LjU4MyAyMTUuNTk5TDI1Ni4wNTYgMTYzLjcyMlY3Ni44NzVaIiBmaWxsPSJ3aGl0ZSI+PC9wYXRoPjxwYXRoIG9wYWNpdHk9IjAuNiIgZD0iTTI1Ni4wODMgMTYzLjcwNkwzNDYuNTYgMjE1LjU4NUwyNTYuMDgzIDc2Ljc5MTZWMTYzLjcwNloiIGZpbGw9IndoaXRlIj48L3BhdGg+PC9zdmc+Cgo=", + coinGeckoId: 'wrapped-steth', + color: '#3AA3FF', + decimals: { + default: 8, + Ethereum: 18, + }, + }, }, nttGroups: { W: { @@ -557,6 +573,33 @@ const MAINNET_TOKEN_CONFIG: WormholeConnectConfig = { } ] }, + Lido_wstETH: { + displayName: 'NTT: Wormhole + Axelar', + nttManagers: [ + { + chainName: 'ethereum', + address: '0xb948a93827d68a82F6513Ad178964Da487fe2BD9', + tokenKey: 'wstETH', + transceivers: [ + { + address: '0xA1ACC1e6edaB281Febd91E3515093F1DE81F25c0', + type: 'wormhole', + }, + ], + }, + { + chainName: 'bsc', + address: '0x6981F5621691CBfE3DdD524dE71076b79F0A0278', + tokenKey: 'wstETH ', + transceivers: [ + { + address: '0xbe3F7e06872E0dF6CD7FF35B7aa4Bb1446DC9986', + type: 'wormhole', + }, + ], + }, + ], + }, "ETHFI": { nttManagers: [ {