pmxtjs 1.1.3 → 1.2.0

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.
@@ -94,6 +94,30 @@ export interface UnifiedMarket {
94
94
  * @memberof UnifiedMarket
95
95
  */
96
96
  tags?: Array<string>;
97
+ /**
98
+ *
99
+ * @type {MarketOutcome}
100
+ * @memberof UnifiedMarket
101
+ */
102
+ yes?: MarketOutcome;
103
+ /**
104
+ *
105
+ * @type {MarketOutcome}
106
+ * @memberof UnifiedMarket
107
+ */
108
+ no?: MarketOutcome;
109
+ /**
110
+ *
111
+ * @type {MarketOutcome}
112
+ * @memberof UnifiedMarket
113
+ */
114
+ up?: MarketOutcome;
115
+ /**
116
+ *
117
+ * @type {MarketOutcome}
118
+ * @memberof UnifiedMarket
119
+ */
120
+ down?: MarketOutcome;
97
121
  }
98
122
  /**
99
123
  * Check if a given object implements the UnifiedMarket interface.
@@ -39,6 +39,10 @@ export function UnifiedMarketFromJSONTyped(json, ignoreDiscriminator) {
39
39
  'image': json['image'] == null ? undefined : json['image'],
40
40
  'category': json['category'] == null ? undefined : json['category'],
41
41
  'tags': json['tags'] == null ? undefined : json['tags'],
42
+ 'yes': json['yes'] == null ? undefined : MarketOutcomeFromJSON(json['yes']),
43
+ 'no': json['no'] == null ? undefined : MarketOutcomeFromJSON(json['no']),
44
+ 'up': json['up'] == null ? undefined : MarketOutcomeFromJSON(json['up']),
45
+ 'down': json['down'] == null ? undefined : MarketOutcomeFromJSON(json['down']),
42
46
  };
43
47
  }
44
48
  export function UnifiedMarketToJSON(json) {
@@ -62,5 +66,9 @@ export function UnifiedMarketToJSONTyped(value, ignoreDiscriminator = false) {
62
66
  'image': value['image'],
63
67
  'category': value['category'],
64
68
  'tags': value['tags'],
69
+ 'yes': MarketOutcomeToJSON(value['yes']),
70
+ 'no': MarketOutcomeToJSON(value['no']),
71
+ 'up': MarketOutcomeToJSON(value['up']),
72
+ 'down': MarketOutcomeToJSON(value['down']),
65
73
  };
66
74
  }
@@ -15,6 +15,13 @@ function convertMarket(raw) {
15
15
  priceChange24h: o.priceChange24h,
16
16
  metadata: o.metadata,
17
17
  }));
18
+ const convertOutcome = (o) => o ? ({
19
+ id: o.id,
20
+ label: o.label,
21
+ price: o.price,
22
+ priceChange24h: o.priceChange24h,
23
+ metadata: o.metadata,
24
+ }) : undefined;
18
25
  return {
19
26
  id: raw.id,
20
27
  title: raw.title,
@@ -29,6 +36,10 @@ function convertMarket(raw) {
29
36
  image: raw.image,
30
37
  category: raw.category,
31
38
  tags: raw.tags,
39
+ yes: convertOutcome(raw.yes),
40
+ no: convertOutcome(raw.no),
41
+ up: convertOutcome(raw.up),
42
+ down: convertOutcome(raw.down),
32
43
  };
33
44
  }
34
45
  function convertCandle(raw) {
@@ -52,6 +52,14 @@ export interface UnifiedMarket {
52
52
  category?: string;
53
53
  /** Market tags */
54
54
  tags?: string[];
55
+ /** Convenience access to the Yes outcome for binary markets. */
56
+ yes?: MarketOutcome;
57
+ /** Convenience access to the No outcome for binary markets. */
58
+ no?: MarketOutcome;
59
+ /** Convenience access to the Up outcome for binary markets. */
60
+ up?: MarketOutcome;
61
+ /** Convenience access to the Down outcome for binary markets. */
62
+ down?: MarketOutcome;
55
63
  }
56
64
  /**
57
65
  * OHLCV price candle.
@@ -94,6 +94,30 @@ export interface UnifiedMarket {
94
94
  * @memberof UnifiedMarket
95
95
  */
96
96
  tags?: Array<string>;
