Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bridge/bsc.html
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@
} else {
let myEthAddress;
try {
const accounts = (await ethereum.send('eth_requestAccounts')).result;
myEthAddress = accounts[0]
const accounts = await ethereum.request({method: 'eth_requestAccounts'});
myEthAddress = accounts[0];
console.log('address is', myEthAddress);
} catch (error) {
console.log(error);
Expand All @@ -753,7 +753,8 @@
console.log('address is', provider.myEthAddress);
});

if (ethereum.networkVersion !== ETH_CHAIN_ID.toString()) {
const networkVersion = await ethereum.request({ method: 'net_version' });
if (networkVersion !== ETH_CHAIN_ID.toString()) {
alert('Set chain to ' + (IS_TESTNET ? 'BSC Testnet' : 'BSC') + ' in Metamask');
return null;
}
Expand Down
5 changes: 3 additions & 2 deletions bridge/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@
} else {
let myEthAddress;
try {
const accounts = (await ethereum.send('eth_requestAccounts')).result;
const accounts = await ethereum.request({method: 'eth_requestAccounts'});
myEthAddress = accounts[0]
console.log('address is', myEthAddress);
} catch (error) {
Expand All @@ -751,7 +751,8 @@
console.log('address is', provider.myEthAddress);
});

if (ethereum.networkVersion !== ETH_CHAIN_ID.toString()) {
const networkVersion = await ethereum.request({ method: 'net_version' });
if (networkVersion !== ETH_CHAIN_ID.toString()) {
alert('Set chain to ' + (ETH_CHAIN_ID === 3 ? 'Ropsten' : 'Mainnet') + ' in Metamask');
return null;
}
Expand Down