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

Property 'divmod' does not exist on type 'BN' #300

Open
tungleanh92 opened this issue Aug 2, 2022 · 0 comments
Open

Property 'divmod' does not exist on type 'BN' #300

tungleanh92 opened this issue Aug 2, 2022 · 0 comments

Comments

@tungleanh92
Copy link

tungleanh92 commented Aug 2, 2022

export const toUnit = async (balance: any) => {
let curConfig: Config = getConfig();
const api = await setupProviderApi(curConfig);
let decimals = api.registry.chainDecimals;
let base = new BN(10).pow(new BN(decimals));
//I'm using typescript and it return the error at this line
let dm = new BN(balance).divmod(base);
return parseFloat(dm.div.toString() + "." + dm.mod.toString())
}
How can I fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant