Skip to content

Commit

Permalink
Merged master into Master-Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
lhtHimanshuKushwaha committed Apr 14, 2022
2 parents 78136b1 + 54ec196 commit 994165f
Show file tree
Hide file tree
Showing 33 changed files with 962 additions and 44,494 deletions.
3 changes: 0 additions & 3 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1321,9 +1321,6 @@
"yourPrivateSeedPhrase": {
"message": "Your private seed phrase"
},
"transactions":{
"message": "Transactions"
},
"viewOnBlockExplorer":{
"message": "View on Block Explorer"
},
Expand Down
8 changes: 4 additions & 4 deletions app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
"version": "6.2.5",
"version": "6.2.8",
"manifest_version": 2,
"author": "XinFin Network",
"description": "__MSG_appDescription__",
Expand All @@ -17,7 +17,7 @@
},
"icons": {
"16": "images/Assets/xdc-icon-16X16.png",
"128": "images/Assets/xdc-icon-128X128.png"
"128": "images/Assets/XDC-Icon-128X128.png"
},
"applications": {
"gecko": {
Expand All @@ -34,8 +34,8 @@
},
"browser_action": {
"default_icon": {
"19": "images/Assets/xdc-icon.png",
"38": "images/Assets/xdc-icon-48X48.png"
"19": "images/Assets/XDC-Icon.png",
"38": "images/Assets/XDC-Icon-48X48.png"
},
"default_title": "XDCPay",
"default_popup": "popup.html"
Expand Down
150 changes: 78 additions & 72 deletions app/scripts/controllers/network/enums.js
Original file line number Diff line number Diff line change
@@ -1,114 +1,117 @@
const ethNetProps = require('../../../../xdc-net-props')
const POA = 'poa'
const DAI = 'dai'
const POA_SOKOL = 'sokol'
const MAINNET = 'mainnet'
const ROPSTEN = 'ropsten'
const RINKEBY = 'rinkeby'
const KOVAN = 'kovan'
const GOERLI_TESTNET = 'goerli_testnet'
const CLASSIC = 'classic'
const XDC = 'xdc'
const XDC_TESTNET = 'xdc_testnet'
const XDC_DEVNET = 'xdc_devnet'
const LOCALHOST = 'localhost'
const ethNetProps = require("../../../../xdc-net-props");
const POA = "poa";
const DAI = "dai";
const POA_SOKOL = "sokol";
const MAINNET = "mainnet";
const ROPSTEN = "ropsten";
const RINKEBY = "rinkeby";
const KOVAN = "kovan";
const GOERLI_TESTNET = "goerli_testnet";
const CLASSIC = "classic";
const XDC = "xdc";
const XDC_TESTNET = "xdc_testnet";
const XDC_DEVNET = "xdc_devnet";
const LOCALHOST = "localhost";

const POA_CODE = 99
const DAI_CODE = 100
const POA_SOKOL_CODE = 77
const MAINNET_CODE = 1
const ROPSTEN_CODE = 3
const RINKEBY_CODE = 4
const KOVAN_CODE = 42
const GOERLI_TESTNET_CODE = 5
const CLASSIC_CODE = 61
const XDC_CODE = 50
const XDC_TESTNET_CODE = 51
const XDC_DEVNET_CODE = 551
const POA_CODE = 99;
const DAI_CODE = 100;
const POA_SOKOL_CODE = 77;
const MAINNET_CODE = 1;
const ROPSTEN_CODE = 3;
const RINKEBY_CODE = 4;
const KOVAN_CODE = 42;
const GOERLI_TESTNET_CODE = 5;
const CLASSIC_CODE = 61;
const XDC_CODE = 50;
const XDC_TESTNET_CODE = 51;
const XDC_DEVNET_CODE = 551;

const POA_DISPLAY_NAME = 'POA Core'
const DAI_DISPLAY_NAME = 'xDai Chain'
const POA_SOKOL_DISPLAY_NAME = 'Sokol'
const MAINNET_DISPLAY_NAME = 'Main Ethereum Network'
const ROPSTEN_DISPLAY_NAME = 'Ropsten'
const RINKEBY_DISPLAY_NAME = 'Rinkeby'
const KOVAN_DISPLAY_NAME = 'Kovan'
const GOERLI_TESTNET_DISPLAY_NAME = 'Görli Testnet'
const CLASSIC_DISPLAY_NAME = 'Ethereum Classic'
const XDC_DISPLAY_NAME = 'XDC Mainnet'
const XDC_TESTNET_DISPLAY_NAME = 'XDC Apothem Testnet'
const XDC_DEVNET_DISPLAY_NAME = 'XDC Devnet'
const POA_DISPLAY_NAME = "POA Core";
const DAI_DISPLAY_NAME = "xDai Chain";
const POA_SOKOL_DISPLAY_NAME = "Sokol";
const MAINNET_DISPLAY_NAME = "Main Ethereum Network";
const ROPSTEN_DISPLAY_NAME = "Ropsten";
const RINKEBY_DISPLAY_NAME = "Rinkeby";
const KOVAN_DISPLAY_NAME = "Kovan";
const GOERLI_TESTNET_DISPLAY_NAME = "Görli Testnet";
const CLASSIC_DISPLAY_NAME = "Ethereum Classic";
const XDC_DISPLAY_NAME = "XDC Mainnet";
const XDC_TESTNET_DISPLAY_NAME = "XDC Apothem Testnet";
const XDC_DEVNET_DISPLAY_NAME = "XDC Devnet";

const DROPDOWN_POA_DISPLAY_NAME = POA_DISPLAY_NAME
const DROPDOWN_DAI_DISPLAY_NAME = DAI_DISPLAY_NAME
const DROPDOWN_POA_SOKOL_DISPLAY_NAME = 'Sokol Network'
const DROPDOWN_MAINNET_DISPLAY_NAME = 'Main Network'
const DROPDOWN_ROPSTEN_DISPLAY_NAME = 'Ropsten Test Net'
const DROPDOWN_RINKEBY_DISPLAY_NAME = 'Rinkeby Test Net'
const DROPDOWN_KOVAN_DISPLAY_NAME = 'Kovan Test Net'
const DROPDOWN_GOERLI_TESTNET_DISPLAY_NAME = 'Görli Test Net'
const DROPDOWN_CLASSIC_DISPLAY_NAME = 'Ethereum Classic'
const DROPDOWN_XDC_DISPLAY_NAME = 'XDC Mainnet'
const DROPDOWN_XDC_TESTNET_DISPLAY_NAME = 'XDC Apothem Testnet'
const DROPDOWN_XDC_DEVNET_DISPLAY_NAME = 'XDC Devnet'
const DROPDOWN_POA_DISPLAY_NAME = POA_DISPLAY_NAME;
const DROPDOWN_DAI_DISPLAY_NAME = DAI_DISPLAY_NAME;
const DROPDOWN_POA_SOKOL_DISPLAY_NAME = "Sokol Network";
const DROPDOWN_MAINNET_DISPLAY_NAME = "Main Network";
const DROPDOWN_ROPSTEN_DISPLAY_NAME = "Ropsten Test Net";
const DROPDOWN_RINKEBY_DISPLAY_NAME = "Rinkeby Test Net";
const DROPDOWN_KOVAN_DISPLAY_NAME = "Kovan Test Net";
const DROPDOWN_GOERLI_TESTNET_DISPLAY_NAME = "Görli Test Net";
const DROPDOWN_CLASSIC_DISPLAY_NAME = "Ethereum Classic";
const DROPDOWN_XDC_DISPLAY_NAME = "XDC Mainnet";
const DROPDOWN_XDC_TESTNET_DISPLAY_NAME = "XDC Apothem Testnet";
const DROPDOWN_XDC_DEVNET_DISPLAY_NAME = "XDC Devnet";

/* RPC Endpoints */
const XDC_RPC_ENDPOINT = 'https://rpc.xinfin.network'
const XDC_TESTNET_RPC_ENDPOINT = 'https://rpc.apothem.network'
const XDC_DEVNET_RPC_ENDPOINT = 'https://devnetrpc.apothem.network'
// const XDC_RPC_ENDPOINT = 'https://rpc.xinfin.network'
// const XDC_TESTNET_RPC_ENDPOINT = 'https://rpc.apothem.network'
const XDC_RPC_ENDPOINT = "https://xdcpayrpc.blocksscan.io/";
const XDC_TESTNET_RPC_ENDPOINT = "https://apothemxdcpayrpc.blocksscan.io/";
const XDC_DEVNET_RPC_ENDPOINT = "https://devnetrpc.apothem.network";

/* Block Explorer URLs */
const XDC_BLOCK_EXPLORER_URL = 'https://explorer.xdc.network'
const XDC_TESTNET_BLOCK_EXPLORER_URL = 'https://explorer.apothem.network'
const XDC_DEVNET_BLOCK_EXPLORER_URL = 'https://explorer.devnet.network'
const XDC_BLOCK_EXPLORER_URL = "https://observer.xdc.org";
// const XDC_BLOCK_EXPLORER_URL = 'https://explorer.xdc.network'
const XDC_TESTNET_BLOCK_EXPLORER_URL = "https://explorer.apothem.network";
const XDC_DEVNET_BLOCK_EXPLORER_URL = "https://explorer.devnet.network";

const chainTypes = {
TEST: 1,
PROD: 2,
TEST1: 3,

}
};
const permanentNetworks = [
{
name: XDC_DISPLAY_NAME,
rpcURL: XDC_RPC_ENDPOINT,
chainId: XDC_CODE,
currencySymbol: 'XDC',
currencySymbol: "XDC",
blockExplorer: XDC_BLOCK_EXPLORER_URL,
providerType: XDC,
isPermanent: true,
colorCode: '#2049B9',
colorCode: "#2049B9",
},
{
name: XDC_TESTNET_DISPLAY_NAME,
rpcURL: XDC_TESTNET_RPC_ENDPOINT,
chainId: XDC_TESTNET_CODE,
currencySymbol: 'XDC',
currencySymbol: "XDC",
blockExplorer: XDC_TESTNET_BLOCK_EXPLORER_URL,
providerType: XDC_TESTNET,
isPermanent: true,
colorCode: '#2049B9',
colorCode: "#2049B9",
},
{
name: XDC_DEVNET_DISPLAY_NAME,
rpcURL: XDC_DEVNET_RPC_ENDPOINT,
chainId: XDC_DEVNET_CODE,
currencySymbol: 'XDC',
currencySymbol: "XDC",
blockExplorer: XDC_DEVNET_BLOCK_EXPLORER_URL,
providerType: XDC_DEVNET,
isPermanent: true,
colorCode: '#2049B9',
colorCode: "#2049B9",
},
{
name: 'Localhost 8545',
rpcURL: 'https://localhost:8545',
chainId: '',
currencySymbol: '',
blockExplorer: '',
name: "Localhost 8545",
rpcURL: "https://localhost:8545",
chainId: "",
currencySymbol: "",
blockExplorer: "",
providerType: LOCALHOST,
isPermanent: false,
colorCode: '#0CB0BE',
}]
colorCode: "#0CB0BE",
},
];

