@fuel-ts/account 0.80.0 → 0.81.0
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.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/dist/index.global.js +29 -20
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +28 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -19
- package/dist/index.mjs.map +1 -1
- package/dist/providers/fuel-graphql-subscriber.d.ts +2 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -1
- package/dist/test-utils.global.js +29 -20
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +28 -19
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +28 -19
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +21 -26
package/dist/index.global.js
CHANGED
@@ -28954,7 +28954,7 @@ spurious results.`);
|
|
28954
28954
|
return {
|
28955
28955
|
FORC: "0.49.3",
|
28956
28956
|
FUEL_CORE: "0.22.1",
|
28957
|
-
FUELS: "0.
|
28957
|
+
FUELS: "0.81.0"
|
28958
28958
|
};
|
28959
28959
|
}
|
28960
28960
|
function parseVersion(version2) {
|
@@ -38761,36 +38761,45 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
38761
38761
|
});
|
38762
38762
|
this.stream = response.body.getReader();
|
38763
38763
|
}
|
38764
|
+
events = [];
|
38765
|
+
parsingLeftover = "";
|
38764
38766
|
async next() {
|
38765
38767
|
if (!this.stream) {
|
38766
38768
|
await this.setStream();
|
38767
38769
|
}
|
38768
38770
|
while (true) {
|
38771
|
+
if (this.events.length > 0) {
|
38772
|
+
const { data, errors } = this.events.shift();
|
38773
|
+
if (Array.isArray(errors)) {
|
38774
|
+
throw new FuelError(
|
38775
|
+
FuelError.CODES.INVALID_REQUEST,
|
38776
|
+
errors.map((err) => err.message).join("\n\n")
|
38777
|
+
);
|
38778
|
+
}
|
38779
|
+
return { value: data, done: false };
|
38780
|
+
}
|
38769
38781
|
const { value, done } = await this.stream.read();
|
38770
38782
|
if (done) {
|
38771
38783
|
return { value, done };
|
38772
38784
|
}
|
38773
|
-
const
|
38774
|
-
if (
|
38785
|
+
const decoded = _FuelGraphqlSubscriber.textDecoder.decode(value).replace(":keep-alive-text\n\n", "");
|
38786
|
+
if (decoded === "") {
|
38775
38787
|
continue;
|
38776
38788
|
}
|
38777
|
-
|
38778
|
-
|
38779
|
-
|
38780
|
-
|
38781
|
-
|
38782
|
-
|
38783
|
-
|
38784
|
-
|
38785
|
-
|
38786
|
-
|
38787
|
-
|
38788
|
-
|
38789
|
-
|
38790
|
-
|
38791
|
-
);
|
38792
|
-
}
|
38793
|
-
return { value: data, done: false };
|
38789
|
+
const text = `${this.parsingLeftover}${decoded}`;
|
38790
|
+
const regex = /data:.*\n\n/g;
|
38791
|
+
const matches = [...text.matchAll(regex)].flatMap((match) => match);
|
38792
|
+
matches.forEach((match) => {
|
38793
|
+
try {
|
38794
|
+
this.events.push(JSON.parse(match.replace(/^data:/, "")));
|
38795
|
+
} catch (e) {
|
38796
|
+
throw new FuelError(
|
38797
|
+
ErrorCode.STREAM_PARSING_ERROR,
|
38798
|
+
`Error while parsing stream data response: ${text}`
|
38799
|
+
);
|
38800
|
+
}
|
38801
|
+
});
|
38802
|
+
this.parsingLeftover = text.replace(matches.join(), "");
|
38794
38803
|
}
|
38795
38804
|
}
|
38796
38805
|
/**
|