@atomiqlabs/chain-starknet 7.0.23 → 7.0.24
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.
|
@@ -21,6 +21,8 @@ class StarknetChainEvents extends StarknetChainEventsBrowser_1.StarknetChainEven
|
|
|
21
21
|
const arr = txt.split(",");
|
|
22
22
|
if (arr.length < 2) {
|
|
23
23
|
const blockNumber = parseInt(arr[0].split(";")[0]);
|
|
24
|
+
if (isNaN(blockNumber))
|
|
25
|
+
throw new Error("Cannot parse the integer, is NaN!");
|
|
24
26
|
return [
|
|
25
27
|
{ lastBlockNumber: blockNumber, lastTxHash: null },
|
|
26
28
|
{ lastBlockNumber: blockNumber, lastTxHash: null }
|
|
@@ -28,7 +30,10 @@ class StarknetChainEvents extends StarknetChainEventsBrowser_1.StarknetChainEven
|
|
|
28
30
|
}
|
|
29
31
|
return arr.map(arrValue => {
|
|
30
32
|
const subArray = arrValue.split(";");
|
|
31
|
-
|
|
33
|
+
const lastBlockNumber = parseInt(subArray[0]);
|
|
34
|
+
if (isNaN(lastBlockNumber))
|
|
35
|
+
throw new Error("Cannot parse the integer, is NaN!");
|
|
36
|
+
return { lastBlockNumber, lastTxHash: subArray[1] };
|
|
32
37
|
});
|
|
33
38
|
}
|
|
34
39
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -33,6 +33,7 @@ export class StarknetChainEvents extends StarknetChainEventsBrowser {
|
|
|
33
33
|
const arr = txt.split(",");
|
|
34
34
|
if(arr.length<2) {
|
|
35
35
|
const blockNumber = parseInt(arr[0].split(";")[0]);
|
|
36
|
+
if(isNaN(blockNumber)) throw new Error("Cannot parse the integer, is NaN!");
|
|
36
37
|
return [
|
|
37
38
|
{lastBlockNumber: blockNumber, lastTxHash: null},
|
|
38
39
|
{lastBlockNumber: blockNumber, lastTxHash: null}
|
|
@@ -41,7 +42,9 @@ export class StarknetChainEvents extends StarknetChainEventsBrowser {
|
|
|
41
42
|
|
|
42
43
|
return arr.map(arrValue => {
|
|
43
44
|
const subArray = arrValue.split(";");
|
|
44
|
-
|
|
45
|
+
const lastBlockNumber = parseInt(subArray[0]);
|
|
46
|
+
if(isNaN(lastBlockNumber)) throw new Error("Cannot parse the integer, is NaN!");
|
|
47
|
+
return {lastBlockNumber, lastTxHash: subArray[1]};
|
|
45
48
|
})
|
|
46
49
|
} catch (e) {
|
|
47
50
|
return [];
|