diff --git a/lnbits/extensions/cashu/templates/cashu/wallet.html b/lnbits/extensions/cashu/templates/cashu/wallet.html index a31537e1e..a3ca5063a 100644 --- a/lnbits/extensions/cashu/templates/cashu/wallet.html +++ b/lnbits/extensions/cashu/templates/cashu/wallet.html @@ -75,8 +75,8 @@ page_container %} + ////////////////// TABLES ///////////////// + /////////////////////////////////////////// --> @@ -117,8 +117,8 @@ page_container %} {{mint.url}} + >This is your active mint. --> @@ -260,13 +260,18 @@ page_container %}
{{props.row.date}}
+
{{props.row.memo}}
+ --> -
{{props.row.bolt11}}
+
+ {{shortenString(props.row.bolt11, 20, 10)}} + Click to copy +
-
{{props.row.hash}}
+
+ {{props.row.hash}} +
{{props.row.mint}}
@@ -334,15 +339,17 @@ page_container %} >
{{props.row.amount}}
-
{{props.row.date}}
+
{{props.row.memo}}
+ --> -
{{props.row.token}}
+
+ {{shortenString(props.row.token, 10, 40)}} + Click to copy +
@@ -460,14 +467,9 @@ page_container %} @hide="closeParseDialog" position="top" > - +
- + {% raw %}
{{ payInvoiceData.invoice.fsat }}{% endraw %} {{LNBITS_DENOMINATION}} {% raw %} asdasdsd @@ -487,8 +489,12 @@ page_container %} color="primary" :disabled="payInvoiceData.blocking" @click="melt" - >Pay + :label="!payInvoiceData.blocking? 'Pay' : 'Paying...'" + > Cancel @@ -618,7 +624,7 @@ page_container %}
@@ -813,11 +819,11 @@ page_container %} @keyup.enter="requestMintButton" > + filled + dense + v-model.trim="invoiceData.memo" + label="Memo" + > -->
@@ -916,8 +922,8 @@ page_container %} >Send Tokens + >Burn Tokens -->
Copy token length + lastchars) { + return ( + s.substring(0, length) + + '...' + + s.substring(s.length - lastchars, s.length) + ) + } + }, activateMint: async function (url, verbose = false, stop_workers = true) { if (url == this.activeMintURL) { return @@ -1484,17 +1499,6 @@ page_container %} clearInterval(this.payInvoiceData.paymentChecker) }, 10000) }, - - onPaymentReceived: function (paymentHash) { - this.fetchPayments() - this.fetchBalance() - - if (this.receive.paymentHash === paymentHash) { - this.receive.show = false - this.receive.paymentHash = null - clearInterval(this.receive.paymentChecker) - } - }, decodeQR: function (res) { this.camera.data = res // this.payInvoiceData.data.request = res @@ -1635,31 +1639,6 @@ page_container %} }) }, - deleteWallet: function (walletId, user) { - LNbits.utils - .confirmDialog('Are you sure you want to delete this wallet?') - .onOk(() => { - LNbits.href.deleteWallet(walletId, user) - }) - }, - fetchPayments: function () { - return - }, - fetchBalance: function () {}, - exportCSV: function () { - // status is important for export but it is not in paymentsTable - // because it is manually added with payment detail link and icons - // and would cause duplication in the list - let columns = this.paymentsTable.columns - columns.unshift({ - name: 'pending', - align: 'left', - label: 'Pending', - field: 'pending' - }) - LNbits.utils.exportCSV(columns, this.payments) - }, - /////////////////////////////////// WALLET /////////////////////////////////// showInvoiceCreateDialog: async function () { console.log('##### showInvoiceCreateDialog') @@ -1803,8 +1782,8 @@ page_container %} requestMint: async function () { /* - gets an invoice from the mint to get new tokens - */ + gets an invoice from the mint to get new tokens + */ try { const {data} = await axios.get( `${this.activeMintURL}/mint?amount=${this.invoiceData.amount}` @@ -1834,9 +1813,9 @@ page_container %} mintApi: async function (amounts, payment_hash, verbose = true) { /* - asks the mint to check whether the invoice with payment_hash has been paid - and requests signing of the attached outputs. - */ + asks the mint to check whether the invoice with payment_hash has been paid + and requests signing of the attached outputs. + */ try { let secrets = await this.generateSecrets(amounts) @@ -1902,9 +1881,9 @@ page_container %} split: async function (proofs, amount) { /* - supplies proofs and requests a split from the mint of these - proofs at a specific amount - */ + supplies proofs and requests a split from the mint of these + proofs at a specific amount + */ try { if (proofs.length == 0) { throw new Error('no proofs provided.') @@ -1977,11 +1956,11 @@ page_container %} splitToSend: async function (proofs, amount, invlalidate = false) { /* - splits proofs so the user can keep firstProofs, send scndProofs. - then sets scndProofs as reserved. - - if invalidate, scndProofs (the one to send) are invalidated - */ + splits proofs so the user can keep firstProofs, send scndProofs. + then sets scndProofs as reserved. + + if invalidate, scndProofs (the one to send) are invalidated + */ try { const spendableProofs = proofs.filter(p => !p.reserved) if (this.sumProofs(spendableProofs) < amount) { @@ -2024,8 +2003,8 @@ page_container %} redeem: async function () { /* - uses split to receive new tokens. - */ + uses split to receive new tokens. + */ this.showReceiveTokens = false console.log('### receive tokens', this.receiveData.tokensBase64) try { @@ -2087,8 +2066,8 @@ page_container %} sendTokens: async function () { /* - calls splitToSend, displays token and kicks off the spendableWorker - */ + calls splitToSend, displays token and kicks off the spendableWorker + */ try { // keep firstProofs, send scndProofs and delete them (invalidate=true) let {fristProofs, scndProofs} = await this.splitToSend( @@ -2123,7 +2102,6 @@ page_container %} melt: async function () { // todo: get fees from server and add to inputs this.payInvoiceData.blocking = true - console.log('#### pay lightning') const amount_invoice = this.payInvoiceData.invoice.sat const amount = @@ -2197,9 +2175,9 @@ page_container %} checkProofsSpendable: async function (proofs, update_history = false) { /* - checks with the mint whether an array of proofs is still - spendable or already invalidated - */ + checks with the mint whether an array of proofs is still + spendable or already invalidated + */ if (proofs.length == 0) { return } @@ -2307,7 +2285,6 @@ page_container %} }, ////////////// UI HELPERS ////////////// - setInvoicePaid: async function (payment_hash) { const invoice = this.invoicesCashu.find(i => i.hash === payment_hash) invoice.status = 'paid' @@ -2355,9 +2332,9 @@ page_container %} checkTokenSpendable: async function (token, verbose = true) { /* - checks whether a base64-encoded token (from the history table) has been spent already. - if it is spent, the appropraite entry in the history table is set to paid. - */ + checks whether a base64-encoded token (from the history table) has been spent already. + if it is spent, the appropraite entry in the history table is set to paid. + */ const tokenJson = JSON.parse(atob(token)) const proofs = tokenJson.proofs