@fuel-ts/account 0.0.0-rc-1936-20240328132956 → 0.0.0-rc-1962-20240328134623

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.

@@ -28952,9 +28952,9 @@ spurious results.`);
28952
28952
  // ../versions/dist/index.mjs
28953
28953
  function getBuiltinVersions() {
28954
28954
  return {
28955
- FORC: "0.51.1",
28955
+ FORC: "0.49.3",
28956
28956
  FUEL_CORE: "0.22.1",
28957
- FUELS: "0.78.0"
28957
+ FUELS: "0.79.0"
28958
28958
  };
28959
28959
  }
28960
28960
  function parseVersion(version2) {
@@ -33960,7 +33960,7 @@ This unreleased fuel-core build may include features and updates not yet support
33960
33960
  return [receiptMessageOut, o];
33961
33961
  }
33962
33962
  };
33963
- var getAssetId = (contractId, subId) => {
33963
+ var getMintedAssetId = (contractId, subId) => {
33964
33964
  const contractIdBytes = arrayify(contractId);
33965
33965
  const subIdBytes = arrayify(subId);
33966
33966
  return sha2563(concat([contractIdBytes, subIdBytes]));
@@ -33970,7 +33970,7 @@ This unreleased fuel-core build may include features and updates not yet support
33970
33970
  super("ReceiptMint", "struct ReceiptMint", 0);
33971
33971
  }
33972
33972
  static getAssetId(contractId, subId) {
33973
- return getAssetId(contractId, subId);
33973
+ return getMintedAssetId(contractId, subId);
33974
33974
  }
33975
33975
  encode(value) {
33976
33976
  const parts = [];
@@ -34012,7 +34012,7 @@ This unreleased fuel-core build may include features and updates not yet support
34012
34012
  super("ReceiptBurn", "struct ReceiptBurn", 0);
34013
34013
  }
34014
34014
  static getAssetId(contractId, subId) {
34015
- return getAssetId(contractId, subId);
34015
+ return getMintedAssetId(contractId, subId);
34016
34016
  }
34017
34017
  encode(value) {
34018
34018
  const parts = [];
@@ -40107,6 +40107,7 @@ ${MessageCoinFragmentFragmentDoc}`;
40107
40107
  script;
40108
40108
  /** Script input data (parameters) */
40109
40109
  scriptData;
40110
+ abis;
40110
40111
  /**
40111
40112
  * Constructor for `ScriptTransactionRequest`.
40112
40113
  *
@@ -40117,6 +40118,7 @@ ${MessageCoinFragmentFragmentDoc}`;
40117
40118
  this.gasLimit = bn(gasLimit);
40118
40119
  this.script = arrayify(script ?? returnZeroScript.bytes);
40119
40120
  this.scriptData = arrayify(scriptData ?? returnZeroScript.encodeScriptData());
40121
+ this.abis = rest.abis;
40120
40122
  }
40121
40123
  /**
40122
40124
  * Converts the transaction request to a `TransactionScript`.
@@ -41002,6 +41004,19 @@ ${MessageCoinFragmentFragmentDoc}`;
41002
41004
  return transactionSummary;
41003
41005
  }
41004
41006
 
41007
+ // src/providers/transaction-response/getDecodedLogs.ts
41008
+ function getDecodedLogs(receipts, mainAbi, externalAbis = {}) {
41009
+ return receipts.reduce((logs, receipt) => {
41010
+ if (receipt.type === ReceiptType.LogData || receipt.type === ReceiptType.Log) {
41011
+ const interfaceToUse = new Interface(externalAbis[receipt.id] || mainAbi);
41012
+ const data = receipt.type === ReceiptType.Log ? new BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
41013
+ const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toNumber());
41014
+ logs.push(decodedLog);
41015
+ }
41016
+ return logs;
41017
+ }, []);
41018
+ }
41019
+
41005
41020
  // src/providers/transaction-response/transaction-response.ts
41006
41021
  var TransactionResponse2 = class {
41007
41022
  /** Transaction ID */
