diff --git a/lib/routes.js b/lib/routes.js index be9836ee..ec27b131 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -155,6 +155,16 @@ function postTx (req, res, next) { .catch(next) } +function createWallet (req, res, next) { + const pi = plugins(req.settings, req.deviceId) + pi.newAddress(req.tx) + .then(addr => { + console.log(JSON.stringify(addr)) + respond(req, res, addr) + }) + .catch(next) +} + function stateChange (req, res, next) { helpers.stateChange(req.deviceId, req.deviceTime, req.body) .then(() => respond(req, res)) @@ -367,6 +377,7 @@ app.post('/phone_code', getCustomerWithPhoneCode) app.patch('/customer/:id', updateCustomer) app.post('/tx', postTx) +app.post('/tx/createWallet', createWallet) app.get('/tx/:id', getTx) app.get('/tx', getPhoneTx) app.get('/logs', getLastSeen)