pmxtjs 2.50.14 → 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)
@@ -58,8 +58,7 @@ export declare function resolvePmxtBaseUrl(args: {
58
58
  */
59
59
  export declare const PREFUNDED_ESCROW_ADDRESSES: ReadonlySet<string>;
60
60
  /**
61
- * Lowercase 0x-prefixed escrow addresses that the hosted trading API treats
62
- * as venue-owned escrows. Currently empty; populated as venues onboard.
61
+ * Lowercase 0x-prefixed VenueEscrow addresses on BSC (chain 56).
63
62
  */
64
63
  export declare const VENUE_ESCROW_ADDRESSES: ReadonlySet<string>;
65
64
  /**
@@ -67,10 +67,11 @@ export const PREFUNDED_ESCROW_ADDRESSES = new Set([
67
67
  "0x3ad326f78b1390b9a5dc5f00e7f62f8632de23e2",
68
68
  ]);
69
69
  /**
70
- * Lowercase 0x-prefixed escrow addresses that the hosted trading API treats
71
- * as venue-owned escrows. Currently empty; populated as venues onboard.
70
+ * Lowercase 0x-prefixed VenueEscrow addresses on BSC (chain 56).
72
71
  */
73
- export const VENUE_ESCROW_ADDRESSES = new Set();
72
+ export const VENUE_ESCROW_ADDRESSES = new Set([
73
+ "0x6a273643d84edbb603b808d8a724fb963c7a298a",
74
+ ]);
74
75
  /**
75
76
  * Limitless VenueEscrow contract addresses on Base (chain 8453).
76
77
  */
@@ -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)
@@ -58,8 +58,7 @@ export declare function resolvePmxtBaseUrl(args: {
58
58
  */
59
59
  export declare const PREFUNDED_ESCROW_ADDRESSES: ReadonlySet<string>;
60
60
  /**
61
- * Lowercase 0x-prefixed escrow addresses that the hosted trading API treats
62
- * as venue-owned escrows. Currently empty; populated as venues onboard.
61
+ * Lowercase 0x-prefixed VenueEscrow addresses on BSC (chain 56).
63
62
  */
64
63
  export declare const VENUE_ESCROW_ADDRESSES: ReadonlySet<string>;
65
64
  /**
@@ -71,10 +71,11 @@ exports.PREFUNDED_ESCROW_ADDRESSES = new Set([
71
71
  "0x3ad326f78b1390b9a5dc5f00e7f62f8632de23e2",
72
72
  ]);
73
73
  /**
74
- * Lowercase 0x-prefixed escrow addresses that the hosted trading API treats
75
- * as venue-owned escrows. Currently empty; populated as venues onboard.
74
+ * Lowercase 0x-prefixed VenueEscrow addresses on BSC (chain 56).
76
75
  */
77
- exports.VENUE_ESCROW_ADDRESSES = new Set();
76
+ exports.VENUE_ESCROW_ADDRESSES = new Set([
77
+ "0x6a273643d84edbb603b808d8a724fb963c7a298a",
78
+ ]);
78
79
  /**
79
80
  * Limitless VenueEscrow contract addresses on Base (chain 8453).
80
81
  */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxtjs",
3
- "version": "2.50.14",
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.14",
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.14",
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);
package/pmxt/constants.ts CHANGED
@@ -76,10 +76,11 @@ export const PREFUNDED_ESCROW_ADDRESSES: ReadonlySet<string> = new Set([
76
76
  ]);
77
77
 
78
78
  /**
79
- * Lowercase 0x-prefixed escrow addresses that the hosted trading API treats
80
- * as venue-owned escrows. Currently empty; populated as venues onboard.
79
+ * Lowercase 0x-prefixed VenueEscrow addresses on BSC (chain 56).
81
80
  */
82
- export const VENUE_ESCROW_ADDRESSES: ReadonlySet<string> = new Set<string>();
81
+ export const VENUE_ESCROW_ADDRESSES: ReadonlySet<string> = new Set<string>([
82
+ "0x6a273643d84edbb603b808d8a724fb963c7a298a",
83
+ ]);
83
84
 
84
85
  /**
85
86
  * Limitless VenueEscrow contract addresses on Base (chain 8453).