@fuel-ts/account 0.0.0-rc-1895-20240404023124 → 0.0.0-rc-1976-20240404063407

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.js CHANGED
@@ -88,7 +88,7 @@ __export(src_exports, {
88
88
  StorageAbstract: () => StorageAbstract,
89
89
  TransactionResponse: () => TransactionResponse,
90
90
  TransactionStatus: () => TransactionStatus,
91
- TransactionType: () => import_transactions6.TransactionType,
91
+ TransactionType: () => import_transactions5.TransactionType,
92
92
  TransactionTypeName: () => TransactionTypeName,
93
93
  Vault: () => Vault,
94
94
  Wallet: () => Wallet,
@@ -97,9 +97,7 @@ __export(src_exports, {
97
97
  WalletUnlocked: () => WalletUnlocked,
98
98
  addAmountToAsset: () => addAmountToAsset,
99
99
  addOperation: () => addOperation,
100
- assemblePanicError: () => assemblePanicError,
101
100
  assembleReceiptByType: () => assembleReceiptByType,
102
- assembleRevertError: () => assembleRevertError,
103
101
  assembleTransactionSummary: () => assembleTransactionSummary,
104
102
  assets: () => assets,
105
103
  buildBlockExplorerUrl: () => buildBlockExplorerUrl,
@@ -114,7 +112,6 @@ __export(src_exports, {
114
112
  english: () => english,
115
113
  extractBurnedAssetsFromReceipts: () => extractBurnedAssetsFromReceipts,
116
114
  extractMintedAssetsFromReceipts: () => extractMintedAssetsFromReceipts,
117
- extractTxError: () => extractTxError,
118
115
  gasUsedByInputs: () => gasUsedByInputs,
119
116
  getAssetEth: () => getAssetEth,
120
117
  getAssetFuel: () => getAssetFuel,
@@ -184,14 +181,12 @@ module.exports = __toCommonJS(src_exports);
184
181
 
185
182
  // src/account.ts
186
183
  var import_address4 = require("@fuel-ts/address");
187
- var import_configs12 = require("@fuel-ts/address/configs");
188
- var import_errors16 = require("@fuel-ts/errors");
184
+ var import_errors15 = require("@fuel-ts/errors");
189
185
  var import_interfaces = require("@fuel-ts/interfaces");
190
- var import_math18 = require("@fuel-ts/math");
191
- var import_utils28 = require("@fuel-ts/utils");
186
+ var import_math17 = require("@fuel-ts/math");
187
+ var import_utils27 = require("@fuel-ts/utils");
192
188
 
193
189
  // src/providers/coin-quantity.ts
194
- var import_configs = require("@fuel-ts/address/configs");
195
190
  var import_math = require("@fuel-ts/math");
196
191
  var import_utils = require("@fuel-ts/utils");
197
192
  var coinQuantityfy = (coinQuantityLike) => {
@@ -200,11 +195,11 @@ var coinQuantityfy = (coinQuantityLike) => {
200
195
  let max2;
201
196
  if (Array.isArray(coinQuantityLike)) {
202
197
  amount = coinQuantityLike[0];
203
- assetId = coinQuantityLike[1] ?? import_configs.BaseAssetId;
204
- max2 = coinQuantityLike[2] ?? void 0;
198
+ assetId = coinQuantityLike[1];
199
+ max2 = coinQuantityLike[2];
205
200
  } else {
206
201
  amount = coinQuantityLike.amount;
207
- assetId = coinQuantityLike.assetId ?? import_configs.BaseAssetId;
202
+ assetId = coinQuantityLike.assetId;
208
203
  max2 = coinQuantityLike.max ?? void 0;
209
204
  }
210
205
  const bnAmount = (0, import_math.bn)(amount);
@@ -228,12 +223,12 @@ var addAmountToAsset = (params) => {
228
223
 
229
224
  // src/providers/provider.ts
230
225
  var import_address3 = require("@fuel-ts/address");
231
- var import_errors14 = require("@fuel-ts/errors");
232
- var import_math15 = require("@fuel-ts/math");
233
- var import_transactions18 = require("@fuel-ts/transactions");
234
- var import_utils23 = require("@fuel-ts/utils");
226
+ var import_errors13 = require("@fuel-ts/errors");
227
+ var import_math14 = require("@fuel-ts/math");
228
+ var import_transactions17 = require("@fuel-ts/transactions");
229
+ var import_utils22 = require("@fuel-ts/utils");
235
230
  var import_versions = require("@fuel-ts/versions");
236
- var import_utils24 = require("@noble/curves/abstract/utils");
231
+ var import_utils23 = require("@noble/curves/abstract/utils");
237
232
  var import_ethers = require("ethers");
238
233
  var import_graphql_request = require("graphql-request");
239
234
  var import_ramda3 = require("ramda");
@@ -1173,7 +1168,7 @@ var MemoryCache = class {
1173
1168
  };
1174
1169
 
1175
1170
  // src/providers/transaction-request/input.ts
1176
- var import_configs2 = require("@fuel-ts/address/configs");
1171
+ var import_configs = require("@fuel-ts/address/configs");
1177
1172
  var import_errors3 = require("@fuel-ts/errors");
1178
1173
  var import_math2 = require("@fuel-ts/math");
1179
1174
  var import_transactions = require("@fuel-ts/transactions");
@@ -1207,10 +1202,10 @@ var inputify = (value) => {
1207
1202
  case import_transactions.InputType.Contract: {
1208
1203
  return {
1209
1204
  type: import_transactions.InputType.Contract,
1210
- txID: import_configs2.ZeroBytes32,
1205
+ txID: import_configs.ZeroBytes32,
1211
1206
  outputIndex: 0,
1212
- balanceRoot: import_configs2.ZeroBytes32,
1213
- stateRoot: import_configs2.ZeroBytes32,
1207
+ balanceRoot: import_configs.ZeroBytes32,
1208
+ stateRoot: import_configs.ZeroBytes32,
1214
1209
  txPointer: {
1215
1210
  blockHeight: (0, import_math2.toNumber)((0, import_utils3.arrayify)(value.txPointer).slice(0, 8)),
1216
1211
  txIndex: (0, import_math2.toNumber)((0, import_utils3.arrayify)(value.txPointer).slice(8, 16))
@@ -1248,7 +1243,7 @@ var inputify = (value) => {
1248
1243
  };
1249
1244
 
1250
1245
  // src/providers/transaction-request/output.ts
1251
- var import_configs3 = require("@fuel-ts/address/configs");
1246
+ var import_configs2 = require("@fuel-ts/address/configs");
1252
1247
  var import_errors4 = require("@fuel-ts/errors");
1253
1248
  var import_math3 = require("@fuel-ts/math");
1254
1249
  var import_transactions2 = require("@fuel-ts/transactions");
@@ -1268,8 +1263,8 @@ var outputify = (value) => {
1268
1263
  return {
1269
1264
  type: import_transactions2.OutputType.Contract,
1270
1265
  inputIndex: value.inputIndex,
1271
- balanceRoot: import_configs3.ZeroBytes32,
1272
- stateRoot: import_configs3.ZeroBytes32
1266
+ balanceRoot: import_configs2.ZeroBytes32,
1267
+ stateRoot: import_configs2.ZeroBytes32
1273
1268
  };
1274
1269
  }
1275
1270
  case import_transactions2.OutputType.Change: {
@@ -1283,9 +1278,9 @@ var outputify = (value) => {
1283
1278
  case import_transactions2.OutputType.Variable: {
1284
1279
  return {
1285
1280
  type: import_transactions2.OutputType.Variable,
1286
- to: import_configs3.ZeroBytes32,
1281
+ to: import_configs2.ZeroBytes32,
1287
1282
  amount: (0, import_math3.bn)(0),
1288
- assetId: import_configs3.ZeroBytes32
1283
+ assetId: import_configs2.ZeroBytes32
1289
1284
  };
1290
1285
  }
1291
1286
  case import_transactions2.OutputType.ContractCreated: {
@@ -1306,9 +1301,9 @@ var outputify = (value) => {
1306
1301
 
1307
1302
  // src/providers/transaction-request/transaction-request.ts
1308
1303
  var import_address = require("@fuel-ts/address");
1309
- var import_configs7 = require("@fuel-ts/address/configs");
1310
- var import_math7 = require("@fuel-ts/math");
1311
- var import_transactions6 = require("@fuel-ts/transactions");
1304
+ var import_configs5 = require("@fuel-ts/address/configs");
1305
+ var import_math6 = require("@fuel-ts/math");
1306
+ var import_transactions5 = require("@fuel-ts/transactions");
1312
1307
  var import_utils9 = require("@fuel-ts/utils");
1313
1308
 
1314
1309
  // src/providers/resource.ts
@@ -1318,13 +1313,13 @@ var isCoin = (resource) => "id" in resource;
1318
1313
  var isMessage = (resource) => "recipient" in resource;
1319
1314
 
1320
1315
  // src/providers/utils/receipts.ts
1321
- var import_configs4 = require("@fuel-ts/address/configs");
1316
+ var import_configs3 = require("@fuel-ts/address/configs");
1322
1317
  var import_errors5 = require("@fuel-ts/errors");
1323
1318
  var import_math4 = require("@fuel-ts/math");
1324
1319
  var import_transactions3 = require("@fuel-ts/transactions");
1325
- var import_configs5 = require("@fuel-ts/transactions/configs");
1320
+ var import_configs4 = require("@fuel-ts/transactions/configs");
1326
1321
  var import_utils5 = require("@fuel-ts/utils");
1327
- var doesReceiptHaveMissingOutputVariables = (receipt) => receipt.type === import_transactions3.ReceiptType.Revert && receipt.val.toString("hex") === import_configs5.FAILED_TRANSFER_TO_ADDRESS_SIGNAL;
1322
+ var doesReceiptHaveMissingOutputVariables = (receipt) => receipt.type === import_transactions3.ReceiptType.Revert && receipt.val.toString("hex") === import_configs4.FAILED_TRANSFER_TO_ADDRESS_SIGNAL;
1328
1323
  var doesReceiptHaveMissingContractId = (receipt) => receipt.type === import_transactions3.ReceiptType.Panic && receipt.contractId !== "0x0000000000000000000000000000000000000000000000000000000000000000";
1329
1324
  var getReceiptsWithMissingData = (receipts) => receipts.reduce(
1330
1325
  (memo, receipt) => {
@@ -1341,7 +1336,7 @@ var getReceiptsWithMissingData = (receipts) => receipts.reduce(
1341
1336
  missingOutputContractIds: []
1342
1337
  }
1343
1338
  );
1344
- var hexOrZero = (hex) => hex || import_configs4.ZeroBytes32;
1339
+ var hexOrZero = (hex) => hex || import_configs3.ZeroBytes32;
1345
1340
  function assembleReceiptByType(receipt) {
1346
1341
  const { receiptType } = receipt;
1347
1342
  switch (receiptType) {
@@ -1701,78 +1696,6 @@ function sleep(time) {
1701
1696
  });
1702
1697
  }
1703
1698
 
1704
- // src/providers/utils/extract-tx-error.ts
1705
- var import_errors7 = require("@fuel-ts/errors");
1706
- var import_math6 = require("@fuel-ts/math");
1707
- var import_transactions5 = require("@fuel-ts/transactions");
1708
- var import_configs6 = require("@fuel-ts/transactions/configs");
1709
- var assemblePanicError = (status) => {
1710
- let errorMessage = `The transaction reverted with reason: "${status.reason}".`;
1711
- const reason = status.reason;
1712
- if (import_configs6.PANIC_REASONS.includes(status.reason)) {
1713
- errorMessage = `${errorMessage}
1714
-
1715
- You can read more about this error at:
1716
-
1717
- ${import_configs6.PANIC_DOC_URL}#variant.${status.reason}`;
1718
- }
1719
- return { errorMessage, reason };
1720
- };
1721
- var stringify = (obj) => JSON.stringify(obj, null, 2);
1722
- var assembleRevertError = (receipts, logs) => {
1723
- let errorMessage = "The transaction reverted with an unknown reason.";
1724
- const revertReceipt = receipts.find(({ type }) => type === import_transactions5.ReceiptType.Revert);
1725
- let reason = "";
1726
- if (revertReceipt) {
1727
- const reasonHex = (0, import_math6.bn)(revertReceipt.val).toHex();
1728
- switch (reasonHex) {
1729
- case import_configs6.FAILED_REQUIRE_SIGNAL: {
1730
- reason = "require";
1731
- errorMessage = `The transaction reverted because a "require" statement has thrown ${logs.length ? stringify(logs[0]) : "an error."}.`;
1732
- break;
1733
- }
1734
- case import_configs6.FAILED_ASSERT_EQ_SIGNAL: {
1735
- const sufix = logs.length >= 2 ? ` comparing ${stringify(logs[1])} and ${stringify(logs[0])}.` : ".";
1736
- reason = "assert_eq";
1737
- errorMessage = `The transaction reverted because of an "assert_eq" statement${sufix}`;
1738
- break;
1739
- }
1740
- case import_configs6.FAILED_ASSERT_NE_SIGNAL: {
1741
- const sufix = logs.length >= 2 ? ` comparing ${stringify(logs[1])} and ${stringify(logs[0])}.` : ".";
1742
- reason = "assert_ne";
1743
- errorMessage = `The transaction reverted because of an "assert_ne" statement${sufix}`;
1744
- break;
1745
- }
1746
- case import_configs6.FAILED_ASSERT_SIGNAL:
1747
- reason = "assert";
1748
- errorMessage = `The transaction reverted because an "assert" statement failed to evaluate to true.`;
1749
- break;
1750
- case import_configs6.FAILED_TRANSFER_TO_ADDRESS_SIGNAL:
1751
- reason = "MissingOutputChange";
1752
- errorMessage = `The transaction reverted because it's missing an "OutputChange".`;
1753
- break;
1754
- default:
1755
- reason = "unknown";
1756
- errorMessage = `The transaction reverted with an unknown reason: ${revertReceipt.val}`;
1757
- }
1758
- }
1759
- return { errorMessage, reason };
1760
- };
1761
- var extractTxError = (params) => {
1762
- const { receipts, status, logs } = params;
1763
- const isPanic = receipts.some(({ type }) => type === import_transactions5.ReceiptType.Panic);
1764
- const isRevert = receipts.some(({ type }) => type === import_transactions5.ReceiptType.Revert);
1765
- const { errorMessage, reason } = status?.type === "FailureStatus" && isPanic ? assemblePanicError(status) : assembleRevertError(receipts, logs);
1766
- const metadata = {
1767
- logs,
1768
- receipts,
1769
- panic: isPanic,
1770
- revert: isRevert,
1771
- reason
1772
- };
1773
- return new import_errors7.FuelError(import_errors7.ErrorCode.SCRIPT_REVERTED, errorMessage, metadata);
1774
- };
1775
-
1776
1699
  // src/providers/transaction-request/errors.ts
1777
1700
  var ChangeOutputCollisionError = class extends Error {
1778
1701
  name = "ChangeOutputCollisionError";
@@ -1821,6 +1744,8 @@ var BaseTransactionRequest = class {
1821
1744
  outputs = [];
1822
1745
  /** List of witnesses */
1823
1746
  witnesses = [];
1747
+ /** Base asset ID - should be fetched from the chain */
1748
+ baseAssetId = import_configs5.ZeroBytes32;
1824
1749
  /**
1825
1750
  * Constructor for initializing a base transaction request.
1826
1751
  *
@@ -1833,34 +1758,36 @@ var BaseTransactionRequest = class {
1833
1758
  witnessLimit,
1834
1759
  inputs,
1835
1760
  outputs,
1836
- witnesses
1761
+ witnesses,
1762
+ baseAssetId
1837
1763
  } = {}) {
1838
- this.gasPrice = (0, import_math7.bn)(gasPrice);
1764
+ this.gasPrice = (0, import_math6.bn)(gasPrice);
1839
1765
  this.maturity = maturity ?? 0;
1840
- this.witnessLimit = witnessLimit ? (0, import_math7.bn)(witnessLimit) : void 0;
1841
- this.maxFee = maxFee ? (0, import_math7.bn)(maxFee) : void 0;
1766
+ this.witnessLimit = witnessLimit ? (0, import_math6.bn)(witnessLimit) : void 0;
1767
+ this.maxFee = maxFee ? (0, import_math6.bn)(maxFee) : void 0;
1842
1768
  this.inputs = inputs ?? [];
1843
1769
  this.outputs = outputs ?? [];
1844
1770
  this.witnesses = witnesses ?? [];
1771
+ this.baseAssetId = baseAssetId ?? import_configs5.ZeroBytes32;
1845
1772
  }
1846
1773
  static getPolicyMeta(req) {
1847
1774
  let policyTypes = 0;
1848
1775
  const policies = [];
1849
1776
  if (req.gasPrice) {
1850
- policyTypes += import_transactions6.PolicyType.GasPrice;
1851
- policies.push({ data: req.gasPrice, type: import_transactions6.PolicyType.GasPrice });
1777
+ policyTypes += import_transactions5.PolicyType.GasPrice;
1778
+ policies.push({ data: req.gasPrice, type: import_transactions5.PolicyType.GasPrice });
1852
1779
  }
1853
1780
  if (req.witnessLimit) {
1854
- policyTypes += import_transactions6.PolicyType.WitnessLimit;
1855
- policies.push({ data: req.witnessLimit, type: import_transactions6.PolicyType.WitnessLimit });
1781
+ policyTypes += import_transactions5.PolicyType.WitnessLimit;
1782
+ policies.push({ data: req.witnessLimit, type: import_transactions5.PolicyType.WitnessLimit });
1856
1783
  }
1857
1784
  if (req.maturity > 0) {
1858
- policyTypes += import_transactions6.PolicyType.Maturity;
1859
- policies.push({ data: req.maturity, type: import_transactions6.PolicyType.Maturity });
1785
+ policyTypes += import_transactions5.PolicyType.Maturity;
1786
+ policies.push({ data: req.maturity, type: import_transactions5.PolicyType.Maturity });
1860
1787
  }
1861
1788
  if (req.maxFee) {
1862
- policyTypes += import_transactions6.PolicyType.MaxFee;
1863
- policies.push({ data: req.maxFee, type: import_transactions6.PolicyType.MaxFee });
1789
+ policyTypes += import_transactions5.PolicyType.MaxFee;
1790
+ policies.push({ data: req.maxFee, type: import_transactions5.PolicyType.MaxFee });
1864
1791
  }
1865
1792
  return {
1866
1793
  policyTypes,
@@ -1894,7 +1821,7 @@ var BaseTransactionRequest = class {
1894
1821
  * @returns The transaction bytes.
1895
1822
  */
1896
1823
  toTransactionBytes() {
1897
- return new import_transactions6.TransactionCoder().encode(this.toTransaction());
1824
+ return new import_transactions5.TransactionCoder().encode(this.toTransaction());
1898
1825
  }
1899
1826
  /**
1900
1827
  * @hidden
@@ -1934,7 +1861,7 @@ var BaseTransactionRequest = class {
1934
1861
  * @returns The index of the created witness.
1935
1862
  */
1936
1863
  addEmptyWitness() {
1937
- this.addWitness((0, import_utils9.concat)([import_configs7.ZeroBytes32, import_configs7.ZeroBytes32]));
1864
+ this.addWitness((0, import_utils9.concat)([import_configs5.ZeroBytes32, import_configs5.ZeroBytes32]));
1938
1865
  return this.witnesses.length - 1;
1939
1866
  }
1940
1867
  /**
@@ -1985,7 +1912,7 @@ var BaseTransactionRequest = class {
1985
1912
  */
1986
1913
  getCoinInputs() {
1987
1914
  return this.inputs.filter(
1988
- (input) => input.type === import_transactions6.InputType.Coin
1915
+ (input) => input.type === import_transactions5.InputType.Coin
1989
1916
  );
1990
1917
  }
1991
1918
  /**
@@ -1995,7 +1922,7 @@ var BaseTransactionRequest = class {
1995
1922
  */
1996
1923
  getCoinOutputs() {
1997
1924
  return this.outputs.filter(
1998
- (output) => output.type === import_transactions6.OutputType.Coin
1925
+ (output) => output.type === import_transactions5.OutputType.Coin
1999
1926
  );
2000
1927
  }
2001
1928
  /**
@@ -2005,7 +1932,7 @@ var BaseTransactionRequest = class {
2005
1932
  */
2006
1933
  getChangeOutputs() {
2007
1934
  return this.outputs.filter(
2008
- (output) => output.type === import_transactions6.OutputType.Change
1935
+ (output) => output.type === import_transactions5.OutputType.Change
2009
1936
  );
2010
1937
  }
2011
1938
  /**
@@ -2017,9 +1944,9 @@ var BaseTransactionRequest = class {
2017
1944
  const ownerAddress = (0, import_address.addressify)(owner);
2018
1945
  const found = this.inputs.find((input) => {
2019
1946
  switch (input.type) {
2020
- case import_transactions6.InputType.Coin:
1947
+ case import_transactions5.InputType.Coin:
2021
1948
  return (0, import_utils9.hexlify)(input.owner) === ownerAddress.toB256();
2022
- case import_transactions6.InputType.Message:
1949
+ case import_transactions5.InputType.Message:
2023
1950
  return (0, import_utils9.hexlify)(input.recipient) === ownerAddress.toB256();
2024
1951
  default:
2025
1952
  return false;
@@ -2048,7 +1975,7 @@ var BaseTransactionRequest = class {
2048
1975
  }
2049
1976
  const input = {
2050
1977
  ...coin,
2051
- type: import_transactions6.InputType.Coin,
1978
+ type: import_transactions5.InputType.Coin,
2052
1979
  owner: owner.toB256(),
2053
1980
  amount,
2054
1981
  assetId,
@@ -2066,11 +1993,9 @@ var BaseTransactionRequest = class {
2066
1993
  *
2067
1994
  * @param message - Message resource.
2068
1995
  * @param predicate - Predicate bytes.
2069
- * @param predicateData - Predicate data bytes.
2070
1996
  */
2071
1997
  addMessageInput(message, predicate) {
2072
1998
  const { recipient, sender, amount } = message;
2073
- const assetId = import_configs7.BaseAssetId;
2074
1999
  let witnessIndex;
2075
2000
  if (predicate) {
2076
2001
  witnessIndex = 0;
@@ -2082,7 +2007,7 @@ var BaseTransactionRequest = class {
2082
2007
  }
2083
2008
  const input = {
2084
2009
  ...message,
2085
- type: import_transactions6.InputType.Message,
2010
+ type: import_transactions5.InputType.Message,
2086
2011
  sender: sender.toB256(),
2087
2012
  recipient: recipient.toB256(),
2088
2013
  amount,
@@ -2091,7 +2016,7 @@ var BaseTransactionRequest = class {
2091
2016
  predicateData: predicate?.predicateDataBytes
2092
2017
  };
2093
2018
  this.pushInput(input);
2094
- this.addChangeOutput(recipient, assetId);
2019
+ this.addChangeOutput(recipient, this.baseAssetId);
2095
2020
  }
2096
2021
  /**
2097
2022
  * Adds a single resource to the transaction by adding a coin/message input and a
@@ -2152,12 +2077,12 @@ var BaseTransactionRequest = class {
2152
2077
  * @param amount - Amount of coin.
2153
2078
  * @param assetId - Asset ID of coin.
2154
2079
  */
2155
- addCoinOutput(to, amount, assetId = import_configs7.BaseAssetId) {
2080
+ addCoinOutput(to, amount, assetId) {
2156
2081
  this.pushOutput({
2157
- type: import_transactions6.OutputType.Coin,
2082
+ type: import_transactions5.OutputType.Coin,
2158
2083
  to: (0, import_address.addressify)(to).toB256(),
2159
2084
  amount,
2160
- assetId
2085
+ assetId: assetId ?? this.baseAssetId
2161
2086
  });
2162
2087
  return this;
2163
2088
  }
@@ -2170,7 +2095,7 @@ var BaseTransactionRequest = class {
2170
2095
  addCoinOutputs(to, quantities) {
2171
2096
  quantities.map(coinQuantityfy).forEach((quantity) => {
2172
2097
  this.pushOutput({
2173
- type: import_transactions6.OutputType.Coin,
2098
+ type: import_transactions5.OutputType.Coin,
2174
2099
  to: (0, import_address.addressify)(to).toB256(),
2175
2100
  amount: quantity.amount,
2176
2101
  assetId: quantity.assetId
@@ -2184,15 +2109,15 @@ var BaseTransactionRequest = class {
2184
2109
  * @param to - Address of the owner.
2185
2110
  * @param assetId - Asset ID of coin.
2186
2111
  */
2187
- addChangeOutput(to, assetId = import_configs7.BaseAssetId) {
2112
+ addChangeOutput(to, assetId) {
2188
2113
  const changeOutput = this.getChangeOutputs().find(
2189
2114
  (output) => (0, import_utils9.hexlify)(output.assetId) === assetId
2190
2115
  );
2191
2116
  if (!changeOutput) {
2192
2117
  this.pushOutput({
2193
- type: import_transactions6.OutputType.Change,
2118
+ type: import_transactions5.OutputType.Change,
2194
2119
  to: (0, import_address.addressify)(to).toB256(),
2195
- assetId
2120
+ assetId: assetId ?? this.baseAssetId
2196
2121
  });
2197
2122
  }
2198
2123
  }
@@ -2246,7 +2171,7 @@ var BaseTransactionRequest = class {
2246
2171
  let idCounter = 0;
2247
2172
  const generateId = () => {
2248
2173
  const counterString = String(idCounter++);
2249
- const id = import_configs7.ZeroBytes32.slice(0, -counterString.length).concat(counterString);
2174
+ const id = import_configs5.ZeroBytes32.slice(0, -counterString.length).concat(counterString);
2250
2175
  return id;
2251
2176
  };
2252
2177
  const findAssetInput = (assetId) => this.inputs.find((input) => {
@@ -2268,13 +2193,13 @@ var BaseTransactionRequest = class {
2268
2193
  assetId,
2269
2194
  owner: resourcesOwner || import_address.Address.fromRandom(),
2270
2195
  maturity: 0,
2271
- blockCreated: (0, import_math7.bn)(1),
2272
- txCreatedIdx: (0, import_math7.bn)(1)
2196
+ blockCreated: (0, import_math6.bn)(1),
2197
+ txCreatedIdx: (0, import_math6.bn)(1)
2273
2198
  }
2274
2199
  ]);
2275
2200
  }
2276
2201
  };
2277
- updateAssetInput(import_configs7.BaseAssetId, (0, import_math7.bn)(1e11));
2202
+ updateAssetInput(this.baseAssetId, (0, import_math6.bn)(1e11));
2278
2203
  quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
2279
2204
  }
2280
2205
  /**
@@ -2285,7 +2210,7 @@ var BaseTransactionRequest = class {
2285
2210
  */
2286
2211
  getCoinOutputsQuantities() {
2287
2212
  const coinsQuantities = this.getCoinOutputs().map(({ amount, assetId }) => ({
2288
- amount: (0, import_math7.bn)(amount),
2213
+ amount: (0, import_math6.bn)(amount),
2289
2214
  assetId: assetId.toString()
2290
2215
  }));
2291
2216
  return coinsQuantities;
@@ -2303,18 +2228,18 @@ var BaseTransactionRequest = class {
2303
2228
  this.inputs.forEach((i) => {
2304
2229
  let correspondingInput;
2305
2230
  switch (i.type) {
2306
- case import_transactions6.InputType.Coin:
2307
- correspondingInput = inputs.find((x) => x.type === import_transactions6.InputType.Coin && x.owner === i.owner);
2231
+ case import_transactions5.InputType.Coin:
2232
+ correspondingInput = inputs.find((x) => x.type === import_transactions5.InputType.Coin && x.owner === i.owner);
2308
2233
  break;
2309
- case import_transactions6.InputType.Message:
2234
+ case import_transactions5.InputType.Message:
2310
2235
  correspondingInput = inputs.find(
2311
- (x) => x.type === import_transactions6.InputType.Message && x.sender === i.sender
2236
+ (x) => x.type === import_transactions5.InputType.Message && x.sender === i.sender
2312
2237
  );
2313
2238
  break;
2314
2239
  default:
2315
2240
  return;
2316
2241
  }
2317
- if (correspondingInput && "predicateGasUsed" in correspondingInput && (0, import_math7.bn)(correspondingInput.predicateGasUsed).gt(0)) {
2242
+ if (correspondingInput && "predicateGasUsed" in correspondingInput && (0, import_math6.bn)(correspondingInput.predicateGasUsed).gt(0)) {
2318
2243
  i.predicate = correspondingInput.predicate;
2319
2244
  i.predicateData = correspondingInput.predicateData;
2320
2245
  i.predicateGasUsed = correspondingInput.predicateGasUsed;
@@ -2324,47 +2249,47 @@ var BaseTransactionRequest = class {
2324
2249
  };
2325
2250
 
2326
2251
  // src/providers/transaction-request/create-transaction-request.ts
2327
- var import_configs9 = require("@fuel-ts/address/configs");
2328
- var import_math9 = require("@fuel-ts/math");
2329
- var import_transactions8 = require("@fuel-ts/transactions");
2252
+ var import_configs7 = require("@fuel-ts/address/configs");
2253
+ var import_math8 = require("@fuel-ts/math");
2254
+ var import_transactions7 = require("@fuel-ts/transactions");
2330
2255
  var import_utils13 = require("@fuel-ts/utils");
2331
2256
 
2332
2257
  // src/providers/transaction-request/hash-transaction.ts
2333
- var import_configs8 = require("@fuel-ts/address/configs");
2258
+ var import_configs6 = require("@fuel-ts/address/configs");
2334
2259
  var import_hasher = require("@fuel-ts/hasher");
2335
- var import_math8 = require("@fuel-ts/math");
2336
- var import_transactions7 = require("@fuel-ts/transactions");
2260
+ var import_math7 = require("@fuel-ts/math");
2261
+ var import_transactions6 = require("@fuel-ts/transactions");
2337
2262
  var import_utils11 = require("@fuel-ts/utils");
2338
2263
  var import_ramda2 = require("ramda");
2339
2264
  function hashTransaction(transactionRequest, chainId) {
2340
2265
  const transaction = transactionRequest.toTransaction();
2341
- if (transaction.type === import_transactions7.TransactionType.Script) {
2342
- transaction.receiptsRoot = import_configs8.ZeroBytes32;
2266
+ if (transaction.type === import_transactions6.TransactionType.Script) {
2267
+ transaction.receiptsRoot = import_configs6.ZeroBytes32;
2343
2268
  }
2344
2269
  transaction.inputs = transaction.inputs.map((input) => {
2345
2270
  const inputClone = (0, import_ramda2.clone)(input);
2346
2271
  switch (inputClone.type) {
2347
- case import_transactions7.InputType.Coin: {
2272
+ case import_transactions6.InputType.Coin: {
2348
2273
  inputClone.txPointer = {
2349
2274
  blockHeight: 0,
2350
2275
  txIndex: 0
2351
2276
  };
2352
- inputClone.predicateGasUsed = (0, import_math8.bn)(0);
2277
+ inputClone.predicateGasUsed = (0, import_math7.bn)(0);
2353
2278
  return inputClone;
2354
2279
  }
2355
- case import_transactions7.InputType.Message: {
2356
- inputClone.predicateGasUsed = (0, import_math8.bn)(0);
2280
+ case import_transactions6.InputType.Message: {
2281
+ inputClone.predicateGasUsed = (0, import_math7.bn)(0);
2357
2282
  return inputClone;
2358
2283
  }
2359
- case import_transactions7.InputType.Contract: {
2284
+ case import_transactions6.InputType.Contract: {
2360
2285
  inputClone.txPointer = {
2361
2286
  blockHeight: 0,
2362
2287
  txIndex: 0
2363
2288
  };
2364
- inputClone.txID = import_configs8.ZeroBytes32;
2289
+ inputClone.txID = import_configs6.ZeroBytes32;
2365
2290
  inputClone.outputIndex = 0;
2366
- inputClone.balanceRoot = import_configs8.ZeroBytes32;
2367
- inputClone.stateRoot = import_configs8.ZeroBytes32;
2291
+ inputClone.balanceRoot = import_configs6.ZeroBytes32;
2292
+ inputClone.stateRoot = import_configs6.ZeroBytes32;
2368
2293
  return inputClone;
2369
2294
  }
2370
2295
  default:
@@ -2374,19 +2299,19 @@ function hashTransaction(transactionRequest, chainId) {
2374
2299
  transaction.outputs = transaction.outputs.map((output) => {
2375
2300
  const outputClone = (0, import_ramda2.clone)(output);
2376
2301
  switch (outputClone.type) {
2377
- case import_transactions7.OutputType.Contract: {
2378
- outputClone.balanceRoot = import_configs8.ZeroBytes32;
2379
- outputClone.stateRoot = import_configs8.ZeroBytes32;
2302
+ case import_transactions6.OutputType.Contract: {
2303
+ outputClone.balanceRoot = import_configs6.ZeroBytes32;
2304
+ outputClone.stateRoot = import_configs6.ZeroBytes32;
2380
2305
  return outputClone;
2381
2306
  }
2382
- case import_transactions7.OutputType.Change: {
2383
- outputClone.amount = (0, import_math8.bn)(0);
2307
+ case import_transactions6.OutputType.Change: {
2308
+ outputClone.amount = (0, import_math7.bn)(0);
2384
2309
  return outputClone;
2385
2310
  }
2386
- case import_transactions7.OutputType.Variable: {
2387
- outputClone.to = import_configs8.ZeroBytes32;
2388
- outputClone.amount = (0, import_math8.bn)(0);
2389
- outputClone.assetId = import_configs8.ZeroBytes32;
2311
+ case import_transactions6.OutputType.Variable: {
2312
+ outputClone.to = import_configs6.ZeroBytes32;
2313
+ outputClone.amount = (0, import_math7.bn)(0);
2314
+ outputClone.assetId = import_configs6.ZeroBytes32;
2390
2315
  return outputClone;
2391
2316
  }
2392
2317
  default:
@@ -2396,7 +2321,7 @@ function hashTransaction(transactionRequest, chainId) {
2396
2321
  transaction.witnessesCount = 0;
2397
2322
  transaction.witnesses = [];
2398
2323
  const chainIdBytes = (0, import_hasher.uint64ToBytesBE)(chainId);
2399
- const concatenatedData = (0, import_utils11.concat)([chainIdBytes, new import_transactions7.TransactionCoder().encode(transaction)]);
2324
+ const concatenatedData = (0, import_utils11.concat)([chainIdBytes, new import_transactions6.TransactionCoder().encode(transaction)]);
2400
2325
  return (0, import_hasher.sha256)(concatenatedData);
2401
2326
  }
2402
2327
 
@@ -2432,7 +2357,7 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2432
2357
  return new this(obj);
2433
2358
  }
2434
2359
  /** Type of the transaction */
2435
- type = import_transactions8.TransactionType.Create;
2360
+ type = import_transactions7.TransactionType.Create;
2436
2361
  /** Witness index of contract bytecode to create */
2437
2362
  bytecodeWitnessIndex;
2438
2363
  /** Salt */
@@ -2452,7 +2377,7 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2452
2377
  } = {}) {
2453
2378
  super(rest);
2454
2379
  this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
2455
- this.salt = (0, import_utils13.hexlify)(salt ?? import_configs9.ZeroBytes32);
2380
+ this.salt = (0, import_utils13.hexlify)(salt ?? import_configs7.ZeroBytes32);
2456
2381
  this.storageSlots = [...storageSlots ?? []];
2457
2382
  }
2458
2383
  /**
@@ -2465,12 +2390,12 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2465
2390
  const bytecodeWitnessIndex = this.bytecodeWitnessIndex;
2466
2391
  const storageSlots = this.storageSlots?.map(storageSlotify) ?? [];
2467
2392
  return {
2468
- type: import_transactions8.TransactionType.Create,
2393
+ type: import_transactions7.TransactionType.Create,
2469
2394
  ...baseTransaction,
2470
2395
  bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
2471
2396
  bytecodeWitnessIndex,
2472
2397
  storageSlotsCount: storageSlots.length,
2473
- salt: this.salt ? (0, import_utils13.hexlify)(this.salt) : import_configs9.ZeroBytes32,
2398
+ salt: this.salt ? (0, import_utils13.hexlify)(this.salt) : import_configs7.ZeroBytes32,
2474
2399
  storageSlots
2475
2400
  };
2476
2401
  }
@@ -2481,7 +2406,7 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2481
2406
  */
2482
2407
  getContractCreatedOutputs() {
2483
2408
  return this.outputs.filter(
2484
- (output) => output.type === import_transactions8.OutputType.ContractCreated
2409
+ (output) => output.type === import_transactions7.OutputType.ContractCreated
2485
2410
  );
2486
2411
  }
2487
2412
  /**
@@ -2502,14 +2427,14 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2502
2427
  */
2503
2428
  addContractCreatedOutput(contractId, stateRoot) {
2504
2429
  this.pushOutput({
2505
- type: import_transactions8.OutputType.ContractCreated,
2430
+ type: import_transactions7.OutputType.ContractCreated,
2506
2431
  contractId,
2507
2432
  stateRoot
2508
2433
  });
2509
2434
  }
2510
2435
  metadataGas(gasCosts) {
2511
2436
  return calculateMetadataGasForTxCreate({
2512
- contractBytesSize: (0, import_math9.bn)((0, import_utils13.arrayify)(this.witnesses[this.bytecodeWitnessIndex] || "0x").length),
2437
+ contractBytesSize: (0, import_math8.bn)((0, import_utils13.arrayify)(this.witnesses[this.bytecodeWitnessIndex] || "0x").length),
2513
2438
  gasCosts,
2514
2439
  stateRootSize: this.storageSlots.length,
2515
2440
  txBytesSize: this.byteSize()
@@ -2520,9 +2445,9 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2520
2445
  // src/providers/transaction-request/script-transaction-request.ts
2521
2446
  var import_abi_coder = require("@fuel-ts/abi-coder");
2522
2447
  var import_address2 = require("@fuel-ts/address");
2523
- var import_configs10 = require("@fuel-ts/address/configs");
2524
- var import_math10 = require("@fuel-ts/math");
2525
- var import_transactions9 = require("@fuel-ts/transactions");
2448
+ var import_configs8 = require("@fuel-ts/address/configs");
2449
+ var import_math9 = require("@fuel-ts/math");
2450
+ var import_transactions8 = require("@fuel-ts/transactions");
2526
2451
  var import_utils15 = require("@fuel-ts/utils");
2527
2452
 
2528
2453
  // src/providers/transaction-request/scripts.ts
@@ -2560,7 +2485,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2560
2485
  return new this(obj);
2561
2486
  }
2562
2487
  /** Type of the transaction */
2563
- type = import_transactions9.TransactionType.Script;
2488
+ type = import_transactions8.TransactionType.Script;
2564
2489
  /** Gas limit for transaction */
2565
2490
  gasLimit;
2566
2491
  /** Script to execute */
@@ -2575,7 +2500,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2575
2500
  */
2576
2501
  constructor({ script, scriptData, gasLimit, ...rest } = {}) {
2577
2502
  super(rest);
2578
- this.gasLimit = (0, import_math10.bn)(gasLimit);
2503
+ this.gasLimit = (0, import_math9.bn)(gasLimit);
2579
2504
  this.script = (0, import_utils15.arrayify)(script ?? returnZeroScript.bytes);
2580
2505
  this.scriptData = (0, import_utils15.arrayify)(scriptData ?? returnZeroScript.encodeScriptData());
2581
2506
  this.abis = rest.abis;
@@ -2589,12 +2514,12 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2589
2514
  const script = (0, import_utils15.arrayify)(this.script ?? "0x");
2590
2515
  const scriptData = (0, import_utils15.arrayify)(this.scriptData ?? "0x");
2591
2516
  return {
2592
- type: import_transactions9.TransactionType.Script,
2517
+ type: import_transactions8.TransactionType.Script,
2593
2518
  scriptGasLimit: this.gasLimit,
2594
2519
  ...super.getBaseTransaction(),
2595
2520
  scriptLength: script.length,
2596
2521
  scriptDataLength: scriptData.length,
2597
- receiptsRoot: import_configs10.ZeroBytes32,
2522
+ receiptsRoot: import_configs8.ZeroBytes32,
2598
2523
  script: (0, import_utils15.hexlify)(script),
2599
2524
  scriptData: (0, import_utils15.hexlify)(scriptData)
2600
2525
  };
@@ -2606,7 +2531,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2606
2531
  */
2607
2532
  getContractInputs() {
2608
2533
  return this.inputs.filter(
2609
- (input) => input.type === import_transactions9.InputType.Contract
2534
+ (input) => input.type === import_transactions8.InputType.Contract
2610
2535
  );
2611
2536
  }
2612
2537
  /**
@@ -2616,7 +2541,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2616
2541
  */
2617
2542
  getContractOutputs() {
2618
2543
  return this.outputs.filter(
2619
- (output) => output.type === import_transactions9.OutputType.Contract
2544
+ (output) => output.type === import_transactions8.OutputType.Contract
2620
2545
  );
2621
2546
  }
2622
2547
  /**
@@ -2626,7 +2551,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2626
2551
  */
2627
2552
  getVariableOutputs() {
2628
2553
  return this.outputs.filter(
2629
- (output) => output.type === import_transactions9.OutputType.Variable
2554
+ (output) => output.type === import_transactions8.OutputType.Variable
2630
2555
  );
2631
2556
  }
2632
2557
  /**
@@ -2649,7 +2574,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2649
2574
  let outputsNumber = numberOfVariables;
2650
2575
  while (outputsNumber) {
2651
2576
  this.pushOutput({
2652
- type: import_transactions9.OutputType.Variable
2577
+ type: import_transactions8.OutputType.Variable
2653
2578
  });
2654
2579
  outputsNumber -= 1;
2655
2580
  }
@@ -2682,12 +2607,12 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2682
2607
  return this;
2683
2608
  }
2684
2609
  const inputIndex = super.pushInput({
2685
- type: import_transactions9.InputType.Contract,
2610
+ type: import_transactions8.InputType.Contract,
2686
2611
  contractId: contractAddress.toB256(),
2687
2612
  txPointer: "0x00000000000000000000000000000000"
2688
2613
  });
2689
2614
  this.pushOutput({
2690
- type: import_transactions9.OutputType.Contract,
2615
+ type: import_transactions8.OutputType.Contract,
2691
2616
  inputIndex
2692
2617
  });
2693
2618
  return this;
@@ -2723,38 +2648,38 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2723
2648
  };
2724
2649
 
2725
2650
  // src/providers/transaction-request/utils.ts
2726
- var import_errors9 = require("@fuel-ts/errors");
2727
- var import_transactions10 = require("@fuel-ts/transactions");
2651
+ var import_errors8 = require("@fuel-ts/errors");
2652
+ var import_transactions9 = require("@fuel-ts/transactions");
2728
2653
  var transactionRequestify = (obj) => {
2729
2654
  if (obj instanceof ScriptTransactionRequest || obj instanceof CreateTransactionRequest) {
2730
2655
  return obj;
2731
2656
  }
2732
2657
  const { type } = obj;
2733
2658
  switch (obj.type) {
2734
- case import_transactions10.TransactionType.Script: {
2659
+ case import_transactions9.TransactionType.Script: {
2735
2660
  return ScriptTransactionRequest.from(obj);
2736
2661
  }
2737
- case import_transactions10.TransactionType.Create: {
2662
+ case import_transactions9.TransactionType.Create: {
2738
2663
  return CreateTransactionRequest.from(obj);
2739
2664
  }
2740
2665
  default: {
2741
- throw new import_errors9.FuelError(import_errors9.ErrorCode.INVALID_TRANSACTION_TYPE, `Invalid transaction type: ${type}.`);
2666
+ throw new import_errors8.FuelError(import_errors8.ErrorCode.INVALID_TRANSACTION_TYPE, `Invalid transaction type: ${type}.`);
2742
2667
  }
2743
2668
  }
2744
2669
  };
2745
2670
 
2746
2671
  // src/providers/transaction-response/transaction-response.ts
2747
- var import_errors13 = require("@fuel-ts/errors");
2748
- var import_math14 = require("@fuel-ts/math");
2749
- var import_transactions17 = require("@fuel-ts/transactions");
2672
+ var import_errors12 = require("@fuel-ts/errors");
2673
+ var import_math13 = require("@fuel-ts/math");
2674
+ var import_transactions16 = require("@fuel-ts/transactions");
2750
2675
  var import_utils21 = require("@fuel-ts/utils");
2751
2676
 
2752
2677
  // src/providers/transaction-summary/assemble-transaction-summary.ts
2753
2678
  var import_utils19 = require("@fuel-ts/utils");
2754
2679
 
2755
2680
  // src/providers/transaction-summary/calculate-transaction-fee.ts
2756
- var import_math11 = require("@fuel-ts/math");
2757
- var import_transactions11 = require("@fuel-ts/transactions");
2681
+ var import_math10 = require("@fuel-ts/math");
2682
+ var import_transactions10 = require("@fuel-ts/transactions");
2758
2683
  var import_utils16 = require("@fuel-ts/utils");
2759
2684
  var calculateTransactionFee = (params) => {
2760
2685
  const {
@@ -2762,24 +2687,24 @@ var calculateTransactionFee = (params) => {
2762
2687
  rawPayload,
2763
2688
  consensusParameters: { gasCosts, feeParams }
2764
2689
  } = params;
2765
- const gasPerByte = (0, import_math11.bn)(feeParams.gasPerByte);
2766
- const gasPriceFactor = (0, import_math11.bn)(feeParams.gasPriceFactor);
2690
+ const gasPerByte = (0, import_math10.bn)(feeParams.gasPerByte);
2691
+ const gasPriceFactor = (0, import_math10.bn)(feeParams.gasPriceFactor);
2767
2692
  const transactionBytes = (0, import_utils16.arrayify)(rawPayload);
2768
- const [transaction] = new import_transactions11.TransactionCoder().decode(transactionBytes, 0);
2769
- if (transaction.type === import_transactions11.TransactionType.Mint) {
2693
+ const [transaction] = new import_transactions10.TransactionCoder().decode(transactionBytes, 0);
2694
+ if (transaction.type === import_transactions10.TransactionType.Mint) {
2770
2695
  return {
2771
- fee: (0, import_math11.bn)(0),
2772
- minFee: (0, import_math11.bn)(0),
2773
- maxFee: (0, import_math11.bn)(0),
2774
- feeFromGasUsed: (0, import_math11.bn)(0)
2696
+ fee: (0, import_math10.bn)(0),
2697
+ minFee: (0, import_math10.bn)(0),
2698
+ maxFee: (0, import_math10.bn)(0),
2699
+ feeFromGasUsed: (0, import_math10.bn)(0)
2775
2700
  };
2776
2701
  }
2777
2702
  const { type, witnesses, inputs, policies } = transaction;
2778
- let metadataGas = (0, import_math11.bn)(0);
2779
- let gasLimit = (0, import_math11.bn)(0);
2780
- if (type === import_transactions11.TransactionType.Create) {
2703
+ let metadataGas = (0, import_math10.bn)(0);
2704
+ let gasLimit = (0, import_math10.bn)(0);
2705
+ if (type === import_transactions10.TransactionType.Create) {
2781
2706
  const { bytecodeWitnessIndex, storageSlots } = transaction;
2782
- const contractBytesSize = (0, import_math11.bn)((0, import_utils16.arrayify)(witnesses[bytecodeWitnessIndex].data).length);
2707
+ const contractBytesSize = (0, import_math10.bn)((0, import_utils16.arrayify)(witnesses[bytecodeWitnessIndex].data).length);
2783
2708
  metadataGas = calculateMetadataGasForTxCreate({
2784
2709
  contractBytesSize,
2785
2710
  gasCosts,
@@ -2798,13 +2723,13 @@ var calculateTransactionFee = (params) => {
2798
2723
  }
2799
2724
  const minGas = getMinGas({
2800
2725
  gasCosts,
2801
- gasPerByte: (0, import_math11.bn)(gasPerByte),
2726
+ gasPerByte: (0, import_math10.bn)(gasPerByte),
2802
2727
  inputs,
2803
2728
  metadataGas,
2804
2729
  txBytesSize: transactionBytes.length
2805
2730
  });
2806
- const gasPrice = (0, import_math11.bn)(policies.find((policy) => policy.type === import_transactions11.PolicyType.GasPrice)?.data);
2807
- const witnessLimit = policies.find((policy) => policy.type === import_transactions11.PolicyType.WitnessLimit)?.data;
2731
+ const gasPrice = (0, import_math10.bn)(policies.find((policy) => policy.type === import_transactions10.PolicyType.GasPrice)?.data);
2732
+ const witnessLimit = policies.find((policy) => policy.type === import_transactions10.PolicyType.WitnessLimit)?.data;
2808
2733
  const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
2809
2734
  const maxGas = getMaxGas({
2810
2735
  gasPerByte,
@@ -2826,14 +2751,14 @@ var calculateTransactionFee = (params) => {
2826
2751
  };
2827
2752
 
2828
2753
  // src/providers/transaction-summary/operations.ts
2829
- var import_configs11 = require("@fuel-ts/address/configs");
2830
- var import_errors11 = require("@fuel-ts/errors");
2831
- var import_math13 = require("@fuel-ts/math");
2832
- var import_transactions14 = require("@fuel-ts/transactions");
2754
+ var import_configs9 = require("@fuel-ts/address/configs");
2755
+ var import_errors10 = require("@fuel-ts/errors");
2756
+ var import_math12 = require("@fuel-ts/math");
2757
+ var import_transactions13 = require("@fuel-ts/transactions");
2833
2758
 
2834
2759
  // src/providers/transaction-summary/call.ts
2835
2760
  var import_abi_coder2 = require("@fuel-ts/abi-coder");
2836
- var import_math12 = require("@fuel-ts/math");
2761
+ var import_math11 = require("@fuel-ts/math");
2837
2762
  var getFunctionCall = ({ abi, receipt, rawPayload, maxInputs }) => {
2838
2763
  const abiInterface = new import_abi_coder2.Interface(abi);
2839
2764
  const callFunctionSelector = receipt.param1.toHex(8);
@@ -2842,7 +2767,7 @@ var getFunctionCall = ({ abi, receipt, rawPayload, maxInputs }) => {
2842
2767
  let encodedArgs;
2843
2768
  if (functionFragment.isInputDataPointer) {
2844
2769
  if (rawPayload) {
2845
- const argsOffset = (0, import_math12.bn)(receipt.param2).sub((0, import_abi_coder2.calculateVmTxMemory)({ maxInputs: maxInputs.toNumber() })).toNumber();
2770
+ const argsOffset = (0, import_math11.bn)(receipt.param2).sub((0, import_abi_coder2.calculateVmTxMemory)({ maxInputs: maxInputs.toNumber() })).toNumber();
2846
2771
  encodedArgs = `0x${rawPayload.slice(2).slice(argsOffset * 2)}`;
2847
2772
  }
2848
2773
  } else {
@@ -2876,8 +2801,8 @@ var getFunctionCall = ({ abi, receipt, rawPayload, maxInputs }) => {
2876
2801
  };
2877
2802
 
2878
2803
  // src/providers/transaction-summary/input.ts
2879
- var import_errors10 = require("@fuel-ts/errors");
2880
- var import_transactions12 = require("@fuel-ts/transactions");
2804
+ var import_errors9 = require("@fuel-ts/errors");
2805
+ var import_transactions11 = require("@fuel-ts/transactions");
2881
2806
  function getInputsByTypes(inputs, types) {
2882
2807
  return inputs.filter((i) => types.includes(i.type));
2883
2808
  }
@@ -2885,16 +2810,16 @@ function getInputsByType(inputs, type) {
2885
2810
  return inputs.filter((i) => i.type === type);
2886
2811
  }
2887
2812
  function getInputsCoin(inputs) {
2888
- return getInputsByType(inputs, import_transactions12.InputType.Coin);
2813
+ return getInputsByType(inputs, import_transactions11.InputType.Coin);
2889
2814
  }
2890
2815
  function getInputsMessage(inputs) {
2891
- return getInputsByType(inputs, import_transactions12.InputType.Message);
2816
+ return getInputsByType(inputs, import_transactions11.InputType.Message);
2892
2817
  }
2893
2818
  function getInputsCoinAndMessage(inputs) {
2894
- return getInputsByTypes(inputs, [import_transactions12.InputType.Coin, import_transactions12.InputType.Message]);
2819
+ return getInputsByTypes(inputs, [import_transactions11.InputType.Coin, import_transactions11.InputType.Message]);
2895
2820
  }
2896
2821
  function getInputsContract(inputs) {
2897
- return getInputsByType(inputs, import_transactions12.InputType.Contract);
2822
+ return getInputsByType(inputs, import_transactions11.InputType.Contract);
2898
2823
  }
2899
2824
  function getInputFromAssetId(inputs, assetId) {
2900
2825
  const coinInputs = getInputsCoin(inputs);
@@ -2913,43 +2838,43 @@ function getInputContractFromIndex(inputs, inputIndex) {
2913
2838
  if (!contractInput) {
2914
2839
  return void 0;
2915
2840
  }
2916
- if (contractInput.type !== import_transactions12.InputType.Contract) {
2917
- throw new import_errors10.FuelError(
2918
- import_errors10.ErrorCode.INVALID_TRANSACTION_INPUT,
2841
+ if (contractInput.type !== import_transactions11.InputType.Contract) {
2842
+ throw new import_errors9.FuelError(
2843
+ import_errors9.ErrorCode.INVALID_TRANSACTION_INPUT,
2919
2844
  `Contract input should be of type 'contract'.`
2920
2845
  );
2921
2846
  }
2922
2847
  return contractInput;
2923
2848
  }
2924
2849
  function getInputAccountAddress(input) {
2925
- if (input.type === import_transactions12.InputType.Coin) {
2850
+ if (input.type === import_transactions11.InputType.Coin) {
2926
2851
  return input.owner.toString();
2927
2852
  }
2928
- if (input.type === import_transactions12.InputType.Message) {
2853
+ if (input.type === import_transactions11.InputType.Message) {
2929
2854
  return input.recipient.toString();
2930
2855
  }
2931
2856
  return "";
2932
2857
  }
2933
2858
 
2934
2859
  // src/providers/transaction-summary/output.ts
2935
- var import_transactions13 = require("@fuel-ts/transactions");
2860
+ var import_transactions12 = require("@fuel-ts/transactions");
2936
2861
  function getOutputsByType(outputs, type) {
2937
2862
  return outputs.filter((o) => o.type === type);
2938
2863
  }
2939
2864
  function getOutputsContractCreated(outputs) {
2940
- return getOutputsByType(outputs, import_transactions13.OutputType.ContractCreated);
2865
+ return getOutputsByType(outputs, import_transactions12.OutputType.ContractCreated);
2941
2866
  }
2942
2867
  function getOutputsCoin(outputs) {
2943
- return getOutputsByType(outputs, import_transactions13.OutputType.Coin);
2868
+ return getOutputsByType(outputs, import_transactions12.OutputType.Coin);
2944
2869
  }
2945
2870
  function getOutputsChange(outputs) {
2946
- return getOutputsByType(outputs, import_transactions13.OutputType.Change);
2871
+ return getOutputsByType(outputs, import_transactions12.OutputType.Change);
2947
2872
  }
2948
2873
  function getOutputsContract(outputs) {
2949
- return getOutputsByType(outputs, import_transactions13.OutputType.Contract);
2874
+ return getOutputsByType(outputs, import_transactions12.OutputType.Contract);
2950
2875
  }
2951
2876
  function getOutputsVariable(outputs) {
2952
- return getOutputsByType(outputs, import_transactions13.OutputType.Variable);
2877
+ return getOutputsByType(outputs, import_transactions12.OutputType.Variable);
2953
2878
  }
2954
2879
 
2955
2880
  // src/providers/transaction-summary/types.ts
@@ -2996,15 +2921,15 @@ function getReceiptsByType(receipts, type) {
2996
2921
  }
2997
2922
  function getTransactionTypeName(transactionType) {
2998
2923
  switch (transactionType) {
2999
- case import_transactions14.TransactionType.Mint:
2924
+ case import_transactions13.TransactionType.Mint:
3000
2925
  return "Mint" /* Mint */;
3001
- case import_transactions14.TransactionType.Create:
2926
+ case import_transactions13.TransactionType.Create:
3002
2927
  return "Create" /* Create */;
3003
- case import_transactions14.TransactionType.Script:
2928
+ case import_transactions13.TransactionType.Script:
3004
2929
  return "Script" /* Script */;
3005
2930
  default:
3006
- throw new import_errors11.FuelError(
3007
- import_errors11.ErrorCode.INVALID_TRANSACTION_TYPE,
2931
+ throw new import_errors10.FuelError(
2932
+ import_errors10.ErrorCode.INVALID_TRANSACTION_TYPE,
3008
2933
  `Invalid transaction type: ${transactionType}.`
3009
2934
  );
3010
2935
  }
@@ -3026,10 +2951,10 @@ function hasSameAssetId(a) {
3026
2951
  return (b) => a.assetId === b.assetId;
3027
2952
  }
3028
2953
  function getReceiptsCall(receipts) {
3029
- return getReceiptsByType(receipts, import_transactions14.ReceiptType.Call);
2954
+ return getReceiptsByType(receipts, import_transactions13.ReceiptType.Call);
3030
2955
  }
3031
2956
  function getReceiptsMessageOut(receipts) {
3032
- return getReceiptsByType(receipts, import_transactions14.ReceiptType.MessageOut);
2957
+ return getReceiptsByType(receipts, import_transactions13.ReceiptType.MessageOut);
3033
2958
  }
3034
2959
  var mergeAssets = (op1, op2) => {
3035
2960
  const assets1 = op1.assetsSent || [];
@@ -3042,7 +2967,7 @@ var mergeAssets = (op1, op2) => {
3042
2967
  if (!matchingAsset) {
3043
2968
  return asset1;
3044
2969
  }
3045
- const mergedAmount = (0, import_math13.bn)(asset1.amount).add(matchingAsset.amount);
2970
+ const mergedAmount = (0, import_math12.bn)(asset1.amount).add(matchingAsset.amount);
3046
2971
  return { ...asset1, amount: mergedAmount };
3047
2972
  });
3048
2973
  return mergedAssets.concat(filteredAssets);
@@ -3068,7 +2993,7 @@ function addOperation(operations, toAdd) {
3068
2993
  return allOperations;
3069
2994
  }
3070
2995
  function getReceiptsTransferOut(receipts) {
3071
- return getReceiptsByType(receipts, import_transactions14.ReceiptType.TransferOut);
2996
+ return getReceiptsByType(receipts, import_transactions13.ReceiptType.TransferOut);
3072
2997
  }
3073
2998
  function getWithdrawFromFuelOperations({
3074
2999
  inputs,
@@ -3171,7 +3096,7 @@ function extractTransferOperationFromReceipt(receipt, contractInputs, changeOutp
3171
3096
  const { to: toAddress, assetId, amount } = receipt;
3172
3097
  let { from: fromAddress } = receipt;
3173
3098
  const toType = contractInputs.some((input) => input.contractID === toAddress) ? 0 /* contract */ : 1 /* account */;
3174
- if (import_configs11.ZeroBytes32 === fromAddress) {
3099
+ if (import_configs9.ZeroBytes32 === fromAddress) {
3175
3100
  const change = changeOutputs.find((output) => output.assetId === assetId);
3176
3101
  fromAddress = change?.to || fromAddress;
3177
3102
  }
@@ -3228,11 +3153,11 @@ function getTransferOperations({
3228
3153
  });
3229
3154
  const transferReceipts = getReceiptsByType(
3230
3155
  receipts,
3231
- import_transactions14.ReceiptType.Transfer
3156
+ import_transactions13.ReceiptType.Transfer
3232
3157
  );
3233
3158
  const transferOutReceipts = getReceiptsByType(
3234
3159
  receipts,
3235
- import_transactions14.ReceiptType.TransferOut
3160
+ import_transactions13.ReceiptType.TransferOut
3236
3161
  );
3237
3162
  [...transferReceipts, ...transferOutReceipts].forEach((receipt) => {
3238
3163
  const operation = extractTransferOperationFromReceipt(receipt, contractInputs, changeOutputs);
@@ -3317,17 +3242,17 @@ function getOperations({
3317
3242
  }
3318
3243
 
3319
3244
  // src/providers/transaction-summary/receipt.ts
3320
- var import_transactions15 = require("@fuel-ts/transactions");
3245
+ var import_transactions14 = require("@fuel-ts/transactions");
3321
3246
  var processGqlReceipt = (gqlReceipt) => {
3322
3247
  const receipt = assembleReceiptByType(gqlReceipt);
3323
3248
  switch (receipt.type) {
3324
- case import_transactions15.ReceiptType.ReturnData: {
3249
+ case import_transactions14.ReceiptType.ReturnData: {
3325
3250
  return {
3326
3251
  ...receipt,
3327
3252
  data: gqlReceipt.data || "0x"
3328
3253
  };
3329
3254
  }
3330
- case import_transactions15.ReceiptType.LogData: {
3255
+ case import_transactions14.ReceiptType.LogData: {
3331
3256
  return {
3332
3257
  ...receipt,
3333
3258
  data: gqlReceipt.data || "0x"
@@ -3340,7 +3265,7 @@ var processGqlReceipt = (gqlReceipt) => {
3340
3265
  var extractMintedAssetsFromReceipts = (receipts) => {
3341
3266
  const mintedAssets = [];
3342
3267
  receipts.forEach((receipt) => {
3343
- if (receipt.type === import_transactions15.ReceiptType.Mint) {
3268
+ if (receipt.type === import_transactions14.ReceiptType.Mint) {
3344
3269
  mintedAssets.push({
3345
3270
  subId: receipt.subId,
3346
3271
  contractId: receipt.contractId,
@@ -3354,7 +3279,7 @@ var extractMintedAssetsFromReceipts = (receipts) => {
3354
3279
  var extractBurnedAssetsFromReceipts = (receipts) => {
3355
3280
  const burnedAssets = [];
3356
3281
  receipts.forEach((receipt) => {
3357
- if (receipt.type === import_transactions15.ReceiptType.Burn) {
3282
+ if (receipt.type === import_transactions14.ReceiptType.Burn) {
3358
3283
  burnedAssets.push({
3359
3284
  subId: receipt.subId,
3360
3285
  contractId: receipt.contractId,
@@ -3367,7 +3292,7 @@ var extractBurnedAssetsFromReceipts = (receipts) => {
3367
3292
  };
3368
3293
 
3369
3294
  // src/providers/transaction-summary/status.ts
3370
- var import_errors12 = require("@fuel-ts/errors");
3295
+ var import_errors11 = require("@fuel-ts/errors");
3371
3296
  var getTransactionStatusName = (gqlStatus) => {
3372
3297
  switch (gqlStatus) {
3373
3298
  case "FailureStatus":
@@ -3379,8 +3304,8 @@ var getTransactionStatusName = (gqlStatus) => {
3379
3304
  case "SqueezedOutStatus":
3380
3305
  return "squeezedout" /* squeezedout */;
3381
3306
  default:
3382
- throw new import_errors12.FuelError(
3383
- import_errors12.ErrorCode.INVALID_TRANSACTION_STATUS,
3307
+ throw new import_errors11.FuelError(
3308
+ import_errors11.ErrorCode.INVALID_TRANSACTION_STATUS,
3384
3309
  `Invalid transaction status: ${gqlStatus}.`
3385
3310
  );
3386
3311
  }
@@ -3493,12 +3418,12 @@ function assembleTransactionSummary(params) {
3493
3418
 
3494
3419
  // src/providers/transaction-response/getDecodedLogs.ts
3495
3420
  var import_abi_coder3 = require("@fuel-ts/abi-coder");
3496
- var import_transactions16 = require("@fuel-ts/transactions");
3421
+ var import_transactions15 = require("@fuel-ts/transactions");
3497
3422
  function getDecodedLogs(receipts, mainAbi, externalAbis = {}) {
3498
3423
  return receipts.reduce((logs, receipt) => {
3499
- if (receipt.type === import_transactions16.ReceiptType.LogData || receipt.type === import_transactions16.ReceiptType.Log) {
3424
+ if (receipt.type === import_transactions15.ReceiptType.LogData || receipt.type === import_transactions15.ReceiptType.Log) {
3500
3425
  const interfaceToUse = new import_abi_coder3.Interface(externalAbis[receipt.id] || mainAbi);
3501
- const data = receipt.type === import_transactions16.ReceiptType.Log ? new import_abi_coder3.BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
3426
+ const data = receipt.type === import_transactions15.ReceiptType.Log ? new import_abi_coder3.BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
3502
3427
  const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toNumber());
3503
3428
  logs.push(decodedLog);
3504
3429
  }
@@ -3513,7 +3438,7 @@ var TransactionResponse = class {
3513
3438
  /** Current provider */
3514
3439
  provider;
3515
3440
  /** Gas used on the transaction */
3516
- gasUsed = (0, import_math14.bn)(0);
3441
+ gasUsed = (0, import_math13.bn)(0);
3517
3442
  /** The graphql Transaction with receipts object. */
3518
3443
  gqlTransaction;
3519
3444
  abis;
@@ -3571,7 +3496,7 @@ var TransactionResponse = class {
3571
3496
  * @returns The decoded transaction.
3572
3497
  */
3573
3498
  decodeTransaction(transactionWithReceipts) {
3574
- return new import_transactions17.TransactionCoder().decode(
3499
+ return new import_transactions16.TransactionCoder().decode(
3575
3500
  (0, import_utils21.arrayify)(transactionWithReceipts.rawPayload),
3576
3501
  0
3577
3502
  )?.[0];
@@ -3618,8 +3543,8 @@ var TransactionResponse = class {
3618
3543
  });
3619
3544
  for await (const { statusChange } of subscription) {
3620
3545
  if (statusChange.type === "SqueezedOutStatus") {
3621
- throw new import_errors13.FuelError(
3622
- import_errors13.ErrorCode.TRANSACTION_SQUEEZED_OUT,
3546
+ throw new import_errors12.FuelError(
3547
+ import_errors12.ErrorCode.TRANSACTION_SQUEEZED_OUT,
3623
3548
  `Transaction Squeezed Out with reason: ${statusChange.reason}`
3624
3549
  );
3625
3550
  }
@@ -3641,26 +3566,14 @@ var TransactionResponse = class {
3641
3566
  gqlTransaction: this.gqlTransaction,
3642
3567
  ...transactionSummary
3643
3568
  };
3644
- let logs = [];
3645
3569
  if (this.abis) {
3646
- logs = getDecodedLogs(
3570
+ const logs = getDecodedLogs(
3647
3571
  transactionSummary.receipts,
3648
3572
  this.abis.main,
3649
3573
  this.abis.otherContractsAbis
3650
3574
  );
3651
3575
  transactionResult.logs = logs;
3652
3576
  }
3653
- if (transactionResult.isStatusFailure) {
3654
- const {
3655
- receipts,
3656
- gqlTransaction: { status }
3657
- } = transactionResult;
3658
- throw extractTxError({
3659
- receipts,
3660
- status,
3661
- logs
3662
- });
3663
- }
3664
3577
  return transactionResult;
3665
3578
  }
3666
3579
  /**
@@ -3669,7 +3582,14 @@ var TransactionResponse = class {
3669
3582
  * @param contractsAbiMap - The contracts ABI map.
3670
3583
  */
3671
3584
  async wait(contractsAbiMap) {
3672
- return this.waitForResult(contractsAbiMap);
3585
+ const result = await this.waitForResult(contractsAbiMap);
3586
+ if (result.isStatusFailure) {
3587
+ throw new import_errors12.FuelError(
3588
+ import_errors12.ErrorCode.TRANSACTION_FAILED,
3589
+ `Transaction failed: ${result.gqlTransaction.status.reason}`
3590
+ );
3591
+ }
3592
+ return result;
3673
3593
  }
3674
3594
  };
3675
3595
 
@@ -3731,29 +3651,30 @@ var processGqlChain = (chain) => {
3731
3651
  const { contractParams, feeParams, predicateParams, scriptParams, txParams, gasCosts } = consensusParameters;
3732
3652
  return {
3733
3653
  name,
3734
- baseChainHeight: (0, import_math15.bn)(daHeight),
3654
+ baseChainHeight: (0, import_math14.bn)(daHeight),
3735
3655
  consensusParameters: {
3736
- contractMaxSize: (0, import_math15.bn)(contractParams.contractMaxSize),
3737
- maxInputs: (0, import_math15.bn)(txParams.maxInputs),
3738
- maxOutputs: (0, import_math15.bn)(txParams.maxOutputs),
3739
- maxWitnesses: (0, import_math15.bn)(txParams.maxWitnesses),
3740
- maxGasPerTx: (0, import_math15.bn)(txParams.maxGasPerTx),
3741
- maxScriptLength: (0, import_math15.bn)(scriptParams.maxScriptLength),
3742
- maxScriptDataLength: (0, import_math15.bn)(scriptParams.maxScriptDataLength),
3743
- maxStorageSlots: (0, import_math15.bn)(contractParams.maxStorageSlots),
3744
- maxPredicateLength: (0, import_math15.bn)(predicateParams.maxPredicateLength),
3745
- maxPredicateDataLength: (0, import_math15.bn)(predicateParams.maxPredicateDataLength),
3746
- maxGasPerPredicate: (0, import_math15.bn)(predicateParams.maxGasPerPredicate),
3747
- gasPriceFactor: (0, import_math15.bn)(feeParams.gasPriceFactor),
3748
- gasPerByte: (0, import_math15.bn)(feeParams.gasPerByte),
3749
- maxMessageDataLength: (0, import_math15.bn)(predicateParams.maxMessageDataLength),
3750
- chainId: (0, import_math15.bn)(consensusParameters.chainId),
3656
+ contractMaxSize: (0, import_math14.bn)(contractParams.contractMaxSize),
3657
+ maxInputs: (0, import_math14.bn)(txParams.maxInputs),
3658
+ maxOutputs: (0, import_math14.bn)(txParams.maxOutputs),
3659
+ maxWitnesses: (0, import_math14.bn)(txParams.maxWitnesses),
3660
+ maxGasPerTx: (0, import_math14.bn)(txParams.maxGasPerTx),
3661
+ maxScriptLength: (0, import_math14.bn)(scriptParams.maxScriptLength),
3662
+ maxScriptDataLength: (0, import_math14.bn)(scriptParams.maxScriptDataLength),
3663
+ maxStorageSlots: (0, import_math14.bn)(contractParams.maxStorageSlots),
3664
+ maxPredicateLength: (0, import_math14.bn)(predicateParams.maxPredicateLength),
3665
+ maxPredicateDataLength: (0, import_math14.bn)(predicateParams.maxPredicateDataLength),
3666
+ maxGasPerPredicate: (0, import_math14.bn)(predicateParams.maxGasPerPredicate),
3667
+ gasPriceFactor: (0, import_math14.bn)(feeParams.gasPriceFactor),
3668
+ gasPerByte: (0, import_math14.bn)(feeParams.gasPerByte),
3669
+ maxMessageDataLength: (0, import_math14.bn)(predicateParams.maxMessageDataLength),
3670
+ chainId: (0, import_math14.bn)(consensusParameters.chainId),
3671
+ baseAssetId: consensusParameters.baseAssetId,
3751
3672
  gasCosts
3752
3673
  },
3753
3674
  gasCosts,
3754
3675
  latestBlock: {
3755
3676
  id: latestBlock.id,
3756
- height: (0, import_math15.bn)(latestBlock.header.height),
3677
+ height: (0, import_math14.bn)(latestBlock.header.height),
3757
3678
  time: latestBlock.header.time,
3758
3679
  transactions: latestBlock.transactions.map((i) => ({
3759
3680
  id: i.id
@@ -3823,8 +3744,8 @@ var _Provider = class {
3823
3744
  getChain() {
3824
3745
  const chain = _Provider.chainInfoCache[this.url];
3825
3746
  if (!chain) {
3826
- throw new import_errors14.FuelError(
3827
- import_errors14.ErrorCode.CHAIN_INFO_CACHE_EMPTY,
3747
+ throw new import_errors13.FuelError(
3748
+ import_errors13.ErrorCode.CHAIN_INFO_CACHE_EMPTY,
3828
3749
  "Chain info cache is empty. Make sure you have called `Provider.create` to initialize the provider."
3829
3750
  );
3830
3751
  }
@@ -3836,8 +3757,8 @@ var _Provider = class {
3836
3757
  getNode() {
3837
3758
  const node = _Provider.nodeInfoCache[this.url];
3838
3759
  if (!node) {
3839
- throw new import_errors14.FuelError(
3840
- import_errors14.ErrorCode.NODE_INFO_CACHE_EMPTY,
3760
+ throw new import_errors13.FuelError(
3761
+ import_errors13.ErrorCode.NODE_INFO_CACHE_EMPTY,
3841
3762
  "Node info cache is empty. Make sure you have called `Provider.create` to initialize the provider."
3842
3763
  );
3843
3764
  }
@@ -3884,8 +3805,8 @@ var _Provider = class {
3884
3805
  static ensureClientVersionIsSupported(nodeInfo) {
3885
3806
  const { isMajorSupported, isMinorSupported, supportedVersion } = (0, import_versions.checkFuelCoreVersionCompatibility)(nodeInfo.nodeVersion);
3886
3807
  if (!isMajorSupported || !isMinorSupported) {
3887
- throw new import_errors14.FuelError(
3888
- import_errors14.FuelError.CODES.UNSUPPORTED_FUEL_CLIENT_VERSION,
3808
+ throw new import_errors13.FuelError(
3809
+ import_errors13.FuelError.CODES.UNSUPPORTED_FUEL_CLIENT_VERSION,
3889
3810
  `Fuel client version: ${nodeInfo.nodeVersion}, Supported version: ${supportedVersion}`
3890
3811
  );
3891
3812
  }
@@ -3948,7 +3869,7 @@ var _Provider = class {
3948
3869
  */
3949
3870
  async getBlockNumber() {
3950
3871
  const { chain } = await this.operations.getChain();
3951
- return (0, import_math15.bn)(chain.latestBlock.header.height, 10);
3872
+ return (0, import_math14.bn)(chain.latestBlock.header.height, 10);
3952
3873
  }
3953
3874
  /**
3954
3875
  * Returns the chain information.
@@ -3958,9 +3879,9 @@ var _Provider = class {
3958
3879
  async fetchNode() {
3959
3880
  const { nodeInfo } = await this.operations.getNodeInfo();
3960
3881
  const processedNodeInfo = {
3961
- maxDepth: (0, import_math15.bn)(nodeInfo.maxDepth),
3962
- maxTx: (0, import_math15.bn)(nodeInfo.maxTx),
3963
- minGasPrice: (0, import_math15.bn)(nodeInfo.minGasPrice),
3882
+ maxDepth: (0, import_math14.bn)(nodeInfo.maxDepth),
3883
+ maxTx: (0, import_math14.bn)(nodeInfo.maxTx),
3884
+ minGasPrice: (0, import_math14.bn)(nodeInfo.minGasPrice),
3964
3885
  nodeVersion: nodeInfo.nodeVersion,
3965
3886
  utxoValidation: nodeInfo.utxoValidation,
3966
3887
  vmBacktrace: nodeInfo.vmBacktrace,
@@ -3990,6 +3911,17 @@ var _Provider = class {
3990
3911
  } = this.getChain();
3991
3912
  return chainId.toNumber();
3992
3913
  }
3914
+ /**
3915
+ * Returns the base asset ID
3916
+ *
3917
+ * @returns A promise that resolves to the base asset ID
3918
+ */
3919
+ getBaseAssetId() {
3920
+ const {
3921
+ consensusParameters: { baseAssetId }
3922
+ } = this.getChain();
3923
+ return baseAssetId;
3924
+ }
3993
3925
  /**
3994
3926
  * Submits a transaction to the chain to be executed.
3995
3927
  *
@@ -4006,17 +3938,17 @@ var _Provider = class {
4006
3938
  if (estimateTxDependencies) {
4007
3939
  await this.estimateTxDependencies(transactionRequest);
4008
3940
  }
4009
- const encodedTransaction = (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes());
3941
+ const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
4010
3942
  let abis;
4011
- if (transactionRequest.type === import_transactions18.TransactionType.Script) {
3943
+ if (transactionRequest.type === import_transactions17.TransactionType.Script) {
4012
3944
  abis = transactionRequest.abis;
4013
3945
  }
4014
3946
  if (awaitExecution) {
4015
3947
  const subscription = this.operations.submitAndAwait({ encodedTransaction });
4016
3948
  for await (const { submitAndAwait } of subscription) {
4017
3949
  if (submitAndAwait.type === "SqueezedOutStatus") {
4018
- throw new import_errors14.FuelError(
4019
- import_errors14.ErrorCode.TRANSACTION_SQUEEZED_OUT,
3950
+ throw new import_errors13.FuelError(
3951
+ import_errors13.ErrorCode.TRANSACTION_SQUEEZED_OUT,
4020
3952
  `Transaction Squeezed Out with reason: ${submitAndAwait.reason}`
4021
3953
  );
4022
3954
  }
@@ -4049,7 +3981,7 @@ var _Provider = class {
4049
3981
  if (estimateTxDependencies) {
4050
3982
  return this.estimateTxDependencies(transactionRequest);
4051
3983
  }
4052
- const encodedTransaction = (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes());
3984
+ const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
4053
3985
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
4054
3986
  encodedTransaction,
4055
3987
  utxoValidation: utxoValidation || false
@@ -4068,13 +4000,13 @@ var _Provider = class {
4068
4000
  async estimatePredicates(transactionRequest) {
4069
4001
  const shouldEstimatePredicates = Boolean(
4070
4002
  transactionRequest.inputs.find(
4071
- (input) => "predicate" in input && input.predicate && !(0, import_utils24.equalBytes)((0, import_utils23.arrayify)(input.predicate), (0, import_utils23.arrayify)("0x")) && new import_math15.BN(input.predicateGasUsed).isZero()
4003
+ (input) => "predicate" in input && input.predicate && !(0, import_utils23.equalBytes)((0, import_utils22.arrayify)(input.predicate), (0, import_utils22.arrayify)("0x")) && new import_math14.BN(input.predicateGasUsed).isZero()
4072
4004
  )
4073
4005
  );
4074
4006
  if (!shouldEstimatePredicates) {
4075
4007
  return transactionRequest;
4076
4008
  }
4077
- const encodedTransaction = (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes());
4009
+ const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
4078
4010
  const response = await this.operations.estimatePredicates({
4079
4011
  encodedTransaction
4080
4012
  });
@@ -4083,7 +4015,7 @@ var _Provider = class {
4083
4015
  } = response;
4084
4016
  if (inputs) {
4085
4017
  inputs.forEach((input, index) => {
4086
- if ("predicateGasUsed" in input && (0, import_math15.bn)(input.predicateGasUsed).gt(0)) {
4018
+ if ("predicateGasUsed" in input && (0, import_math14.bn)(input.predicateGasUsed).gt(0)) {
4087
4019
  transactionRequest.inputs[index].predicateGasUsed = input.predicateGasUsed;
4088
4020
  }
4089
4021
  });
@@ -4104,7 +4036,7 @@ var _Provider = class {
4104
4036
  * @returns A promise.
4105
4037
  */
4106
4038
  async estimateTxDependencies(transactionRequest) {
4107
- if (transactionRequest.type === import_transactions18.TransactionType.Create) {
4039
+ if (transactionRequest.type === import_transactions17.TransactionType.Create) {
4108
4040
  return {
4109
4041
  receipts: [],
4110
4042
  outputVariables: 0,
@@ -4117,7 +4049,7 @@ var _Provider = class {
4117
4049
  let outputVariables = 0;
4118
4050
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
4119
4051
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
4120
- encodedTransaction: (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes()),
4052
+ encodedTransaction: (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes()),
4121
4053
  utxoValidation: false
4122
4054
  });
4123
4055
  receipts = gqlReceipts.map(processGqlReceipt);
@@ -4155,7 +4087,7 @@ var _Provider = class {
4155
4087
  if (estimateTxDependencies) {
4156
4088
  return this.estimateTxDependencies(transactionRequest);
4157
4089
  }
4158
- const encodedTransaction = (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes());
4090
+ const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
4159
4091
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
4160
4092
  encodedTransaction,
4161
4093
  utxoValidation: true
@@ -4189,14 +4121,14 @@ var _Provider = class {
4189
4121
  const txRequestClone = (0, import_ramda3.clone)(transactionRequestify(transactionRequestLike));
4190
4122
  const chainInfo = this.getChain();
4191
4123
  const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
4192
- const gasPrice = (0, import_math15.max)(txRequestClone.gasPrice, minGasPrice);
4193
- const isScriptTransaction = txRequestClone.type === import_transactions18.TransactionType.Script;
4124
+ const gasPrice = (0, import_math14.max)(txRequestClone.gasPrice, minGasPrice);
4125
+ const isScriptTransaction = txRequestClone.type === import_transactions17.TransactionType.Script;
4194
4126
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
4195
4127
  const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
4196
4128
  txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
4197
4129
  if (estimatePredicates) {
4198
4130
  if (isScriptTransaction) {
4199
- txRequestClone.gasLimit = (0, import_math15.bn)(0);
4131
+ txRequestClone.gasLimit = (0, import_math14.bn)(0);
4200
4132
  }
4201
4133
  if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
4202
4134
  resourcesOwner.populateTransactionPredicateData(txRequestClone);
@@ -4212,8 +4144,8 @@ var _Provider = class {
4212
4144
  let missingContractIds = [];
4213
4145
  let outputVariables = 0;
4214
4146
  if (isScriptTransaction && estimateTxDependencies) {
4215
- txRequestClone.gasPrice = (0, import_math15.bn)(0);
4216
- txRequestClone.gasLimit = (0, import_math15.bn)(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
4147
+ txRequestClone.gasPrice = (0, import_math14.bn)(0);
4148
+ txRequestClone.gasLimit = (0, import_math14.bn)(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
4217
4149
  const result = await this.estimateTxDependencies(txRequestClone);
4218
4150
  receipts = result.receipts;
4219
4151
  outputVariables = result.outputVariables;
@@ -4269,17 +4201,17 @@ var _Provider = class {
4269
4201
  const result = await this.operations.getCoins({
4270
4202
  first: 10,
4271
4203
  ...paginationArgs,
4272
- filter: { owner: ownerAddress.toB256(), assetId: assetId && (0, import_utils23.hexlify)(assetId) }
4204
+ filter: { owner: ownerAddress.toB256(), assetId: assetId && (0, import_utils22.hexlify)(assetId) }
4273
4205
  });
4274
4206
  const coins = result.coins.edges.map((edge) => edge.node);
4275
4207
  return coins.map((coin) => ({
4276
4208
  id: coin.utxoId,
4277
4209
  assetId: coin.assetId,
4278
- amount: (0, import_math15.bn)(coin.amount),
4210
+ amount: (0, import_math14.bn)(coin.amount),
4279
4211
  owner: import_address3.Address.fromAddressOrString(coin.owner),
4280
- maturity: (0, import_math15.bn)(coin.maturity).toNumber(),
4281
- blockCreated: (0, import_math15.bn)(coin.blockCreated),
4282
- txCreatedIdx: (0, import_math15.bn)(coin.txCreatedIdx)
4212
+ maturity: (0, import_math14.bn)(coin.maturity).toNumber(),
4213
+ blockCreated: (0, import_math14.bn)(coin.blockCreated),
4214
+ txCreatedIdx: (0, import_math14.bn)(coin.txCreatedIdx)
4283
4215
  }));
4284
4216
  }
4285
4217
  /**
@@ -4293,19 +4225,19 @@ var _Provider = class {
4293
4225
  async getResourcesToSpend(owner, quantities, excludedIds) {
4294
4226
  const ownerAddress = import_address3.Address.fromAddressOrString(owner);
4295
4227
  const excludeInput = {
4296
- messages: excludedIds?.messages?.map((nonce) => (0, import_utils23.hexlify)(nonce)) || [],
4297
- utxos: excludedIds?.utxos?.map((id) => (0, import_utils23.hexlify)(id)) || []
4228
+ messages: excludedIds?.messages?.map((nonce) => (0, import_utils22.hexlify)(nonce)) || [],
4229
+ utxos: excludedIds?.utxos?.map((id) => (0, import_utils22.hexlify)(id)) || []
4298
4230
  };
4299
4231
  if (this.cache) {
4300
4232
  const uniqueUtxos = new Set(
4301
- excludeInput.utxos.concat(this.cache?.getActiveData().map((id) => (0, import_utils23.hexlify)(id)))
4233
+ excludeInput.utxos.concat(this.cache?.getActiveData().map((id) => (0, import_utils22.hexlify)(id)))
4302
4234
  );
4303
4235
  excludeInput.utxos = Array.from(uniqueUtxos);
4304
4236
  }
4305
4237
  const coinsQuery = {
4306
4238
  owner: ownerAddress.toB256(),
4307
4239
  queryPerAsset: quantities.map(coinQuantityfy).map(({ assetId, amount, max: maxPerAsset }) => ({
4308
- assetId: (0, import_utils23.hexlify)(assetId),
4240
+ assetId: (0, import_utils22.hexlify)(assetId),
4309
4241
  amount: amount.toString(10),
4310
4242
  max: maxPerAsset ? maxPerAsset.toString(10) : void 0
4311
4243
  })),
@@ -4316,9 +4248,9 @@ var _Provider = class {
4316
4248
  switch (coin.__typename) {
4317
4249
  case "MessageCoin":
4318
4250
  return {
4319
- amount: (0, import_math15.bn)(coin.amount),
4251
+ amount: (0, import_math14.bn)(coin.amount),
4320
4252
  assetId: coin.assetId,
4321
- daHeight: (0, import_math15.bn)(coin.daHeight),
4253
+ daHeight: (0, import_math14.bn)(coin.daHeight),
4322
4254
  sender: import_address3.Address.fromAddressOrString(coin.sender),
4323
4255
  recipient: import_address3.Address.fromAddressOrString(coin.recipient),
4324
4256
  nonce: coin.nonce
@@ -4326,12 +4258,12 @@ var _Provider = class {
4326
4258
  case "Coin":
4327
4259
  return {
4328
4260
  id: coin.utxoId,
4329
- amount: (0, import_math15.bn)(coin.amount),
4261
+ amount: (0, import_math14.bn)(coin.amount),
4330
4262
  assetId: coin.assetId,
4331
4263
  owner: import_address3.Address.fromAddressOrString(coin.owner),
4332
- maturity: (0, import_math15.bn)(coin.maturity).toNumber(),
4333
- blockCreated: (0, import_math15.bn)(coin.blockCreated),
4334
- txCreatedIdx: (0, import_math15.bn)(coin.txCreatedIdx)
4264
+ maturity: (0, import_math14.bn)(coin.maturity).toNumber(),
4265
+ blockCreated: (0, import_math14.bn)(coin.blockCreated),
4266
+ txCreatedIdx: (0, import_math14.bn)(coin.txCreatedIdx)
4335
4267
  };
4336
4268
  default:
4337
4269
  return null;
@@ -4348,13 +4280,13 @@ var _Provider = class {
4348
4280
  async getBlock(idOrHeight) {
4349
4281
  let variables;
4350
4282
  if (typeof idOrHeight === "number") {
4351
- variables = { height: (0, import_math15.bn)(idOrHeight).toString(10) };
4283
+ variables = { height: (0, import_math14.bn)(idOrHeight).toString(10) };
4352
4284
  } else if (idOrHeight === "latest") {
4353
4285
  variables = { height: (await this.getBlockNumber()).toString(10) };
4354
4286
  } else if (idOrHeight.length === 66) {
4355
4287
  variables = { blockId: idOrHeight };
4356
4288
  } else {
4357
- variables = { blockId: (0, import_math15.bn)(idOrHeight).toString(10) };
4289
+ variables = { blockId: (0, import_math14.bn)(idOrHeight).toString(10) };
4358
4290
  }
4359
4291
  const { block } = await this.operations.getBlock(variables);
4360
4292
  if (!block) {
@@ -4362,7 +4294,7 @@ var _Provider = class {
4362
4294
  }
4363
4295
  return {
4364
4296
  id: block.id,
4365
- height: (0, import_math15.bn)(block.header.height),
4297
+ height: (0, import_math14.bn)(block.header.height),
4366
4298
  time: block.header.time,
4367
4299
  transactionIds: block.transactions.map((tx) => tx.id)
4368
4300
  };
@@ -4377,7 +4309,7 @@ var _Provider = class {
4377
4309
  const { blocks: fetchedData } = await this.operations.getBlocks(params);
4378
4310
  const blocks = fetchedData.edges.map(({ node: block }) => ({
4379
4311
  id: block.id,
4380
- height: (0, import_math15.bn)(block.header.height),
4312
+ height: (0, import_math14.bn)(block.header.height),
4381
4313
  time: block.header.time,
4382
4314
  transactionIds: block.transactions.map((tx) => tx.id)
4383
4315
  }));
@@ -4392,7 +4324,7 @@ var _Provider = class {
4392
4324
  async getBlockWithTransactions(idOrHeight) {
4393
4325
  let variables;
4394
4326
  if (typeof idOrHeight === "number") {
4395
- variables = { blockHeight: (0, import_math15.bn)(idOrHeight).toString(10) };
4327
+ variables = { blockHeight: (0, import_math14.bn)(idOrHeight).toString(10) };
4396
4328
  } else if (idOrHeight === "latest") {
4397
4329
  variables = { blockHeight: (await this.getBlockNumber()).toString() };
4398
4330
  } else {
@@ -4404,11 +4336,11 @@ var _Provider = class {
4404
4336
  }
4405
4337
  return {
4406
4338
  id: block.id,
4407
- height: (0, import_math15.bn)(block.header.height, 10),
4339
+ height: (0, import_math14.bn)(block.header.height, 10),
4408
4340
  time: block.header.time,
4409
4341
  transactionIds: block.transactions.map((tx) => tx.id),
4410
4342
  transactions: block.transactions.map(
4411
- (tx) => new import_transactions18.TransactionCoder().decode((0, import_utils23.arrayify)(tx.rawPayload), 0)?.[0]
4343
+ (tx) => new import_transactions17.TransactionCoder().decode((0, import_utils22.arrayify)(tx.rawPayload), 0)?.[0]
4412
4344
  )
4413
4345
  };
4414
4346
  }
@@ -4423,8 +4355,8 @@ var _Provider = class {
4423
4355
  if (!transaction) {
4424
4356
  return null;
4425
4357
  }
4426
- return new import_transactions18.TransactionCoder().decode(
4427
- (0, import_utils23.arrayify)(transaction.rawPayload),
4358
+ return new import_transactions17.TransactionCoder().decode(
4359
+ (0, import_utils22.arrayify)(transaction.rawPayload),
4428
4360
  0
4429
4361
  )?.[0];
4430
4362
  }
@@ -4451,9 +4383,9 @@ var _Provider = class {
4451
4383
  async getContractBalance(contractId, assetId) {
4452
4384
  const { contractBalance } = await this.operations.getContractBalance({
4453
4385
  contract: import_address3.Address.fromAddressOrString(contractId).toB256(),
4454
- asset: (0, import_utils23.hexlify)(assetId)
4386
+ asset: (0, import_utils22.hexlify)(assetId)
4455
4387
  });
4456
- return (0, import_math15.bn)(contractBalance.amount, 10);
4388
+ return (0, import_math14.bn)(contractBalance.amount, 10);
4457
4389
  }
4458
4390
  /**
4459
4391
  * Returns the balance for the given owner for the given asset ID.
@@ -4465,9 +4397,9 @@ var _Provider = class {
4465
4397
  async getBalance(owner, assetId) {
4466
4398
  const { balance } = await this.operations.getBalance({
4467
4399
  owner: import_address3.Address.fromAddressOrString(owner).toB256(),
4468
- assetId: (0, import_utils23.hexlify)(assetId)
4400
+ assetId: (0, import_utils22.hexlify)(assetId)
4469
4401
  });
4470
- return (0, import_math15.bn)(balance.amount, 10);
4402
+ return (0, import_math14.bn)(balance.amount, 10);
4471
4403
  }
4472
4404
  /**
4473
4405
  * Returns balances for the given owner.
@@ -4485,7 +4417,7 @@ var _Provider = class {
4485
4417
  const balances = result.balances.edges.map((edge) => edge.node);
4486
4418
  return balances.map((balance) => ({
4487
4419
  assetId: balance.assetId,
4488
- amount: (0, import_math15.bn)(balance.amount)
4420
+ amount: (0, import_math14.bn)(balance.amount)
4489
4421
  }));
4490
4422
  }
4491
4423
  /**
@@ -4503,19 +4435,19 @@ var _Provider = class {
4503
4435
  });
4504
4436
  const messages = result.messages.edges.map((edge) => edge.node);
4505
4437
  return messages.map((message) => ({
4506
- messageId: import_transactions18.InputMessageCoder.getMessageId({
4438
+ messageId: import_transactions17.InputMessageCoder.getMessageId({
4507
4439
  sender: message.sender,
4508
4440
  recipient: message.recipient,
4509
4441
  nonce: message.nonce,
4510
- amount: (0, import_math15.bn)(message.amount),
4442
+ amount: (0, import_math14.bn)(message.amount),
4511
4443
  data: message.data
4512
4444
  }),
4513
4445
  sender: import_address3.Address.fromAddressOrString(message.sender),
4514
4446
  recipient: import_address3.Address.fromAddressOrString(message.recipient),
4515
4447
  nonce: message.nonce,
4516
- amount: (0, import_math15.bn)(message.amount),
4517
- data: import_transactions18.InputMessageCoder.decodeData(message.data),
4518
- daHeight: (0, import_math15.bn)(message.daHeight)
4448
+ amount: (0, import_math14.bn)(message.amount),
4449
+ data: import_transactions17.InputMessageCoder.decodeData(message.data),
4450
+ daHeight: (0, import_math14.bn)(message.daHeight)
4519
4451
  }));
4520
4452
  }
4521
4453
  /**
@@ -4533,8 +4465,8 @@ var _Provider = class {
4533
4465
  nonce
4534
4466
  };
4535
4467
  if (commitBlockId && commitBlockHeight) {
4536
- throw new import_errors14.FuelError(
4537
- import_errors14.ErrorCode.INVALID_INPUT_PARAMETERS,
4468
+ throw new import_errors13.FuelError(
4469
+ import_errors13.ErrorCode.INVALID_INPUT_PARAMETERS,
4538
4470
  "commitBlockId and commitBlockHeight cannot be used together"
4539
4471
  );
4540
4472
  }
@@ -4568,41 +4500,41 @@ var _Provider = class {
4568
4500
  } = result.messageProof;
4569
4501
  return {
4570
4502
  messageProof: {
4571
- proofIndex: (0, import_math15.bn)(messageProof.proofIndex),
4503
+ proofIndex: (0, import_math14.bn)(messageProof.proofIndex),
4572
4504
  proofSet: messageProof.proofSet
4573
4505
  },
4574
4506
  blockProof: {
4575
- proofIndex: (0, import_math15.bn)(blockProof.proofIndex),
4507
+ proofIndex: (0, import_math14.bn)(blockProof.proofIndex),
4576
4508
  proofSet: blockProof.proofSet
4577
4509
  },
4578
4510
  messageBlockHeader: {
4579
4511
  id: messageBlockHeader.id,
4580
- daHeight: (0, import_math15.bn)(messageBlockHeader.daHeight),
4581
- transactionsCount: (0, import_math15.bn)(messageBlockHeader.transactionsCount),
4512
+ daHeight: (0, import_math14.bn)(messageBlockHeader.daHeight),
4513
+ transactionsCount: (0, import_math14.bn)(messageBlockHeader.transactionsCount),
4582
4514
  transactionsRoot: messageBlockHeader.transactionsRoot,
4583
- height: (0, import_math15.bn)(messageBlockHeader.height),
4515
+ height: (0, import_math14.bn)(messageBlockHeader.height),
4584
4516
  prevRoot: messageBlockHeader.prevRoot,
4585
4517
  time: messageBlockHeader.time,
4586
4518
  applicationHash: messageBlockHeader.applicationHash,
4587
4519
  messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
4588
- messageReceiptCount: (0, import_math15.bn)(messageBlockHeader.messageReceiptCount)
4520
+ messageReceiptCount: (0, import_math14.bn)(messageBlockHeader.messageReceiptCount)
4589
4521
  },
4590
4522
  commitBlockHeader: {
4591
4523
  id: commitBlockHeader.id,
4592
- daHeight: (0, import_math15.bn)(commitBlockHeader.daHeight),
4593
- transactionsCount: (0, import_math15.bn)(commitBlockHeader.transactionsCount),
4524
+ daHeight: (0, import_math14.bn)(commitBlockHeader.daHeight),
4525
+ transactionsCount: (0, import_math14.bn)(commitBlockHeader.transactionsCount),
4594
4526
  transactionsRoot: commitBlockHeader.transactionsRoot,
4595
- height: (0, import_math15.bn)(commitBlockHeader.height),
4527
+ height: (0, import_math14.bn)(commitBlockHeader.height),
4596
4528
  prevRoot: commitBlockHeader.prevRoot,
4597
4529
  time: commitBlockHeader.time,
4598
4530
  applicationHash: commitBlockHeader.applicationHash,
4599
4531
  messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
4600
- messageReceiptCount: (0, import_math15.bn)(commitBlockHeader.messageReceiptCount)
4532
+ messageReceiptCount: (0, import_math14.bn)(commitBlockHeader.messageReceiptCount)
4601
4533
  },
4602
4534
  sender: import_address3.Address.fromAddressOrString(sender),
4603
4535
  recipient: import_address3.Address.fromAddressOrString(recipient),
4604
4536
  nonce,
4605
- amount: (0, import_math15.bn)(amount),
4537
+ amount: (0, import_math14.bn)(amount),
4606
4538
  data
4607
4539
  };
4608
4540
  }
@@ -4625,10 +4557,10 @@ var _Provider = class {
4625
4557
  */
4626
4558
  async produceBlocks(amount, startTime) {
4627
4559
  const { produceBlocks: latestBlockHeight } = await this.operations.produceBlocks({
4628
- blocksToProduce: (0, import_math15.bn)(amount).toString(10),
4629
- startTimestamp: startTime ? import_utils23.DateTime.fromUnixMilliseconds(startTime).toTai64() : void 0
4560
+ blocksToProduce: (0, import_math14.bn)(amount).toString(10),
4561
+ startTimestamp: startTime ? import_utils22.DateTime.fromUnixMilliseconds(startTime).toTai64() : void 0
4630
4562
  });
4631
- return (0, import_math15.bn)(latestBlockHeight);
4563
+ return (0, import_math14.bn)(latestBlockHeight);
4632
4564
  }
4633
4565
  // eslint-disable-next-line @typescript-eslint/require-await
4634
4566
  async getTransactionResponse(transactionId) {
@@ -4642,7 +4574,7 @@ cacheInputs_fn = function(inputs) {
4642
4574
  return;
4643
4575
  }
4644
4576
  inputs.forEach((input) => {
4645
- if (input.type === import_transactions18.InputType.Coin) {
4577
+ if (input.type === import_transactions17.InputType.Coin) {
4646
4578
  this.cache?.set(input.id);
4647
4579
  }
4648
4580
  });
@@ -4651,23 +4583,23 @@ __publicField(Provider, "chainInfoCache", {});
4651
4583
  __publicField(Provider, "nodeInfoCache", {});
4652
4584
 
4653
4585
  // src/providers/transaction-summary/get-transaction-summary.ts
4654
- var import_errors15 = require("@fuel-ts/errors");
4655
- var import_math16 = require("@fuel-ts/math");
4656
- var import_transactions19 = require("@fuel-ts/transactions");
4657
- var import_utils26 = require("@fuel-ts/utils");
4586
+ var import_errors14 = require("@fuel-ts/errors");
4587
+ var import_math15 = require("@fuel-ts/math");
4588
+ var import_transactions18 = require("@fuel-ts/transactions");
4589
+ var import_utils25 = require("@fuel-ts/utils");
4658
4590
  async function getTransactionSummary(params) {
4659
4591
  const { id, provider, abiMap } = params;
4660
4592
  const { transaction: gqlTransaction } = await provider.operations.getTransactionWithReceipts({
4661
4593
  transactionId: id
4662
4594
  });
4663
4595
  if (!gqlTransaction) {
4664
- throw new import_errors15.FuelError(
4665
- import_errors15.ErrorCode.TRANSACTION_NOT_FOUND,
4596
+ throw new import_errors14.FuelError(
4597
+ import_errors14.ErrorCode.TRANSACTION_NOT_FOUND,
4666
4598
  `Transaction not found for given id: ${id}.`
4667
4599
  );
4668
4600
  }
4669
- const [decodedTransaction] = new import_transactions19.TransactionCoder().decode(
4670
- (0, import_utils26.arrayify)(gqlTransaction.rawPayload),
4601
+ const [decodedTransaction] = new import_transactions18.TransactionCoder().decode(
4602
+ (0, import_utils25.arrayify)(gqlTransaction.rawPayload),
4671
4603
  0
4672
4604
  );
4673
4605
  const receipts = gqlTransaction.receipts?.map(processGqlReceipt) || [];
@@ -4678,10 +4610,10 @@ async function getTransactionSummary(params) {
4678
4610
  id: gqlTransaction.id,
4679
4611
  receipts,
4680
4612
  transaction: decodedTransaction,
4681
- transactionBytes: (0, import_utils26.arrayify)(gqlTransaction.rawPayload),
4613
+ transactionBytes: (0, import_utils25.arrayify)(gqlTransaction.rawPayload),
4682
4614
  gqlTransactionStatus: gqlTransaction.status,
4683
- gasPerByte: (0, import_math16.bn)(gasPerByte),
4684
- gasPriceFactor: (0, import_math16.bn)(gasPriceFactor),
4615
+ gasPerByte: (0, import_math15.bn)(gasPerByte),
4616
+ gasPriceFactor: (0, import_math15.bn)(gasPriceFactor),
4685
4617
  abiMap,
4686
4618
  maxInputs,
4687
4619
  gasCosts
@@ -4720,13 +4652,13 @@ async function getTransactionsSummaries(params) {
4720
4652
  const transactions = edges.map((edge) => {
4721
4653
  const { node: gqlTransaction } = edge;
4722
4654
  const { id, rawPayload, receipts: gqlReceipts, status } = gqlTransaction;
4723
- const [decodedTransaction] = new import_transactions19.TransactionCoder().decode((0, import_utils26.arrayify)(rawPayload), 0);
4655
+ const [decodedTransaction] = new import_transactions18.TransactionCoder().decode((0, import_utils25.arrayify)(rawPayload), 0);
4724
4656
  const receipts = gqlReceipts?.map(processGqlReceipt) || [];
4725
4657
  const transactionSummary = assembleTransactionSummary({
4726
4658
  id,
4727
4659
  receipts,
4728
4660
  transaction: decodedTransaction,
4729
- transactionBytes: (0, import_utils26.arrayify)(rawPayload),
4661
+ transactionBytes: (0, import_utils25.arrayify)(rawPayload),
4730
4662
  gqlTransactionStatus: status,
4731
4663
  abiMap,
4732
4664
  gasPerByte,
@@ -4869,17 +4801,17 @@ var assets = [
4869
4801
 
4870
4802
  // src/utils/formatTransferToContractScriptData.ts
4871
4803
  var import_abi_coder4 = require("@fuel-ts/abi-coder");
4872
- var import_math17 = require("@fuel-ts/math");
4873
- var import_utils27 = require("@fuel-ts/utils");
4804
+ var import_math16 = require("@fuel-ts/math");
4805
+ var import_utils26 = require("@fuel-ts/utils");
4874
4806
  var asm = __toESM(require("@fuels/vm-asm"));
4875
4807
  var formatTransferToContractScriptData = (params) => {
4876
4808
  const { assetId, amountToTransfer, hexlifiedContractId } = params;
4877
4809
  const numberCoder = new import_abi_coder4.BigNumberCoder("u64");
4878
- const encoded = numberCoder.encode(new import_math17.BN(amountToTransfer).toNumber());
4810
+ const encoded = numberCoder.encode(new import_math16.BN(amountToTransfer).toNumber());
4879
4811
  const scriptData = Uint8Array.from([
4880
- ...(0, import_utils27.arrayify)(hexlifiedContractId),
4812
+ ...(0, import_utils26.arrayify)(hexlifiedContractId),
4881
4813
  ...encoded,
4882
- ...(0, import_utils27.arrayify)(assetId)
4814
+ ...(0, import_utils26.arrayify)(assetId)
4883
4815
  ]);
4884
4816
  return scriptData;
4885
4817
  };
@@ -4935,7 +4867,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4935
4867
  */
4936
4868
  get provider() {
4937
4869
  if (!this._provider) {
4938
- throw new import_errors16.FuelError(import_errors16.ErrorCode.MISSING_PROVIDER, "Provider not set");
4870
+ throw new import_errors15.FuelError(import_errors15.ErrorCode.MISSING_PROVIDER, "Provider not set");
4939
4871
  }
4940
4872
  return this._provider;
4941
4873
  }
@@ -4987,8 +4919,8 @@ var Account = class extends import_interfaces.AbstractAccount {
4987
4919
  if (!hasNextPage) {
4988
4920
  break;
4989
4921
  }
4990
- throw new import_errors16.FuelError(
4991
- import_errors16.ErrorCode.NOT_SUPPORTED,
4922
+ throw new import_errors15.FuelError(
4923
+ import_errors15.ErrorCode.NOT_SUPPORTED,
4992
4924
  `Wallets containing more than ${pageSize} coins exceed the current supported limit.`
4993
4925
  );
4994
4926
  }
@@ -5013,8 +4945,8 @@ var Account = class extends import_interfaces.AbstractAccount {
5013
4945
  if (!hasNextPage) {
5014
4946
  break;
5015
4947
  }
5016
- throw new import_errors16.FuelError(
5017
- import_errors16.ErrorCode.NOT_SUPPORTED,
4948
+ throw new import_errors15.FuelError(
4949
+ import_errors15.ErrorCode.NOT_SUPPORTED,
5018
4950
  `Wallets containing more than ${pageSize} messages exceed the current supported limit.`
5019
4951
  );
5020
4952
  }
@@ -5026,8 +4958,9 @@ var Account = class extends import_interfaces.AbstractAccount {
5026
4958
  * @param assetId - The asset ID to check the balance for.
5027
4959
  * @returns A promise that resolves to the balance amount.
5028
4960
  */
5029
- async getBalance(assetId = import_configs12.BaseAssetId) {
5030
- const amount = await this.provider.getBalance(this.address, assetId);
4961
+ async getBalance(assetId) {
4962
+ const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
4963
+ const amount = await this.provider.getBalance(this.address, assetIdToFetch);
5031
4964
  return amount;
5032
4965
  }
5033
4966
  /**
@@ -5049,8 +4982,8 @@ var Account = class extends import_interfaces.AbstractAccount {
5049
4982
  if (!hasNextPage) {
5050
4983
  break;
5051
4984
  }
5052
- throw new import_errors16.FuelError(
5053
- import_errors16.ErrorCode.NOT_SUPPORTED,
4985
+ throw new import_errors15.FuelError(
4986
+ import_errors15.ErrorCode.NOT_SUPPORTED,
5054
4987
  `Wallets containing more than ${pageSize} balances exceed the current supported limit.`
5055
4988
  );
5056
4989
  }
@@ -5065,16 +4998,17 @@ var Account = class extends import_interfaces.AbstractAccount {
5065
4998
  * @returns A promise that resolves when the resources are added to the transaction.
5066
4999
  */
5067
5000
  async fund(request, coinQuantities, fee) {
5001
+ const baseAssetId = this.provider.getBaseAssetId();
5068
5002
  const updatedQuantities = addAmountToAsset({
5069
- amount: (0, import_math18.bn)(fee),
5070
- assetId: import_configs12.BaseAssetId,
5003
+ amount: (0, import_math17.bn)(fee),
5004
+ assetId: baseAssetId,
5071
5005
  coinQuantities
5072
5006
  });
5073
5007
  const quantitiesDict = {};
5074
5008
  updatedQuantities.forEach(({ amount, assetId }) => {
5075
5009
  quantitiesDict[assetId] = {
5076
5010
  required: amount,
5077
- owned: (0, import_math18.bn)(0)
5011
+ owned: (0, import_math17.bn)(0)
5078
5012
  };
5079
5013
  });
5080
5014
  const cachedUtxos = [];
@@ -5087,12 +5021,12 @@ var Account = class extends import_interfaces.AbstractAccount {
5087
5021
  if (isCoin2) {
5088
5022
  const assetId = String(input.assetId);
5089
5023
  if (input.owner === owner && quantitiesDict[assetId]) {
5090
- const amount = (0, import_math18.bn)(input.amount);
5024
+ const amount = (0, import_math17.bn)(input.amount);
5091
5025
  quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
5092
5026
  cachedUtxos.push(input.id);
5093
5027
  }
5094
- } else if (input.recipient === owner && input.amount && quantitiesDict[import_configs12.BaseAssetId]) {
5095
- quantitiesDict[import_configs12.BaseAssetId].owned = quantitiesDict[import_configs12.BaseAssetId].owned.add(input.amount);
5028
+ } else if (input.recipient === owner && input.amount && quantitiesDict[baseAssetId]) {
5029
+ quantitiesDict[baseAssetId].owned = quantitiesDict[baseAssetId].owned.add(input.amount);
5096
5030
  cachedMessages.push(input.nonce);
5097
5031
  }
5098
5032
  }
@@ -5124,17 +5058,18 @@ var Account = class extends import_interfaces.AbstractAccount {
5124
5058
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
5125
5059
  * @returns A promise that resolves to the prepared transaction request.
5126
5060
  */
5127
- async createTransfer(destination, amount, assetId = import_configs12.BaseAssetId, txParams = {}) {
5061
+ async createTransfer(destination, amount, assetId, txParams = {}) {
5128
5062
  const { minGasPrice } = this.provider.getGasConfig();
5063
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
5129
5064
  const params = { gasPrice: minGasPrice, ...txParams };
5130
5065
  const request = new ScriptTransactionRequest(params);
5131
- request.addCoinOutput(import_address4.Address.fromAddressOrString(destination), amount, assetId);
5066
+ request.addCoinOutput(import_address4.Address.fromAddressOrString(destination), amount, assetIdToTransfer);
5132
5067
  const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
5133
5068
  estimateTxDependencies: true,
5134
5069
  resourcesOwner: this
5135
5070
  });
5136
- request.gasPrice = (0, import_math18.bn)(txParams.gasPrice ?? minGasPrice);
5137
- request.gasLimit = (0, import_math18.bn)(txParams.gasLimit ?? gasUsed);
5071
+ request.gasPrice = (0, import_math17.bn)(txParams.gasPrice ?? minGasPrice);
5072
+ request.gasLimit = (0, import_math17.bn)(txParams.gasLimit ?? gasUsed);
5138
5073
  this.validateGas({
5139
5074
  gasUsed,
5140
5075
  gasPrice: request.gasPrice,
@@ -5154,14 +5089,15 @@ var Account = class extends import_interfaces.AbstractAccount {
5154
5089
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
5155
5090
  * @returns A promise that resolves to the transaction response.
5156
5091
  */
5157
- async transfer(destination, amount, assetId = import_configs12.BaseAssetId, txParams = {}) {
5158
- if ((0, import_math18.bn)(amount).lte(0)) {
5159
- throw new import_errors16.FuelError(
5160
- import_errors16.ErrorCode.INVALID_TRANSFER_AMOUNT,
5092
+ async transfer(destination, amount, assetId, txParams = {}) {
5093
+ if ((0, import_math17.bn)(amount).lte(0)) {
5094
+ throw new import_errors15.FuelError(
5095
+ import_errors15.ErrorCode.INVALID_TRANSFER_AMOUNT,
5161
5096
  "Transfer amount must be a positive number."
5162
5097
  );
5163
5098
  }
5164
- const request = await this.createTransfer(destination, amount, assetId, txParams);
5099
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
5100
+ const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
5165
5101
  return this.sendTransaction(request, { estimateTxDependencies: false });
5166
5102
  }
5167
5103
  /**
@@ -5173,20 +5109,21 @@ var Account = class extends import_interfaces.AbstractAccount {
5173
5109
  * @param txParams - The optional transaction parameters.
5174
5110
  * @returns A promise that resolves to the transaction response.
5175
5111
  */
5176
- async transferToContract(contractId, amount, assetId = import_configs12.BaseAssetId, txParams = {}) {
5177
- if ((0, import_math18.bn)(amount).lte(0)) {
5178
- throw new import_errors16.FuelError(
5179
- import_errors16.ErrorCode.INVALID_TRANSFER_AMOUNT,
5112
+ async transferToContract(contractId, amount, assetId, txParams = {}) {
5113
+ if ((0, import_math17.bn)(amount).lte(0)) {
5114
+ throw new import_errors15.FuelError(
5115
+ import_errors15.ErrorCode.INVALID_TRANSFER_AMOUNT,
5180
5116
  "Transfer amount must be a positive number."
5181
5117
  );
5182
5118
  }
5183
5119
  const contractAddress = import_address4.Address.fromAddressOrString(contractId);
5184
5120
  const { minGasPrice } = this.provider.getGasConfig();
5121
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
5185
5122
  const params = { gasPrice: minGasPrice, ...txParams };
5186
5123
  const { script, scriptData } = await assembleTransferToContractScript({
5187
5124
  hexlifiedContractId: contractAddress.toB256(),
5188
- amountToTransfer: (0, import_math18.bn)(amount),
5189
- assetId
5125
+ amountToTransfer: (0, import_math17.bn)(amount),
5126
+ assetId: assetIdToTransfer
5190
5127
  });
5191
5128
  const request = new ScriptTransactionRequest({
5192
5129
  ...params,
@@ -5196,9 +5133,9 @@ var Account = class extends import_interfaces.AbstractAccount {
5196
5133
  request.addContractInputAndOutput(contractAddress);
5197
5134
  const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
5198
5135
  request,
5199
- [{ amount: (0, import_math18.bn)(amount), assetId: String(assetId) }]
5136
+ [{ amount: (0, import_math17.bn)(amount), assetId: String(assetIdToTransfer) }]
5200
5137
  );
5201
- request.gasLimit = (0, import_math18.bn)(params.gasLimit ?? gasUsed);
5138
+ request.gasLimit = (0, import_math17.bn)(params.gasLimit ?? gasUsed);
5202
5139
  this.validateGas({
5203
5140
  gasUsed,
5204
5141
  gasPrice: request.gasPrice,
@@ -5218,26 +5155,27 @@ var Account = class extends import_interfaces.AbstractAccount {
5218
5155
  */
5219
5156
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
5220
5157
  const { minGasPrice } = this.provider.getGasConfig();
5158
+ const baseAssetId = this.provider.getBaseAssetId();
5221
5159
  const recipientAddress = import_address4.Address.fromAddressOrString(recipient);
5222
- const recipientDataArray = (0, import_utils28.arrayify)(
5160
+ const recipientDataArray = (0, import_utils27.arrayify)(
5223
5161
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
5224
5162
  );
5225
- const amountDataArray = (0, import_utils28.arrayify)(
5226
- "0x".concat((0, import_math18.bn)(amount).toHex().substring(2).padStart(16, "0"))
5163
+ const amountDataArray = (0, import_utils27.arrayify)(
5164
+ "0x".concat((0, import_math17.bn)(amount).toHex().substring(2).padStart(16, "0"))
5227
5165
  );
5228
5166
  const script = new Uint8Array([
5229
- ...(0, import_utils28.arrayify)(withdrawScript.bytes),
5167
+ ...(0, import_utils27.arrayify)(withdrawScript.bytes),
5230
5168
  ...recipientDataArray,
5231
5169
  ...amountDataArray
5232
5170
  ]);
5233
5171
  const params = { script, gasPrice: minGasPrice, ...txParams };
5234
5172
  const request = new ScriptTransactionRequest(params);
5235
- const forwardingQuantities = [{ amount: (0, import_math18.bn)(amount), assetId: import_configs12.BaseAssetId }];
5173
+ const forwardingQuantities = [{ amount: (0, import_math17.bn)(amount), assetId: baseAssetId }];
5236
5174
  const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
5237
5175
  request,
5238
5176
  forwardingQuantities
5239
5177
  );
5240
- request.gasLimit = (0, import_math18.bn)(params.gasLimit ?? gasUsed);
5178
+ request.gasLimit = (0, import_math17.bn)(params.gasLimit ?? gasUsed);
5241
5179
  this.validateGas({
5242
5180
  gasUsed,
5243
5181
  gasPrice: request.gasPrice,
@@ -5249,7 +5187,7 @@ var Account = class extends import_interfaces.AbstractAccount {
5249
5187
  }
5250
5188
  async signMessage(message) {
5251
5189
  if (!this._connector) {
5252
- throw new import_errors16.FuelError(import_errors16.ErrorCode.MISSING_CONNECTOR, "A connector is required to sign messages.");
5190
+ throw new import_errors15.FuelError(import_errors15.ErrorCode.MISSING_CONNECTOR, "A connector is required to sign messages.");
5253
5191
  }
5254
5192
  return this._connector.signMessage(this.address.toString(), message);
5255
5193
  }
@@ -5261,8 +5199,8 @@ var Account = class extends import_interfaces.AbstractAccount {
5261
5199
  */
5262
5200
  async signTransaction(transactionRequestLike) {
5263
5201
  if (!this._connector) {
5264
- throw new import_errors16.FuelError(
5265
- import_errors16.ErrorCode.MISSING_CONNECTOR,
5202
+ throw new import_errors15.FuelError(
5203
+ import_errors15.ErrorCode.MISSING_CONNECTOR,
5266
5204
  "A connector is required to sign transactions."
5267
5205
  );
5268
5206
  }
@@ -5309,14 +5247,14 @@ var Account = class extends import_interfaces.AbstractAccount {
5309
5247
  minGasPrice
5310
5248
  }) {
5311
5249
  if (minGasPrice.gt(gasPrice)) {
5312
- throw new import_errors16.FuelError(
5313
- import_errors16.ErrorCode.GAS_PRICE_TOO_LOW,
5250
+ throw new import_errors15.FuelError(
5251
+ import_errors15.ErrorCode.GAS_PRICE_TOO_LOW,
5314
5252
  `Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
5315
5253
  );
5316
5254
  }
5317
5255
  if (gasUsed.gt(gasLimit)) {
5318
- throw new import_errors16.FuelError(
5319
- import_errors16.ErrorCode.GAS_LIMIT_TOO_LOW,
5256
+ throw new import_errors15.FuelError(
5257
+ import_errors15.ErrorCode.GAS_LIMIT_TOO_LOW,
5320
5258
  `Gas limit '${gasLimit}' is lower than the required: '${gasUsed}'.`
5321
5259
  );
5322
5260
  }
@@ -5325,14 +5263,14 @@ var Account = class extends import_interfaces.AbstractAccount {
5325
5263
 
5326
5264
  // src/wallet/base-wallet-unlocked.ts
5327
5265
  var import_hasher3 = require("@fuel-ts/hasher");
5328
- var import_utils31 = require("@fuel-ts/utils");
5266
+ var import_utils30 = require("@fuel-ts/utils");
5329
5267
 
5330
5268
  // src/signer/signer.ts
5331
5269
  var import_address5 = require("@fuel-ts/address");
5332
5270
  var import_crypto = require("@fuel-ts/crypto");
5333
5271
  var import_hasher2 = require("@fuel-ts/hasher");
5334
- var import_math19 = require("@fuel-ts/math");
5335
- var import_utils29 = require("@fuel-ts/utils");
5272
+ var import_math18 = require("@fuel-ts/math");
5273
+ var import_utils28 = require("@fuel-ts/utils");
5336
5274
  var import_secp256k1 = require("@noble/curves/secp256k1");
5337
5275
  var Signer = class {
5338
5276
  address;
@@ -5351,10 +5289,10 @@ var Signer = class {
5351
5289
  privateKey = `0x${privateKey}`;
5352
5290
  }
5353
5291
  }
5354
- const privateKeyBytes = (0, import_math19.toBytes)(privateKey, 32);
5355
- this.privateKey = (0, import_utils29.hexlify)(privateKeyBytes);
5356
- this.publicKey = (0, import_utils29.hexlify)(import_secp256k1.secp256k1.getPublicKey(privateKeyBytes, false).slice(1));
5357
- this.compressedPublicKey = (0, import_utils29.hexlify)(import_secp256k1.secp256k1.getPublicKey(privateKeyBytes, true));
5292
+ const privateKeyBytes = (0, import_math18.toBytes)(privateKey, 32);
5293
+ this.privateKey = (0, import_utils28.hexlify)(privateKeyBytes);
5294
+ this.publicKey = (0, import_utils28.hexlify)(import_secp256k1.secp256k1.getPublicKey(privateKeyBytes, false).slice(1));
5295
+ this.compressedPublicKey = (0, import_utils28.hexlify)(import_secp256k1.secp256k1.getPublicKey(privateKeyBytes, true));
5358
5296
  this.address = import_address5.Address.fromPublicKey(this.publicKey);
5359
5297
  }
5360
5298
  /**
@@ -5368,11 +5306,11 @@ var Signer = class {
5368
5306
  * @returns hashed signature
5369
5307
  */
5370
5308
  sign(data) {
5371
- const signature = import_secp256k1.secp256k1.sign((0, import_utils29.arrayify)(data), (0, import_utils29.arrayify)(this.privateKey));
5372
- const r = (0, import_math19.toBytes)(`0x${signature.r.toString(16)}`, 32);
5373
- const s = (0, import_math19.toBytes)(`0x${signature.s.toString(16)}`, 32);
5309
+ const signature = import_secp256k1.secp256k1.sign((0, import_utils28.arrayify)(data), (0, import_utils28.arrayify)(this.privateKey));
5310
+ const r = (0, import_math18.toBytes)(`0x${signature.r.toString(16)}`, 32);
5311
+ const s = (0, import_math18.toBytes)(`0x${signature.s.toString(16)}`, 32);
5374
5312
  s[0] |= (signature.recovery || 0) << 7;
5375
- return (0, import_utils29.hexlify)((0, import_utils29.concat)([r, s]));
5313
+ return (0, import_utils28.hexlify)((0, import_utils28.concat)([r, s]));
5376
5314
  }
5377
5315
  /**
5378
5316
  * Add point on the current elliptic curve
@@ -5381,8 +5319,8 @@ var Signer = class {
5381
5319
  * @returns compressed point on the curve
5382
5320
  */
5383
5321
  addPoint(point) {
5384
- const p0 = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils29.arrayify)(this.compressedPublicKey));
5385
- const p1 = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils29.arrayify)(point));
5322
+ const p0 = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils28.arrayify)(this.compressedPublicKey));
5323
+ const p1 = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils28.arrayify)(point));
5386
5324
  const result = p0.add(p1);
5387
5325
  return `0x${result.toHex(true)}`;
5388
5326
  }
@@ -5394,16 +5332,16 @@ var Signer = class {
5394
5332
  * @returns public key from signature from the
5395
5333
  */
5396
5334
  static recoverPublicKey(data, signature) {
5397
- const signedMessageBytes = (0, import_utils29.arrayify)(signature);
5335
+ const signedMessageBytes = (0, import_utils28.arrayify)(signature);
5398
5336
  const r = signedMessageBytes.slice(0, 32);
5399
5337
  const s = signedMessageBytes.slice(32, 64);
5400
5338
  const recoveryParam = (s[0] & 128) >> 7;
5401
5339
  s[0] &= 127;
5402
- const sig = new import_secp256k1.secp256k1.Signature(BigInt((0, import_utils29.hexlify)(r)), BigInt((0, import_utils29.hexlify)(s))).addRecoveryBit(
5340
+ const sig = new import_secp256k1.secp256k1.Signature(BigInt((0, import_utils28.hexlify)(r)), BigInt((0, import_utils28.hexlify)(s))).addRecoveryBit(
5403
5341
  recoveryParam
5404
5342
  );
5405
- const publicKey = sig.recoverPublicKey((0, import_utils29.arrayify)(data)).toRawBytes(false).slice(1);
5406
- return (0, import_utils29.hexlify)(publicKey);
5343
+ const publicKey = sig.recoverPublicKey((0, import_utils28.arrayify)(data)).toRawBytes(false).slice(1);
5344
+ return (0, import_utils28.hexlify)(publicKey);
5407
5345
  }
5408
5346
  /**
5409
5347
  * Recover the address from a signature performed with [`sign`](#sign).
@@ -5422,7 +5360,7 @@ var Signer = class {
5422
5360
  * @returns random 32-byte hashed
5423
5361
  */
5424
5362
  static generatePrivateKey(entropy) {
5425
- return entropy ? (0, import_hasher2.hash)((0, import_utils29.concat)([(0, import_crypto.randomBytes)(32), (0, import_utils29.arrayify)(entropy)])) : (0, import_crypto.randomBytes)(32);
5363
+ return entropy ? (0, import_hasher2.hash)((0, import_utils28.concat)([(0, import_crypto.randomBytes)(32), (0, import_utils28.arrayify)(entropy)])) : (0, import_crypto.randomBytes)(32);
5426
5364
  }
5427
5365
  /**
5428
5366
  * Extended publicKey from a compact publicKey
@@ -5431,16 +5369,16 @@ var Signer = class {
5431
5369
  * @returns extended publicKey
5432
5370
  */
5433
5371
  static extendPublicKey(publicKey) {
5434
- const point = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils29.arrayify)(publicKey));
5435
- return (0, import_utils29.hexlify)(point.toRawBytes(false).slice(1));
5372
+ const point = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils28.arrayify)(publicKey));
5373
+ return (0, import_utils28.hexlify)(point.toRawBytes(false).slice(1));
5436
5374
  }
5437
5375
  };
5438
5376
 
5439
5377
  // src/wallet/keystore-wallet.ts
5440
5378
  var import_address6 = require("@fuel-ts/address");
5441
5379
  var import_crypto2 = require("@fuel-ts/crypto");
5442
- var import_errors17 = require("@fuel-ts/errors");
5443
- var import_utils30 = require("@fuel-ts/utils");
5380
+ var import_errors16 = require("@fuel-ts/errors");
5381
+ var import_utils29 = require("@fuel-ts/utils");
5444
5382
  var import_uuid = require("uuid");
5445
5383
  var DEFAULT_KDF_PARAMS_LOG_N = 13;
5446
5384
  var DEFAULT_KDF_PARAMS_R = 8;
@@ -5517,13 +5455,13 @@ async function decryptKeystoreWallet(jsonWallet, password) {
5517
5455
  const macHashUint8Array = (0, import_crypto2.keccak256)(data);
5518
5456
  const macHash = (0, import_crypto2.stringFromBuffer)(macHashUint8Array, "hex");
5519
5457
  if (mac !== macHash) {
5520
- throw new import_errors17.FuelError(
5521
- import_errors17.ErrorCode.INVALID_PASSWORD,
5458
+ throw new import_errors16.FuelError(
5459
+ import_errors16.ErrorCode.INVALID_PASSWORD,
5522
5460
  "Failed to decrypt the keystore wallet, the provided password is incorrect."
5523
5461
  );
5524
5462
  }
5525
5463
  const buffer = await (0, import_crypto2.decryptJsonWalletData)(ciphertextBuffer, key, ivBuffer);
5526
- const privateKey = (0, import_utils30.hexlify)(buffer);
5464
+ const privateKey = (0, import_utils29.hexlify)(buffer);
5527
5465
  return privateKey;
5528
5466
  }
5529
5467
 
@@ -5568,7 +5506,7 @@ var BaseWalletUnlocked = class extends Account {
5568
5506
  */
5569
5507
  async signMessage(message) {
5570
5508
  const signedMessage = await this.signer().sign((0, import_hasher3.hashMessage)(message));
5571
- return (0, import_utils31.hexlify)(signedMessage);
5509
+ return (0, import_utils30.hexlify)(signedMessage);
5572
5510
  }
5573
5511
  /**
5574
5512
  * Signs a transaction with the wallet's private key.
@@ -5581,7 +5519,7 @@ var BaseWalletUnlocked = class extends Account {
5581
5519
  const chainId = this.provider.getChainId();
5582
5520
  const hashedTransaction = transactionRequest.getTransactionId(chainId);
5583
5521
  const signature = await this.signer().sign(hashedTransaction);
5584
- return (0, import_utils31.hexlify)(signature);
5522
+ return (0, import_utils30.hexlify)(signature);
5585
5523
  }
5586
5524
  /**
5587
5525
  * Populates a transaction with the witnesses signature.
@@ -5640,17 +5578,17 @@ var BaseWalletUnlocked = class extends Account {
5640
5578
  __publicField(BaseWalletUnlocked, "defaultPath", "m/44'/1179993420'/0'/0/0");
5641
5579
 
5642
5580
  // src/hdwallet/hdwallet.ts
5643
- var import_errors20 = require("@fuel-ts/errors");
5581
+ var import_errors19 = require("@fuel-ts/errors");
5644
5582
  var import_hasher6 = require("@fuel-ts/hasher");
5645
- var import_math20 = require("@fuel-ts/math");
5646
- var import_utils35 = require("@fuel-ts/utils");
5583
+ var import_math19 = require("@fuel-ts/math");
5584
+ var import_utils34 = require("@fuel-ts/utils");
5647
5585
  var import_ethers3 = require("ethers");
5648
5586
 
5649
5587
  // src/mnemonic/mnemonic.ts
5650
5588
  var import_crypto3 = require("@fuel-ts/crypto");
5651
- var import_errors19 = require("@fuel-ts/errors");
5589
+ var import_errors18 = require("@fuel-ts/errors");
5652
5590
  var import_hasher5 = require("@fuel-ts/hasher");
5653
- var import_utils33 = require("@fuel-ts/utils");
5591
+ var import_utils32 = require("@fuel-ts/utils");
5654
5592
  var import_ethers2 = require("ethers");
5655
5593
 
5656
5594
  // src/wordlists/words/english.ts
@@ -7712,9 +7650,9 @@ var Language = /* @__PURE__ */ ((Language2) => {
7712
7650
  })(Language || {});
7713
7651
 
7714
7652
  // src/mnemonic/utils.ts
7715
- var import_errors18 = require("@fuel-ts/errors");
7653
+ var import_errors17 = require("@fuel-ts/errors");
7716
7654
  var import_hasher4 = require("@fuel-ts/hasher");
7717
- var import_utils32 = require("@fuel-ts/utils");
7655
+ var import_utils31 = require("@fuel-ts/utils");
7718
7656
  function toUtf8Bytes(stri) {
7719
7657
  const str = stri.normalize("NFKD");
7720
7658
  const result = [];
@@ -7729,8 +7667,8 @@ function toUtf8Bytes(stri) {
7729
7667
  i += 1;
7730
7668
  const c2 = str.charCodeAt(i);
7731
7669
  if (i >= str.length || (c2 & 64512) !== 56320) {
7732
- throw new import_errors18.FuelError(
7733
- import_errors18.ErrorCode.INVALID_INPUT_PARAMETERS,
7670
+ throw new import_errors17.FuelError(
7671
+ import_errors17.ErrorCode.INVALID_INPUT_PARAMETERS,
7734
7672
  "Invalid UTF-8 in the input string."
7735
7673
  );
7736
7674
  }
@@ -7781,20 +7719,20 @@ function entropyToMnemonicIndices(entropy) {
7781
7719
  }
7782
7720
  }
7783
7721
  const checksumBits = entropy.length / 4;
7784
- const checksum = (0, import_utils32.arrayify)((0, import_hasher4.sha256)(entropy))[0] & getUpperMask(checksumBits);
7722
+ const checksum = (0, import_utils31.arrayify)((0, import_hasher4.sha256)(entropy))[0] & getUpperMask(checksumBits);
7785
7723
  indices[indices.length - 1] <<= checksumBits;
7786
7724
  indices[indices.length - 1] |= checksum >> 8 - checksumBits;
7787
7725
  return indices;
7788
7726
  }
7789
7727
  function mnemonicWordsToEntropy(words, wordlist) {
7790
7728
  const size = Math.ceil(11 * words.length / 8);
7791
- const entropy = (0, import_utils32.arrayify)(new Uint8Array(size));
7729
+ const entropy = (0, import_utils31.arrayify)(new Uint8Array(size));
7792
7730
  let offset = 0;
7793
7731
  for (let i = 0; i < words.length; i += 1) {
7794
7732
  const index = wordlist.indexOf(words[i].normalize("NFKD"));
7795
7733
  if (index === -1) {
7796
- throw new import_errors18.FuelError(
7797
- import_errors18.ErrorCode.INVALID_MNEMONIC,
7734
+ throw new import_errors17.FuelError(
7735
+ import_errors17.ErrorCode.INVALID_MNEMONIC,
7798
7736
  `Invalid mnemonic: the word '${words[i]}' is not found in the provided wordlist.`
7799
7737
  );
7800
7738
  }
@@ -7808,10 +7746,10 @@ function mnemonicWordsToEntropy(words, wordlist) {
7808
7746
  const entropyBits = 32 * words.length / 3;
7809
7747
  const checksumBits = words.length / 3;
7810
7748
  const checksumMask = getUpperMask(checksumBits);
7811
- const checksum = (0, import_utils32.arrayify)((0, import_hasher4.sha256)(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;
7749
+ const checksum = (0, import_utils31.arrayify)((0, import_hasher4.sha256)(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;
7812
7750
  if (checksum !== (entropy[entropy.length - 1] & checksumMask)) {
7813
- throw new import_errors18.FuelError(
7814
- import_errors18.ErrorCode.INVALID_CHECKSUM,
7751
+ throw new import_errors17.FuelError(
7752
+ import_errors17.ErrorCode.INVALID_CHECKSUM,
7815
7753
  "Checksum validation failed for the provided mnemonic."
7816
7754
  );
7817
7755
  }
@@ -7825,16 +7763,16 @@ var TestnetPRV = "0x04358394";
7825
7763
  var MNEMONIC_SIZES = [12, 15, 18, 21, 24];
7826
7764
  function assertWordList(wordlist) {
7827
7765
  if (wordlist.length !== 2048) {
7828
- throw new import_errors19.FuelError(
7829
- import_errors19.ErrorCode.INVALID_WORD_LIST,
7766
+ throw new import_errors18.FuelError(
7767
+ import_errors18.ErrorCode.INVALID_WORD_LIST,
7830
7768
  `Expected word list length of 2048, but got ${wordlist.length}.`
7831
7769
  );
7832
7770
  }
7833
7771
  }
7834
7772
  function assertEntropy(entropy) {
7835
7773
  if (entropy.length % 4 !== 0 || entropy.length < 16 || entropy.length > 32) {
7836
- throw new import_errors19.FuelError(
7837
- import_errors19.ErrorCode.INVALID_ENTROPY,
7774
+ throw new import_errors18.FuelError(
7775
+ import_errors18.ErrorCode.INVALID_ENTROPY,
7838
7776
  `Entropy should be between 16 and 32 bytes and a multiple of 4, but got ${entropy.length} bytes.`
7839
7777
  );
7840
7778
  }
@@ -7844,7 +7782,7 @@ function assertMnemonic(words) {
7844
7782
  const errorMsg = `Invalid mnemonic size. Expected one of [${MNEMONIC_SIZES.join(
7845
7783
  ", "
7846
7784
  )}] words, but got ${words.length}.`;
7847
- throw new import_errors19.FuelError(import_errors19.ErrorCode.INVALID_MNEMONIC, errorMsg);
7785
+ throw new import_errors18.FuelError(import_errors18.ErrorCode.INVALID_MNEMONIC, errorMsg);
7848
7786
  }
7849
7787
  }
7850
7788
  var Mnemonic = class {
@@ -7883,7 +7821,7 @@ var Mnemonic = class {
7883
7821
  static mnemonicToEntropy(phrase, wordlist = english) {
7884
7822
  const words = getWords(phrase);
7885
7823
  assertMnemonic(words);
7886
- return (0, import_utils33.hexlify)(mnemonicWordsToEntropy(words, wordlist));
7824
+ return (0, import_utils32.hexlify)(mnemonicWordsToEntropy(words, wordlist));
7887
7825
  }
7888
7826
  /**
7889
7827
  * @param entropy - Entropy source to the mnemonic phrase.
@@ -7891,7 +7829,7 @@ var Mnemonic = class {
7891
7829
  * @returns 64-byte array contains privateKey and chainCode as described on BIP39
7892
7830
  */
7893
7831
  static entropyToMnemonic(entropy, wordlist = english) {
7894
- const entropyBytes = (0, import_utils33.arrayify)(entropy);
7832
+ const entropyBytes = (0, import_utils32.arrayify)(entropy);
7895
7833
  assertWordList(wordlist);
7896
7834
  assertEntropy(entropyBytes);
7897
7835
  return entropyToMnemonicIndices(entropyBytes).map((i) => wordlist[i]).join(" ");
@@ -7960,14 +7898,14 @@ var Mnemonic = class {
7960
7898
  * @returns 64-byte array contains privateKey and chainCode as described on BIP39
7961
7899
  */
7962
7900
  static masterKeysFromSeed(seed) {
7963
- const seedArray = (0, import_utils33.arrayify)(seed);
7901
+ const seedArray = (0, import_utils32.arrayify)(seed);
7964
7902
  if (seedArray.length < 16 || seedArray.length > 64) {
7965
- throw new import_errors19.FuelError(
7966
- import_errors19.ErrorCode.INVALID_SEED,
7903
+ throw new import_errors18.FuelError(
7904
+ import_errors18.ErrorCode.INVALID_SEED,
7967
7905
  `Seed length should be between 16 and 64 bytes, but received ${seedArray.length} bytes.`
7968
7906
  );
7969
7907
  }
7970
- return (0, import_utils33.arrayify)((0, import_ethers2.computeHmac)("sha512", MasterSecret, seedArray));
7908
+ return (0, import_utils32.arrayify)((0, import_ethers2.computeHmac)("sha512", MasterSecret, seedArray));
7971
7909
  }
7972
7910
  /**
7973
7911
  * Get the extendKey as defined on BIP-32 from the provided seed
@@ -7978,22 +7916,22 @@ var Mnemonic = class {
7978
7916
  */
7979
7917
  static seedToExtendedKey(seed, testnet = false) {
7980
7918
  const masterKey = Mnemonic.masterKeysFromSeed(seed);
7981
- const prefix = (0, import_utils33.arrayify)(testnet ? TestnetPRV : MainnetPRV);
7919
+ const prefix = (0, import_utils32.arrayify)(testnet ? TestnetPRV : MainnetPRV);
7982
7920
  const depth = "0x00";
7983
7921
  const fingerprint = "0x00000000";
7984
7922
  const index = "0x00000000";
7985
7923
  const chainCode = masterKey.slice(32);
7986
7924
  const privateKey = masterKey.slice(0, 32);
7987
- const extendedKey = (0, import_utils33.concat)([
7925
+ const extendedKey = (0, import_utils32.concat)([
7988
7926
  prefix,
7989
7927
  depth,
7990
7928
  fingerprint,
7991
7929
  index,
7992
7930
  chainCode,
7993
- (0, import_utils33.concat)(["0x00", privateKey])
7931
+ (0, import_utils32.concat)(["0x00", privateKey])
7994
7932
  ]);
7995
7933
  const checksum = (0, import_ethers2.dataSlice)((0, import_hasher5.sha256)((0, import_hasher5.sha256)(extendedKey)), 0, 4);
7996
- return (0, import_ethers2.encodeBase58)((0, import_utils33.concat)([extendedKey, checksum]));
7934
+ return (0, import_ethers2.encodeBase58)((0, import_utils32.concat)([extendedKey, checksum]));
7997
7935
  }
7998
7936
  /**
7999
7937
  * Create a new mnemonic using a randomly generated number as entropy.
@@ -8008,7 +7946,7 @@ var Mnemonic = class {
8008
7946
  * @returns A randomly generated mnemonic
8009
7947
  */
8010
7948
  static generate(size = 32, extraEntropy = "") {
8011
- const entropy = extraEntropy ? (0, import_hasher5.sha256)((0, import_utils33.concat)([(0, import_crypto3.randomBytes)(size), (0, import_utils33.arrayify)(extraEntropy)])) : (0, import_crypto3.randomBytes)(size);
7949
+ const entropy = extraEntropy ? (0, import_hasher5.sha256)((0, import_utils32.concat)([(0, import_crypto3.randomBytes)(size), (0, import_utils32.arrayify)(extraEntropy)])) : (0, import_crypto3.randomBytes)(size);
8012
7950
  return Mnemonic.entropyToMnemonic(entropy);
8013
7951
  }
8014
7952
  };
@@ -8016,12 +7954,12 @@ var mnemonic_default = Mnemonic;
8016
7954
 
8017
7955
  // src/hdwallet/hdwallet.ts
8018
7956
  var HARDENED_INDEX = 2147483648;
8019
- var MainnetPRV2 = (0, import_utils35.hexlify)("0x0488ade4");
8020
- var MainnetPUB = (0, import_utils35.hexlify)("0x0488b21e");
8021
- var TestnetPRV2 = (0, import_utils35.hexlify)("0x04358394");
8022
- var TestnetPUB = (0, import_utils35.hexlify)("0x043587cf");
7957
+ var MainnetPRV2 = (0, import_utils34.hexlify)("0x0488ade4");
7958
+ var MainnetPUB = (0, import_utils34.hexlify)("0x0488b21e");
7959
+ var TestnetPRV2 = (0, import_utils34.hexlify)("0x04358394");
7960
+ var TestnetPUB = (0, import_utils34.hexlify)("0x043587cf");
8023
7961
  function base58check(data) {
8024
- return (0, import_ethers3.encodeBase58)((0, import_utils35.concat)([data, (0, import_ethers3.dataSlice)((0, import_hasher6.sha256)((0, import_hasher6.sha256)(data)), 0, 4)]));
7962
+ return (0, import_ethers3.encodeBase58)((0, import_utils34.concat)([data, (0, import_ethers3.dataSlice)((0, import_hasher6.sha256)((0, import_hasher6.sha256)(data)), 0, 4)]));
8025
7963
  }
8026
7964
  function getExtendedKeyPrefix(isPublic = false, testnet = false) {
8027
7965
  if (isPublic) {
@@ -8030,17 +7968,17 @@ function getExtendedKeyPrefix(isPublic = false, testnet = false) {
8030
7968
  return testnet ? TestnetPRV2 : MainnetPRV2;
8031
7969
  }
8032
7970
  function isPublicExtendedKey(extendedKey) {
8033
- return [MainnetPUB, TestnetPUB].includes((0, import_utils35.hexlify)(extendedKey.slice(0, 4)));
7971
+ return [MainnetPUB, TestnetPUB].includes((0, import_utils34.hexlify)(extendedKey.slice(0, 4)));
8034
7972
  }
8035
7973
  function isValidExtendedKey(extendedKey) {
8036
7974
  return [MainnetPRV2, TestnetPRV2, MainnetPUB, TestnetPUB].includes(
8037
- (0, import_utils35.hexlify)(extendedKey.slice(0, 4))
7975
+ (0, import_utils34.hexlify)(extendedKey.slice(0, 4))
8038
7976
  );
8039
7977
  }
8040
7978
  function parsePath(path, depth = 0) {
8041
7979
  const components = path.split("/");
8042
7980
  if (components.length === 0 || components[0] === "m" && depth !== 0) {
8043
- throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, `invalid path - ${path}`);
7981
+ throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, `invalid path - ${path}`);
8044
7982
  }
8045
7983
  if (components[0] === "m") {
8046
7984
  components.shift();
@@ -8052,8 +7990,8 @@ function parsePath(path, depth = 0) {
8052
7990
  var HDWallet = class {
8053
7991
  depth = 0;
8054
7992
  index = 0;
8055
- fingerprint = (0, import_utils35.hexlify)("0x00000000");
8056
- parentFingerprint = (0, import_utils35.hexlify)("0x00000000");
7993
+ fingerprint = (0, import_utils34.hexlify)("0x00000000");
7994
+ parentFingerprint = (0, import_utils34.hexlify)("0x00000000");
8057
7995
  privateKey;
8058
7996
  publicKey;
8059
7997
  chainCode;
@@ -8065,16 +8003,16 @@ var HDWallet = class {
8065
8003
  constructor(config) {
8066
8004
  if (config.privateKey) {
8067
8005
  const signer = new Signer(config.privateKey);
8068
- this.publicKey = (0, import_utils35.hexlify)(signer.compressedPublicKey);
8069
- this.privateKey = (0, import_utils35.hexlify)(config.privateKey);
8006
+ this.publicKey = (0, import_utils34.hexlify)(signer.compressedPublicKey);
8007
+ this.privateKey = (0, import_utils34.hexlify)(config.privateKey);
8070
8008
  } else {
8071
8009
  if (!config.publicKey) {
8072
- throw new import_errors20.FuelError(
8073
- import_errors20.ErrorCode.HD_WALLET_ERROR,
8010
+ throw new import_errors19.FuelError(
8011
+ import_errors19.ErrorCode.HD_WALLET_ERROR,
8074
8012
  "Both public and private Key cannot be missing. At least one should be provided."
8075
8013
  );
8076
8014
  }
8077
- this.publicKey = (0, import_utils35.hexlify)(config.publicKey);
8015
+ this.publicKey = (0, import_utils34.hexlify)(config.publicKey);
8078
8016
  }
8079
8017
  this.parentFingerprint = config.parentFingerprint || this.parentFingerprint;
8080
8018
  this.fingerprint = (0, import_ethers3.dataSlice)((0, import_ethers3.ripemd160)((0, import_hasher6.sha256)(this.publicKey)), 0, 4);
@@ -8093,28 +8031,28 @@ var HDWallet = class {
8093
8031
  * @returns A new instance of HDWallet on the derived index
8094
8032
  */
8095
8033
  deriveIndex(index) {
8096
- const privateKey = this.privateKey && (0, import_utils35.arrayify)(this.privateKey);
8097
- const publicKey = (0, import_utils35.arrayify)(this.publicKey);
8098
- const chainCode = (0, import_utils35.arrayify)(this.chainCode);
8034
+ const privateKey = this.privateKey && (0, import_utils34.arrayify)(this.privateKey);
8035
+ const publicKey = (0, import_utils34.arrayify)(this.publicKey);
8036
+ const chainCode = (0, import_utils34.arrayify)(this.chainCode);
8099
8037
  const data = new Uint8Array(37);
8100
8038
  if (index & HARDENED_INDEX) {
8101
8039
  if (!privateKey) {
8102
- throw new import_errors20.FuelError(
8103
- import_errors20.ErrorCode.HD_WALLET_ERROR,
8040
+ throw new import_errors19.FuelError(
8041
+ import_errors19.ErrorCode.HD_WALLET_ERROR,
8104
8042
  "Cannot derive a hardened index without a private Key."
8105
8043
  );
8106
8044
  }
8107
8045
  data.set(privateKey, 1);
8108
8046
  } else {
8109
- data.set((0, import_utils35.arrayify)(this.publicKey));
8047
+ data.set((0, import_utils34.arrayify)(this.publicKey));
8110
8048
  }
8111
- data.set((0, import_math20.toBytes)(index, 4), 33);
8112
- const bytes = (0, import_utils35.arrayify)((0, import_ethers3.computeHmac)("sha512", chainCode, data));
8049
+ data.set((0, import_math19.toBytes)(index, 4), 33);
8050
+ const bytes = (0, import_utils34.arrayify)((0, import_ethers3.computeHmac)("sha512", chainCode, data));
8113
8051
  const IL = bytes.slice(0, 32);
8114
8052
  const IR = bytes.slice(32);
8115
8053
  if (privateKey) {
8116
8054
  const N = "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141";
8117
- const ki = (0, import_math20.bn)(IL).add(privateKey).mod(N).toBytes(32);
8055
+ const ki = (0, import_math19.bn)(IL).add(privateKey).mod(N).toBytes(32);
8118
8056
  return new HDWallet({
8119
8057
  privateKey: ki,
8120
8058
  chainCode: IR,
@@ -8123,7 +8061,7 @@ var HDWallet = class {
8123
8061
  parentFingerprint: this.fingerprint
8124
8062
  });
8125
8063
  }
8126
- const signer = new Signer((0, import_utils35.hexlify)(IL));
8064
+ const signer = new Signer((0, import_utils34.hexlify)(IL));
8127
8065
  const Ki = signer.addPoint(publicKey);
8128
8066
  return new HDWallet({
8129
8067
  publicKey: Ki,
@@ -8152,18 +8090,18 @@ var HDWallet = class {
8152
8090
  */
8153
8091
  toExtendedKey(isPublic = false, testnet = false) {
8154
8092
  if (this.depth >= 256) {
8155
- throw new import_errors20.FuelError(
8156
- import_errors20.ErrorCode.HD_WALLET_ERROR,
8093
+ throw new import_errors19.FuelError(
8094
+ import_errors19.ErrorCode.HD_WALLET_ERROR,
8157
8095
  `Exceeded max depth of 255. Current depth: ${this.depth}.`
8158
8096
  );
8159
8097
  }
8160
8098
  const prefix = getExtendedKeyPrefix(this.privateKey == null || isPublic, testnet);
8161
- const depth = (0, import_utils35.hexlify)(Uint8Array.from([this.depth]));
8099
+ const depth = (0, import_utils34.hexlify)(Uint8Array.from([this.depth]));
8162
8100
  const parentFingerprint = this.parentFingerprint;
8163
- const index = (0, import_math20.toHex)(this.index, 4);
8101
+ const index = (0, import_math19.toHex)(this.index, 4);
8164
8102
  const chainCode = this.chainCode;
8165
- const key = this.privateKey != null && !isPublic ? (0, import_utils35.concat)(["0x00", this.privateKey]) : this.publicKey;
8166
- const extendedKey = (0, import_utils35.arrayify)((0, import_utils35.concat)([prefix, depth, parentFingerprint, index, chainCode, key]));
8103
+ const key = this.privateKey != null && !isPublic ? (0, import_utils34.concat)(["0x00", this.privateKey]) : this.publicKey;
8104
+ const extendedKey = (0, import_utils34.arrayify)((0, import_utils34.concat)([prefix, depth, parentFingerprint, index, chainCode, key]));
8167
8105
  return base58check(extendedKey);
8168
8106
  }
8169
8107
  /**
@@ -8175,34 +8113,34 @@ var HDWallet = class {
8175
8113
  static fromSeed(seed) {
8176
8114
  const masterKey = mnemonic_default.masterKeysFromSeed(seed);
8177
8115
  return new HDWallet({
8178
- chainCode: (0, import_utils35.arrayify)(masterKey.slice(32)),
8179
- privateKey: (0, import_utils35.arrayify)(masterKey.slice(0, 32))
8116
+ chainCode: (0, import_utils34.arrayify)(masterKey.slice(32)),
8117
+ privateKey: (0, import_utils34.arrayify)(masterKey.slice(0, 32))
8180
8118
  });
8181
8119
  }
8182
8120
  static fromExtendedKey(extendedKey) {
8183
8121
  const decoded = (0, import_ethers3.toBeHex)((0, import_ethers3.decodeBase58)(extendedKey));
8184
- const bytes = (0, import_utils35.arrayify)(decoded);
8122
+ const bytes = (0, import_utils34.arrayify)(decoded);
8185
8123
  const validChecksum = base58check(bytes.slice(0, 78)) === extendedKey;
8186
8124
  if (bytes.length !== 82 || !isValidExtendedKey(bytes)) {
8187
- throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, "Provided key is not a valid extended key.");
8125
+ throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Provided key is not a valid extended key.");
8188
8126
  }
8189
8127
  if (!validChecksum) {
8190
- throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, "Provided key has an invalid checksum.");
8128
+ throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Provided key has an invalid checksum.");
8191
8129
  }
8192
8130
  const depth = bytes[4];
8193
- const parentFingerprint = (0, import_utils35.hexlify)(bytes.slice(5, 9));
8194
- const index = parseInt((0, import_utils35.hexlify)(bytes.slice(9, 13)).substring(2), 16);
8195
- const chainCode = (0, import_utils35.hexlify)(bytes.slice(13, 45));
8131
+ const parentFingerprint = (0, import_utils34.hexlify)(bytes.slice(5, 9));
8132
+ const index = parseInt((0, import_utils34.hexlify)(bytes.slice(9, 13)).substring(2), 16);
8133
+ const chainCode = (0, import_utils34.hexlify)(bytes.slice(13, 45));
8196
8134
  const key = bytes.slice(45, 78);
8197
8135
  if (depth === 0 && parentFingerprint !== "0x00000000" || depth === 0 && index !== 0) {
8198
- throw new import_errors20.FuelError(
8199
- import_errors20.ErrorCode.HD_WALLET_ERROR,
8136
+ throw new import_errors19.FuelError(
8137
+ import_errors19.ErrorCode.HD_WALLET_ERROR,
8200
8138
  "Inconsistency detected: Depth is zero but fingerprint/index is non-zero."
8201
8139
  );
8202
8140
  }
8203
8141
  if (isPublicExtendedKey(bytes)) {
8204
8142
  if (key[0] !== 3) {
8205
- throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
8143
+ throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
8206
8144
  }
8207
8145
  return new HDWallet({
8208
8146
  publicKey: key,
@@ -8213,7 +8151,7 @@ var HDWallet = class {
8213
8151
  });
8214
8152
  }
8215
8153
  if (key[0] !== 0) {
8216
- throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, "Invalid private extended key.");
8154
+ throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Invalid private extended key.");
8217
8155
  }
8218
8156
  return new HDWallet({
8219
8157
  privateKey: key.slice(1),
@@ -8381,7 +8319,7 @@ __publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
8381
8319
  // src/wallet-manager/wallet-manager.ts
8382
8320
  var import_address9 = require("@fuel-ts/address");
8383
8321
  var import_crypto4 = require("@fuel-ts/crypto");
8384
- var import_errors23 = require("@fuel-ts/errors");
8322
+ var import_errors22 = require("@fuel-ts/errors");
8385
8323
  var import_events = require("events");
8386
8324
 
8387
8325
  // src/wallet-manager/storages/memory-storage.ts
@@ -8404,7 +8342,7 @@ var MemoryStorage = class {
8404
8342
 
8405
8343
  // src/wallet-manager/vaults/mnemonic-vault.ts
8406
8344
  var import_address7 = require("@fuel-ts/address");
8407
- var import_errors21 = require("@fuel-ts/errors");
8345
+ var import_errors20 = require("@fuel-ts/errors");
8408
8346
  var _secret;
8409
8347
  var MnemonicVault = class {
8410
8348
  constructor(options) {
@@ -8460,8 +8398,8 @@ var MnemonicVault = class {
8460
8398
  }
8461
8399
  numberOfAccounts += 1;
8462
8400
  } while (numberOfAccounts < this.numberOfAccounts);
8463
- throw new import_errors21.FuelError(
8464
- import_errors21.ErrorCode.WALLET_MANAGER_ERROR,
8401
+ throw new import_errors20.FuelError(
8402
+ import_errors20.ErrorCode.WALLET_MANAGER_ERROR,
8465
8403
  `Account with address '${address}' not found in derived wallets.`
8466
8404
  );
8467
8405
  }
@@ -8475,7 +8413,7 @@ __publicField(MnemonicVault, "type", "mnemonic");
8475
8413
 
8476
8414
  // src/wallet-manager/vaults/privatekey-vault.ts
8477
8415
  var import_address8 = require("@fuel-ts/address");
8478
- var import_errors22 = require("@fuel-ts/errors");
8416
+ var import_errors21 = require("@fuel-ts/errors");
8479
8417
  var _privateKeys;
8480
8418
  var PrivateKeyVault = class {
8481
8419
  /**
@@ -8516,8 +8454,8 @@ var PrivateKeyVault = class {
8516
8454
  (pk) => Wallet.fromPrivateKey(pk).address.equals(ownerAddress)
8517
8455
  );
8518
8456
  if (!privateKey) {
8519
- throw new import_errors22.FuelError(
8520
- import_errors22.ErrorCode.WALLET_MANAGER_ERROR,
8457
+ throw new import_errors21.FuelError(
8458
+ import_errors21.ErrorCode.WALLET_MANAGER_ERROR,
8521
8459
  `No private key found for address '${address}'.`
8522
8460
  );
8523
8461
  }
@@ -8541,7 +8479,7 @@ var ERROR_MESSAGES = {
8541
8479
  };
8542
8480
  function assert(condition, message) {
8543
8481
  if (!condition) {
8544
- throw new import_errors23.FuelError(import_errors23.ErrorCode.WALLET_MANAGER_ERROR, message);
8482
+ throw new import_errors22.FuelError(import_errors22.ErrorCode.WALLET_MANAGER_ERROR, message);
8545
8483
  }
8546
8484
  }
8547
8485
  var _vaults, _passphrase, _isLocked, _serializeVaults, serializeVaults_fn, _deserializeVaults, deserializeVaults_fn;
@@ -8767,25 +8705,25 @@ deserializeVaults_fn = function(vaults) {
8767
8705
  __publicField(WalletManager, "Vaults", [MnemonicVault, PrivateKeyVault]);
8768
8706
 
8769
8707
  // src/wallet-manager/types.ts
8770
- var import_errors24 = require("@fuel-ts/errors");
8708
+ var import_errors23 = require("@fuel-ts/errors");
8771
8709
  var Vault = class {
8772
8710
  constructor(_options) {
8773
- throw new import_errors24.FuelError(import_errors24.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8711
+ throw new import_errors23.FuelError(import_errors23.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8774
8712
  }
8775
8713
  serialize() {
8776
- throw new import_errors24.FuelError(import_errors24.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8714
+ throw new import_errors23.FuelError(import_errors23.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8777
8715
  }
8778
8716
  getAccounts() {
8779
- throw new import_errors24.FuelError(import_errors24.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8717
+ throw new import_errors23.FuelError(import_errors23.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8780
8718
  }
8781
8719
  addAccount() {
8782
- throw new import_errors24.FuelError(import_errors24.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8720
+ throw new import_errors23.FuelError(import_errors23.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8783
8721
  }
8784
8722
  exportAccount(_address) {
8785
- throw new import_errors24.FuelError(import_errors24.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8723
+ throw new import_errors23.FuelError(import_errors23.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8786
8724
  }
8787
8725
  getWallet(_address) {
8788
- throw new import_errors24.FuelError(import_errors24.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8726
+ throw new import_errors23.FuelError(import_errors23.ErrorCode.NOT_IMPLEMENTED, "Not implemented.");
8789
8727
  }
8790
8728
  };
8791
8729
  __publicField(Vault, "type");
@@ -8795,21 +8733,20 @@ var StorageAbstract = class {
8795
8733
  // src/predicate/predicate.ts
8796
8734
  var import_abi_coder5 = require("@fuel-ts/abi-coder");
8797
8735
  var import_address10 = require("@fuel-ts/address");
8798
- var import_configs13 = require("@fuel-ts/address/configs");
8799
- var import_errors25 = require("@fuel-ts/errors");
8800
- var import_transactions20 = require("@fuel-ts/transactions");
8801
- var import_utils37 = require("@fuel-ts/utils");
8736
+ var import_errors24 = require("@fuel-ts/errors");
8737
+ var import_transactions19 = require("@fuel-ts/transactions");
8738
+ var import_utils36 = require("@fuel-ts/utils");
8802
8739
 
8803
8740
  // src/predicate/utils/getPredicateRoot.ts
8804
8741
  var import_hasher7 = require("@fuel-ts/hasher");
8805
8742
  var import_merkle = require("@fuel-ts/merkle");
8806
- var import_utils36 = require("@fuel-ts/utils");
8743
+ var import_utils35 = require("@fuel-ts/utils");
8807
8744
  var getPredicateRoot = (bytecode) => {
8808
8745
  const chunkSize = 16 * 1024;
8809
- const bytes = (0, import_utils36.arrayify)(bytecode);
8810
- const chunks = (0, import_utils36.chunkAndPadBytes)(bytes, chunkSize);
8811
- const codeRoot = (0, import_merkle.calcRoot)(chunks.map((c) => (0, import_utils36.hexlify)(c)));
8812
- const predicateRoot = (0, import_hasher7.hash)((0, import_utils36.concat)(["0x4655454C", codeRoot]));
8746
+ const bytes = (0, import_utils35.arrayify)(bytecode);
8747
+ const chunks = (0, import_utils35.chunkAndPadBytes)(bytes, chunkSize);
8748
+ const codeRoot = (0, import_merkle.calcRoot)(chunks.map((c) => (0, import_utils35.hexlify)(c)));
8749
+ const predicateRoot = (0, import_hasher7.hash)((0, import_utils35.concat)(["0x4655454C", codeRoot]));
8813
8750
  return predicateRoot;
8814
8751
  };
8815
8752
 
@@ -8858,7 +8795,7 @@ var Predicate = class extends Account {
8858
8795
  const request = transactionRequestify(transactionRequestLike);
8859
8796
  const { policies } = BaseTransactionRequest.getPolicyMeta(request);
8860
8797
  request.inputs?.forEach((input) => {
8861
- if (input.type === import_transactions20.InputType.Coin && (0, import_utils37.hexlify)(input.owner) === this.address.toB256()) {
8798
+ if (input.type === import_transactions19.InputType.Coin && (0, import_utils36.hexlify)(input.owner) === this.address.toB256()) {
8862
8799
  input.predicate = this.bytes;
8863
8800
  input.predicateData = this.getPredicateData(policies.length);
8864
8801
  }
@@ -8874,8 +8811,9 @@ var Predicate = class extends Account {
8874
8811
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
8875
8812
  * @returns A promise that resolves to the prepared transaction request.
8876
8813
  */
8877
- async createTransfer(destination, amount, assetId = import_configs13.BaseAssetId, txParams = {}) {
8878
- const request = await super.createTransfer(destination, amount, assetId, txParams);
8814
+ async createTransfer(destination, amount, assetId, txParams = {}) {
8815
+ const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
8816
+ const request = await super.createTransfer(destination, amount, assetIdToTransfer, txParams);
8879
8817
  return this.populateTransactionPredicateData(request);
8880
8818
  }
8881
8819
  /**
@@ -8903,7 +8841,7 @@ var Predicate = class extends Account {
8903
8841
  return new Uint8Array();
8904
8842
  }
8905
8843
  const mainFn = this.interface?.functions.main;
8906
- const paddedCode = new import_transactions20.ByteArrayCoder(this.bytes.length).encode(this.bytes);
8844
+ const paddedCode = new import_transactions19.ByteArrayCoder(this.bytes.length).encode(this.bytes);
8907
8845
  const VM_TX_MEMORY = (0, import_abi_coder5.calculateVmTxMemory)({
8908
8846
  maxInputs: this.provider.getChain().consensusParameters.maxInputs.toNumber()
8909
8847
  });
@@ -8919,13 +8857,13 @@ var Predicate = class extends Account {
8919
8857
  * @returns An object containing the new predicate bytes and interface.
8920
8858
  */
8921
8859
  static processPredicateData(bytes, jsonAbi, configurableConstants) {
8922
- let predicateBytes = (0, import_utils37.arrayify)(bytes);
8860
+ let predicateBytes = (0, import_utils36.arrayify)(bytes);
8923
8861
  let abiInterface;
8924
8862
  if (jsonAbi) {
8925
8863
  abiInterface = new import_abi_coder5.Interface(jsonAbi);
8926
8864
  if (abiInterface.functions.main === void 0) {
8927
- throw new import_errors25.FuelError(
8928
- import_errors25.ErrorCode.ABI_MAIN_METHOD_MISSING,
8865
+ throw new import_errors24.FuelError(
8866
+ import_errors24.ErrorCode.ABI_MAIN_METHOD_MISSING,
8929
8867
  'Cannot use ABI without "main" function.'
8930
8868
  );
8931
8869
  }
@@ -8970,8 +8908,8 @@ var Predicate = class extends Account {
8970
8908
  mutatedBytes.set(encoded, offset);
8971
8909
  });
8972
8910
  } catch (err) {
8973
- throw new import_errors25.FuelError(
8974
- import_errors25.ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,
8911
+ throw new import_errors24.FuelError(
8912
+ import_errors24.ErrorCode.INVALID_CONFIGURABLE_CONSTANTS,
8975
8913
  `Error setting configurable constants: ${err.message}.`
8976
8914
  );
8977
8915
  }
@@ -8980,7 +8918,7 @@ var Predicate = class extends Account {
8980
8918
  };
8981
8919
 
8982
8920
  // src/connectors/fuel.ts
8983
- var import_errors26 = require("@fuel-ts/errors");
8921
+ var import_errors25 = require("@fuel-ts/errors");
8984
8922
 
8985
8923
  // src/connectors/fuel-connector.ts
8986
8924
  var import_events2 = require("events");
@@ -9613,7 +9551,7 @@ var _Fuel = class extends FuelConnector {
9613
9551
  const currentNetwork = await this.currentNetwork();
9614
9552
  provider = await Provider.create(currentNetwork.url);
9615
9553
  } else {
9616
- throw new import_errors26.FuelError(import_errors26.ErrorCode.INVALID_PROVIDER, "Provider is not valid.");
9554
+ throw new import_errors25.FuelError(import_errors25.ErrorCode.INVALID_PROVIDER, "Provider is not valid.");
9617
9555
  }
9618
9556
  return provider;
9619
9557
  }
@@ -9693,9 +9631,7 @@ __publicField(Fuel, "defaultConfig", {});
9693
9631
  WalletUnlocked,
9694
9632
  addAmountToAsset,
9695
9633
  addOperation,
9696
- assemblePanicError,
9697
9634
  assembleReceiptByType,
9698
- assembleRevertError,
9699
9635
  assembleTransactionSummary,
9700
9636
  assets,
9701
9637
  buildBlockExplorerUrl,
@@ -9710,7 +9646,6 @@ __publicField(Fuel, "defaultConfig", {});
9710
9646
  english,
9711
9647
  extractBurnedAssetsFromReceipts,
9712
9648
  extractMintedAssetsFromReceipts,
9713
- extractTxError,
9714
9649
  gasUsedByInputs,
9715
9650
  getAssetEth,
9716
9651
  getAssetFuel,