Commit a00b215c authored by Jared Pereira's avatar Jared Pereira

set etherScan in network config

parent 2ff75b1e
......@@ -6,11 +6,13 @@
"rinkeby": {
"provider": "https://rinkeby.infura.io",
"etherscan": "https://rinkeby.etherscan.io/",
"defaultRoom": "0x855b28d40208575951e695fa0b6a6e16e175b9d9"
},
"mainnet": {
"provider": "https://mainnet.infura.io",
"etherscan": "https://etherscan.io/",
"defaultRoom": "0xd73c64f76937c0c656f8bb4f0d120ef3a29a23ce"
}
}
......@@ -18,16 +18,14 @@ window.setInterval(function() {
//Network Selection
if(document.domain == "darq.chat"){
var network = 'mainnet'
var network = config.mainnet
}
else {
var network = 'rinkeby'
var network = config.rinkeby
}
var networkConfig = config[network]
var eth = new Eth(new HttpProvider(networkConfig.provider));
var eth = new Eth(new HttpProvider(network.provider));
//WebSocket Funcctions!
function join() {
......@@ -54,7 +52,7 @@ var COMMANDS = {
transaction: function(args) {
eth.getTransactionByHash(args.receipt).then(function(txData){
if(txData != null){
message = "You were sent " + web3.fromWei(txData.value.toString(), 'ether') + " eth: [" + txData.hash+ "]" + "(https://" + network + ".etherscan.io/" + txData.hash + ")"
message = "You were sent " + web3.fromWei(txData.value.toString(), 'ether') + " eth: [" + txData.hash+ "]" + "(" + network.etherscan + txData.hash + ")"
pushMessage({text: message, class: "notification"})
}
})
......@@ -248,7 +246,7 @@ var ABI = {"constant":true,"inputs":[{"name":"permissions","type":"address"}],"n
if(room == ''){
var home = window.location
var roomLink = "[" + networkConfig.defaultRoom + "]" +"(" + home + "?" + networkConfig.defaultRoom + ")"
var roomLink = "[" + network.defaultRoom + "]" +"(" + home + "?" + network.defaultRoom + ")"
var message = [
"This is an interface for smart-contract based chat rooms",
"This is super low security. It's essentially just an arbitrary message relayer",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment