@limitless-exchange/sdk 0.0.1 → 0.0.2
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.
- package/README.md +6 -0
- package/dist/index.d.mts +578 -40
- package/dist/index.d.ts +578 -40
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -504,6 +504,8 @@ var AuthenticatedClient = class {
|
|
|
504
504
|
|
|
505
505
|
// src/api/http.ts
|
|
506
506
|
var import_axios = __toESM(require("axios"));
|
|
507
|
+
var import_http = __toESM(require("http"));
|
|
508
|
+
var import_https = __toESM(require("https"));
|
|
507
509
|
|
|
508
510
|
// src/utils/constants.ts
|
|
509
511
|
var DEFAULT_API_URL = "https://api.limitless.exchange";
|
|
@@ -545,14 +547,39 @@ var HttpClient = class {
|
|
|
545
547
|
constructor(config = {}) {
|
|
546
548
|
this.sessionCookie = config.sessionCookie;
|
|
547
549
|
this.logger = config.logger || new NoOpLogger();
|
|
550
|
+
const keepAlive = config.keepAlive !== false;
|
|
551
|
+
const maxSockets = config.maxSockets || 50;
|
|
552
|
+
const maxFreeSockets = config.maxFreeSockets || 10;
|
|
553
|
+
const socketTimeout = config.socketTimeout || 6e4;
|
|
554
|
+
const httpAgent = new import_http.default.Agent({
|
|
555
|
+
keepAlive,
|
|
556
|
+
maxSockets,
|
|
557
|
+
maxFreeSockets,
|
|
558
|
+
timeout: socketTimeout
|
|
559
|
+
});
|
|
560
|
+
const httpsAgent = new import_https.default.Agent({
|
|
561
|
+
keepAlive,
|
|
562
|
+
maxSockets,
|
|
563
|
+
maxFreeSockets,
|
|
564
|
+
timeout: socketTimeout
|
|
565
|
+
});
|
|
548
566
|
this.client = import_axios.default.create({
|
|
549
567
|
baseURL: config.baseURL || DEFAULT_API_URL,
|
|
550
568
|
timeout: config.timeout || 3e4,
|
|
569
|
+
httpAgent,
|
|
570
|
+
httpsAgent,
|
|
551
571
|
headers: {
|
|
552
572
|
"Content-Type": "application/json",
|
|
553
|
-
Accept: "application/json"
|
|
573
|
+
Accept: "application/json",
|
|
574
|
+
...config.additionalHeaders
|
|
554
575
|
}
|
|
555
576
|
});
|
|
577
|
+
this.logger.debug("HTTP client initialized", {
|
|
578
|
+
baseURL: config.baseURL || DEFAULT_API_URL,
|
|
579
|
+
keepAlive,
|
|
580
|
+
maxSockets,
|
|
581
|
+
maxFreeSockets
|
|
582
|
+
});
|
|
556
583
|
this.setupInterceptors();
|
|
557
584
|
}
|
|
558
585
|
/**
|