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("./src/server/config.json"),r=(s("./src/dapp/config.json"),s("web3")),c=s.n(r);var a=s("express"),i=s.n(a),l=n.localhost,u=new c.a(new c.a.providers.WebsocketProvider(l.url.replace("http","ws")));u.eth.defaultAccount=u.eth.accounts[0];var d=new u.eth.Contract(t.abi,l.appAddress),f=[];u.eth.getAccounts((function(e,o){o[0];for(var s=function(e){d.methods.registerOracle().send({from:o[e],value:u.utils.toWei("1","ether"),gas:45e5},(function(s,t){s?console.log(s):d.methods.getMyIndexes().call({from:o[e]},(function(s,t){if(s)console.log(s);else{var n={address:o[e],index:t};console.log("Oracle: ".concat(JSON.stringify(n))),f.push(n)}}))}))},t=10;t<30;t++)s(t)})),d.events.OracleRequest({fromBlock:0},(function(e,o){if(e)console.log(e);else for(var s=o.returnValues,t=s.index,n=function(e){f[e].index.includes(t)&&d.methods.submitOracleResponse(t,s.airline,s.flight,s.timestamp,s.statusCode).send({from:f[e].address},(function(o,s){o?console.log(o):console.log("".concat(JSON.stringify(f[e]),": Status code ").concat(STATUS_CODES[Math.floor(6*Math.random())]))}))},r=0;r<f.length;r++)n(r)}));var g=i()();g.get("/api",(function(e,o){o.send({message:"An API for use with your Dapp!"})}));o.default=g}};