Skip to content

Commit

Permalink
devop: add blast network
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Jul 23, 2024
1 parent 04aaec6 commit de4097e
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 11 deletions.
4 changes: 2 additions & 2 deletions packages/extension/src/libs/keyring/public-keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class PublicKeyRing {
private async getKeysObject(): Promise<{ [key: string]: EnkryptAccount }> {
const allKeys = await this.#keyring.getKeysObject();
if (process.env.IS_DEV) {
allKeys["0x339d413ccefd986b1b3647a9cfa9cbbe70a30749"] = {
address: "0x339d413ccefd986b1b3647a9cfa9cbbe70a30749",
allKeys["0x99999990d598b918799f38163204bbc30611b6b6"] = {
address: "0x99999990d598b918799f38163204bbc30611b6b6",
basePath: "m/44'/60'/1'/0",
name: "fake account #1",
pathIndex: 0,
Expand Down
8 changes: 2 additions & 6 deletions packages/extension/src/providers/common/libs/new-features.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { NetworkNames } from "@enkryptcom/types";

const newNetworks = [
NetworkNames.Kadena,
NetworkNames.Rollux,
NetworkNames.Syscoin,
];
const newSwaps = [NetworkNames.MaticZK, NetworkNames.Base];
const newNetworks = [NetworkNames.Telos, NetworkNames.Blast];
const newSwaps: NetworkNames[] = [];

export { newNetworks, newSwaps };
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const NetworkEndpoints: Record<string, string> = {
[NetworkNames.Syscoin]: "https://explorer.syscoin.org/",
[NetworkNames.RolluxTest]: "https://rollux.tanenbaum.io/",
[NetworkNames.Rollux]: "https://explorer.rollux.com/",
[NetworkNames.Blast]: "https://blastscan.io/",
};

export { NetworkEndpoints };
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ const supportedNetworks: Record<SupportedNetworkNames, SupportedNetwork> = {
tbName: "tlos",
cgPlatform: CoingeckoPlatform.Telos,
},
[NetworkNames.Blast]: {
tbName: "blast",
cgPlatform: CoingeckoPlatform.Blast,
},
};

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

const getKnownNetworkTokens = async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ export type SupportedNetworkNames =
| NetworkNames.Celo
| NetworkNames.ZkSync
| NetworkNames.Telos
| NetworkNames.Rollux;
| NetworkNames.Rollux
| NetworkNames.Blast;
27 changes: 27 additions & 0 deletions packages/extension/src/providers/ethereum/networks/blast.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CoingeckoPlatform, NetworkNames } from "@enkryptcom/types";
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
import assetsInfoHandler from "@/providers/ethereum/libs/assets-handlers/assetinfo-mew";
import { EtherscanActivity } from "../libs/activity-handlers";
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler";

const ethOptions: EvmNetworkOptions = {
name: NetworkNames.Blast,
name_long: "Blast",
homePage: "https://blast.io/en",
blockExplorerTX: "https://blastscan.io/tx/[[txHash]]",
blockExplorerAddr: "https://blastscan.io/address/[[address]]",
chainID: "0x13e31",
isTestNetwork: false,
currencyName: "ETH",
currencyNameLong: "Ethereum",
node: "wss://blast-rpc.publicnode.com",
icon: require("./icons/blast.webp"),
coingeckoID: "ethereum",
coingeckoPlatform: CoingeckoPlatform.Blast,
assetsInfoHandler,
activityHandler: wrapActivityHandler(EtherscanActivity),
};

const eth = new EvmNetwork(ethOptions);

export default eth;
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/extension/src/providers/ethereum/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import rolluxTestNode from "./trlx";
import rolluxNode from "./rlx";
import cagaAnkara from "./cagaAnkara";
import telosNode from "./tlos";
import blastNode from "./blast";

export default {
sepolia: sepoliaNode,
Expand Down Expand Up @@ -91,4 +92,5 @@ export default {
rollux: rolluxNode,
cagaAnkara: cagaAnkara,
telos: telosNode,
blast: blastNode,
};
6 changes: 4 additions & 2 deletions packages/types/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export enum NetworkNames {
RolluxTest = "TRLX",
Rollux = "RLX",
CagaAnkara = "CagaAnkara",
Telos = "TLOS"
Telos = "TLOS",
Blast = "blast",
}

export enum CoingeckoPlatform {
Expand Down Expand Up @@ -115,5 +116,6 @@ export enum CoingeckoPlatform {
Kadena = "kadena",
Syscoin = "syscoin",
Rollux = "rollux",
Telos = "telos"
Telos = "telos",
Blast = "blast",
}

1 comment on commit de4097e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.