fill round update + notification update + visual fixes
This commit is contained in:
@@ -130,22 +130,29 @@ async function stakeAndClaimAllRounds() {
|
||||
try {
|
||||
const unclaimedRewards = walletStore.memeToken?.unclaimedRewards;
|
||||
stateClaim.value = 2;
|
||||
console.log("tokenNumber.value", tokenNumber.value);
|
||||
console.log("walletStore.memeToken?.unclaimedRewards", walletStore.memeToken?.unclaimedRewards);
|
||||
const coefficient = (10000 * tokenNumber.value) / walletStore.memeToken?.unclaimedRewards;
|
||||
const coefficient = (10000 * tokenNumber.value) / unclaimedRewards;
|
||||
var hash = await rewardLockerStore.stakeAndClaimAllRounds(coefficient);
|
||||
stateClaim.value = 3;
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
stateClaim.value = 4;
|
||||
await walletStore.loadWalletData();
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3"
|
||||
);
|
||||
});
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
//ClaimedReward (address staker, uint256 reward)
|
||||
const outputClaim = Number(rewardData.topics[2]) / Math.pow(10, tokenStore.memeToken.decimals);
|
||||
showSuccessToast(
|
||||
unclaimedRewards,
|
||||
outputClaim.toFixed(5),
|
||||
"Success!",
|
||||
"You just claimed and staked",
|
||||
"Join the next cycle to increase your rewards and win with your clan"
|
||||
);
|
||||
await walletStore.loadWalletData();
|
||||
} catch (error) {
|
||||
stateClaim.value = 0;
|
||||
console.error(error);
|
||||
@@ -161,14 +168,22 @@ async function claimAll() {
|
||||
const data = await waitForTransaction({
|
||||
hash: hash,
|
||||
});
|
||||
console.log("data", data);
|
||||
await walletStore.loadWalletData();
|
||||
var rewardData = data.logs.find((logObject) => {
|
||||
return logObject.topics.find(
|
||||
(topic) => topic === "0xd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3"
|
||||
);
|
||||
});
|
||||
//
|
||||
console.log("rewardData", rewardData);
|
||||
//ClaimedReward (address staker, uint256 reward)
|
||||
const outputClaim = Number(rewardData.topics[2]) / Math.pow(10, tokenStore.memeToken.decimals);
|
||||
showSuccessToast(
|
||||
walletStore.memeToken?.unclaimedRewards,
|
||||
outputClaim.toFixed(5),
|
||||
"Success!",
|
||||
"You just claimed",
|
||||
"Join the next cycle to increase your rewards and win with your clan."
|
||||
);
|
||||
await walletStore.loadWalletData();
|
||||
} catch (error) {
|
||||
state.value = 0;
|
||||
console.error(error);
|
||||
|
||||
Reference in New Issue
Block a user