File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 15
15
<span >Currently owning {{ trade.amount }} {{ trade.base_currency }}</span >
16
16
</p >
17
17
<BFormGroup
18
- :label =" `*Amount in ${trade.base_currency} [optional]`"
19
18
label-for =" stake-input"
20
19
invalid-feedback =" Amount must be empty or a positive number"
21
20
:state =" amount !== undefined && amount > 0"
22
21
>
22
+ <template #label >
23
+ <span class =" fst-italic" >*Amount in {{ trade.base_currency }} [optional]</span >
24
+ <span class =" ms-1 fst-italic" >{{ amountInBase }}</span >
25
+ </template >
23
26
<BFormInput id =" stake-input" v-model =" amount" type =" number" step =" 0.000001" ></BFormInput >
24
27
<BFormInput
25
28
id =" stake-input"
@@ -59,6 +62,10 @@ const props = defineProps({
59
62
type: Object as () => Trade ,
60
63
required: true ,
61
64
},
65
+ stakeCurrencyDecimals: {
66
+ type: Number ,
67
+ required: true ,
68
+ },
62
69
});
63
70
64
71
const model = defineModel <boolean >();
@@ -105,4 +112,12 @@ function handleEntry() {
105
112
// Trigger submit handler
106
113
handleSubmit ();
107
114
}
115
+
116
+ const amountDebounced = refDebounced (amount , 250 , { maxWait: 500 });
117
+
118
+ const amountInBase = computed <string >(() => {
119
+ return amountDebounced .value && props .trade .current_rate
120
+ ? ` ~${formatPriceCurrency (amountDebounced .value * props .trade .current_rate , props .trade .quote_currency || ' ' , props .stakeCurrencyDecimals )} (Estimated value) `
121
+ : ' ' ;
122
+ });
108
123
</script >
Original file line number Diff line number Diff line change 79
79
<BFormInput id =" trade-filter" v-model =" filterText" type =" text" placeholder =" Filter" />
80
80
</BFormGroup >
81
81
</div >
82
- <ForceExitForm v-if =" activeTrades" v-model =" forceExitVisible" :trade =" feTrade" />
82
+ <ForceExitForm
83
+ v-if =" activeTrades"
84
+ v-model =" forceExitVisible"
85
+ :trade =" feTrade"
86
+ :quote-currency-decimals =" botStore.activeBot.botState.stake_currency_decimals"
87
+ />
83
88
<ForceEntryForm
84
89
v-model =" increasePosition.visible"
85
90
:pair =" increasePosition.trade?.pair"
You can’t perform that action at this time.
0 commit comments