api: create address.
This commit is contained in:
parent
edbd42b2c2
commit
f494762a67
@ -148,8 +148,10 @@ HTTPServer.prototype._init = function _init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.account != null)
|
if (typeof params.account === 'string')
|
||||||
options.account = params.account || null;
|
options.account = params.account || null;
|
||||||
|
else if (typeof params.account === 'number')
|
||||||
|
options.account = params.account;
|
||||||
|
|
||||||
if (params.name)
|
if (params.name)
|
||||||
options.name = params.name;
|
options.name = params.name;
|
||||||
@ -520,6 +522,18 @@ HTTPServer.prototype._init = function _init() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Create address
|
||||||
|
this.post('/wallet/:id/address', function(req, res, next, send) {
|
||||||
|
var id = req.options.id;
|
||||||
|
var account = req.options.account;
|
||||||
|
self.walletdb.createAddress(id, account, false, function(err, address) {
|
||||||
|
if (err)
|
||||||
|
return next(err);
|
||||||
|
|
||||||
|
send(200, address.toJSON());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Wallet Balance
|
// Wallet Balance
|
||||||
this.get('/wallet/:id/balance', function(req, res, next, send) {
|
this.get('/wallet/:id/balance', function(req, res, next, send) {
|
||||||
var id = req.options.id;
|
var id = req.options.id;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user