@fuel-ts/account 0.89.2 → 0.90.0

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.

Files changed (50) hide show
  1. package/dist/account.d.ts +8 -0
  2. package/dist/account.d.ts.map +1 -1
  3. package/dist/configs.d.ts +3 -1
  4. package/dist/configs.d.ts.map +1 -1
  5. package/dist/configs.global.js +4 -2
  6. package/dist/configs.global.js.map +1 -1
  7. package/dist/configs.js +10 -4
  8. package/dist/configs.js.map +1 -1
  9. package/dist/configs.mjs +7 -3
  10. package/dist/configs.mjs.map +1 -1
  11. package/dist/index.global.js +3328 -3275
  12. package/dist/index.global.js.map +1 -1
  13. package/dist/index.js +217 -169
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +121 -72
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/predicate/predicate.d.ts +8 -0
  18. package/dist/predicate/predicate.d.ts.map +1 -1
  19. package/dist/providers/__generated__/operations.d.ts +58 -0
  20. package/dist/providers/__generated__/operations.d.ts.map +1 -1
  21. package/dist/providers/chains.d.ts +1 -1
  22. package/dist/providers/provider.d.ts +12 -2
  23. package/dist/providers/provider.d.ts.map +1 -1
  24. package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -1
  25. package/dist/providers/utils/index.d.ts +0 -1
  26. package/dist/providers/utils/index.d.ts.map +1 -1
  27. package/dist/test-utils/asset-id.d.ts +8 -0
  28. package/dist/test-utils/asset-id.d.ts.map +1 -0
  29. package/dist/test-utils/launchNode.d.ts +8 -1
  30. package/dist/test-utils/launchNode.d.ts.map +1 -1
  31. package/dist/test-utils/setup-test-provider-and-wallets.d.ts +33 -0
  32. package/dist/test-utils/setup-test-provider-and-wallets.d.ts.map +1 -0
  33. package/dist/test-utils/test-message.d.ts +29 -0
  34. package/dist/test-utils/test-message.d.ts.map +1 -0
  35. package/dist/test-utils/wallet-config.d.ts +55 -0
  36. package/dist/test-utils/wallet-config.d.ts.map +1 -0
  37. package/dist/test-utils.d.ts +8 -0
  38. package/dist/test-utils.d.ts.map +1 -0
  39. package/dist/test-utils.global.js +2275 -1900
  40. package/dist/test-utils.global.js.map +1 -1
  41. package/dist/test-utils.js +491 -210
  42. package/dist/test-utils.js.map +1 -1
  43. package/dist/test-utils.mjs +398 -121
  44. package/dist/test-utils.mjs.map +1 -1
  45. package/dist/wallet/base-wallet-unlocked.d.ts +1 -1
  46. package/package.json +18 -17
  47. package/dist/providers/utils/sleep.d.ts +0 -3
  48. package/dist/providers/utils/sleep.d.ts.map +0 -1
  49. package/dist/test-utils/index.d.ts +0 -4
  50. package/dist/test-utils/index.d.ts.map +0 -1
package/dist/index.mjs CHANGED
@@ -28,11 +28,13 @@ var __privateMethod = (obj, member, method) => {
28
28
  };
29
29
 
30
30
  // src/account.ts
31
+ import { UTXO_ID_LEN as UTXO_ID_LEN3 } from "@fuel-ts/abi-coder";
31
32
  import { Address as Address3 } from "@fuel-ts/address";
33
+ import { randomBytes as randomBytes2 } from "@fuel-ts/crypto";
32
34
  import { ErrorCode as ErrorCode15, FuelError as FuelError15 } from "@fuel-ts/errors";
33
35
  import { AbstractAccount } from "@fuel-ts/interfaces";
34
36
  import { bn as bn19 } from "@fuel-ts/math";
35
- import { arrayify as arrayify14, isDefined as isDefined2 } from "@fuel-ts/utils";
37
+ import { arrayify as arrayify14, hexlify as hexlify13, isDefined as isDefined2 } from "@fuel-ts/utils";
36
38
  import { clone as clone4 } from "ramda";
37
39
 
38
40
  // src/providers/coin-quantity.ts
@@ -307,6 +309,7 @@ var MessageProofFragmentDoc = gql`
307
309
  proofIndex
308
310
  }
309
311
  messageBlockHeader {
312
+ version
310
313
  id
311
314
  daHeight
312
315
  consensusParametersVersion
@@ -322,6 +325,7 @@ var MessageProofFragmentDoc = gql`
322
325
  applicationHash
