pmxtjs 2.50.15 → 2.50.16

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.
@@ -1015,6 +1015,19 @@ export class Exchange {
1015
1015
  }
1016
1016
  async fetchOpenOrders(marketId) {
1017
1017
  await this.initPromise;
1018
+ if (this.isHosted) {
1019
+ const resolvedAddress = resolveWalletAddress(this, undefined);
1020
+ const route = HOSTED_METHOD_ROUTES.get("fetchOpenOrders");
1021
+ const path = formatRoutePath(route, {});
1022
+ const params = { address: resolvedAddress };
1023
+ if (marketId !== undefined)
1024
+ params.market_id = marketId;
1025
+ const data = await _tradingRequest(this, { method: route.method, path, params });
1026
+ const list = Array.isArray(data)
1027
+ ? data
1028
+ : (data && Array.isArray(data.orders) ? data.orders : []);
1029
+ return list.map((o) => orderFromV0(o));
1030
+ }
1018
1031
  try {
1019
1032
  const args = [];
1020
1033
  if (marketId !== undefined)
@@ -1018,6 +1018,19 @@ class Exchange {
1018
1018
  }
1019
1019
  async fetchOpenOrders(marketId) {
1020
1020
  await this.initPromise;
1021
+ if (this.isHosted) {
1022
+ const resolvedAddress = (0, hosted_routing_js_1.resolveWalletAddress)(this, undefined);
1023
+ const route = hosted_routing_js_1.HOSTED_METHOD_ROUTES.get("fetchOpenOrders");
1024
+ const path = (0, hosted_routing_js_1.formatRoutePath)(route, {});
1025
+ const params = { address: resolvedAddress };
1026
+ if (marketId !== undefined)
1027
+ params.market_id = marketId;
1028
+ const data = await (0, hosted_routing_js_1._tradingRequest)(this, { method: route.method, path, params });
1029
+ const list = Array.isArray(data)
1030
+ ? data
1031
+ : (data && Array.isArray(data.orders) ? data.orders : []);
1032
+ return list.map((o) => (0, hosted_mappers_js_1.orderFromV0)(o));
1033
+ }
1021
1034
  try {
1022
1035
  const args = [];
1023
1036
  if (marketId !== undefined)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "2.50.15",
3
+ "version": "2.50.16",
4
4
  "description": "OpenAPI client for pmxtjs",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "2.50.15",
3
+ "version": "2.50.16",
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.50.15",
46
+ "pmxt-core": "2.50.16",
47
47
  "ws": "^8.18.0"
48
48
  },
49
49
  "peerDependencies": {
package/pmxt/client.ts CHANGED
@@ -1223,6 +1223,18 @@ export abstract class Exchange {
1223
1223
 
1224
1224
  async fetchOpenOrders(marketId?: string): Promise<Order[]> {
1225
1225
  await this.initPromise;
1226
+ if (this.isHosted) {
1227
+ const resolvedAddress = resolveWalletAddress(this, undefined);
1228
+ const route = HOSTED_METHOD_ROUTES.get("fetchOpenOrders")!;
1229
+ const path = formatRoutePath(route, {});
1230
+ const params: Record<string, string> = { address: resolvedAddress };
1231
+ if (marketId !== undefined) params.market_id = marketId;
1232
+ const data = await _tradingRequest(this, { method: route.method, path, params });
1233
+ const list = Array.isArray(data)
1234
+ ? data
1235
+ : (data && Array.isArray((data as any).orders) ? (data as any).orders : []);
1236
+ return list.map((o: unknown) => orderFromV0(o as Record<string, unknown>));
1237
+ }
1226
1238
  try {
1227
1239
  const args: any[] = [];
1228
1240
  if (marketId !== undefined) args.push(marketId);