@fuel-ts/account 0.0.0-rc-1936-20240326112905 → 0.0.0-rc-1895-20240327220629

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.

@@ -58,15 +58,15 @@ module.exports = __toCommonJS(test_utils_exports);
58
58
 
59
59
  // src/wallet/base-wallet-unlocked.ts
60
60
  var import_hasher3 = require("@fuel-ts/hasher");
61
- var import_utils30 = require("@fuel-ts/utils");
61
+ var import_utils31 = require("@fuel-ts/utils");
62
62
 
63
63
  // src/account.ts
64
64
  var import_address4 = require("@fuel-ts/address");
65
- var import_configs11 = require("@fuel-ts/address/configs");
66
- var import_errors15 = require("@fuel-ts/errors");
65
+ var import_configs12 = require("@fuel-ts/address/configs");
66
+ var import_errors16 = require("@fuel-ts/errors");
67
67
  var import_interfaces = require("@fuel-ts/interfaces");
68
- var import_math17 = require("@fuel-ts/math");
69
- var import_utils27 = require("@fuel-ts/utils");
68
+ var import_math18 = require("@fuel-ts/math");
69
+ var import_utils28 = require("@fuel-ts/utils");
70
70
 
71
71
  // src/providers/coin-quantity.ts
72
72
  var import_configs = require("@fuel-ts/address/configs");
@@ -106,12 +106,12 @@ var addAmountToAsset = (params) => {
106
106
 
107
107
  // src/providers/provider.ts
108
108
  var import_address3 = require("@fuel-ts/address");
109
- var import_errors13 = require("@fuel-ts/errors");
110
- var import_math14 = require("@fuel-ts/math");
111
- var import_transactions17 = require("@fuel-ts/transactions");
112
- var import_utils22 = require("@fuel-ts/utils");
109
+ var import_errors14 = require("@fuel-ts/errors");
110
+ var import_math15 = require("@fuel-ts/math");
111
+ var import_transactions18 = require("@fuel-ts/transactions");
112
+ var import_utils23 = require("@fuel-ts/utils");
113
113
  var import_versions = require("@fuel-ts/versions");
114
- var import_utils23 = require("@noble/curves/abstract/utils");
114
+ var import_utils24 = require("@noble/curves/abstract/utils");
115
115
  var import_ethers = require("ethers");
116
116
  var import_graphql_request = require("graphql-request");
117
117
  var import_ramda3 = require("ramda");
@@ -1184,9 +1184,9 @@ var outputify = (value) => {
1184
1184
 
1185
1185
  // src/providers/transaction-request/transaction-request.ts
1186
1186
  var import_address = require("@fuel-ts/address");
1187
- var import_configs6 = require("@fuel-ts/address/configs");
1188
- var import_math6 = require("@fuel-ts/math");
1189
- var import_transactions5 = require("@fuel-ts/transactions");
1187
+ var import_configs7 = require("@fuel-ts/address/configs");
1188
+ var import_math7 = require("@fuel-ts/math");
1189
+ var import_transactions6 = require("@fuel-ts/transactions");
1190
1190
  var import_utils9 = require("@fuel-ts/utils");
1191
1191
 
1192
1192
  // src/providers/resource.ts
@@ -1517,6 +1517,68 @@ function sleep(time) {
1517
1517
  });
1518
1518
  }
1519
1519
 
1520
+ // src/providers/utils/extract-tx-error.ts
1521
+ var import_errors7 = require("@fuel-ts/errors");
1522
+ var import_math6 = require("@fuel-ts/math");
1523
+ var import_transactions5 = require("@fuel-ts/transactions");
1524
+ var import_configs6 = require("@fuel-ts/transactions/configs");
1525
+ var assemblePanicError = (status) => {
1526
+ let errorMessage = `The transaction reverted with reason: "${status.reason}".`;
1527
+ if (import_configs6.PANIC_REASONS.includes(status.reason)) {
1528
+ errorMessage = `${errorMessage}
1529
+
1530
+ You can read more about this error at:
1531
+
1532
+ ${import_configs6.PANIC_DOC_URL}#variant.${status.reason}`;
1533
+ }
1534
+ return errorMessage;
1535
+ };
1536
+ var stringify = (obj) => JSON.stringify(obj, null, 2);
1537
+ var assembleRevertError = (receipts, logs) => {
1538
+ let errorMessage = "The transaction reverted with an unknown reason.";
1539
+ const revertReceipt = receipts.find(({ type }) => type === import_transactions5.ReceiptType.Revert);
1540
+ if (revertReceipt) {
1541
+ const reasonHex = (0, import_math6.bn)(revertReceipt.val).toHex();
1542
+ switch (reasonHex) {
1543
+ case import_configs6.FAILED_REQUIRE_SIGNAL: {
1544
+ errorMessage = `The transaction reverted because of a "require" statement has thrown ${logs.length ? stringify(logs[0]) : "an error."}.`;
1545
+ break;
1546
+ }
1547
+ case import_configs6.FAILED_ASSERT_EQ_SIGNAL: {
1548
+ const sufix = logs.length >= 2 ? ` comparing ${stringify(logs[1])} and ${stringify(logs[0])}.` : ".";
1549
+ errorMessage = `The transaction reverted because of an "assert_eq" statement${sufix}`;
1550
+ break;
1551
+ }
1552
+ case import_configs6.FAILED_ASSERT_NE_SIGNAL: {
1553
+ const sufix = logs.length >= 2 ? ` comparing ${stringify(logs[1])} and ${stringify(logs[0])}.` : ".";
1554
+ errorMessage = `The transaction reverted because of an "assert_ne" statement${sufix}`;
1555
+ break;
1556
+ }
1557
+ case import_configs6.FAILED_ASSERT_SIGNAL:
1558
+ errorMessage = `The transaction reverted because of an "assert" statement failed to evaluate to true.`;
1559
+ break;
1560
+ case import_configs6.FAILED_TRANSFER_TO_ADDRESS_SIGNAL:
1561
+ errorMessage = `The transaction reverted because missing "OutputChange"(s).`;
1562
+ break;
1563
+ default:
1564
+ errorMessage = `The transaction reverted with an unknown reason: ${revertReceipt.val}`;
1565
+ }
1566
+ }
1567
+ return errorMessage;
1568
+ };
1569
+ var extractTxError = (params) => {
1570
+ const { receipts, status, logs } = params;
1571
+ const wasPanic = receipts.some(({ type }) => type === import_transactions5.ReceiptType.Panic);
1572
+ let err = status?.type === "FailureStatus" && wasPanic ? assemblePanicError(status) : assembleRevertError(receipts, logs);
1573
+ err += `
1574
+
1575
+ logs: ${JSON.stringify(logs, null, 2)}`;
1576
+ err += `
1577
+
1578
+ receipts: ${JSON.stringify(receipts, null, 2)}`;
1579
+ return new import_errors7.FuelError(import_errors7.ErrorCode.SCRIPT_REVERTED, err);
1580
+ };
1581
+
1520
1582
  // src/providers/transaction-request/errors.ts
