diff --git a/lnbits/extensions/cashu/templates/cashu/wallet.html b/lnbits/extensions/cashu/templates/cashu/wallet.html index cad457653..7b5e1c3fb 100644 --- a/lnbits/extensions/cashu/templates/cashu/wallet.html +++ b/lnbits/extensions/cashu/templates/cashu/wallet.html @@ -79,54 +79,31 @@ page_container %} {% raw %} {% endraw %} @@ -475,6 +452,44 @@ page_container %} }, filter: null }, + + tokensTable: { + columns: [ + { + name: 'denomination', + align: 'left', + label: 'Denomination', + field: 'denomination', + sortable: true + }, + { + name: 'count', + align: 'left', + label: 'Count', + field: 'count', + sortable: true + }, + { + name: 'value', + align: 'left', + label: 'Value', + field: 'value', + sortable: true + }, + { + name: 'memo', + align: 'left', + label: 'Memo', + field: 'memo', + sortable: true + } + ], + pagination: { + rowsPerPage: 10 + }, + filter: null + }, + paymentsChart: { show: false }, @@ -498,6 +513,31 @@ page_container %} }, pendingPaymentsExist: function () { return this.payments.findIndex(payment => payment.pending) !== -1 + }, + + tokenList: function () { + const y = {} + let x = this.tokens + .map(t => t.blindedMessages) + .flat() + .map(t => ({ + blindingFactor: t.B_, + denomination: t.amount + })) + console.log('### x1', x) + x.forEach(t => { + y[`_${t.denomination}`] = y[`_${t.denomination}`] || [] + y[`_${t.denomination}`].push(t) + }) + x = Object.keys(y).map(k => ({ + denomination: y[k][0].denomination, + count: y[k].length, + value: y[k][0].denomination * y[k].length + })) + console.log('### x2', x) + console.log('### y', y) + + return x } }, filters: {