Skip to content

Commit 9973929

Browse files
committed
feat: Remove formatBalance replacements
1 parent 6f8a3b4 commit 9973929

File tree

3 files changed

+4
-48
lines changed

3 files changed

+4
-48
lines changed

src/helpers/formatBalance.ts

-40
This file was deleted.

src/helpers/getBalance.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ApiPromise } from '@polkadot/api'
22
import { AccountId } from '@polkadot/types/interfaces'
3-
import { BN } from '@polkadot/util'
4-
import { formatBalanceToFixed } from './formatBalance'
3+
import { BN, formatBalance } from '@polkadot/util'
54

65
/**
76
* Returns the native token balance of the given `address`.
@@ -29,11 +28,9 @@ export const getBalance = async (
2928
const balance = reservedBalance.add(freeBalance)
3029

3130
// Format the balance
32-
const balanceFormatted = formatBalanceToFixed(
33-
balance,
34-
tokenDecimals,
35-
fractionDigits,
36-
)
31+
const balanceFormatted = formatBalance(balance, {
32+
decimals: tokenDecimals,
33+
})
3734

3835
return {
3936
freeBalance,

src/helpers/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export * from './accountsAreEqual'
33
export * from './contractCall'
44
export * from './decodeOutput'
55
export * from './deployContract'
6-
export * from './formatBalance'
76
export * from './getAbiMessage'
87
export * from './getBalance'
98
export * from './getGasLimit'

0 commit comments

Comments
 (0)