@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.mjs
CHANGED
|
@@ -435,6 +435,8 @@ var AuthenticatedClient = class {
|
|
|
435
435
|
|
|
436
436
|
// src/api/http.ts
|
|
437
437
|
import axios from "axios";
|
|
438
|
+
import http from "http";
|
|
439
|
+
import https from "https";
|
|
438
440
|
|
|
439
441
|
// src/utils/constants.ts
|
|
440
442
|
var DEFAULT_API_URL = "https://api.limitless.exchange";
|
|
@@ -476,14 +478,39 @@ var HttpClient = class {
|
|
|
476
478
|
constructor(config = {}) {
|
|
477
479
|
this.sessionCookie = config.sessionCookie;
|
|
478
480
|
this.logger = config.logger || new NoOpLogger();
|
|
481
|
+
const keepAlive = config.keepAlive !== false;
|
|
482
|
+
const maxSockets = config.maxSockets || 50;
|
|
483
|
+
const maxFreeSockets = config.maxFreeSockets || 10;
|
|
484
|
+
const socketTimeout = config.socketTimeout || 6e4;
|
|
485
|
+
const httpAgent = new http.Agent({
|
|
486
|
+
keepAlive,
|
|
487
|
+
maxSockets,
|
|
488
|
+
maxFreeSockets,
|
|
489
|
+
timeout: socketTimeout
|
|
490
|
+
});
|
|
491
|
+
const httpsAgent = new https.Agent({
|
|
492
|
+
keepAlive,
|
|
493
|
+
maxSockets,
|
|
494
|
+
maxFreeSockets,
|
|
495
|
+
timeout: socketTimeout
|
|
496
|
+
});
|
|
479
497
|
this.client = axios.create({
|
|
480
498
|
baseURL: config.baseURL || DEFAULT_API_URL,
|
|
481
499
|
timeout: config.timeout || 3e4,
|
|
500
|
+
httpAgent,
|
|
501
|
+
httpsAgent,
|
|
482
502
|
headers: {
|
|
483
503
|
"Content-Type": "application/json",
|
|
484
|
-
Accept: "application/json"
|
|
504
|
+
Accept: "application/json",
|
|
505
|
+
...config.additionalHeaders
|
|
485
506
|
}
|
|
486
507
|
});
|
|
508
|
+
this.logger.debug("HTTP client initialized", {
|
|
509
|
+
baseURL: config.baseURL || DEFAULT_API_URL,
|
|
510
|
+
keepAlive,
|
|
511
|
+
maxSockets,
|
|
512
|
+
maxFreeSockets
|
|
513
|
+
});
|
|
487
514
|
this.setupInterceptors();
|
|
488
515
|
}
|
|
489
516
|
/**
|