1521
1583
  var NoWitnessAtIndexError = class extends Error {
1522
1584
  constructor(index) {
@@ -1567,10 +1629,10 @@ var BaseTransactionRequest = class {
1567
1629
  outputs,
1568
1630
  witnesses
1569
1631
  } = {}) {
1570
- this.gasPrice = (0, import_math6.bn)(gasPrice);
1632
+ this.gasPrice = (0, import_math7.bn)(gasPrice);
1571
1633
  this.maturity = maturity ?? 0;
1572
- this.witnessLimit = witnessLimit ? (0, import_math6.bn)(witnessLimit) : void 0;
1573
- this.maxFee = maxFee ? (0, import_math6.bn)(maxFee) : void 0;
1634
+ this.witnessLimit = witnessLimit ? (0, import_math7.bn)(witnessLimit) : void 0;
1635
+ this.maxFee = maxFee ? (0, import_math7.bn)(maxFee) : void 0;
1574
1636
  this.inputs = inputs ?? [];
1575
1637
  this.outputs = outputs ?? [];
1576
1638
  this.witnesses = witnesses ?? [];
@@ -1579,20 +1641,20 @@ var BaseTransactionRequest = class {
1579
1641
  let policyTypes = 0;
1580
1642
  const policies = [];
1581
1643
  if (req.gasPrice) {
1582
- policyTypes += import_transactions5.PolicyType.GasPrice;
1583
- policies.push({ data: req.gasPrice, type: import_transactions5.PolicyType.GasPrice });
1644
+ policyTypes += import_transactions6.PolicyType.GasPrice;
1645
+ policies.push({ data: req.gasPrice, type: import_transactions6.PolicyType.GasPrice });
1584
1646
  }
1585
1647
  if (req.witnessLimit) {
1586
- policyTypes += import_transactions5.PolicyType.WitnessLimit;
1587
- policies.push({ data: req.witnessLimit, type: import_transactions5.PolicyType.WitnessLimit });
1648
+ policyTypes += import_transactions6.PolicyType.WitnessLimit;
1649
+ policies.push({ data: req.witnessLimit, type: import_transactions6.PolicyType.WitnessLimit });
1588
1650
  }
1589
1651
  if (req.maturity > 0) {
1590
- policyTypes += import_transactions5.PolicyType.Maturity;
1591
- policies.push({ data: req.maturity, type: import_transactions5.PolicyType.Maturity });
1652
+ policyTypes += import_transactions6.PolicyType.Maturity;
1653
+ policies.push({ data: req.maturity, type: import_transactions6.PolicyType.Maturity });
1592
1654
  }
1593
1655
  if (req.maxFee) {
1594
- policyTypes += import_transactions5.PolicyType.MaxFee;
1595
- policies.push({ data: req.maxFee, type: import_transactions5.PolicyType.MaxFee });
1656
+ policyTypes += import_transactions6.PolicyType.MaxFee;
1657
+ policies.push({ data: req.maxFee, type: import_transactions6.PolicyType.MaxFee });
1596
1658
  }
1597
1659
  return {
1598
1660
  policyTypes,
@@ -1626,7 +1688,7 @@ var BaseTransactionRequest = class {
1626
1688
  * @returns The transaction bytes.
1627
1689
  */
1628
1690
  toTransactionBytes() {
1629
- return new import_transactions5.TransactionCoder().encode(this.toTransaction());
1691
+ return new import_transactions6.TransactionCoder().encode(this.toTransaction());
1630
1692
  }
1631
1693
  /**
1632
1694
  * @hidden
@@ -1666,7 +1728,7 @@ var BaseTransactionRequest = class {
1666
1728
  * @returns The index of the created witness.
1667
1729
  */
1668
1730
  addEmptyWitness() {
1669
- this.addWitness((0, import_utils9.concat)([import_configs6.ZeroBytes32, import_configs6.ZeroBytes32]));
1731
+ this.addWitness((0, import_utils9.concat)([import_configs7.ZeroBytes32, import_configs7.ZeroBytes32]));
1670
1732
  return this.witnesses.length - 1;
1671
1733
  }
1672
1734
  /**
@@ -1717,7 +1779,7 @@ var BaseTransactionRequest = class {
1717
1779
  */
1718
1780
  getCoinInputs() {
1719
1781
  return this.inputs.filter(
1720
- (input) => input.type === import_transactions5.InputType.Coin
1782
+ (input) => input.type === import_transactions6.InputType.Coin
1721
1783
  );
1722
1784
  }
1723
1785
  /**
@@ -1727,7 +1789,7 @@ var BaseTransactionRequest = class {
1727
1789
  */
1728
1790
  getCoinOutputs() {
1729
1791
  return this.outputs.filter(
1730
- (output) => output.type === import_transactions5.OutputType.Coin
1792
+ (output) => output.type === import_transactions6.OutputType.Coin
1731
1793
  );
1732
1794
  }
1733
1795
  /**
@@ -1737,7 +1799,7 @@ var BaseTransactionRequest = class {
1737
1799
  */
1738
1800
  getChangeOutputs() {
1739
1801
  return this.outputs.filter(
1740
- (output) => output.type === import_transactions5.OutputType.Change
1802
+ (output) => output.type === import_transactions6.OutputType.Change
1741
1803
  );
1742
1804
  }
1743
1805
  /**
@@ -1749,9 +1811,9 @@ var BaseTransactionRequest = class {
1749
1811
  const ownerAddress = (0, import_address.addressify)(owner);
1750
1812
  const found = this.inputs.find((input) => {
1751
1813
  switch (input.type) {
1752
- case import_transactions5.InputType.Coin:
1814
+ case import_transactions6.InputType.Coin:
1753
1815
  return (0, import_utils9.hexlify)(input.owner) === ownerAddress.toB256();
1754
- case import_transactions5.InputType.Message:
1816
+ case import_transactions6.InputType.Message:
1755
1817
  return (0, import_utils9.hexlify)(input.recipient) === ownerAddress.toB256();
1756
1818
  default:
1757
1819
  return false;
@@ -1780,7 +1842,7 @@ var BaseTransactionRequest = class {
1780
1842
  }
1781
1843
  const input = {
1782
1844
  ...coin,
1783
- type: import_transactions5.InputType.Coin,
1845
+ type: import_transactions6.InputType.Coin,
1784
1846
  owner: owner.toB256(),
1785
1847
  amount,
1786
1848
  assetId,
@@ -1802,7 +1864,7 @@ var BaseTransactionRequest = class {
1802
1864
  */
1803
1865
  addMessageInput(message, predicate) {
1804
1866
  const { recipient, sender, amount } = message;
1805
- const assetId = import_configs6.BaseAssetId;
1867
+ const assetId = import_configs7.BaseAssetId;
1806
1868
  let witnessIndex;
1807
1869
  if (predicate) {
1808
1870
  witnessIndex = 0;
@@ -1814,7 +1876,7 @@ var BaseTransactionRequest = class {
1814
1876
  }
1815
1877
  const input = {
1816
1878
  ...message,
1817
- type: import_transactions5.InputType.Message,
1879
+ type: import_transactions6.InputType.Message,
1818
1880
  sender: sender.toB256(),
1819
1881
  recipient: recipient.toB256(),
1820
1882
  amount,
@@ -1884,9 +1946,9 @@ var BaseTransactionRequest = class {
1884
1946
  * @param amount - Amount of coin.
1885
1947
  * @param assetId - Asset ID of coin.
1886
1948
  */
1887
- addCoinOutput(to, amount, assetId = import_configs6.BaseAssetId) {
1949
+ addCoinOutput(to, amount, assetId = import_configs7.BaseAssetId) {
1888
1950
  this.pushOutput({
1889
- type: import_transactions5.OutputType.Coin,
1951
+ type: import_transactions6.OutputType.Coin,
1890
1952
  to: (0, import_address.addressify)(to).toB256(),
1891
1953
  amount,
1892
1954
  assetId
@@ -1902,7 +1964,7 @@ var BaseTransactionRequest = class {
1902
1964
  addCoinOutputs(to, quantities) {
1903
1965
  quantities.map(coinQuantityfy).forEach((quantity) => {
1904
1966
  this.pushOutput({
1905
- type: import_transactions5.OutputType.Coin,
1967
+ type: import_transactions6.OutputType.Coin,
1906
1968
  to: (0, import_address.addressify)(to).toB256(),
1907
1969
  amount: quantity.amount,
1908
1970
  assetId: quantity.assetId
@@ -1916,13 +1978,13 @@ var BaseTransactionRequest = class {
1916
1978
  * @param to - Address of the owner.
1917
1979
  * @param assetId - Asset ID of coin.
1918
1980
  */
1919
- addChangeOutput(to, assetId = import_configs6.BaseAssetId) {
1981
+ addChangeOutput(to, assetId = import_configs7.BaseAssetId) {
1920
1982
  const changeOutput = this.getChangeOutputs().find(
1921
1983
  (output) => (0, import_utils9.hexlify)(output.assetId) === assetId
1922
1984
  );
1923
1985
  if (!changeOutput) {
1924
1986
  this.pushOutput({
1925
- type: import_transactions5.OutputType.Change,
1987
+ type: import_transactions6.OutputType.Change,
1926
1988
  to: (0, import_address.addressify)(to).toB256(),
1927
1989
  assetId
1928
1990
  });
@@ -1978,7 +2040,7 @@ var BaseTransactionRequest = class {
1978
2040
  let idCounter = 0;
1979
2041
  const generateId = () => {
1980
2042
  const counterString = String(idCounter++);
1981
- const id = import_configs6.ZeroBytes32.slice(0, -counterString.length).concat(counterString);
2043
+ const id = import_configs7.ZeroBytes32.slice(0, -counterString.length).concat(counterString);
1982
2044
  return id;
1983
2045
  };
1984
2046
  const findAssetInput = (assetId) => this.inputs.find((input) => {
@@ -2000,13 +2062,13 @@ var BaseTransactionRequest = class {
2000
2062
  assetId,
2001
2063
  owner: resourcesOwner || import_address.Address.fromRandom(),
2002
2064
  maturity: 0,
2003
- blockCreated: (0, import_math6.bn)(1),
2004
- txCreatedIdx: (0, import_math6.bn)(1)
2065
+ blockCreated: (0, import_math7.bn)(1),
2066
+ txCreatedIdx: (0, import_math7.bn)(1)
2005
2067
  }
2006
2068
  ]);
2007
2069
  }
2008
2070
  };
2009
- updateAssetInput(import_configs6.BaseAssetId, (0, import_math6.bn)(1e11));
2071
+ updateAssetInput(import_configs7.BaseAssetId, (0, import_math7.bn)(1e11));
2010
2072
  quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
2011
2073
  }
2012
2074
  /**
@@ -2017,7 +2079,7 @@ var BaseTransactionRequest = class {
2017
2079
  */
2018
2080
  getCoinOutputsQuantities() {
2019
2081
  const coinsQuantities = this.getCoinOutputs().map(({ amount, assetId }) => ({
2020
- amount: (0, import_math6.bn)(amount),
2082
+ amount: (0, import_math7.bn)(amount),
2021
2083
  assetId: assetId.toString()
2022
2084
  }));
2023
2085
  return coinsQuantities;
@@ -2035,18 +2097,18 @@ var BaseTransactionRequest = class {
2035
2097
  this.inputs.forEach((i) => {
2036
2098
  let correspondingInput;
2037
2099
  switch (i.type) {
2038
- case import_transactions5.InputType.Coin:
2039
- correspondingInput = inputs.find((x) => x.type === import_transactions5.InputType.Coin && x.owner === i.owner);
2100
+ case import_transactions6.InputType.Coin:
2101
+ correspondingInput = inputs.find((x) => x.type === import_transactions6.InputType.Coin && x.owner === i.owner);
2040
2102
  break;
2041
- case import_transactions5.InputType.Message:
2103
+ case import_transactions6.InputType.Message:
2042
2104
  correspondingInput = inputs.find(
2043
- (x) => x.type === import_transactions5.InputType.Message && x.sender === i.sender
2105
+ (x) => x.type === import_transactions6.InputType.Message && x.sender === i.sender
2044
2106
  );
2045
2107
  break;
2046
2108
  default:
2047
2109
  return;
2048
2110
  }
2049
- if (correspondingInput && "predicateGasUsed" in correspondingInput && (0, import_math6.bn)(correspondingInput.predicateGasUsed).gt(0)) {
2111
+ if (correspondingInput && "predicateGasUsed" in correspondingInput && (0, import_math7.bn)(correspondingInput.predicateGasUsed).gt(0)) {
2050
2112
  i.predicate = correspondingInput.predicate;
2051
2113
  i.predicateData = correspondingInput.predicateData;
2052
2114
  i.predicateGasUsed = correspondingInput.predicateGasUsed;
@@ -2056,47 +2118,47 @@ var BaseTransactionRequest = class {
2056
2118
  };
2057
2119
 
2058
2120
  // src/providers/transaction-request/create-transaction-request.ts
2059
- var import_configs8 = require("@fuel-ts/address/configs");
2060
- var import_math8 = require("@fuel-ts/math");
2061
- var import_transactions7 = require("@fuel-ts/transactions");
2121
+ var import_configs9 = require("@fuel-ts/address/configs");
2122
+ var import_math9 = require("@fuel-ts/math");
2123
+ var import_transactions8 = require("@fuel-ts/transactions");
2062
2124
  var import_utils13 = require("@fuel-ts/utils");
2063
2125
 
2064
2126
  // src/providers/transaction-request/hash-transaction.ts
2065
- var import_configs7 = require("@fuel-ts/address/configs");
2127
+ var import_configs8 = require("@fuel-ts/address/configs");
2066
2128
  var import_hasher = require("@fuel-ts/hasher");
2067
- var import_math7 = require("@fuel-ts/math");
2068
- var import_transactions6 = require("@fuel-ts/transactions");
2129
+ var import_math8 = require("@fuel-ts/math");
2130
+ var import_transactions7 = require("@fuel-ts/transactions");
2069
2131
  var import_utils11 = require("@fuel-ts/utils");
2070
2132
  var import_ramda2 = require("ramda");
2071
2133
  function hashTransaction(transactionRequest, chainId) {
2072
2134
  const transaction = transactionRequest.toTransaction();
2073
- if (transaction.type === import_transactions6.TransactionType.Script) {
2074
- transaction.receiptsRoot = import_configs7.ZeroBytes32;
2135
+ if (transaction.type === import_transactions7.TransactionType.Script) {
2136
+ transaction.receiptsRoot = import_configs8.ZeroBytes32;
2075
2137
  }
2076
2138
  transaction.inputs = transaction.inputs.map((input) => {
2077
2139
  const inputClone = (0, import_ramda2.clone)(input);
2078
2140
  switch (inputClone.type) {
2079
- case import_transactions6.InputType.Coin: {
2141
+ case import_transactions7.InputType.Coin: {
2080
2142
  inputClone.txPointer = {
2081
2143
  blockHeight: 0,
2082
2144
  txIndex: 0
2083
2145
  };
2084
- inputClone.predicateGasUsed = (0, import_math7.bn)(0);
2146
+ inputClone.predicateGasUsed = (0, import_math8.bn)(0);
2085
2147
  return inputClone;
2086
2148
  }
2087
- case import_transactions6.InputType.Message: {
2088
- inputClone.predicateGasUsed = (0, import_math7.bn)(0);
2149
+ case import_transactions7.InputType.Message: {
2150
+ inputClone.predicateGasUsed = (0, import_math8.bn)(0);
2089
2151
  return inputClone;
2090
2152
  }
2091
- case import_transactions6.InputType.Contract: {
2153
+ case import_transactions7.InputType.Contract: {
2092
2154
  inputClone.txPointer = {
2093
2155
  blockHeight: 0,
2094
2156
  txIndex: 0
2095
2157
  };
2096
- inputClone.txID = import_configs7.ZeroBytes32;
2158
+ inputClone.txID = import_configs8.ZeroBytes32;
2097
2159
  inputClone.outputIndex = 0;
2098
- inputClone.balanceRoot = import_configs7.ZeroBytes32;
2099
- inputClone.stateRoot = import_configs7.ZeroBytes32;
2160
+ inputClone.balanceRoot = import_configs8.ZeroBytes32;
2161
+ inputClone.stateRoot = import_configs8.ZeroBytes32;
2100
2162
  return inputClone;
2101
2163
  }
2102
2164
  default:
@@ -2106,19 +2168,19 @@ function hashTransaction(transactionRequest, chainId) {
2106
2168
  transaction.outputs = transaction.outputs.map((output) => {
2107
2169
  const outputClone = (0, import_ramda2.clone)(output);
2108
2170
  switch (outputClone.type) {
2109
- case import_transactions6.OutputType.Contract: {
2110
- outputClone.balanceRoot = import_configs7.ZeroBytes32;
2111
- outputClone.stateRoot = import_configs7.ZeroBytes32;
2171
+ case import_transactions7.OutputType.Contract: {
2172
+ outputClone.balanceRoot = import_configs8.ZeroBytes32;
2173
+ outputClone.stateRoot = import_configs8.ZeroBytes32;
2112
2174
  return outputClone;
2113
2175
  }
2114
- case import_transactions6.OutputType.Change: {
2115
- outputClone.amount = (0, import_math7.bn)(0);
2176
+ case import_transactions7.OutputType.Change: {
2177
+ outputClone.amount = (0, import_math8.bn)(0);
2116
2178
  return outputClone;
2117
2179
  }
2118
- case import_transactions6.OutputType.Variable: {
2119
- outputClone.to = import_configs7.ZeroBytes32;
2120
- outputClone.amount = (0, import_math7.bn)(0);
2121
- outputClone.assetId = import_configs7.ZeroBytes32;
2180
+ case import_transactions7.OutputType.Variable: {
2181
+ outputClone.to = import_configs8.ZeroBytes32;
2182
+ outputClone.amount = (0, import_math8.bn)(0);
2183
+ outputClone.assetId = import_configs8.ZeroBytes32;
2122
2184
  return outputClone;
2123
2185
  }
2124
2186
  default:
@@ -2128,7 +2190,7 @@ function hashTransaction(transactionRequest, chainId) {
2128
2190
  transaction.witnessesCount = 0;
2129
2191
  transaction.witnesses = [];
2130
2192
  const chainIdBytes = (0, import_hasher.uint64ToBytesBE)(chainId);
2131
- const concatenatedData = (0, import_utils11.concat)([chainIdBytes, new import_transactions6.TransactionCoder().encode(transaction)]);
2193
+ const concatenatedData = (0, import_utils11.concat)([chainIdBytes, new import_transactions7.TransactionCoder().encode(transaction)]);
2132
2194
  return (0, import_hasher.sha256)(concatenatedData);
2133
2195
  }
2134
2196
 
@@ -2164,7 +2226,7 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2164
2226
  return new this(obj);
2165
2227
  }
2166
2228
  /** Type of the transaction */
2167
- type = import_transactions7.TransactionType.Create;
2229
+ type = import_transactions8.TransactionType.Create;
2168
2230
  /** Witness index of contract bytecode to create */
2169
2231
  bytecodeWitnessIndex;
2170
2232
  /** Salt */
@@ -2184,7 +2246,7 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2184
2246
  } = {}) {
2185
2247
  super(rest);
2186
2248
  this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
2187
- this.salt = (0, import_utils13.hexlify)(salt ?? import_configs8.ZeroBytes32);
2249
+ this.salt = (0, import_utils13.hexlify)(salt ?? import_configs9.ZeroBytes32);
2188
2250
  this.storageSlots = [...storageSlots ?? []];
2189
2251
  }
2190
2252
  /**
@@ -2197,12 +2259,12 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2197
2259
  const bytecodeWitnessIndex = this.bytecodeWitnessIndex;
2198
2260
  const storageSlots = this.storageSlots?.map(storageSlotify) ?? [];
2199
2261
  return {
2200
- type: import_transactions7.TransactionType.Create,
2262
+ type: import_transactions8.TransactionType.Create,
2201
2263
  ...baseTransaction,
2202
2264
  bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
2203
2265
  bytecodeWitnessIndex,
2204
2266
  storageSlotsCount: storageSlots.length,
2205
- salt: this.salt ? (0, import_utils13.hexlify)(this.salt) : import_configs8.ZeroBytes32,
2267
+ salt: this.salt ? (0, import_utils13.hexlify)(this.salt) : import_configs9.ZeroBytes32,
2206
2268
  storageSlots
2207
2269
  };
2208
2270
  }
@@ -2213,7 +2275,7 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2213
2275
  */
2214
2276
  getContractCreatedOutputs() {
2215
2277
  return this.outputs.filter(
2216
- (output) => output.type === import_transactions7.OutputType.ContractCreated
2278
+ (output) => output.type === import_transactions8.OutputType.ContractCreated
2217
2279
  );
2218
2280
  }
2219
2281
  /**
@@ -2234,14 +2296,14 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2234
2296
  */
2235
2297
  addContractCreatedOutput(contractId, stateRoot) {
2236
2298
  this.pushOutput({
2237
- type: import_transactions7.OutputType.ContractCreated,
2299
+ type: import_transactions8.OutputType.ContractCreated,
2238
2300
  contractId,
2239
2301
  stateRoot
2240
2302
  });
2241
2303
  }
2242
2304
  metadataGas(gasCosts) {
2243
2305
  return calculateMetadataGasForTxCreate({
2244
- contractBytesSize: (0, import_math8.bn)((0, import_utils13.arrayify)(this.witnesses[this.bytecodeWitnessIndex] || "0x").length),
2306
+ contractBytesSize: (0, import_math9.bn)((0, import_utils13.arrayify)(this.witnesses[this.bytecodeWitnessIndex] || "0x").length),
2245
2307
  gasCosts,
2246
2308
  stateRootSize: this.storageSlots.length,
2247
2309
  txBytesSize: this.byteSize()
@@ -2252,9 +2314,9 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2252
2314
  // src/providers/transaction-request/script-transaction-request.ts
2253
2315
  var import_abi_coder = require("@fuel-ts/abi-coder");
2254
2316
  var import_address2 = require("@fuel-ts/address");
2255
- var import_configs9 = require("@fuel-ts/address/configs");
2256
- var import_math9 = require("@fuel-ts/math");
2257
- var import_transactions8 = require("@fuel-ts/transactions");
2317
+ var import_configs10 = require("@fuel-ts/address/configs");
2318
+ var import_math10 = require("@fuel-ts/math");
2319
+ var import_transactions9 = require("@fuel-ts/transactions");
2258
2320
  var import_utils15 = require("@fuel-ts/utils");
2259
2321
 
2260
2322
  // src/providers/transaction-request/scripts.ts
@@ -2292,13 +2354,14 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2292
2354
  return new this(obj);
2293
2355
  }
2294
2356
  /** Type of the transaction */
2295
- type = import_transactions8.TransactionType.Script;
2357
+ type = import_transactions9.TransactionType.Script;
2296
2358
  /** Gas limit for transaction */
2297
2359
  gasLimit;
2298
2360
  /** Script to execute */
2299
2361
  script;
2300
2362
  /** Script input data (parameters) */
2301
2363
  scriptData;
2364
+ abis;
2302
2365
  /**
2303
2366
  * Constructor for `ScriptTransactionRequest`.
2304
2367
  *
@@ -2306,9 +2369,10 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2306
2369
  */
2307
2370
  constructor({ script, scriptData, gasLimit, ...rest } = {}) {
2308
2371
  super(rest);
2309
- this.gasLimit = (0, import_math9.bn)(gasLimit);
2372
+ this.gasLimit = (0, import_math10.bn)(gasLimit);
2310
2373
  this.script = (0, import_utils15.arrayify)(script ?? returnZeroScript.bytes);
2311
2374
  this.scriptData = (0, import_utils15.arrayify)(scriptData ?? returnZeroScript.encodeScriptData());
2375
+ this.abis = rest.abis;
2312
2376
  }
2313
2377
  /**
2314
2378
  * Converts the transaction request to a `TransactionScript`.
@@ -2319,12 +2383,12 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2319
2383
  const script = (0, import_utils15.arrayify)(this.script ?? "0x");
2320
2384
  const scriptData = (0, import_utils15.arrayify)(this.scriptData ?? "0x");
2321
2385
  return {
2322
- type: import_transactions8.TransactionType.Script,
2386
+ type: import_transactions9.TransactionType.Script,
2323
2387
  scriptGasLimit: this.gasLimit,
2324
2388
  ...super.getBaseTransaction(),
2325
2389
  scriptLength: script.length,
2326
2390
  scriptDataLength: scriptData.length,
2327
- receiptsRoot: import_configs9.ZeroBytes32,
2391
+ receiptsRoot: import_configs10.ZeroBytes32,
2328
2392
  script: (0, import_utils15.hexlify)(script),
2329
2393
  scriptData: (0, import_utils15.hexlify)(scriptData)
2330
2394
  };
@@ -2336,7 +2400,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2336
2400
  */
2337
2401
  getContractInputs() {
2338
2402
  return this.inputs.filter(
2339
- (input) => input.type === import_transactions8.InputType.Contract
2403
+ (input) => input.type === import_transactions9.InputType.Contract
2340
2404
  );
2341
2405
  }
2342
2406
  /**
@@ -2346,7 +2410,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2346
2410
  */
2347
2411
  getContractOutputs() {
2348
2412
  return this.outputs.filter(
2349
- (output) => output.type === import_transactions8.OutputType.Contract
2413
+ (output) => output.type === import_transactions9.OutputType.Contract
2350
2414
  );
2351
2415
  }
2352
2416
  /**
@@ -2356,7 +2420,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2356
2420
  */
2357
2421
  getVariableOutputs() {
2358
2422
  return this.outputs.filter(
2359
- (output) => output.type === import_transactions8.OutputType.Variable
2423
+ (output) => output.type === import_transactions9.OutputType.Variable
2360
2424
  );
2361
2425
  }
2362
2426
  /**
@@ -2379,7 +2443,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2379
2443
  let outputsNumber = numberOfVariables;
2380
2444
  while (outputsNumber) {
2381
2445
  this.pushOutput({
2382
- type: import_transactions8.OutputType.Variable
2446
+ type: import_transactions9.OutputType.Variable
2383
2447
  });
2384
2448
  outputsNumber -= 1;
2385
2449
  }
@@ -2412,12 +2476,12 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2412
2476
  return this;
2413
2477
  }
2414
2478
  const inputIndex = super.pushInput({
2415
- type: import_transactions8.InputType.Contract,
2479
+ type: import_transactions9.InputType.Contract,
2416
2480
  contractId: contractAddress.toB256(),
2417
2481
  txPointer: "0x00000000000000000000000000000000"
2418
2482
  });
2419
2483
  this.pushOutput({
2420
- type: import_transactions8.OutputType.Contract,
2484
+ type: import_transactions9.OutputType.Contract,
2421
2485
  inputIndex
2422
2486
  });
2423
2487
  return this;
@@ -2453,38 +2517,38 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2453
2517
  };
2454
2518
 
2455
2519
  // src/providers/transaction-request/utils.ts
2456
- var import_errors8 = require("@fuel-ts/errors");
2457
- var import_transactions9 = require("@fuel-ts/transactions");
2520
+ var import_errors9 = require("@fuel-ts/errors");
2521
+ var import_transactions10 = require("@fuel-ts/transactions");
2458
2522
  var transactionRequestify = (obj) => {
2459
2523
  if (obj instanceof ScriptTransactionRequest || obj instanceof CreateTransactionRequest) {
2460
2524
  return obj;
2461
2525
  }
2462
2526
  const { type } = obj;
2463
2527
  switch (obj.type) {
2464
- case import_transactions9.TransactionType.Script: {
2528
+ case import_transactions10.TransactionType.Script: {
2465
2529
  return ScriptTransactionRequest.from(obj);
2466
2530
  }
2467
- case import_transactions9.TransactionType.Create: {
2531
+ case import_transactions10.TransactionType.Create: {
2468
2532
  return CreateTransactionRequest.from(obj);
2469
2533
  }
2470
2534
  default: {
2471
- throw new import_errors8.FuelError(import_errors8.ErrorCode.INVALID_TRANSACTION_TYPE, `Invalid transaction type: ${type}.`);
2535
+ throw new import_errors9.FuelError(import_errors9.ErrorCode.INVALID_TRANSACTION_TYPE, `Invalid transaction type: ${type}.`);
2472
2536
  }
2473
2537
  }
2474
2538
  };
2475
2539
 
2476
2540
  // src/providers/transaction-response/transaction-response.ts
2477
- var import_errors12 = require("@fuel-ts/errors");
2478
- var import_math13 = require("@fuel-ts/math");
2479
- var import_transactions15 = require("@fuel-ts/transactions");
2541
+ var import_errors13 = require("@fuel-ts/errors");
2542
+ var import_math14 = require("@fuel-ts/math");
2543
+ var import_transactions17 = require("@fuel-ts/transactions");
2480
2544
  var import_utils21 = require("@fuel-ts/utils");
2481
2545
 
2482
2546
  // src/providers/transaction-summary/assemble-transaction-summary.ts
2483
2547
  var import_utils19 = require("@fuel-ts/utils");
2484
2548
 
2485
2549
  // src/providers/transaction-summary/calculate-transaction-fee.ts
2486
- var import_math10 = require("@fuel-ts/math");
2487
- var import_transactions10 = require("@fuel-ts/transactions");
2550
+ var import_math11 = require("@fuel-ts/math");
2551
+ var import_transactions11 = require("@fuel-ts/transactions");
2488
2552
  var import_utils16 = require("@fuel-ts/utils");
2489
2553
  var calculateTransactionFee = (params) => {
2490
2554
  const {
@@ -2492,24 +2556,24 @@ var calculateTransactionFee = (params) => {
2492
2556
  rawPayload,
2493
2557
  consensusParameters: { gasCosts, feeParams }
2494
2558
  } = params;
2495
- const gasPerByte = (0, import_math10.bn)(feeParams.gasPerByte);
2496
- const gasPriceFactor = (0, import_math10.bn)(feeParams.gasPriceFactor);
2559
+ const gasPerByte = (0, import_math11.bn)(feeParams.gasPerByte);
2560
+ const gasPriceFactor = (0, import_math11.bn)(feeParams.gasPriceFactor);
2497
2561
  const transactionBytes = (0, import_utils16.arrayify)(rawPayload);
2498
- const [transaction] = new import_transactions10.TransactionCoder().decode(transactionBytes, 0);
2499
- if (transaction.type === import_transactions10.TransactionType.Mint) {
2562
+ const [transaction] = new import_transactions11.TransactionCoder().decode(transactionBytes, 0);
2563
+ if (transaction.type === import_transactions11.TransactionType.Mint) {
2500
2564
  return {
2501
- fee: (0, import_math10.bn)(0),
2502
- minFee: (0, import_math10.bn)(0),
2503
- maxFee: (0, import_math10.bn)(0),
2504
- feeFromGasUsed: (0, import_math10.bn)(0)
2565
+ fee: (0, import_math11.bn)(0),
2566
+ minFee: (0, import_math11.bn)(0),
2567
+ maxFee: (0, import_math11.bn)(0),
2568
+ feeFromGasUsed: (0, import_math11.bn)(0)
2505
2569
  };
2506
2570
  }
2507
2571
  const { type, witnesses, inputs, policies } = transaction;
2508
- let metadataGas = (0, import_math10.bn)(0);
2509
- let gasLimit = (0, import_math10.bn)(0);
2510
- if (type === import_transactions10.TransactionType.Create) {
2572
+ let metadataGas = (0, import_math11.bn)(0);
2573
+ let gasLimit = (0, import_math11.bn)(0);
2574
+ if (type === import_transactions11.TransactionType.Create) {
2511
2575
  const { bytecodeWitnessIndex, storageSlots } = transaction;
2512
- const contractBytesSize = (0, import_math10.bn)((0, import_utils16.arrayify)(witnesses[bytecodeWitnessIndex].data).length);
2576
+ const contractBytesSize = (0, import_math11.bn)((0, import_utils16.arrayify)(witnesses[bytecodeWitnessIndex].data).length);
2513
2577
  metadataGas = calculateMetadataGasForTxCreate({
2514
2578
  contractBytesSize,
2515
2579
  gasCosts,
@@ -2528,13 +2592,13 @@ var calculateTransactionFee = (params) => {
2528
2592
  }
2529
2593
  const minGas = getMinGas({
2530
2594
  gasCosts,
2531
- gasPerByte: (0, import_math10.bn)(gasPerByte),
2595
+ gasPerByte: (0, import_math11.bn)(gasPerByte),
2532
2596
  inputs,
2533
2597
  metadataGas,
2534
2598
  txBytesSize: transactionBytes.length
2535
2599
  });
2536
- const gasPrice = (0, import_math10.bn)(policies.find((policy) => policy.type === import_transactions10.PolicyType.GasPrice)?.data);
2537
- const witnessLimit = policies.find((policy) => policy.type === import_transactions10.PolicyType.WitnessLimit)?.data;
2600
+ const gasPrice = (0, import_math11.bn)(policies.find((policy) => policy.type === import_transactions11.PolicyType.GasPrice)?.data);
2601
+ const witnessLimit = policies.find((policy) => policy.type === import_transactions11.PolicyType.WitnessLimit)?.data;
2538
2602
  const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
2539
2603
  const maxGas = getMaxGas({
2540
2604
  gasPerByte,
@@ -2556,14 +2620,14 @@ var calculateTransactionFee = (params) => {
2556
2620
  };
2557
2621
 
2558
2622
  // src/providers/transaction-summary/operations.ts
2559
- var import_configs10 = require("@fuel-ts/address/configs");
2560
- var import_errors10 = require("@fuel-ts/errors");
2561
- var import_math12 = require("@fuel-ts/math");
2562
- var import_transactions13 = require("@fuel-ts/transactions");
2623
+ var import_configs11 = require("@fuel-ts/address/configs");
2624
+ var import_errors11 = require("@fuel-ts/errors");
2625
+ var import_math13 = require("@fuel-ts/math");
2626
+ var import_transactions14 = require("@fuel-ts/transactions");
2563
2627
 
2564
2628
  // src/providers/transaction-summary/call.ts
2565
2629
  var import_abi_coder2 = require("@fuel-ts/abi-coder");
2566
- var import_math11 = require("@fuel-ts/math");
2630
+ var import_math12 = require("@fuel-ts/math");
2567
2631
  var getFunctionCall = ({ abi, receipt, rawPayload, maxInputs }) => {
2568
2632
  const abiInterface = new import_abi_coder2.Interface(abi);
2569
2633
  const callFunctionSelector = receipt.param1.toHex(8);
@@ -2572,7 +2636,7 @@ var getFunctionCall = ({ abi, receipt, rawPayload, maxInputs }) => {
2572
2636
  let encodedArgs;
2573
2637
  if (functionFragment.isInputDataPointer) {
2574
2638
  if (rawPayload) {
2575
- const argsOffset = (0, import_math11.bn)(receipt.param2).sub((0, import_abi_coder2.calculateVmTxMemory)({ maxInputs: maxInputs.toNumber() })).toNumber();
2639
+ const argsOffset = (0, import_math12.bn)(receipt.param2).sub((0, import_abi_coder2.calculateVmTxMemory)({ maxInputs: maxInputs.toNumber() })).toNumber();
2576
2640
  encodedArgs = `0x${rawPayload.slice(2).slice(argsOffset * 2)}`;
2577
2641
  }
2578
2642
  } else {
@@ -2606,8 +2670,8 @@ var getFunctionCall = ({ abi, receipt, rawPayload, maxInputs }) => {
2606
2670
  };
2607
2671
 
2608
2672
  // src/providers/transaction-summary/input.ts
2609
- var import_errors9 = require("@fuel-ts/errors");
2610
- var import_transactions11 = require("@fuel-ts/transactions");
2673
+ var import_errors10 = require("@fuel-ts/errors");
2674
+ var import_transactions12 = require("@fuel-ts/transactions");
2611
2675
  function getInputsByTypes(inputs, types) {
2612
2676
  return inputs.filter((i) => types.includes(i.type));
2613
2677
  }
@@ -2615,16 +2679,16 @@ function getInputsByType(inputs, type) {
2615
2679
  return inputs.filter((i) => i.type === type);
2616
2680
  }
2617
2681
  function getInputsCoin(inputs) {
2618
- return getInputsByType(inputs, import_transactions11.InputType.Coin);
2682
+ return getInputsByType(inputs, import_transactions12.InputType.Coin);
2619
2683
  }
2620
2684
  function getInputsMessage(inputs) {
2621
- return getInputsByType(inputs, import_transactions11.InputType.Message);
2685
+ return getInputsByType(inputs, import_transactions12.InputType.Message);
2622
2686
  }
2623
2687
  function getInputsCoinAndMessage(inputs) {
2624
- return getInputsByTypes(inputs, [import_transactions11.InputType.Coin, import_transactions11.InputType.Message]);
2688
+ return getInputsByTypes(inputs, [import_transactions12.InputType.Coin, import_transactions12.InputType.Message]);
2625
2689
  }
2626
2690
  function getInputsContract(inputs) {
2627
- return getInputsByType(inputs, import_transactions11.InputType.Contract);
2691
+ return getInputsByType(inputs, import_transactions12.InputType.Contract);
2628
2692
  }
2629
2693
  function getInputFromAssetId(inputs, assetId) {
2630
2694
  const coinInputs = getInputsCoin(inputs);
@@ -2643,40 +2707,40 @@ function getInputContractFromIndex(inputs, inputIndex) {
2643
2707
  if (!contractInput) {
2644
2708
  return void 0;
2645
2709
  }
2646
- if (contractInput.type !== import_transactions11.InputType.Contract) {
2647
- throw new import_errors9.FuelError(
2648
- import_errors9.ErrorCode.INVALID_TRANSACTION_INPUT,
2710
+ if (contractInput.type !== import_transactions12.InputType.Contract) {
2711
+ throw new import_errors10.FuelError(
2712
+ import_errors10.ErrorCode.INVALID_TRANSACTION_INPUT,
2649
2713
  `Contract input should be of type 'contract'.`
2650
2714
  );
2651
2715
  }
2652
2716
  return contractInput;
2653
2717
  }
2654
2718
  function getInputAccountAddress(input) {
2655
- if (input.type === import_transactions11.InputType.Coin) {
2719
+ if (input.type === import_transactions12.InputType.Coin) {
2656
2720
  return input.owner.toString();
2657
2721
  }
2658
- if (input.type === import_transactions11.InputType.Message) {
2722
+ if (input.type === import_transactions12.InputType.Message) {
2659
2723
  return input.recipient.toString();
2660
2724
  }
2661
2725
  return "";
2662
2726
  }
2663
2727
 
2664
2728
  // src/providers/transaction-summary/output.ts
2665
- var import_transactions12 = require("@fuel-ts/transactions");
2729
+ var import_transactions13 = require("@fuel-ts/transactions");
2666
2730
  function getOutputsByType(outputs, type) {
2667
2731
  return outputs.filter((o) => o.type === type);
2668
2732
  }
2669
2733
  function getOutputsContractCreated(outputs) {
2670
- return getOutputsByType(outputs, import_transactions12.OutputType.ContractCreated);
2734
+ return getOutputsByType(outputs, import_transactions13.OutputType.ContractCreated);
2671
2735
  }
2672
2736
  function getOutputsCoin(outputs) {
2673
- return getOutputsByType(outputs, import_transactions12.OutputType.Coin);
2737
+ return getOutputsByType(outputs, import_transactions13.OutputType.Coin);
2674
2738
  }
2675
2739
  function getOutputsChange(outputs) {
2676
- return getOutputsByType(outputs, import_transactions12.OutputType.Change);
2740
+ return getOutputsByType(outputs, import_transactions13.OutputType.Change);
2677
2741
  }
2678
2742
  function getOutputsContract(outputs) {
2679
- return getOutputsByType(outputs, import_transactions12.OutputType.Contract);
2743
+ return getOutputsByType(outputs, import_transactions13.OutputType.Contract);
2680
2744
  }
2681
2745
 
2682
2746
  // src/providers/transaction-summary/operations.ts
@@ -2685,15 +2749,15 @@ function getReceiptsByType(receipts, type) {
2685
2749
  }
2686
2750
  function getTransactionTypeName(transactionType) {
2687
2751
  switch (transactionType) {
2688
- case import_transactions13.TransactionType.Mint:
2752
+ case import_transactions14.TransactionType.Mint:
2689
2753
  return "Mint" /* Mint */;
2690
- case import_transactions13.TransactionType.Create:
2754
+ case import_transactions14.TransactionType.Create:
2691
2755
  return "Create" /* Create */;
2692
- case import_transactions13.TransactionType.Script:
2756
+ case import_transactions14.TransactionType.Script:
2693
2757
  return "Script" /* Script */;
2694
2758
  default:
2695
- throw new import_errors10.FuelError(
2696
- import_errors10.ErrorCode.INVALID_TRANSACTION_TYPE,
2759
+ throw new import_errors11.FuelError(
2760
+ import_errors11.ErrorCode.INVALID_TRANSACTION_TYPE,
2697
2761
  `Invalid transaction type: ${transactionType}.`
2698
2762
  );
2699
2763
  }
@@ -2712,10 +2776,10 @@ function isTypeScript(transactionType) {
2712
2776
  return isType(transactionType, "Script" /* Script */);
2713
2777
  }
2714
2778
  function getReceiptsCall(receipts) {
2715
- return getReceiptsByType(receipts, import_transactions13.ReceiptType.Call);
2779
+ return getReceiptsByType(receipts, import_transactions14.ReceiptType.Call);
2716
2780
  }
2717
2781
  function getReceiptsMessageOut(receipts) {
2718
- return getReceiptsByType(receipts, import_transactions13.ReceiptType.MessageOut);
2782
+ return getReceiptsByType(receipts, import_transactions14.ReceiptType.MessageOut);
2719
2783
  }
2720
2784
  var mergeAssets = (op1, op2) => {
2721
2785
  const assets1 = op1.assetsSent || [];
@@ -2728,7 +2792,7 @@ var mergeAssets = (op1, op2) => {
2728
2792
  if (!matchingAsset) {
2729
2793
  return asset1;
2730
2794
  }
2731
- const mergedAmount = (0, import_math12.bn)(asset1.amount).add(matchingAsset.amount);
2795
+ const mergedAmount = (0, import_math13.bn)(asset1.amount).add(matchingAsset.amount);
2732
2796
  return { ...asset1, amount: mergedAmount };
2733
2797
  });
2734
2798
  return mergedAssets.concat(filteredAssets);
@@ -2854,7 +2918,7 @@ function extractTransferOperationFromReceipt(receipt, contractInputs, changeOutp
2854
2918
  const { to: toAddress, assetId, amount } = receipt;
2855
2919
  let { from: fromAddress } = receipt;
2856
2920
  const toType = contractInputs.some((input) => input.contractID === toAddress) ? 0 /* contract */ : 1 /* account */;
2857
- if (import_configs10.ZeroBytes32 === fromAddress) {
2921
+ if (import_configs11.ZeroBytes32 === fromAddress) {
2858
2922
  const change = changeOutputs.find((output) => output.assetId === assetId);
2859
2923
  fromAddress = change?.to || fromAddress;
2860
2924
  }
@@ -2911,11 +2975,11 @@ function getTransferOperations({
2911
2975
  });
2912
2976
  const transferReceipts = getReceiptsByType(
2913
2977
  receipts,
2914
- import_transactions13.ReceiptType.Transfer
2978
+ import_transactions14.ReceiptType.Transfer
2915
2979
  );
2916
2980
  const transferOutReceipts = getReceiptsByType(
2917
2981
  receipts,
2918
- import_transactions13.ReceiptType.TransferOut
2982
+ import_transactions14.ReceiptType.TransferOut
2919
2983
  );
2920
2984
  [...transferReceipts, ...transferOutReceipts].forEach((receipt) => {
2921
2985
  const operation = extractTransferOperationFromReceipt(receipt, contractInputs, changeOutputs);
@@ -3000,17 +3064,17 @@ function getOperations({
3000
3064
  }
3001
3065
 
3002
3066
  // src/providers/transaction-summary/receipt.ts
3003
- var import_transactions14 = require("@fuel-ts/transactions");
3067
+ var import_transactions15 = require("@fuel-ts/transactions");
3004
3068
  var processGqlReceipt = (gqlReceipt) => {
3005
3069
  const receipt = assembleReceiptByType(gqlReceipt);
3006
3070
  switch (receipt.type) {
3007
- case import_transactions14.ReceiptType.ReturnData: {
3071
+ case import_transactions15.ReceiptType.ReturnData: {
3008
3072
  return {
3009
3073
  ...receipt,
3010
3074
  data: gqlReceipt.data || "0x"
3011
3075
  };
3012
3076
  }
3013
- case import_transactions14.ReceiptType.LogData: {
3077
+ case import_transactions15.ReceiptType.LogData: {
3014
3078
  return {
3015
3079
  ...receipt,
3016
3080
  data: gqlReceipt.data || "0x"
@@ -3023,7 +3087,7 @@ var processGqlReceipt = (gqlReceipt) => {
3023
3087
  var extractMintedAssetsFromReceipts = (receipts) => {
3024
3088
  const mintedAssets = [];
3025
3089
  receipts.forEach((receipt) => {
3026
- if (receipt.type === import_transactions14.ReceiptType.Mint) {
3090
+ if (receipt.type === import_transactions15.ReceiptType.Mint) {
3027
3091
  mintedAssets.push({
3028
3092
  subId: receipt.subId,
3029
3093
  contractId: receipt.contractId,
@@ -3037,7 +3101,7 @@ var extractMintedAssetsFromReceipts = (receipts) => {
3037
3101
  var extractBurnedAssetsFromReceipts = (receipts) => {
3038
3102
  const burnedAssets = [];
3039
3103
  receipts.forEach((receipt) => {
3040
- if (receipt.type === import_transactions14.ReceiptType.Burn) {
3104
+ if (receipt.type === import_transactions15.ReceiptType.Burn) {
3041
3105
  burnedAssets.push({
3042
3106
  subId: receipt.subId,
3043
3107
  contractId: receipt.contractId,
@@ -3050,7 +3114,7 @@ var extractBurnedAssetsFromReceipts = (receipts) => {
3050
3114
  };
3051
3115
 
3052
3116
  // src/providers/transaction-summary/status.ts
3053
- var import_errors11 = require("@fuel-ts/errors");
3117
+ var import_errors12 = require("@fuel-ts/errors");
3054
3118
  var getTransactionStatusName = (gqlStatus) => {
3055
3119
  switch (gqlStatus) {
3056
3120
  case "FailureStatus":
@@ -3062,8 +3126,8 @@ var getTransactionStatusName = (gqlStatus) => {
3062
3126
  case "SqueezedOutStatus":
3063
3127
  return "squeezedout" /* squeezedout */;
3064
3128
  default:
3065
- throw new import_errors11.FuelError(
3066
- import_errors11.ErrorCode.INVALID_TRANSACTION_STATUS,
3129
+ throw new import_errors12.FuelError(
3130
+ import_errors12.ErrorCode.INVALID_TRANSACTION_STATUS,
3067
3131
  `Invalid transaction status: ${gqlStatus}.`
3068
3132
  );
3069
3133
  }
@@ -3174,6 +3238,21 @@ function assembleTransactionSummary(params) {
3174
3238
  return transactionSummary;
3175
3239
  }
3176
3240
 
3241
+ // src/providers/transaction-response/getDecodedLogs.ts
3242
+ var import_abi_coder3 = require("@fuel-ts/abi-coder");
3243
+ var import_transactions16 = require("@fuel-ts/transactions");
3244
+ function getDecodedLogs(receipts, mainAbi, externalAbis = {}) {
3245
+ return receipts.reduce((logs, receipt) => {
3246
+ if (receipt.type === import_transactions16.ReceiptType.LogData || receipt.type === import_transactions16.ReceiptType.Log) {
3247
+ const interfaceToUse = new import_abi_coder3.Interface(externalAbis[receipt.id] || mainAbi);
3248
+ const data = receipt.type === import_transactions16.ReceiptType.Log ? new import_abi_coder3.BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
3249
+ const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toNumber());
3250
+ logs.push(decodedLog);
3251
+ }
3252
+ return logs;
3253
+ }, []);
3254
+ }
3255
+
3177
3256
  // src/providers/transaction-response/transaction-response.ts
3178
3257
  var TransactionResponse = class {
3179
3258
  /** Transaction ID */
@@ -3181,18 +3260,20 @@ var TransactionResponse = class {
3181
3260
  /** Current provider */
3182
3261
  provider;
3183
3262
  /** Gas used on the transaction */
3184
- gasUsed = (0, import_math13.bn)(0);
3263
+ gasUsed = (0, import_math14.bn)(0);
3185
3264
  /** The graphql Transaction with receipts object. */
3186
3265
  gqlTransaction;
3266
+ abis;
3187
3267
  /**
3188
3268
  * Constructor for `TransactionResponse`.
3189
3269
  *
3190
3270
  * @param id - The transaction ID.
3191
3271
  * @param provider - The provider.
3192
3272
  */
3193
- constructor(id, provider) {
3273
+ constructor(id, provider, abis) {
3194
3274
  this.id = id;
3195
3275
  this.provider = provider;
3276
+ this.abis = abis;
3196
3277
  }
3197
3278
  /**
3198
3279
  * Async constructor for `TransactionResponse`. This method can be used to create
@@ -3202,8 +3283,8 @@ var TransactionResponse = class {
3202
3283
  * @param id - The transaction ID.
3203
3284
  * @param provider - The provider.
3204
3285
  */
3205
- static async create(id, provider) {
3206
- const response = new TransactionResponse(id, provider);
3286
+ static async create(id, provider, abis) {
3287
+ const response = new TransactionResponse(id, provider, abis);
3207
3288
  await response.fetch();
3208
3289
  return response;
3209
3290
  }
@@ -3237,7 +3318,7 @@ var TransactionResponse = class {
3237
3318
  * @returns The decoded transaction.
3238
3319
  */
3239
3320
  decodeTransaction(transactionWithReceipts) {
3240
- return new import_transactions15.TransactionCoder().decode(
3321
+ return new import_transactions17.TransactionCoder().decode(
3241
3322
  (0, import_utils21.arrayify)(transactionWithReceipts.rawPayload),
3242
3323
  0
3243
3324
  )?.[0];
@@ -3284,8 +3365,8 @@ var TransactionResponse = class {
3284
3365
  });
3285
3366
  for await (const { statusChange } of subscription) {
3286
3367
  if (statusChange.type === "SqueezedOutStatus") {
3287
- throw new import_errors12.FuelError(
3288
- import_errors12.ErrorCode.TRANSACTION_SQUEEZED_OUT,
3368
+ throw new import_errors13.FuelError(
3369
+ import_errors13.ErrorCode.TRANSACTION_SQUEEZED_OUT,
3289
3370
  `Transaction Squeezed Out with reason: ${statusChange.reason}`
3290
3371
  );
3291
3372
  }
@@ -3307,6 +3388,26 @@ var TransactionResponse = class {
3307
3388
  gqlTransaction: this.gqlTransaction,
3308
3389
  ...transactionSummary
3309
3390
  };
3391
+ let logs = [];
3392
+ if (this.abis) {
3393
+ logs = getDecodedLogs(
3394
+ transactionSummary.receipts,
3395
+ this.abis.main,
3396
+ this.abis.otherContractsAbis
3397
+ );
3398
+ transactionResult.logs = logs;
3399
+ }
3400
+ if (transactionResult.isStatusFailure) {
3401
+ const {
3402
+ receipts,
3403
+ gqlTransaction: { status }
3404
+ } = transactionResult;
3405
+ throw extractTxError({
3406
+ receipts,
3407
+ status,
3408
+ logs
3409
+ });
3410
+ }
3310
3411
  return transactionResult;
3311
3412
  }
3312
3413
  /**
@@ -3317,19 +3418,21 @@ var TransactionResponse = class {
3317
3418
  async wait(contractsAbiMap) {
3318
3419
  const result = await this.waitForResult(contractsAbiMap);
3319
3420
  if (result.isStatusFailure) {
3320
- throw new import_errors12.FuelError(
3321
- import_errors12.ErrorCode.TRANSACTION_FAILED,
3322
- `Transaction failed: ${result.gqlTransaction.status.reason}`
3323
- );
3421
+ const {
3422
+ receipts,
3423
+ logs = [],
3424
+ gqlTransaction: { status }
3425
+ } = result;
3426
+ throw extractTxError({
3427
+ receipts,
3428
+ logs,
3429
+ status
3430
+ });
3324
3431
  }
3325
3432
  return result;
3326
3433
  }
3327
3434
  };
3328
3435
 
3329
- // src/providers/transaction-response/getDecodedLogs.ts
3330
- var import_abi_coder3 = require("@fuel-ts/abi-coder");
3331
- var import_transactions16 = require("@fuel-ts/transactions");
3332
-
3333
3436
  // src/providers/utils/auto-retry-fetch.ts
3334
3437
  function getWaitDelay(options, retryAttemptNum) {
3335
3438
  const duration = options.baseDelay ?? 150;
@@ -3388,29 +3491,29 @@ var processGqlChain = (chain) => {
3388
3491
  const { contractParams, feeParams, predicateParams, scriptParams, txParams, gasCosts } = consensusParameters;
3389
3492
  return {
3390
3493
  name,
3391
- baseChainHeight: (0, import_math14.bn)(daHeight),
3494
+ baseChainHeight: (0, import_math15.bn)(daHeight),
3392
3495
  consensusParameters: {
3393
- contractMaxSize: (0, import_math14.bn)(contractParams.contractMaxSize),
3394
- maxInputs: (0, import_math14.bn)(txParams.maxInputs),
3395
- maxOutputs: (0, import_math14.bn)(txParams.maxOutputs),
3396
- maxWitnesses: (0, import_math14.bn)(txParams.maxWitnesses),
3397
- maxGasPerTx: (0, import_math14.bn)(txParams.maxGasPerTx),
3398
- maxScriptLength: (0, import_math14.bn)(scriptParams.maxScriptLength),
3399
- maxScriptDataLength: (0, import_math14.bn)(scriptParams.maxScriptDataLength),
3400
- maxStorageSlots: (0, import_math14.bn)(contractParams.maxStorageSlots),
3401
- maxPredicateLength: (0, import_math14.bn)(predicateParams.maxPredicateLength),
3402
- maxPredicateDataLength: (0, import_math14.bn)(predicateParams.maxPredicateDataLength),
3403
- maxGasPerPredicate: (0, import_math14.bn)(predicateParams.maxGasPerPredicate),
3404
- gasPriceFactor: (0, import_math14.bn)(feeParams.gasPriceFactor),
3405
- gasPerByte: (0, import_math14.bn)(feeParams.gasPerByte),
3406
- maxMessageDataLength: (0, import_math14.bn)(predicateParams.maxMessageDataLength),
3407
- chainId: (0, import_math14.bn)(consensusParameters.chainId),
3496
+ contractMaxSize: (0, import_math15.bn)(contractParams.contractMaxSize),
3497
+ maxInputs: (0, import_math15.bn)(txParams.maxInputs),
3498
+ maxOutputs: (0, import_math15.bn)(txParams.maxOutputs),
3499
+ maxWitnesses: (0, import_math15.bn)(txParams.maxWitnesses),
3500
+ maxGasPerTx: (0, import_math15.bn)(txParams.maxGasPerTx),
3501
+ maxScriptLength: (0, import_math15.bn)(scriptParams.maxScriptLength),
3502
+ maxScriptDataLength: (0, import_math15.bn)(scriptParams.maxScriptDataLength),
3503
+ maxStorageSlots: (0, import_math15.bn)(contractParams.maxStorageSlots),
3504
+ maxPredicateLength: (0, import_math15.bn)(predicateParams.maxPredicateLength),
3505
+ maxPredicateDataLength: (0, import_math15.bn)(predicateParams.maxPredicateDataLength),
3506
+ maxGasPerPredicate: (0, import_math15.bn)(predicateParams.maxGasPerPredicate),
3507
+ gasPriceFactor: (0, import_math15.bn)(feeParams.gasPriceFactor),
3508
+ gasPerByte: (0, import_math15.bn)(feeParams.gasPerByte),
3509
+ maxMessageDataLength: (0, import_math15.bn)(predicateParams.maxMessageDataLength),
3510
+ chainId: (0, import_math15.bn)(consensusParameters.chainId),
3408
3511
  gasCosts
3409
3512
  },
3410
3513
  gasCosts,
3411
3514
  latestBlock: {
3412
3515
  id: latestBlock.id,
3413
- height: (0, import_math14.bn)(latestBlock.header.height),
3516
+ height: (0, import_math15.bn)(latestBlock.header.height),
3414
3517
  time: latestBlock.header.time,
3415
3518
  transactions: latestBlock.transactions.map((i) => ({
3416
3519
  id: i.id
@@ -3480,8 +3583,8 @@ var _Provider = class {
3480
3583
  getChain() {
3481
3584
  const chain = _Provider.chainInfoCache[this.url];
3482
3585
  if (!chain) {
3483
- throw new import_errors13.FuelError(
3484
- import_errors13.ErrorCode.CHAIN_INFO_CACHE_EMPTY,
3586
+ throw new import_errors14.FuelError(
3587
+ import_errors14.ErrorCode.CHAIN_INFO_CACHE_EMPTY,
3485
3588
  "Chain info cache is empty. Make sure you have called `Provider.create` to initialize the provider."
3486
3589
  );
3487
3590
  }
@@ -3493,8 +3596,8 @@ var _Provider = class {
3493
3596
  getNode() {
3494
3597
  const node = _Provider.nodeInfoCache[this.url];
3495
3598
  if (!node) {
3496
- throw new import_errors13.FuelError(
3497
- import_errors13.ErrorCode.NODE_INFO_CACHE_EMPTY,
3599
+ throw new import_errors14.FuelError(
3600
+ import_errors14.ErrorCode.NODE_INFO_CACHE_EMPTY,
3498
3601
  "Node info cache is empty. Make sure you have called `Provider.create` to initialize the provider."
3499
3602
  );
3500
3603
  }
@@ -3541,8 +3644,8 @@ var _Provider = class {
3541
3644
  static ensureClientVersionIsSupported(nodeInfo) {
3542
3645
  const { isMajorSupported, isMinorSupported, supportedVersion } = (0, import_versions.checkFuelCoreVersionCompatibility)(nodeInfo.nodeVersion);
3543
3646
  if (!isMajorSupported || !isMinorSupported) {
3544
- throw new import_errors13.FuelError(
3545
- import_errors13.FuelError.CODES.UNSUPPORTED_FUEL_CLIENT_VERSION,
3647
+ throw new import_errors14.FuelError(
3648
+ import_errors14.FuelError.CODES.UNSUPPORTED_FUEL_CLIENT_VERSION,
3546
3649
  `Fuel client version: ${nodeInfo.nodeVersion}, Supported version: ${supportedVersion}`
3547
3650
  );
3548
3651
  }
@@ -3605,7 +3708,7 @@ var _Provider = class {
3605
3708
  */
3606
3709
  async getBlockNumber() {
3607
3710
  const { chain } = await this.operations.getChain();
3608
- return (0, import_math14.bn)(chain.latestBlock.header.height, 10);
3711
+ return (0, import_math15.bn)(chain.latestBlock.header.height, 10);
3609
3712
  }
3610
3713
  /**
3611
3714
  * Returns the chain information.
@@ -3615,9 +3718,9 @@ var _Provider = class {
3615
3718
  async fetchNode() {
3616
3719
  const { nodeInfo } = await this.operations.getNodeInfo();
3617
3720
  const processedNodeInfo = {
3618
- maxDepth: (0, import_math14.bn)(nodeInfo.maxDepth),
3619
- maxTx: (0, import_math14.bn)(nodeInfo.maxTx),
3620
- minGasPrice: (0, import_math14.bn)(nodeInfo.minGasPrice),
3721
+ maxDepth: (0, import_math15.bn)(nodeInfo.maxDepth),
3722
+ maxTx: (0, import_math15.bn)(nodeInfo.maxTx),
3723
+ minGasPrice: (0, import_math15.bn)(nodeInfo.minGasPrice),
3621
3724
  nodeVersion: nodeInfo.nodeVersion,
3622
3725
  utxoValidation: nodeInfo.utxoValidation,
3623
3726
  vmBacktrace: nodeInfo.vmBacktrace,
@@ -3663,13 +3766,17 @@ var _Provider = class {
3663
3766
  if (estimateTxDependencies) {
3664
3767
  await this.estimateTxDependencies(transactionRequest);
3665
3768
  }
3666
- const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
3769
+ const encodedTransaction = (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes());
3770
+ let abis;
3771
+ if (transactionRequest.type === import_transactions18.TransactionType.Script) {
3772
+ abis = transactionRequest.abis;
3773
+ }
3667
3774
  if (awaitExecution) {
3668
3775
  const subscription = this.operations.submitAndAwait({ encodedTransaction });
3669
3776
  for await (const { submitAndAwait } of subscription) {
3670
3777
  if (submitAndAwait.type === "SqueezedOutStatus") {
3671
- throw new import_errors13.FuelError(
3672
- import_errors13.ErrorCode.TRANSACTION_SQUEEZED_OUT,
3778
+ throw new import_errors14.FuelError(
3779
+ import_errors14.ErrorCode.TRANSACTION_SQUEEZED_OUT,
3673
3780
  `Transaction Squeezed Out with reason: ${submitAndAwait.reason}`
3674
3781
  );
3675
3782
  }
@@ -3678,14 +3785,14 @@ var _Provider = class {
3678
3785
  }
3679
3786
  }
3680
3787
  const transactionId2 = transactionRequest.getTransactionId(this.getChainId());
3681
- const response = new TransactionResponse(transactionId2, this);
3788
+ const response = new TransactionResponse(transactionId2, this, abis);
3682
3789
  await response.fetch();
3683
3790
  return response;
3684
3791
  }
3685
3792
  const {
3686
3793
  submit: { id: transactionId }
3687
3794
  } = await this.operations.submit({ encodedTransaction });
3688
- return new TransactionResponse(transactionId, this);
3795
+ return new TransactionResponse(transactionId, this, abis);
3689
3796
  }
3690
3797
  /**
3691
3798
  * Executes a transaction without actually submitting it to the chain.
@@ -3702,7 +3809,7 @@ var _Provider = class {
3702
3809
  if (estimateTxDependencies) {
3703
3810
  return this.estimateTxDependencies(transactionRequest);
3704
3811
  }
3705
- const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
3812
+ const encodedTransaction = (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes());
3706
3813
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
3707
3814
  encodedTransaction,
3708
3815
  utxoValidation: utxoValidation || false
@@ -3721,13 +3828,13 @@ var _Provider = class {
3721
3828
  async estimatePredicates(transactionRequest) {
3722
3829
  const shouldEstimatePredicates = Boolean(
3723
3830
  transactionRequest.inputs.find(
3724
- (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()
3831
+ (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()
3725
3832
  )
3726
3833
  );
3727
3834
  if (!shouldEstimatePredicates) {
3728
3835
  return transactionRequest;
3729
3836
  }
3730
- const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
3837
+ const encodedTransaction = (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes());
3731
3838
  const response = await this.operations.estimatePredicates({
3732
3839
  encodedTransaction
3733
3840
  });
@@ -3736,7 +3843,7 @@ var _Provider = class {
3736
3843
  } = response;
3737
3844
  if (inputs) {
3738
3845
  inputs.forEach((input, index) => {
3739
- if ("predicateGasUsed" in input && (0, import_math14.bn)(input.predicateGasUsed).gt(0)) {
3846
+ if ("predicateGasUsed" in input && (0, import_math15.bn)(input.predicateGasUsed).gt(0)) {
3740
3847
  transactionRequest.inputs[index].predicateGasUsed = input.predicateGasUsed;
3741
3848
  }
3742
3849
  });
@@ -3757,7 +3864,7 @@ var _Provider = class {
3757
3864
  * @returns A promise.
3758
3865
  */
3759
3866
  async estimateTxDependencies(transactionRequest) {
3760
- if (transactionRequest.type === import_transactions17.TransactionType.Create) {
3867
+ if (transactionRequest.type === import_transactions18.TransactionType.Create) {
3761
3868
  return {
3762
3869
  receipts: [],
3763
3870
  outputVariables: 0,
@@ -3770,7 +3877,7 @@ var _Provider = class {
3770
3877
  let outputVariables = 0;
3771
3878
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
3772
3879
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
3773
- encodedTransaction: (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes()),
3880
+ encodedTransaction: (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes()),
3774
3881
  utxoValidation: false
3775
3882
  });
3776
3883
  receipts = gqlReceipts.map(processGqlReceipt);
@@ -3808,7 +3915,7 @@ var _Provider = class {
3808
3915
  if (estimateTxDependencies) {
3809
3916
  return this.estimateTxDependencies(transactionRequest);
3810
3917
  }
3811
- const encodedTransaction = (0, import_utils22.hexlify)(transactionRequest.toTransactionBytes());
3918
+ const encodedTransaction = (0, import_utils23.hexlify)(transactionRequest.toTransactionBytes());
3812
3919
  const { dryRun: gqlReceipts } = await this.operations.dryRun({
3813
3920
  encodedTransaction,
3814
3921
  utxoValidation: true
@@ -3842,14 +3949,14 @@ var _Provider = class {
3842
3949
  const txRequestClone = (0, import_ramda3.clone)(transactionRequestify(transactionRequestLike));
3843
3950
  const chainInfo = this.getChain();
3844
3951
  const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
3845
- const gasPrice = (0, import_math14.max)(txRequestClone.gasPrice, minGasPrice);
3846
- const isScriptTransaction = txRequestClone.type === import_transactions17.TransactionType.Script;
3952
+ const gasPrice = (0, import_math15.max)(txRequestClone.gasPrice, minGasPrice);
3953
+ const isScriptTransaction = txRequestClone.type === import_transactions18.TransactionType.Script;
3847
3954
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
3848
3955
  const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
3849
3956
  txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
3850
3957
  if (estimatePredicates) {
3851
3958
  if (isScriptTransaction) {
3852
- txRequestClone.gasLimit = (0, import_math14.bn)(0);
3959
+ txRequestClone.gasLimit = (0, import_math15.bn)(0);
3853
3960
  }
3854
3961
  if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
3855
3962
  resourcesOwner.populateTransactionPredicateData(txRequestClone);
@@ -3865,8 +3972,8 @@ var _Provider = class {
3865
3972
  let missingContractIds = [];
3866
3973
  let outputVariables = 0;
3867
3974
  if (isScriptTransaction && estimateTxDependencies) {
3868
- txRequestClone.gasPrice = (0, import_math14.bn)(0);
3869
- txRequestClone.gasLimit = (0, import_math14.bn)(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
3975
+ txRequestClone.gasPrice = (0, import_math15.bn)(0);
3976
+ txRequestClone.gasLimit = (0, import_math15.bn)(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
3870
3977
  const result = await this.estimateTxDependencies(txRequestClone);
3871
3978
  receipts = result.receipts;
3872
3979
  outputVariables = result.outputVariables;
@@ -3922,17 +4029,17 @@ var _Provider = class {
3922
4029
  const result = await this.operations.getCoins({
3923
4030
  first: 10,
3924
4031
  ...paginationArgs,
3925
- filter: { owner: ownerAddress.toB256(), assetId: assetId && (0, import_utils22.hexlify)(assetId) }
4032
+ filter: { owner: ownerAddress.toB256(), assetId: assetId && (0, import_utils23.hexlify)(assetId) }
3926
4033
  });
3927
4034
  const coins = result.coins.edges.map((edge) => edge.node);
3928
4035
  return coins.map((coin) => ({
3929
4036
  id: coin.utxoId,
3930
4037
  assetId: coin.assetId,
3931
- amount: (0, import_math14.bn)(coin.amount),
4038
+ amount: (0, import_math15.bn)(coin.amount),
3932
4039
  owner: import_address3.Address.fromAddressOrString(coin.owner),
3933
- maturity: (0, import_math14.bn)(coin.maturity).toNumber(),
3934
- blockCreated: (0, import_math14.bn)(coin.blockCreated),
3935
- txCreatedIdx: (0, import_math14.bn)(coin.txCreatedIdx)
4040
+ maturity: (0, import_math15.bn)(coin.maturity).toNumber(),
4041
+ blockCreated: (0, import_math15.bn)(coin.blockCreated),
4042
+ txCreatedIdx: (0, import_math15.bn)(coin.txCreatedIdx)
3936
4043
  }));
3937
4044
  }
3938
4045
  /**
@@ -3946,19 +4053,19 @@ var _Provider = class {
3946
4053
  async getResourcesToSpend(owner, quantities, excludedIds) {
3947
4054
  const ownerAddress = import_address3.Address.fromAddressOrString(owner);
3948
4055
  const excludeInput = {
3949
- messages: excludedIds?.messages?.map((nonce) => (0, import_utils22.hexlify)(nonce)) || [],
3950
- utxos: excludedIds?.utxos?.map((id) => (0, import_utils22.hexlify)(id)) || []
4056
+ messages: excludedIds?.messages?.map((nonce) => (0, import_utils23.hexlify)(nonce)) || [],
4057
+ utxos: excludedIds?.utxos?.map((id) => (0, import_utils23.hexlify)(id)) || []
3951
4058
  };
3952
4059
  if (this.cache) {
3953
4060
  const uniqueUtxos = new Set(
3954
- excludeInput.utxos.concat(this.cache?.getActiveData().map((id) => (0, import_utils22.hexlify)(id)))
4061
+ excludeInput.utxos.concat(this.cache?.getActiveData().map((id) => (0, import_utils23.hexlify)(id)))
3955
4062
  );
3956
4063
  excludeInput.utxos = Array.from(uniqueUtxos);
3957
4064
  }
3958
4065
  const coinsQuery = {
3959
4066
  owner: ownerAddress.toB256(),
3960
4067
  queryPerAsset: quantities.map(coinQuantityfy).map(({ assetId, amount, max: maxPerAsset }) => ({
3961
- assetId: (0, import_utils22.hexlify)(assetId),
4068
+ assetId: (0, import_utils23.hexlify)(assetId),
3962
4069
  amount: amount.toString(10),
3963
4070
  max: maxPerAsset ? maxPerAsset.toString(10) : void 0
3964
4071
  })),
@@ -3969,9 +4076,9 @@ var _Provider = class {
3969
4076
  switch (coin.__typename) {
3970
4077
  case "MessageCoin":
3971
4078
  return {
3972
- amount: (0, import_math14.bn)(coin.amount),
4079
+ amount: (0, import_math15.bn)(coin.amount),
3973
4080
  assetId: coin.assetId,
3974
- daHeight: (0, import_math14.bn)(coin.daHeight),
4081
+ daHeight: (0, import_math15.bn)(coin.daHeight),
3975
4082
  sender: import_address3.Address.fromAddressOrString(coin.sender),
3976
4083
  recipient: import_address3.Address.fromAddressOrString(coin.recipient),
3977
4084
  nonce: coin.nonce
@@ -3979,12 +4086,12 @@ var _Provider = class {
3979
4086
  case "Coin":
3980
4087
  return {
3981
4088
  id: coin.utxoId,
3982
- amount: (0, import_math14.bn)(coin.amount),
4089
+ amount: (0, import_math15.bn)(coin.amount),
3983
4090
  assetId: coin.assetId,
3984
4091
  owner: import_address3.Address.fromAddressOrString(coin.owner),
3985
- maturity: (0, import_math14.bn)(coin.maturity).toNumber(),
3986
- blockCreated: (0, import_math14.bn)(coin.blockCreated),
3987
- txCreatedIdx: (0, import_math14.bn)(coin.txCreatedIdx)
4092
+ maturity: (0, import_math15.bn)(coin.maturity).toNumber(),
4093
+ blockCreated: (0, import_math15.bn)(coin.blockCreated),
4094
+ txCreatedIdx: (0, import_math15.bn)(coin.txCreatedIdx)
3988
4095
  };
3989
4096
  default:
3990
4097
  return null;
@@ -4001,13 +4108,13 @@ var _Provider = class {
4001
4108
  async getBlock(idOrHeight) {
4002
4109
  let variables;
4003
4110
  if (typeof idOrHeight === "number") {
4004
- variables = { height: (0, import_math14.bn)(idOrHeight).toString(10) };
4111
+ variables = { height: (0, import_math15.bn)(idOrHeight).toString(10) };
4005
4112
  } else if (idOrHeight === "latest") {
4006
4113
  variables = { height: (await this.getBlockNumber()).toString(10) };
4007
4114
  } else if (idOrHeight.length === 66) {
4008
4115
  variables = { blockId: idOrHeight };
4009
4116
  } else {
4010
- variables = { blockId: (0, import_math14.bn)(idOrHeight).toString(10) };
4117
+ variables = { blockId: (0, import_math15.bn)(idOrHeight).toString(10) };
4011
4118
  }
4012
4119
  const { block } = await this.operations.getBlock(variables);
4013
4120
  if (!block) {
@@ -4015,7 +4122,7 @@ var _Provider = class {
4015
4122
  }
4016
4123
  return {
4017
4124
  id: block.id,
4018
- height: (0, import_math14.bn)(block.header.height),
4125
+ height: (0, import_math15.bn)(block.header.height),
4019
4126
  time: block.header.time,
4020
4127
  transactionIds: block.transactions.map((tx) => tx.id)
4021
4128
  };
@@ -4030,7 +4137,7 @@ var _Provider = class {
4030
4137
  const { blocks: fetchedData } = await this.operations.getBlocks(params);
4031
4138
  const blocks = fetchedData.edges.map(({ node: block }) => ({
4032
4139
  id: block.id,
4033
- height: (0, import_math14.bn)(block.header.height),
4140
+ height: (0, import_math15.bn)(block.header.height),
4034
4141
  time: block.header.time,
4035
4142
  transactionIds: block.transactions.map((tx) => tx.id)
4036
4143
  }));
@@ -4045,7 +4152,7 @@ var _Provider = class {
4045
4152
  async getBlockWithTransactions(idOrHeight) {
4046
4153
  let variables;
4047
4154
  if (typeof idOrHeight === "number") {
4048
- variables = { blockHeight: (0, import_math14.bn)(idOrHeight).toString(10) };
4155
+ variables = { blockHeight: (0, import_math15.bn)(idOrHeight).toString(10) };
4049
4156
  } else if (idOrHeight === "latest") {
4050
4157
  variables = { blockHeight: (await this.getBlockNumber()).toString() };
4051
4158
  } else {
@@ -4057,11 +4164,11 @@ var _Provider = class {
4057
4164
  }
4058
4165
  return {
4059
4166
  id: block.id,
4060
- height: (0, import_math14.bn)(block.header.height, 10),
4167
+ height: (0, import_math15.bn)(block.header.height, 10),
4061
4168
  time: block.header.time,
4062
4169
  transactionIds: block.transactions.map((tx) => tx.id),
4063
4170
  transactions: block.transactions.map(
4064
- (tx) => new import_transactions17.TransactionCoder().decode((0, import_utils22.arrayify)(tx.rawPayload), 0)?.[0]
4171
+ (tx) => new import_transactions18.TransactionCoder().decode((0, import_utils23.arrayify)(tx.rawPayload), 0)?.[0]
4065
4172
  )
4066
4173
  };
4067
4174
  }
@@ -4076,8 +4183,8 @@ var _Provider = class {
4076
4183
  if (!transaction) {
4077
4184
  return null;
4078
4185
  }
4079
- return new import_transactions17.TransactionCoder().decode(
4080
- (0, import_utils22.arrayify)(transaction.rawPayload),
4186
+ return new import_transactions18.TransactionCoder().decode(
4187
+ (0, import_utils23.arrayify)(transaction.rawPayload),
4081
4188
  0
4082
4189
  )?.[0];
4083
4190
  }
@@ -4104,9 +4211,9 @@ var _Provider = class {
4104
4211
  async getContractBalance(contractId, assetId) {
4105
4212
  const { contractBalance } = await this.operations.getContractBalance({
4106
4213
  contract: import_address3.Address.fromAddressOrString(contractId).toB256(),
4107
- asset: (0, import_utils22.hexlify)(assetId)
4214
+ asset: (0, import_utils23.hexlify)(assetId)
4108
4215
  });
4109
- return (0, import_math14.bn)(contractBalance.amount, 10);
4216
+ return (0, import_math15.bn)(contractBalance.amount, 10);
4110
4217
  }
4111
4218
  /**
4112
4219
  * Returns the balance for the given owner for the given asset ID.
@@ -4118,9 +4225,9 @@ var _Provider = class {
4118
4225
  async getBalance(owner, assetId) {
4119
4226
  const { balance } = await this.operations.getBalance({
4120
4227
  owner: import_address3.Address.fromAddressOrString(owner).toB256(),
4121
- assetId: (0, import_utils22.hexlify)(assetId)
4228
+ assetId: (0, import_utils23.hexlify)(assetId)
4122
4229
  });
4123
- return (0, import_math14.bn)(balance.amount, 10);
4230
+ return (0, import_math15.bn)(balance.amount, 10);
4124
4231
  }
4125
4232
  /**
4126
4233
  * Returns balances for the given owner.
@@ -4138,7 +4245,7 @@ var _Provider = class {
4138
4245
  const balances = result.balances.edges.map((edge) => edge.node);
4139
4246
  return balances.map((balance) => ({
4140
4247
  assetId: balance.assetId,
4141
- amount: (0, import_math14.bn)(balance.amount)
4248
+ amount: (0, import_math15.bn)(balance.amount)
4142
4249
  }));
4143
4250
  }
4144
4251
  /**
@@ -4156,19 +4263,19 @@ var _Provider = class {
4156
4263
  });
4157
4264
  const messages = result.messages.edges.map((edge) => edge.node);
4158
4265
  return messages.map((message) => ({
4159
- messageId: import_transactions17.InputMessageCoder.getMessageId({
4266
+ messageId: import_transactions18.InputMessageCoder.getMessageId({
4160
4267
  sender: message.sender,
4161
4268
  recipient: message.recipient,
4162
4269
  nonce: message.nonce,
4163
- amount: (0, import_math14.bn)(message.amount),
4270
+ amount: (0, import_math15.bn)(message.amount),
4164
4271
  data: message.data
4165
4272
  }),
4166
4273
  sender: import_address3.Address.fromAddressOrString(message.sender),
4167
4274
  recipient: import_address3.Address.fromAddressOrString(message.recipient),
4168
4275
  nonce: message.nonce,
4169
- amount: (0, import_math14.bn)(message.amount),
4170
- data: import_transactions17.InputMessageCoder.decodeData(message.data),
4171
- daHeight: (0, import_math14.bn)(message.daHeight)
4276
+ amount: (0, import_math15.bn)(message.amount),
4277
+ data: import_transactions18.InputMessageCoder.decodeData(message.data),
4278
+ daHeight: (0, import_math15.bn)(message.daHeight)
4172
4279
  }));
4173
4280
  }
4174
4281
  /**
@@ -4186,8 +4293,8 @@ var _Provider = class {
4186
4293
  nonce
4187
4294
  };
4188
4295
  if (commitBlockId && commitBlockHeight) {
4189
- throw new import_errors13.FuelError(
4190
- import_errors13.ErrorCode.INVALID_INPUT_PARAMETERS,
4296
+ throw new import_errors14.FuelError(
4297
+ import_errors14.ErrorCode.INVALID_INPUT_PARAMETERS,
4191
4298
  "commitBlockId and commitBlockHeight cannot be used together"
4192
4299
  );
4193
4300
  }
@@ -4221,41 +4328,41 @@ var _Provider = class {
4221
4328
  } = result.messageProof;
4222
4329
  return {
4223
4330
  messageProof: {
4224
- proofIndex: (0, import_math14.bn)(messageProof.proofIndex),
4331
+ proofIndex: (0, import_math15.bn)(messageProof.proofIndex),
4225
4332
  proofSet: messageProof.proofSet
4226
4333
  },
4227
4334
  blockProof: {
4228
- proofIndex: (0, import_math14.bn)(blockProof.proofIndex),
4335
+ proofIndex: (0, import_math15.bn)(blockProof.proofIndex),
4229
4336
  proofSet: blockProof.proofSet
4230
4337
  },
4231
4338
  messageBlockHeader: {
4232
4339
  id: messageBlockHeader.id,
4233
- daHeight: (0, import_math14.bn)(messageBlockHeader.daHeight),
4234
- transactionsCount: (0, import_math14.bn)(messageBlockHeader.transactionsCount),
4340
+ daHeight: (0, import_math15.bn)(messageBlockHeader.daHeight),
4341
+ transactionsCount: (0, import_math15.bn)(messageBlockHeader.transactionsCount),
4235
4342
  transactionsRoot: messageBlockHeader.transactionsRoot,
4236
- height: (0, import_math14.bn)(messageBlockHeader.height),
4343
+ height: (0, import_math15.bn)(messageBlockHeader.height),
4237
4344
  prevRoot: messageBlockHeader.prevRoot,
4238
4345
  time: messageBlockHeader.time,
4239
4346
  applicationHash: messageBlockHeader.applicationHash,
4240
4347
  messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
4241
- messageReceiptCount: (0, import_math14.bn)(messageBlockHeader.messageReceiptCount)
4348
+ messageReceiptCount: (0, import_math15.bn)(messageBlockHeader.messageReceiptCount)
4242
4349
  },
4243
4350
  commitBlockHeader: {
4244
4351
  id: commitBlockHeader.id,
4245
- daHeight: (0, import_math14.bn)(commitBlockHeader.daHeight),
4246
- transactionsCount: (0, import_math14.bn)(commitBlockHeader.transactionsCount),
4352
+ daHeight: (0, import_math15.bn)(commitBlockHeader.daHeight),
4353
+ transactionsCount: (0, import_math15.bn)(commitBlockHeader.transactionsCount),
4247
4354
  transactionsRoot: commitBlockHeader.transactionsRoot,
4248
- height: (0, import_math14.bn)(commitBlockHeader.height),
4355
+ height: (0, import_math15.bn)(commitBlockHeader.height),
4249
4356
  prevRoot: commitBlockHeader.prevRoot,
4250
4357
  time: commitBlockHeader.time,
4251
4358
  applicationHash: commitBlockHeader.applicationHash,
4252
4359
  messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
4253
- messageReceiptCount: (0, import_math14.bn)(commitBlockHeader.messageReceiptCount)
4360
+ messageReceiptCount: (0, import_math15.bn)(commitBlockHeader.messageReceiptCount)
4254
4361
  },
4255
4362
  sender: import_address3.Address.fromAddressOrString(sender),
4256
4363
  recipient: import_address3.Address.fromAddressOrString(recipient),
4257
4364
  nonce,
4258
- amount: (0, import_math14.bn)(amount),
4365
+ amount: (0, import_math15.bn)(amount),
4259
4366
  data
4260
4367
  };
4261
4368
  }
@@ -4278,10 +4385,10 @@ var _Provider = class {
4278
4385
  */
4279
4386
  async produceBlocks(amount, startTime) {
4280
4387
  const { produceBlocks: latestBlockHeight } = await this.operations.produceBlocks({
4281
- blocksToProduce: (0, import_math14.bn)(amount).toString(10),
4282
- startTimestamp: startTime ? import_utils22.DateTime.fromUnixMilliseconds(startTime).toTai64() : void 0
4388
+ blocksToProduce: (0, import_math15.bn)(amount).toString(10),
4389
+ startTimestamp: startTime ? import_utils23.DateTime.fromUnixMilliseconds(startTime).toTai64() : void 0
4283
4390
  });
4284
- return (0, import_math14.bn)(latestBlockHeight);
4391
+ return (0, import_math15.bn)(latestBlockHeight);
4285
4392
  }
4286
4393
  // eslint-disable-next-line @typescript-eslint/require-await
4287
4394
  async getTransactionResponse(transactionId) {
@@ -4295,7 +4402,7 @@ cacheInputs_fn = function(inputs) {
4295
4402
  return;
4296
4403
  }
4297
4404
  inputs.forEach((input) => {
4298
- if (input.type === import_transactions17.InputType.Coin) {
4405
+ if (input.type === import_transactions18.InputType.Coin) {
4299
4406
  this.cache?.set(input.id);
4300
4407
  }
4301
4408
  });
@@ -4304,10 +4411,10 @@ __publicField(Provider, "chainInfoCache", {});
4304
4411
  __publicField(Provider, "nodeInfoCache", {});
4305
4412
 
4306
4413
  // src/providers/transaction-summary/get-transaction-summary.ts
4307
- var import_errors14 = require("@fuel-ts/errors");
4308
- var import_math15 = require("@fuel-ts/math");
4309
- var import_transactions18 = require("@fuel-ts/transactions");
4310
- var import_utils25 = require("@fuel-ts/utils");
4414
+ var import_errors15 = require("@fuel-ts/errors");
4415
+ var import_math16 = require("@fuel-ts/math");
4416
+ var import_transactions19 = require("@fuel-ts/transactions");
4417
+ var import_utils26 = require("@fuel-ts/utils");
4311
4418
 
4312
4419
  // src/providers/chains.ts
4313
4420
  var CHAIN_IDS = {
@@ -4356,17 +4463,17 @@ var assets = [
4356
4463
 
4357
4464
  // src/utils/formatTransferToContractScriptData.ts
4358
4465
  var import_abi_coder4 = require("@fuel-ts/abi-coder");
4359
- var import_math16 = require("@fuel-ts/math");
4360
- var import_utils26 = require("@fuel-ts/utils");
4466
+ var import_math17 = require("@fuel-ts/math");
4467
+ var import_utils27 = require("@fuel-ts/utils");
4361
4468
  var asm = __toESM(require("@fuels/vm-asm"));
4362
4469
  var formatTransferToContractScriptData = (params) => {
4363
4470
  const { assetId, amountToTransfer, hexlifiedContractId } = params;
4364
4471
  const numberCoder = new import_abi_coder4.BigNumberCoder("u64");
4365
- const encoded = numberCoder.encode(new import_math16.BN(amountToTransfer).toNumber());
4472
+ const encoded = numberCoder.encode(new import_math17.BN(amountToTransfer).toNumber());
4366
4473
  const scriptData = Uint8Array.from([
4367
- ...(0, import_utils26.arrayify)(hexlifiedContractId),
4474
+ ...(0, import_utils27.arrayify)(hexlifiedContractId),
4368
4475
  ...encoded,
4369
- ...(0, import_utils26.arrayify)(assetId)
4476
+ ...(0, import_utils27.arrayify)(assetId)
4370
4477
  ]);
4371
4478
  return scriptData;
4372
4479
  };
@@ -4422,7 +4529,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4422
4529
  */
4423
4530
  get provider() {
4424
4531
  if (!this._provider) {
4425
- throw new import_errors15.FuelError(import_errors15.ErrorCode.MISSING_PROVIDER, "Provider not set");
4532
+ throw new import_errors16.FuelError(import_errors16.ErrorCode.MISSING_PROVIDER, "Provider not set");
4426
4533
  }
4427
4534
  return this._provider;
4428
4535
  }
@@ -4474,8 +4581,8 @@ var Account = class extends import_interfaces.AbstractAccount {
4474
4581
  if (!hasNextPage) {
4475
4582
  break;
4476
4583
  }
4477
- throw new import_errors15.FuelError(
4478
- import_errors15.ErrorCode.NOT_SUPPORTED,
4584
+ throw new import_errors16.FuelError(
4585
+ import_errors16.ErrorCode.NOT_SUPPORTED,
4479
4586
  `Wallets containing more than ${pageSize} coins exceed the current supported limit.`
4480
4587
  );
4481
4588
  }
@@ -4500,8 +4607,8 @@ var Account = class extends import_interfaces.AbstractAccount {
4500
4607
  if (!hasNextPage) {
4501
4608
  break;
4502
4609
  }
4503
- throw new import_errors15.FuelError(
4504
- import_errors15.ErrorCode.NOT_SUPPORTED,
4610
+ throw new import_errors16.FuelError(
4611
+ import_errors16.ErrorCode.NOT_SUPPORTED,
4505
4612
  `Wallets containing more than ${pageSize} messages exceed the current supported limit.`
4506
4613
  );
4507
4614
  }
@@ -4513,7 +4620,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4513
4620
  * @param assetId - The asset ID to check the balance for.
4514
4621
  * @returns A promise that resolves to the balance amount.
4515
4622
  */
4516
- async getBalance(assetId = import_configs11.BaseAssetId) {
4623
+ async getBalance(assetId = import_configs12.BaseAssetId) {
4517
4624
  const amount = await this.provider.getBalance(this.address, assetId);
4518
4625
  return amount;
4519
4626
  }
@@ -4536,8 +4643,8 @@ var Account = class extends import_interfaces.AbstractAccount {
4536
4643
  if (!hasNextPage) {
4537
4644
  break;
4538
4645
  }
4539
- throw new import_errors15.FuelError(
4540
- import_errors15.ErrorCode.NOT_SUPPORTED,
4646
+ throw new import_errors16.FuelError(
4647
+ import_errors16.ErrorCode.NOT_SUPPORTED,
4541
4648
  `Wallets containing more than ${pageSize} balances exceed the current supported limit.`
4542
4649
  );
4543
4650
  }
@@ -4553,15 +4660,15 @@ var Account = class extends import_interfaces.AbstractAccount {
4553
4660
  */
4554
4661
  async fund(request, coinQuantities, fee) {
4555
4662
  const updatedQuantities = addAmountToAsset({
4556
- amount: (0, import_math17.bn)(fee),
4557
- assetId: import_configs11.BaseAssetId,
4663
+ amount: (0, import_math18.bn)(fee),
4664
+ assetId: import_configs12.BaseAssetId,
4558
4665
  coinQuantities
4559
4666
  });
4560
4667
  const quantitiesDict = {};
4561
4668
  updatedQuantities.forEach(({ amount, assetId }) => {
4562
4669
  quantitiesDict[assetId] = {
4563
4670
  required: amount,
4564
- owned: (0, import_math17.bn)(0)
4671
+ owned: (0, import_math18.bn)(0)
4565
4672
  };
4566
4673
  });
4567
4674
  const cachedUtxos = [];
@@ -4574,12 +4681,12 @@ var Account = class extends import_interfaces.AbstractAccount {
4574
4681
  if (isCoin2) {
4575
4682
  const assetId = String(input.assetId);
4576
4683
  if (input.owner === owner && quantitiesDict[assetId]) {
4577
- const amount = (0, import_math17.bn)(input.amount);
4684
+ const amount = (0, import_math18.bn)(input.amount);
4578
4685
  quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
4579
4686
  cachedUtxos.push(input.id);
4580
4687
  }
4581
- } else if (input.recipient === owner && input.amount && quantitiesDict[import_configs11.BaseAssetId]) {
4582
- quantitiesDict[import_configs11.BaseAssetId].owned = quantitiesDict[import_configs11.BaseAssetId].owned.add(input.amount);
4688
+ } else if (input.recipient === owner && input.amount && quantitiesDict[import_configs12.BaseAssetId]) {
4689
+ quantitiesDict[import_configs12.BaseAssetId].owned = quantitiesDict[import_configs12.BaseAssetId].owned.add(input.amount);
4583
4690
  cachedMessages.push(input.nonce);
4584
4691
  }
4585
4692
  }
@@ -4611,7 +4718,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4611
4718
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
4612
4719
  * @returns A promise that resolves to the prepared transaction request.
4613
4720
  */
4614
- async createTransfer(destination, amount, assetId = import_configs11.BaseAssetId, txParams = {}) {
4721
+ async createTransfer(destination, amount, assetId = import_configs12.BaseAssetId, txParams = {}) {
4615
4722
  const { minGasPrice } = this.provider.getGasConfig();
4616
4723
  const params = { gasPrice: minGasPrice, ...txParams };
4617
4724
  const request = new ScriptTransactionRequest(params);
@@ -4620,8 +4727,8 @@ var Account = class extends import_interfaces.AbstractAccount {
4620
4727
  estimateTxDependencies: true,
4621
4728
  resourcesOwner: this
4622
4729
  });
4623
- request.gasPrice = (0, import_math17.bn)(txParams.gasPrice ?? minGasPrice);
4624
- request.gasLimit = (0, import_math17.bn)(txParams.gasLimit ?? gasUsed);
4730
+ request.gasPrice = (0, import_math18.bn)(txParams.gasPrice ?? minGasPrice);
4731
+ request.gasLimit = (0, import_math18.bn)(txParams.gasLimit ?? gasUsed);
4625
4732
  this.validateGas({
4626
4733
  gasUsed,
4627
4734
  gasPrice: request.gasPrice,
@@ -4641,10 +4748,10 @@ var Account = class extends import_interfaces.AbstractAccount {
4641
4748
  * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
4642
4749
  * @returns A promise that resolves to the transaction response.
4643
4750
  */
4644
- async transfer(destination, amount, assetId = import_configs11.BaseAssetId, txParams = {}) {
4645
- if ((0, import_math17.bn)(amount).lte(0)) {
4646
- throw new import_errors15.FuelError(
4647
- import_errors15.ErrorCode.INVALID_TRANSFER_AMOUNT,
4751
+ async transfer(destination, amount, assetId = import_configs12.BaseAssetId, txParams = {}) {
4752
+ if ((0, import_math18.bn)(amount).lte(0)) {
4753
+ throw new import_errors16.FuelError(
4754
+ import_errors16.ErrorCode.INVALID_TRANSFER_AMOUNT,
4648
4755
  "Transfer amount must be a positive number."
4649
4756
  );
4650
4757
  }
@@ -4660,10 +4767,10 @@ var Account = class extends import_interfaces.AbstractAccount {
4660
4767
  * @param txParams - The optional transaction parameters.
4661
4768
  * @returns A promise that resolves to the transaction response.
4662
4769
  */
4663
- async transferToContract(contractId, amount, assetId = import_configs11.BaseAssetId, txParams = {}) {
4664
- if ((0, import_math17.bn)(amount).lte(0)) {
4665
- throw new import_errors15.FuelError(
4666
- import_errors15.ErrorCode.INVALID_TRANSFER_AMOUNT,
4770
+ async transferToContract(contractId, amount, assetId = import_configs12.BaseAssetId, txParams = {}) {
4771
+ if ((0, import_math18.bn)(amount).lte(0)) {
4772
+ throw new import_errors16.FuelError(
4773
+ import_errors16.ErrorCode.INVALID_TRANSFER_AMOUNT,
4667
4774
  "Transfer amount must be a positive number."
4668
4775
  );
4669
4776
  }
@@ -4672,7 +4779,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4672
4779
  const params = { gasPrice: minGasPrice, ...txParams };
4673
4780
  const { script, scriptData } = await assembleTransferToContractScript({
4674
4781
  hexlifiedContractId: contractAddress.toB256(),
4675
- amountToTransfer: (0, import_math17.bn)(amount),
4782
+ amountToTransfer: (0, import_math18.bn)(amount),
4676
4783
  assetId
4677
4784
  });
4678
4785
  const request = new ScriptTransactionRequest({
@@ -4683,9 +4790,9 @@ var Account = class extends import_interfaces.AbstractAccount {
4683
4790
  request.addContractInputAndOutput(contractAddress);
4684
4791
  const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
4685
4792
  request,
4686
- [{ amount: (0, import_math17.bn)(amount), assetId: String(assetId) }]
4793
+ [{ amount: (0, import_math18.bn)(amount), assetId: String(assetId) }]
4687
4794
  );
4688
- request.gasLimit = (0, import_math17.bn)(params.gasLimit ?? gasUsed);
4795
+ request.gasLimit = (0, import_math18.bn)(params.gasLimit ?? gasUsed);
4689
4796
  this.validateGas({
4690
4797
  gasUsed,
4691
4798
  gasPrice: request.gasPrice,
@@ -4706,25 +4813,25 @@ var Account = class extends import_interfaces.AbstractAccount {
4706
4813
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
4707
4814
  const { minGasPrice } = this.provider.getGasConfig();
4708
4815
  const recipientAddress = import_address4.Address.fromAddressOrString(recipient);
4709
- const recipientDataArray = (0, import_utils27.arrayify)(
4816
+ const recipientDataArray = (0, import_utils28.arrayify)(
4710
4817
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
4711
4818
  );
4712
- const amountDataArray = (0, import_utils27.arrayify)(
4713
- "0x".concat((0, import_math17.bn)(amount).toHex().substring(2).padStart(16, "0"))
4819
+ const amountDataArray = (0, import_utils28.arrayify)(
4820
+ "0x".concat((0, import_math18.bn)(amount).toHex().substring(2).padStart(16, "0"))
4714
4821
  );
4715
4822
  const script = new Uint8Array([
4716
- ...(0, import_utils27.arrayify)(withdrawScript.bytes),
4823
+ ...(0, import_utils28.arrayify)(withdrawScript.bytes),
4717
4824
  ...recipientDataArray,
4718
4825
  ...amountDataArray
4719
4826
  ]);
4720
4827
  const params = { script, gasPrice: minGasPrice, ...txParams };
4721
4828
  const request = new ScriptTransactionRequest(params);
4722
- const forwardingQuantities = [{ amount: (0, import_math17.bn)(amount), assetId: import_configs11.BaseAssetId }];
4829
+ const forwardingQuantities = [{ amount: (0, import_math18.bn)(amount), assetId: import_configs12.BaseAssetId }];
4723
4830
  const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
4724
4831
  request,
4725
4832
  forwardingQuantities
4726
4833
  );
4727
- request.gasLimit = (0, import_math17.bn)(params.gasLimit ?? gasUsed);
4834
+ request.gasLimit = (0, import_math18.bn)(params.gasLimit ?? gasUsed);
4728
4835
  this.validateGas({
4729
4836
  gasUsed,
4730
4837
  gasPrice: request.gasPrice,
@@ -4736,7 +4843,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4736
4843
  }
4737
4844
  async signMessage(message) {
4738
4845
  if (!this._connector) {
4739
- throw new import_errors15.FuelError(import_errors15.ErrorCode.MISSING_CONNECTOR, "A connector is required to sign messages.");
4846
+ throw new import_errors16.FuelError(import_errors16.ErrorCode.MISSING_CONNECTOR, "A connector is required to sign messages.");
4740
4847
  }
4741
4848
  return this._connector.signMessage(this.address.toString(), message);
4742
4849
  }
@@ -4748,8 +4855,8 @@ var Account = class extends import_interfaces.AbstractAccount {
4748
4855
  */
4749
4856
  async signTransaction(transactionRequestLike) {
4750
4857
  if (!this._connector) {
4751
- throw new import_errors15.FuelError(
4752
- import_errors15.ErrorCode.MISSING_CONNECTOR,
4858
+ throw new import_errors16.FuelError(
4859
+ import_errors16.ErrorCode.MISSING_CONNECTOR,
4753
4860
  "A connector is required to sign transactions."
4754
4861
  );
4755
4862
  }
@@ -4796,14 +4903,14 @@ var Account = class extends import_interfaces.AbstractAccount {
4796
4903
  minGasPrice
4797
4904
  }) {
4798
4905
  if (minGasPrice.gt(gasPrice)) {
4799
- throw new import_errors15.FuelError(
4800
- import_errors15.ErrorCode.GAS_PRICE_TOO_LOW,
4906
+ throw new import_errors16.FuelError(
4907
+ import_errors16.ErrorCode.GAS_PRICE_TOO_LOW,
4801
4908
  `Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
4802
4909
  );
4803
4910
  }
4804
4911
  if (gasUsed.gt(gasLimit)) {
4805
- throw new import_errors15.FuelError(
4806
- import_errors15.ErrorCode.GAS_LIMIT_TOO_LOW,
4912
+ throw new import_errors16.FuelError(
4913
+ import_errors16.ErrorCode.GAS_LIMIT_TOO_LOW,
4807
4914
  `Gas limit '${gasLimit}' is lower than the required: '${gasUsed}'.`
4808
4915
  );
4809
4916
  }
@@ -4814,8 +4921,8 @@ var Account = class extends import_interfaces.AbstractAccount {
4814
4921
  var import_address5 = require("@fuel-ts/address");
4815
4922
  var import_crypto = require("@fuel-ts/crypto");
4816
4923
  var import_hasher2 = require("@fuel-ts/hasher");
4817
- var import_math18 = require("@fuel-ts/math");
4818
- var import_utils28 = require("@fuel-ts/utils");
4924
+ var import_math19 = require("@fuel-ts/math");
4925
+ var import_utils29 = require("@fuel-ts/utils");
4819
4926
  var import_secp256k1 = require("@noble/curves/secp256k1");
4820
4927
  var Signer = class {
4821
4928
  address;
@@ -4834,10 +4941,10 @@ var Signer = class {
4834
4941
  privateKey = `0x${privateKey}`;
4835
4942
  }
4836
4943
  }
4837
- const privateKeyBytes = (0, import_math18.toBytes)(privateKey, 32);
4838
- this.privateKey = (0, import_utils28.hexlify)(privateKeyBytes);
4839
- this.publicKey = (0, import_utils28.hexlify)(import_secp256k1.secp256k1.getPublicKey(privateKeyBytes, false).slice(1));
4840
- this.compressedPublicKey = (0, import_utils28.hexlify)(import_secp256k1.secp256k1.getPublicKey(privateKeyBytes, true));
4944
+ const privateKeyBytes = (0, import_math19.toBytes)(privateKey, 32);
4945
+ this.privateKey = (0, import_utils29.hexlify)(privateKeyBytes);
4946
+ this.publicKey = (0, import_utils29.hexlify)(import_secp256k1.secp256k1.getPublicKey(privateKeyBytes, false).slice(1));
4947
+ this.compressedPublicKey = (0, import_utils29.hexlify)(import_secp256k1.secp256k1.getPublicKey(privateKeyBytes, true));
4841
4948
  this.address = import_address5.Address.fromPublicKey(this.publicKey);
4842
4949
  }
4843
4950
  /**
@@ -4851,11 +4958,11 @@ var Signer = class {
4851
4958
  * @returns hashed signature
4852
4959
  */
4853
4960
  sign(data) {
4854
- const signature = import_secp256k1.secp256k1.sign((0, import_utils28.arrayify)(data), (0, import_utils28.arrayify)(this.privateKey));
4855
- const r = (0, import_math18.toBytes)(`0x${signature.r.toString(16)}`, 32);
4856
- const s = (0, import_math18.toBytes)(`0x${signature.s.toString(16)}`, 32);
4961
+ const signature = import_secp256k1.secp256k1.sign((0, import_utils29.arrayify)(data), (0, import_utils29.arrayify)(this.privateKey));
4962
+ const r = (0, import_math19.toBytes)(`0x${signature.r.toString(16)}`, 32);
4963
+ const s = (0, import_math19.toBytes)(`0x${signature.s.toString(16)}`, 32);
4857
4964
  s[0] |= (signature.recovery || 0) << 7;
4858
- return (0, import_utils28.hexlify)((0, import_utils28.concat)([r, s]));
4965
+ return (0, import_utils29.hexlify)((0, import_utils29.concat)([r, s]));
4859
4966
  }
4860
4967
  /**
4861
4968
  * Add point on the current elliptic curve
@@ -4864,8 +4971,8 @@ var Signer = class {
4864
4971
  * @returns compressed point on the curve
4865
4972
  */
4866
4973
  addPoint(point) {
4867
- const p0 = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils28.arrayify)(this.compressedPublicKey));
4868
- const p1 = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils28.arrayify)(point));
4974
+ const p0 = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils29.arrayify)(this.compressedPublicKey));
4975
+ const p1 = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils29.arrayify)(point));
4869
4976
  const result = p0.add(p1);
4870
4977
  return `0x${result.toHex(true)}`;
4871
4978
  }
@@ -4877,16 +4984,16 @@ var Signer = class {
4877
4984
  * @returns public key from signature from the
4878
4985
  */
4879
4986
  static recoverPublicKey(data, signature) {
4880
- const signedMessageBytes = (0, import_utils28.arrayify)(signature);
4987
+ const signedMessageBytes = (0, import_utils29.arrayify)(signature);
4881
4988
  const r = signedMessageBytes.slice(0, 32);
4882
4989
  const s = signedMessageBytes.slice(32, 64);
4883
4990
  const recoveryParam = (s[0] & 128) >> 7;
4884
4991
  s[0] &= 127;
4885
- const sig = new import_secp256k1.secp256k1.Signature(BigInt((0, import_utils28.hexlify)(r)), BigInt((0, import_utils28.hexlify)(s))).addRecoveryBit(
4992
+ const sig = new import_secp256k1.secp256k1.Signature(BigInt((0, import_utils29.hexlify)(r)), BigInt((0, import_utils29.hexlify)(s))).addRecoveryBit(
4886
4993
  recoveryParam
4887
4994
  );
4888
- const publicKey = sig.recoverPublicKey((0, import_utils28.arrayify)(data)).toRawBytes(false).slice(1);
4889
- return (0, import_utils28.hexlify)(publicKey);
4995
+ const publicKey = sig.recoverPublicKey((0, import_utils29.arrayify)(data)).toRawBytes(false).slice(1);
4996
+ return (0, import_utils29.hexlify)(publicKey);
4890
4997
  }
4891
4998
  /**
4892
4999
  * Recover the address from a signature performed with [`sign`](#sign).
@@ -4905,7 +5012,7 @@ var Signer = class {
4905
5012
  * @returns random 32-byte hashed
4906
5013
  */
4907
5014
  static generatePrivateKey(entropy) {
4908
- 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);
5015
+ 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);
4909
5016
  }
4910
5017
  /**
4911
5018
  * Extended publicKey from a compact publicKey
@@ -4914,16 +5021,16 @@ var Signer = class {
4914
5021
  * @returns extended publicKey
4915
5022
  */
4916
5023
  static extendPublicKey(publicKey) {
4917
- const point = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils28.arrayify)(publicKey));
4918
- return (0, import_utils28.hexlify)(point.toRawBytes(false).slice(1));
5024
+ const point = import_secp256k1.secp256k1.ProjectivePoint.fromHex((0, import_utils29.arrayify)(publicKey));
5025
+ return (0, import_utils29.hexlify)(point.toRawBytes(false).slice(1));
4919
5026
  }
4920
5027
  };
4921
5028
 
4922
5029
  // src/wallet/keystore-wallet.ts
4923
5030
  var import_address6 = require("@fuel-ts/address");
4924
5031
  var import_crypto2 = require("@fuel-ts/crypto");
4925
- var import_errors16 = require("@fuel-ts/errors");
4926
- var import_utils29 = require("@fuel-ts/utils");
5032
+ var import_errors17 = require("@fuel-ts/errors");
5033
+ var import_utils30 = require("@fuel-ts/utils");
4927
5034
  var import_uuid = require("uuid");
4928
5035
  var DEFAULT_KDF_PARAMS_LOG_N = 13;
4929
5036
  var DEFAULT_KDF_PARAMS_R = 8;
@@ -5000,13 +5107,13 @@ async function decryptKeystoreWallet(jsonWallet, password) {
5000
5107
  const macHashUint8Array = (0, import_crypto2.keccak256)(data);
5001
5108
  const macHash = (0, import_crypto2.stringFromBuffer)(macHashUint8Array, "hex");
5002
5109
  if (mac !== macHash) {
5003
- throw new import_errors16.FuelError(
5004
- import_errors16.ErrorCode.INVALID_PASSWORD,
5110
+ throw new import_errors17.FuelError(
5111
+ import_errors17.ErrorCode.INVALID_PASSWORD,
5005
5112
  "Failed to decrypt the keystore wallet, the provided password is incorrect."
5006
5113
  );
5007
5114
  }
5008
5115
  const buffer = await (0, import_crypto2.decryptJsonWalletData)(ciphertextBuffer, key, ivBuffer);
5009
- const privateKey = (0, import_utils29.hexlify)(buffer);
5116
+ const privateKey = (0, import_utils30.hexlify)(buffer);
5010
5117
  return privateKey;
5011
5118
  }
5012
5119
 
@@ -5051,7 +5158,7 @@ var BaseWalletUnlocked = class extends Account {
5051
5158
  */
5052
5159
  async signMessage(message) {
5053
5160
  const signedMessage = await this.signer().sign((0, import_hasher3.hashMessage)(message));
5054
- return (0, import_utils30.hexlify)(signedMessage);
5161
+ return (0, import_utils31.hexlify)(signedMessage);
5055
5162
  }
5056
5163
  /**
5057
5164
  * Signs a transaction with the wallet's private key.
@@ -5064,7 +5171,7 @@ var BaseWalletUnlocked = class extends Account {
5064
5171
  const chainId = this.provider.getChainId();
5065
5172
  const hashedTransaction = transactionRequest.getTransactionId(chainId);
5066
5173
  const signature = await this.signer().sign(hashedTransaction);
5067
- return (0, import_utils30.hexlify)(signature);
5174
+ return (0, import_utils31.hexlify)(signature);
5068
5175
  }
5069
5176
  /**
5070
5177
  * Populates a transaction with the witnesses signature.
@@ -5123,17 +5230,17 @@ var BaseWalletUnlocked = class extends Account {
5123
5230
  __publicField(BaseWalletUnlocked, "defaultPath", "m/44'/1179993420'/0'/0/0");
5124
5231
 
5125
5232
  // src/hdwallet/hdwallet.ts
5126
- var import_errors19 = require("@fuel-ts/errors");
5233
+ var import_errors20 = require("@fuel-ts/errors");
5127
5234
  var import_hasher6 = require("@fuel-ts/hasher");
5128
- var import_math19 = require("@fuel-ts/math");
5129
- var import_utils34 = require("@fuel-ts/utils");
5235
+ var import_math20 = require("@fuel-ts/math");
5236
+ var import_utils35 = require("@fuel-ts/utils");
5130
5237
  var import_ethers3 = require("ethers");
5131
5238
 
5132
5239
  // src/mnemonic/mnemonic.ts
5133
5240
  var import_crypto3 = require("@fuel-ts/crypto");
5134
- var import_errors18 = require("@fuel-ts/errors");
5241
+ var import_errors19 = require("@fuel-ts/errors");
5135
5242
  var import_hasher5 = require("@fuel-ts/hasher");
5136
- var import_utils32 = require("@fuel-ts/utils");
5243
+ var import_utils33 = require("@fuel-ts/utils");
5137
5244
  var import_ethers2 = require("ethers");
5138
5245
 
5139
5246
  // src/wordlists/words/english.ts
@@ -7189,9 +7296,9 @@ var english = [
7189
7296
  ];
7190
7297
 
7191
7298
  // src/mnemonic/utils.ts
7192
- var import_errors17 = require("@fuel-ts/errors");
7299
+ var import_errors18 = require("@fuel-ts/errors");
7193
7300
  var import_hasher4 = require("@fuel-ts/hasher");
7194
- var import_utils31 = require("@fuel-ts/utils");
7301
+ var import_utils32 = require("@fuel-ts/utils");
7195
7302
  function toUtf8Bytes(stri) {
7196
7303
  const str = stri.normalize("NFKD");
7197
7304
  const result = [];
@@ -7206,8 +7313,8 @@ function toUtf8Bytes(stri) {
7206
7313
  i += 1;
7207
7314
  const c2 = str.charCodeAt(i);
7208
7315
  if (i >= str.length || (c2 & 64512) !== 56320) {
7209
- throw new import_errors17.FuelError(
7210
- import_errors17.ErrorCode.INVALID_INPUT_PARAMETERS,
7316
+ throw new import_errors18.FuelError(
7317
+ import_errors18.ErrorCode.INVALID_INPUT_PARAMETERS,
7211
7318
  "Invalid UTF-8 in the input string."
7212
7319
  );
7213
7320
  }
@@ -7258,20 +7365,20 @@ function entropyToMnemonicIndices(entropy) {
7258
7365
  }
7259
7366
  }
7260
7367
  const checksumBits = entropy.length / 4;
7261
- const checksum = (0, import_utils31.arrayify)((0, import_hasher4.sha256)(entropy))[0] & getUpperMask(checksumBits);
7368
+ const checksum = (0, import_utils32.arrayify)((0, import_hasher4.sha256)(entropy))[0] & getUpperMask(checksumBits);
7262
7369
  indices[indices.length - 1] <<= checksumBits;
7263
7370
  indices[indices.length - 1] |= checksum >> 8 - checksumBits;
7264
7371
  return indices;
7265
7372
  }
7266
7373
  function mnemonicWordsToEntropy(words, wordlist) {
7267
7374
  const size = Math.ceil(11 * words.length / 8);
7268
- const entropy = (0, import_utils31.arrayify)(new Uint8Array(size));
7375
+ const entropy = (0, import_utils32.arrayify)(new Uint8Array(size));
7269
7376
  let offset = 0;
7270
7377
  for (let i = 0; i < words.length; i += 1) {
7271
7378
  const index = wordlist.indexOf(words[i].normalize("NFKD"));
7272
7379
  if (index === -1) {
7273
- throw new import_errors17.FuelError(
7274
- import_errors17.ErrorCode.INVALID_MNEMONIC,
7380
+ throw new import_errors18.FuelError(
7381
+ import_errors18.ErrorCode.INVALID_MNEMONIC,
7275
7382
  `Invalid mnemonic: the word '${words[i]}' is not found in the provided wordlist.`
7276
7383
  );
7277
7384
  }
@@ -7285,10 +7392,10 @@ function mnemonicWordsToEntropy(words, wordlist) {
7285
7392
  const entropyBits = 32 * words.length / 3;
7286
7393
  const checksumBits = words.length / 3;
7287
7394
  const checksumMask = getUpperMask(checksumBits);
7288
- const checksum = (0, import_utils31.arrayify)((0, import_hasher4.sha256)(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;
7395
+ const checksum = (0, import_utils32.arrayify)((0, import_hasher4.sha256)(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;
7289
7396
  if (checksum !== (entropy[entropy.length - 1] & checksumMask)) {
7290
- throw new import_errors17.FuelError(
7291
- import_errors17.ErrorCode.INVALID_CHECKSUM,
7397
+ throw new import_errors18.FuelError(
7398
+ import_errors18.ErrorCode.INVALID_CHECKSUM,
7292
7399
  "Checksum validation failed for the provided mnemonic."
7293
7400
  );
7294
7401
  }
@@ -7302,16 +7409,16 @@ var TestnetPRV = "0x04358394";
7302
7409
  var MNEMONIC_SIZES = [12, 15, 18, 21, 24];
7303
7410
  function assertWordList(wordlist) {
7304
7411
  if (wordlist.length !== 2048) {
7305
- throw new import_errors18.FuelError(
7306
- import_errors18.ErrorCode.INVALID_WORD_LIST,
7412
+ throw new import_errors19.FuelError(
7413
+ import_errors19.ErrorCode.INVALID_WORD_LIST,
7307
7414
  `Expected word list length of 2048, but got ${wordlist.length}.`
7308
7415
  );
7309
7416
  }
7310
7417
  }
7311
7418
  function assertEntropy(entropy) {
7312
7419
  if (entropy.length % 4 !== 0 || entropy.length < 16 || entropy.length > 32) {
7313
- throw new import_errors18.FuelError(
7314
- import_errors18.ErrorCode.INVALID_ENTROPY,
7420
+ throw new import_errors19.FuelError(
7421
+ import_errors19.ErrorCode.INVALID_ENTROPY,
7315
7422
  `Entropy should be between 16 and 32 bytes and a multiple of 4, but got ${entropy.length} bytes.`
7316
7423
  );
7317
7424
  }
@@ -7321,7 +7428,7 @@ function assertMnemonic(words) {
7321
7428
  const errorMsg = `Invalid mnemonic size. Expected one of [${MNEMONIC_SIZES.join(
7322
7429
  ", "
7323
7430
  )}] words, but got ${words.length}.`;
7324
- throw new import_errors18.FuelError(import_errors18.ErrorCode.INVALID_MNEMONIC, errorMsg);
7431
+ throw new import_errors19.FuelError(import_errors19.ErrorCode.INVALID_MNEMONIC, errorMsg);
7325
7432
  }
7326
7433
  }
7327
7434
  var Mnemonic = class {
@@ -7360,7 +7467,7 @@ var Mnemonic = class {
7360
7467
  static mnemonicToEntropy(phrase, wordlist = english) {
7361
7468
  const words = getWords(phrase);
7362
7469
  assertMnemonic(words);
7363
- return (0, import_utils32.hexlify)(mnemonicWordsToEntropy(words, wordlist));
7470
+ return (0, import_utils33.hexlify)(mnemonicWordsToEntropy(words, wordlist));
7364
7471
  }
7365
7472
  /**
7366
7473
  * @param entropy - Entropy source to the mnemonic phrase.
@@ -7368,7 +7475,7 @@ var Mnemonic = class {
7368
7475
  * @returns 64-byte array contains privateKey and chainCode as described on BIP39
7369
7476
  */
7370
7477
  static entropyToMnemonic(entropy, wordlist = english) {
7371
- const entropyBytes = (0, import_utils32.arrayify)(entropy);
7478
+ const entropyBytes = (0, import_utils33.arrayify)(entropy);
7372
7479
  assertWordList(wordlist);
7373
7480
  assertEntropy(entropyBytes);
7374
7481
  return entropyToMnemonicIndices(entropyBytes).map((i) => wordlist[i]).join(" ");
@@ -7437,14 +7544,14 @@ var Mnemonic = class {
7437
7544
  * @returns 64-byte array contains privateKey and chainCode as described on BIP39
7438
7545
  */
7439
7546
  static masterKeysFromSeed(seed) {
7440
- const seedArray = (0, import_utils32.arrayify)(seed);
7547
+ const seedArray = (0, import_utils33.arrayify)(seed);
7441
7548
  if (seedArray.length < 16 || seedArray.length > 64) {
7442
- throw new import_errors18.FuelError(
7443
- import_errors18.ErrorCode.INVALID_SEED,
7549
+ throw new import_errors19.FuelError(
7550
+ import_errors19.ErrorCode.INVALID_SEED,
7444
7551
  `Seed length should be between 16 and 64 bytes, but received ${seedArray.length} bytes.`
7445
7552
  );
7446
7553
  }
7447
- return (0, import_utils32.arrayify)((0, import_ethers2.computeHmac)("sha512", MasterSecret, seedArray));
7554
+ return (0, import_utils33.arrayify)((0, import_ethers2.computeHmac)("sha512", MasterSecret, seedArray));
7448
7555
  }
7449
7556
  /**
7450
7557
  * Get the extendKey as defined on BIP-32 from the provided seed
@@ -7455,22 +7562,22 @@ var Mnemonic = class {
7455
7562
  */
7456
7563
  static seedToExtendedKey(seed, testnet = false) {
7457
7564
  const masterKey = Mnemonic.masterKeysFromSeed(seed);
7458
- const prefix = (0, import_utils32.arrayify)(testnet ? TestnetPRV : MainnetPRV);
7565
+ const prefix = (0, import_utils33.arrayify)(testnet ? TestnetPRV : MainnetPRV);
7459
7566
  const depth = "0x00";
7460
7567
  const fingerprint = "0x00000000";
7461
7568
  const index = "0x00000000";
7462
7569
  const chainCode = masterKey.slice(32);
7463
7570
  const privateKey = masterKey.slice(0, 32);
7464
- const extendedKey = (0, import_utils32.concat)([
7571
+ const extendedKey = (0, import_utils33.concat)([
7465
7572
  prefix,
7466
7573
  depth,
7467
7574
  fingerprint,
7468
7575
  index,
7469
7576
  chainCode,
7470
- (0, import_utils32.concat)(["0x00", privateKey])
7577
+ (0, import_utils33.concat)(["0x00", privateKey])
7471
7578
  ]);
7472
7579
  const checksum = (0, import_ethers2.dataSlice)((0, import_hasher5.sha256)((0, import_hasher5.sha256)(extendedKey)), 0, 4);
7473
- return (0, import_ethers2.encodeBase58)((0, import_utils32.concat)([extendedKey, checksum]));
7580
+ return (0, import_ethers2.encodeBase58)((0, import_utils33.concat)([extendedKey, checksum]));
7474
7581
  }
7475
7582
  /**
7476
7583
  * Create a new mnemonic using a randomly generated number as entropy.
@@ -7485,7 +7592,7 @@ var Mnemonic = class {
7485
7592
  * @returns A randomly generated mnemonic
7486
7593
  */
7487
7594
  static generate(size = 32, extraEntropy = "") {
7488
- 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);
7595
+ 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);
7489
7596
  return Mnemonic.entropyToMnemonic(entropy);
7490
7597
  }
7491
7598
  };
@@ -7493,12 +7600,12 @@ var mnemonic_default = Mnemonic;
7493
7600
 
7494
7601
  // src/hdwallet/hdwallet.ts
7495
7602
  var HARDENED_INDEX = 2147483648;
7496
- var MainnetPRV2 = (0, import_utils34.hexlify)("0x0488ade4");
7497
- var MainnetPUB = (0, import_utils34.hexlify)("0x0488b21e");
7498
- var TestnetPRV2 = (0, import_utils34.hexlify)("0x04358394");
7499
- var TestnetPUB = (0, import_utils34.hexlify)("0x043587cf");
7603
+ var MainnetPRV2 = (0, import_utils35.hexlify)("0x0488ade4");
7604
+ var MainnetPUB = (0, import_utils35.hexlify)("0x0488b21e");
7605
+ var TestnetPRV2 = (0, import_utils35.hexlify)("0x04358394");
7606
+ var TestnetPUB = (0, import_utils35.hexlify)("0x043587cf");
7500
7607
  function base58check(data) {
7501
- 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)]));
7608
+ 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)]));
7502
7609
  }
7503
7610
  function getExtendedKeyPrefix(isPublic = false, testnet = false) {
7504
7611
  if (isPublic) {
@@ -7507,17 +7614,17 @@ function getExtendedKeyPrefix(isPublic = false, testnet = false) {
7507
7614
  return testnet ? TestnetPRV2 : MainnetPRV2;
7508
7615
  }
7509
7616
  function isPublicExtendedKey(extendedKey) {
7510
- return [MainnetPUB, TestnetPUB].includes((0, import_utils34.hexlify)(extendedKey.slice(0, 4)));
7617
+ return [MainnetPUB, TestnetPUB].includes((0, import_utils35.hexlify)(extendedKey.slice(0, 4)));
7511
7618
  }
7512
7619
  function isValidExtendedKey(extendedKey) {
7513
7620
  return [MainnetPRV2, TestnetPRV2, MainnetPUB, TestnetPUB].includes(
7514
- (0, import_utils34.hexlify)(extendedKey.slice(0, 4))
7621
+ (0, import_utils35.hexlify)(extendedKey.slice(0, 4))
7515
7622
  );
7516
7623
  }
7517
7624
  function parsePath(path2, depth = 0) {
7518
7625
  const components = path2.split("/");
7519
7626
  if (components.length === 0 || components[0] === "m" && depth !== 0) {
7520
- throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, `invalid path - ${path2}`);
7627
+ throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, `invalid path - ${path2}`);
7521
7628
  }
7522
7629
  if (components[0] === "m") {
7523
7630
  components.shift();
@@ -7529,8 +7636,8 @@ function parsePath(path2, depth = 0) {
7529
7636
  var HDWallet = class {
7530
7637
  depth = 0;
7531
7638
  index = 0;
7532
- fingerprint = (0, import_utils34.hexlify)("0x00000000");
7533
- parentFingerprint = (0, import_utils34.hexlify)("0x00000000");
7639
+ fingerprint = (0, import_utils35.hexlify)("0x00000000");
7640
+ parentFingerprint = (0, import_utils35.hexlify)("0x00000000");
7534
7641
  privateKey;
7535
7642
  publicKey;
7536
7643
  chainCode;
@@ -7542,16 +7649,16 @@ var HDWallet = class {
7542
7649
  constructor(config) {
7543
7650
  if (config.privateKey) {
7544
7651
  const signer = new Signer(config.privateKey);
7545
- this.publicKey = (0, import_utils34.hexlify)(signer.compressedPublicKey);
7546
- this.privateKey = (0, import_utils34.hexlify)(config.privateKey);
7652
+ this.publicKey = (0, import_utils35.hexlify)(signer.compressedPublicKey);
7653
+ this.privateKey = (0, import_utils35.hexlify)(config.privateKey);
7547
7654
  } else {
7548
7655
  if (!config.publicKey) {
7549
- throw new import_errors19.FuelError(
7550
- import_errors19.ErrorCode.HD_WALLET_ERROR,
7656
+ throw new import_errors20.FuelError(
7657
+ import_errors20.ErrorCode.HD_WALLET_ERROR,
7551
7658
  "Both public and private Key cannot be missing. At least one should be provided."
7552
7659
  );
7553
7660
  }
7554
- this.publicKey = (0, import_utils34.hexlify)(config.publicKey);
7661
+ this.publicKey = (0, import_utils35.hexlify)(config.publicKey);
7555
7662
  }
7556
7663
  this.parentFingerprint = config.parentFingerprint || this.parentFingerprint;
7557
7664
  this.fingerprint = (0, import_ethers3.dataSlice)((0, import_ethers3.ripemd160)((0, import_hasher6.sha256)(this.publicKey)), 0, 4);
@@ -7570,28 +7677,28 @@ var HDWallet = class {
7570
7677
  * @returns A new instance of HDWallet on the derived index
7571
7678
  */
7572
7679
  deriveIndex(index) {
7573
- const privateKey = this.privateKey && (0, import_utils34.arrayify)(this.privateKey);
7574
- const publicKey = (0, import_utils34.arrayify)(this.publicKey);
7575
- const chainCode = (0, import_utils34.arrayify)(this.chainCode);
7680
+ const privateKey = this.privateKey && (0, import_utils35.arrayify)(this.privateKey);
7681
+ const publicKey = (0, import_utils35.arrayify)(this.publicKey);
7682
+ const chainCode = (0, import_utils35.arrayify)(this.chainCode);
7576
7683
  const data = new Uint8Array(37);
7577
7684
  if (index & HARDENED_INDEX) {
7578
7685
  if (!privateKey) {
7579
- throw new import_errors19.FuelError(
7580
- import_errors19.ErrorCode.HD_WALLET_ERROR,
7686
+ throw new import_errors20.FuelError(
7687
+ import_errors20.ErrorCode.HD_WALLET_ERROR,
7581
7688
  "Cannot derive a hardened index without a private Key."
7582
7689
  );
7583
7690
  }
7584
7691
  data.set(privateKey, 1);
7585
7692
  } else {
7586
- data.set((0, import_utils34.arrayify)(this.publicKey));
7693
+ data.set((0, import_utils35.arrayify)(this.publicKey));
7587
7694
  }
7588
- data.set((0, import_math19.toBytes)(index, 4), 33);
7589
- const bytes = (0, import_utils34.arrayify)((0, import_ethers3.computeHmac)("sha512", chainCode, data));
7695
+ data.set((0, import_math20.toBytes)(index, 4), 33);
7696
+ const bytes = (0, import_utils35.arrayify)((0, import_ethers3.computeHmac)("sha512", chainCode, data));
7590
7697
  const IL = bytes.slice(0, 32);
7591
7698
  const IR = bytes.slice(32);
7592
7699
  if (privateKey) {
7593
7700
  const N = "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141";
7594
- const ki = (0, import_math19.bn)(IL).add(privateKey).mod(N).toBytes(32);
7701
+ const ki = (0, import_math20.bn)(IL).add(privateKey).mod(N).toBytes(32);
7595
7702
  return new HDWallet({
7596
7703
  privateKey: ki,
7597
7704
  chainCode: IR,
@@ -7600,7 +7707,7 @@ var HDWallet = class {
7600
7707
  parentFingerprint: this.fingerprint
7601
7708
  });
7602
7709
  }
7603
- const signer = new Signer((0, import_utils34.hexlify)(IL));
7710
+ const signer = new Signer((0, import_utils35.hexlify)(IL));
7604
7711
  const Ki = signer.addPoint(publicKey);
7605
7712
  return new HDWallet({
7606
7713
  publicKey: Ki,
@@ -7629,18 +7736,18 @@ var HDWallet = class {
7629
7736
  */
7630
7737
  toExtendedKey(isPublic = false, testnet = false) {
7631
7738
  if (this.depth >= 256) {
7632
- throw new import_errors19.FuelError(
7633
- import_errors19.ErrorCode.HD_WALLET_ERROR,
7739
+ throw new import_errors20.FuelError(
7740
+ import_errors20.ErrorCode.HD_WALLET_ERROR,
7634
7741
  `Exceeded max depth of 255. Current depth: ${this.depth}.`
7635
7742
  );
7636
7743
  }
7637
7744
  const prefix = getExtendedKeyPrefix(this.privateKey == null || isPublic, testnet);
7638
- const depth = (0, import_utils34.hexlify)(Uint8Array.from([this.depth]));
7745
+ const depth = (0, import_utils35.hexlify)(Uint8Array.from([this.depth]));
7639
7746
  const parentFingerprint = this.parentFingerprint;
7640
- const index = (0, import_math19.toHex)(this.index, 4);
7747
+ const index = (0, import_math20.toHex)(this.index, 4);
7641
7748
  const chainCode = this.chainCode;
7642
- const key = this.privateKey != null && !isPublic ? (0, import_utils34.concat)(["0x00", this.privateKey]) : this.publicKey;
7643
- const extendedKey = (0, import_utils34.arrayify)((0, import_utils34.concat)([prefix, depth, parentFingerprint, index, chainCode, key]));
7749
+ const key = this.privateKey != null && !isPublic ? (0, import_utils35.concat)(["0x00", this.privateKey]) : this.publicKey;
7750
+ const extendedKey = (0, import_utils35.arrayify)((0, import_utils35.concat)([prefix, depth, parentFingerprint, index, chainCode, key]));
7644
7751
  return base58check(extendedKey);
7645
7752
  }
7646
7753
  /**
@@ -7652,34 +7759,34 @@ var HDWallet = class {
7652
7759
  static fromSeed(seed) {
7653
7760
  const masterKey = mnemonic_default.masterKeysFromSeed(seed);
7654
7761
  return new HDWallet({
7655
- chainCode: (0, import_utils34.arrayify)(masterKey.slice(32)),
7656
- privateKey: (0, import_utils34.arrayify)(masterKey.slice(0, 32))
7762
+ chainCode: (0, import_utils35.arrayify)(masterKey.slice(32)),
7763
+ privateKey: (0, import_utils35.arrayify)(masterKey.slice(0, 32))
7657
7764
  });
7658
7765
  }
7659
7766
  static fromExtendedKey(extendedKey) {
7660
7767
  const decoded = (0, import_ethers3.toBeHex)((0, import_ethers3.decodeBase58)(extendedKey));
7661
- const bytes = (0, import_utils34.arrayify)(decoded);
7768
+ const bytes = (0, import_utils35.arrayify)(decoded);
7662
7769
  const validChecksum = base58check(bytes.slice(0, 78)) === extendedKey;
7663
7770
  if (bytes.length !== 82 || !isValidExtendedKey(bytes)) {
7664
- throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Provided key is not a valid extended key.");
7771
+ throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, "Provided key is not a valid extended key.");
7665
7772
  }
7666
7773
  if (!validChecksum) {
7667
- throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Provided key has an invalid checksum.");
7774
+ throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, "Provided key has an invalid checksum.");
7668
7775
  }
7669
7776
  const depth = bytes[4];
7670
- const parentFingerprint = (0, import_utils34.hexlify)(bytes.slice(5, 9));
7671
- const index = parseInt((0, import_utils34.hexlify)(bytes.slice(9, 13)).substring(2), 16);
7672
- const chainCode = (0, import_utils34.hexlify)(bytes.slice(13, 45));
7777
+ const parentFingerprint = (0, import_utils35.hexlify)(bytes.slice(5, 9));
7778
+ const index = parseInt((0, import_utils35.hexlify)(bytes.slice(9, 13)).substring(2), 16);
7779
+ const chainCode = (0, import_utils35.hexlify)(bytes.slice(13, 45));
7673
7780
  const key = bytes.slice(45, 78);
7674
7781
  if (depth === 0 && parentFingerprint !== "0x00000000" || depth === 0 && index !== 0) {
7675
- throw new import_errors19.FuelError(
7676
- import_errors19.ErrorCode.HD_WALLET_ERROR,
7782
+ throw new import_errors20.FuelError(
7783
+ import_errors20.ErrorCode.HD_WALLET_ERROR,
7677
7784
  "Inconsistency detected: Depth is zero but fingerprint/index is non-zero."
7678
7785
  );
7679
7786
  }
7680
7787
  if (isPublicExtendedKey(bytes)) {
7681
7788
  if (key[0] !== 3) {
7682
- throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
7789
+ throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, "Invalid public extended key.");
7683
7790
  }
7684
7791
  return new HDWallet({
7685
7792
  publicKey: key,
@@ -7690,7 +7797,7 @@ var HDWallet = class {
7690
7797
  });
7691
7798
  }
7692
7799
  if (key[0] !== 0) {
7693
- throw new import_errors19.FuelError(import_errors19.ErrorCode.HD_WALLET_ERROR, "Invalid private extended key.");
7800
+ throw new import_errors20.FuelError(import_errors20.ErrorCode.HD_WALLET_ERROR, "Invalid private extended key.");
7694
7801
  }
7695
7802
  return new HDWallet({
7696
7803
  privateKey: key.slice(1),
@@ -7883,9 +7990,9 @@ var generateTestWallet = async (provider, quantities) => {
7883
7990
  };
7884
7991
 
7885
7992
  // src/test-utils/launchNode.ts
7886
- var import_configs12 = require("@fuel-ts/address/configs");
7887
- var import_math20 = require("@fuel-ts/math");
7888
- var import_utils35 = require("@fuel-ts/utils");
7993
+ var import_configs13 = require("@fuel-ts/address/configs");
7994
+ var import_math21 = require("@fuel-ts/math");
7995
+ var import_utils36 = require("@fuel-ts/utils");
7889
7996
  var import_cli_utils = require("@fuel-ts/utils/cli-utils");
7890
7997
  var import_child_process = require("child_process");
7891
7998
  var import_crypto5 = require("crypto");
@@ -7943,7 +8050,7 @@ var launchNode = async ({
7943
8050
  "--poa-instant"
7944
8051
  ]);
7945
8052
  const chainConfigPath = getFlagValueFromArgs(args, "--chain");
7946
- const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || import_utils35.defaultConsensusKey;
8053
+ const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || import_utils36.defaultConsensusKey;
7947
8054
  const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
7948
8055
  const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
7949
8056
  const poaInstantFlagValue = getFlagValueFromArgs(args, "--poa-instant");
@@ -7969,21 +8076,21 @@ var launchNode = async ({
7969
8076
  (0, import_fs.mkdirSync)(tempDirPath, { recursive: true });
7970
8077
  }
7971
8078
  const tempChainConfigFilePath = import_path.default.join(tempDirPath, "chainConfig.json");
7972
- let chainConfig = import_utils35.defaultChainConfig;
8079
+ let chainConfig = import_utils36.defaultChainConfig;
7973
8080
  if (!process.env.GENESIS_SECRET) {
7974
8081
  const pk = Signer.generatePrivateKey();
7975
8082
  const signer = new Signer(pk);
7976
- process.env.GENESIS_SECRET = (0, import_utils35.hexlify)(pk);
8083
+ process.env.GENESIS_SECRET = (0, import_utils36.hexlify)(pk);
7977
8084
  chainConfig = {
7978
- ...import_utils35.defaultChainConfig,
8085
+ ...import_utils36.defaultChainConfig,
7979
8086
  initial_state: {
7980
- ...import_utils35.defaultChainConfig.initial_state,
8087
+ ...import_utils36.defaultChainConfig.initial_state,
7981
8088
  coins: [
7982
- ...import_utils35.defaultChainConfig.initial_state.coins,
8089
+ ...import_utils36.defaultChainConfig.initial_state.coins,
7983
8090
  {
7984
8091
  owner: signer.address.toHexString(),
7985
- amount: (0, import_math20.toHex)(1e9),
7986
- asset_id: import_configs12.BaseAssetId
8092
+ amount: (0, import_math21.toHex)(1e9),
8093
+ asset_id: import_configs13.BaseAssetId
7987
8094
  }
7988
8095
  ]
7989
8096
  }
@@ -8051,7 +8158,7 @@ var launchNode = async ({
8051
8158
  var generateWallets = async (count, provider) => {
8052
8159
  const wallets = [];
8053
8160
  for (let i = 0; i < count; i += 1) {
8054
- const wallet = await generateTestWallet(provider, [[1e3, import_configs12.BaseAssetId]]);
8161
+ const wallet = await generateTestWallet(provider, [[1e3, import_configs13.BaseAssetId]]);
8055
8162
  wallets.push(wallet);
8056
8163
  }
8057
8164
  return wallets;