@fuel-ts/account 0.98.0 → 0.99.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.
Files changed (79) hide show
  1. package/dist/account.d.ts +4 -4
  2. package/dist/account.d.ts.map +1 -1
  3. package/dist/assets/asset-api.d.ts +69 -0
  4. package/dist/assets/asset-api.d.ts.map +1 -0
  5. package/dist/assets/assets.d.ts.map +1 -0
  6. package/dist/{providers/assets → assets}/index.d.ts +1 -0
  7. package/dist/assets/index.d.ts.map +1 -0
  8. package/dist/assets/types.d.ts.map +1 -0
  9. package/dist/assets/utils/fuelAssetsBaseUrl.d.ts +2 -0
  10. package/dist/assets/utils/fuelAssetsBaseUrl.d.ts.map +1 -0
  11. package/dist/assets/utils/index.d.ts.map +1 -0
  12. package/dist/{providers/assets → assets}/utils/network.d.ts +6 -6
  13. package/dist/assets/utils/network.d.ts.map +1 -0
  14. package/dist/assets/utils/resolveIconPaths.d.ts.map +1 -0
  15. package/dist/assets/utils/url.d.ts.map +1 -0
  16. package/dist/configs.d.ts +2 -2
  17. package/dist/configs.global.js.map +1 -1
  18. package/dist/configs.js.map +1 -1
  19. package/dist/configs.mjs.map +1 -1
  20. package/dist/connectors/fuel-connector.d.ts +1 -1
  21. package/dist/connectors/fuel-connector.d.ts.map +1 -1
  22. package/dist/connectors/types/events.d.ts +1 -1
  23. package/dist/connectors/types/events.d.ts.map +1 -1
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.global.js +14564 -14439
  27. package/dist/index.global.js.map +1 -1
  28. package/dist/index.js +6423 -6303
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +6461 -6347
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/providers/__generated__/operations.d.ts +28 -6
  33. package/dist/providers/__generated__/operations.d.ts.map +1 -1
  34. package/dist/providers/fuel-graphql-subscriber.d.ts +1 -0
  35. package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -1
  36. package/dist/providers/index.d.ts +0 -1
  37. package/dist/providers/index.d.ts.map +1 -1
  38. package/dist/providers/provider.d.ts +43 -13
  39. package/dist/providers/provider.d.ts.map +1 -1
  40. package/dist/providers/transaction-request/transaction-request.d.ts +2 -2
  41. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
  42. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
  43. package/dist/providers/utils/handle-gql-error-message.d.ts +5 -1
  44. package/dist/providers/utils/handle-gql-error-message.d.ts.map +1 -1
  45. package/dist/test-utils/wallet-config.d.ts +2 -1
  46. package/dist/test-utils/wallet-config.d.ts.map +1 -1
  47. package/dist/test-utils.global.js +205 -740
  48. package/dist/test-utils.global.js.map +1 -1
  49. package/dist/test-utils.js +270 -822
  50. package/dist/test-utils.js.map +1 -1
  51. package/dist/test-utils.mjs +195 -747
  52. package/dist/test-utils.mjs.map +1 -1
  53. package/dist/utils/deployScriptOrPredicate.d.ts.map +1 -1
  54. package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -1
  55. package/dist/utils/predicate-script-loader-instructions.d.ts +36 -1
  56. package/dist/utils/predicate-script-loader-instructions.d.ts.map +1 -1
  57. package/dist/wallet/keystore-wallet.d.ts +2 -2
  58. package/dist/wallet/keystore-wallet.d.ts.map +1 -1
  59. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +3 -2
  60. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -1
  61. package/dist/wallet-manager/vaults/privatekey-vault.d.ts +2 -1
  62. package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -1
  63. package/dist/wallet-manager/wallet-manager.d.ts +3 -3
  64. package/dist/wallet-manager/wallet-manager.d.ts.map +1 -1
  65. package/package.json +15 -16
  66. package/dist/providers/assets/assets.d.ts.map +0 -1
  67. package/dist/providers/assets/index.d.ts.map +0 -1
  68. package/dist/providers/assets/types.d.ts.map +0 -1
  69. package/dist/providers/assets/utils/fuelAssetsBaseUrl.d.ts +0 -2
  70. package/dist/providers/assets/utils/fuelAssetsBaseUrl.d.ts.map +0 -1
  71. package/dist/providers/assets/utils/index.d.ts.map +0 -1
  72. package/dist/providers/assets/utils/network.d.ts.map +0 -1
  73. package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +0 -1
  74. package/dist/providers/assets/utils/url.d.ts.map +0 -1
  75. /package/dist/{providers/assets → assets}/assets.d.ts +0 -0
  76. /package/dist/{providers/assets → assets}/types.d.ts +0 -0
  77. /package/dist/{providers/assets → assets}/utils/index.d.ts +0 -0
  78. /package/dist/{providers/assets → assets}/utils/resolveIconPaths.d.ts +0 -0
  79. /package/dist/{providers/assets → assets}/utils/url.d.ts +0 -0
@@ -16400,9 +16400,9 @@
16400
16400
  // ../versions/dist/index.mjs
16401
16401
  function getBuiltinVersions() {
16402
16402
  return {
16403
- FORC: "0.66.5",
16404
- FUEL_CORE: "0.40.2",
16405
- FUELS: "0.98.0"
16403
+ FORC: "0.66.6",
16404
+ FUEL_CORE: "0.40.4",
16405
+ FUELS: "0.99.0"
16406
16406
  };
16407
16407
  }
16408
16408
  function parseVersion(version) {
@@ -16536,6 +16536,7 @@ This unreleased fuel-core build may include features and updates not yet support
16536
16536
  ErrorCode2["INVALID_PASSWORD"] = "invalid-password";
16537
16537
  ErrorCode2["ACCOUNT_REQUIRED"] = "account-required";
16538
16538
  ErrorCode2["UNLOCKED_WALLET_REQUIRED"] = "unlocked-wallet-required";
16539
+ ErrorCode2["NUMBER_TOO_BIG"] = "number-too-big";
16539
16540
  ErrorCode2["ERROR_BUILDING_BLOCK_EXPLORER_URL"] = "error-building-block-explorer-url";
16540
16541
  ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error";
16541
16542
  ErrorCode2["SCRIPT_REVERTED"] = "script-reverted";
@@ -16599,6 +16600,12 @@ This unreleased fuel-core build may include features and updates not yet support
16599
16600
  bnValue = value.substring(2);
16600
16601
  bnBase = base2 || "hex";
16601
16602
  }
16603
+ if (typeof bnValue === "number" && bnValue > Number.MAX_SAFE_INTEGER) {
16604
+ throw new FuelError(
16605
+ ErrorCode.NUMBER_TOO_BIG,
16606
+ `Value ${bnValue} is too large to be represented as a number, use string instead.`
16607
+ );
16608
+ }
16602
16609
  super(bnValue == null ? 0 : bnValue, bnBase, endian);
16603
16610
  }
16604
16611
  // ANCHOR: HELPERS
@@ -19548,10 +19555,10 @@ If you are attempting to transform a hex value, please make sure it is being pas
19548
19555
  const result = this.jsonFnOld.inputs.reduce(
19549
19556
  (obj, input) => {
19550
19557
  const coder = AbiCoder.getCoder(this.jsonAbiOld, input, { encoding: this.encoding });
19551
- const [decodedValue, decodedValueByteSize] = coder.decode(bytes2, obj.offset);
19558
+ const [decodedValue, decodedOffset] = coder.decode(bytes2, obj.offset);
19552
19559
  return {
19553
19560
  decoded: [...obj.decoded, decodedValue],
19554
- offset: obj.offset + decodedValueByteSize
19561
+ offset: decodedOffset
19555
19562
  };
19556
19563
  },
19557
19564
  { decoded: [], offset: 0 }
@@ -19810,21 +19817,41 @@ If you are attempting to transform a hex value, please make sure it is being pas
19810
19817
  }
19811
19818
  return address.replace("0x", "0x000000000000000000000000");
19812
19819
  };