97
+ /**
98
+ *
99
+ * @type {MarketOutcome}
100
+ * @memberof UnifiedMarket
101
+ */
102
+ yes?: MarketOutcome;
103
+ /**
104
+ *
105
+ * @type {MarketOutcome}
106
+ * @memberof UnifiedMarket
107
+ */
108
+ no?: MarketOutcome;
109
+ /**
110
+ *
111
+ * @type {MarketOutcome}
112
+ * @memberof UnifiedMarket
113
+ */
114
+ up?: MarketOutcome;
115
+ /**
116
+ *
117
+ * @type {MarketOutcome}
118
+ * @memberof UnifiedMarket
119
+ */
120
+ down?: MarketOutcome;
97
121
  }
98
122
  /**
99
123
  * Check if a given object implements the UnifiedMarket interface.
@@ -46,6 +46,10 @@ function UnifiedMarketFromJSONTyped(json, ignoreDiscriminator) {
46
46
  'image': json['image'] == null ? undefined : json['image'],
47
47
  'category': json['category'] == null ? undefined : json['category'],
48
48
  'tags': json['tags'] == null ? undefined : json['tags'],
49
+ 'yes': json['yes'] == null ? undefined : (0, MarketOutcome_1.MarketOutcomeFromJSON)(json['yes']),
50
+ 'no': json['no'] == null ? undefined : (0, MarketOutcome_1.MarketOutcomeFromJSON)(json['no']),
51
+ 'up': json['up'] == null ? undefined : (0, MarketOutcome_1.MarketOutcomeFromJSON)(json['up']),
52
+ 'down': json['down'] == null ? undefined : (0, MarketOutcome_1.MarketOutcomeFromJSON)(json['down']),
49
53
  };
50
54
  }
51
55
  function UnifiedMarketToJSON(json) {
@@ -69,5 +73,9 @@ function UnifiedMarketToJSONTyped(value, ignoreDiscriminator = false) {
69
73
  'image': value['image'],
70
74
  'category': value['category'],
71
75
  'tags': value['tags'],
76
+ 'yes': (0, MarketOutcome_1.MarketOutcomeToJSON)(value['yes']),
77
+ 'no': (0, MarketOutcome_1.MarketOutcomeToJSON)(value['no']),
78
+ 'up': (0, MarketOutcome_1.MarketOutcomeToJSON)(value['up']),
79
+ 'down': (0, MarketOutcome_1.MarketOutcomeToJSON)(value['down']),
72
80
  };
73
81
  }
@@ -18,6 +18,13 @@ function convertMarket(raw) {
18
18
  priceChange24h: o.priceChange24h,
19
19
  metadata: o.metadata,
20
20
  }));
21
+ const convertOutcome = (o) => o ? ({
22
+ id: o.id,
23
+ label: o.label,
24
+ price: o.price,
25
+ priceChange24h: o.priceChange24h,
26
+ metadata: o.metadata,
27
+ }) : undefined;
21
28
  return {
22
29
  id: raw.id,
23
30
  title: raw.title,
@@ -32,6 +39,10 @@ function convertMarket(raw) {
32
39
  image: raw.image,
33
40
  category: raw.category,
34
41
  tags: raw.tags,
42
+ yes: convertOutcome(raw.yes),
43
+ no: convertOutcome(raw.no),
44
+ up: convertOutcome(raw.up),
45
+ down: convertOutcome(raw.down),
35
46
  };
36
47
  }
37
48
  function convertCandle(raw) {
@@ -52,6 +52,14 @@ export interface UnifiedMarket {
52
52
  category?: string;
53
53
  /** Market tags */
54
54
  tags?: string[];
55
+ /** Convenience access to the Yes outcome for binary markets. */
56
+ yes?: MarketOutcome;
57
+ /** Convenience access to the No outcome for binary markets. */
58
+ no?: MarketOutcome;
59
+ /** Convenience access to the Up outcome for binary markets. */
60
+ up?: MarketOutcome;
61
+ /** Convenience access to the Down outcome for binary markets. */
62
+ down?: MarketOutcome;
55
63
  }
56
64
  /**
57
65
  * OHLCV price candle.
@@ -19,6 +19,10 @@ Name | Type
19
19
  `image` | string
20
20
  `category` | string
21
21
  `tags` | Array&lt;string&gt;
22
+ `yes` | [MarketOutcome](MarketOutcome.md)
23
+ `no` | [MarketOutcome](MarketOutcome.md)
24
+ `up` | [MarketOutcome](MarketOutcome.md)
25
+ `down` | [MarketOutcome](MarketOutcome.md)
22
26
 
23
27
  ## Example
24
28
 
@@ -40,6 +44,10 @@ const example = {
40
44
  "image": null,
41
45
  "category": null,
42
46
  "tags": null,
47
+ "yes": null,
48
+ "no": null,
49
+ "up": null,
50
+ "down": null,
43
51
  } satisfies UnifiedMarket
44
52
 
45
53
  console.log(example)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "OpenAPI client for pmxtjs",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -105,6 +105,30 @@ export interface UnifiedMarket {
105
105
  * @memberof UnifiedMarket
106
106
  */
