@fuel-ts/account 0.94.1 → 0.94.3
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/dist/account.d.ts +1 -1
- package/dist/account.d.ts.map +1 -1
- package/dist/connectors/fuel.d.ts +3 -0
- package/dist/connectors/fuel.d.ts.map +1 -1
- package/dist/index.global.js +43 -15
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +39 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -11
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +8 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/test-utils.global.js +85 -70
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +23 -8
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +23 -8
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +15 -15
package/dist/index.mjs
CHANGED
@@ -4498,7 +4498,6 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
4498
4498
|
* @param sendTransactionParams - The provider send transaction parameters (optional).
|
4499
4499
|
* @returns A promise that resolves to the transaction response object.
|
4500
4500
|
*/
|
4501
|
-
// #region Provider-sendTransaction
|
4502
4501
|
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true } = {}) {
|
4503
4502
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
4504
4503
|
if (estimateTxDependencies) {
|
@@ -5040,10 +5039,18 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
5040
5039
|
if (!transaction) {
|
5041
5040
|
return null;
|
5042
5041
|
}
|
5043
|
-
|
5044
|
-
|
5045
|
-
|
5046
|
-
|
5042
|
+
try {
|
5043
|
+
return new TransactionCoder5().decode(
|
5044
|
+
arrayify11(transaction.rawPayload),
|
5045
|
+
0
|
5046
|
+
)?.[0];
|
5047
|
+
} catch (error) {
|
5048
|
+
if (error instanceof FuelError14 && error.code === ErrorCode13.UNSUPPORTED_TRANSACTION_TYPE) {
|
5049
|
+
console.warn("Unsupported transaction type encountered");
|
5050
|
+
return null;
|
5051
|
+
}
|
5052
|
+
throw error;
|
5053
|
+
}
|
5047
5054
|
}
|
5048
5055
|
/**
|
5049
5056
|
* Retrieves transactions based on the provided pagination arguments.
|
@@ -5055,9 +5062,17 @@ Supported fuel-core version: ${supportedVersion}.`
|
|
5055
5062
|
transactions: { edges, pageInfo }
|
5056
5063
|
} = await this.operations.getTransactions(paginationArgs);
|
5057
5064
|
const coder = new TransactionCoder5();
|
5058
|
-
const transactions = edges.map(
|
5059
|
-
|
5060
|
-
|
5065
|
+
const transactions = edges.map(({ node: { rawPayload } }) => {
|
5066
|
+
try {
|
5067
|
+
return coder.decode(arrayify11(rawPayload), 0)[0];
|
5068
|
+
} catch (error) {
|
5069
|
+
if (error instanceof FuelError14 && error.code === ErrorCode13.UNSUPPORTED_TRANSACTION_TYPE) {
|
5070
|
+
console.warn("Unsupported transaction type encountered");
|
5071
|
+
return null;
|
5072
|
+
}
|
5073
|
+
throw error;
|
5074
|
+
}
|
5075
|
+
}).filter((tx) => tx !== null);
|
5061
5076
|
return { transactions, pageInfo };
|
5062
5077
|
}
|
5063
5078
|
/**
|
@@ -10292,9 +10307,11 @@ var _Fuel = class extends FuelConnector {
|
|
10292
10307
|
_connectors = [];
|
10293
10308
|
_targetObject = null;
|
10294
10309
|
_unsubscribes = [];
|
10295
|
-
_targetUnsubscribe
|
10310
|
+
_targetUnsubscribe = () => {
|
10311
|
+
};
|
10296
10312
|
_pingCache = {};
|
10297
10313
|
_currentConnector;
|
10314
|
+
_initializationPromise = null;
|
10298
10315
|
constructor(config = _Fuel.defaultConfig) {
|
10299
10316
|
super();
|
10300
10317
|
this.setMaxListeners(1e3);
|
@@ -10302,8 +10319,19 @@ var _Fuel = class extends FuelConnector {
|
|
10302
10319
|
this._targetObject = this.getTargetObject(config.targetObject);
|
10303
10320
|
this._storage = config.storage === void 0 ? this.getStorage() : config.storage;
|
10304
10321
|
this.setupMethods();
|
10305
|
-
this.
|
10306
|
-
|
10322
|
+
this._initializationPromise = this.initialize();
|
10323
|
+
}
|
10324
|
+
async initialize() {
|
10325
|
+
try {
|
10326
|
+
await this.setDefaultConnector();
|
10327
|
+
this._targetUnsubscribe = this.setupConnectorListener();
|
10328
|
+
} catch (error) {
|
10329
|
+
throw new FuelError28(ErrorCode25.INVALID_PROVIDER, "Error initializing Fuel Connector");
|
10330
|
+
}
|
10331
|
+
}
|
10332
|
+
async init() {
|
10333
|
+
await this._initializationPromise;
|
10334
|
+
return this;
|
10307
10335
|
}
|
10308
10336
|
/**
|
10309
10337
|
* Return the target object to listen for global events.
|