From 49df9b93589b14e65c79a7b22f2e5611b88ccac0 Mon Sep 17 00:00:00 2001 From: Sebastian Scatularo Date: Tue, 11 Jun 2024 16:25:11 -0300 Subject: [PATCH 1/4] setup NTT wstETH --- apps/connect/vite.config.ts | 23 +++++++++ apps/connect/vite.token-bridge.config.ts | 63 +++++++++++++++++++++++- 2 files changed, 84 insertions(+), 2 deletions(-) diff --git a/apps/connect/vite.config.ts b/apps/connect/vite.config.ts index 216f93e09..73303e44a 100644 --- a/apps/connect/vite.config.ts +++ b/apps/connect/vite.config.ts @@ -16,6 +16,29 @@ const wcPackageJson = readPackageVersion('@wormhole-foundation/wormhole-connect' const rpcs = (chains: string[], template: (chain: string) => string) => chains.map((chain: string) => ({ [chain]: template(chain) })).reduce((acc, cur) => ({ ...acc, ...cur }), {}); const asRpcHost = (chain: string) => `https://and76cjzpa.execute-api.us-east-2.amazonaws.com/${chain}/`; + +export const testnetChains = [ + "wormchain", + "osmosis", + "ethereum", + "sui", + "aptos", + "kujira", + "evmos", + "bsc", + "polygon", + "avalanche", + "fantom", + "celo", + "moonbeam", + "base", + "arbitrum", + "optimism", + "scroll", + "xlayer", + "sepolia" +] + export const chains = [ "wormchain", "osmosis", diff --git a/apps/connect/vite.token-bridge.config.ts b/apps/connect/vite.token-bridge.config.ts index e7d221dbd..6284b1ac4 100644 --- a/apps/connect/vite.token-bridge.config.ts +++ b/apps/connect/vite.token-bridge.config.ts @@ -1,5 +1,5 @@ import { defineConfig } from 'vite' -import viteConfig, { chains } from './vite.config' +import viteConfig, { chains, testnetChains } from './vite.config' import type { WormholeConnectConfig } from '@wormhole-foundation/wormhole-connect' const PUBLIC_URL = viteConfig.base; @@ -38,6 +38,7 @@ const MAINNET_MORE_NETWORKS = [ALGORAND, ACALA, SEI, MORE]; const TESTNET_MORE_NETWORKS = [ALGORAND, ACALA, MORE]; const TESTNET_TOKEN_CONFIG: WormholeConnectConfig = { + env: 'testnet', tokensConfig: { Wsolana: { key: 'Wsolana', @@ -109,6 +110,38 @@ const TESTNET_TOKEN_CONFIG: WormholeConnectConfig = { default: 18, }, }, + wstETHsepolia: { + key: "wstETHsepolia", + symbol: "wstETH (NTT)", + nativeChain: "sepolia", + tokenId: { + chain: "sepolia", + address: "0xB82381A3fBD3FaFA77B3a7bE693342618240067b" + }, + icon: "https://assets.coingecko.com/coins/images/18834/standard/wstETH.png", + coinGeckoId: "wrapped-steth", + color: "#3AA3FF", + decimals: { + default: 8, + Ethereum: 18 + } + }, + wstETHbsc: { + key: "wstETHbsc", + symbol: "wstETH (NTT)", + nativeChain: "bsc", + tokenId: { + chain: "bsc", + address: "0x0B15635FCF5316EdFD2a9A0b0dC3700aeA4D09E6" + }, + icon: "https://assets.coingecko.com/coins/images/18834/standard/wstETH.png", + coinGeckoId: "wrapped-steth", + color: "#3AA3FF", + decimals: { + default: 8, + Ethereum: 18 + } + } }, nttGroups: { W: { @@ -171,6 +204,32 @@ const TESTNET_TOKEN_CONFIG: WormholeConnectConfig = { }, ], }, + wstETH: { + nttManagers: [ + { + chainName: "sepolia", + address: "0x8B715EAf61A7DdF61C67d5D46687c796D1f47146", + tokenKey: "wstETHsepolia", + transceivers: [ + { + address: "0xF2bc73502283fcaC4b047dfE45366d8744daaC5B", + type: "wormhole" + } + ] + }, + { + chainName: "bsc", + address: "0x66Cb5a992570EF01b522Bc59A056a64A84Bd0aAa", + tokenKey: "wstETHbsc", + transceivers: [ + { + address: "0x3a84364d27Ed3D16022Da0f603f3E0F74826c707", + type: "wormhole" + } + ] + } + ] + } }, } @@ -525,7 +584,7 @@ export default defineConfig({ cctpWarning: { href: USDC_BRIDGE_HREF }, - networks: [...chains, "solana", "injective", "klaytn"], + networks: [...(process.env.VITE_APP_CLUSTER === 'mainnet' ? chains : testnetChains), "solana", "injective", "klaytn"], moreNetworks: { href: ADVANCE_TOOLS_HREF_TEMPLATE, target: "_blank", From b9e63e1b7da3dcb7e74a885f2541366e12846246 Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Tue, 11 Jun 2024 15:48:32 -0400 Subject: [PATCH 2/4] Update connect version to 0.3.12 --- apps/connect/package-lock.json | 2 +- apps/connect/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/connect/package-lock.json b/apps/connect/package-lock.json index 9f4a254d7..9f2e01759 100644 --- a/apps/connect/package-lock.json +++ b/apps/connect/package-lock.json @@ -14,7 +14,7 @@ "@mui/icons-material": "^5.14.11", "@mui/material": "^5.12.1", "@tanstack/react-query": "^5.14.2", - "@wormhole-foundation/wormhole-connect": "0.3.12", + "@wormhole-foundation/wormhole-connect": "^0.3.12", "dompurify": "^3.0.6", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/apps/connect/package.json b/apps/connect/package.json index 3923071f5..724483743 100644 --- a/apps/connect/package.json +++ b/apps/connect/package.json @@ -21,7 +21,7 @@ "@mui/icons-material": "^5.14.11", "@mui/material": "^5.12.1", "@tanstack/react-query": "^5.14.2", - "@wormhole-foundation/wormhole-connect": "0.3.12", + "@wormhole-foundation/wormhole-connect": "^0.3.12", "dompurify": "^3.0.6", "react": "^18.2.0", "react-dom": "^18.2.0" From 2e0d2aaa7caab7bbfa4bc5f62a74fc1c1b7b8d1e Mon Sep 17 00:00:00 2001 From: Sebastian Scatularo Date: Wed, 12 Jun 2024 10:26:09 -0300 Subject: [PATCH 3/4] limit routes to nttRelay --- apps/connect/vite.token-bridge.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/connect/vite.token-bridge.config.ts b/apps/connect/vite.token-bridge.config.ts index 6284b1ac4..1681a15f1 100644 --- a/apps/connect/vite.token-bridge.config.ts +++ b/apps/connect/vite.token-bridge.config.ts @@ -595,6 +595,7 @@ export default defineConfig({ label: "More tokens ...", href: ADVANCE_TOOLS_HREF_TEMPLATE, }, + routes: ["nttRelay"], ...(process.env.VITE_APP_CLUSTER === 'mainnet' ? MAINNET_TOKEN_CONFIG : TESTNET_TOKEN_CONFIG) } } From 4f31a6af54699c0b47d9dfa759983ded979125a3 Mon Sep 17 00:00:00 2001 From: yuli-ferna Date: Thu, 13 Jun 2024 17:11:21 -0400 Subject: [PATCH 4/4] upgrade connect version --- apps/connect/package-lock.json | 8 ++++---- apps/connect/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/connect/package-lock.json b/apps/connect/package-lock.json index 9f2e01759..e41cd8586 100644 --- a/apps/connect/package-lock.json +++ b/apps/connect/package-lock.json @@ -14,7 +14,7 @@ "@mui/icons-material": "^5.14.11", "@mui/material": "^5.12.1", "@tanstack/react-query": "^5.14.2", - "@wormhole-foundation/wormhole-connect": "^0.3.12", + "@wormhole-foundation/wormhole-connect": "^0.3.13-beta.0-development", "dompurify": "^3.0.6", "react": "^18.2.0", "react-dom": "^18.2.0" @@ -15955,9 +15955,9 @@ } }, "node_modules/@wormhole-foundation/wormhole-connect": { - "version": "0.3.12", - "resolved": "https://registry.npmjs.org/@wormhole-foundation/wormhole-connect/-/wormhole-connect-0.3.12.tgz", - "integrity": "sha512-BAOK8E533xiTsmN2/517sNh5S4MVe9OR19ew2h8kibqVBMzCcHwu81nACRIS+/LwSBK20Fm4iTxk8TEbTLbSFA==", + "version": "0.3.13-beta.0-development", + "resolved": "https://registry.npmjs.org/@wormhole-foundation/wormhole-connect/-/wormhole-connect-0.3.13-beta.0-development.tgz", + "integrity": "sha512-VBBlJ37AfOpZITwCPPMyJkMsA8eJH658xN0LDtF7hD+qvkAm9GgoGSHYSm9/nVUKWPhRxxNvX9zwuxKnnpjWtw==", "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 724483743..2883c2efd 100644 --- a/apps/connect/package.json +++ b/apps/connect/package.json @@ -21,7 +21,7 @@ "@mui/icons-material": "^5.14.11", "@mui/material": "^5.12.1", "@tanstack/react-query": "^5.14.2", - "@wormhole-foundation/wormhole-connect": "^0.3.12", + "@wormhole-foundation/wormhole-connect": "^0.3.13-beta.0-development", "dompurify": "^3.0.6", "react": "^18.2.0", "react-dom": "^18.2.0"