mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 05:38:03 +00:00
20 lines
644 B
TypeScript
20 lines
644 B
TypeScript
import type { ToBigInt, ToBn } from '../types.js';
|
|
import { BN } from './bn.js';
|
|
/**
|
|
* @name bnToBn
|
|
* @summary Creates a BN value from a BN, bigint, string (base 10 or hex) or number input.
|
|
* @description
|
|
* `null` inputs returns a `0x0` result, BN values returns the value, numbers returns a BN representation.
|
|
* @example
|
|
* <BR>
|
|
*
|
|
* ```javascript
|
|
* import BN from 'bn.js';
|
|
* import { bnToBn } from '@pezkuwi/util';
|
|
*
|
|
* bnToBn(0x1234); // => BN(0x1234)
|
|
* bnToBn(new BN(0x1234)); // => BN(0x1234)
|
|
* ```
|
|
*/
|
|
export declare function bnToBn<ExtToBn extends ToBigInt | ToBn>(value?: ExtToBn | BN | bigint | string | number | null): BN;
|