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

fix: convert minimum staking amount #420

Merged
merged 2 commits into from
May 13, 2022
Merged
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions src/components/Dialog/DialogStake.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import Button from "@/components/Button"
import {stakeLabFee} from "@/lib/polkadotProvider/command/labs"
import {queryBalance} from "@/lib/polkadotProvider/query/balance"
import {minimumStakeAmount} from "@/lib/polkadotProvider/query/labs"
import { toEther, fromEther } from "@/lib/balance-format"
import { toEther } from "@/lib/balance-format"

export default {
name: "DialogStake",
Expand Down Expand Up @@ -127,10 +127,10 @@ export default {

async getMinimumStake() {
const stakeAmount = await minimumStakeAmount(this.api)
const minimumStake = stakeAmount ? await toEther(stakeAmount) : toEther(50000)
const _minimumStakeAmount = Number(stakeAmount.replaceAll(",", ""))

this.minimumStake = minimumStake
this.stakeAmount = await fromEther(minimumStake)
this.minimumStake = stakeAmount ? await _minimumStakeAmount : toEther(50000)
this.stakeAmount = new Intl.NumberFormat("en-US").format(_minimumStakeAmount / (10**18))
},

async fetchWalletBalance() {
Expand Down