@proton/wrap-constants 0.2.85 → 0.2.87

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/index.d.ts CHANGED
@@ -6529,16 +6529,19 @@ declare const getOpenOrdersParser: z.ZodObject<{
6529
6529
  symbol: z.ZodOptional<z.ZodString>;
6530
6530
  offset: z.ZodDefault<z.ZodString>;
6531
6531
  limit: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
6532
+ ordinal_order_id: z.ZodOptional<z.ZodString>;
6532
6533
  }, "strip", z.ZodTypeAny, {
6533
6534
  account: string;
6534
6535
  limit: string;
6535
6536
  offset: string;
6536
6537
  symbol?: string | undefined;
6538
+ ordinal_order_id?: string | undefined;
6537
6539
  }, {
6538
6540
  account: string;
6539
6541
  symbol?: string | undefined;
6540
6542
  offset?: string | undefined;
6541
6543
  limit?: string | undefined;
6544
+ ordinal_order_id?: string | undefined;
6542
6545
  }>;
6543
6546
  declare type GetOpenOrders = z.infer<typeof getOpenOrdersParser>;
6544
6547
  declare const getOpenOrdersResponseParser: z.ZodObject<{
@@ -6665,6 +6668,7 @@ declare const getOrderHistoryParser: z.ZodObject<{
6665
6668
  symbol: z.ZodOptional<z.ZodString>;
6666
6669
  offset: z.ZodDefault<z.ZodString>;
6667
6670
  limit: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
6671
+ ordinal_order_id: z.ZodOptional<z.ZodString>;
6668
6672
  trx_id: z.ZodOptional<z.ZodString>;
6669
6673
  status: z.ZodOptional<z.ZodString>;
6670
6674
  }, "strip", z.ZodTypeAny, {
@@ -6672,6 +6676,7 @@ declare const getOrderHistoryParser: z.ZodObject<{
6672
6676
  limit: string;
6673
6677
  offset: string;
6674
6678
  symbol?: string | undefined;
6679
+ ordinal_order_id?: string | undefined;
6675
6680
  trx_id?: string | undefined;
6676
6681
  status?: string | undefined;
6677
6682
  }, {
@@ -6679,6 +6684,7 @@ declare const getOrderHistoryParser: z.ZodObject<{
6679
6684
  symbol?: string | undefined;
6680
6685
  offset?: string | undefined;
6681
6686
  limit?: string | undefined;
6687
+ ordinal_order_id?: string | undefined;
6682
6688
  trx_id?: string | undefined;
6683
6689
  status?: string | undefined;
6684
6690
  }>;
@@ -7607,16 +7613,19 @@ declare const getTradeHistoryParser: z.ZodObject<{
7607
7613
  account: z.ZodString;
7608
7614
  symbol: z.ZodOptional<z.ZodString>;
7609
7615
  offset: z.ZodDefault<z.ZodString>;
7616
+ ordinal_order_id: z.ZodOptional<z.ZodString>;
7610
7617
  limit: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
7611
7618
  }, "strip", z.ZodTypeAny, {
7612
7619
  account: string;
7613
7620
  limit: string;
7614
7621
  offset: string;
7615
7622
  symbol?: string | undefined;
7623
+ ordinal_order_id?: string | undefined;
7616
7624
  }, {
7617
7625
  account: string;
7618
7626
  symbol?: string | undefined;
7619
7627
  offset?: string | undefined;
7628
+ ordinal_order_id?: string | undefined;
7620
7629
  limit?: string | undefined;
7621
7630
  }>;
7622
7631
  declare type GetTradeHistory = z.infer<typeof getTradeHistoryParser>;
package/dist/index.js CHANGED
@@ -1829,6 +1829,7 @@ var wrapParser = z10.object({
1829
1829
 
1830
1830
  // src/parsers/dex.ts
1831
1831
  var z11 = __toESM(require("zod"));
1832
+ var createLimit = (def, max) => z11.string().default(String(def)).refine((n) => +n <= max, "Max limit is 250");
1832
1833
  var ohlcvParser = z11.object({
1833
1834
  time: z11.number(),
1834
1835
  open: z11.number(),
@@ -1844,7 +1845,7 @@ var getOhlcvParser = z11.object({
1844
1845
  from: z11.string(),
1845
1846
  to: z11.string(),
1846
1847
  symbol: z11.string(),
1847
- limit: z11.string().default("500").refine((n) => +n <= 1e3, "Max limit is 1000")
1848
+ limit: createLimit(500, 1e3)
1848
1849
  });
1849
1850
  var getOhlcvResponseParser = z11.object({
1850
1851
  sync: z11.number(),
@@ -1876,7 +1877,8 @@ var getOpenOrdersParser = z11.object({
1876
1877
  account: z11.string(),
1877
1878
  symbol: z11.string().optional(),
1878
1879
  offset: z11.string().default("0"),
1879
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250")
1880
+ limit: createLimit(100, 250),
1881
+ ordinal_order_id: z11.string().optional()
1880
1882
  });
1881
1883
  var getOpenOrdersResponseParser = z11.object({
1882
1884
  sync: z11.number(),
@@ -1887,7 +1889,8 @@ var getOrderHistoryParser = z11.object({
1887
1889
  account: z11.string(),
1888
1890
  symbol: z11.string().optional(),
1889
1891
  offset: z11.string().default("0"),
1890
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250"),
1892
+ limit: createLimit(100, 250),
1893
+ ordinal_order_id: z11.string().optional(),
1891
1894
  trx_id: z11.string().optional(),
1892
1895
  status: z11.string().optional()
1893
1896
  });
@@ -1925,7 +1928,7 @@ var depthParser = z11.object({
1925
1928
  var getDepthParser = z11.object({
1926
1929
  symbol: z11.string(),
1927
1930
  step: z11.string(),
1928
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250")
1931
+ limit: createLimit(100, 250)
1929
1932
  });
1930
1933
  var getDepthResponseParser = z11.object({
1931
1934
  sync: z11.number(),
@@ -1998,7 +2001,7 @@ var tradeParser = z11.object({
1998
2001
  var getTradesParser = z11.object({
1999
2002
  symbol: z11.string(),
2000
2003
  offset: z11.string().default("0"),
2001
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250")
2004
+ limit: createLimit(100, 250)
2002
2005
  });
2003
2006
  var getTradesResponseParser = z11.object({
2004
2007
  sync: z11.number(),
@@ -2008,7 +2011,8 @@ var getTradeHistoryParser = z11.object({
2008
2011
  account: z11.string(),
2009
2012
  symbol: z11.string().optional(),
2010
2013
  offset: z11.string().default("0"),
2011
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250")
2014
+ ordinal_order_id: z11.string().optional(),
2015
+ limit: createLimit(100, 250)
2012
2016
  });
2013
2017
  var getTradeHistoryResponseParser = z11.object({
2014
2018
  sync: z11.number(),
package/dist/index.mjs CHANGED
@@ -1699,6 +1699,7 @@ var wrapParser = z10.object({
1699
1699
 
1700
1700
  // src/parsers/dex.ts
1701
1701
  import * as z11 from "zod";
1702
+ var createLimit = (def, max) => z11.string().default(String(def)).refine((n) => +n <= max, "Max limit is 250");
1702
1703
  var ohlcvParser = z11.object({
1703
1704
  time: z11.number(),
1704
1705
  open: z11.number(),
@@ -1714,7 +1715,7 @@ var getOhlcvParser = z11.object({
1714
1715
  from: z11.string(),
1715
1716
  to: z11.string(),
1716
1717
  symbol: z11.string(),
1717
- limit: z11.string().default("500").refine((n) => +n <= 1e3, "Max limit is 1000")
1718
+ limit: createLimit(500, 1e3)
1718
1719
  });
1719
1720
  var getOhlcvResponseParser = z11.object({
1720
1721
  sync: z11.number(),
@@ -1746,7 +1747,8 @@ var getOpenOrdersParser = z11.object({
1746
1747
  account: z11.string(),
1747
1748
  symbol: z11.string().optional(),
1748
1749
  offset: z11.string().default("0"),
1749
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250")
1750
+ limit: createLimit(100, 250),
1751
+ ordinal_order_id: z11.string().optional()
1750
1752
  });
1751
1753
  var getOpenOrdersResponseParser = z11.object({
1752
1754
  sync: z11.number(),
@@ -1757,7 +1759,8 @@ var getOrderHistoryParser = z11.object({
1757
1759
  account: z11.string(),
1758
1760
  symbol: z11.string().optional(),
1759
1761
  offset: z11.string().default("0"),
1760
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250"),
1762
+ limit: createLimit(100, 250),
1763
+ ordinal_order_id: z11.string().optional(),
1761
1764
  trx_id: z11.string().optional(),
1762
1765
  status: z11.string().optional()
1763
1766
  });
@@ -1795,7 +1798,7 @@ var depthParser = z11.object({
1795
1798
  var getDepthParser = z11.object({
1796
1799
  symbol: z11.string(),
1797
1800
  step: z11.string(),
1798
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250")
1801
+ limit: createLimit(100, 250)
1799
1802
  });
1800
1803
  var getDepthResponseParser = z11.object({
1801
1804
  sync: z11.number(),
@@ -1868,7 +1871,7 @@ var tradeParser = z11.object({
1868
1871
  var getTradesParser = z11.object({
1869
1872
  symbol: z11.string(),
1870
1873
  offset: z11.string().default("0"),
1871
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250")
1874
+ limit: createLimit(100, 250)
1872
1875
  });
1873
1876
  var getTradesResponseParser = z11.object({
1874
1877
  sync: z11.number(),
@@ -1878,7 +1881,8 @@ var getTradeHistoryParser = z11.object({
1878
1881
  account: z11.string(),
1879
1882
  symbol: z11.string().optional(),
1880
1883
  offset: z11.string().default("0"),
1881
- limit: z11.string().default("100").refine((n) => +n <= 250, "Max limit is 250")
1884
+ ordinal_order_id: z11.string().optional(),
1885
+ limit: createLimit(100, 250)
1882
1886
  });
1883
1887
  var getTradeHistoryResponseParser = z11.object({
1884
1888
  sync: z11.number(),
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.2.85",
8
+ "version": "0.2.87",
9
9
  "license": "MIT",
10
10
  "main": "dist/index.js",
11
11
  "typings": "dist/index.d.ts",
@@ -40,5 +40,5 @@
40
40
  "resolutions": {
41
41
  "typescript": "4.5"
42
42
  },
43
- "gitHead": "92a54998b8c7f2323a563855abcd4eb1d2fef474"
43
+ "gitHead": "dfc34f84bfebfb81c7b0168ed5685bef07c45e6f"
44
44
  }
@@ -1,5 +1,11 @@
1
1
  import * as z from "zod";
2
2
 
3
+ const createLimit = (def: number, max: number) =>
4
+ z
5
+ .string()
6
+ .default(String(def))
7
+ .refine((n) => +n <= max, "Max limit is 250");
8
+
3
9
  /**
4
10
  * OHLCV
5
11
  */
@@ -20,10 +26,7 @@ export const getOhlcvParser = z.object({
20
26
  from: z.string(),
21
27
  to: z.string(),
22
28
  symbol: z.string(),
23
- limit: z
24
- .string()
25
- .default("500")
26
- .refine((n) => +n <= 1000, "Max limit is 1000"),
29
+ limit: createLimit(500, 1000),
27
30
  });
28
31
  export type GetOHLCV = z.infer<typeof getOhlcvParser>;
29
32
 
@@ -64,10 +67,8 @@ export const getOpenOrdersParser = z.object({
64
67
  account: z.string(),
65
68
  symbol: z.string().optional(),
66
69
  offset: z.string().default("0"),
67
- limit: z
68
- .string()
69
- .default("100")
70
- .refine((n) => +n <= 250, "Max limit is 250"),
70
+ limit: createLimit(100, 250),
71
+ ordinal_order_id: z.string().optional(),
71
72
  });
72
73
  export type GetOpenOrders = z.infer<typeof getOpenOrdersParser>;
73
74
 
@@ -82,10 +83,8 @@ export const getOrderHistoryParser = z.object({
82
83
  account: z.string(),
83
84
  symbol: z.string().optional(),
84
85
  offset: z.string().default("0"),
85
- limit: z
86
- .string()
87
- .default("100")
88
- .refine((n) => +n <= 250, "Max limit is 250"),
86
+ limit: createLimit(100, 250),
87
+ ordinal_order_id: z.string().optional(),
89
88
  trx_id: z.string().optional(),
90
89
  status: z.string().optional(),
91
90
  });
@@ -144,10 +143,7 @@ export type Depth = z.infer<typeof depthParser>;
144
143
  export const getDepthParser = z.object({
145
144
  symbol: z.string(),
146
145
  step: z.string(),
147
- limit: z
148
- .string()
149
- .default("100")
150
- .refine((n) => +n <= 250, "Max limit is 250"),
146
+ limit: createLimit(100, 250),
151
147
  });
152
148
  export type GetDepth = z.infer<typeof getDepthParser>;
153
149
 
@@ -243,10 +239,7 @@ export type Trade = z.infer<typeof tradeParser>;
243
239
  export const getTradesParser = z.object({
244
240
  symbol: z.string(),
245
241
  offset: z.string().default("0"),
246
- limit: z
247
- .string()
248
- .default("100")
249
- .refine((n) => +n <= 250, "Max limit is 250"),
242
+ limit: createLimit(100, 250),
250
243
  });
251
244
  export type GetTrades = z.infer<typeof getTradesParser>;
252
245
 
@@ -260,10 +253,8 @@ export const getTradeHistoryParser = z.object({
260
253
  account: z.string(),
261
254
  symbol: z.string().optional(),
262
255
  offset: z.string().default("0"),
263
- limit: z
264
- .string()
265
- .default("100")
266
- .refine((n) => +n <= 250, "Max limit is 250"),
256
+ ordinal_order_id: z.string().optional(),
257
+ limit: createLimit(100, 250),
267
258
  });
268
259
  export type GetTradeHistory = z.infer<typeof getTradeHistoryParser>;
269
260