update m issues + e frontend improvements
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
<template v-slot:body>
|
||||
<token-name-price
|
||||
:name="tokenStore.getToken(walletStore.memeToken?.contractAddress)?.name"
|
||||
:price="formatBigIntDivision(walletStore.unclaimedRewards, 10n ** tokenStore.memeToken.decimals)"
|
||||
:price="formatNumber(walletStore.unclaimedRewards, 10n ** tokenStore.memeToken.decimals)"
|
||||
></token-name-price>
|
||||
<token-logo img="/assets/img/token/bloodline.png" :alt="'bloodline logo'"></token-logo>
|
||||
</template>
|
||||
<template v-slot:actions>
|
||||
<template v-if="walletStore.unclaimedRewards > 0">
|
||||
<template v-if="walletStore.unclaimedRewards > 0n">
|
||||
<Transition name="smooth">
|
||||
<div class="connected-stake-buttons" v-show="!stakeMenu">
|
||||
<div class="btn btn-immortal mid-mid-text" @click="claimAll" v-if="stateStake === 0">Claim</div>
|
||||
@@ -19,21 +19,32 @@
|
||||
<div class="btn btn-immortal stake-button" disabled v-else-if="stateStake === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div class="btn btn-immortal mid-mid-text" @click="openStake">Stake</div>
|
||||
<div class="btn btn-immortal mid-mid-text" @click="openStake" v-if="stateStake === 0">
|
||||
Stake
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
<Transition name="smooth">
|
||||
<stake-menu
|
||||
v-model="tokenNumber"
|
||||
@close="stakeMenu = false"
|
||||
:amount="
|
||||
formatBigIntDivision(walletStore.unclaimedRewards, 10n ** tokenStore.memeToken.decimals)
|
||||
"
|
||||
:amount="walletStore.unclaimedRewards"
|
||||
:stake="stake"
|
||||
v-if="stakeMenu"
|
||||
>
|
||||
<template v-slot:body>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateClaimComp === 0">
|
||||
<div
|
||||
class="btn btn-immortal stake-button"
|
||||
disabled
|
||||
v-if="
|
||||
tokenNumber > 0 &&
|
||||
BigInt(tokenNumber) * 10n ** tokenStore.memeToken.decimals >
|
||||
walletStore.unclaimedRewards
|
||||
"
|
||||
>
|
||||
Insufficient Balance
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-else-if="stateClaimComp === 0">
|
||||
Enter Amount
|
||||
</div>
|
||||
<div
|
||||
@@ -43,10 +54,10 @@
|
||||
>
|
||||
Stake & Claim Rest
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateClaimComp === 2">
|
||||
<div class="btn btn-immortal stake-button" disabled v-else-if="stateClaimComp === 2">
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateClaimComp === 3">
|
||||
<div class="btn btn-immortal stake-button" disabled v-else-if="stateClaimComp === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div
|
||||
@@ -59,12 +70,7 @@
|
||||
<template v-slot:message-end>
|
||||
<div class="input-balance">
|
||||
Balance:
|
||||
{{
|
||||
formatBigIntDivision(
|
||||
walletStore.unclaimedRewards,
|
||||
10n ** tokenStore.memeToken.decimals
|
||||
)
|
||||
}}
|
||||
{{ formatNumber(walletStore.unclaimedRewards, 10n ** tokenStore.memeToken.decimals) }}
|
||||
</div>
|
||||
</template>
|
||||
</stake-menu>
|
||||
@@ -73,7 +79,7 @@
|
||||
<template v-else-if="cycleStore.rewardsSacrificeCurrentCycle > 0n">
|
||||
<div class="connected-stake-buttons">
|
||||
<div class="btn btn-immortal mid-mid-text btn--disabled">Claim</div>
|
||||
<div class="btn btn-immortal mid-mid-text btn--disabled">stake</div>
|
||||
<div class="btn btn-immortal mid-mid-text btn--disabled">Stake</div>
|
||||
</div>
|
||||
<div class="text-center">You can claim, once the cycle is over</div>
|
||||
</template>
|
||||
@@ -103,7 +109,7 @@ import { useTokenStore } from "@/stores/tokens";
|
||||
import { useRewardLockerStore } from "@/stores/rewardlocker";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useToast } from "vue-toastification";
|
||||
import { formatBigIntDivision } from "@/helper/helper.js";
|
||||
import { formatNumber } from "@/helper/helper.js";
|
||||
import { showSuccessToast } from "@/helper/toast.js";
|
||||
|
||||
const toast = useToast();
|
||||
@@ -158,7 +164,7 @@ async function stakeAndClaimAllCycles() {
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
//ClaimedReward (address staker, uint256 reward)
|
||||
const outputClaim = formatBigIntDivision(BigInt(rewardData.topics[2]), 10n ** tokenStore.memeToken.decimals);
|
||||
const outputClaim = formatNumber(BigInt(rewardData.topics[2]), 10n ** tokenStore.memeToken.decimals);
|
||||
showSuccessToast(
|
||||
outputClaim,
|
||||
"Success!",
|
||||
@@ -189,7 +195,7 @@ async function claimAll() {
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
//ClaimedReward (address staker, uint256 reward)
|
||||
const outputClaim = formatBigIntDivision(BigInt(rewardData.topics[2]), 10n ** tokenStore.memeToken.decimals);
|
||||
const outputClaim = formatNumber(BigInt(rewardData.topics[2]), 10n ** tokenStore.memeToken.decimals);
|
||||
showSuccessToast(
|
||||
outputClaim,
|
||||
"Success!",
|
||||
|
||||
Reference in New Issue
Block a user