@proton/wrap-constants 0.2.122 → 0.2.124

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
@@ -6600,13 +6600,13 @@ declare const getOpenOrdersParser: z.ZodObject<{
6600
6600
  symbol: z.ZodOptional<z.ZodString>;
6601
6601
  offset: z.ZodDefault<z.ZodNumber>;
6602
6602
  limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
6603
- ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
6603
+ ordinal_order_ids: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>, string[], string | string[] | undefined>;
6604
6604
  }, "strip", z.ZodTypeAny, {
6605
6605
  account: string;
6606
6606
  limit: number;
6607
6607
  offset: number;
6608
+ ordinal_order_ids: string[];
6608
6609
  symbol?: string | undefined;
6609
- ordinal_order_ids?: string | string[] | undefined;
6610
6610
  }, {
6611
6611
  account: string;
6612
6612
  symbol?: string | undefined;
@@ -6729,15 +6729,15 @@ declare const getOrderHistoryParser: z.ZodObject<{
6729
6729
  symbol: z.ZodOptional<z.ZodString>;
6730
6730
  offset: z.ZodDefault<z.ZodNumber>;
6731
6731
  limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
6732
- ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
6732
+ ordinal_order_ids: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>, string[], string | string[] | undefined>;
6733
6733
  trx_id: z.ZodOptional<z.ZodString>;
6734
6734
  status: z.ZodOptional<z.ZodString>;
6735
6735
  }, "strip", z.ZodTypeAny, {
6736
6736
  account: string;
6737
6737
  limit: number;
6738
6738
  offset: number;
6739
+ ordinal_order_ids: string[];
6739
6740
  symbol?: string | undefined;
6740
- ordinal_order_ids?: string | string[] | undefined;
6741
6741
  trx_id?: string | undefined;
6742
6742
  status?: string | undefined;
6743
6743
  }, {
@@ -7197,15 +7197,15 @@ declare const depthParser: z.ZodObject<{
7197
7197
  declare type Depth = z.infer<typeof depthParser>;
7198
7198
  declare const getDepthParser: z.ZodObject<{
7199
7199
  symbol: z.ZodString;
7200
- step: z.ZodString;
7200
+ step: z.ZodNumber;
7201
7201
  limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
7202
7202
  }, "strip", z.ZodTypeAny, {
7203
7203
  symbol: string;
7204
7204
  limit: number;
7205
- step: string;
7205
+ step: number;
7206
7206
  }, {
7207
7207
  symbol: string;
7208
- step: string;
7208
+ step: number;
7209
7209
  limit?: number | undefined;
7210
7210
  }>;
7211
7211
  declare type GetDepth = z.infer<typeof getDepthParser>;
@@ -7884,14 +7884,14 @@ declare const getTradeHistoryParser: z.ZodObject<{
7884
7884
  account: z.ZodString;
7885
7885
  symbol: z.ZodOptional<z.ZodString>;
7886
7886
  offset: z.ZodDefault<z.ZodNumber>;
7887
- ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
7887
+ ordinal_order_ids: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>, string[], string | string[] | undefined>;
7888
7888
  limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
7889
7889
  }, "strip", z.ZodTypeAny, {
7890
7890
  account: string;
7891
7891
  limit: number;
7892
7892
  offset: number;
7893
+ ordinal_order_ids: string[];
7893
7894
  symbol?: string | undefined;
7894
- ordinal_order_ids?: string | string[] | undefined;
7895
7895
  }, {
7896
7896
  account: string;
7897
7897
  symbol?: string | undefined;
@@ -8209,17 +8209,17 @@ declare const leaderboardParser: z.ZodObject<{
8209
8209
  }>;
8210
8210
  declare type Leaderboard = z.infer<typeof leaderboardParser>;
8211
8211
  declare const getLeaderboardParser: z.ZodObject<{
8212
- market_ids: z.ZodArray<z.ZodString, "many">;
8212
+ market_ids: z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodNumber]>, number[], number | number[]>;
8213
8213
  from: z.ZodString;
8214
8214
  to: z.ZodString;
8215
8215
  }, "strip", z.ZodTypeAny, {
8216
8216
  from: string;
8217
8217
  to: string;
8218
- market_ids: string[];
8218
+ market_ids: number[];
8219
8219
  }, {
8220
8220
  from: string;
8221
8221
  to: string;
8222
- market_ids: string[];
8222
+ market_ids: (number | number[]) & (number | number[] | undefined);
8223
8223
  }>;
8224
8224
  declare type GetLeaderboard = z.infer<typeof getLeaderboardParser>;
8225
8225
  declare const getLeaderboardResponseParser: z.ZodObject<{
package/dist/index.js CHANGED
@@ -1898,6 +1898,11 @@ var wrapParser = z10.object({
1898
1898
  var z11 = __toESM(require("zod"));
1899
1899
  var createLimit = (base, max) => z11.coerce.number().default(base).refine((n) => +n > 0 && +n <= max, `Limit must be between 0 and ${max}`);
1900
1900
  var createOffset = (base) => z11.coerce.number().default(base);
1901
+ var ordinalOrderIdsParser = z11.array(z11.string()).or(z11.string()).optional().transform((oids) => {
1902
+ if (!oids)
1903
+ return [];
1904
+ return Array.isArray(oids) ? oids : [oids];
1905
+ });
1901
1906
  var ohlcvParser = z11.object({
1902
1907
  time: z11.number(),
1903
1908
  open: z11.number(),
@@ -1966,7 +1971,7 @@ var getOpenOrdersParser = z11.object({
1966
1971
  symbol: z11.string().optional(),
1967
1972
  offset: createOffset(0),
1968
1973
  limit: createLimit(100, 250),
1969
- ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional()
1974
+ ordinal_order_ids: ordinalOrderIdsParser
1970
1975
  });
1971
1976
  var getOpenOrdersResponseParser = z11.object({
1972
1977
  sync: z11.number(),
@@ -1978,7 +1983,7 @@ var getOrderHistoryParser = z11.object({
1978
1983
  symbol: z11.string().optional(),
1979
1984
  offset: createOffset(0),
1980
1985
  limit: createLimit(100, 250),
1981
- ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
1986
+ ordinal_order_ids: ordinalOrderIdsParser,
1982
1987
  trx_id: z11.string().optional(),
1983
1988
  status: z11.string().optional()
1984
1989
  });
@@ -2039,7 +2044,7 @@ var depthParser = z11.object({
2039
2044
  });
2040
2045
  var getDepthParser = z11.object({
2041
2046
  symbol: z11.string(),
2042
- step: z11.string(),
2047
+ step: z11.coerce.number(),
2043
2048
  limit: createLimit(100, 250)
2044
2049
  });
2045
2050
  var getDepthResponseParser = z11.object({
@@ -2141,7 +2146,7 @@ var getTradeHistoryParser = z11.object({
2141
2146
  account: z11.string(),
2142
2147
  symbol: z11.string().optional(),
2143
2148
  offset: createOffset(0),
2144
- ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
2149
+ ordinal_order_ids: ordinalOrderIdsParser,
2145
2150
  limit: createLimit(100, 250)
2146
2151
  });
2147
2152
  var getTradeHistoryResponseParser = z11.object({
@@ -2192,7 +2197,7 @@ var leaderboardParser = z11.object({
2192
2197
  total: z11.number()
2193
2198
  });
2194
2199
  var getLeaderboardParser = z11.object({
2195
- market_ids: z11.array(z11.string()),
2200
+ market_ids: z11.array(z11.coerce.number()).or(z11.coerce.number()).transform((mids) => Array.isArray(mids) ? mids : [mids]),
2196
2201
  from: z11.string(),
2197
2202
  to: z11.string()
2198
2203
  });
package/dist/index.mjs CHANGED
@@ -1755,6 +1755,11 @@ var wrapParser = z10.object({
1755
1755
  import * as z11 from "zod";
1756
1756
  var createLimit = (base, max) => z11.coerce.number().default(base).refine((n) => +n > 0 && +n <= max, `Limit must be between 0 and ${max}`);
1757
1757
  var createOffset = (base) => z11.coerce.number().default(base);
1758
+ var ordinalOrderIdsParser = z11.array(z11.string()).or(z11.string()).optional().transform((oids) => {
1759
+ if (!oids)
1760
+ return [];
1761
+ return Array.isArray(oids) ? oids : [oids];
1762
+ });
1758
1763
  var ohlcvParser = z11.object({
1759
1764
  time: z11.number(),
1760
1765
  open: z11.number(),
@@ -1823,7 +1828,7 @@ var getOpenOrdersParser = z11.object({
1823
1828
  symbol: z11.string().optional(),
1824
1829
  offset: createOffset(0),
1825
1830
  limit: createLimit(100, 250),
1826
- ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional()
1831
+ ordinal_order_ids: ordinalOrderIdsParser
1827
1832
  });
1828
1833
  var getOpenOrdersResponseParser = z11.object({
1829
1834
  sync: z11.number(),
@@ -1835,7 +1840,7 @@ var getOrderHistoryParser = z11.object({
1835
1840
  symbol: z11.string().optional(),
1836
1841
  offset: createOffset(0),
1837
1842
  limit: createLimit(100, 250),
1838
- ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
1843
+ ordinal_order_ids: ordinalOrderIdsParser,
1839
1844
  trx_id: z11.string().optional(),
1840
1845
  status: z11.string().optional()
1841
1846
  });
@@ -1896,7 +1901,7 @@ var depthParser = z11.object({
1896
1901
  });
1897
1902
  var getDepthParser = z11.object({
1898
1903
  symbol: z11.string(),
1899
- step: z11.string(),
1904
+ step: z11.coerce.number(),
1900
1905
  limit: createLimit(100, 250)
1901
1906
  });
1902
1907
  var getDepthResponseParser = z11.object({
@@ -1998,7 +2003,7 @@ var getTradeHistoryParser = z11.object({
1998
2003
  account: z11.string(),
1999
2004
  symbol: z11.string().optional(),
2000
2005
  offset: createOffset(0),
2001
- ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
2006
+ ordinal_order_ids: ordinalOrderIdsParser,
2002
2007
  limit: createLimit(100, 250)
2003
2008
  });
2004
2009
  var getTradeHistoryResponseParser = z11.object({
@@ -2049,7 +2054,7 @@ var leaderboardParser = z11.object({
2049
2054
  total: z11.number()
2050
2055
  });
2051
2056
  var getLeaderboardParser = z11.object({
2052
- market_ids: z11.array(z11.string()),
2057
+ market_ids: z11.array(z11.coerce.number()).or(z11.coerce.number()).transform((mids) => Array.isArray(mids) ? mids : [mids]),
2053
2058
  from: z11.string(),
2054
2059
  to: z11.string()
2055
2060
  });
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "version": "0.2.122",
8
+ "version": "0.2.124",
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": "412005a5fd9d671655384c5df74101922a1458cb"
43
+ "gitHead": "d5ab0e1097ce68700f76fccbb8e96899f830f9c9"
44
44
  }
@@ -9,6 +9,15 @@ const createLimit = (base: number, max: number) =>
9
9
 
10
10
  const createOffset = (base: number) => z.coerce.number().default(base);
11
11
 
12
+ const ordinalOrderIdsParser = z
13
+ .array(z.string())
14
+ .or(z.string())
15
+ .optional()
16
+ .transform((oids) => {
17
+ if (!oids) return [];
18
+ return Array.isArray(oids) ? oids : [oids];
19
+ });
20
+
12
21
  /**
13
22
  * OHLCV
14
23
  */
@@ -93,10 +102,7 @@ export const getOpenOrdersParser = z.object({
93
102
  symbol: z.string().optional(),
94
103
  offset: createOffset(0),
95
104
  limit: createLimit(100, 250),
96
- ordinal_order_ids: z
97
- .array(z.string())
98
- .or(z.string())
99
- .optional(),
105
+ ordinal_order_ids: ordinalOrderIdsParser,
100
106
  });
101
107
  export type GetOpenOrders = z.infer<typeof getOpenOrdersParser>;
102
108
 
@@ -112,10 +118,7 @@ export const getOrderHistoryParser = z.object({
112
118
  symbol: z.string().optional(),
113
119
  offset: createOffset(0),
114
120
  limit: createLimit(100, 250),
115
- ordinal_order_ids: z
116
- .array(z.string())
117
- .or(z.string())
118
- .optional(),
121
+ ordinal_order_ids: ordinalOrderIdsParser,
119
122
  trx_id: z.string().optional(),
120
123
  status: z.string().optional(),
121
124
  });
@@ -210,7 +213,7 @@ export type Depth = z.infer<typeof depthParser>;
210
213
 
211
214
  export const getDepthParser = z.object({
212
215
  symbol: z.string(),
213
- step: z.string(),
216
+ step: z.coerce.number(),
214
217
  limit: createLimit(100, 250),
215
218
  });
216
219
  export type GetDepth = z.infer<typeof getDepthParser>;
@@ -341,10 +344,7 @@ export const getTradeHistoryParser = z.object({
341
344
  account: z.string(),
342
345
  symbol: z.string().optional(),
343
346
  offset: createOffset(0),
344
- ordinal_order_ids: z
345
- .array(z.string())
346
- .or(z.string())
347
- .optional(),
347
+ ordinal_order_ids: ordinalOrderIdsParser,
348
348
  limit: createLimit(100, 250),
349
349
  });
350
350
  export type GetTradeHistory = z.infer<typeof getTradeHistoryParser>;
@@ -436,7 +436,10 @@ export const leaderboardParser = z.object({
436
436
  export type Leaderboard = z.infer<typeof leaderboardParser>;
437
437
 
438
438
  export const getLeaderboardParser = z.object({
439
- market_ids: z.array(z.string()),
439
+ market_ids: z
440
+ .array(z.coerce.number())
441
+ .or(z.coerce.number())
442
+ .transform((mids) => (Array.isArray(mids) ? mids : [mids])),
440
443
  from: z.string(),
441
444
  to: z.string(),
442
445
  });