From a93903a1832c7a1bbc0bf713ec79766c873e8bf9 Mon Sep 17 00:00:00 2001 From: benarc Date: Mon, 22 Feb 2021 01:14:28 +0000 Subject: [PATCH] added address dialogue --- .../watchonly/templates/watchonly/index.html | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index ed3a5537b..11ae3a17b 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -468,7 +468,44 @@ }, methods: { + getAddresses: function (walletID) { + var self = this + LNbits.api + .request( + 'GET', + '/watchonly/api/v1/addresses/' + walletID, + this.g.user.wallets[0].inkey + ) + .then(function (response) { + + self.Addresses.data = response.data + self.currentaddress = self.Addresses.data[self.Addresses.data.length - 1].address + console.log(self.currentaddress) + + }) + + .catch(function (error) { + LNbits.utils.notifyApiError(error) + }) + }, + getFreshAddress: function (walletID) { + var self = this + + LNbits.api + .request( + 'GET', + '/watchonly/api/v1/address/' + walletID, + this.g.user.wallets[0].inkey + ) + .then(function (response) { + console.log(response.data) + self.Addresses.data = response.data + self.currentaddress = self.Addresses.data[self.Addresses.data.length - 1].address + + }) + + }, chargeRedirect: function (address){ window.location.href = this.mempool.endpoint + "/address/" + address;