@bithomp/xrpl-api 3.0.10 → 3.1.1

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.
@@ -1,10 +1,12 @@
1
1
  import { EventEmitter } from "events";
2
- import { Request, Response } from "xrpl";
2
+ import { Request, Response, APIVersion } from "xrpl";
3
+ export declare const DEFAULT_API_VERSION = 1;
3
4
  export interface ConnectionOptions {
4
5
  logger?: any;
5
6
  timeout?: number;
6
7
  connectionTimeout?: number;
7
8
  networkID?: number;
9
+ apiVersion?: APIVersion;
8
10
  }
9
11
  export interface LatencyInfo {
10
12
  timestamp: Date;
@@ -34,6 +36,7 @@ declare class Connection extends EventEmitter {
34
36
  readonly connectionTimeout: number;
35
37
  readonly hash?: string;
36
38
  private networkID?;
39
+ private apiVersion;
37
40
  private serverInfoUpdating;
38
41
  serverInfo: any;
39
42
  private shutdown;
package/lib/connection.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Connection = void 0;
6
+ exports.Connection = exports.DEFAULT_API_VERSION = void 0;
7
7
  const crypto_1 = __importDefault(require("crypto"));
8
8
  const events_1 = require("events");
9
9
  const xrpl_1 = require("xrpl");
@@ -14,6 +14,7 @@ const RECONNECT_TIMEOUT = 1000 * 5;
14
14
  const LEDGER_CLOSED_TIMEOUT = 1000 * 15;
15
15
  const SERVER_INFO_UPDATE_INTERVAL = 1000 * 60 * 5;
16
16
  const AVAILABLE_LEDGER_INDEX_WINDOW = 1000;
17
+ exports.DEFAULT_API_VERSION = xrpl_1.RIPPLED_API_V1;
17
18
  class Connection extends events_1.EventEmitter {
18
19
  constructor(url, type, options = {}) {
19
20
  super();
@@ -38,6 +39,7 @@ class Connection extends events_1.EventEmitter {
38
39
  if (typeof options.networkID === "number") {
39
40
  this.networkID = options.networkID;
40
41
  }
42
+ this.apiVersion = options.apiVersion || exports.DEFAULT_API_VERSION;
41
43
  this.serverInfoUpdating = false;
42
44
  this.serverInfo = null;
43
45
  this.streams = {
@@ -56,6 +58,7 @@ class Connection extends events_1.EventEmitter {
56
58
  });
57
59
  await this.removeClient();
58
60
  this.client = new xrpl_1.Client(this.url, (0, common_1.removeUndefined)({ timeout: this.timeout, connectionTimeout: this.connectionTimeout }));
61
+ this.client.apiVersion = this.apiVersion;
59
62
  this.setupEmitter();
60
63
  await this.client.connect();
61
64
  await this.updateServerInfo();
@@ -106,9 +106,6 @@ async function getAccountAllOffers(account, options = {}) {
106
106
  else {
107
107
  break;
108
108
  }
109
- if (response.offers.length === 0) {
110
- break;
111
- }
112
109
  }
113
110
  if (response.error) {
114
111
  const { error, error_code, error_message, status, validated } = response;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.0.10",
3
+ "version": "3.1.1",
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",
@@ -11,19 +11,23 @@
11
11
  "url": "git+https://github.com/Bithomp/xrpl-api.git"
12
12
  },
13
13
  "engines": {
14
- "node": ">=16.0.0"
14
+ "node": ">=18.0.0"
15
15
  },
16
16
  "keywords": [
17
17
  "xrpl",
18
- "ws",
18
+ "rippled",
19
+ "clio",
19
20
  "xrp",
20
- "xah",
21
21
  "nft",
22
22
  "xls20",
23
23
  "xls35",
24
24
  "unl",
25
25
  "bithomp",
26
- "xahau"
26
+ "xahau",
27
+ "xahaud",
28
+ "xah",
29
+ "hooks",
30
+ "ws"
27
31
  ],
28
32
  "funding": {
29
33
  "type": "individual",
@@ -51,21 +55,21 @@
51
55
  "axios": "^1.7.2",
52
56
  "base-x": "^5.0.0",
53
57
  "bignumber.js": "^9.1.2",
54
- "elliptic": "^6.5.5",
58
+ "elliptic": "^6.5.6",
55
59
  "lodash": "^4.17.21",
56
60
  "ripple-address-codec": "^5.0.0",
57
61
  "ripple-binary-codec": "^2.1.0",
58
- "xrpl": "^3.1.0"
62
+ "xrpl": "^4.0.0"
59
63
  },
60
64
  "devDependencies": {
61
65
  "@types/chai": "^4.3.16",
62
66
  "@types/chai-as-promised": "^7.1.8",
63
- "@types/lodash": "^4.17.6",
67
+ "@types/lodash": "^4.17.7",
64
68
  "@types/mocha": "^10.0.7",
65
69
  "@types/nconf": "^0.10.6",
66
- "@types/node": "^20.14.10",
67
- "@typescript-eslint/eslint-plugin": "^7.16.0",
68
- "@typescript-eslint/parser": "^7.16.0",
70
+ "@types/node": "^20.14.11",
71
+ "@typescript-eslint/eslint-plugin": "^7.17.0",
72
+ "@typescript-eslint/parser": "^7.17.0",
69
73
  "chai": "^4.4.1",
70
74
  "chai-as-promised": "^7.1.2",
71
75
  "eslint": "^8.57.0",
@@ -73,10 +77,10 @@
73
77
  "eslint-plugin-chai-friendly": "^1.0.0",
74
78
  "eslint-plugin-import": "^2.29.1",
75
79
  "eslint-plugin-n": "^17.9.0",
76
- "eslint-plugin-promise": "^6.4.0",
77
- "mocha": "^10.6.0",
80
+ "eslint-plugin-promise": "^6.6.0",
81
+ "mocha": "^10.7.0",
78
82
  "nconf": "^0.12.1",
79
- "ts-jest": "^29.2.2",
83
+ "ts-jest": "^29.2.3",
80
84
  "ts-node": "^10.9.2",
81
85
  "typescript": "^5.4.5"
82
86
  }