19820
+ var fromEvmAddressToB256 = (address) => padFirst12BytesOfEvmAddress(address);
19821
+ var fromPublicKeyToB256 = (publicKey) => {
19822
+ if (!isPublicKey(publicKey)) {
19823
+ throw new FuelError(FuelError.CODES.INVALID_PUBLIC_KEY, `Invalid Public Key: ${publicKey}.`);
19824
+ }
19825
+ return hexlify(sha256(arrayify(publicKey)));
19826
+ };
19827
+ var fromDynamicInputToB256 = (address) => {
19828
+ if (typeof address !== "string" && "toB256" in address) {
19829
+ return address.toB256();
19830
+ }
19831
+ if (isB256(address)) {
19832
+ return address;
19833
+ }
19834
+ if (isPublicKey(address)) {
19835
+ return fromPublicKeyToB256(address);
19836
+ }
19837
+ if (isEvmAddress(address)) {
19838
+ return fromEvmAddressToB256(address);
19839
+ }
19840
+ throw new FuelError(
19841
+ FuelError.CODES.PARSE_FAILED,
19842
+ `Unknown address format: only 'B256', 'Public Key (512)', or 'EVM Address' are supported.`
19843
+ );
19844
+ };
19813
19845
  var Address = class {
19814
19846
  // #region address-2
19815
19847
  b256Address;
19816
19848
  // #endregion address-2
19817
19849
  /**
19818
- * @param address - A B256 address
19850
+ * @param address - A B256 address, public key, EVM address, or Address instance
19819
19851
  */
19820
19852
  constructor(address) {
19821
- if (!isB256(address)) {
19822
- throw new FuelError(
19823
- FuelError.CODES.INVALID_B256_ADDRESS,
19824
- `Invalid B256 Address: ${address}.`
19825
- );
19826
- }
19827
- this.b256Address = normalizeB256(address);
19853
+ const b256Address = fromDynamicInputToB256(address);
19854
+ this.b256Address = normalizeB256(b256Address);
19828
19855
  }
19829
19856
  /**
19830
19857
  * Takes an B256 Address and returns back an checksum address.
@@ -19919,12 +19946,11 @@ If you are attempting to transform a hex value, please make sure it is being pas
19919
19946
  *
19920
19947
  * @param publicKey - A wallets public key
19921
19948
  * @returns A new `Address` instance
19949
+ *
19950
+ * @deprecated Use `new Address` instead
19922
19951
  */
19923
19952
  static fromPublicKey(publicKey) {
19924
- if (!isPublicKey(publicKey)) {
19925
- throw new FuelError(FuelError.CODES.INVALID_PUBLIC_KEY, `Invalid Public Key: ${publicKey}.`);
19926
- }
19927
- const b256Address = hexlify(sha256(arrayify(publicKey)));
19953
+ const b256Address = fromPublicKeyToB256(publicKey);
19928
19954
  return new Address(b256Address);
19929
19955
  }
19930
19956
  /**
@@ -19932,6 +19958,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
19932
19958
  *
19933
19959
  * @param b256Address - A b256 hash
19934
19960
  * @returns A new `Address` instance
19961
+ *
19962
+ * @deprecated Use `new Address` instead
19935
19963
  */
19936
19964
  static fromB256(b256Address) {
19937
19965
  if (!isB256(b256Address)) {
@@ -19948,24 +19976,28 @@ If you are attempting to transform a hex value, please make sure it is being pas
19948
19976
  * @returns A new `Address` instance
19949
19977
  */
19950
19978
  static fromRandom() {
19951
- return this.fromB256(getRandomB256());
19979
+ return new Address(getRandomB256());
19952
19980
  }
19953
19981
  /**
19954
19982
  * Takes an ambiguous string and attempts to create an `Address`
19955
19983
  *
19956
19984
  * @param address - An ambiguous string
19957
19985
  * @returns A new `Address` instance
19986
+ *
19987
+ * @deprecated Use `new Address` instead
19958
19988
  */
19959
19989
  static fromString(address) {
19960
- return this.fromB256(address);
19990
+ return new Address(address);
19961
19991
  }
19962
19992
  /**
19963
19993
  * Takes an ambiguous string or address and creates an `Address`
19964
19994
  *
19965
19995
  * @returns a new `Address` instance
19996
+ *
19997
+ * @deprecated Use `new Address` instead
19966
19998
  */
19967
19999
  static fromAddressOrString(address) {
19968
- return typeof address === "string" ? this.fromString(address) : address;
20000
+ return new Address(address);
19969
20001
  }
19970
20002
  /**
19971
20003
  * Takes a dynamic string or `Address` and creates an `Address`
@@ -19973,29 +20005,18 @@ If you are attempting to transform a hex value, please make sure it is being pas
19973
20005
  * @param addressId - A string containing B256, or Public Key
19974
20006
  * @throws Error - Unknown address if the format is not recognised
19975
20007
  * @returns A new `Address` instance
20008
+ *
20009
+ * @deprecated Use `new Address` instead
19976
20010
  */
19977
20011
  static fromDynamicInput(address) {
19978
- if (typeof address !== "string" && "toB256" in address) {
19979
- return Address.fromB256(address.toB256());
19980
- }
19981
- if (isPublicKey(address)) {
19982
- return Address.fromPublicKey(address);
19983
- }
19984
- if (isB256(address)) {
19985
- return Address.fromB256(address);
19986
- }
19987
- if (isEvmAddress(address)) {
19988
- return Address.fromEvmAddress(address);
19989
- }
19990
- throw new FuelError(
19991
- FuelError.CODES.PARSE_FAILED,
19992
- `Unknown address format: only 'B256', or 'Public Key (512)' are supported.`
19993
- );
20012
+ return new Address(address);
19994
20013
  }
19995
20014
  /**
19996
20015
  * Takes an Evm Address and returns back an `Address`
19997
20016
  *
19998
20017
  * @returns A new `Address` instance
20018
+ *
20019
+ * @deprecated Use `new Address` instead
19999
20020
  */
20000
20021
  static fromEvmAddress(evmAddress) {
20001
20022
  if (!isEvmAddress(evmAddress)) {
@@ -20004,8 +20025,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
20004
20025
  `Invalid Evm Address: ${evmAddress}.`
20005
20026
  );
20006
20027
  }
20007
- const paddedAddress = padFirst12BytesOfEvmAddress(evmAddress);
20008
- return new Address(paddedAddress);
20028
+ return new Address(evmAddress);
20009
20029
  }
20010
20030
  /**
20011
20031
  * Takes an ChecksumAddress and validates if it is a valid checksum address.
@@ -21717,7 +21737,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
21717
21737
  this.privateKey = hexlify(privateKeyBytes);
21718
21738
  this.publicKey = hexlify(secp256k1.getPublicKey(privateKeyBytes, false).slice(1));
21719
21739
  this.compressedPublicKey = hexlify(secp256k1.getPublicKey(privateKeyBytes, true));
21720
- this.address = Address.fromPublicKey(this.publicKey);
21740
+ this.address = new Address(this.publicKey);
21721
21741
  }
21722
21742
  /**
21723
21743
  * Sign data using the Signer instance
@@ -21775,7 +21795,7 @@ If you are attempting to transform a hex value, please make sure it is being pas
21775
21795
  * @returns Address from signature
21776
21796
  */
21777
21797
  static recoverAddress(data, signature) {
21778
- return Address.fromPublicKey(Signer.recoverPublicKey(data, signature));
21798
+ return new Address(Signer.recoverPublicKey(data, signature));
21779
21799
  }
21780
21800
  /**
21781
21801
  * Generate a random privateKey
@@ -27984,9 +28004,6 @@ ${MessageCoinFragmentDoc}`;
27984
28004
  first: $first
27985
28005
  last: $last
27986
28006
  ) {
27987
- pageInfo {
27988
- ...pageInfoFragment
27989
- }
27990
28007
  edges {
27991
28008
  node {
27992
28009
  assetId
@@ -27995,7 +28012,7 @@ ${MessageCoinFragmentDoc}`;
27995
28012
  }
27996
28013
  }
27997
28014
  }
27998
- ${PageInfoFragmentDoc}`;
28015
+ `;
27999
28016
  var GetMessagesDocument = lib_default2`
28000
28017
  query getMessages($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
28001
28018
  messages(
@@ -28017,6 +28034,13 @@ ${MessageCoinFragmentDoc}`;
28017
28034
  }
28018
28035
  ${PageInfoFragmentDoc}
28019
28036
  ${GetMessageFragmentDoc}`;
28037
+ var DaCompressedBlockDocument = lib_default2`
28038
+ query daCompressedBlock($height: U32!) {
28039
+ daCompressedBlock(height: $height) {
28040
+ bytes
28041
+ }
28042
+ }
28043
+ `;
28020
28044
  var GetMessageProofDocument = lib_default2`
28021
28045
  query getMessageProof($transactionId: TransactionId!, $nonce: Nonce!, $commitBlockId: BlockId, $commitBlockHeight: U32) {
28022
28046
  messageProof(
@@ -28188,6 +28212,9 @@ ${GetMessageFragmentDoc}`;
28188
28212
  getMessages(variables, options) {
28189
28213
  return requester(GetMessagesDocument, variables, options);
28190
28214
  },
28215
+ daCompressedBlock(variables, options) {
28216
+ return requester(DaCompressedBlockDocument, variables, options);
28217
+ },
28191
28218
  getMessageProof(variables, options) {
28192
28219
  return requester(GetMessageProofDocument, variables, options);
28193
28220
  },
@@ -28224,6 +28251,55 @@ ${GetMessageFragmentDoc}`;
28224
28251
  };
28225
28252
  }
28226
28253
 
28254
+ // src/providers/utils/handle-gql-error-message.ts
28255
+ var mapGqlErrorMessage = (error2) => {
28256
+ switch (error2.message) {
28257
+ case "not enough coins to fit the target" /* NOT_ENOUGH_COINS */:
28258
+ return new FuelError(
28259
+ ErrorCode.NOT_ENOUGH_FUNDS,
28260
+ `The account(s) sending the transaction don't have enough funds to cover the transaction.`,
28261
+ {},
28262
+ error2
28263
+ );
28264
+ case "max number of coins is reached while trying to fit the target" /* MAX_COINS_REACHED */:
28265
+ return new FuelError(
28266
+ ErrorCode.MAX_COINS_REACHED,
28267
+ "The account retrieving coins has exceeded the maximum number of coins per asset. Please consider combining your coins into a single UTXO.",
28268
+ {},
28269
+ error2
28270
+ );
28271
+ default:
28272
+ return new FuelError(ErrorCode.INVALID_REQUEST, error2.message, {}, error2);
28273
+ }
28274
+ };
28275
+ var mapGqlErrorWithIncompatibleNodeVersion = (error2, incompatibleNodeVersionMessage) => {
28276
+ if (!incompatibleNodeVersionMessage) {
28277
+ return error2;
28278
+ }
28279
+ return new FuelError(
28280
+ error2.code,
28281
+ `${error2.message}
28282
+
28283
+ ${incompatibleNodeVersionMessage}`,
28284
+ error2.metadata,
28285
+ error2.rawError
28286
+ );
28287
+ };
28288
+ var assertGqlResponseHasNoErrors = (errors2, incompatibleNodeVersionMessage = false) => {
28289
+ if (!Array.isArray(errors2)) {
28290
+ return;
28291
+ }
28292
+ const mappedErrors = errors2.map(mapGqlErrorMessage);
28293
+ if (mappedErrors.length === 1) {
28294
+ throw mapGqlErrorWithIncompatibleNodeVersion(mappedErrors[0], incompatibleNodeVersionMessage);
28295
+ }
28296
+ const errorMessage = mappedErrors.map((err) => err.message).join("\n");
28297
+ throw mapGqlErrorWithIncompatibleNodeVersion(
28298
+ new FuelError(ErrorCode.INVALID_REQUEST, errorMessage, {}, mappedErrors),
28299
+ incompatibleNodeVersionMessage
28300
+ );
28301
+ };
28302
+
28227
28303
  // src/providers/fuel-graphql-subscriber.ts
