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 12, 2023
1 parent 764f98d commit 5ac5482
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/walletextension/api/staticOG/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,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 @@ -31,7 +31,6 @@ let obscuroGatewayAddress = window.location.protocol + "//" + window.location.ho
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 @@ -40,12 +39,12 @@ 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],
blockExplorerUrls: null,
blockExplorerUrls: ['https://testnet.obscuroscan.io'],
},
],
});
Expand Down Expand Up @@ -228,4 +227,4 @@ const initialize = () => {

}

window.addEventListener(eventDomLoaded, initialize);
window.addEventListener(eventDomLoaded, initialize);

0 comments on commit 5ac5482

Please sign in to comment.