@fuel-ts/account 0.0.0-rc-1964-20240328130004 → 0.0.0-rc-1936-20240328132546
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 +19 -35
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +22 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -36
- package/dist/index.mjs.map +1 -1
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts +0 -3
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/types.d.ts +0 -5
- package/dist/providers/transaction-request/types.d.ts.map +1 -1
- package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts +2 -5
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/test-utils.global.js +6 -35
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +11 -38
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +9 -36
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +16 -16
package/dist/index.js
CHANGED
@@ -2492,7 +2492,6 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
|
|
2492
2492
|
script;
|
2493
2493
|
/** Script input data (parameters) */
|
2494
2494
|
scriptData;
|
2495
|
-
abis;
|
2496
2495
|
/**
|
2497
2496
|
* Constructor for `ScriptTransactionRequest`.
|
2498
2497
|
*
|
@@ -2503,7 +2502,6 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
|
|
2503
2502
|
this.gasLimit = (0, import_math9.bn)(gasLimit);
|
2504
2503
|
this.script = (0, import_utils15.arrayify)(script ?? returnZeroScript.bytes);
|
2505
2504
|
this.scriptData = (0, import_utils15.arrayify)(scriptData ?? returnZeroScript.encodeScriptData());
|
2506
|
-
this.abis = rest.abis;
|
2507
2505
|
}
|
2508
2506
|
/**
|
2509
2507
|
* Converts the transaction request to a `TransactionScript`.
|
@@ -2671,7 +2669,7 @@ var transactionRequestify = (obj) => {
|
|
2671
2669
|
// src/providers/transaction-response/transaction-response.ts
|
2672
2670
|
var import_errors12 = require("@fuel-ts/errors");
|
2673
2671
|
var import_math13 = require("@fuel-ts/math");
|
2674
|
-
var
|
2672
|
+
var import_transactions15 = require("@fuel-ts/transactions");
|
2675
2673
|
var import_utils21 = require("@fuel-ts/utils");
|
2676
2674
|
|
2677
2675
|
// src/providers/transaction-summary/assemble-transaction-summary.ts
|
@@ -3416,21 +3414,6 @@ function assembleTransactionSummary(params) {
|
|
3416
3414
|
return transactionSummary;
|
3417
3415
|
}
|
3418
3416
|
|
3419
|
-
// src/providers/transaction-response/getDecodedLogs.ts
|
3420
|
-
var import_abi_coder3 = require("@fuel-ts/abi-coder");
|
3421
|
-
var import_transactions15 = require("@fuel-ts/transactions");
|
3422
|
-
function getDecodedLogs(receipts, mainAbi, externalAbis = {}) {
|
3423
|
-
return receipts.reduce((logs, receipt) => {
|
3424
|
-
if (receipt.type === import_transactions15.ReceiptType.LogData || receipt.type === import_transactions15.ReceiptType.Log) {
|
3425
|
-
const interfaceToUse = new import_abi_coder3.Interface(externalAbis[receipt.id] || mainAbi);
|
3426
|
-
const data = receipt.type === import_transactions15.ReceiptType.Log ? new import_abi_coder3.BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
|
3427
|
-
const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toNumber());
|
3428
|
-
logs.push(decodedLog);
|
3429
|
-
}
|
3430
|
-
return logs;
|
3431
|
-
}, []);
|
3432
|
-
}
|
3433
|
-
|
3434
3417
|
// src/providers/transaction-response/transaction-response.ts
|
3435
3418
|
var TransactionResponse = class {
|
3436
3419
|
/** Transaction ID */
|
@@ -3441,17 +3424,15 @@ var TransactionResponse = class {
|
|
3441
3424
|
gasUsed = (0, import_math13.bn)(0);
|
3442
3425
|
/** The graphql Transaction with receipts object. */
|
3443
3426
|
gqlTransaction;
|
3444
|
-
abis;
|
3445
3427
|
/**
|
3446
3428
|
* Constructor for `TransactionResponse`.
|
3447
3429
|
*
|
3448
3430
|
* @param id - The transaction ID.
|
3449
3431
|
* @param provider - The provider.
|
3450
3432
|
*/
|
3451
|
-
constructor(id, provider
|
3433
|
+
constructor(id, provider) {
|
3452
3434
|
this.id = id;
|
3453
3435
|
this.provider = provider;
|
3454
|
-
this.abis = abis;
|
3455
3436
|
}
|
3456
3437
|
/**
|
3457
3438
|
* Async constructor for `TransactionResponse`. This method can be used to create
|
@@ -3461,8 +3442,8 @@ var TransactionResponse = class {
|
|
3461
3442
|
* @param id - The transaction ID.
|
3462
3443
|
* @param provider - The provider.
|
3463
3444
|
*/
|
3464
|
-
static async create(id, provider
|
3465
|
-
const response = new TransactionResponse(id, provider
|
3445
|
+
static async create(id, provider) {
|
3446
|
+
const response = new TransactionResponse(id, provider);
|
3466
3447
|
await response.fetch();
|
3467
3448
|
return response;
|
3468
3449
|
}
|
@@ -3496,7 +3477,7 @@ var TransactionResponse = class {
|
|
3496
3477
|
* @returns The decoded transaction.
|
3497
3478
|
*/
|
3498
3479
|
decodeTransaction(transactionWithReceipts) {
|
3499
|
-
return new
|
3480
|
+
return new import_transactions15.TransactionCoder().decode(
|
3500
3481
|
(0, import_utils21.arrayify)(transactionWithReceipts.rawPayload),
|
3501
3482
|
0
|
3502
3483
|
)?.[0];
|
@@ -3566,14 +3547,6 @@ var TransactionResponse = class {
|
|
3566
3547
|
gqlTransaction: this.gqlTransaction,
|
3567
3548
|
...transactionSummary
|
3568
3549
|
};
|
3569
|
-
if (this.abis) {
|
3570
|
-
const logs = getDecodedLogs(
|
3571
|
-
transactionSummary.receipts,
|
3572
|
-
this.abis.main,
|
3573
|
-
this.abis.otherContractsAbis
|
3574
|
-
);
|
3575
|
-
transactionResult.logs = logs;
|
3576
|
-
}
|
3577
3550
|
return transactionResult;
|
3578
3551
|
}
|
3579
3552
|
/**
|
@@ -3593,6 +3566,21 @@ var TransactionResponse = class {
|
|
3593
3566
|
}
|
3594
3567
|
};
|
3595
3568
|
|
3569
|
+
// src/providers/transaction-response/getDecodedLogs.ts
|
3570
|
+
var import_abi_coder3 = require("@fuel-ts/abi-coder");
|
3571
|
+
var import_transactions16 = require("@fuel-ts/transactions");
|
3572
|
+
function getDecodedLogs(receipts, mainAbi, externalAbis = {}) {
|
3573
|
+
return receipts.reduce((logs, receipt) => {
|
3574
|
+
if (receipt.type === import_transactions16.ReceiptType.LogData || receipt.type === import_transactions16.ReceiptType.Log) {
|
3575
|
+
const interfaceToUse = externalAbis[receipt.id] ? new import_abi_coder3.Interface(externalAbis[receipt.id]) : new import_abi_coder3.Interface(mainAbi);
|
3576
|
+
const data = receipt.type === import_transactions16.ReceiptType.Log ? new import_abi_coder3.BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
|
3577
|
+
const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toNumber());
|
3578
|
+
logs.push(decodedLog);
|
3579
|
+
}
|
3580
|
+
return logs;
|
3581
|
+
}, []);
|
3582
|
+
}
|
3583
|
+
|
3596
3584
|
// src/providers/utils/auto-retry-fetch.ts
|
3597
3585
|
function getWaitDelay(options, retryAttemptNum) {
|
3598
3586
|
const duration = options.baseDelay ?? 150;
|
@@ -3927,10 +3915,6 @@ var _Provider = class {
|
|
3927
3915
|
await this.estimateTxDependencies(transactionRequest);
|
3928
3916
|
}
|
3929
3917
|
const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
|
3930
|
-
let abis;
|
3931
|
-
if (transactionRequest.type === import_transactions17.TransactionType.Script) {
|
3932
|
-
abis = transactionRequest.abis;
|
3933
|
-
}
|
3934
3918
|
if (awaitExecution) {
|
3935
3919
|
const subscription = this.operations.submitAndAwait({ encodedTransaction });
|
3936
3920
|
for await (const { submitAndAwait } of subscription) {
|
@@ -3945,14 +3929,14 @@ var _Provider = class {
|
|
3945
3929
|
}
|
3946
3930
|
}
|
3947
3931
|
const transactionId2 = transactionRequest.getTransactionId(this.getChainId());
|
3948
|
-
const response = new TransactionResponse(transactionId2, this
|
3932
|
+
const response = new TransactionResponse(transactionId2, this);
|
3949
3933
|
await response.fetch();
|
3950
3934
|
return response;
|
3951
3935
|
}
|
3952
3936
|
const {
|
3953
3937
|
submit: { id: transactionId }
|
3954
3938
|
} = await this.operations.submit({ encodedTransaction });
|
3955
|
-
return new TransactionResponse(transactionId, this
|
3939
|
+
return new TransactionResponse(transactionId, this);
|
3956
3940
|
}
|
3957
3941
|
/**
|
3958
3942
|
* Executes a transaction without actually submitting it to the chain.
|