@fuel-ts/account 0.80.0 → 0.82.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 +47 -22
- 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 +47 -22
- 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
@@ -12,6 +12,8 @@ export declare class FuelGraphqlSubscriber implements AsyncIterator<unknown> {
|
|
12
12
|
private static textDecoder;
|
13
13
|
constructor(options: FuelGraphQLSubscriberOptions);
|
14
14
|
private setStream;
|
15
|
+
private events;
|
16
|
+
private parsingLeftover;
|
15
17
|
next(): Promise<IteratorResult<unknown, unknown>>;
|
16
18
|
/**
|
17
19
|
* Gets called when `break` is called in a `for-await-of` loop.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fuel-graphql-subscriber.d.ts","sourceRoot":"","sources":["../../src/providers/fuel-graphql-subscriber.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,KAAK,4BAA4B,GAAG;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,EAAE,OAAO,KAAK,CAAC;CACvB,CAAC;AAEF,qBAAa,qBAAsB,YAAW,aAAa,CAAC,OAAO,CAAC;IAI/C,OAAO,CAAC,OAAO;IAHlC,OAAO,CAAC,MAAM,CAA2C;IACzD,OAAO,CAAC,MAAM,CAAC,WAAW,CAAqB;gBAEpB,OAAO,EAAE,4BAA4B;YAElD,SAAS;
|
1
|
+
{"version":3,"file":"fuel-graphql-subscriber.d.ts","sourceRoot":"","sources":["../../src/providers/fuel-graphql-subscriber.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,KAAK,4BAA4B,GAAG;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,EAAE,OAAO,KAAK,CAAC;CACvB,CAAC;AAEF,qBAAa,qBAAsB,YAAW,aAAa,CAAC,OAAO,CAAC;IAI/C,OAAO,CAAC,OAAO;IAHlC,OAAO,CAAC,MAAM,CAA2C;IACzD,OAAO,CAAC,MAAM,CAAC,WAAW,CAAqB;gBAEpB,OAAO,EAAE,4BAA4B;YAElD,SAAS;IAmBvB,OAAO,CAAC,MAAM,CAAgE;IAC9E,OAAO,CAAC,eAAe,CAAM;IAEvB,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IA4DvD;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAM3D,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC;CAGrE"}
|
@@ -31916,7 +31916,7 @@ spurious results.`);
|
|
31916
31916
|
return {
|
31917
31917
|
FORC: "0.49.3",
|
31918
31918
|
FUEL_CORE: "0.22.1",
|
31919
|
-
FUELS: "0.
|
31919
|
+
FUELS: "0.82.0"
|
31920
31920
|
};
|
31921
31921
|
}
|
31922
31922
|
function parseVersion(version2) {
|
@@ -35807,6 +35807,20 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35807
35807
|
];
|
35808
35808
|
}
|
35809
35809
|
};
|
35810
|
+
var getEncodingVersion = (encoding) => {
|
35811
|
+
switch (encoding) {
|
35812
|
+
case void 0:
|
35813
|
+
case ENCODING_V0:
|
35814
|
+
return ENCODING_V0;
|
35815
|
+
case ENCODING_V1:
|
35816
|
+
return ENCODING_V1;
|
35817
|
+
default:
|
35818
|
+
throw new FuelError(
|
35819
|
+
ErrorCode.UNSUPPORTED_ENCODING_VERSION,
|
35820
|
+
`Encoding version '${encoding}' is unsupported.`
|
35821
|
+
);
|
35822
|
+
}
|
35823
|
+
};
|
35810
35824
|
var findFunctionByName = (abi, name) => {
|
35811
35825
|
const fn = abi.functions.find((f2) => f2.name === name);
|
35812
35826
|
if (!fn) {
|
@@ -36571,7 +36585,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36571
36585
|
this.signature = FunctionFragment.getSignature(this.jsonAbi, this.jsonFn);
|
36572
36586
|
this.selector = FunctionFragment.getFunctionSelector(this.signature);
|
36573
36587
|
this.selectorBytes = new StdStringCoder2().encode(name);
|
36574
|
-
this.encoding =
|
36588
|
+
this.encoding = getEncodingVersion(jsonAbi.encoding);
|
36575
36589
|
this.isInputDataPointer = this.#isInputDataPointer();
|
36576
36590
|
this.outputMetadata = {
|
36577
36591
|
isHeapType: this.#isOutputDataHeap(),
|
@@ -36709,8 +36723,10 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36709
36723
|
functions;
|
36710
36724
|
configurables;
|
36711
36725
|
jsonAbi;
|
36726
|
+
encoding;
|
36712
36727
|
constructor(jsonAbi) {
|
36713
36728
|
this.jsonAbi = jsonAbi;
|
36729
|
+
this.encoding = getEncodingVersion(jsonAbi.encoding);
|
36714
36730
|
this.functions = Object.fromEntries(
|
36715
36731
|
this.jsonAbi.functions.map((x) => [x.name, new FunctionFragment(this.jsonAbi, x.name)])
|
36716
36732
|
);
|
@@ -36754,7 +36770,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36754
36770
|
);
|
36755
36771
|
}
|
36756
36772
|
return AbiCoder.decode(this.jsonAbi, loggedType.loggedType, arrayify(data), 0, {
|
36757
|
-
encoding: this.
|
36773
|
+
encoding: this.encoding
|
36758
36774
|
});
|
36759
36775
|
}
|
36760
36776
|
encodeConfigurable(name, value) {
|
@@ -42226,36 +42242,45 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42226
42242
|
});
|
42227
42243
|
this.stream = response.body.getReader();
|
42228
42244
|
}
|
42245
|
+
events = [];
|
42246
|
+
parsingLeftover = "";
|
42229
42247
|
async next() {
|
42230
42248
|
if (!this.stream) {
|
42231
42249
|
await this.setStream();
|
42232
42250
|
}
|
42233
42251
|
while (true) {
|
42252
|
+
if (this.events.length > 0) {
|
42253
|
+
const { data, errors } = this.events.shift();
|
42254
|
+
if (Array.isArray(errors)) {
|
42255
|
+
throw new FuelError(
|
42256
|
+
FuelError.CODES.INVALID_REQUEST,
|
42257
|
+
errors.map((err) => err.message).join("\n\n")
|
42258
|
+
);
|
42259
|
+
}
|
42260
|
+
return { value: data, done: false };
|
42261
|
+
}
|
42234
42262
|
const { value, done } = await this.stream.read();
|
42235
42263
|
if (done) {
|
42236
42264
|
return { value, done };
|
42237
42265
|
}
|
42238
|
-
const
|
42239
|
-
if (
|
42266
|
+
const decoded = _FuelGraphqlSubscriber.textDecoder.decode(value).replace(":keep-alive-text\n\n", "");
|
42267
|
+
if (decoded === "") {
|
42240
42268
|
continue;
|
42241
42269
|
}
|
42242
|
-
|
42243
|
-
|
42244
|
-
|
42245
|
-
|
42246
|
-
|
42247
|
-
|
42248
|
-
|
42249
|
-
|
42250
|
-
|
42251
|
-
|
42252
|
-
|
42253
|
-
|
42254
|
-
|
42255
|
-
|
42256
|
-
);
|
42257
|
-
}
|
42258
|
-
return { value: data, done: false };
|
42270
|
+
const text = `${this.parsingLeftover}${decoded}`;
|
42271
|
+
const regex = /data:.*\n\n/g;
|
42272
|
+
const matches = [...text.matchAll(regex)].flatMap((match) => match);
|
42273
|
+
matches.forEach((match) => {
|
42274
|
+
try {
|
42275
|
+
this.events.push(JSON.parse(match.replace(/^data:/, "")));
|
42276
|
+
} catch (e) {
|
42277
|
+
throw new FuelError(
|
42278
|
+
ErrorCode.STREAM_PARSING_ERROR,
|
42279
|
+
`Error while parsing stream data response: ${text}`
|
42280
|
+
);
|
42281
|
+
}
|
42282
|
+
});
|
42283
|
+
this.parsingLeftover = text.replace(matches.join(), "");
|
42259
42284
|
}
|
42260
42285
|
}
|
42261
42286
|
/**
|