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.mjs
CHANGED
|
@@ -12589,10 +12589,13 @@ var Block = class {
|
|
|
12589
12589
|
*/
|
|
12590
12590
|
tag = null;
|
|
12591
12591
|
setIdentifier(__identifier) {
|
|
12592
|
+
this.hash = null;
|
|
12593
|
+
this.number = null;
|
|
12594
|
+
this.tag = null;
|
|
12592
12595
|
if (isString(__identifier)) {
|
|
12593
|
-
if (isDecimalString2(__identifier)) {
|
|
12596
|
+
if (__identifier !== "" && isDecimalString2(__identifier)) {
|
|
12594
12597
|
this.number = parseInt(__identifier, 10);
|
|
12595
|
-
} else if (isHex(__identifier)) {
|
|
12598
|
+
} else if (isHex(__identifier) && !isEmptyHex(__identifier)) {
|
|
12596
12599
|
this.hash = __identifier;
|
|
12597
12600
|
} else if (validBlockTags.includes(__identifier)) {
|
|
12598
12601
|
this.tag = __identifier;
|
|
@@ -12609,6 +12612,11 @@ var Block = class {
|
|
|
12609
12612
|
if (isNumber(this.number) && this.number < 0) {
|
|
12610
12613
|
throw TypeError(`Block number (${this.number}) can't be negative`);
|
|
12611
12614
|
}
|
|
12615
|
+
if (isNumber(this.number) && !Number.isSafeInteger(this.number)) {
|
|
12616
|
+
throw TypeError(
|
|
12617
|
+
`Block number (${__identifier}) must be a whole number no larger than Number.MAX_SAFE_INTEGER`
|
|
12618
|
+
);
|
|
12619
|
+
}
|
|
12612
12620
|
}
|
|
12613
12621
|
/**
|
|
12614
12622
|
* Create a Block instance
|