Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

add etherlink mainnet #140

Merged
merged 2 commits into from
Aug 5, 2024
Merged
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
1 change: 1 addition & 0 deletions core/utils/templateMappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const buildTemplate = async (appConfig: ConfigType): Promise<ConfigType>
'ethereum-sepolia',
'polygon',
'polygon-amoy',
'etherlink',
'etherlink-testnet',
'zksync',
'zksync-sepolia',
Expand Down
13 changes: 12 additions & 1 deletion scaffolds/nextjs-dedicated-wallet/template/src/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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:
Expand All @@ -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;
}
Expand All @@ -58,6 +63,7 @@ export const getNetworkToken = () => {
case Network.ZKSYNC:
case Network.ZKSYNC_SEPOLIA:
return 'ETH';
case Network.ETHERLINK:
case Network.ETHERLINK_TESTNET:
return 'XTZ';
}
Expand Down Expand Up @@ -86,6 +92,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:
Expand All @@ -105,8 +113,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:
Expand All @@ -123,6 +133,7 @@ export const isEip1559Supported = () => {
case Network.ZKSYNC_SEPOLIA:
case Network.POLYGON:
case Network.POLYGON_AMOY:
case Network.ETHERLINK:
case Network.ETHERLINK_TESTNET:
return false;
}
Expand Down
1 change: 1 addition & 0 deletions scaffolds/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)' },
Expand Down
Loading