diff --git a/core/src/exchanges/limitless/websocket.ts b/core/src/exchanges/limitless/websocket.ts index 9d75108f..61de1598 100644 --- a/core/src/exchanges/limitless/websocket.ts +++ b/core/src/exchanges/limitless/websocket.ts @@ -107,8 +107,8 @@ export class LimitlessWebSocket { await this.client.connect(); } - // Subscribe to market - await this.client.subscribe('orderbook', { marketSlugs: [marketSlug] }); + // Subscribe to market orderbook updates through the SDK market-price channel. + await this.client.subscribe('subscribe_market_prices', { marketSlugs: [marketSlug] }); if (callback) { this.orderbookCallbacks.set(marketSlug, callback); @@ -210,7 +210,7 @@ export class LimitlessWebSocket { } // Subscribe to market prices - await this.client.subscribe('prices', { marketAddresses: [marketAddress] }); + await this.client.subscribe('subscribe_market_prices', { marketAddresses: [marketAddress] }); this.priceCallbacks.set(marketAddress, callback); } @@ -228,11 +228,7 @@ export class LimitlessWebSocket { await this.client.connect(); } - await this.client.subscribe('orders'); // SDK uses 'orders' channel for user positional updates too? - // Actually, the channel type has 'subscribe_positions'. Let's check. - // Wait, I saw 'orders' in SubscriptionChannel. - // Let's use 'orders' as it's common for user data. - // Wait, I saw 'subscribe_positions' in the type. + await this.client.subscribe('subscribe_order_events'); await this.client.subscribe('subscribe_positions' as any); this.client.on('positions', callback); } @@ -272,11 +268,12 @@ export class LimitlessWebSocket { this.orderbookCallbacks.delete(marketSlugOrAddress); this.priceCallbacks.delete(marketSlugOrAddress); - // Unsubscribe from SDK - await this.client.unsubscribe('orderbook', { + // The current SDK only exposes explicit unsubscribe lifecycle channels; + // cast market-price unsubscribe channels until the SDK publishes them. + await this.client.unsubscribe('subscribe_market_prices' as any, { marketSlugs: [marketSlugOrAddress], }); - await this.client.unsubscribe('prices', { + await this.client.unsubscribe('subscribe_market_prices' as any, { marketAddresses: [marketSlugOrAddress], }); } diff --git a/docs/api-reference/openapi-hosted.json b/docs/api-reference/openapi-hosted.json index 089de254..1dab0137 100644 --- a/docs/api-reference/openapi-hosted.json +++ b/docs/api-reference/openapi-hosted.json @@ -3,7 +3,7 @@ "info": { "title": "PMXT Hosted Router API", "description": "Hosted-only endpoints for cross-venue search, matching, arbitrage, and SQL.", - "version": "bfa6308" + "version": "49fbcd4" }, "servers": [ { diff --git a/package-lock.json b/package-lock.json index dce615e5..0a76e41f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,8 @@ "dependencies": { "@types/cli-progress": "^3.11.6", "cli-progress": "^3.12.0", - "pmxtjs": "^2.17.1" + "pmxtjs": "^2.17.1", + "viem": "2.48.4" }, "devDependencies": { "concurrently": "^9.2.1" @@ -22,6 +23,7 @@ } }, "core": { + "name": "pmxt-core", "version": "2.17.1", "license": "MIT", "dependencies": { @@ -74,6 +76,26 @@ } } }, + "core/node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/@adraffy/ens-normalize": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz", @@ -7547,9 +7569,9 @@ } }, "node_modules/ox": { - "version": "0.14.29", - "resolved": "https://registry.npmjs.org/ox/-/ox-0.14.29.tgz", - "integrity": "sha512-M5j87Ec4V99MQdRct/g09eWXW60g6zhHTUs1lr4deUtrPDnezBdCJTgKd7pxqTpSZBFveV0ALi9jMMuT1qKyNg==", + "version": "0.14.20", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.14.20.tgz", + "integrity": "sha512-rby38C3nDn8eQkf29Zgw4hkCZJ64Qqi0zRPWL8ENUQ7JVuoITqrVtwWQgM/He19SCMUEc7hS/Sjw0jIOSLJhOw==", "funding": [ { "type": "github", @@ -9685,9 +9707,9 @@ } }, "node_modules/viem": { - "version": "2.52.2", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.52.2.tgz", - "integrity": "sha512-HSU12p5aD/kAPZfrlbCUqdiP4P/c6hQ9AhfTS51VbLUQIjkWd1d5EjrCx/SCxZ0zhZVRn4Iv5X5WDqXPG8Ubew==", + "version": "2.48.4", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.48.4.tgz", + "integrity": "sha512-mReP/rgY2P+WeeRSG4sUvccCLKfyAW1C73Y3KkobAqgzYmVna9qyUMNE44xIUkDtfvRuC33r24UhF4baBYovsg==", "funding": [ { "type": "github", @@ -9701,8 +9723,8 @@ "@scure/bip39": "1.6.0", "abitype": "1.2.3", "isows": "1.0.7", - "ox": "0.14.29", - "ws": "8.20.1" + "ox": "0.14.20", + "ws": "8.18.3" }, "peerDependencies": { "typescript": ">=5.0.4" @@ -9728,9 +9750,9 @@ } }, "node_modules/viem/node_modules/ws": { - "version": "8.20.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz", - "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==", + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "engines": { "node": ">=10.0.0" }, @@ -10039,6 +10061,7 @@ } }, "sdks/cli": { + "name": "@pmxt/cli", "version": "2.17.1", "dependencies": { "@oclif/core": "^4.11.4", @@ -10052,6 +10075,7 @@ } }, "sdks/typescript": { + "name": "pmxtjs", "version": "2.17.1", "dependencies": { "pmxt-core": "2.17.1", diff --git a/package.json b/package.json index 36e9aa94..1566b4c1 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,10 @@ "dependencies": { "@types/cli-progress": "^3.11.6", "cli-progress": "^3.12.0", - "pmxtjs": "^2.17.1" + "pmxtjs": "^2.17.1", + "viem": "2.48.4" + }, + "overrides": { + "viem": "2.48.4" } }