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