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

@@ -4451,6 +4451,7 @@ Supported fuel-core version: ${supportedVersion}.`
4451
4451
  * @returns A promise that resolves to the coins.
4452
4452
  */
4453
4453
  async getCoins(owner, assetId, paginationArgs) {
4454
+ this.validatePaginationArgs(paginationArgs);
4454
4455
  const ownerAddress = import_address3.Address.fromAddressOrString(owner);
4455
4456
  const {
4456
4457
  coins: { edges, pageInfo }
@@ -4685,8 +4686,8 @@ Supported fuel-core version: ${supportedVersion}.`
4685
4686
  balances: { edges }
4686
4687
  } = await this.operations.getBalances({
4687
4688
  /**
4688
- * The query signature for this method was create to support pagination but the
4689
- * current Fuel-Core implementation does not support pagination yet
4689
+ * The query parameters for this method were designed to support pagination,
4690
+ * but the current Fuel-Core implementation does not support pagination yet.
4690
4691
  */
4691
4692
  first: 1e4,
4692
4693
  filter: { owner: import_address3.Address.fromAddressOrString(owner).toB256() }
@@ -4705,6 +4706,7 @@ Supported fuel-core version: ${supportedVersion}.`
4705
4706
  * @returns A promise that resolves to the messages.
4706
4707
  */
4707
4708
  async getMessages(address, paginationArgs) {
4709
+ this.validatePaginationArgs(paginationArgs);
4708
4710
  const {
4709
4711
  messages: { edges, pageInfo }
4710
4712
  } = await this.operations.getMessages({
@@ -4909,6 +4911,18 @@ Supported fuel-core version: ${supportedVersion}.`
4909
4911
  }
4910
4912
  return relayedTransactionStatus;
4911
4913
  }
4914
+ /**
4915
+ * @hidden
4916
+ */
4917
+ validatePaginationArgs({ first, last } = {}) {
4918
+ const MAX_PAGINATION_LIMIT = 1e3;
4919
+ if ((first || 0) > MAX_PAGINATION_LIMIT || (last || 0) > MAX_PAGINATION_LIMIT) {
4920
+ throw new import_errors14.FuelError(
4921
+ import_errors14.ErrorCode.INVALID_INPUT_PARAMETERS,
4922
+ "Pagination limit cannot exceed 1000 items"
4923
+ );
4924
+ }
4925
+ }
4912
4926
  /**
4913
4927
  * @hidden
4914
4928
  */