From ad6dc88befd3169f667db3d4369f2d98390dcc33 Mon Sep 17 00:00:00 2001 From: Hunter Cote Date: Fri, 2 Aug 2024 13:40:28 -0400 Subject: [PATCH 1/2] add etherlink mainnet --- core/utils/templateMappings.ts | 1 + .../template/src/utils/network.ts | 14 +++++++++++++- scaffolds/prompts.ts | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/utils/templateMappings.ts b/core/utils/templateMappings.ts index 4127482..71be752 100644 --- a/core/utils/templateMappings.ts +++ b/core/utils/templateMappings.ts @@ -159,6 +159,7 @@ export const buildTemplate = async (appConfig: ConfigType): Promise 'ethereum-sepolia', 'polygon', 'polygon-amoy', + 'etherlink', 'etherlink-testnet', 'zksync', 'zksync-sepolia', diff --git a/scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts b/scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts index 240a5bc..4930946 100644 --- a/scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts +++ b/scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts @@ -3,6 +3,7 @@ export enum Network { POLYGON = 'polygon', ETHEREUM_SEPOLIA = 'ethereum-sepolia', ETHEREUM = 'ethereum', + ETHERLINK = 'etherlink', ETHERLINK_TESTNET = 'etherlink-testnet', ZKSYNC = 'zksync', ZKSYNC_SEPOLIA = 'zksync-sepolia', @@ -18,6 +19,8 @@ export const getNetworkUrl = () => { return 'https://eth-sepolia.g.alchemy.com/v2/fYFybLQFR9Zr2GCRcgALmAktStFKr0i0'; case Network.ETHEREUM: return 'https://eth-mainnet.g.alchemy.com/v2/fYFybLQFR9Zr2GCRcgALmAktStFKr0i0'; + case Network.ETHERLINK: + return 'https://node.mainnet.etherlink.com'; case Network.ETHERLINK_TESTNET: return 'https://node.ghostnet.etherlink.com'; case Network.ZKSYNC: @@ -43,6 +46,8 @@ export const getChainId = () => { return 300; case Network.ETHEREUM: return 1; + case Network.ETHERLINK: + return 42793; case Network.ETHERLINK_TESTNET: return 128123; } @@ -58,6 +63,8 @@ export const getNetworkToken = () => { case Network.ZKSYNC: case Network.ZKSYNC_SEPOLIA: return 'ETH'; + case Network.ETHERLINK: + return 'XTZ'; case Network.ETHERLINK_TESTNET: return 'XTZ'; } @@ -86,6 +93,8 @@ export const getNetworkName = () => { return 'Ethereum (Sepolia)'; case Network.ETHEREUM: return 'Ethereum (Mainnet)'; + case Network.ETHERLINK: + return 'Etherlink (Mainnet)'; case Network.ETHERLINK_TESTNET: return 'Etherlink (Testnet)'; case Network.ZKSYNC: @@ -105,8 +114,10 @@ export const getBlockExplorer = (address: string) => { return `https://etherscan.io/address/${address}`; case Network.ETHEREUM_SEPOLIA: return `https://sepolia.etherscan.io/address/${address}`; + case Network.ETHERLINK: + return `https://explorer.etherlink.com/address/${address}`; case Network.ETHERLINK_TESTNET: - return `https://testnet-explorer.etherlink.com//address/${address}`; + return `https://testnet-explorer.etherlink.com/address/${address}`; case Network.ZKSYNC: return `https://explorer.zksync.io/address/${address}`; case Network.ZKSYNC_SEPOLIA: @@ -123,6 +134,7 @@ export const isEip1559Supported = () => { case Network.ZKSYNC_SEPOLIA: case Network.POLYGON: case Network.POLYGON_AMOY: + case Network.ETHERLINK: case Network.ETHERLINK_TESTNET: return false; } diff --git a/scaffolds/prompts.ts b/scaffolds/prompts.ts index 9484d80..bcddd16 100644 --- a/scaffolds/prompts.ts +++ b/scaffolds/prompts.ts @@ -163,6 +163,7 @@ export namespace BlockchainNetworkPrompt { choices: [ { name: 'ethereum', message: 'Ethereum (Mainnet)' }, { name: 'ethereum-sepolia', message: 'Ethereum (Sepolia Testnet)' }, + { name: 'etherlink', message: 'Etherlink (Mainnet)' }, { name: 'etherlink-testnet', message: 'Etherlink (Testnet)' }, { name: 'polygon', message: 'Polygon (Mainnet)' }, { name: 'polygon-amoy', message: 'Polygon (Amoy Testnet)' }, From e04af4857c041275a195c8aff768b3a650b5c94c Mon Sep 17 00:00:00 2001 From: Hunter Cote Date: Fri, 2 Aug 2024 13:42:15 -0400 Subject: [PATCH 2/2] cleanup --- scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts b/scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts index 4930946..3c895f3 100644 --- a/scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts +++ b/scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts @@ -64,7 +64,6 @@ export const getNetworkToken = () => { case Network.ZKSYNC_SEPOLIA: return 'ETH'; case Network.ETHERLINK: - return 'XTZ'; case Network.ETHERLINK_TESTNET: return 'XTZ'; }