From 1a9cd3d10471d0e1bd58d77ba4bb37664726111a Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Fri, 6 May 2022 16:44:18 -0600 Subject: [PATCH 1/2] remove go home await after sending --- src/store/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index b2c7a577..8635e8db 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1010,7 +1010,6 @@ export default new Vuex.Store({ await dispatch('shiftAccount', data.account_id); if (getters.user.unit === 'SAT') await dispatch('toggleUnit'); } - await go('/home'); } commit('addPayment', data); commit('selected', 0); @@ -1215,7 +1214,7 @@ export default new Vuex.Store({ const pair = ECPair.fromPrivateKey(hd.privateKey, { compressed: true, - network: { ...network, assetHash: "", confidentialPrefix: 1 }, + network: { ...network, assetHash: '', confidentialPrefix: 1 }, }); try { @@ -1714,8 +1713,10 @@ export default new Vuex.Store({ let [name, domain] = text.split('@'); try { clearTimeout(debounce); - await new Promise((r) => debounce = setTimeout(r, 1500)); - ({ data: text } = await Vue.axios.get(`/encode?domain=${domain}&name=${name}`)); + await new Promise((r) => (debounce = setTimeout(r, 1500))); + ({ data: text } = await Vue.axios.get( + `/encode?domain=${domain}&name=${name}` + )); } catch (e) {} } @@ -1845,7 +1846,11 @@ export default new Vuex.Store({ } try { - let ecpair = ECPair.fromWIF(text, { ...this._vm.$network, confidentialPrefix: 1, assetHash: "" }); + let ecpair = ECPair.fromWIF(text, { + ...this._vm.$network, + confidentialPrefix: 1, + assetHash: '', + }); commit('ecpair', ecpair); go('/sweep'); } catch (e) { From 86f10441e6ca144b1508db7ad6771d3bfbee3347 Mon Sep 17 00:00:00 2001 From: secondl1ght <85003930+secondl1ght@users.noreply.github.com> Date: Fri, 6 May 2022 16:45:11 -0600 Subject: [PATCH 2/2] add 1% coinos fee to payment flow front-end, replace button on sent page --- src/components/Payments.vue | 29 ++++++++++++++++------- src/components/Sent.vue | 42 ++++++++++++++++++++++++++++++---- src/components/Transaction.vue | 41 +++++++++++++++++++++++++++++---- 3 files changed, 94 insertions(+), 18 deletions(-) diff --git a/src/components/Payments.vue b/src/components/Payments.vue index 5c3c16d8..1062d821 100644 --- a/src/components/Payments.vue +++ b/src/components/Payments.vue @@ -10,7 +10,7 @@
-
+
@@ -102,7 +102,7 @@ + + + + p.amount < 0 || p.received) .filter( (p) => !this.user.account || p.account_id === this.user.account.id - ) - ; + ); }, explore(link) { diff --git a/src/components/Sent.vue b/src/components/Sent.vue index f3c8ee6f..fac7ebb8 100644 --- a/src/components/Sent.vue +++ b/src/components/Sent.vue @@ -26,7 +26,9 @@
- + Fee: + + Network Fee: + {{ fee }} {{ user.unit }}
@@ -42,11 +44,39 @@
- - $leftSend Another +
+
+
+ + Coinos Fee (1%): + + {{ + $format(total, precision) / 100 + }} + {{ user.unit }} +
+
+ + {{ + fiat($format(total, precision) / 100) + }} + {{ payment.currency }} + +
+
+
+ + + $walletHome $openExplore @@ -87,7 +117,9 @@ export default { }, methods: { - clearPayment: call('clearPayment'), + home() { + this.$go('/home'); + }, fiat(n) { if (!n || isNaN(n)) return '0.00'; diff --git a/src/components/Transaction.vue b/src/components/Transaction.vue index 73df3ad4..8d5808d2 100644 --- a/src/components/Transaction.vue +++ b/src/components/Transaction.vue @@ -55,7 +55,7 @@
+ + + + $copy - Copy {{ payment.network === 'BTC' ? 'PSBT' : 'PSET' }} + Copy {{ payment.network === 'bitcoin' ? 'PSBT' : 'PSET' }}
@@ -142,12 +161,24 @@ export default { return address; }, accounts() { - return this.user.accounts.map(a => ({ text: a.name, value: a.id })); + return this.user.accounts.map((a) => ({ text: a.name, value: a.id })); }, currency() { if (this.user.account.ticker === 'BTC') return null; else return this.user.account.ticker; }, + coinosFee() { + let coinosFee = this.user.fiat + ? this.coinosFiatFee + : this.user.unit === 'SAT' + ? this.payment.amount / 100 + : this.$format(this.payment.amount / 100, 8); + + return coinosFee; + }, + coinosFiatFee() { + return (((this.payment.amount / 100) * this.rate) / SATS).toFixed(2); + }, displayFee() { let fee = this.user.fiat ? this.fiatFee @@ -190,7 +221,7 @@ export default { this.toggleFiat(); }, explore() { - this.$nextTick(function() { + this.$nextTick(function () { if (this.payment.network === 'bitcoin') window.open(`${bs}/address/${this.payment.address}`); else window.open(`${bs}/liquid/address/${this.payment.address}`);