323
326
  }
324
327
  commitBlockHeader {
328
+ version
325
329
  id
326
330
  daHeight
327
331
  consensusParametersVersion
@@ -508,6 +512,9 @@ var GasCostsFragmentDoc = gql`
508
512
  wqmm
509
513
  xor
510
514
  xori
515
+ alocDependentCost {
516
+ ...DependentCostFragment
517
+ }
511
518
  call {
512
519
  ...DependentCostFragment
513
520
  }
@@ -692,9 +699,13 @@ var GetTransactionsDocument = gql`
692
699
  ...transactionFragment
693
700
  }
694
701
  }
702
+ pageInfo {
703
+ ...pageInfoFragment
704
+ }
695
705
  }
696
706
  }
697
- ${TransactionFragmentDoc}`;
707
+ ${TransactionFragmentDoc}
708
+ ${PageInfoFragmentDoc}`;
698
709
  var GetTransactionsByOwnerDocument = gql`
699
710
  query getTransactionsByOwner($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
700
711
  transactionsByOwner(
@@ -886,8 +897,12 @@ var GetRelayedTransactionStatusDocument = gql`
886
897
  }
887
898
  ${RelayedTransactionStatusFragmentDoc}`;
888
899
  var DryRunDocument = gql`
889
- mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
890
- dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
900
+ mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean, $gasPrice: U64) {
901
+ dryRun(
902
+ txs: $encodedTransactions
903
+ utxoValidation: $utxoValidation
904
+ gasPrice: $gasPrice
905
+ ) {
891
906
  ...dryRunTransactionExecutionStatusFragment
892
907
  }
893
908
  }
@@ -1714,15 +1729,6 @@ function normalizeJSON(root) {
1714
1729
  return normalize(clone(root));
1715
1730
  }
1716
1731
 
1717
- // src/providers/utils/sleep.ts
1718
- function sleep(time) {
1719
- return new Promise((resolve) => {
1720
- setTimeout(() => {
1721
- resolve(true);
1722
- }, time);
1723
- });
1724
- }
1725
-
1726
1732
  // src/providers/utils/extract-tx-error.ts
1727
1733
  import { ErrorCode as ErrorCode7, FuelError as FuelError7 } from "@fuel-ts/errors";
1728
1734
  import { bn as bn6 } from "@fuel-ts/math";
@@ -3752,6 +3758,7 @@ var TransactionResponse = class {
3752
3758
  };
3753
3759
 
3754
3760
  // src/providers/utils/auto-retry-fetch.ts
3761
+ import { sleep } from "@fuel-ts/utils";
3755
3762
  function getWaitDelay(options, retryAttemptNum) {
3756
3763
  const duration = options.baseDelay ?? 150;
3757
3764
  switch (options.backoff) {
@@ -4178,7 +4185,7 @@ Supported fuel-core version: ${supportedVersion}.`
4178
4185
  * @param sendTransactionParams - The provider call parameters (optional).
4179
4186
  * @returns A promise that resolves to the call result object.
4180
4187
  */
4181
- async call(transactionRequestLike, { utxoValidation, estimateTxDependencies = true } = {}) {
4188
+ async dryRun(transactionRequestLike, { utxoValidation, estimateTxDependencies = true } = {}) {
4182
4189
  const transactionRequest = transactionRequestify(transactionRequestLike);
4183
4190
  if (estimateTxDependencies) {
4184
4191
  return this.estimateTxDependencies(transactionRequest);
@@ -4717,6 +4724,21 @@ Supported fuel-core version: ${supportedVersion}.`
4717
4724
  0
4718
4725
  )?.[0];
4719
4726
  }
