Add HTTP method to create a new wallet on request
This commit is contained in:
parent
03288c4f5e
commit
bbd76ba851
1 changed files with 11 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue