1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.hexToBigInt = void 0;
|
4 | const x_bigint_1 = require("@polkadot/x-bigint");
|
5 | const toBigInt_js_1 = require("../u8a/toBigInt.js");
|
6 | const toU8a_js_1 = require("./toU8a.js");
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | function hexToBigInt(value, { isLe = false, isNegative = false } = {}) {
|
12 | return !value || value === '0x'
|
13 | ? (0, x_bigint_1.BigInt)(0)
|
14 | : (0, toBigInt_js_1.u8aToBigInt)((0, toU8a_js_1.hexToU8a)(value), { isLe, isNegative });
|
15 | }
|
16 | exports.hexToBigInt = hexToBigInt;
|