107
107
  tags?: Array<string>;
108
+ /**
109
+ *
110
+ * @type {MarketOutcome}
111
+ * @memberof UnifiedMarket
112
+ */
113
+ yes?: MarketOutcome;
114
+ /**
115
+ *
116
+ * @type {MarketOutcome}
117
+ * @memberof UnifiedMarket
118
+ */
119
+ no?: MarketOutcome;
120
+ /**
121
+ *
122
+ * @type {MarketOutcome}
123
+ * @memberof UnifiedMarket
124
+ */
125
+ up?: MarketOutcome;
126
+ /**
127
+ *
128
+ * @type {MarketOutcome}
129
+ * @memberof UnifiedMarket
130
+ */
131
+ down?: MarketOutcome;
108
132
  }
109
133
 
110
134
  /**
@@ -137,6 +161,10 @@ export function UnifiedMarketFromJSONTyped(json: any, ignoreDiscriminator: boole
137
161
  'image': json['image'] == null ? undefined : json['image'],
138
162
  'category': json['category'] == null ? undefined : json['category'],
139
163
  'tags': json['tags'] == null ? undefined : json['tags'],
164
+ 'yes': json['yes'] == null ? undefined : MarketOutcomeFromJSON(json['yes']),
165
+ 'no': json['no'] == null ? undefined : MarketOutcomeFromJSON(json['no']),
166
+ 'up': json['up'] == null ? undefined : MarketOutcomeFromJSON(json['up']),
167
+ 'down': json['down'] == null ? undefined : MarketOutcomeFromJSON(json['down']),
140
168
  };
141
169
  }
142
170
 
@@ -164,6 +192,10 @@ export function UnifiedMarketToJSONTyped(value?: UnifiedMarket | null, ignoreDis
164
192
  'image': value['image'],
165
193
  'category': value['category'],
166
194
  'tags': value['tags'],
195
+ 'yes': MarketOutcomeToJSON(value['yes']),
196
+ 'no': MarketOutcomeToJSON(value['no']),
197
+ 'up': MarketOutcomeToJSON(value['up']),
198
+ 'down': MarketOutcomeToJSON(value['down']),
167
199
  };
168
200
  }
169
201
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Unified prediction market data API - The ccxt for prediction markets",
5
5
  "author": "PMXT Contributors",
6
6
  "repository": {
@@ -42,7 +42,7 @@
42
42
  "unified"
43
43
  ],
44
44
  "dependencies": {
45
- "pmxt-core": "1.1.3"
45
+ "pmxt-core": "1.2.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/jest": "^30.0.0",
package/pmxt/client.ts CHANGED
@@ -48,6 +48,14 @@ function convertMarket(raw: any): UnifiedMarket {
48
48
  metadata: o.metadata,
49
49
  }));
50
50
 
51
+ const convertOutcome = (o: any) => o ? ({
52
+ id: o.id,
53
+ label: o.label,
54
+ price: o.price,
55
+ priceChange24h: o.priceChange24h,
56
+ metadata: o.metadata,
57
+ }) : undefined;
58
+
51
59
  return {
52
60
  id: raw.id,
53
61
  title: raw.title,
@@ -62,9 +70,14 @@ function convertMarket(raw: any): UnifiedMarket {
62
70
  image: raw.image,
63
71
  category: raw.category,
64
72
  tags: raw.tags,
73
+ yes: convertOutcome(raw.yes),
74
+ no: convertOutcome(raw.no),
75
+ up: convertOutcome(raw.up),
76
+ down: convertOutcome(raw.down),
65
77
  };
66
78
  }
67
79
 
80
+
68
81
  function convertCandle(raw: any): PriceCandle {
69
82
  return {
70
83
  timestamp: raw.timestamp,
package/pmxt/models.ts CHANGED
@@ -70,6 +70,18 @@ export interface UnifiedMarket {
70
70
 
71
71
  /** Market tags */
72
72
  tags?: string[];
73
+
74
+ /** Convenience access to the Yes outcome for binary markets. */
75
+ yes?: MarketOutcome;
76
+
77
+ /** Convenience access to the No outcome for binary markets. */
78
+ no?: MarketOutcome;
79
+
80
+ /** Convenience access to the Up outcome for binary markets. */
81
+ up?: MarketOutcome;
82
+
83
+ /** Convenience access to the Down outcome for binary markets. */
84
+ down?: MarketOutcome;
73
85
  }
74
86
 
75
87
  /**