starknet 11.10.4 → 11.10.5
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 +34 -11
- package/dist/index.global.js +10 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12800,10 +12800,13 @@ var Block = class {
|
|
|
12800
12800
|
*/
|
|
12801
12801
|
tag = null;
|
|
12802
12802
|
setIdentifier(__identifier) {
|
|
12803
|
+
this.hash = null;
|
|
12804
|
+
this.number = null;
|
|
12805
|
+
this.tag = null;
|
|
12803
12806
|
if (isString(__identifier)) {
|
|
12804
|
-
if (isDecimalString2(__identifier)) {
|
|
12807
|
+
if (__identifier !== "" && isDecimalString2(__identifier)) {
|
|
12805
12808
|
this.number = parseInt(__identifier, 10);
|
|
12806
|
-
} else if (isHex(__identifier)) {
|
|
12809
|
+
} else if (isHex(__identifier) && !isEmptyHex(__identifier)) {
|
|
12807
12810
|
this.hash = __identifier;
|
|
12808
12811
|
} else if (validBlockTags.includes(__identifier)) {
|
|
12809
12812
|
this.tag = __identifier;
|
|
@@ -12820,6 +12823,11 @@ var Block = class {
|
|
|
12820
12823
|
if (isNumber(this.number) && this.number < 0) {
|
|
12821
12824
|
throw TypeError(`Block number (${this.number}) can't be negative`);
|
|
12822
12825
|
}
|
|
12826
|
+
if (isNumber(this.number) && !Number.isSafeInteger(this.number)) {
|
|
12827
|
+
throw TypeError(
|
|
12828
|
+
`Block number (${__identifier}) must be a whole number no larger than Number.MAX_SAFE_INTEGER`
|
|
12829
|
+
);
|
|
12830
|
+
}
|
|
12823
12831
|
}
|
|
12824
12832
|
/**
|
|
12825
12833
|
* Create a Block instance
|