UNPKG

@radixdlt/primitives

Version:
21 lines 1.11 kB
/// <reference types="node" /> import BN from 'bn.js'; import { Result } from 'neverthrow'; import { UInt256 } from '@radixdlt/uint256'; import { SecureRandom } from '@radixdlt/util'; export declare const fitsInUInt256: (number: BN | number) => boolean; /** * Converts a big number (BN) into a UInt256 * * @param {BN} bn - A big number to be converted into a UInt256. * @returns {UInt256} A 256 bit wide unsigned integer. */ export declare const uint256FromBN: (bn: BN) => Result<UInt256, Error>; export declare type UInt256InputUnsafe = number | string | number[] | Uint8Array | Buffer; export declare const isUnsafeInputForUInt256: (something: unknown) => something is UInt256InputUnsafe; export declare const uint256FromUnsafe: (unsafe: UInt256InputUnsafe) => Result<UInt256, Error>; export declare const bnFromUInt256: (uint256: UInt256) => BN; export declare const uint256Max: UInt256; export declare const secureRandomUInt256: (secureRandom?: SecureRandom) => UInt256; export declare const isUInt256: (something: unknown) => something is UInt256; //# sourceMappingURL=uint256-extensions.d.ts.map