pmxtjs 2.17.1 → 2.17.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.js +6 -1
- package/dist/esm/pmxt/models.d.ts +2 -0
- package/dist/pmxt/client.js +6 -1
- package/dist/pmxt/models.d.ts +2 -0
- package/generated/package.json +1 -1
- package/package.json +2 -2
- package/pmxt/client.ts +8 -1
- package/pmxt/models.ts +3 -0
package/dist/esm/pmxt/client.js
CHANGED
|
@@ -129,7 +129,7 @@ function convertUserTrade(raw) {
|
|
|
129
129
|
}
|
|
130
130
|
function convertEvent(raw) {
|
|
131
131
|
const markets = MarketList.from((raw.markets || []).map(convertMarket));
|
|
132
|
-
|
|
132
|
+
const event = {
|
|
133
133
|
id: raw.id,
|
|
134
134
|
title: raw.title,
|
|
135
135
|
description: raw.description,
|
|
@@ -140,6 +140,11 @@ function convertEvent(raw) {
|
|
|
140
140
|
category: raw.category,
|
|
141
141
|
tags: raw.tags,
|
|
142
142
|
};
|
|
143
|
+
// Add bi-directional navigation
|
|
144
|
+
for (const market of markets) {
|
|
145
|
+
market.event = event;
|
|
146
|
+
}
|
|
147
|
+
return event;
|
|
143
148
|
}
|
|
144
149
|
/**
|
|
145
150
|
* Base class for prediction market exchanges.
|
|
@@ -54,6 +54,8 @@ export interface UnifiedMarket {
|
|
|
54
54
|
category?: string;
|
|
55
55
|
/** Market tags */
|
|
56
56
|
tags?: string[];
|
|
57
|
+
/** Parent event reference */
|
|
58
|
+
event?: UnifiedEvent;
|
|
57
59
|
/** Convenience access to the Yes outcome for binary markets. */
|
|
58
60
|
yes?: MarketOutcome;
|
|
59
61
|
/** Convenience access to the No outcome for binary markets. */
|
package/dist/pmxt/client.js
CHANGED
|
@@ -132,7 +132,7 @@ function convertUserTrade(raw) {
|
|
|
132
132
|
}
|
|
133
133
|
function convertEvent(raw) {
|
|
134
134
|
const markets = models_js_1.MarketList.from((raw.markets || []).map(convertMarket));
|
|
135
|
-
|
|
135
|
+
const event = {
|
|
136
136
|
id: raw.id,
|
|
137
137
|
title: raw.title,
|
|
138
138
|
description: raw.description,
|
|
@@ -143,6 +143,11 @@ function convertEvent(raw) {
|
|
|
143
143
|
category: raw.category,
|
|
144
144
|
tags: raw.tags,
|
|
145
145
|
};
|
|
146
|
+
// Add bi-directional navigation
|
|
147
|
+
for (const market of markets) {
|
|
148
|
+
market.event = event;
|
|
149
|
+
}
|
|
150
|
+
return event;
|
|
146
151
|
}
|
|
147
152
|
/**
|
|
148
153
|
* Base class for prediction market exchanges.
|
package/dist/pmxt/models.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ export interface UnifiedMarket {
|
|
|
54
54
|
category?: string;
|
|
55
55
|
/** Market tags */
|
|
56
56
|
tags?: string[];
|
|
57
|
+
/** Parent event reference */
|
|
58
|
+
event?: UnifiedEvent;
|
|
57
59
|
/** Convenience access to the Yes outcome for binary markets. */
|
|
58
60
|
yes?: MarketOutcome;
|
|
59
61
|
/** Convenience access to the No outcome for binary markets. */
|
package/generated/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmxtjs",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.3",
|
|
4
4
|
"description": "Unified prediction market data API - The ccxt for prediction markets",
|
|
5
5
|
"author": "PMXT Contributors",
|
|
6
6
|
"repository": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"unified"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"pmxt-core": "2.17.
|
|
46
|
+
"pmxt-core": "2.17.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/jest": "^30.0.0",
|
package/pmxt/client.ts
CHANGED
|
@@ -174,7 +174,7 @@ function convertUserTrade(raw: any): UserTrade {
|
|
|
174
174
|
function convertEvent(raw: any): UnifiedEvent {
|
|
175
175
|
const markets = MarketList.from((raw.markets || []).map(convertMarket)) as MarketList;
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
const event: UnifiedEvent = {
|
|
178
178
|
id: raw.id,
|
|
179
179
|
title: raw.title,
|
|
180
180
|
description: raw.description,
|
|
@@ -185,6 +185,13 @@ function convertEvent(raw: any): UnifiedEvent {
|
|
|
185
185
|
category: raw.category,
|
|
186
186
|
tags: raw.tags,
|
|
187
187
|
};
|
|
188
|
+
|
|
189
|
+
// Add bi-directional navigation
|
|
190
|
+
for (const market of markets) {
|
|
191
|
+
market.event = event;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return event;
|
|
188
195
|
}
|
|
189
196
|
|
|
190
197
|
/**
|
package/pmxt/models.ts
CHANGED