Skip to content

Commit

Permalink
Match network configuration with Chainlist
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Sep 21, 2023
1 parent 34aeae3 commit 259bfe4
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tools/walletextension/api/staticOG/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const pathJoin = obscuroGatewayVersion + "/join/";
const pathAuthenticate = obscuroGatewayVersion + "/authenticate/";
const pathQuery = obscuroGatewayVersion + "/query/";
const pathRevoke = obscuroGatewayVersion + "/revoke/";
const obscuroChainIDDecimal = 777;
const obscuroChainIDDecimal = 443;
const methodPost = "post";
const methodGet = "get";
const jsonHeaders = {
Expand All @@ -32,7 +32,6 @@ let provider = null;
async function addNetworkToMetaMask(ethereum, userID, chainIDDecimal) {
// add network to MetaMask
let chainIdHex = "0x" + chainIDDecimal.toString(16); // Convert to hexadecimal and prefix with '0x'

try {
await ethereum.request({
method: 'wallet_addEthereumChain',
Expand All @@ -41,12 +40,16 @@ async function addNetworkToMetaMask(ethereum, userID, chainIDDecimal) {
chainId: chainIdHex,
chainName: 'Obscuro Testnet',
nativeCurrency: {
name: 'Obscuro',
symbol: 'OBX',
name: 'Sepolia Ether',
symbol: 'ETH',
decimals: 18
},
rpcUrls: [obscuroGatewayAddress+"/"+obscuroGatewayVersion+'/?u='+userID],
<<<<<<< HEAD
blockExplorerUrls: null
=======
blockExplorerUrls: ['https://testnet.obscuroscan.io'],
>>>>>>> 5ac5482f (Match network configuration with Chainlist)
},
],
});
Expand Down Expand Up @@ -314,4 +317,8 @@ const initialize = async () => {

}

window.addEventListener(eventDomLoaded, checkIfMetamaskIsLoaded);
<<<<<<< HEAD
window.addEventListener(eventDomLoaded, checkIfMetamaskIsLoaded);
=======
window.addEventListener(eventDomLoaded, initialize);
>>>>>>> 5ac5482f (Match network configuration with Chainlist)

0 comments on commit 259bfe4

Please sign in to comment.