4727
+ /**
4728
+ * Retrieves transactions based on the provided pagination arguments.
4729
+ * @param paginationArgs - The pagination arguments for retrieving transactions.
4730
+ * @returns A promise that resolves to an object containing the retrieved transactions and pagination information.
4731
+ */
4732
+ async getTransactions(paginationArgs) {
4733
+ const {
4734
+ transactions: { edges, pageInfo }
4735
+ } = await this.operations.getTransactions(paginationArgs);
4736
+ const coder = new TransactionCoder5();
4737
+ const transactions = edges.map(
4738
+ ({ node: { rawPayload } }) => coder.decode(arrayify11(rawPayload), 0)[0]
4739
+ );
4740
+ return { transactions, pageInfo };
4741
+ }
4720
4742
  /**
4721
4743
  * Get deployed contract with the given ID.
4722
4744
  *
@@ -5077,7 +5099,7 @@ async function getTransactionSummary(params) {
5077
5099
  }
5078
5100
  async function getTransactionSummaryFromRequest(params) {
5079
5101
  const { provider, transactionRequest, abiMap } = params;
5080
- const { receipts } = await provider.call(transactionRequest);
5102
+ const { receipts } = await provider.dryRun(transactionRequest);
5081
5103
  const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = provider.getGasConfig();
5082
5104
  const maxInputs = provider.getChain().consensusParameters.txParameters.maxInputs;
5083
5105
  const transaction = transactionRequest.toTransaction();
@@ -5155,8 +5177,8 @@ var CHAIN_IDS = {
5155
5177
  foundry: 31337
5156
5178
  },
5157
5179
  fuel: {
5158
- beta5: 0,
5159
- devnet: 10
5180
+ devnet: 0,
5181
+ testnet: 0
5160
5182
  }
5161
5183
  };
5162
5184
 
@@ -5166,7 +5188,7 @@ var getDefaultChainId = (networkType) => {
5166
5188
  return CHAIN_IDS.eth.sepolia;
5167
5189
  }
5168
5190
  if (networkType === "fuel") {
5169
- return CHAIN_IDS.fuel.devnet;
5191
+ return CHAIN_IDS.fuel.testnet;
5170
5192
  }
5171
5193
  return void 0;
5172
5194
  };
@@ -5258,15 +5280,15 @@ var rawAssets = [
5258
5280
  },
5259
5281
  {
5260
5282
  type: "fuel",
5261
- chainId: CHAIN_IDS.fuel.beta5,
5283
+ chainId: CHAIN_IDS.fuel.devnet,
5262
5284
  decimals: 9,
5263
- assetId: "0x0000000000000000000000000000000000000000000000000000000000000000"
5285
+ assetId: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
5264
5286
  },
5265
5287
  {
5266
5288
  type: "fuel",
5267
- chainId: CHAIN_IDS.fuel.devnet,
5289
+ chainId: CHAIN_IDS.fuel.testnet,
5268
5290
  decimals: 9,
5269
- assetId: "0x0000000000000000000000000000000000000000000000000000000000000000"
5291
+ assetId: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
5270
5292
  }
5271
5293
  ]
5272
5294
  }
@@ -5780,6 +5802,21 @@ var Account = class extends AbstractAccount {
5780
5802
  }
5781
5803
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
5782
5804
  }
5805
+ /**
5806
+ * Generates an array of fake resources based on the provided coins.
5807
+ *
5808
+ * @param coins - An array of `FakeResources` objects representing the coins.
5809
+ * @returns An array of `Resource` objects with generated properties.
5810
+ */
5811
+ generateFakeResources(coins) {
5812
+ return coins.map((coin) => ({
5813
+ id: hexlify13(randomBytes2(UTXO_ID_LEN3)),
5814
+ owner: this.address,
5815
+ blockCreated: bn19(1),
5816
+ txCreatedIdx: bn19(1),
5817
+ ...coin
5818
+ }));
5819
+ }
5783
5820
  /** @hidden * */
