@fuel-ts/account 0.0.0-rc-2408-20240620125747 → 0.0.0-rc-2408-20240620151941

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @fuel-ts/account might be problematic. Click here for more details.

package/dist/index.mjs CHANGED
@@ -4575,6 +4575,7 @@ Supported fuel-core version: ${supportedVersion}.`
4575
4575
  * @returns A promise that resolves to the coins.
4576
4576
  */
4577
4577
  async getCoins(owner, assetId, paginationArgs) {
4578
+ this.validatePaginationArgs(paginationArgs);
4578
4579
  const ownerAddress = Address2.fromAddressOrString(owner);
4579
4580
  const {
4580
4581
  coins: { edges, pageInfo }
@@ -4809,8 +4810,8 @@ Supported fuel-core version: ${supportedVersion}.`
4809
4810
  balances: { edges }
4810
4811
  } = await this.operations.getBalances({
4811
4812
  /**
4812
- * The query signature for this method was create to support pagination but the
4813
- * current Fuel-Core implementation does not support pagination yet
4813
+ * The query parameters for this method were designed to support pagination,
4814
+ * but the current Fuel-Core implementation does not support pagination yet.
4814
4815
  */
4815
4816
  first: 1e4,
4816
4817
  filter: { owner: Address2.fromAddressOrString(owner).toB256() }
@@ -4829,6 +4830,7 @@ Supported fuel-core version: ${supportedVersion}.`
4829
4830
  * @returns A promise that resolves to the messages.
4830
4831
  */
4831
4832
  async getMessages(address, paginationArgs) {
4833
+ this.validatePaginationArgs(paginationArgs);
4832
4834
  const {
4833
4835
  messages: { edges, pageInfo }
4834
4836
  } = await this.operations.getMessages({
@@ -5033,6 +5035,18 @@ Supported fuel-core version: ${supportedVersion}.`
5033
5035
  }
5034
5036
  return relayedTransactionStatus;
5035
5037
  }
5038
+ /**
5039
+ * @hidden
5040
+ */
5041
+ validatePaginationArgs({ first, last } = {}) {
5042
+ const MAX_PAGINATION_LIMIT = 1e3;
5043
+ if ((first || 0) > MAX_PAGINATION_LIMIT || (last || 0) > MAX_PAGINATION_LIMIT) {
5044
+ throw new FuelError13(
5045
+ ErrorCode13.INVALID_INPUT_PARAMETERS,
5046
+ "Pagination limit cannot exceed 1000 items"
5047
+ );
5048
+ }
5049
+ }
5036
5050
  /**
5037
5051
  * @hidden
5038
5052
  */