Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify Users When Reward Amount is Less Than Transaction Fee #434

Open
wants to merge 1 commit into
base: suite
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/wallet/earn/ModalClaimDepositReward.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
}}
</p>
</div>
<Alert variant="warning" v-if="isAmountLessThanTxFee">
{{ $t('earn.rewards.claim_modal.alert_info_message') }}
</Alert>
<div class="modal-buttons">
<CamBtn variant="transparent" @click="close()">
{{ $t('earn.rewards.claim_modal.cancel') }}
Expand Down Expand Up @@ -78,12 +81,14 @@ import Modal from '../../modals/Modal.vue'
import CamBtn from '@/components/CamBtn.vue'
import { cleanAvaxBN } from '@/helpers/helper'
import { ZeroBN } from '@/constants'
import Alert from '@/components/Alert.vue'

@Component({
components: {
AvaxInput,
Modal,
CamBtn,
Alert,
},
})
export default class ModalClaimDepositReward extends Vue {
Expand Down Expand Up @@ -138,7 +143,11 @@ export default class ModalClaimDepositReward extends Vue {
}

get feeAmt(): string {
return this.formattedAmount(ava.PChain().getTxFee())
return this.cleanAvaxBN(ava.PChain().getTxFee())
}

get isAmountLessThanTxFee(): boolean {
return this.amt.lt(ava.PChain().getTxFee())
}

get ava_asset(): AvaAsset | null {
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,8 @@
"confirmation_message": "{amount} {symbol} has been claimed.",
"signature_collected": "Your signature has been collected.",
"confirm": "Confirm",
"cancel": "Cancel"
"cancel": "Cancel",
"alert_info_message": "The requested claim operation will claim less funds than the transaction will cost. Please confirm that you want to proceed with this operation."
},
"abort_modal": {
"title": "Abort Claim Rewards",
Expand Down
Loading