Skip to content

Commit

Permalink
Merge branch 'NickKelly1-devop/add-linea-network' into devop/release-…
Browse files Browse the repository at this point in the history
…prep
  • Loading branch information
kvhnuke committed Aug 15, 2024
2 parents 999c038 + 26b45bd commit 66fa06c
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/extension/src/libs/nft-handlers/simplehash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default async (
[NetworkNames.ImmutableZkevm]: "immutable-zkevm",
[NetworkNames.Forma]: "forma",
[NetworkNames.Godwoken]: "godwoken",
[NetworkNames.Linea]: "linea",
};
if (!Object.keys(supportedNetworks).includes(network.name))
throw new Error("Simplehash: network not supported");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const NetworkEndpoints: Record<string, string> = {
[NetworkNames.Ham]: "https://explorer.ham.fun/",
[NetworkNames.ImmutableZkevm]: "https://explorer.immutable.com/",
[NetworkNames.Forma]: "https://explorer.forma.art/",
[NetworkNames.Linea]: "https://api.lineascan.build/",
};

export { NetworkEndpoints };
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ const supportedNetworks: Record<SupportedNetworkNames, SupportedNetwork> = {
tbName: "ckb",
cgPlatform: CoingeckoPlatform.Godwoken,
},
[NetworkNames.Linea]: {
tbName: "linea",
cgPlatform: CoingeckoPlatform.Linea,
},
};

const getTokens = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const TokenList: Record<SupportedNetworkNames, string> = {
[NetworkNames.Sanko]: `https://tokens.coingecko.com/${CoingeckoPlatform.Sanko}/all.json`,
[NetworkNames.Degen]: `https://tokens.coingecko.com/${CoingeckoPlatform.Degen}/all.json`,
[NetworkNames.Godwoken]: `https://tokens.coingecko.com/${CoingeckoPlatform.Godwoken}/all.json`,
[NetworkNames.Linea]: `https://tokens.coingecko.com/${CoingeckoPlatform.Linea}/all.json`,
};

const getKnownNetworkTokens = async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ export type SupportedNetworkNames =
| NetworkNames.Sanko
| NetworkNames.Degen
| NetworkNames.Blast
| NetworkNames.Godwoken;
| NetworkNames.Godwoken
| NetworkNames.Linea;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions packages/extension/src/providers/ethereum/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ import blastNode from "./blast";
import sankoNode from "./dmt";
import degenNode from "./degen";
import hamNode from "./ham";
<<<<<<< HEAD
import zcdNode from "./zcd";
import immutableZkevmNode from "./immutable-zkevm";
import formaNode from "./forma";
import godwokenNode from "./godwoken";
=======
import lineaNode from "./linea";
>>>>>>> 038fec6090829b22db483c800d7701b36f74285b

export default {
sepolia: sepoliaNode,
Expand Down Expand Up @@ -105,8 +109,12 @@ export default {
sanko: sankoNode,
degen: degenNode,
ham: hamNode,
<<<<<<< HEAD
zcd: zcdNode,
immutableZkevm: immutableZkevmNode,
forma: formaNode,
godwoken: godwokenNode,
=======
linea: lineaNode,
>>>>>>> 038fec6090829b22db483c800d7701b36f74285b
};
28 changes: 28 additions & 0 deletions packages/extension/src/providers/ethereum/networks/linea.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { CoingeckoPlatform, NetworkNames } from "@enkryptcom/types";
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
import shNFTHandler from "@/libs/nft-handlers/simplehash";
import { EtherscanActivity } from "../libs/activity-handlers";
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler";
import assetsInfoHandler from "@/providers/ethereum/libs/assets-handlers/assetinfo-mew";

const lineaOptions: EvmNetworkOptions = {
name: NetworkNames.Linea,
name_long: "Linea",
homePage: "https://linea.build/",
blockExplorerTX: "https://lineascan.build/tx/[[txHash]]",
blockExplorerAddr: "https://lineascan.build/address/[[address]]",
chainID: `0xe708`,
isTestNetwork: false,
currencyName: "ETH",
currencyNameLong: "Ethereum",
node: "https://rpc.linea.build",
icon: require("./icons/linea.png"),
coingeckoPlatform: CoingeckoPlatform.Linea,
NFTHandler: shNFTHandler,
assetsInfoHandler,
activityHandler: wrapActivityHandler(EtherscanActivity),
};

const linea = new EvmNetwork(lineaOptions);

export default linea;
5 changes: 2 additions & 3 deletions packages/types/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,11 @@ export enum NetworkNames {
Sanko = "sanko",
Degen = "degen",
Ham = "ham",
<<<<<<< HEAD
ZChains = "ZCD",
ImmutableZkevm = "ImmutableZkevm",
Forma = "Forma",
=======
Godwoken = "godwoken",
>>>>>>> 9aa19afbeeddf0b41a6f8f82589ee488cef7c269
Linea = "Linea",
}

export enum CoingeckoPlatform {
Expand Down Expand Up @@ -134,4 +132,5 @@ export enum CoingeckoPlatform {
Degen = "degen",
ImmutableZkevm = "immutable",
Godwoken = "godwoken",
Linea = "linea",
}

0 comments on commit 66fa06c

Please sign in to comment.