1 | /// <reference types="bn.js" />
|
2 | import type { HexString, NumberOptions, ToBn } from '../types';
|
3 | import type { BN } from './bn';
|
4 | /**
|
5 | * @name bnToHex
|
6 | * @summary Creates a hex value from a BN.js bignumber object.
|
7 | * @description
|
8 | * `null` inputs returns a `0x` result, BN values return the actual value as a `0x` prefixed hex value. Anything that is not a BN object throws an error. With `bitLength` set, it fixes the number to the specified length.
|
9 | * @example
|
10 | * <BR>
|
11 | *
|
12 | * ```javascript
|
13 | * import BN from 'bn.js';
|
14 | * import { bnToHex } from '@polkadot/util';
|
15 | *
|
16 | * bnToHex(new BN(0x123456)); // => '0x123456'
|
17 | * ```
|
18 | */
|
19 | declare function bnToHex<ExtToBn extends ToBn>(value?: ExtToBn | BN | bigint | number | null, options?: NumberOptions): HexString;
|
20 | /** @deprecated Use bnToHex (value?: ExtToBn | BN | bigint | number | null, options?: NumberOptions) */
|
21 | declare function bnToHex<ExtToBn extends ToBn>(value?: ExtToBn | BN | bigint | number | null, bitLength?: number, isLe?: boolean): HexString;
|
22 | export { bnToHex };
|