@fuel-ts/account 0.0.0-rc-2040-20240411104812 → 0.0.0-rc-2034-20240411105200

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.

@@ -1051,6 +1051,7 @@ var MemoryCache = class {
1051
1051
  };
1052
1052
 
1053
1053
  // src/providers/transaction-request/input.ts
1054
+ var import_abi_coder = require("@fuel-ts/abi-coder");
1054
1055
  var import_configs2 = require("@fuel-ts/address/configs");
1055
1056
  var import_errors3 = require("@fuel-ts/errors");
1056
1057
  var import_math2 = require("@fuel-ts/math");
@@ -1064,8 +1065,8 @@ var inputify = (value) => {
1064
1065
  const predicateData = (0, import_utils3.arrayify)(value.predicateData ?? "0x");
1065
1066
  return {
1066
1067
  type: import_transactions.InputType.Coin,
1067
- txID: (0, import_utils3.hexlify)((0, import_utils3.arrayify)(value.id).slice(0, 32)),
1068
- outputIndex: (0, import_utils3.arrayify)(value.id)[32],
1068
+ txID: (0, import_utils3.hexlify)((0, import_utils3.arrayify)(value.id).slice(0, import_abi_coder.BYTES_32)),
1069
+ outputIndex: (0, import_math2.toNumber)((0, import_utils3.arrayify)(value.id).slice(import_abi_coder.BYTES_32, import_abi_coder.UTXO_ID_LEN)),
1069
1070
  owner: (0, import_utils3.hexlify)(value.owner),
1070
1071
  amount: (0, import_math2.bn)(value.amount),
1071
1072
  assetId: (0, import_utils3.hexlify)(value.assetId),
@@ -1183,8 +1184,10 @@ var outputify = (value) => {
1183
1184
  };
1184
1185
 
1185
1186
  // src/providers/transaction-request/transaction-request.ts
1187
+ var import_abi_coder2 = require("@fuel-ts/abi-coder");
1186
1188
  var import_address = require("@fuel-ts/address");
1187
1189
  var import_configs7 = require("@fuel-ts/address/configs");
1190
+ var import_crypto = require("@fuel-ts/crypto");
1188
1191
  var import_math7 = require("@fuel-ts/math");
1189
1192
  var import_transactions6 = require("@fuel-ts/transactions");
1190
1193
  var import_utils9 = require("@fuel-ts/utils");
@@ -2045,12 +2048,6 @@ var BaseTransactionRequest = class {
2045
2048
  * @param quantities - CoinQuantity Array.
2046
2049
  */
2047
2050
  fundWithFakeUtxos(quantities, resourcesOwner) {
2048
- let idCounter = 0;
2049
- const generateId = () => {
2050
- const counterString = String(idCounter++);
2051
- const id = import_configs7.ZeroBytes32.slice(0, -counterString.length).concat(counterString);
2052
- return id;
2053
- };
2054
2051
  const findAssetInput = (assetId) => this.inputs.find((input) => {
2055
2052
  if ("assetId" in input) {
2056
2053
  return input.assetId === assetId;
@@ -2060,12 +2057,12 @@ var BaseTransactionRequest = class {
2060
2057
  const updateAssetInput = (assetId, quantity) => {
2061
2058
  const assetInput = findAssetInput(assetId);
2062
2059
  if (assetInput && "assetId" in assetInput) {
2063
- assetInput.id = generateId();
2060
+ assetInput.id = (0, import_utils9.hexlify)((0, import_crypto.randomBytes)(import_abi_coder2.UTXO_ID_LEN));
2064
2061
  assetInput.amount = quantity;
2065
2062
  } else {
2066
2063
  this.addResources([
2067
2064
  {
2068
- id: generateId(),
2065
+ id: (0, import_utils9.hexlify)((0, import_crypto.randomBytes)(import_abi_coder2.UTXO_ID_LEN)),
2069
2066
  amount: quantity,
2070
2067
  assetId,
2071
2068
  owner: resourcesOwner || import_address.Address.fromRandom(),
@@ -2320,7 +2317,7 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2320
2317
  };
2321
2318
 
2322
2319
  // src/providers/transaction-request/script-transaction-request.ts
2323
- var import_abi_coder = require("@fuel-ts/abi-coder");
2320
+ var import_abi_coder3 = require("@fuel-ts/abi-coder");
2324
2321
  var import_address2 = require("@fuel-ts/address");
2325
2322
  var import_configs10 = require("@fuel-ts/address/configs");
2326
2323
  var import_math10 = require("@fuel-ts/math");
@@ -2512,7 +2509,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2512
2509
  * @returns The current instance of the `ScriptTransactionRequest`.
2513
2510
  */
2514
2511
  setData(abi, args) {
2515
- const abiInterface = new import_abi_coder.Interface(abi);
2512
+ const abiInterface = new import_abi_coder3.Interface(abi);
2516
2513
  this.scriptData = abiInterface.functions.main.encodeArguments(args);
2517
2514
  return this;
2518
2515
  }
@@ -2634,17 +2631,17 @@ var import_math13 = require("@fuel-ts/math");
2634
2631
  var import_transactions14 = require("@fuel-ts/transactions");
2635
2632
 
2636
2633
  // src/providers/transaction-summary/call.ts
2637
- var import_abi_coder2 = require("@fuel-ts/abi-coder");
2634
+ var import_abi_coder4 = require("@fuel-ts/abi-coder");
2638
2635
  var import_math12 = require("@fuel-ts/math");
2639
2636
  var getFunctionCall = ({ abi, receipt, rawPayload, maxInputs }) => {
2640
- const abiInterface = new import_abi_coder2.Interface(abi);
2637
+ const abiInterface = new import_abi_coder4.Interface(abi);
2641
2638
  const callFunctionSelector = receipt.param1.toHex(8);
2642
2639
  const functionFragment = abiInterface.getFunction(callFunctionSelector);
2643
2640
  const inputs = functionFragment.jsonFn.inputs;
2644
2641
  let encodedArgs;
2645
2642
  if (functionFragment.isInputDataPointer) {
2646
2643
  if (rawPayload) {
2647
- const argsOffset = (0, import_math12.bn)(receipt.param2).sub((0, import_abi_coder2.calculateVmTxMemory)({ maxInputs: maxInputs.toNumber() })).toNumber();
2644
+ const argsOffset = (0, import_math12.bn)(receipt.param2).sub((0, import_abi_coder4.calculateVmTxMemory)({ maxInputs: maxInputs.toNumber() })).toNumber();
2648
2645
  encodedArgs = `0x${rawPayload.slice(2).slice(argsOffset * 2)}`;
2649
2646
  }
2650
2647
  } else {
@@ -3247,13 +3244,13 @@ function assembleTransactionSummary(params) {
3247
3244
  }
3248
3245
 
3249
3246
  // src/providers/transaction-response/getDecodedLogs.ts
3250
- var import_abi_coder3 = require("@fuel-ts/abi-coder");
3247
+ var import_abi_coder5 = require("@fuel-ts/abi-coder");
3251
3248
  var import_transactions16 = require("@fuel-ts/transactions");
3252
3249
  function getDecodedLogs(receipts, mainAbi, externalAbis = {}) {
3253
3250
  return receipts.reduce((logs, receipt) => {
3254
3251
  if (receipt.type === import_transactions16.ReceiptType.LogData || receipt.type === import_transactions16.ReceiptType.Log) {
3255
- const interfaceToUse = new import_abi_coder3.Interface(externalAbis[receipt.id] || mainAbi);
3256
- const data = receipt.type === import_transactions16.ReceiptType.Log ? new import_abi_coder3.BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
3252
+ const interfaceToUse = new import_abi_coder5.Interface(externalAbis[receipt.id] || mainAbi);
3253
+ const data = receipt.type === import_transactions16.ReceiptType.Log ? new import_abi_coder5.BigNumberCoder("u64").encode(receipt.val0) : receipt.data;
3257
3254
  const [decodedLog] = interfaceToUse.decodeLog(data, receipt.val1.toNumber());
3258
3255
  logs.push(decodedLog);
3259
3256
  }
@@ -3895,6 +3892,36 @@ var _Provider = class {
3895
3892
  missingContractIds
3896
3893
  };
3897
3894
  }
3895
+ /**
3896
+ * Estimates the transaction gas and fee based on the provided transaction request.
3897
+ * @param transactionRequest - The transaction request object.
3898
+ * @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
3899
+ */
3900
+ estimateTxGasAndFee(params) {
3901
+ const { transactionRequest } = params;
3902
+ const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
3903
+ const chainInfo = this.getChain();
3904
+ const gasPrice = transactionRequest.gasPrice.eq(0) ? minGasPrice : transactionRequest.gasPrice;
3905
+ transactionRequest.gasPrice = gasPrice;
3906
+ const minGas = transactionRequest.calculateMinGas(chainInfo);
3907
+ const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
3908
+ if (transactionRequest.type === import_transactions18.TransactionType.Script) {
3909
+ if (transactionRequest.gasLimit.eq(0)) {
3910
+ transactionRequest.gasLimit = minGas;
3911
+ transactionRequest.gasLimit = maxGasPerTx.sub(
3912
+ transactionRequest.calculateMaxGas(chainInfo, minGas)
3913
+ );
3914
+ }
3915
+ }
3916
+ const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
3917
+ const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
3918
+ return {
3919
+ minGas,
3920
+ minFee,
3921
+ maxGas,
3922
+ maxFee
3923
+ };
3924
+ }
3898
3925
  /**
3899
3926
  * Executes a signed transaction without applying the states changes
3900
3927
  * on the chain.
@@ -3942,17 +3969,16 @@ var _Provider = class {
3942
3969
  signatureCallback
3943
3970
  } = {}) {
3944
3971
  const txRequestClone = (0, import_ramda3.clone)(transactionRequestify(transactionRequestLike));
3945
- const chainInfo = this.getChain();
3946
- const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
3947
- const gasPrice = (0, import_math15.max)(txRequestClone.gasPrice, minGasPrice);
3972
+ const { minGasPrice } = this.getGasConfig();
3973
+ const setGasPrice = (0, import_math15.max)(txRequestClone.gasPrice, minGasPrice);
3948
3974
  const isScriptTransaction = txRequestClone.type === import_transactions18.TransactionType.Script;
3949
3975
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
3950
3976
  const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
3951
3977
  txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
3978
+ if (isScriptTransaction) {
3979
+ txRequestClone.gasLimit = (0, import_math15.bn)(0);
3980
+ }
3952
3981
  if (estimatePredicates) {
3953
- if (isScriptTransaction) {
3954
- txRequestClone.gasLimit = (0, import_math15.bn)(0);
3955
- }
3956
3982
  if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
3957
3983
  resourcesOwner.populateTransactionPredicateData(txRequestClone);
3958
3984
  }
@@ -3961,36 +3987,34 @@ var _Provider = class {
3961
3987
  if (signatureCallback && isScriptTransaction) {
3962
3988
  await signatureCallback(txRequestClone);
3963
3989
  }
3964
- const minGas = txRequestClone.calculateMinGas(chainInfo);
3965
- const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
3990
+ let { maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
3991
+ transactionRequest: txRequestClone
3992
+ });
3966
3993
  let receipts = [];
3967
3994
  let missingContractIds = [];
3968
3995
  let outputVariables = 0;
3996
+ let gasUsed = (0, import_math15.bn)(0);
3969
3997
  if (isScriptTransaction && estimateTxDependencies) {
3970
3998
  txRequestClone.gasPrice = (0, import_math15.bn)(0);
3971
- txRequestClone.gasLimit = (0, import_math15.bn)(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
3972
3999
  const result = await this.estimateTxDependencies(txRequestClone);
3973
4000
  receipts = result.receipts;
3974
4001
  outputVariables = result.outputVariables;
3975
4002
  missingContractIds = result.missingContractIds;
4003
+ gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : gasUsed;
4004
+ txRequestClone.gasLimit = gasUsed;
4005
+ txRequestClone.gasPrice = setGasPrice;
4006
+ ({ maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
4007
+ transactionRequest: txRequestClone
4008
+ }));
3976
4009
  }
3977
- const gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : minGas;
3978
- const usedFee = calculatePriceWithFactor(
3979
- gasUsed,
3980
- gasPrice,
3981
- gasPriceFactor
3982
- ).normalizeZeroToOne();
3983
- const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
3984
- const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
3985
4010
  return {
3986
4011
  requiredQuantities: allQuantities,
3987
4012
  receipts,
3988
4013
  gasUsed,
3989
4014
  minGasPrice,
3990
- gasPrice,
4015
+ gasPrice: setGasPrice,
3991
4016
  minGas,
3992
4017
  maxGas,
3993
- usedFee,
3994
4018
  minFee,
3995
4019
  maxFee,
3996
4020
  estimatedInputs: txRequestClone.inputs,
@@ -4457,13 +4481,13 @@ var assets = [
4457
4481
  ];
4458
4482
 
4459
4483
  // src/utils/formatTransferToContractScriptData.ts
4460
- var import_abi_coder4 = require("@fuel-ts/abi-coder");
4484
+ var import_abi_coder6 = require("@fuel-ts/abi-coder");
4461
4485
  var import_math17 = require("@fuel-ts/math");
4462
4486
  var import_utils27 = require("@fuel-ts/utils");
4463
4487
  var asm = __toESM(require("@fuels/vm-asm"));
4464
4488
  var formatTransferToContractScriptData = (params) => {
4465
4489
  const { assetId, amountToTransfer, hexlifiedContractId } = params;
4466
- const numberCoder = new import_abi_coder4.BigNumberCoder("u64");
4490
+ const numberCoder = new import_abi_coder6.BigNumberCoder("u64");
4467
4491
  const encoded = numberCoder.encode(new import_math17.BN(amountToTransfer).toNumber());
4468
4492
  const scriptData = Uint8Array.from([
4469
4493
  ...(0, import_utils27.arrayify)(hexlifiedContractId),
@@ -4914,7 +4938,7 @@ var Account = class extends import_interfaces.AbstractAccount {
4914
4938
 
4915
4939
  // src/signer/signer.ts
4916
4940
  var import_address5 = require("@fuel-ts/address");
4917
- var import_crypto = require("@fuel-ts/crypto");
4941
+ var import_crypto2 = require("@fuel-ts/crypto");
4918
4942
  var import_hasher2 = require("@fuel-ts/hasher");
4919
4943
  var import_math19 = require("@fuel-ts/math");
4920
4944
  var import_utils29 = require("@fuel-ts/utils");
@@ -5007,7 +5031,7 @@ var Signer = class {
5007
5031
  * @returns random 32-byte hashed
5008
5032
  */
5009
5033
  static generatePrivateKey(entropy) {
5010
- 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);
5034
+ return entropy ? (0, import_hasher2.hash)((0, import_utils29.concat)([(0, import_crypto2.randomBytes)(32), (0, import_utils29.arrayify)(entropy)])) : (0, import_crypto2.randomBytes)(32);
5011
5035
  }
5012
5036
  /**
5013
5037
  * Extended publicKey from a compact publicKey
@@ -5023,7 +5047,7 @@ var Signer = class {
5023
5047
 
5024
5048
  // src/wallet/keystore-wallet.ts
5025
5049
  var import_address6 = require("@fuel-ts/address");
5026
- var import_crypto2 = require("@fuel-ts/crypto");
5050
+ var import_crypto3 = require("@fuel-ts/crypto");
5027
5051
  var import_errors17 = require("@fuel-ts/errors");
5028
5052
  var import_utils30 = require("@fuel-ts/utils");
5029
5053
  var import_uuid = require("uuid");
@@ -5039,22 +5063,22 @@ var removeHexPrefix = (hexString) => {
5039
5063
  return hexString;
5040
5064
  };
5041
5065
  async function encryptKeystoreWallet(privateKey, address, password) {
5042
- const privateKeyBuffer = (0, import_crypto2.bufferFromString)(removeHexPrefix(privateKey), "hex");
5066
+ const privateKeyBuffer = (0, import_crypto3.bufferFromString)(removeHexPrefix(privateKey), "hex");
5043
5067
  const ownerAddress = import_address6.Address.fromAddressOrString(address);
5044
- const salt = (0, import_crypto2.randomBytes)(DEFAULT_KEY_SIZE);
5045
- const key = (0, import_crypto2.scrypt)({
5046
- password: (0, import_crypto2.bufferFromString)(password),
5068
+ const salt = (0, import_crypto3.randomBytes)(DEFAULT_KEY_SIZE);
5069
+ const key = (0, import_crypto3.scrypt)({
5070
+ password: (0, import_crypto3.bufferFromString)(password),
5047
5071
  salt,
5048
5072
  dklen: DEFAULT_KEY_SIZE,
5049
5073
  n: 2 ** DEFAULT_KDF_PARAMS_LOG_N,
5050
5074
  r: DEFAULT_KDF_PARAMS_R,
5051
5075
  p: DEFAULT_KDF_PARAMS_P
5052
5076
  });
5053
- const iv = (0, import_crypto2.randomBytes)(DEFAULT_IV_SIZE);
5054
- const ciphertext = await (0, import_crypto2.encryptJsonWalletData)(privateKeyBuffer, key, iv);
5077
+ const iv = (0, import_crypto3.randomBytes)(DEFAULT_IV_SIZE);
5078
+ const ciphertext = await (0, import_crypto3.encryptJsonWalletData)(privateKeyBuffer, key, iv);
5055
5079
  const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertext]);
5056
- const macHashUint8Array = (0, import_crypto2.keccak256)(data);
5057
- const mac = (0, import_crypto2.stringFromBuffer)(macHashUint8Array, "hex");
5080
+ const macHashUint8Array = (0, import_crypto3.keccak256)(data);
5081
+ const mac = (0, import_crypto3.stringFromBuffer)(macHashUint8Array, "hex");
5058
5082
  const keystore = {
5059
5083
  id: (0, import_uuid.v4)(),
5060
5084
  version: 3,
@@ -5062,15 +5086,15 @@ async function encryptKeystoreWallet(privateKey, address, password) {
5062
5086
  crypto: {
5063
5087
  cipher: "aes-128-ctr",
5064
5088
  mac,
5065
- cipherparams: { iv: (0, import_crypto2.stringFromBuffer)(iv, "hex") },
5066
- ciphertext: (0, import_crypto2.stringFromBuffer)(ciphertext, "hex"),
5089
+ cipherparams: { iv: (0, import_crypto3.stringFromBuffer)(iv, "hex") },
5090
+ ciphertext: (0, import_crypto3.stringFromBuffer)(ciphertext, "hex"),
5067
5091
  kdf: "scrypt",
5068
5092
  kdfparams: {
5069
5093
  dklen: DEFAULT_KEY_SIZE,
5070
5094
  n: 2 ** DEFAULT_KDF_PARAMS_LOG_N,
5071
5095
  p: DEFAULT_KDF_PARAMS_P,
5072
5096
  r: DEFAULT_KDF_PARAMS_R,
5073
- salt: (0, import_crypto2.stringFromBuffer)(salt, "hex")
5097
+ salt: (0, import_crypto3.stringFromBuffer)(salt, "hex")
5074
5098
  }
5075
5099
  }
5076
5100
  };
@@ -5086,11 +5110,11 @@ async function decryptKeystoreWallet(jsonWallet, password) {
5086
5110
  kdfparams: { dklen, n, r, p, salt }
5087
5111
  }
5088
5112
  } = keystoreWallet;
5089
- const ciphertextBuffer = (0, import_crypto2.bufferFromString)(ciphertext, "hex");
5090
- const ivBuffer = (0, import_crypto2.bufferFromString)(iv, "hex");
5091
- const saltBuffer = (0, import_crypto2.bufferFromString)(salt, "hex");
5092
- const passwordBuffer = (0, import_crypto2.bufferFromString)(password);
5093
- const key = (0, import_crypto2.scrypt)({
5113
+ const ciphertextBuffer = (0, import_crypto3.bufferFromString)(ciphertext, "hex");
5114
+ const ivBuffer = (0, import_crypto3.bufferFromString)(iv, "hex");
5115
+ const saltBuffer = (0, import_crypto3.bufferFromString)(salt, "hex");
5116
+ const passwordBuffer = (0, import_crypto3.bufferFromString)(password);
5117
+ const key = (0, import_crypto3.scrypt)({
5094
5118
  password: passwordBuffer,
5095
5119
  salt: saltBuffer,
5096
5120
  n,
@@ -5099,15 +5123,15 @@ async function decryptKeystoreWallet(jsonWallet, password) {
5099
5123
  dklen
5100
5124
  });
5101
5125
  const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertextBuffer]);
5102
- const macHashUint8Array = (0, import_crypto2.keccak256)(data);
5103
- const macHash = (0, import_crypto2.stringFromBuffer)(macHashUint8Array, "hex");
5126
+ const macHashUint8Array = (0, import_crypto3.keccak256)(data);
5127
+ const macHash = (0, import_crypto3.stringFromBuffer)(macHashUint8Array, "hex");
5104
5128
  if (mac !== macHash) {
5105
5129
  throw new import_errors17.FuelError(
5106
5130
  import_errors17.ErrorCode.INVALID_PASSWORD,
5107
5131
  "Failed to decrypt the keystore wallet, the provided password is incorrect."
5108
5132
  );
5109
5133
  }
5110
- const buffer = await (0, import_crypto2.decryptJsonWalletData)(ciphertextBuffer, key, ivBuffer);
5134
+ const buffer = await (0, import_crypto3.decryptJsonWalletData)(ciphertextBuffer, key, ivBuffer);
5111
5135
  const privateKey = (0, import_utils30.hexlify)(buffer);
5112
5136
  return privateKey;
5113
5137
  }
@@ -5232,7 +5256,7 @@ var import_utils35 = require("@fuel-ts/utils");
5232
5256
  var import_ethers3 = require("ethers");
5233
5257
 
5234
5258
  // src/mnemonic/mnemonic.ts
5235
- var import_crypto3 = require("@fuel-ts/crypto");
5259
+ var import_crypto4 = require("@fuel-ts/crypto");
5236
5260
  var import_errors19 = require("@fuel-ts/errors");
5237
5261
  var import_hasher5 = require("@fuel-ts/hasher");
5238
5262
  var import_utils33 = require("@fuel-ts/utils");
@@ -7587,7 +7611,7 @@ var Mnemonic = class {
7587
7611
  * @returns A randomly generated mnemonic
7588
7612
  */
7589
7613
  static generate(size = 32, extraEntropy = "") {
7590
- 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);
7614
+ const entropy = extraEntropy ? (0, import_hasher5.sha256)((0, import_utils33.concat)([(0, import_crypto4.randomBytes)(size), (0, import_utils33.arrayify)(extraEntropy)])) : (0, import_crypto4.randomBytes)(size);
7591
7615
  return Mnemonic.entropyToMnemonic(entropy);
7592
7616
  }
7593
7617
  };
@@ -7958,10 +7982,10 @@ __publicField(Wallet, "fromExtendedKey", WalletUnlocked.fromExtendedKey);
7958
7982
  __publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
7959
7983
 
7960
7984
  // src/test-utils/seedTestWallet.ts
7961
- var import_crypto4 = require("@fuel-ts/crypto");
7985
+ var import_crypto5 = require("@fuel-ts/crypto");
7962
7986
  var seedTestWallet = async (wallet, quantities) => {
7963
7987
  const genesisWallet = new WalletUnlocked(
7964
- process.env.GENESIS_SECRET || (0, import_crypto4.randomBytes)(32),
7988
+ process.env.GENESIS_SECRET || (0, import_crypto5.randomBytes)(32),
7965
7989
  wallet.provider
7966
7990
  );
7967
7991
  const resources = await genesisWallet.getResourcesToSpend(quantities);
@@ -7990,7 +8014,7 @@ var import_math21 = require("@fuel-ts/math");
7990
8014
  var import_utils36 = require("@fuel-ts/utils");
7991
8015
  var import_cli_utils = require("@fuel-ts/utils/cli-utils");
7992
8016
  var import_child_process = require("child_process");
7993
- var import_crypto5 = require("crypto");
8017
+ var import_crypto6 = require("crypto");
7994
8018
  var import_fs = require("fs");
7995
8019
  var import_os = __toESM(require("os"));
7996
8020
  var import_path = __toESM(require("path"));
@@ -8062,7 +8086,7 @@ var launchNode = async ({
8062
8086
  })).toString();
8063
8087
  let chainConfigPathToUse;
8064
8088
  const prefix = basePath || import_os.default.tmpdir();
8065
- const suffix = basePath ? "" : (0, import_crypto5.randomUUID)();
8089
+ const suffix = basePath ? "" : (0, import_crypto6.randomUUID)();
8066
8090
  const tempDirPath = import_path.default.join(prefix, ".fuels", suffix);
8067
8091
  if (chainConfigPath) {
8068
8092
  chainConfigPathToUse = chainConfigPath;