28228
28304
  var _FuelGraphqlSubscriber = class {
28229
28305
  constructor(stream) {
@@ -28252,12 +28328,7 @@ ${GetMessageFragmentDoc}`;
28252
28328
  while (true) {
28253
28329
  if (this.events.length > 0) {
28254
28330
  const { data, errors: errors2 } = this.events.shift();
28255
- if (Array.isArray(errors2)) {
28256
- throw new FuelError(
28257
- FuelError.CODES.INVALID_REQUEST,
28258
- errors2.map((err) => err.message).join("\n\n")
28259
- );
28260
- }
28331
+ assertGqlResponseHasNoErrors(errors2, _FuelGraphqlSubscriber.incompatibleNodeVersionMessage);
28261
28332
  return { value: data, done: false };
28262
28333
  }
28263
28334
  const { value, done } = await this.stream.read();
@@ -28295,6 +28366,7 @@ ${GetMessageFragmentDoc}`;
28295
28366
  }
28296
28367
  };
28297
28368
  var FuelGraphqlSubscriber = _FuelGraphqlSubscriber;
28369
+ __publicField(FuelGraphqlSubscriber, "incompatibleNodeVersionMessage", false);
28298
28370
  __publicField(FuelGraphqlSubscriber, "textDecoder", new TextDecoder());
28299
28371
 
28300
28372
  // src/providers/resource-cache.ts
@@ -29234,7 +29306,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
29234
29306
  * @param signature - The signature to update the witness with.
29235
29307
  */