@@ -41012,15 +41027,17 @@ ${MessageCoinFragmentFragmentDoc}`;
41012
41027
  gasUsed = bn(0);
41013
41028
  /** The graphql Transaction with receipts object. */
41014
41029
  gqlTransaction;
41030
+ abis;
41015
41031
  /**
41016
41032
  * Constructor for `TransactionResponse`.
41017
41033
  *
41018
41034
  * @param id - The transaction ID.
41019
41035
  * @param provider - The provider.
41020
41036
  */
41021
- constructor(id, provider) {
41037
+ constructor(id, provider, abis) {
41022
41038
  this.id = id;
41023
41039
  this.provider = provider;
41040
+ this.abis = abis;
41024
41041
  }
41025
41042
  /**
41026
41043
  * Async constructor for `TransactionResponse`. This method can be used to create
@@ -41030,8 +41047,8 @@ ${MessageCoinFragmentFragmentDoc}`;
41030
41047
  * @param id - The transaction ID.
41031
41048
  * @param provider - The provider.
41032
41049
  */
41033
- static async create(id, provider) {
41034
- const response = new TransactionResponse2(id, provider);
41050
+ static async create(id, provider, abis) {
41051
+ const response = new TransactionResponse2(id, provider, abis);
41035
41052
  await response.fetch();
41036
41053
  return response;
41037
41054
  }
@@ -41135,6 +41152,14 @@ ${MessageCoinFragmentFragmentDoc}`;
41135
41152
  gqlTransaction: this.gqlTransaction,
41136
41153
  ...transactionSummary
41137
41154
  };
41155
+ if (this.abis) {
41156
+ const logs = getDecodedLogs(
41157
+ transactionSummary.receipts,
41158
+ this.abis.main,
41159
+ this.abis.otherContractsAbis
41160
+ );
41161
+ transactionResult.logs = logs;
41162
+ }
41138
41163
  return transactionResult;
41139
41164
  }
41140
41165
  /**
@@ -41154,19 +41179,6 @@ ${MessageCoinFragmentFragmentDoc}`;
41154
41179
  }
41155
41180
  };
41156
41181
 
41157
- // src/providers/transaction-response/getDecodedLogs.ts
41158
- function getDecodedLogs(receipts, mainAbi, externalAbis = {}) {
41159
- return receipts.reduce((logs, receipt) => {
41160
- if (receipt.type === ReceiptType.LogData || receipt.type === ReceiptType.Log) {
41161
- const interfaceToUse = externalAbis[receipt.id] ? new Interface(externalAbis[receipt.id]) : new Interface(mainAbi);
41162
- const data = receipt.type === ReceiptType.Log ? new BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
41163
- const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toNumber());
41164
- logs.push(decodedLog);
41165
- }
41166
- return logs;
41167
- }, []);
41168
- }
41169
-
41170
41182
  // src/providers/utils/auto-retry-fetch.ts
41171
41183
  function getWaitDelay(options, retryAttemptNum) {
41172
41184
  const duration = options.baseDelay ?? 150;
@@ -41501,6 +41513,10 @@ ${MessageCoinFragmentFragmentDoc}`;
41501
41513
  await this.estimateTxDependencies(transactionRequest);
41502
41514
  }
41503
41515
  const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
41516
+ let abis;
41517
+ if (transactionRequest.type === TransactionType.Script) {
41518
+ abis = transactionRequest.abis;
41519
+ }
41504
41520
  if (awaitExecution) {
41505
41521
  const subscription = this.operations.submitAndAwait({ encodedTransaction });
41506
41522
  for await (const { submitAndAwait } of subscription) {
@@ -41515,14 +41531,14 @@ ${MessageCoinFragmentFragmentDoc}`;
41515
41531
  }
41516
41532
  }
41517
41533
  const transactionId2 = transactionRequest.getTransactionId(this.getChainId());
41518
- const response = new TransactionResponse2(transactionId2, this);
41534
+ const response = new TransactionResponse2(transactionId2, this, abis);
41519
41535
  await response.fetch();
41520
41536
  return response;
41521
41537
  }
41522
41538
  const {
41523
41539
  submit: { id: transactionId }
41524
41540
  } = await this.operations.submit({ encodedTransaction });
41525
- return new TransactionResponse2(transactionId, this);
41541
+ return new TransactionResponse2(transactionId, this, abis);
41526
41542
  }
41527
41543
  /**
41528
41544
  * Executes a transaction without actually submitting it to the chain.