Skip to content

Commit d307f3c

Browse files
authored
Merge pull request #962 from liquality/fix/login-for-min-send-amount
fix: modified login to validate min send amount for solana and btc
2 parents d03ac56 + 6069ecd commit d307f3c

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "liquality-wallet",
3-
"version": "0.81.4",
3+
"version": "0.81.5",
44
"private": true,
55
"author": "Liquality <info@liquality.io>",
66
"scripts": {

src/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ import router from './router'
66
import { Localization } from './utils/localization'
77
import ToggleButton from 'vue-js-toggle-button'
88
import VTooltip from 'v-tooltip'
9-
109
import '@/assets/scss/style.scss'
1110

11+
if (process.env.NODE_ENV === 'development' && process.env.VUE_APP_USE_VUE_DEV_TOOLS) {
12+
devtools.connect()
13+
}
14+
1215
Vue.use(ToggleButton)
1316
Vue.use(VTooltip)
1417
Vue.config.productionTip = false
@@ -20,6 +23,3 @@ new Vue({
2023
render: (h) => h(App)
2124
}).$mount('#app')
2225

23-
if (process.env.NODE_ENV === 'development' && process.env.VUE_APP_USE_VUE_DEV_TOOLS === true) {
24-
devtools.connect()
25-
}

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version": 2,
3-
"version": "0.81.4",
3+
"version": "0.81.5",
44
"name": "__MSG_appName__",
55
"description": "__MSG_appDesc__",
66
"default_locale": "en",

src/views/Send/Send.vue

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
>
99
{{ $t('common.send') }}
1010
</NavBar>
11-
<InfoNotification v-if="nativeAssetRequired || !isValidSendAmount">
12-
<EthRequiredMessage v-if="nativeAssetRequired" :account-id="account.id" :action="'send'" />
13-
<template v-else>
14-
{{ `${$t('common.minSendAmount')} ${minimumAssetSendAmount} ${asset}` }}
15-
</template>
11+
<!-- <InfoNotification v-if="nativeAssetRequired">
12+
<EthRequiredMessage :account-id="account.id" :action="'send'" />
13+
</InfoNotification> -->
14+
<InfoNotification v-if="!isValidSendAmount">
15+
{{ `${$t('common.minSendAmount')} ${minimumAssetSendAmount} ${asset}` }}
1616
</InfoNotification>
1717
<div class="wrapper form">
1818
<div class="wrapper_top">
@@ -23,7 +23,7 @@
2323
:amount-fiat="amountFiat"
2424
@update:amount="(newAmount) => (amount = newAmount)"
2525
@toggle-max="toggleMaxAmount"
26-
@update:amountFiat="updateSendAmount"
26+
@update:amountFiat="(newAmount) => (amountFiat = newAmount)"
2727
:max="available"
2828
:available="available"
2929
:max-fiat="prettyFiatBalance(available, fiatRates[asset])"
@@ -131,7 +131,7 @@
131131
class="btn btn-primary btn-lg"
132132
id="send_review_button"
133133
@click="review"
134-
:disabled="!canSend || !isValidSendAmount"
134+
:disabled="!canSend"
135135
>
136136
{{ $t('common.review') }}
137137
</button>
@@ -289,7 +289,7 @@ import { UNSResolver } from '@liquality/wallet-core/dist/src/nameResolvers/uns'
289289
import { errorToLiqualityErrorString } from '@liquality/error-parser/dist/src/utils'
290290
import { reportLiqualityError } from '@liquality/error-parser/dist/src/reporters/index'
291291
import InfoNotification from '@/components/InfoNotification'
292-
import EthRequiredMessage from '@/components/EthRequiredMessage'
292+
// import EthRequiredMessage from '@/components/EthRequiredMessage'
293293
294294
export default {
295295
components: {
@@ -303,7 +303,7 @@ export default {
303303
CustomFees,
304304
CustomFeesEIP1559,
305305
InfoNotification,
306-
EthRequiredMessage
306+
// EthRequiredMessage
307307
},
308308
mixins: [ledgerConnectMixin],
309309
data() {
@@ -351,19 +351,23 @@ export default {
351351
return this.account?.balances
352352
},
353353
minimumAssetSendAmount() {
354-
return this.minimumAssetsSendAmounts[this.asset] || 0
354+
return this.minimumAssetsSendAmounts[this.asset] || 0.0
355355
},
356356
isValidSendAmount() {
357-
return this.stateAmount >= this.minimumAssetSendAmount
357+
const amount = BN(this.stateAmount)
358+
if (amount.eq(0)) {
359+
debugger
360+
return true
361+
}
362+
debugger
363+
return amount.gte(BN(this.minimumAssetSendAmount))
358364
},
359365
amount: {
360366
get() {
361-
return this.stateAmount
367+
return this.stateAmount // crypto value
362368
},
363369
set(newValue) {
364-
this.$nextTick(() => {
365-
this.updateSendAmount(newValue)
366-
})
370+
this.updateSendAmount(newValue)
367371
}
368372
},
369373
amountFiat: {
@@ -374,14 +378,14 @@ export default {
374378
if (!newValue) {
375379
// keep it as a number instead of string, otherwise the placeholder of input won't appear
376380
this.stateAmountFiat = 0.0
377-
this.stateAmount = 0.0
378381
} else {
379382
this.stateAmountFiat = newValue
380-
this.stateAmount = fiatToCrypto(
381-
this.stateAmountFiat?.replaceAll(',', ''),
382-
this.fiatRates[this.asset]
383-
)
384383
}
384+
385+
this.stateAmount = fiatToCrypto(
386+
this.stateAmountFiat?.replaceAll(',', ''),
387+
this.fiatRates[this.asset]
388+
)
385389
}
386390
},
387391
balance() {
@@ -470,6 +474,7 @@ export default {
470474
!this.nativeAssetRequired &&
471475
this.address &&
472476
!this.addressError &&
477+
BN(this.amount).gte(BN(this.minimumAssetSendAmount)) &&
473478
BN(this.amount).gt(0) &&
474479
!this.amountError
475480
) {
@@ -538,7 +543,7 @@ export default {
538543
if (newValue && !isNaN(newValue)) {
539544
this.stateAmount = newValue
540545
} else {
541-
this.stateAmount = this.minimumAssetSendAmount
546+
this.stateAmount = 0.0
542547
}
543548
this.stateAmountFiat = prettyFiatBalance(this.stateAmount, this.fiatRates[this.asset])
544549
},
@@ -743,11 +748,6 @@ export default {
743748
label: `${this.asset}`
744749
}
745750
})
746-
747-
// Set Asset minimum send Amount
748-
this.$nextTick(() => {
749-
this.stateAmount = this.minimumAssetSendAmount || 0.0
750-
})
751751
},
752752
watch: {
753753
selectedFee: {

0 commit comments

Comments
 (0)