pmxt-core 2.0.9 → 2.0.10
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.
|
@@ -3,13 +3,7 @@
|
|
|
3
3
|
* Polymarket WebSocket implementation for pmxt.
|
|
4
4
|
*
|
|
5
5
|
* NOTICE: This implementation depends on "@nevuamarkets/poly-websockets",
|
|
6
|
-
* which is licensed under the
|
|
7
|
-
*
|
|
8
|
-
* While pmxt is licensed under MIT, using these specific WebSocket methods
|
|
9
|
-
* may subject your application to the terms of the AGPL-3.0.
|
|
10
|
-
*
|
|
11
|
-
* If you must avoid AGPL-3.0, do not use the watchOrderBook() or
|
|
12
|
-
* watchTrades() methods for Polymarket.
|
|
6
|
+
* which is licensed under the MIT License.
|
|
13
7
|
*/
|
|
14
8
|
import { OrderBook, Trade } from '../../types';
|
|
15
9
|
export interface PolymarketWebSocketConfig {
|
|
@@ -4,13 +4,7 @@
|
|
|
4
4
|
* Polymarket WebSocket implementation for pmxt.
|
|
5
5
|
*
|
|
6
6
|
* NOTICE: This implementation depends on "@nevuamarkets/poly-websockets",
|
|
7
|
-
* which is licensed under the
|
|
8
|
-
*
|
|
9
|
-
* While pmxt is licensed under MIT, using these specific WebSocket methods
|
|
10
|
-
* may subject your application to the terms of the AGPL-3.0.
|
|
11
|
-
*
|
|
12
|
-
* If you must avoid AGPL-3.0, do not use the watchOrderBook() or
|
|
13
|
-
* watchTrades() methods for Polymarket.
|
|
7
|
+
* which is licensed under the MIT License.
|
|
14
8
|
*/
|
|
15
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -63,7 +57,7 @@ class PolymarketWebSocket {
|
|
|
63
57
|
return this.initializationPromise;
|
|
64
58
|
this.initializationPromise = (async () => {
|
|
65
59
|
try {
|
|
66
|
-
// Dynamic import to handle
|
|
60
|
+
// Dynamic import to handle optional dependency
|
|
67
61
|
const poly = await Promise.resolve().then(() => __importStar(require('@nevuamarkets/poly-websockets')));
|
|
68
62
|
this.manager = new poly.WSSubscriptionManager({
|
|
69
63
|
onBook: async (events) => {
|
|
@@ -92,7 +86,7 @@ class PolymarketWebSocket {
|
|
|
92
86
|
catch (e) {
|
|
93
87
|
const error = e;
|
|
94
88
|
if (error.message.includes('Cannot find module')) {
|
|
95
|
-
throw new Error('Polymarket WebSocket support requires the "@nevuamarkets/poly-websockets" package
|
|
89
|
+
throw new Error('Polymarket WebSocket support requires the "@nevuamarkets/poly-websockets" package.\n' +
|
|
96
90
|
'To use this feature, please install it: npm install @nevuamarkets/poly-websockets');
|
|
97
91
|
}
|
|
98
92
|
throw e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxt-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "pmxt is a unified prediction market data API. The ccxt for prediction markets.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"test": "jest -c jest.config.js",
|
|
30
30
|
"server": "tsx watch src/server/index.ts",
|
|
31
31
|
"server:prod": "node dist/server/index.js",
|
|
32
|
-
"generate:sdk:python": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g python -o ../sdks/python/generated --package-name pmxt_internal --additional-properties=projectName=pmxt-internal,packageVersion=2.0.
|
|
33
|
-
"generate:sdk:typescript": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g typescript-fetch -o ../sdks/typescript/generated --additional-properties=npmName=pmxtjs,npmVersion=2.0.
|
|
32
|
+
"generate:sdk:python": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g python -o ../sdks/python/generated --package-name pmxt_internal --additional-properties=projectName=pmxt-internal,packageVersion=2.0.10,library=urllib3",
|
|
33
|
+
"generate:sdk:typescript": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g typescript-fetch -o ../sdks/typescript/generated --additional-properties=npmName=pmxtjs,npmVersion=2.0.10,supportsES6=true,typescriptThreePlus=true && node ../sdks/typescript/scripts/fix-generated.js",
|
|
34
34
|
"extract:jsdoc": "node ../scripts/extract-jsdoc.js",
|
|
35
35
|
"generate:docs": "npm run extract:jsdoc && node ../scripts/generate-api-docs.js",
|
|
36
36
|
"generate:sdk:all": "npm run generate:sdk:python && npm run generate:sdk:typescript && npm run generate:docs"
|