starknet 11.9.2 → 11.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.global.js +10 -4
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1049,17 +1049,21 @@ function tryToBigInt(value) {
|
|
|
1049
1049
|
return value ? BigInt(value) : void 0;
|
|
1050
1050
|
}
|
|
1051
1051
|
function toHex(value) {
|
|
1052
|
-
|
|
1052
|
+
const bn = toBigInt(value);
|
|
1053
|
+
if (bn < 0n) {
|
|
1054
|
+
throw new Error(`Invalid input: ${bn} is negative, a hex-string cannot hold a sign`);
|
|
1055
|
+
}
|
|
1056
|
+
return addHexPrefix(bn.toString(16));
|
|
1053
1057
|
}
|
|
1054
1058
|
var toHexString = toHex;
|
|
1055
1059
|
function cleanHex(hex) {
|
|
1056
1060
|
return toHex(hex);
|
|
1057
1061
|
}
|
|
1058
1062
|
function toStorageKey(number) {
|
|
1059
|
-
return addHexPrefix(
|
|
1063
|
+
return addHexPrefix(removeHexPrefix(toHex(number)).padStart(64, "0"));
|
|
1060
1064
|
}
|
|
1061
1065
|
function toHex64(number) {
|
|
1062
|
-
const res = addHexPrefix(
|
|
1066
|
+
const res = addHexPrefix(removeHexPrefix(toHex(number)).padStart(64, "0"));
|
|
1063
1067
|
if (res.length !== 66) throw TypeError("number is too big for hex 0x(64) representation");
|
|
1064
1068
|
return res;
|
|
1065
1069
|
}
|
|
@@ -16222,14 +16226,16 @@ function identifyRevision({ types, domain }) {
|
|
|
16222
16226
|
return void 0;
|
|
16223
16227
|
}
|
|
16224
16228
|
function getHex(value) {
|
|
16229
|
+
let bn;
|
|
16225
16230
|
try {
|
|
16226
|
-
|
|
16231
|
+
bn = toBigInt(value);
|
|
16227
16232
|
} catch (e) {
|
|
16228
16233
|
if (isString(value)) {
|
|
16229
16234
|
return toHex(CairoBytes31.fromText(value).toBigInt());
|
|
16230
16235
|
}
|
|
16231
16236
|
throw new Error(`Invalid BigNumberish: ${value}`);
|
|
16232
16237
|
}
|
|
16238
|
+
return toHex(bn);
|
|
16233
16239
|
}
|
|
16234
16240
|
function validateTypedData(data) {
|
|
16235
16241
|
const typedData = data;
|