pmxtjs 2.34.1 → 2.34.3
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/dist/esm/pmxt/client.d.ts +22 -0
- package/dist/esm/pmxt/client.js +386 -88
- package/dist/esm/pmxt/server-manager.js +16 -2
- package/dist/pmxt/client.d.ts +22 -0
- package/dist/pmxt/client.js +386 -88
- package/dist/pmxt/server-manager.js +16 -2
- package/generated/package.json +1 -1
- package/package.json +2 -2
- package/pmxt/client.ts +363 -88
- package/pmxt/server-manager.ts +15 -2
|
@@ -305,11 +305,25 @@ export class ServerManager {
|
|
|
305
305
|
if (info && info.pid) {
|
|
306
306
|
try {
|
|
307
307
|
process.kill(info.pid, 'SIGTERM');
|
|
308
|
-
// Brief wait
|
|
309
308
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
310
309
|
}
|
|
311
310
|
catch {
|
|
312
|
-
//
|
|
311
|
+
// Process already dead — fall through to lock cleanup
|
|
312
|
+
}
|
|
313
|
+
// Verify the process is actually dead; escalate to SIGKILL if not
|
|
314
|
+
try {
|
|
315
|
+
process.kill(info.pid, 0); // throws if dead
|
|
316
|
+
// Still alive — force kill
|
|
317
|
+
try {
|
|
318
|
+
process.kill(info.pid, 'SIGKILL');
|
|
319
|
+
await new Promise(resolve => setTimeout(resolve, 200));
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
// Ignore — SIGKILL may race with natural exit
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
catch {
|
|
326
|
+
// Process is dead — good
|
|
313
327
|
}
|
|
314
328
|
}
|
|
315
329
|
// Remove lock file (best effort)
|
package/dist/pmxt/client.d.ts
CHANGED
|
@@ -80,6 +80,22 @@ export declare abstract class Exchange {
|
|
|
80
80
|
protected handleResponse(response: any): any;
|
|
81
81
|
protected getCredentials(): ExchangeCredentials | undefined;
|
|
82
82
|
protected getAuthHeaders(): Record<string, string>;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve the current sidecar base URL.
|
|
85
|
+
*
|
|
86
|
+
* For hosted mode the configured basePath is returned as-is.
|
|
87
|
+
* For local mode the port is re-read from the lock file on every
|
|
88
|
+
* call so we pick up sidecar restarts that land on a different port.
|
|
89
|
+
*/
|
|
90
|
+
private resolveBaseUrl;
|
|
91
|
+
/**
|
|
92
|
+
* Execute a fetch with retry on connection failures.
|
|
93
|
+
*
|
|
94
|
+
* Only retries on connection-level errors (ECONNREFUSED, ECONNRESET) —
|
|
95
|
+
* never on HTTP responses (4xx, 5xx). On first connection failure,
|
|
96
|
+
* attempts to restart the sidecar.
|
|
97
|
+
*/
|
|
98
|
+
private fetchWithRetry;
|
|
83
99
|
/**
|
|
84
100
|
* Call an exchange-specific REST endpoint by its operationId.
|
|
85
101
|
* This provides direct access to all implicit API methods defined in
|
|
@@ -135,6 +151,12 @@ export declare abstract class Exchange {
|
|
|
135
151
|
unwatchOrderBook(id: string): Promise<void>;
|
|
136
152
|
unwatchAddress(address: string): Promise<void>;
|
|
137
153
|
close(): Promise<void>;
|
|
154
|
+
fetchMarketMatches(params: any): Promise<any[]>;
|
|
155
|
+
fetchMatches(params: any): Promise<any[]>;
|
|
156
|
+
fetchEventMatches(params: any): Promise<any[]>;
|
|
157
|
+
compareMarketPrices(params: any): Promise<any[]>;
|
|
158
|
+
fetchHedges(params: any): Promise<any[]>;
|
|
159
|
+
fetchArbitrage(params?: any): Promise<any[]>;
|
|
138
160
|
/**
|
|
139
161
|
* Get historical price candles.
|
|
140
162
|
*
|