update m issues + digit change numbers
This commit is contained in:
@@ -23,20 +23,24 @@
|
||||
<rewards-wrapper
|
||||
title="Sacrafice Reward"
|
||||
coin="$BLOOD"
|
||||
:amount="formatNumber(rewardsSacrifice)"
|
||||
:amount="formatBigIntDivision(rewardsSacrifice, 10n ** tokenStore.memeToken.decimals)"
|
||||
image="/assets/img/vampir.png"
|
||||
/>
|
||||
<rewards-wrapper
|
||||
title="Staking Bonus"
|
||||
coin="$BLOOD"
|
||||
:amount="formatNumber(rewardsStaking)"
|
||||
:amount="formatBigIntDivision(rewardsStaking, 10n ** tokenStore.memeToken.decimals)"
|
||||
image="/assets/img/vampir.png"
|
||||
/>
|
||||
<rewards-wrapper
|
||||
title="Clan Bonus"
|
||||
coin="$BLOOD"
|
||||
:amount="formatNumber(rewardsClan)"
|
||||
image="/assets/img/vampir.png"
|
||||
:amount="formatBigIntDivision(rewardsClan, 10n ** tokenStore.memeToken.decimals)"
|
||||
:image="
|
||||
activeCycle === currentCycle || !cycleStore.getCurrentCycleData?.winner.vamplogo
|
||||
? '/assets/img/token/notoken.png'
|
||||
: cycleStore.getCurrentCycleData?.winner.vamplogo
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="rewards-total-wrapper">
|
||||
@@ -45,7 +49,10 @@
|
||||
class="rewards-total-inner bloodline-border bloodline-border--variant1"
|
||||
:class="{ purple: rewardsTotal > 0 && activeCycle !== currentCycle }"
|
||||
>
|
||||
<token-name-price name="$BLOOD" :price="formatNumber(rewardsTotal)"></token-name-price>
|
||||
<token-name-price
|
||||
name="$BLOOD"
|
||||
:price="formatBigIntDivision(rewardsTotal, 10n ** tokenStore.memeToken.decimals)"
|
||||
></token-name-price>
|
||||
<token-logo img="/assets/img/vampir.png" :alt="'vampire'"></token-logo>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,12 +77,16 @@
|
||||
<template v-else-if="rewardsTotal > 0">
|
||||
<Transition name="smooth">
|
||||
<div class="stake-buttons" v-show="!stakeMenu">
|
||||
<div class="btn btn-immortal" v-if="stateClaimedComp === 0" @click="claimRewards">Claim</div>
|
||||
<div class="btn btn-immortal" disabled v-if="stateClaimedComp === 2">Sign Transaction</div>
|
||||
<div class="btn btn-immortal" disabled v-if="stateClaimedComp === 3">
|
||||
<div class="btn btn-immortal sub-header" v-if="stateClaimedComp === 0" @click="claimRewards">
|
||||
Claim
|
||||
</div>
|
||||
<div class="btn btn-immortal sub-header" disabled v-if="stateClaimedComp === 2">
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn-immortal sub-header" disabled v-if="stateClaimedComp === 3">
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div class="btn btn-immortal" @click="openStake">Stake</div>
|
||||
<div class="btn btn-immortal sub-header" @click="openStake">Stake</div>
|
||||
</div>
|
||||
</Transition>
|
||||
<Transition name="smooth">
|
||||
@@ -87,20 +98,32 @@
|
||||
v-if="stakeMenu"
|
||||
>
|
||||
<template v-slot:body>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStakeClaimComp === 0">
|
||||
<div
|
||||
class="btn btn-immortal sub-header stake-button"
|
||||
disabled
|
||||
v-if="stateStakeClaimComp === 0"
|
||||
>
|
||||
Enter Amount
|
||||
</div>
|
||||
<div
|
||||
class="btn btn-immortal stake-button"
|
||||
class="btn btn-immortal sub-header stake-button"
|
||||
v-else-if="stateStakeClaimComp === 1"
|
||||
@click="stakeAndClaim"
|
||||
>
|
||||
Stake & Claim Rest
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStakeClaimComp === 2">
|
||||
<div
|
||||
class="btn btn-immortal sub-header stake-button"
|
||||
disabled
|
||||
v-if="stateStakeClaimComp === 2"
|
||||
>
|
||||
Sign Transaction
|
||||
</div>
|
||||
<div class="btn btn-immortal stake-button" disabled v-if="stateStakeClaimComp === 3">
|
||||
<div
|
||||
class="btn btn-immortal sub-header stake-button"
|
||||
disabled
|
||||
v-if="stateStakeClaimComp === 3"
|
||||
>
|
||||
<loading-component></loading-component>
|
||||
</div>
|
||||
<div
|
||||
@@ -134,7 +157,7 @@ import { waitForTransaction } from "@wagmi/core";
|
||||
import LoadingComponent from "@/components/LoadingComponent.vue";
|
||||
import TokenNamePrice from "@/components/TokenNamePrice.vue";
|
||||
import TokenLogo from "@/components/TokenLogo.vue";
|
||||
import { formatNumber } from "@/helper/helper.js";
|
||||
import { formatBigIntDivision } from "@/helper/helper.js";
|
||||
import { showSuccessToast } from "@/helper/toast.js";
|
||||
|
||||
const showPanel = inject("showPanel");
|
||||
@@ -186,10 +209,10 @@ async function stakeAndClaim() {
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
console.log("stakeData", stakeData);
|
||||
const outputClaim = BigInt(rewardData?.topics[2]) / 10n ** tokenStore.memeToken.decimals;
|
||||
const outputStaked = BigInt(stakeData?.topics[3]) / 10n ** tokenStore.memeToken.decimals;
|
||||
const outputClaim = BigInt(rewardData?.topics[2]);
|
||||
const outputStaked = BigInt(stakeData?.topics[3]);
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim + outputStaked),
|
||||
formatBigIntDivision(outputClaim + outputStaked, 10n ** tokenStore.memeToken.decimals),
|
||||
"Success!",
|
||||
"You just claimed and staked",
|
||||
"Join the next cycle to increase your rewards and win with your clan."
|
||||
@@ -237,9 +260,9 @@ async function claimRewards() {
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
|
||||
const outputClaim = BigInt(rewardData.topics[2]) / 10n ** tokenStore.memeToken.decimals;
|
||||
const outputClaim = formatBigIntDivision(BigInt(rewardData.topics[2]), 10n ** tokenStore.memeToken.decimals);
|
||||
showSuccessToast(
|
||||
formatNumber(outputClaim),
|
||||
outputClaim,
|
||||
"Success!",
|
||||
"You just claimed",
|
||||
"Join the next cycle to increase your rewards and win with your clan."
|
||||
@@ -276,7 +299,7 @@ const stateStakeClaimComp = computed(() => {
|
||||
tokenNumber.value === null ||
|
||||
tokenNumber.value === "" ||
|
||||
tokenNumber.value === 0 ||
|
||||
tokenNumber.value > walletStore.unclaimedRewards
|
||||
BigInt(tokenNumber.value) > walletStore.unclaimedRewards / 10n ** tokenStore.memeToken.decimals
|
||||
) {
|
||||
returnState = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user