29236
29308
  updateWitnessByOwner(address, signature) {
29237
- const ownerAddress = Address.fromAddressOrString(address);
29309
+ const ownerAddress = new Address(address);
29238
29310
  const witnessIndex = this.getCoinInputWitnessIndexByOwner(ownerAddress);
29239
29311
  if (typeof witnessIndex === "number") {
29240
29312
  this.updateWitness(witnessIndex, signature);
@@ -29585,7 +29657,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
29585
29657
  this.inputs.filter(isRequestInputResource).forEach((i) => {
29586
29658
  const owner = getRequestInputResourceOwner(i);
29587
29659
  const correspondingInput = inputsToExtractGasUsed.find(
29588
- (x) => isRequestInputResourceFromOwner(x, Address.fromString(String(owner)))
29660
+ (x) => isRequestInputResourceFromOwner(x, new Address(String(owner)))
29589
29661
  );
29590
29662
  if (correspondingInput && "predicateGasUsed" in correspondingInput && bn(correspondingInput.predicateGasUsed).gt(0)) {
29591
29663
  i.predicateGasUsed = correspondingInput.predicateGasUsed;
@@ -31124,6 +31196,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
31124
31196
  this.provider = provider;
31125
31197
  this.abis = abis;
31126
31198
  this.request = typeof tx === "string" ? void 0 : tx;
31199
+ this.waitForResult = this.waitForResult.bind(this);
31127
31200
  }
31128
31201
  /** Transaction ID */
31129
31202
  id;
@@ -31385,28 +31458,6 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
31385
31458
  };
31386
31459
  }
31387
31460
 
31388
- // src/providers/utils/handle-gql-error-message.ts
31389
- var handleGqlErrorMessage = (errorMessage, rawError) => {
31390
- switch (errorMessage) {
31391
- case "not enough coins to fit the target" /* NOT_ENOUGH_COINS */:
31392
- throw new FuelError(
31393
- ErrorCode.NOT_ENOUGH_FUNDS,
31394
- `The account(s) sending the transaction don't have enough funds to cover the transaction.`,
31395
- {},
31396
- rawError
31397
- );
31398
- case "max number of coins is reached while trying to fit the target" /* MAX_COINS_REACHED */:
31399
- throw new FuelError(
31400
- ErrorCode.MAX_COINS_REACHED,
31401
- "The account retrieving coins has exceeded the maximum number of coins per asset. Please consider combining your coins into a single UTXO.",
31402
- {},
31403
- rawError
31404
- );
31405
- default:
31406
- throw new FuelError(ErrorCode.INVALID_REQUEST, errorMessage);
31407
- }
31408
- };
31409
-
31410
31461
  // src/providers/utils/validate-pagination-args.ts
31411
31462
  var validatePaginationArgs = (params) => {
31412
31463
  const { paginationLimit, inputArgs = {} } = params;
@@ -31681,7 +31732,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
31681
31732
  utxoValidation: data.nodeInfo.utxoValidation,
31682
31733
  vmBacktrace: data.nodeInfo.vmBacktrace
31683
31734
  };
31684
- _Provider.ensureClientVersionIsSupported(nodeInfo);
31735
+ _Provider.setIncompatibleNodeVersionMessage(nodeInfo);
31685
31736
  chain = processGqlChain(data.chain);
31686
31737
  _Provider.chainInfoCache[this.urlWithoutAuth] = chain;
31687
31738
  _Provider.nodeInfoCache[this.urlWithoutAuth] = nodeInfo;
@@ -31695,15 +31746,15 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
31695
31746
  /**
31696
31747
  * @hidden
31697
31748
  */
31698
- static ensureClientVersionIsSupported(nodeInfo) {
31749
+ static setIncompatibleNodeVersionMessage(nodeInfo) {
31699
31750
  const { isMajorSupported, isMinorSupported, supportedVersion } = checkFuelCoreVersionCompatibility(nodeInfo.nodeVersion);
31700
31751
  if (!isMajorSupported || !isMinorSupported) {
31701
- console.warn(
31702
- `The Fuel Node that you are trying to connect to is using fuel-core version ${nodeInfo.nodeVersion},
31703
- which is not supported by the version of the TS SDK that you are using.
31704
- Things may not work as expected.
31705
- Supported fuel-core version: ${supportedVersion}.`
31706
- );
31752
+ _Provider.incompatibleNodeVersionMessage = [
31753
+ `The Fuel Node that you are trying to connect to is using fuel-core version ${nodeInfo.nodeVersion}.`,
31754
+ `The TS SDK currently supports fuel-core version ${supportedVersion}.`,
31755
+ `Things may not work as expected.`
31756
+ ].join("\n");
31757
+ FuelGraphqlSubscriber.incompatibleNodeVersionMessage = _Provider.incompatibleNodeVersionMessage;
31707
31758
  }
31708
31759
  }
31709
31760
  /**
@@ -31719,11 +31770,10 @@ Supported fuel-core version: ${supportedVersion}.`
31719
31770
  responseMiddleware: (response) => {
31720
31771
  if ("response" in response) {
31721
31772
  const graphQlResponse = response.response;
31722
- if (Array.isArray(graphQlResponse?.errors)) {
31723
- for (const error2 of graphQlResponse.errors) {
31724
- handleGqlErrorMessage(error2.message, error2);
31725
- }
31726
- }
31773
+ assertGqlResponseHasNoErrors(
31774
+ graphQlResponse.errors,
31775
+ _Provider.incompatibleNodeVersionMessage
31776
+ );
31727
31777
  }
31728
31778
  }
31729
31779
  });
@@ -31953,9 +32003,10 @@ Supported fuel-core version: ${supportedVersion}.`
31953
32003
  * `addVariableOutputs` is called on the transaction.
31954
32004
  *
31955
32005
  * @param transactionRequest - The transaction request object.
32006
+ * @param gasPrice - The gas price to use for the transaction, if not provided it will be fetched.
31956
32007
  * @returns A promise that resolves to the estimate transaction dependencies.
31957
32008
  */
31958
- async estimateTxDependencies(transactionRequest) {
32009
+ async estimateTxDependencies(transactionRequest, { gasPrice: gasPriceParam } = {}) {
31959
32010
  if (isTransactionTypeCreate(transactionRequest)) {
31960
32011
  return {
31961
32012
  receipts: [],
@@ -31968,13 +32019,14 @@ Supported fuel-core version: ${supportedVersion}.`
31968
32019
  let outputVariables = 0;
31969
32020
  let dryRunStatus;
31970
32021
  await this.validateTransaction(transactionRequest);
32022
+ const gasPrice = gasPriceParam ?? await this.estimateGasPrice(10);
31971
32023
  for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
31972
32024
  const {
31973
32025
  dryRun: [{ receipts: rawReceipts, status }]
31974
32026
  } = await this.operations.dryRun({
31975
32027
  encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
31976
32028
  utxoValidation: false,
31977
- gasPrice: "0"
32029
+ gasPrice: gasPrice.toString()
31978
32030
  });
31979
32031
  receipts = rawReceipts.map(processGqlReceipt);
31980
32032
  dryRunStatus = status;
@@ -31984,12 +32036,12 @@ Supported fuel-core version: ${supportedVersion}.`
31984
32036
  outputVariables += missingOutputVariables.length;
31985
32037
  transactionRequest.addVariableOutputs(missingOutputVariables.length);
31986
32038
  missingOutputContractIds.forEach(({ contractId }) => {
31987
- transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
32039
+ transactionRequest.addContractInputAndOutput(new Address(contractId));
31988
32040
  missingContractIds.push(contractId);
31989
32041
  });
31990
32042
  const { maxFee } = await this.estimateTxGasAndFee({
31991
32043
  transactionRequest,
31992
- gasPrice: bn(0)
32044
+ gasPrice
31993
32045
  });
31994
32046
  transactionRequest.maxFee = maxFee;
31995
32047
  } else {
@@ -32053,7 +32105,7 @@ Supported fuel-core version: ${supportedVersion}.`
32053
32105
  result.outputVariables += missingOutputVariables.length;
32054
32106
  request.addVariableOutputs(missingOutputVariables.length);
32055
32107
  missingOutputContractIds.forEach(({ contractId }) => {
32056
- request.addContractInputAndOutput(Address.fromString(contractId));
32108
+ request.addContractInputAndOutput(new Address(contractId));
32057
32109
  result.missingContractIds.push(contractId);
32058
32110
  });
32059
32111
  const { maxFee } = await this.estimateTxGasAndFee({
@@ -32119,12 +32171,12 @@ Supported fuel-core version: ${supportedVersion}.`
32119
32171
  }
32120
32172
  /**
32121
32173
  * Estimates the transaction gas and fee based on the provided transaction request.
32122
- * @param transactionRequest - The transaction request object.
32174
+ * @param params - The parameters for estimating the transaction gas and fee.
32123
32175
  * @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
32124
32176
  */
32125
32177
  async estimateTxGasAndFee(params) {
32126
- const { transactionRequest } = params;
32127
- let { gasPrice } = params;
32178
+ const { transactionRequest, gasPrice: gasPriceParam } = params;
32179
+ let gasPrice = gasPriceParam;
32128
32180
  await this.autoRefetchConfigs();
32129
32181
  const chainInfo = await this.getChain();
32130
32182
  const { gasPriceFactor, maxGasPerTx } = await this.getGasConfig();
@@ -32205,7 +32257,7 @@ Supported fuel-core version: ${supportedVersion}.`
32205
32257
  *
32206
32258
  * @returns A promise that resolves to the transaction cost object.
32207
32259
  */
32208
- async getTransactionCost(transactionRequestLike, { signatureCallback } = {}) {
32260
+ async getTransactionCost(transactionRequestLike, { signatureCallback, gasPrice: gasPriceParam } = {}) {
32209
32261
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
32210
32262
  const updateMaxFee = txRequestClone.maxFee.eq(0);
32211
32263
  const isScriptTransaction = isTransactionTypeScript(txRequestClone);
@@ -32221,8 +32273,11 @@ Supported fuel-core version: ${supportedVersion}.`
32221
32273
  }
32222
32274
  await this.estimatePredicates(signedRequest);
32223
32275
  txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
32224
- let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
32225
- transactionRequest: signedRequest
32276
+ const gasPrice = gasPriceParam ?? await this.estimateGasPrice(10);
32277
+ let { maxFee, maxGas, minFee, minGas, gasLimit } = await this.estimateTxGasAndFee({
32278
+ // Fetches and returns a gas price
32279
+ transactionRequest: signedRequest,
32280
+ gasPrice
32226
32281
  });
32227
32282
  let receipts = [];
32228
32283
  let dryRunStatus;
@@ -32235,7 +32290,7 @@ Supported fuel-core version: ${supportedVersion}.`
32235
32290
  if (signatureCallback) {
32236
32291
  await signatureCallback(txRequestClone);
32237
32292
  }
32238
- ({ receipts, missingContractIds, outputVariables, dryRunStatus } = await this.estimateTxDependencies(txRequestClone));
32293
+ ({ receipts, missingContractIds, outputVariables, dryRunStatus } = await this.estimateTxDependencies(txRequestClone, { gasPrice }));
32239
32294
  if (dryRunStatus && "reason" in dryRunStatus) {
32240
32295
  throw this.extractDryRunError(txRequestClone, receipts, dryRunStatus);
32241
32296
  }
@@ -32243,7 +32298,7 @@ Supported fuel-core version: ${supportedVersion}.`
32243
32298
  const pristineGasUsed = getGasUsedFromReceipts(receipts);
32244
32299
  gasUsed = bn(pristineGasUsed.muln(GAS_USED_MODIFIER)).max(maxGasPerTx.sub(minGas));
32245
32300
  txRequestClone.gasLimit = gasUsed;
32246
- ({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
32301
+ ({ maxFee, maxGas, minFee, minGas } = await this.estimateTxGasAndFee({
32247
32302
  transactionRequest: txRequestClone,
32248
32303
  gasPrice
32249
32304
  }));
@@ -32274,7 +32329,7 @@ Supported fuel-core version: ${supportedVersion}.`
32274
32329
  * @returns A promise that resolves to the coins.
32275
32330
  */
32276
32331
  async getCoins(owner, assetId, paginationArgs) {
32277
- const ownerAddress = Address.fromAddressOrString(owner);
32332
+ const ownerAddress = new Address(owner);
32278
32333
  const {
32279
32334
  coins: { edges, pageInfo }
32280
32335
  } = await this.operations.getCoins({
@@ -32306,7 +32361,7 @@ Supported fuel-core version: ${supportedVersion}.`
32306
32361
  * @returns A promise that resolves to the resources.
32307
32362
  */
32308
32363
  async getResourcesToSpend(owner, quantities, excludedIds) {
32309
- const ownerAddress = Address.fromAddressOrString(owner);
32364
+ const ownerAddress = new Address(owner);
32310
32365
  const excludeInput = {
32311
32366
  messages: excludedIds?.messages?.map((nonce) => hexlify(nonce)) || [],
32312
32367
  utxos: excludedIds?.utxos?.map((id) => hexlify(id)) || []
@@ -32333,8 +32388,8 @@ Supported fuel-core version: ${supportedVersion}.`
32333
32388
  amount: bn(coin.amount),
32334
32389
  assetId: coin.assetId,
32335
32390
  daHeight: bn(coin.daHeight),
32336
- sender: Address.fromAddressOrString(coin.sender),
32337
- recipient: Address.fromAddressOrString(coin.recipient),
32391
+ sender: new Address(coin.sender),
32392
+ recipient: new Address(coin.recipient),
32338
32393
  nonce: coin.nonce
32339
32394
  };
32340
32395
  case "Coin":
@@ -32531,6 +32586,21 @@ Supported fuel-core version: ${supportedVersion}.`
32531
32586
  }).filter((tx) => tx !== null);
32532
32587
  return { transactions, pageInfo };
32533
32588
  }
32589
+ /**
32590
+ * Fetches a compressed block at the specified height.
32591
+ *
32592
+ * @param height - The height of the block to fetch.
32593
+ * @returns The compressed block if available, otherwise `null`.
32594
+ */
32595
+ async daCompressedBlock(height) {
32596
+ const { daCompressedBlock } = await this.operations.daCompressedBlock({
32597
+ height
32598
+ });
32599
+ if (!daCompressedBlock) {
32600
+ return null;
32601
+ }
32602
+ return daCompressedBlock;
32603
+ }
32534
32604
  /**
32535
32605
  * Get deployed contract with the given ID.
32536
32606
  *
@@ -32553,7 +32623,7 @@ Supported fuel-core version: ${supportedVersion}.`
32553
32623
  */
32554
32624
  async getContractBalance(contractId, assetId) {
32555
32625
  const { contractBalance } = await this.operations.getContractBalance({
32556
- contract: Address.fromAddressOrString(contractId).toB256(),
32626
+ contract: new Address(contractId).toB256(),
32557
32627
  asset: hexlify(assetId)
32558
32628
  });
32559
32629
  return bn(contractBalance.amount, 10);
@@ -32567,7 +32637,7 @@ Supported fuel-core version: ${supportedVersion}.`
32567
32637
  */
32568
32638
  async getBalance(owner, assetId) {
32569
32639
  const { balance } = await this.operations.getBalance({
32570
- owner: Address.fromAddressOrString(owner).toB256(),
32640
+ owner: new Address(owner).toB256(),
32571
32641
  assetId: hexlify(assetId)
32572
32642
  });
32573
32643
  return bn(balance.amount, 10);
@@ -32588,7 +32658,7 @@ Supported fuel-core version: ${supportedVersion}.`
32588
32658
  * but the current Fuel-Core implementation does not support pagination yet.
32589
32659
  */
32590
32660
  first: 1e4,
32591
- filter: { owner: Address.fromAddressOrString(owner).toB256() }
32661
+ filter: { owner: new Address(owner).toB256() }
32592
32662
  });
32593
32663
  const balances = edges.map(({ node }) => ({
32594
32664
  assetId: node.assetId,
@@ -32611,7 +32681,7 @@ Supported fuel-core version: ${supportedVersion}.`
32611
32681
  inputArgs: paginationArgs,
32612
32682
  paginationLimit: RESOURCES_PAGE_SIZE_LIMIT
32613
32683
  }),
32614
- owner: Address.fromAddressOrString(address).toB256()
32684
+ owner: new Address(address).toB256()
32615
32685
  });
32616
32686
  const messages = edges.map(({ node }) => ({
32617
32687
  messageId: InputMessageCoder.getMessageId({
@@ -32621,8 +32691,8 @@ Supported fuel-core version: ${supportedVersion}.`
32621
32691
  amount: bn(node.amount),
32622
32692
  data: node.data
32623
32693
  }),
32624
- sender: Address.fromAddressOrString(node.sender),
32625
- recipient: Address.fromAddressOrString(node.recipient),
32694
+ sender: new Address(node.sender),
32695
+ recipient: new Address(node.recipient),
32626
32696
  nonce: node.nonce,
32627
32697
  amount: bn(node.amount),
32628
32698
  data: InputMessageCoder.decodeData(node.data),
@@ -32720,8 +32790,8 @@ Supported fuel-core version: ${supportedVersion}.`
32720
32790
  eventInboxRoot: commitBlockHeader.eventInboxRoot,
32721
32791
  stateTransitionBytecodeVersion: Number(commitBlockHeader.stateTransitionBytecodeVersion)
32722
32792
  },
32723
- sender: Address.fromAddressOrString(sender),
32724
- recipient: Address.fromAddressOrString(recipient),
32793
+ sender: new Address(sender),
32794
+ recipient: new Address(recipient),
32725
32795
  nonce,
32726
32796
  amount: bn(amount),
32727
32797
  data
@@ -32835,8 +32905,8 @@ Supported fuel-core version: ${supportedVersion}.`
32835
32905
  amount: bn(rawMessage.amount),
32836
32906
  data: rawMessage.data
32837
32907
  }),
32838
- sender: Address.fromAddressOrString(rawMessage.sender),
32839
- recipient: Address.fromAddressOrString(rawMessage.recipient),
32908
+ sender: new Address(rawMessage.sender),
32909
+ recipient: new Address(rawMessage.recipient),
32840
32910
  nonce,
32841
32911
  amount: bn(rawMessage.amount),
32842
32912
  data: InputMessageCoder.decodeData(rawMessage.data),
@@ -32902,610 +32972,8 @@ Supported fuel-core version: ${supportedVersion}.`
32902
32972
  __publicField(Provider, "chainInfoCache", {});
32903
32973
  /** @hidden */
32904
32974
  __publicField(Provider, "nodeInfoCache", {});
32905
-
32906
- // src/providers/chains.ts
32907
- var CHAIN_IDS = {
32908
- eth: {
32909
- mainnet: 1,
32910
- sepolia: 11155111,
32911
- foundry: 31337
32912
- },
32913
- fuel: {
32914
- devnet: 0,
32915
- testnet: 0,
32916
- mainnet: 9889
32917
- }
32918
- };
32919
-
32920
- // src/providers/assets/utils/url.ts
32921
- var DELIMITER_PATH = "/";
32922
- var trimRegex = /^\/|\/$/g;
32923
- var trimPath = (path2 = "") => path2.replace(trimRegex, "");
32924
- function urlJoin(baseUrl, ...paths) {
32925
- const hasBaseUrl = baseUrl !== null && baseUrl !== void 0;
32926
- const rootPath = baseUrl?.[0] === "/" && baseUrl.length > 1;
32927
- const allPaths = [baseUrl, ...paths].filter(Boolean).map(trimPath);
32928
- if (rootPath && hasBaseUrl) {
32929
- allPaths.unshift("");
32930
- }
32931
- return allPaths.join(DELIMITER_PATH);
32932
- }
32933
-
32934
- // src/providers/assets/utils/resolveIconPaths.ts
32935
- function resolveIconPaths(assets2, basePath = "./") {
32936
- return assets2.map((asset) => ({
32937
- ...asset,
32938
- icon: urlJoin(basePath, asset.icon)
32939
- }));
32940
- }
32941
-
32942
- // src/providers/assets/utils/fuelAssetsBaseUrl.ts
32943
- var fuelAssetsBaseUrl = "https://cdn.fuel.network/assets/";
32944
-
32945
- // src/providers/assets/assets.ts
32946
- var rawAssets = [
32947
- {
32948
- name: "Ethereum",
32949
- symbol: "ETH",
32950
- icon: "eth.svg",
32951
- networks: [
32952
- {
32953
- type: "ethereum",
32954
- chainId: CHAIN_IDS.eth.sepolia,
32955
- decimals: 18
32956
- },
32957
- {
32958
- type: "ethereum",
32959
- chainId: CHAIN_IDS.eth.foundry,
32960
- decimals: 18
32961
- },
32962
- {
32963
- type: "ethereum",
32964
- chainId: CHAIN_IDS.eth.mainnet,
32965
- decimals: 18
32966
- },
32967
- {
32968
- type: "fuel",
32969
- chainId: CHAIN_IDS.fuel.devnet,
32970
- decimals: 9,
32971
- assetId: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
32972
- },
32973
- {
32974
- type: "fuel",
32975
- chainId: CHAIN_IDS.fuel.testnet,
32976
- decimals: 9,
32977
- assetId: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
32978
- },
32979
- {
32980
- type: "fuel",
32981
- chainId: CHAIN_IDS.fuel.mainnet,
32982
- decimals: 9,
32983
- assetId: "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07"
32984
- }
32985
- ]
32986
- },
32987
- {
32988
- name: "WETH",
32989
- symbol: "WETH",
32990
- icon: "weth.svg",
32991
- networks: [
32992
- {
32993
- type: "ethereum",
32994
- chainId: CHAIN_IDS.eth.mainnet,
32995
- address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
32996
- decimals: 18
32997
- },
32998
- {
32999
- type: "fuel",
33000
- chainId: CHAIN_IDS.fuel.mainnet,
33001
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33002
- assetId: "0xa38a5a8beeb08d95744bc7f58528073f4052b254def59eba20c99c202b5acaa3",
33003
- decimals: 9
33004
- }
33005
- ]
33006
- },
33007
- {
33008
- name: "weETH",
33009
- symbol: "weETH",
33010
- icon: "weETH.webp",
33011
- networks: [
33012
- {
33013
- type: "ethereum",
33014
- chainId: CHAIN_IDS.eth.mainnet,
33015
- address: "0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee",
33016
- decimals: 18
33017
- },
33018
- {
33019
- type: "fuel",
33020
- chainId: CHAIN_IDS.fuel.mainnet,
33021
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33022
- assetId: "0x239ed6e12b7ce4089ee245244e3bf906999a6429c2a9a445a1e1faf56914a4ab",
33023
- decimals: 9
33024
- }
33025
- ]
33026
- },
33027
- {
33028
- name: "rsETH",
33029
- symbol: "rsETH",
33030
- icon: "rsETH.webp",
33031
- networks: [
33032
- {
33033
- type: "ethereum",
33034
- chainId: CHAIN_IDS.eth.mainnet,
33035
- address: "0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7",
33036
- decimals: 18
33037
- },
33038
- {
33039
- type: "fuel",
33040
- chainId: CHAIN_IDS.fuel.mainnet,
33041
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33042
- assetId: "0xbae80f7fb8aa6b90d9b01ef726ec847cc4f59419c4d5f2ea88fec785d1b0e849",
33043
- decimals: 9
33044
- }
33045
- ]
33046
- },
33047
- {
33048
- name: "rETH",
33049
- symbol: "rETH",
33050
- icon: "reth.svg",
33051
- networks: [
33052
- {
33053
- type: "ethereum",
33054
- chainId: CHAIN_IDS.eth.mainnet,
33055
- address: "0xae78736cd615f374d3085123a210448e74fc6393",
33056
- decimals: 18
33057
- },
33058
- {
33059
- type: "fuel",
33060
- chainId: CHAIN_IDS.fuel.mainnet,
33061
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33062
- assetId: "0xf3f9a0ed0ce8eac5f89d6b83e41b3848212d5b5f56108c54a205bb228ca30c16",
33063
- decimals: 9
33064
- }
33065
- ]
33066
- },
33067
- {
33068
- name: "wbETH",
33069
- symbol: "wbETH",
33070
- icon: "wbeth.png",
33071
- networks: [
33072
- {
33073
- type: "ethereum",
33074
- chainId: CHAIN_IDS.eth.mainnet,
33075
- address: "0xa2E3356610840701BDf5611a53974510Ae27E2e1",
33076
- decimals: 18
33077
- },
33078
- {
33079
- type: "fuel",
33080
- chainId: CHAIN_IDS.fuel.mainnet,
33081
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33082
- assetId: "0x7843c74bef935e837f2bcf67b5d64ecb46dd53ff86375530b0caf3699e8ffafe",
33083
- decimals: 9
33084
- }
33085
- ]
33086
- },
33087
- {
33088
- name: "rstETH",
33089
- symbol: "rstETH",
33090
- icon: "rstETH.webp",
33091
- networks: [
33092
- {
33093
- type: "ethereum",
33094
- chainId: CHAIN_IDS.eth.mainnet,
33095
- address: "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a",
33096
- decimals: 18
33097
- },
33098
- {
33099
- type: "fuel",
33100
- chainId: CHAIN_IDS.fuel.mainnet,
33101
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33102
- assetId: "0x962792286fbc9b1d5860b4551362a12249362c21594c77abf4b3fe2bbe8d977a",
33103
- decimals: 9
33104
- }
33105
- ]
33106
- },
33107
- {
33108
- name: "amphrETH",
33109
- symbol: "amphrETH",
33110
- icon: "amphrETH.png",
33111
- networks: [
33112
- {
33113
- type: "ethereum",
33114
- chainId: CHAIN_IDS.eth.mainnet,
33115
- address: "0x5fD13359Ba15A84B76f7F87568309040176167cd",
33116
- decimals: 18
33117
- },
33118
- {
33119
- type: "fuel",
33120
- chainId: CHAIN_IDS.fuel.mainnet,
33121
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33122
- assetId: "0x05fc623e57bd7bc1258efa8e4f62b05af5471d73df6f2c2dc11ecc81134c4f36",
33123
- decimals: 9
33124
- }
33125
- ]
33126
- },
33127
- {
33128
- name: "Manta mBTC",
33129
- symbol: "Manta mBTC",
33130
- icon: "manta-mbtc.svg",
33131
- networks: [
33132
- {
33133
- type: "ethereum",
33134
- chainId: CHAIN_IDS.eth.mainnet,
33135
- address: "0x4041381e947CFD3D483d67a25C6aa9Dc924250c5",
33136
- decimals: 18
33137
- },
33138
- {
33139
- type: "fuel",
33140
- chainId: CHAIN_IDS.fuel.mainnet,
33141
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33142
- assetId: "0xaf3111a248ff7a3238cdeea845bb2d43cf3835f1f6b8c9d28360728b55b9ce5b",
33143
- decimals: 9
33144
- }
33145
- ]
33146
- },
33147
- {
33148
- name: "Manta mETH",
33149
- symbol: "Manta mETH",
33150
- icon: "manta-meth.svg",
33151
- networks: [
33152
- {
33153
- type: "ethereum",
33154
- chainId: CHAIN_IDS.eth.mainnet,
33155
- address: "0x8CdF550C04Bc9B9F10938368349C9c8051A772b6",
33156
- decimals: 18
33157
- },
33158
- {
33159
- type: "fuel",
33160
- chainId: CHAIN_IDS.fuel.mainnet,
33161
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33162
- assetId: "0xafd219f513317b1750783c6581f55530d6cf189a5863fd18bd1b3ffcec1714b4",
33163
- decimals: 9
33164
- }
33165
- ]
33166
- },
33167
- {
33168
- name: "Manta mUSD",
33169
- symbol: "Manta mUSD",
33170
- icon: "manta-musd.svg",
33171
- networks: [
33172
- {
33173
- type: "ethereum",
33174
- chainId: CHAIN_IDS.eth.mainnet,
33175
- address: "0x3f24E1d7a973867fC2A03fE199E5502514E0e11E",
33176
- decimals: 18
33177
- },
33178
- {
33179
- type: "fuel",
33180
- chainId: CHAIN_IDS.fuel.mainnet,
33181
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33182
- assetId: "0x89cb9401e55d49c3269654dd1cdfb0e80e57823a4a7db98ba8fc5953b120fef4",
33183
- decimals: 9
33184
- }
33185
- ]
33186
- },
33187
- {
33188
- name: "pumpBTC",
33189
- symbol: "pumpBTC",
33190
- icon: "pumpbtc.webp",
33191
- networks: [
33192
- {
33193
- type: "ethereum",
33194
- chainId: CHAIN_IDS.eth.mainnet,
33195
- address: "0xf469fbd2abcd6b9de8e169d128226c0fc90a012e",
33196
- decimals: 8
33197
- },
33198
- {
33199
- type: "fuel",
33200
- chainId: CHAIN_IDS.fuel.mainnet,
33201
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33202
- assetId: "0x0aa5eb2bb97ca915288b653a2529355d4dc66de2b37533213f0e4aeee3d3421f",
33203
- decimals: 8
33204
- }
33205
- ]
33206
- },
33207
- {
33208
- name: "FBTC",
33209
- symbol: "FBTC",
33210
- icon: "fbtc.svg",
33211
- networks: [
33212
- {
33213
- type: "ethereum",
33214
- chainId: CHAIN_IDS.eth.mainnet,
33215
- address: "0xc96de26018a54d51c097160568752c4e3bd6c364",
33216
- decimals: 8
33217
- },
33218
- {
33219
- type: "fuel",
33220
- chainId: CHAIN_IDS.fuel.mainnet,
33221
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33222
- assetId: "0xb5ecb0a1e08e2abbabf624ffea089df933376855f468ade35c6375b00c33996a",
33223
- decimals: 8
33224
- }
33225
- ]
33226
- },
33227
- {
33228
- name: "SolvBTC",
33229
- symbol: "SolvBTC",
33230
- icon: "solvBTC.webp",
33231
- networks: [
33232
- {
33233
- type: "ethereum",
33234
- chainId: CHAIN_IDS.eth.mainnet,
33235
- address: "0x7a56e1c57c7475ccf742a1832b028f0456652f97",
33236
- decimals: 18
33237
- },
33238
- {
33239
- type: "fuel",
33240
- chainId: CHAIN_IDS.fuel.mainnet,
33241
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33242
- assetId: "0x1186afea9affb88809c210e13e2330b5258c2cef04bb8fff5eff372b7bd3f40f",
33243
- decimals: 9
33244
- }
33245
- ]
33246
- },
33247
- {
33248
- name: "SolvBTC.BBN",
33249
- symbol: "SolvBTC.BBN",
33250
- icon: "SolvBTC.BBN.png",
33251
- networks: [
33252
- {
33253
- type: "ethereum",
33254
- chainId: CHAIN_IDS.eth.mainnet,
33255
- address: "0xd9d920aa40f578ab794426f5c90f6c731d159def",
33256
- decimals: 18
33257
- },
33258
- {
33259
- type: "fuel",
33260
- chainId: CHAIN_IDS.fuel.mainnet,
33261
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33262
- assetId: "0x7a4f087c957d30218223c2baaaa365355c9ca81b6ea49004cfb1590a5399216f",
33263
- decimals: 9
33264
- }
33265
- ]
33266
- },
33267
- {
33268
- name: "Mantle mETH",
33269
- symbol: "Mantle mETH",
33270
- icon: "mantle-meth.svg",
33271
- networks: [
33272
- {
33273
- type: "ethereum",
33274
- chainId: CHAIN_IDS.eth.mainnet,
33275
- address: "0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa",
33276
- decimals: 18
33277
- },
33278
- {
33279
- type: "fuel",
33280
- chainId: CHAIN_IDS.fuel.mainnet,
33281
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33282
- assetId: "0x642a5db59ec323c2f846d4d4cf3e58d78aff64accf4f8f6455ba0aa3ef000a3b",
33283
- decimals: 9
33284
- }
33285
- ]
33286
- },
33287
- {
33288
- name: "sDAI",
33289
- symbol: "sDAI",
33290
- icon: "sdai.svg",
33291
- networks: [
33292
- {
33293
- type: "ethereum",
33294
- chainId: CHAIN_IDS.eth.mainnet,
33295
- address: "0x83f20f44975d03b1b09e64809b757c47f942beea",
33296
- decimals: 18
33297
- },
33298
- {
33299
- type: "fuel",
33300
- chainId: CHAIN_IDS.fuel.mainnet,
33301
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33302
- assetId: "0x9e46f919fbf978f3cad7cd34cca982d5613af63ff8aab6c379e4faa179552958",
33303
- decimals: 9
33304
- }
33305
- ]
33306
- },
33307
- {
33308
- name: "USDT",
33309
- symbol: "USDT",
33310
- icon: "usdt.svg",
33311
- networks: [
33312
- {
33313
- type: "ethereum",
33314
- chainId: CHAIN_IDS.eth.mainnet,
33315
- address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
33316
- decimals: 6
33317
- },
33318
- {
33319
- type: "fuel",
33320
- chainId: CHAIN_IDS.fuel.mainnet,
33321
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33322
- assetId: "0xa0265fb5c32f6e8db3197af3c7eb05c48ae373605b8165b6f4a51c5b0ba4812e",
33323
- decimals: 6
33324
- }
33325
- ]
33326
- },
33327
- {
33328
- name: "USDC",
33329
- symbol: "USDC",
33330
- icon: "usdc.svg",
33331
- networks: [
33332
- {
33333
- type: "ethereum",
33334
- chainId: CHAIN_IDS.eth.mainnet,
33335
- address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
33336
- decimals: 6
33337
- },
33338
- {
33339
- type: "fuel",
33340
- chainId: CHAIN_IDS.fuel.mainnet,
33341
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33342
- assetId: "0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6b",
33343
- decimals: 6
33344
- }
33345
- ]
33346
- },
33347
- {
33348
- name: "USDe",
33349
- symbol: "USDe",
33350
- icon: "USDe.svg",
33351
- networks: [
33352
- {
33353
- type: "ethereum",
33354
- chainId: CHAIN_IDS.eth.mainnet,
33355
- address: "0x4c9edd5852cd905f086c759e8383e09bff1e68b3",
33356
- decimals: 18
33357
- },
33358
- {
33359
- type: "fuel",
33360
- chainId: CHAIN_IDS.fuel.mainnet,
33361
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33362
- assetId: "0xb6133b2ef9f6153eb869125d23dcf20d1e735331b5e41b15a6a7a6cec70e8651",
33363
- decimals: 9
33364
- }
33365
- ]
33366
- },
33367
- {
33368
- name: "sUSDe",
33369
- symbol: "sUSDe",
33370
- icon: "sUSDe.webp",
33371
- networks: [
33372
- {
33373
- type: "ethereum",
33374
- chainId: CHAIN_IDS.eth.mainnet,
33375
- address: "0x9d39a5de30e57443bff2a8307a4256c8797a3497",
33376
- decimals: 18
33377
- },
33378
- {
33379
- type: "fuel",
33380
- chainId: CHAIN_IDS.fuel.mainnet,
33381
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33382
- assetId: "0xd05563025104fc36496c15c7021ad6b31034b0e89a356f4f818045d1f48808bc",
33383
- decimals: 9
33384
- }
33385
- ]
33386
- },
33387
- {
33388
- name: "rsUSDe",
33389
- symbol: "rsUSDe",
33390
- icon: "rsUSDe.svg",
33391
- networks: [
33392
- {
33393
- type: "ethereum",
33394
- chainId: CHAIN_IDS.eth.mainnet,
33395
- address: "0x82f5104b23FF2FA54C2345F821dAc9369e9E0B26",
33396
- decimals: 18
33397
- },
33398
- {
33399
- type: "fuel",
33400
- chainId: CHAIN_IDS.fuel.mainnet,
33401
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33402
- assetId: "0x78d4522ec607f6e8efb66ea49439d1ee48623cf763f9688a8eada025def033d9",
33403
- decimals: 9
33404
- }
33405
- ]
33406
- },
33407
- {
33408
- name: "wstETH",
33409
- symbol: "wstETH",
33410
- icon: "wsteth.svg",
33411
- networks: [
33412
- {
33413
- type: "ethereum",
33414
- chainId: CHAIN_IDS.eth.mainnet,
33415
- address: "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
33416
- decimals: 18
33417
- },
33418
- {
33419
- type: "fuel",
33420
- chainId: CHAIN_IDS.fuel.mainnet,
33421
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33422
- assetId: "0x1a7815cc9f75db5c24a5b0814bfb706bb9fe485333e98254015de8f48f84c67b",
33423
- decimals: 9
33424
- }
33425
- ]
33426
- },
33427
- {
33428
- name: "ezETH",
33429
- symbol: "ezETH",
33430
- icon: "ezeth.webp",
33431
- networks: [
33432
- {
33433
- type: "ethereum",
33434
- chainId: CHAIN_IDS.eth.mainnet,
33435
- address: "0xbf5495Efe5DB9ce00f80364C8B423567e58d2110",
33436
- decimals: 18
33437
- },
33438
- {
33439
- type: "fuel",
33440
- chainId: CHAIN_IDS.fuel.mainnet,
33441
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33442
- assetId: "0x91b3559edb2619cde8ffb2aa7b3c3be97efd794ea46700db7092abeee62281b0",
33443
- decimals: 9
33444
- }
33445
- ]
33446
- },
33447
- {
33448
- name: "pzETH",
33449
- symbol: "pzETH",
33450
- icon: "pzETH.webp",
33451
- networks: [
33452
- {
33453
- type: "ethereum",
33454
- chainId: CHAIN_IDS.eth.mainnet,
33455
- address: "0x8c9532a60e0e7c6bbd2b2c1303f63ace1c3e9811",
33456
- decimals: 18
33457
- },
33458
- {
33459
- type: "fuel",
33460
- chainId: CHAIN_IDS.fuel.mainnet,
33461
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33462
- assetId: "0x1493d4ec82124de8f9b625682de69dcccda79e882b89a55a8c737b12de67bd68",
33463
- decimals: 9
33464
- }
33465
- ]
33466
- },
33467
- {
33468
- name: "Re7LRT",
33469
- symbol: "Re7LRT",
33470
- icon: "Re7LRT.png",
33471
- networks: [
33472
- {
33473
- type: "ethereum",
33474
- chainId: CHAIN_IDS.eth.mainnet,
33475
- address: "0x84631c0d0081FDe56DeB72F6DE77abBbF6A9f93a",
33476
- decimals: 18
33477
- },
33478
- {
33479
- type: "fuel",
33480
- chainId: CHAIN_IDS.fuel.mainnet,
33481
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33482
- assetId: "0xf2fc648c23a5db24610a1cf696acc4f0f6d9a7d6028dd9944964ab23f6e35995",
33483
- decimals: 9
33484
- }
33485
- ]
33486
- },
33487
- {
33488
- name: "steakLRT",
33489
- symbol: "steakLRT",
33490
- icon: "steakLRT.png",
33491
- networks: [
33492
- {
33493
- type: "ethereum",
33494
- chainId: CHAIN_IDS.eth.mainnet,
33495
- address: "0xBEEF69Ac7870777598A04B2bd4771c71212E6aBc",
33496
- decimals: 18
33497
- },
33498
- {
33499
- type: "fuel",
33500
- chainId: CHAIN_IDS.fuel.mainnet,
33501
- contractId: "0x4ea6ccef1215d9479f1024dff70fc055ca538215d2c8c348beddffd54583d0e8",
33502
- assetId: "0x4fc8ac9f101df07e2c2dec4a53c8c42c439bdbe5e36ea2d863a61ff60afafc30",
33503
- decimals: 9
33504
- }
33505
- ]
33506
- }
33507
- ];
33508
- var assets = resolveIconPaths(rawAssets, fuelAssetsBaseUrl);
32975
+ /** @hidden */
32976
+ __publicField(Provider, "incompatibleNodeVersionMessage", "");
33509
32977
 
33510
32978
  // src/test-utils/test-asset-id.ts
33511
32979
  var _TestAssetId = class {
@@ -33553,11 +33021,7 @@ Supported fuel-core version: ${supportedVersion}.`
33553
33021
  return transferParams.reduce((acc, transferParam) => {
33554
33022
  const { assetId, amount, contractId } = transferParam;
33555
33023
  const encoded = numberCoder.encode(amount);
33556
- const scriptData = concat([
33557
- Address.fromAddressOrString(contractId).toBytes(),
33558
- encoded,
33559
- arrayify(assetId)
33560
- ]);
33024
+ const scriptData = concat([new Address(contractId).toBytes(), encoded, arrayify(assetId)]);
33561
33025
  return concat([acc, scriptData]);
33562
33026
  }, new Uint8Array());
33563
33027
  };
@@ -33613,7 +33077,7 @@ Supported fuel-core version: ${supportedVersion}.`
33613
33077
  super();
33614
33078
  this._provider = provider;
33615
33079
  this._connector = connector;
33616
- this.address = Address.fromDynamicInput(address);
33080
+ this.address = new Address(address);
33617
33081
  }
33618
33082
  /**
33619
33083
  * The provider used to interact with the network.
@@ -33851,7 +33315,7 @@ Supported fuel-core version: ${supportedVersion}.`
33851
33315
  addTransfer(request, transferParams) {
33852
33316
  const { destination, amount, assetId } = transferParams;
33853
33317
  this.validateTransferAmount(amount);
33854
- request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
33318
+ request.addCoinOutput(new Address(destination), amount, assetId);
33855
33319
  return request;
33856
33320
  }
33857
33321
  /**
@@ -33891,7 +33355,7 @@ Supported fuel-core version: ${supportedVersion}.`
33891
33355
  const defaultAssetId = await this.provider.getBaseAssetId();
33892
33356
  const transferParams = contractTransferParams.map((transferParam) => {
33893
33357
  const amount = bn(transferParam.amount);
33894
- const contractAddress = Address.fromAddressOrString(transferParam.contractId);
33358
+ const contractAddress = new Address(transferParam.contractId);
33895
33359
  const assetId = transferParam.assetId ? hexlify(transferParam.assetId) : defaultAssetId;
33896
33360
  if (amount.lte(0)) {
33897
33361
  throw new FuelError(
@@ -33922,7 +33386,7 @@ Supported fuel-core version: ${supportedVersion}.`
33922
33386
  * @returns A promise that resolves to the transaction response.
33923
33387
  */
33924
33388
  async withdrawToBaseLayer(recipient, amount, txParams = {}) {
33925
- const recipientAddress = Address.fromAddressOrString(recipient);
33389
+ const recipientAddress = new Address(recipient);
33926
33390
  const recipientDataArray = arrayify(
33927
33391
  "0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
33928
33392
  );
@@ -33958,7 +33422,7 @@ Supported fuel-core version: ${supportedVersion}.`
33958
33422
  *
33959
33423
  * @returns A promise that resolves to the transaction cost object.
33960
33424
  */
33961
- async getTransactionCost(transactionRequestLike, { signatureCallback, quantities = [] } = {}) {
33425
+ async getTransactionCost(transactionRequestLike, { signatureCallback, quantities = [], gasPrice } = {}) {
33962
33426
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
33963
33427
  const baseAssetId = await this.provider.getBaseAssetId();
33964
33428
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
@@ -33993,7 +33457,8 @@ Supported fuel-core version: ${supportedVersion}.`
33993
33457
  ({ amount, assetId }) => updateAssetInput(assetId, amount)
33994
33458
  );
33995
33459
  const txCost = await this.provider.getTransactionCost(txRequestClone, {
33996
- signatureCallback
33460
+ signatureCallback,
33461
+ gasPrice
33997
33462
  });
33998
33463
  return {
33999
33464
  ...txCost,
@@ -34146,7 +33611,7 @@ Supported fuel-core version: ${supportedVersion}.`
34146
33611
  };
34147
33612
  async function encryptKeystoreWallet(privateKey, address, password) {
34148
33613
  const privateKeyBuffer = bufferFromString2(removeHexPrefix(privateKey), "hex");
34149
- const ownerAddress = Address.fromAddressOrString(address);
33614
+ const ownerAddress = new Address(address);
34150
33615
  const salt = randomBytes22(DEFAULT_KEY_SIZE);
34151
33616
  const key = scrypt22({
34152
33617
  password: bufferFromString2(password),
@@ -37041,14 +36506,14 @@ Supported fuel-core version: ${supportedVersion}.`
37041
36506
  constructor(baseAssetId, config) {
37042
36507
  WalletsConfig.validate(config);
37043
36508
  this.options = config;
37044
- const { assets: assets2, coinsPerAsset, amountPerCoin, messages } = this.options;
36509
+ const { assets, coinsPerAsset, amountPerCoin, messages } = this.options;
37045
36510
  this.wallets = this.generateWallets();
37046
36511
  this.initialState = {
37047
36512
  messages: WalletsConfig.createMessages(this.wallets, messages),
37048
36513
  coins: WalletsConfig.createCoins(
37049
36514
  this.wallets,
37050
36515
  baseAssetId,
37051
- assets2,
36516
+ assets,
37052
36517
  coinsPerAsset,
37053
36518
  amountPerCoin
37054
36519
  )
@@ -37073,19 +36538,19 @@ Supported fuel-core version: ${supportedVersion}.`
37073
36538
  /**
37074
36539
  * Create coins for the wallets in the format that the chain expects.
37075
36540
  */
37076
- static createCoins(wallets, baseAssetId, assets2, coinsPerAsset, amountPerCoin) {
36541
+ static createCoins(wallets, baseAssetId, assets, coinsPerAsset, amountPerCoin) {
37077
36542
  const coins = [];
37078
36543
  let assetIds = [baseAssetId];
37079
- if (Array.isArray(assets2)) {
37080
- assetIds = assetIds.concat(assets2.map((a) => a.value));
36544
+ if (Array.isArray(assets)) {
36545
+ assetIds = assetIds.concat(assets.map((a) => a.value));
37081
36546
  } else {
37082
- assetIds = assetIds.concat(TestAssetId.random(assets2 - 1).map((a) => a.value));
36547
+ assetIds = assetIds.concat(TestAssetId.random(assets - 1).map((a) => a.value));
37083
36548
  }
37084
36549
  wallets.map((wallet) => wallet.address.toHexString()).forEach((walletAddress) => {
37085
36550
  assetIds.forEach((assetId) => {
37086
36551
  for (let index = 0; index < coinsPerAsset; index++) {
37087
36552
  coins.push({
37088
- amount: amountPerCoin,
36553
+ amount: bn(amountPerCoin).toString(),
37089
36554
  asset_id: assetId,
37090
36555
  owner: walletAddress,
37091
36556
  tx_pointer_block_height: 0,
@@ -37100,7 +36565,7 @@ Supported fuel-core version: ${supportedVersion}.`
37100
36565
  }
37101
36566
  static validate({
37102
36567
  count: wallets,
37103
- assets: assets2,
36568
+ assets,
37104
36569
  coinsPerAsset,
37105
36570
  amountPerCoin
37106
36571
  }) {
@@ -37110,7 +36575,7 @@ Supported fuel-core version: ${supportedVersion}.`
37110
36575
  "Number of wallets must be greater than zero."
37111
36576
  );
37112
36577
  }
37113
- if (Array.isArray(assets2) && assets2.length === 0 || typeof assets2 === "number" && assets2 <= 0) {
36578
+ if (Array.isArray(assets) && assets.length === 0 || typeof assets === "number" && assets <= 0) {
37114
36579
  throw new FuelError(
37115
36580
  FuelError.CODES.INVALID_INPUT_PARAMETERS,
37116
36581
  "Number of assets per wallet must be greater than zero."
@@ -37122,7 +36587,7 @@ Supported fuel-core version: ${supportedVersion}.`
37122
36587
  "Number of coins per asset must be greater than zero."
37123
36588
  );
37124
36589
  }
37125
- if (amountPerCoin < 0) {
36590
+ if (bn(amountPerCoin).lt(0)) {
37126
36591
  throw new FuelError(
37127
36592
  FuelError.CODES.INVALID_INPUT_PARAMETERS,
37128
36593
  "Amount per coin must be greater than or equal to zero."