wallet-http: provide info if key was added/removed to db

This commit is contained in:
Nodar Chkuaselidze 2018-03-20 17:29:33 -07:00 committed by Christopher Jeffrey
parent 37a1d02e76
commit 5f47b23736
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -574,9 +574,12 @@ class HTTP extends Server {
const key = HDPublicKey.fromBase58(b58, this.network); const key = HDPublicKey.fromBase58(b58, this.network);
await req.wallet.addSharedKey(acct, key); const added = await req.wallet.addSharedKey(acct, key);
res.json(200, { success: true }); res.json(200, {
success: true,
addedKey: added
});
}); });
// Remove key // Remove key
@ -589,9 +592,12 @@ class HTTP extends Server {
const key = HDPublicKey.fromBase58(b58, this.network); const key = HDPublicKey.fromBase58(b58, this.network);
await req.wallet.removeSharedKey(acct, key); const removed = await req.wallet.removeSharedKey(acct, key);
res.json(200, { success: true }); res.json(200, {
success: true,
removedKey: removed
});
}); });
// Get key by address // Get key by address