{"version":3,"sources":["jsdelivr-header.js","/npm/five-bells-trader@1.0.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,MAAM,GAAK,QAAQ,MACb,QAAU,QAAQ,iBAClB,OAAS,QAAQ,qBACjB,IAAM,QAAQ,kBACd,QAAU,QAAQ,sBAClB,WAAa,QAAQ,yBACrB,IAAM,QAAQ,SAEpB,SAAS,SACP,IAAI,OAAO,OAAO,OAAO,MAEzB,IAAI,OAAO,KAAK,uBAAyB,OAAO,OAAO,QAAU,IAC/D,OAAO,OAAO,MAChB,IAAI,OAAO,KAAK,aAAe,OAAO,OAAO,UAC7C,IAAK,IAAI,KAAQ,OAAO,aACtB,IAAI,OAAO,KAAK,OAAQ,GAK1B,IAAG,kBACK,QAAQ,gBAER,WAAW,eAAe,OAAO,aACzC,IAAG,OAAM,SAAU,GACjB,IAAI,OAAO,MAAqB,iBAAR,GAAoB,EAAI,OAAS,EAC3D,GACF,CAEA,OAAO,QAAU,CACf,IAAK,IACL,OAAQ,OACR,UAAW,QAAQ,WAGhB,OAAO,QACV","file":"/npm/five-bells-trader@1.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/five-bells-trader@1.0.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict'\nconst co = require('co')\nconst ledgers = require('./lib/ledgers')\nconst config = require('./services/config')\nconst log = require('./services/log')\nconst backend = require('./services/backend')\nconst subscriber = require('./services/subscriber')\nconst app = require('./app')\n\nfunction listen () {\n  app.listen(config.server.port)\n\n  log('app').info('trader listening on ' + config.server.bind_ip + ':' +\n    config.server.port)\n  log('app').info('public at ' + config.server.base_uri)\n  for (let pair of config.tradingPairs) {\n    log('app').info('pair', pair)\n  }\n\n  // Start a coroutine that connects to the backend and\n  // subscribes to all the ledgers in the background\n  co(function * () {\n    yield backend.connect()\n\n    yield subscriber.subscribePairs(config.tradingPairs)\n  }).catch(function (err) {\n    log('app').error(typeof err === 'object' && err.stack || err)\n  })\n}\n\nmodule.exports = {\n  app: app,\n  listen: listen,\n  addLedger: ledgers.addLedger\n}\n\nif (!module.parent) {\n  listen()\n}\n"]}