diff --git a/lnbits/extensions/cashu/templates/cashu/wallet.html b/lnbits/extensions/cashu/templates/cashu/wallet.html index 14290570d..6cf394a04 100644 --- a/lnbits/extensions/cashu/templates/cashu/wallet.html +++ b/lnbits/extensions/cashu/templates/cashu/wallet.html @@ -52,6 +52,7 @@ page_container %} rounded color="primary" class="full-width" + @click="showReceiveTokensDialog" >Receive @@ -322,6 +323,43 @@ page_container %} + + + + +
+
+
+ Paste tokens please +
+
+ +
+ +
+ Accept Tokens + Close +
+
+
+ +
@@ -436,9 +474,13 @@ page_container %} tokens: '', tokensBase64: '' }, + receiveData: { + tokensBase64: '' + }, showInvoiceDetails: false, showPayInvoice: false, showSendTokens: false, + showReceiveTokens: false, tokens: [], tab: 'tokens', @@ -868,6 +910,11 @@ page_container %} this.showSendTokens = true }, + showReceiveTokensDialog : function() { + this.receiveData.tokensBase64 = '' + this.showReceiveTokens = true + }, + requestInvoice: async function () { try { const {data} = await LNbits.api.request( @@ -1015,14 +1062,23 @@ page_container %} console.log('### this.tokens', this.tokens) }, + acceptTokens: async function() { + this.showReceiveTokens = false + console.log('### receive tokens', this.receiveData.tokensBase64) + if (this.receiveData.tokensBase64) { + const tokensJson = atob(this.receiveData.tokensBase64) + console.log('tokensJson', tokensJson) + } + + }, + findTokenForAmount: function (amount) { for (const token of this.tokens) { const index = token.promises?.findIndex(p => p.amount === amount) if (index >= 0) { return { promise: token.promises[index], - secret: token.secrets[index], - randomBlindingFactor: token.randomBlindingFactors[index] + secret: token.secrets[index] } } }