module.exports = {
POA,
Expand Down Expand Up @@ -162,4 +165,7 @@ module.exports = {
DROPDOWN_XDC_DEVNET_DISPLAY_NAME,
chainTypes,
permanentNetworks,
}
XDC_RPC_ENDPOINT,
XDC_TESTNET_RPC_ENDPOINT,
XDC_DEVNET_RPC_ENDPOINT,
};
12 changes: 6 additions & 6 deletions app/scripts/controllers/network/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ const {
POA_SOKOL_CODE,
GOERLI_TESTNET_CODE,
CLASSIC_CODE,
XDC_CODE,
XDC_TESTNET_CODE,
XDC_DEVNET_CODE
XDC_RPC_ENDPOINT,
XDC_TESTNET_RPC_ENDPOINT,
XDC_DEVNET_RPC_ENDPOINT,
} = require('./enums')
const INFURA_PROVIDER_TYPES = [ROPSTEN, RINKEBY, KOVAN, MAINNET]

Expand Down Expand Up @@ -183,11 +183,11 @@ module.exports = class NetworkController extends EventEmitter {
} else if (type === CLASSIC) {
this._configureStandardProvider({ rpcUrl: ethNetProps.RPCEndpoints(CLASSIC_CODE)[0] })
} else if (type === XDC) {
this._configureStandardProvider({ rpcUrl: ethNetProps.RPCEndpoints(XDC_CODE)[0] })
this._configureStandardProvider({ rpcUrl: XDC_RPC_ENDPOINT })
} else if (type === XDC_TESTNET) {
this._configureStandardProvider({ rpcUrl: ethNetProps.RPCEndpoints(XDC_TESTNET_CODE)[0] })
this._configureStandardProvider({ rpcUrl: XDC_TESTNET_RPC_ENDPOINT })
} else if (type === XDC_DEVNET) {
this._configureStandardProvider({ rpcUrl: ethNetProps.RPCEndpoints(XDC_DEVNET_CODE)[0] })
this._configureStandardProvider({ rpcUrl: XDC_DEVNET_RPC_ENDPOINT })
} else if (type === LOCALHOST) {
this._configureLocalhostProvider()
// url-based rpc endpoints
Expand Down
Loading

0 comments on commit 994165f

Please sign in to comment.