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

Commit

Permalink
add etherlink mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
hcote committed Aug 2, 2024
1 parent 99ddca9 commit ad6dc88
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
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
14 changes: 13 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,8 @@ export const getNetworkToken = () => {
case Network.ZKSYNC:
case Network.ZKSYNC_SEPOLIA:
return 'ETH';
case Network.ETHERLINK:
return 'XTZ';
case Network.ETHERLINK_TESTNET:
return 'XTZ';
}
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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;
}
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

0 comments on commit ad6dc88

Please sign in to comment.