5784
5821
  validateTransferAmount(amount) {
5785
5822
  if (bn19(amount).lte(0)) {
@@ -5834,14 +5871,14 @@ var Account = class extends AbstractAccount {
5834
5871
 
5835
5872
  // src/wallet/base-wallet-unlocked.ts
5836
5873
  import { hashMessage } from "@fuel-ts/hasher";
5837
- import { hexlify as hexlify15 } from "@fuel-ts/utils";
5874
+ import { hexlify as hexlify16 } from "@fuel-ts/utils";
5838
5875
 
5839
5876
  // src/signer/signer.ts
5840
5877
  import { Address as Address4 } from "@fuel-ts/address";
5841
- import { randomBytes as randomBytes2 } from "@fuel-ts/crypto";
5878
+ import { randomBytes as randomBytes3 } from "@fuel-ts/crypto";
5842
5879
  import { hash } from "@fuel-ts/hasher";
5843
5880
  import { toBytes } from "@fuel-ts/math";
5844
- import { hexlify as hexlify13, concat as concat3, arrayify as arrayify15 } from "@fuel-ts/utils";
5881
+ import { hexlify as hexlify14, concat as concat3, arrayify as arrayify15 } from "@fuel-ts/utils";
5845
5882
  import { secp256k1 } from "@noble/curves/secp256k1";
5846
5883
  var Signer = class {
5847
5884
  address;
@@ -5861,9 +5898,9 @@ var Signer = class {
5861
5898
  }
5862
5899
  }
5863
5900
  const privateKeyBytes = toBytes(privateKey, 32);
5864
- this.privateKey = hexlify13(privateKeyBytes);
5865
- this.publicKey = hexlify13(secp256k1.getPublicKey(privateKeyBytes, false).slice(1));
5866
- this.compressedPublicKey = hexlify13(secp256k1.getPublicKey(privateKeyBytes, true));
5901
+ this.privateKey = hexlify14(privateKeyBytes);
5902
+ this.publicKey = hexlify14(secp256k1.getPublicKey(privateKeyBytes, false).slice(1));
5903
+ this.compressedPublicKey = hexlify14(secp256k1.getPublicKey(privateKeyBytes, true));
5867
5904
  this.address = Address4.fromPublicKey(this.publicKey);
5868
5905
  }
5869
5906
  /**
@@ -5881,7 +5918,7 @@ var Signer = class {
5881
5918
  const r = toBytes(`0x${signature.r.toString(16)}`, 32);
5882
5919
  const s = toBytes(`0x${signature.s.toString(16)}`, 32);
5883
5920
  s[0] |= (signature.recovery || 0) << 7;
5884
- return hexlify13(concat3([r, s]));
5921
+ return hexlify14(concat3([r, s]));
5885
5922
  }
5886
5923
  /**
5887
5924
  * Add point on the current elliptic curve
@@ -5908,11 +5945,11 @@ var Signer = class {
5908
5945
  const s = signedMessageBytes.slice(32, 64);
5909
5946
  const recoveryParam = (s[0] & 128) >> 7;
5910
5947
  s[0] &= 127;
5911
- const sig = new secp256k1.Signature(BigInt(hexlify13(r)), BigInt(hexlify13(s))).addRecoveryBit(
5948
+ const sig = new secp256k1.Signature(BigInt(hexlify14(r)), BigInt(hexlify14(s))).addRecoveryBit(
5912
5949
  recoveryParam
5913
5950
  );
5914
5951
  const publicKey = sig.recoverPublicKey(arrayify15(data)).toRawBytes(false).slice(1);
5915
- return hexlify13(publicKey);
5952
+ return hexlify14(publicKey);
5916
5953
  }
5917
5954
  /**
5918
5955
  * Recover the address from a signature performed with [`sign`](#sign).
@@ -5931,7 +5968,7 @@ var Signer = class {
5931
5968
  * @returns random 32-byte hashed
5932
5969
  */
5933
5970
  static generatePrivateKey(entropy) {
5934
- return entropy ? hash(concat3([randomBytes2(32), arrayify15(entropy)])) : randomBytes2(32);
5971
+ return entropy ? hash(concat3([randomBytes3(32), arrayify15(entropy)])) : randomBytes3(32);
5935
5972
  }
5936
5973
  /**
5937
5974
  * Extended publicKey from a compact publicKey
@@ -5941,7 +5978,7 @@ var Signer = class {
5941
5978
  */
5942
5979
  static extendPublicKey(publicKey) {
5943
5980
  const point = secp256k1.ProjectivePoint.fromHex(arrayify15(publicKey));
5944
- return hexlify13(point.toRawBytes(false).slice(1));
5981
+ return hexlify14(point.toRawBytes(false).slice(1));
5945
5982
  }
5946
5983
  };
5947
5984
 
@@ -5950,14 +5987,14 @@ import { Address as Address5 } from "@fuel-ts/address";
5950
5987
  import {
5951
5988
  bufferFromString,
5952
5989
  keccak256,
5953
- randomBytes as randomBytes3,
5990
+ randomBytes as randomBytes4,
5954
5991
  scrypt,
5955
5992
  stringFromBuffer,
5956
5993
  decryptJsonWalletData,
5957
5994
  encryptJsonWalletData
5958
5995
  } from "@fuel-ts/crypto";
5959
5996
  import { ErrorCode as ErrorCode16, FuelError as FuelError16 } from "@fuel-ts/errors";
5960
- import { hexlify as hexlify14 } from "@fuel-ts/utils";
5997
+ import { hexlify as hexlify15 } from "@fuel-ts/utils";
5961
5998
  import { v4 as uuidv4 } from "uuid";
5962
5999
  var DEFAULT_KDF_PARAMS_LOG_N = 13;
5963
6000
  var DEFAULT_KDF_PARAMS_R = 8;
@@ -5973,7 +6010,7 @@ var removeHexPrefix = (hexString) => {
5973
6010
  async function encryptKeystoreWallet(privateKey, address, password) {
5974
6011
  const privateKeyBuffer = bufferFromString(removeHexPrefix(privateKey), "hex");
5975
6012
  const ownerAddress = Address5.fromAddressOrString(address);
5976
- const salt = randomBytes3(DEFAULT_KEY_SIZE);
6013
+ const salt = randomBytes4(DEFAULT_KEY_SIZE);
5977
6014
  const key = scrypt({
5978
6015
  password: bufferFromString(password),
5979
6016
  salt,
@@ -5982,7 +6019,7 @@ async function encryptKeystoreWallet(privateKey, address, password) {
5982
6019
  r: DEFAULT_KDF_PARAMS_R,
5983
6020
  p: DEFAULT_KDF_PARAMS_P
5984
6021
  });
5985
- const iv = randomBytes3(DEFAULT_IV_SIZE);
6022
+ const iv = randomBytes4(DEFAULT_IV_SIZE);
5986
6023
  const ciphertext = await encryptJsonWalletData(privateKeyBuffer, key, iv);
5987
6024
  const data = Uint8Array.from([...key.subarray(16, 32), ...ciphertext]);
5988
6025
  const macHashUint8Array = keccak256(data);
@@ -6040,7 +6077,7 @@ async function decryptKeystoreWallet(jsonWallet, password) {
6040
6077
  );
6041
6078
  }
6042
6079
  const buffer = await decryptJsonWalletData(ciphertextBuffer, key, ivBuffer);
6043
- const privateKey = hexlify14(buffer);
6080
+ const privateKey = hexlify15(buffer);
6044
6081
  return privateKey;
6045
6082
  }
6046
6083
 
@@ -6085,7 +6122,7 @@ var BaseWalletUnlocked = class extends Account {
6085
6122
  */
6086
6123
  async signMessage(message) {
6087
6124
  const signedMessage = await this.signer().sign(hashMessage(message));
6088
- return hexlify15(signedMessage);
6125
+ return hexlify16(signedMessage);
6089
6126
  }
6090
6127
  /**
6091
6128
  * Signs a transaction with the wallet's private key.
@@ -6098,7 +6135,7 @@ var BaseWalletUnlocked = class extends Account {
6098
6135
  const chainId = this.provider.getChainId();
6099
6136
  const hashedTransaction = transactionRequest.getTransactionId(chainId);
6100
6137
  const signature = await this.signer().sign(hashedTransaction);
6101
- return hexlify15(signature);
6138
+ return hexlify16(signature);
6102
6139
  }
6103
6140
  /**
6104
6141
  * Populates a transaction with the witnesses signature.
@@ -6131,7 +6168,7 @@ var BaseWalletUnlocked = class extends Account {
6131
6168
  );
6132
6169
  }
6133
6170
  /**
6134
- * Populates the witness signature for a transaction and sends a call to the network using `provider.call`.
6171
+ * Populates the witness signature for a transaction and sends a call to the network using `provider.dryRun`.
6135
6172
  *
6136
6173
  * @param transactionRequestLike - The transaction request to simulate.
6137
6174
  * @returns A promise that resolves to the CallResult object.
@@ -6141,7 +6178,7 @@ var BaseWalletUnlocked = class extends Account {
6141
6178
  if (estimateTxDependencies) {
6142
6179
  await this.provider.estimateTxDependencies(transactionRequest);
6143
6180
  }
6144
- return this.provider.call(
6181
+ return this.provider.dryRun(
6145
6182
  await this.populateTransactionWitnessesSignature(transactionRequest),
6146
6183
  {
6147
6184
  utxoValidation: true,
@@ -6169,13 +6206,13 @@ import { computeHmac as computeHmac2, ripemd160 } from "@fuel-ts/crypto";
6169
6206
  import { ErrorCode as ErrorCode19, FuelError as FuelError19 } from "@fuel-ts/errors";
6170
6207
  import { sha256 as sha2564 } from "@fuel-ts/hasher";
6171
6208
  import { bn as bn20, toBytes as toBytes2, toHex } from "@fuel-ts/math";
6172
- import { arrayify as arrayify18, hexlify as hexlify17, concat as concat5, dataSlice as dataSlice2, encodeBase58 as encodeBase582, decodeBase58 } from "@fuel-ts/utils";
6209
+ import { arrayify as arrayify18, hexlify as hexlify18, concat as concat5, dataSlice as dataSlice2, encodeBase58 as encodeBase582, decodeBase58 } from "@fuel-ts/utils";
6173
6210
 
6174
6211
  // src/mnemonic/mnemonic.ts
6175
- import { randomBytes as randomBytes4, pbkdf2, computeHmac } from "@fuel-ts/crypto";
6212
+ import { randomBytes as randomBytes5, pbkdf2, computeHmac } from "@fuel-ts/crypto";
6176
6213
  import { ErrorCode as ErrorCode18, FuelError as FuelError18 } from "@fuel-ts/errors";
6177
6214
  import { sha256 as sha2563 } from "@fuel-ts/hasher";
6178
- import { arrayify as arrayify17, hexlify as hexlify16, concat as concat4, dataSlice, encodeBase58, toUtf8Bytes } from "@fuel-ts/utils";
6215
+ import { arrayify as arrayify17, hexlify as hexlify17, concat as concat4, dataSlice, encodeBase58, toUtf8Bytes } from "@fuel-ts/utils";
6179
6216
 
6180
6217
  // src/wordlists/words/english.ts
6181
6218
  var english = [
@@ -8375,7 +8412,7 @@ var Mnemonic = class {
8375
8412
  static mnemonicToEntropy(phrase, wordlist = english) {
8376
8413
  const words = getWords(phrase);
8377
8414
  assertMnemonic(words);
8378
- return hexlify16(mnemonicWordsToEntropy(words, wordlist));
8415
+ return hexlify17(mnemonicWordsToEntropy(words, wordlist));
8379
8416
  }
8380
8417
  /**
8381
8418
  * @param entropy - Entropy source to the mnemonic phrase.
@@ -8500,7 +8537,7 @@ var Mnemonic = class {
8500
8537
  * @returns A randomly generated mnemonic
8501
8538
  */
8502
8539
  static generate(size = 32, extraEntropy = "") {
8503
- const entropy = extraEntropy ? sha2563(concat4([randomBytes4(size), arrayify17(extraEntropy)])) : randomBytes4(size);
8540
+ const entropy = extraEntropy ? sha2563(concat4([randomBytes5(size), arrayify17(extraEntropy)])) : randomBytes5(size);
8504
8541
  return Mnemonic.entropyToMnemonic(entropy);
8505
8542
  }
8506
8543
  };
@@ -8508,10 +8545,10 @@ var mnemonic_default = Mnemonic;
8508
8545
 
8509
8546
  // src/hdwallet/hdwallet.ts
8510
8547
  var HARDENED_INDEX = 2147483648;
8511
- var MainnetPRV2 = hexlify17("0x0488ade4");
8512
- var MainnetPUB = hexlify17("0x0488b21e");
8513
- var TestnetPRV2 = hexlify17("0x04358394");
8514
- var TestnetPUB = hexlify17("0x043587cf");
8548
+ var MainnetPRV2 = hexlify18("0x0488ade4");
8549
+ var MainnetPUB = hexlify18("0x0488b21e");
8550
+ var TestnetPRV2 = hexlify18("0x04358394");
8551
+ var TestnetPUB = hexlify18("0x043587cf");
8515
8552
  function base58check(data) {
8516
8553
  return encodeBase582(concat5([data, dataSlice2(sha2564(sha2564(data)), 0, 4)]));
8517
8554
  }
@@ -8522,11 +8559,11 @@ function getExtendedKeyPrefix(isPublic = false, testnet = false) {
8522
8559
  return testnet ? TestnetPRV2 : MainnetPRV2;
8523
8560
  }
8524
8561
  function isPublicExtendedKey(extendedKey) {
8525
- return [MainnetPUB, TestnetPUB].includes(hexlify17(extendedKey.slice(0, 4)));
8562
+ return [MainnetPUB, TestnetPUB].includes(hexlify18(extendedKey.slice(0, 4)));
8526
8563
  }
8527
8564
  function isValidExtendedKey(extendedKey) {
8528
8565
  return [MainnetPRV2, TestnetPRV2, MainnetPUB, TestnetPUB].includes(
8529
- hexlify17(extendedKey.slice(0, 4))
8566
+ hexlify18(extendedKey.slice(0, 4))
8530
8567
  );
8531
8568
  }
8532
8569
  function parsePath(path, depth = 0) {
@@ -8544,8 +8581,8 @@ function parsePath(path, depth = 0) {
8544
8581
  var HDWallet = class {
8545
8582
  depth = 0;
8546
8583
  index = 0;
8547
- fingerprint = hexlify17("0x00000000");
8548
- parentFingerprint = hexlify17("0x00000000");
8584
+ fingerprint = hexlify18("0x00000000");
8585
+ parentFingerprint = hexlify18("0x00000000");
8549
8586
  privateKey;
8550
8587
  publicKey;
8551
8588
  chainCode;
@@ -8557,8 +8594,8 @@ var HDWallet = class {
8557
8594
  constructor(config) {
8558
8595
  if (config.privateKey) {
8559
8596
  const signer = new Signer(config.privateKey);
8560
- this.publicKey = hexlify17(signer.compressedPublicKey);
8561
- this.privateKey = hexlify17(config.privateKey);
8597
+ this.publicKey = hexlify18(signer.compressedPublicKey);
8598
+ this.privateKey = hexlify18(config.privateKey);
8562
8599
  } else {
8563
8600
  if (!config.publicKey) {
8564
8601
  throw new FuelError19(
@@ -8566,7 +8603,7 @@ var HDWallet = class {
8566
8603
  "Both public and private Key cannot be missing. At least one should be provided."
8567
8604
  );
8568
8605
  }
8569
- this.publicKey = hexlify17(config.publicKey);
8606
+ this.publicKey = hexlify18(config.publicKey);
8570
8607
  }
8571
8608
  this.parentFingerprint = config.parentFingerprint || this.parentFingerprint;
8572
8609
  this.fingerprint = dataSlice2(ripemd160(sha2564(this.publicKey)), 0, 4);
@@ -8615,7 +8652,7 @@ var HDWallet = class {
8615
8652
  parentFingerprint: this.fingerprint
8616
8653
  });
8617
8654
  }
8618
- const signer = new Signer(hexlify17(IL));
8655
+ const signer = new Signer(hexlify18(IL));
8619
8656
  const Ki = signer.addPoint(publicKey);
8620
8657
  return new HDWallet({
8621
8658
  publicKey: Ki,
@@ -8650,7 +8687,7 @@ var HDWallet = class {
8650
8687
  );
8651
8688
  }
8652
8689
  const prefix = getExtendedKeyPrefix(this.privateKey == null || isPublic, testnet);
8653
- const depth = hexlify17(Uint8Array.from([this.depth]));
8690
+ const depth = hexlify18(Uint8Array.from([this.depth]));
8654
8691
  const parentFingerprint = this.parentFingerprint;
8655
8692
  const index = toHex(this.index, 4);
8656
8693
  const chainCode = this.chainCode;
@@ -8672,7 +8709,7 @@ var HDWallet = class {
8672
8709
  });
8673
8710
  }
8674
8711
  static fromExtendedKey(extendedKey) {
8675
- const decoded = hexlify17(toBytes2(decodeBase58(extendedKey)));
8712
+ const decoded = hexlify18(toBytes2(decodeBase58(extendedKey)));
8676
8713
  const bytes = arrayify18(decoded);
8677
8714
  const validChecksum = base58check(bytes.slice(0, 78)) === extendedKey;
8678
8715
  if (bytes.length !== 82 || !isValidExtendedKey(bytes)) {
@@ -8682,9 +8719,9 @@ var HDWallet = class {
8682
8719
  throw new FuelError19(ErrorCode19.HD_WALLET_ERROR, "Provided key has an invalid checksum.");
8683
8720
  }
8684
8721
  const depth = bytes[4];
8685
- const parentFingerprint = hexlify17(bytes.slice(5, 9));
8686
- const index = parseInt(hexlify17(bytes.slice(9, 13)).substring(2), 16);
8687
- const chainCode = hexlify17(bytes.slice(13, 45));
8722
+ const parentFingerprint = hexlify18(bytes.slice(5, 9));
8723
+ const index = parseInt(hexlify18(bytes.slice(9, 13)).substring(2), 16);
8724
+ const chainCode = hexlify18(bytes.slice(13, 45));
8688
8725
  const key = bytes.slice(45, 78);
8689
8726
  if (depth === 0 && parentFingerprint !== "0x00000000" || depth === 0 && index !== 0) {
8690
8727
  throw new FuelError19(
@@ -9288,17 +9325,17 @@ var StorageAbstract = class {
9288
9325
  import { Interface as Interface4 } from "@fuel-ts/abi-coder";
9289
9326
  import { Address as Address9 } from "@fuel-ts/address";
9290
9327
  import { ErrorCode as ErrorCode24, FuelError as FuelError24 } from "@fuel-ts/errors";
9291
- import { arrayify as arrayify20, hexlify as hexlify19 } from "@fuel-ts/utils";
9328
+ import { arrayify as arrayify20, hexlify as hexlify20 } from "@fuel-ts/utils";
9292
9329
 
9293
9330
  // src/predicate/utils/getPredicateRoot.ts
9294
9331
  import { hash as hash2 } from "@fuel-ts/hasher";
9295
9332
  import { calcRoot } from "@fuel-ts/merkle";
9296
- import { chunkAndPadBytes, hexlify as hexlify18, concat as concat6, arrayify as arrayify19 } from "@fuel-ts/utils";
9333
+ import { chunkAndPadBytes, hexlify as hexlify19, concat as concat6, arrayify as arrayify19 } from "@fuel-ts/utils";
9297
9334
  var getPredicateRoot = (bytecode) => {
9298
9335
  const chunkSize = 16 * 1024;
9299
9336
  const bytes = arrayify19(bytecode);
9300
9337
  const chunks = chunkAndPadBytes(bytes, chunkSize);
9301
- const codeRoot = calcRoot(chunks.map((c) => hexlify18(c)));
9338
+ const codeRoot = calcRoot(chunks.map((c) => hexlify19(c)));
9302
9339
  const predicateRoot = hash2(concat6(["0x4655454C", codeRoot]));
9303
9340
  return predicateRoot;
9304
9341
  };
@@ -9351,8 +9388,8 @@ var Predicate = class extends Account {
9351
9388
  }
9352
9389
  request.inputs.filter(isRequestInputResource).forEach((input) => {
9353
9390
  if (isRequestInputResourceFromOwner(input, this.address)) {
9354
- input.predicate = hexlify19(this.bytes);
9355
- input.predicateData = hexlify19(this.getPredicateData());
9391
+ input.predicate = hexlify20(this.bytes);
9392
+ input.predicateData = hexlify20(this.getPredicateData());
9356
9393
  input.witnessIndex = 0;
9357
9394
  }
9358
9395
  });
@@ -9432,8 +9469,21 @@ var Predicate = class extends Account {
9432
9469
  );
9433
9470
  return resources.map((resource) => ({
9434
9471
  ...resource,
9435
- predicate: hexlify19(this.bytes),
9436
- predicateData: hexlify19(this.getPredicateData())
9472
+ predicate: hexlify20(this.bytes),
9473
+ predicateData: hexlify20(this.getPredicateData())
9474
+ }));
9475
+ }
9476
+ /**
9477
+ * Generates an array of fake resources based on the provided coins.
9478
+ *
9479
+ * @param coins - An array of `FakeResources` objects representing the coins.
9480
+ * @returns An array of `Resource` objects with generated properties.
9481
+ */
9482
+ generateFakeResources(coins) {
9483
+ return super.generateFakeResources(coins).map((coin) => ({
9484
+ ...coin,
9485
+ predicate: hexlify20(this.bytes),
9486
+ predicateData: hexlify20(this.getPredicateData())
9437
9487
  }));
9438
9488
  }
9439
9489
  /**
@@ -10297,7 +10347,6 @@ export {
10297
10347
  resolveGasDependentCosts,
10298
10348
  resolveIconPaths,
10299
10349
  returnZeroScript,
10300
- sleep,
10301
10350
  transactionRequestify,
10302
10351
  urlJoin,
10303
10352
  withTimeout,