From 5f47b237367cda04755327480631c286aa7657e4 Mon Sep 17 00:00:00 2001 From: Nodar Chkuaselidze Date: Tue, 20 Mar 2018 17:29:33 -0700 Subject: [PATCH] wallet-http: provide info if key was added/removed to db --- lib/wallet/http.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/wallet/http.js b/lib/wallet/http.js index 2d0f1a1b..afc856a4 100644 --- a/lib/wallet/http.js +++ b/lib/wallet/http.js @@ -574,9 +574,12 @@ class HTTP extends Server { 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 @@ -589,9 +592,12 @@ class HTTP extends Server { 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