Skip to content

Commit

Permalink
Move tokens - available balance fix (AstarNetwork#1160)
Browse files Browse the repository at this point in the history
* Handle removal of unregistered dApps from a node storage (AstarNetwork#1155)

* Handle removal of unregistered dApps from a note storage

* Map dapp id

* Move available balance fix
  • Loading branch information
bobo-k2 authored Feb 1, 2024
1 parent 876710a commit c7b52f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
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

0 comments on commit c7b52f9

Please sign in to comment.