|
9 | 9 | <v-card>
|
10 | 10 | <v-card-title class="bg-primary"> Withdraw TFT </v-card-title>
|
11 | 11 | <v-card-text>
|
12 |
| - Interact with the bridge in order to withdraw your TFT to |
13 |
| - {{ selectedName?.charAt(0).toUpperCase() + selectedName!.slice(1) }} (withdraw fee is: {{ withdrawFee }} TFT) |
| 12 | + <VAlert type="info"> |
| 13 | + Interact with the bridge in order to withdraw your TFT to |
| 14 | + {{ selectedName?.charAt(0).toUpperCase() + selectedName!.slice(1) }} (withdraw fee is: |
| 15 | + {{ withdrawFee }} TFT) |
| 16 | + </VAlert> |
14 | 17 | </v-card-text>
|
15 | 18 | <v-card-text>
|
16 | 19 | <FormValidator v-model="valid">
|
|
35 | 38 | :rules="[
|
36 | 39 | validators.required('This field is required'),
|
37 | 40 | validators.min('Amount should be at least 2 TFT', 2),
|
38 |
| - validators.max( 'Amount cannot exceed balance',freeBalance!), |
| 41 | + validators.max('Amount cannot exceed balance with fees',freeBalance! - withdrawFee!), |
39 | 42 | validators.isValidDecimalNumber(3,'Amount must have 3 decimals only')
|
40 | 43 | ]"
|
41 | 44 | >
|
@@ -124,10 +127,11 @@ async function validateAddress() {
|
124 | 127 | }
|
125 | 128 |
|
126 | 129 | async function withdrawTFT(targetAddress: string, withdrawAmount: number) {
|
| 130 | + if (!props.withdrawFee) return; |
127 | 131 | loadingWithdraw.value = true;
|
128 | 132 | try {
|
129 | 133 | updateGrid(grid, { projectName: "" });
|
130 |
| - await grid?.bridge.swapToStellar({ amount: +withdrawAmount, target: targetAddress }); |
| 134 | + await grid?.bridge.swapToStellar({ amount: +withdrawAmount + props.withdrawFee, target: targetAddress }); |
131 | 135 |
|
132 | 136 | await ProfileManagerController.reloadBalance();
|
133 | 137 | createCustomToast("Transaction Succeeded", ToastType.success);
|
|
0 commit comments