1 | import type { BN } from '../bn/bn.js';
|
2 | import type { SiDef, ToBn } from '../types.js';
|
3 | interface Defaults {
|
4 | decimals: number;
|
5 | unit: string;
|
6 | }
|
7 | interface SetDefaults {
|
8 | decimals?: number[] | number;
|
9 | unit?: string[] | string;
|
10 | }
|
11 | interface Options {
|
12 | |
13 |
|
14 |
|
15 | decimals?: number;
|
16 | |
17 |
|
18 |
|
19 | forceUnit?: string;
|
20 | |
21 |
|
22 |
|
23 | withAll?: boolean;
|
24 | |
25 |
|
26 |
|
27 | withSi?: boolean;
|
28 | |
29 |
|
30 |
|
31 | withSiFull?: boolean;
|
32 | |
33 |
|
34 |
|
35 | withUnit?: boolean | string;
|
36 | |
37 |
|
38 |
|
39 | withZero?: boolean;
|
40 | |
41 |
|
42 |
|
43 | locale?: string;
|
44 | }
|
45 | interface BalanceFormatter {
|
46 | <ExtToBn extends ToBn>(input?: number | string | BN | bigint | ExtToBn, options?: Options): string;
|
47 | calcSi(text: string, decimals?: number): SiDef;
|
48 | findSi(type: string): SiDef;
|
49 | getDefaults(): Defaults;
|
50 | getOptions(decimals?: number): SiDef[];
|
51 | setDefaults(defaults: SetDefaults): void;
|
52 | }
|
53 | export declare const formatBalance: BalanceFormatter;
|
54 | export {};
|