update m issues + digit change numbers

This commit is contained in:
EmberSpirit
2023-10-22 17:14:00 +02:00
parent fa4fa54033
commit bf76e55fb5
26 changed files with 2704 additions and 2361 deletions
+17 -15
View File
@@ -4,7 +4,7 @@
<template v-slot:body>
<token-name-price
:name="tokenStore.getToken(walletStore.memeToken?.contractAddress)?.name"
:price="formatNumber(walletStore.unclaimedRewards)"
:price="formatBigIntDivision(walletStore.unclaimedRewards, 10n ** tokenStore.memeToken.decimals)"
></token-name-price>
<token-logo img="/assets/img/token/bloodline.png" :alt="'bloodline logo'"></token-logo>
</template>
@@ -26,7 +26,9 @@
<stake-menu
v-model="tokenNumber"
@close="stakeMenu = false"
:amount="walletStore.unclaimedRewards"
:amount="
formatBigIntDivision(walletStore.unclaimedRewards, 10n ** tokenStore.memeToken.decimals)
"
:stake="stake"
v-if="stakeMenu"
>
@@ -57,14 +59,16 @@
<template v-slot:message-end>
<div class="input-balance">
Balance:
{{ formatNumber(walletStore.unclaimedRewards) }}
{{
formatBigIntDivision(
walletStore.unclaimedRewards,
10n ** tokenStore.memeToken.decimals
)
}}
</div>
</template>
</stake-menu>
</Transition>
<div class="connected-stake-first-round small-text text-center">
You can claim, once the cycle is over.
</div>
</template>
<template v-else-if="cycleStore.rewardsSacrificeCurrentCycle > 0n">
<div class="connected-stake-buttons">
@@ -99,7 +103,7 @@ import { useTokenStore } from "@/stores/tokens";
import { useRewardLockerStore } from "@/stores/rewardlocker";
import { useRouter } from "vue-router";
import { useToast } from "vue-toastification";
import { formatNumber } from "@/helper/helper.js";
import { formatBigIntDivision } from "@/helper/helper.js";
import { showSuccessToast } from "@/helper/toast.js";
const toast = useToast();
@@ -138,10 +142,8 @@ function openStake() {
async function stakeAndClaimAllCycles() {
try {
const unclaimedRewards = walletStore.memeToken?.unclaimedRewards / 10n ** tokenStore.memeToken.decimals;
stateClaim.value = 2;
console.log("unclaimedRewards", unclaimedRewards);
const coefficient = BigInt(10000 * tokenNumber.value) / unclaimedRewards;
const coefficient = BigInt(10000 * tokenNumber.value) / walletStore.unclaimedRewards;
var hash = await rewardLockerStore.stakeAndClaimAllCycles(coefficient);
stateClaim.value = 3;
const data = await waitForTransaction({
@@ -156,9 +158,9 @@ async function stakeAndClaimAllCycles() {
//
console.log("rewardData", rewardData);
//ClaimedReward (address staker, uint256 reward)
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 and staked",
"Join the next cycle to increase your rewards and win with your clan"
@@ -187,9 +189,9 @@ async function claimAll() {
//
console.log("rewardData", rewardData);
//ClaimedReward (address staker, uint256 reward)
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."
@@ -219,7 +221,7 @@ const stateClaimComp = computed(() => {
tokenNumber.value === null ||
tokenNumber.value === "" ||
tokenNumber.value === 0 ||
tokenNumber.value > walletStore.memeToken?.unclaimedRewards
BigInt(tokenNumber.value) > walletStore.unclaimedRewards / 10n ** tokenStore.memeToken.decimals
) {
returnState = 0;
} else if (stateClaim.value === 2) {