@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.

@@ -4433,6 +4433,7 @@ Supported fuel-core version: ${supportedVersion}.`
4433
4433
  * @returns A promise that resolves to the coins.
4434
4434
  */
4435
4435
  async getCoins(owner, assetId, paginationArgs) {
4436
+ this.validatePaginationArgs(paginationArgs);
4436
4437
  const ownerAddress = Address2.fromAddressOrString(owner);
4437
4438
  const {
4438
4439
  coins: { edges, pageInfo }
@@ -4667,8 +4668,8 @@ Supported fuel-core version: ${supportedVersion}.`
4667
4668
  balances: { edges }
4668
4669
  } = await this.operations.getBalances({
4669
4670
  /**
4670
- * The query signature for this method was create to support pagination but the
4671
- * current Fuel-Core implementation does not support pagination yet
4671
+ * The query parameters for this method were designed to support pagination,
4672
+ * but the current Fuel-Core implementation does not support pagination yet.
4672
4673
  */
4673
4674
  first: 1e4,
4674
4675
  filter: { owner: Address2.fromAddressOrString(owner).toB256() }
@@ -4687,6 +4688,7 @@ Supported fuel-core version: ${supportedVersion}.`
4687
4688
  * @returns A promise that resolves to the messages.
4688
4689
  */
4689
4690
  async getMessages(address, paginationArgs) {
4691
+ this.validatePaginationArgs(paginationArgs);
4690
4692
  const {
4691
4693
  messages: { edges, pageInfo }
4692
4694
  } = await this.operations.getMessages({
@@ -4891,6 +4893,18 @@ Supported fuel-core version: ${supportedVersion}.`
4891
4893
  }
4892
4894
  return relayedTransactionStatus;
4893
4895
  }
4896
+ /**
4897
+ * @hidden
4898
+ */
4899
+ validatePaginationArgs({ first, last } = {}) {
4900
+ const MAX_PAGINATION_LIMIT = 1e3;
4901
+ if ((first || 0) > MAX_PAGINATION_LIMIT || (last || 0) > MAX_PAGINATION_LIMIT) {
4902
+ throw new FuelError13(
4903
+ ErrorCode13.INVALID_INPUT_PARAMETERS,
4904
+ "Pagination limit cannot exceed 1000 items"
4905
+ );
4906
+ }
4907
+ }
4894
4908
  /**
4895
4909
  * @hidden
4896
4910
  */