text: exports.id=0,exports.modules={"./src/server/server.js":function(e,o,s){"use strict";s.r(o);var t=s("./build/contracts/FlightSuretyApp.json"),n=s("./build/contracts/FlightSuretyData.json"),r=s("./src/server/config.json"),c=s("web3"),a=s.n(c),l=s("express"),u=s.n(l),i=r.localhost,d=new a.a(new a.a.providers.WebsocketProvider(i.url.replace("http","ws")));d.eth.defaultAccount=d.eth.accounts[0];var f=new d.eth.Contract(t.abi,i.appAddress),g=new d.eth.Contract(n.abi,i.dataAddress),h=[],p=[m,v,A,b,w,x],m=0,v=10,A=20,b=30,w=40,x=50;d.eth.getAccounts((function(e,o){console.log("Get account"),function(e){g.methods.authorizeCaller(i.appAddress).send({from:e},(function(e,o){e?console.log(e):console.log("found authorized callerss: ".concat(i.appAddress))}))}(o[0]),console.log("authorized");for(var s=10;s<40;s++)console.log("accounts :"+o[s]),f.methods.registerOracle().send({from:o[s],value:d.utils.toWei("1","ether"),gas:1e6},(function(e,o){e?console.log(e):console.log("regiser success")}))})),f.events.OracleRequest({fromBlock:0},(function(e,o){console.log("inside the oracle requests"),e?console.log(e):function(){for(var e=o.returnValues.flightInfo,s=o.returnValues.timestamp,t=p[Math.floor(Math.random()*p.length)],n=o.returnValues.index,r=o.returnValues.airline,c=function(o){h[o].index.includes(n)&&f.methods.submitOracleResponse(n,r,e,s,t).send({from:h[o].address,gas:1e5},(function(e,s){e?console.log(e):console.log("".concat(JSON.stringify(h[o]),": Status code ").concat(t))}))},a=0;a<h.length;a++)c(a)}()}));var j=u()();j.get("/api",(function(e,o){o.send({message:"An API for use with your Dapp!"})})),o.default=j}};