Skip to content

Commit

Permalink
Merge pull request #447 from enkryptcom/devop/new-networks
Browse files Browse the repository at this point in the history
devop: new networks
  • Loading branch information
kvhnuke authored May 20, 2024
2 parents 04aab9a + 1b8957b commit a90bc83
Show file tree
Hide file tree
Showing 20 changed files with 327 additions and 9 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,24 @@ To get started make sure you have `nodejs` and `nvm` installed on your system
yarn watch-extension # chromium based browsers
yarn watch:firefox # firefox
```
4. Build the project for release
4. Build the project for release (if you are Firefox team dont follow this)
```sh
yarn build:all
yarn build:chrome # chromium based browsers
yarn build:firefox # firefox
```
5. Add to your browser
5. Build the project for release (For Firefox team)

Since Firefox verification team looking for identical builds, you have to build it using docker

```sh
docker build -t enkrypt-build-container .
docker run --rm -v `pwd`:/home:rw --user "$(id -u):$(id -g)" enkrypt-build-container /bin/bash -c "yarn install --silent"
docker run --rm --user "$(id -u):$(id -g)" -v `pwd`:/home:rw enkrypt-build-container /bin/bash -c "cd packages/extension && yarn build:all"
docker run --rm --user "$(id -u):$(id -g)" -v `pwd`:/home:rw enkrypt-build-container /bin/bash -c "cd packages/extension && yarn build:firefox && yarn zip"
```

6. Add to your browser
- [Chrome/Brave/Opera](https://developer.chrome.com/docs/extensions/mv2/getstarted/#manifest)
- [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension#installing)

Expand Down
5 changes: 4 additions & 1 deletion packages/extension/configs/browser-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ const setConfig = (config) => {
args[0]["process.env"] = {
..._base,
PACKAGE_VERSION: JSON.stringify(package.version),
BUILD_TIME: new Date().toLocaleString().replace(/\D/g, ""),
BUILD_TIME:
BROWSER === browserNames.firefox
? "FF-build"
: new Date().toLocaleString().replace(/\D/g, ""),
IS_DEV: process.env.NODE_ENV === "development",
IS_FIREFOX: BROWSER === browserNames.firefox,
IS_OPERA_EDGE: BROWSER === browserNames.operaedge,
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "1.39.0",
"version": "1.40.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/manifest/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "https://www.enkrypt.com",
"homepage_url": "https://www.enkrypt.com",
"version": "",
"name": "Enkrypt: Multichain Crypto Wallet",
"name": "Enkrypt Crypto Wallet: ETH, BTC, KDA & more!",
"short_name": "Enkrypt",
"permissions": [
"storage",
Expand Down
6 changes: 5 additions & 1 deletion packages/extension/src/providers/common/libs/new-features.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { NetworkNames } from "@enkryptcom/types";

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

export { newNetworks, newSwaps };
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const NetworkEndpoints: Record<string, string> = {
[NetworkNames.FormTestnet]: "https://testnet-explorer.form.network/",
[NetworkNames.ArtheraTest]: "https://explorer-test.arthera.net/",
[NetworkNames.Arthera]: "https://explorer.arthera.net/",
[NetworkNames.SyscoinTest]: "https://tanenbaum.io/",
[NetworkNames.Syscoin]: "https://explorer.syscoin.org/",
[NetworkNames.RolluxTest]: "https://rollux.tanenbaum.io/",
[NetworkNames.Rollux]: "https://explorer.rollux.com/",
};

export { NetworkEndpoints };
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ const supportedNetworks: Record<SupportedNetworkNames, SupportedNetwork> = {
tbName: "shib",
cgPlatform: CoingeckoPlatform.Shibarium,
},
[NetworkNames.Rollux]: {
tbName: "rollux",
cgPlatform: CoingeckoPlatform.Rollux,
},
};

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

const getKnownNetworkTokens = async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ export type SupportedNetworkNames =
| NetworkNames.Shibarium
| NetworkNames.MaticZK
| NetworkNames.Celo
| NetworkNames.ZkSync;
| NetworkNames.ZkSync
| NetworkNames.Rollux;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -32,6 +32,10 @@ import shibNode from "./shib";
import artheraNode from "./aa";
import formTestnet from "./form-testnet";
import artheraTestNode from "./aat";
import syscoinTestNode from "./tsys";
import syscoinNode from "./sys";
import rolluxTestNode from "./trlx";
import rolluxNode from "./rlx";
import cagaAnkara from "./cagaAnkara";

export default {
Expand Down Expand Up @@ -78,5 +82,9 @@ export default {
arthera: artheraNode,
formTestnet: formTestnet,
artheraTest: artheraTestNode,
syscoinTest: syscoinTestNode,
syscoin: syscoinNode,
rolluxTest: rolluxTestNode,
rollux: rolluxNode,
cagaAnkara: cagaAnkara,
};
27 changes: 27 additions & 0 deletions packages/extension/src/providers/ethereum/networks/rlx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { NetworkNames, CoingeckoPlatform } from "@enkryptcom/types";
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
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 rolluxOptions: EvmNetworkOptions = {
name: NetworkNames.Rollux,
name_long: "Syscoin ROLLUX",
homePage: "https://www.rollux.com/",
blockExplorerTX: "https://explorer.rollux.com/tx/[[txHash]]",
blockExplorerAddr: "https://explorer.rollux.com/address/[[address]]",
chainID: "0x23a",
isTestNetwork: false,
currencyName: "SYS",
currencyNameLong: "Syscoin",
node: "wss://rpc.rollux.com/wss",
coingeckoID: "syscoin",
coingeckoPlatform: CoingeckoPlatform.Rollux,
icon: require("./icons/sys_rollux.svg"),
assetsInfoHandler,
activityHandler: wrapActivityHandler(EtherscanActivity),
};

const rollux = new EvmNetwork(rolluxOptions);

export default rollux;
25 changes: 25 additions & 0 deletions packages/extension/src/providers/ethereum/networks/sys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { NetworkNames, CoingeckoPlatform } from "@enkryptcom/types";
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
import { EtherscanActivity } from "../libs/activity-handlers";
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler";

const syscoinOptions: EvmNetworkOptions = {
name: NetworkNames.Syscoin,
name_long: "Syscoin NEVM",
homePage: "https://www.syscoin.org/",
blockExplorerTX: "https://explorer.syscoin.org/tx/[[txHash]]",
blockExplorerAddr: "https://explorer.syscoin.org/address/[[address]]",
chainID: "0x39",
isTestNetwork: false,
currencyName: "SYS",
currencyNameLong: "Syscoin",
node: "wss://rpc.syscoin.org/wss",
icon: require("./icons/sys_nevm.svg"),
coingeckoID: "syscoin",
coingeckoPlatform: CoingeckoPlatform.Syscoin,
activityHandler: wrapActivityHandler(EtherscanActivity),
};

const syscoin = new EvmNetwork(syscoinOptions);

export default syscoin;
23 changes: 23 additions & 0 deletions packages/extension/src/providers/ethereum/networks/trlx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { NetworkNames } from "@enkryptcom/types";
import { EvmNetwork, EvmNetworkOptions } from "../types/evm-network";
import { EtherscanActivity } from "../libs/activity-handlers";
import wrapActivityHandler from "@/libs/activity-state/wrap-activity-handler";

const rolluxTestOptions: EvmNetworkOptions = {
name: NetworkNames.RolluxTest,
name_long: "Syscoin ROLLUX Testnet",
homePage: "https://www.rollux.com/",
blockExplorerTX: "https://rollux.tanenbaum.io/tx/[[txHash]]",
blockExplorerAddr: "https://rollux.tanenbaum.io/address/[[address]]",
chainID: "0xdea8",
isTestNetwork: true,
currencyName: "TSYS",
currencyNameLong: "Test Syscoin",
node: "wss://rpc-tanenbaum.rollux.com/wss",
icon: require("./icons/tsys_rollux.svg"),
activityHandler: wrapActivityHandler(EtherscanActivity),
};

const rolluxTest = new EvmNetwork(rolluxTestOptions);

export default rolluxTest;
Loading

1 comment on commit a90bc83

@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.