@@ -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]
}
}
}