@proton/wrap-constants 0.2.122 → 0.2.123

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
  }, {
@@ -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;
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
  });
@@ -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({
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
  });
@@ -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({
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.123",
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": "9f0d2e8264db2dc364710c9efd2854770cc5b04d"
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
  });
@@ -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>;