@bithomp/xrpl-api 3.7.19 → 3.7.20

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.
@@ -49,6 +49,7 @@ const DEFAULT_LIMIT = 200;
49
49
  const MAX_LIMIT_WITH_FILTER = 20;
50
50
  const MAX_LIMIT_WITH_TAG = 3;
51
51
  const LIMIT_INCREASE_COUNT = 10;
52
+ const DEFAULT_TIMEOUT = 15000;
52
53
  async function getTransactions(account, options = { limit: DEFAULT_LIMIT }) {
53
54
  const { hash, marker } = (0, utils_1.parseMarker)(options.marker);
54
55
  options.marker = marker;
@@ -137,11 +138,17 @@ async function getTransactions(account, options = { limit: DEFAULT_LIMIT }) {
137
138
  result.bithompHash = connection.hash;
138
139
  return result;
139
140
  }
140
- async function findTransactionsExt(account, options = { limit: DEFAULT_LIMIT, timeout: 15000 }) {
141
+ async function findTransactionsExt(account, options = { limit: DEFAULT_LIMIT, timeout: DEFAULT_TIMEOUT }) {
141
142
  let transactions = [];
142
143
  let accountTransactionsError = null;
143
144
  const timeStart = new Date();
144
145
  const loadOptions = { ...options };
146
+ if (!loadOptions.limit || loadOptions.limit <= 0) {
147
+ loadOptions.limit = DEFAULT_LIMIT;
148
+ }
149
+ if (!loadOptions.timeout || loadOptions.timeout <= 0) {
150
+ loadOptions.timeout = DEFAULT_TIMEOUT;
151
+ }
145
152
  const formatted = loadOptions.legacy === true || loadOptions.formatted === true;
146
153
  loadOptions.binary = false;
147
154
  applyLimitOptions(loadOptions);
@@ -265,12 +272,12 @@ async function findTransactions(account, options = { limit: DEFAULT_LIMIT, timeo
265
272
  }
266
273
  function applyLimitOptions(options) {
267
274
  if (options.sourceTag > 0 || options.destinationTag > 0) {
268
- if (options.limit > MAX_LIMIT_WITH_TAG) {
275
+ if (!options.limit || options.limit > MAX_LIMIT_WITH_TAG) {
269
276
  options.limit = MAX_LIMIT_WITH_TAG;
270
277
  }
271
278
  }
272
279
  else if (options.types || options.initiated || options.counterparty) {
273
- if (options.limit > MAX_LIMIT_WITH_FILTER) {
280
+ if (!options.limit || options.limit > MAX_LIMIT_WITH_FILTER) {
274
281
  options.limit = MAX_LIMIT_WITH_FILTER;
275
282
  }
276
283
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.7.19",
3
+ "version": "3.7.20",
4
4
  "description": "A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -62,15 +62,15 @@
62
62
  "xrpl": "4.4.3"
63
63
  },
64
64
  "devDependencies": {
65
- "@eslint/eslintrc": "^3.3.1",
65
+ "@eslint/eslintrc": "^3.3.3",
66
66
  "@types/chai": "^5.2.3",
67
67
  "@types/chai-as-promised": "^8.0.2",
68
- "@types/lodash": "^4.17.20",
68
+ "@types/lodash": "^4.17.21",
69
69
  "@types/mocha": "^10.0.10",
70
70
  "@types/nconf": "^0.10.7",
71
71
  "@types/node": "^22.15.21",
72
- "@typescript-eslint/eslint-plugin": "^8.47.0",
73
- "@typescript-eslint/parser": "^8.47.0",
72
+ "@typescript-eslint/eslint-plugin": "^8.48.0",
73
+ "@typescript-eslint/parser": "^8.48.0",
74
74
  "chai": "^6.2.1",
75
75
  "chai-as-promised": "^8.0.2",
76
76
  "eslint": "^9.39.1",