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

Move tokens - available balance fix #1160

Merged
merged 3 commits into from
Feb 1, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ export default {
overview: 'Overview',
},
unregisteredDappInfo:
'This project has been unregistered. Claim action is required and your funds will be returned.',
'This project has been unregistered but If you are currently entitled to Bonus you will be entitled to it as well as basic rewards as long as you do not move/unstake the fund during this Period. Unstake if you still want to (it has {days} days unlocking period).',
voteSuccess: 'You successfully voted on {number} dApp(s). All pending rewards are claimed.',
unbondSuccess: 'You successfully unbonded from {dapp}.',
unbondFromUnregisteredSuccess: 'You successfully unbonded from unregistered dApp {dapp}.',
Expand Down
9 changes: 6 additions & 3 deletions src/staking-v3/components/Vote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,16 @@ export default defineComponent({
});

const availableToVote = computed<bigint>(
() => BigInt(useableBalance.value) + max(remainLockedTokenInitial, BigInt(0))
() =>
BigInt(useableBalance.value) +
max(remainLockedTokenInitial, BigInt(0)) +
availableToMove.value
);

const availableToVoteDisplay = computed<bigint>(() =>
remainLockedToken.value >= BigInt(0)
? BigInt(useableBalance.value) + remainLockedToken.value
: BigInt(useableBalance.value) - abs(remainLockedToken.value)
? BigInt(useableBalance.value) + remainLockedToken.value + availableToMove.value
: BigInt(useableBalance.value) - abs(remainLockedToken.value) + availableToMove.value
);

const amountToUnstake = computed<bigint>(() =>
Expand Down
5 changes: 3 additions & 2 deletions src/staking-v3/components/my-staking/MyDapps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<div v-if="!isRegistered(key)" class="warning--unregistered-dapp">
<astar-icon-warning size="20" />
<span class="text--unregistered-dapp">
{{ $t('stakingV3.unregisteredDappInfo') }}
{{ $t('stakingV3.unregisteredDappInfo', { days: constants?.unlockingPeriod ?? '--' }) }}
</span>
<astar-button
class="btn--unregistered-dapp"
Expand Down Expand Up @@ -75,7 +75,7 @@ export default defineComponent({
setup() {
const { getDapp } = useDapps();
const { navigateToVote, navigateToMove } = useDappStakingNavigation();
const { unstake, unstakeFromUnregistered } = useDappStaking();
const { unstake, unstakeFromUnregistered, constants } = useDappStaking();

const dappToUnbond = ref<CombinedDappInfo | undefined>();
const showModalUnbond = ref<boolean>(false);
Expand Down Expand Up @@ -115,6 +115,7 @@ export default defineComponent({
dappToUnbond,
width,
screenSize,
constants,
setShowModalUnbond,
getDappName,
getStakedAmount,
Expand Down
Loading