@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.js CHANGED
@@ -4717,6 +4717,7 @@ Supported fuel-core version: ${supportedVersion}.`
4717
4717
  * @returns A promise that resolves to the coins.
4718
4718
  */
4719
4719
  async getCoins(owner, assetId, paginationArgs) {
4720
+ this.validatePaginationArgs(paginationArgs);
4720
4721
  const ownerAddress = import_address3.Address.fromAddressOrString(owner);
4721
4722
  const {
4722
4723
  coins: { edges, pageInfo }
@@ -4951,8 +4952,8 @@ Supported fuel-core version: ${supportedVersion}.`
4951
4952
  balances: { edges }
4952
4953
  } = await this.operations.getBalances({
4953
4954
  /**
4954
- * The query signature for this method was create to support pagination but the
4955
- * current Fuel-Core implementation does not support pagination yet
4955
+ * The query parameters for this method were designed to support pagination,
4956
+ * but the current Fuel-Core implementation does not support pagination yet.
4956
4957
  */
4957
4958
  first: 1e4,
4958
4959
  filter: { owner: import_address3.Address.fromAddressOrString(owner).toB256() }
@@ -4971,6 +4972,7 @@ Supported fuel-core version: ${supportedVersion}.`
4971
4972
  * @returns A promise that resolves to the messages.
4972
4973
  */
4973
4974
  async getMessages(address, paginationArgs) {
4975
+ this.validatePaginationArgs(paginationArgs);
4974
4976
  const {
4975
4977
  messages: { edges, pageInfo }
4976
4978
  } = await this.operations.getMessages({
@@ -5175,6 +5177,18 @@ Supported fuel-core version: ${supportedVersion}.`
5175
5177
  }
5176
5178
  return relayedTransactionStatus;
5177
5179
  }
5180
+ /**
5181
+ * @hidden
5182
+ */
5183
+ validatePaginationArgs({ first, last } = {}) {
5184
+ const MAX_PAGINATION_LIMIT = 1e3;
5185
+ if ((first || 0) > MAX_PAGINATION_LIMIT || (last || 0) > MAX_PAGINATION_LIMIT) {
5186
+ throw new import_errors14.FuelError(
5187
+ import_errors14.ErrorCode.INVALID_INPUT_PARAMETERS,
5188
+ "Pagination limit cannot exceed 1000 items"
5189
+ );
5190
+ }
5191
+ }
5178
5192
  /**
5179
5193
  * @hidden
5180
5194
  */