text: exports.id=0,exports.modules={"./src/server/server.js":function(e,o,t){"use strict";t.r(o);var n=t("./build/contracts/FlightSuretyApp.json"),r=t("./src/server/config.json"),s=t("web3"),c=t.n(s),l=t("express"),a=t.n(l);t("babel-polyfill");function u(e,o,t,n,r,s,c){try{var l=e[s](c),a=l.value}catch(e){return void t(e)}l.done?o(a):Promise.resolve(a).then(n,r)}console.log("start!!!");var i=[],g=r.localhost,f=new c.a(new c.a.providers.WebsocketProvider(g.url.replace("http","ws")));f.eth.defaultAccount=f.eth.accounts[0];var p=new f.eth.Contract(n.abi,g.appAddress),v=function(){var e,o=(e=regeneratorRuntime.mark((function e(){var o,t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.eth.getAccounts();case 2:return o=e.sent,console.log("start!"),console.log("accounts: ",o),e.next=7,p.methods.REGISTRATION_FEE().call();case 7:t=e.sent,console.log(t),n=1;case 10:if(!(n<20)){e.next=21;break}return e.next=13,p.methods.registerOracle().send({from:o[n],value:t,gas:4712388,gasPrice:1e11});case 13:return e.next=15,p.methods.getMyIndexes().call({from:o[n]});case 15:r=e.sent,i.push(r),console.log("Oracle Registered: ".concat(r[0],", ").concat(r[1],", ").concat(r[2]));case 18:n++,e.next=10;break;case 21:return console.log(i),e.abrupt("return",o);case 23:case"end":return e.stop()}}),e)})),function(){var o=this,t=arguments;return new Promise((function(n,r){var s=e.apply(o,t);function c(e){u(s,n,r,c,l,"next",e)}function l(e){u(s,n,r,c,l,"throw",e)}c(void 0)}))});return function(){return o.apply(this,arguments)}}()();console.log("accounts: ",v),console.log("1st check point"),p.events.OracleRequest({fromBlock:0},(function(e,o){e&&console.log(e),console.log("OracleRequest"),console.log(o)})),p.events.FlightStatusInfo({fromBlock:0},(function(e,o){e&&console.log(e),console.log("FlightStatusInfo"),console.log(o)})),p.events.OracleReport({fromBlock:0},(function(e,o){e&&console.log(e),console.log("OracleReport"),console.log(o)}));var h=a()();h.get("/api",(function(e,o){o.send({message:"An API for use with your Dapp!"})})),o.default=h}};