@metamask-previews/bridge-controller 77.3.2-preview-bbd2df29f → 77.3.2-preview-34f2bcbf7

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.
Files changed (195) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/bridge-controller.cjs.map +1 -1
  3. package/dist/bridge-controller.d.cts +3 -2
  4. package/dist/bridge-controller.d.cts.map +1 -1
  5. package/dist/bridge-controller.d.mts +3 -2
  6. package/dist/bridge-controller.d.mts.map +1 -1
  7. package/dist/bridge-controller.mjs +1 -1
  8. package/dist/bridge-controller.mjs.map +1 -1
  9. package/dist/index.cjs +36 -30
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +14 -5
  12. package/dist/index.d.cts.map +1 -1
  13. package/dist/index.d.mts +14 -5
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +10 -4
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/selectors.cjs.map +1 -1
  18. package/dist/selectors.d.cts +5971 -6520
  19. package/dist/selectors.d.cts.map +1 -1
  20. package/dist/selectors.d.mts +5971 -6520
  21. package/dist/selectors.d.mts.map +1 -1
  22. package/dist/selectors.mjs.map +1 -1
  23. package/dist/types.cjs +1 -12
  24. package/dist/types.cjs.map +1 -1
  25. package/dist/types.d.cts +21 -41
  26. package/dist/types.d.cts.map +1 -1
  27. package/dist/types.d.mts +21 -41
  28. package/dist/types.d.mts.map +1 -1
  29. package/dist/types.mjs +0 -11
  30. package/dist/types.mjs.map +1 -1
  31. package/dist/utils/bridge.cjs +1 -0
  32. package/dist/utils/bridge.cjs.map +1 -1
  33. package/dist/utils/bridge.d.cts +4 -3
  34. package/dist/utils/bridge.d.cts.map +1 -1
  35. package/dist/utils/bridge.d.mts +4 -3
  36. package/dist/utils/bridge.d.mts.map +1 -1
  37. package/dist/utils/bridge.mjs +1 -0
  38. package/dist/utils/bridge.mjs.map +1 -1
  39. package/dist/utils/feature-flags.cjs +2 -2
  40. package/dist/utils/feature-flags.cjs.map +1 -1
  41. package/dist/utils/feature-flags.d.cts +1 -1
  42. package/dist/utils/feature-flags.d.mts +1 -1
  43. package/dist/utils/feature-flags.mjs +1 -1
  44. package/dist/utils/feature-flags.mjs.map +1 -1
  45. package/dist/utils/fetch.cjs +16 -11
  46. package/dist/utils/fetch.cjs.map +1 -1
  47. package/dist/utils/fetch.d.cts +3 -1
  48. package/dist/utils/fetch.d.cts.map +1 -1
  49. package/dist/utils/fetch.d.mts +3 -1
  50. package/dist/utils/fetch.d.mts.map +1 -1
  51. package/dist/utils/fetch.mjs +9 -4
  52. package/dist/utils/fetch.mjs.map +1 -1
  53. package/dist/utils/metrics/properties.cjs +2 -2
  54. package/dist/utils/metrics/properties.cjs.map +1 -1
  55. package/dist/utils/metrics/properties.d.cts +4 -2
  56. package/dist/utils/metrics/properties.d.cts.map +1 -1
  57. package/dist/utils/metrics/properties.d.mts +4 -2
  58. package/dist/utils/metrics/properties.d.mts.map +1 -1
  59. package/dist/utils/metrics/properties.mjs +1 -1
  60. package/dist/utils/metrics/properties.mjs.map +1 -1
  61. package/dist/utils/metrics/types.cjs.map +1 -1
  62. package/dist/utils/metrics/types.d.cts +2 -1
  63. package/dist/utils/metrics/types.d.cts.map +1 -1
  64. package/dist/utils/metrics/types.d.mts +2 -1
  65. package/dist/utils/metrics/types.d.mts.map +1 -1
  66. package/dist/utils/metrics/types.mjs.map +1 -1
  67. package/dist/utils/quote-fees.cjs +2 -1
  68. package/dist/utils/quote-fees.cjs.map +1 -1
  69. package/dist/utils/quote-fees.d.cts +2 -1
  70. package/dist/utils/quote-fees.d.cts.map +1 -1
  71. package/dist/utils/quote-fees.d.mts +2 -1
  72. package/dist/utils/quote-fees.d.mts.map +1 -1
  73. package/dist/utils/quote-fees.mjs +2 -1
  74. package/dist/utils/quote-fees.mjs.map +1 -1
  75. package/dist/utils/quote.cjs +3 -3
  76. package/dist/utils/quote.cjs.map +1 -1
  77. package/dist/utils/quote.d.cts +5 -2
  78. package/dist/utils/quote.d.cts.map +1 -1
  79. package/dist/utils/quote.d.mts +5 -2
  80. package/dist/utils/quote.d.mts.map +1 -1
  81. package/dist/utils/quote.mjs +2 -2
  82. package/dist/utils/quote.mjs.map +1 -1
  83. package/dist/utils/struct-error.cjs +16 -0
  84. package/dist/utils/struct-error.cjs.map +1 -0
  85. package/dist/utils/struct-error.d.cts +11 -0
  86. package/dist/utils/struct-error.d.cts.map +1 -0
  87. package/dist/utils/struct-error.d.mts +11 -0
  88. package/dist/utils/struct-error.d.mts.map +1 -0
  89. package/dist/utils/struct-error.mjs +12 -0
  90. package/dist/utils/struct-error.mjs.map +1 -0
  91. package/dist/utils/trade-utils.cjs +7 -66
  92. package/dist/utils/trade-utils.cjs.map +1 -1
  93. package/dist/utils/trade-utils.d.cts +1 -54
  94. package/dist/utils/trade-utils.d.cts.map +1 -1
  95. package/dist/utils/trade-utils.d.mts +1 -54
  96. package/dist/utils/trade-utils.d.mts.map +1 -1
  97. package/dist/utils/trade-utils.mjs +1 -56
  98. package/dist/utils/trade-utils.mjs.map +1 -1
  99. package/dist/validators/batch-sell.cjs +39 -0
  100. package/dist/validators/batch-sell.cjs.map +1 -0
  101. package/dist/validators/batch-sell.d.cts +79 -0
  102. package/dist/validators/batch-sell.d.cts.map +1 -0
  103. package/dist/validators/batch-sell.d.mts +79 -0
  104. package/dist/validators/batch-sell.d.mts.map +1 -0
  105. package/dist/validators/batch-sell.mjs +35 -0
  106. package/dist/validators/batch-sell.mjs.map +1 -0
  107. package/dist/validators/bridge-asset.cjs +42 -0
  108. package/dist/validators/bridge-asset.cjs.map +1 -0
  109. package/dist/validators/bridge-asset.d.cts +52 -0
  110. package/dist/validators/bridge-asset.d.cts.map +1 -0
  111. package/dist/validators/bridge-asset.d.mts +52 -0
  112. package/dist/validators/bridge-asset.d.mts.map +1 -0
  113. package/dist/validators/bridge-asset.mjs +38 -0
  114. package/dist/validators/bridge-asset.mjs.map +1 -0
  115. package/dist/validators/feature-flags.cjs +110 -0
  116. package/dist/validators/feature-flags.cjs.map +1 -0
  117. package/dist/validators/feature-flags.d.cts +264 -0
  118. package/dist/validators/feature-flags.d.cts.map +1 -0
  119. package/dist/validators/feature-flags.d.mts +264 -0
  120. package/dist/validators/feature-flags.d.mts.map +1 -0
  121. package/dist/validators/feature-flags.mjs +106 -0
  122. package/dist/validators/feature-flags.mjs.map +1 -0
  123. package/dist/validators/intent.cjs +122 -0
  124. package/dist/validators/intent.cjs.map +1 -0
  125. package/dist/validators/intent.d.cts +231 -0
  126. package/dist/validators/intent.d.cts.map +1 -0
  127. package/dist/validators/intent.d.mts +231 -0
  128. package/dist/validators/intent.d.mts.map +1 -0
  129. package/dist/validators/intent.mjs +119 -0
  130. package/dist/validators/intent.mjs.map +1 -0
  131. package/dist/validators/number.cjs +8 -0
  132. package/dist/validators/number.cjs.map +1 -0
  133. package/dist/validators/number.d.cts +4 -0
  134. package/dist/validators/number.d.cts.map +1 -0
  135. package/dist/validators/number.d.mts +4 -0
  136. package/dist/validators/number.d.mts.map +1 -0
  137. package/dist/validators/number.mjs +5 -0
  138. package/dist/validators/number.mjs.map +1 -0
  139. package/dist/validators/quote-response-v1.cjs +31 -0
  140. package/dist/validators/quote-response-v1.cjs.map +1 -0
  141. package/dist/validators/quote-response-v1.d.cts +658 -0
  142. package/dist/validators/quote-response-v1.d.cts.map +1 -0
  143. package/dist/validators/quote-response-v1.d.mts +658 -0
  144. package/dist/validators/quote-response-v1.d.mts.map +1 -0
  145. package/dist/validators/quote-response-v1.mjs +27 -0
  146. package/dist/validators/quote-response-v1.mjs.map +1 -0
  147. package/dist/validators/quote-stream-complete.cjs +29 -0
  148. package/dist/validators/quote-stream-complete.cjs.map +1 -0
  149. package/dist/validators/quote-stream-complete.d.cts +39 -0
  150. package/dist/validators/quote-stream-complete.d.cts.map +1 -0
  151. package/dist/validators/quote-stream-complete.d.mts +39 -0
  152. package/dist/validators/quote-stream-complete.d.mts.map +1 -0
  153. package/dist/validators/quote-stream-complete.mjs +25 -0
  154. package/dist/validators/quote-stream-complete.mjs.map +1 -0
  155. package/dist/validators/quote.cjs +96 -0
  156. package/dist/validators/quote.cjs.map +1 -0
  157. package/dist/validators/quote.d.cts +230 -0
  158. package/dist/validators/quote.d.cts.map +1 -0
  159. package/dist/validators/quote.d.mts +230 -0
  160. package/dist/validators/quote.d.mts.map +1 -0
  161. package/dist/validators/quote.mjs +93 -0
  162. package/dist/validators/quote.mjs.map +1 -0
  163. package/dist/validators/step.cjs +20 -0
  164. package/dist/validators/step.cjs.map +1 -0
  165. package/dist/validators/step.d.cts +148 -0
  166. package/dist/validators/step.d.cts.map +1 -0
  167. package/dist/validators/step.d.mts +148 -0
  168. package/dist/validators/step.d.mts.map +1 -0
  169. package/dist/validators/step.mjs +17 -0
  170. package/dist/validators/step.mjs.map +1 -0
  171. package/dist/validators/token-feature.cjs +22 -0
  172. package/dist/validators/token-feature.cjs.map +1 -0
  173. package/dist/validators/token-feature.d.cts +26 -0
  174. package/dist/validators/token-feature.d.cts.map +1 -0
  175. package/dist/validators/token-feature.d.mts +26 -0
  176. package/dist/validators/token-feature.d.mts.map +1 -0
  177. package/dist/validators/token-feature.mjs +18 -0
  178. package/dist/validators/token-feature.mjs.map +1 -0
  179. package/dist/validators/trade.cjs +94 -0
  180. package/dist/validators/trade.cjs.map +1 -0
  181. package/dist/validators/trade.d.cts +121 -0
  182. package/dist/validators/trade.d.cts.map +1 -0
  183. package/dist/validators/trade.d.mts +121 -0
  184. package/dist/validators/trade.d.mts.map +1 -0
  185. package/dist/validators/trade.mjs +86 -0
  186. package/dist/validators/trade.mjs.map +1 -0
  187. package/package.json +4 -4
  188. package/dist/utils/validators.cjs +0 -471
  189. package/dist/utils/validators.cjs.map +0 -1
  190. package/dist/utils/validators.d.cts +0 -1765
  191. package/dist/utils/validators.d.cts.map +0 -1
  192. package/dist/utils/validators.d.mts +0 -1765
  193. package/dist/utils/validators.d.mts.map +0 -1
  194. package/dist/utils/validators.mjs +0 -461
  195. package/dist/utils/validators.mjs.map +0 -1
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Schema for an intent-based order used for EIP-712 signing and submission.
3
+ *
4
+ * This represents the minimal subset of fields required by intent-based
5
+ * protocols (e.g. CoW Swap) to build, sign, and submit an order.
6
+ */
7
+ export declare const IntentOrderSchema: import("@metamask/superstruct").Struct<{
8
+ sellToken: `0x${string}`;
9
+ buyToken: `0x${string}`;
10
+ validTo: string | number;
11
+ appData: string;
12
+ appDataHash: `0x${string}`;
13
+ feeAmount: string;
14
+ kind: "sell" | "buy";
15
+ partiallyFillable: boolean;
16
+ from?: `0x${string}` | undefined;
17
+ receiver?: `0x${string}` | undefined;
18
+ sellAmount?: string | undefined;
19
+ buyAmount?: string | undefined;
20
+ }, {
21
+ /**
22
+ * Address of the token being sold.
23
+ */
24
+ sellToken: import("@metamask/superstruct").Struct<`0x${string}`, null>;
25
+ /**
26
+ * Address of the token being bought.
27
+ */
28
+ buyToken: import("@metamask/superstruct").Struct<`0x${string}`, null>;
29
+ /**
30
+ * Optional receiver of the bought tokens.
31
+ * If omitted, defaults to the signer / order owner.
32
+ */
33
+ receiver: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
34
+ /**
35
+ * Order expiration time.
36
+ *
37
+ * Can be provided as a UNIX timestamp in seconds, either as a number
38
+ * or as a digit string, depending on provider requirements.
39
+ */
40
+ validTo: import("@metamask/superstruct").Struct<string | number, null>;
41
+ /**
42
+ * Arbitrary application-specific data attached to the order.
43
+ */
44
+ appData: import("@metamask/superstruct").Struct<string, null>;
45
+ /**
46
+ * Hash of the `appData` field, used for EIP-712 signing.
47
+ */
48
+ appDataHash: import("@metamask/superstruct").Struct<`0x${string}`, null>;
49
+ /**
50
+ * Fee amount paid for order execution, expressed as a digit string.
51
+ */
52
+ feeAmount: import("@metamask/superstruct").Struct<string, null>;
53
+ /**
54
+ * Order kind.
55
+ *
56
+ * - `sell`: exact sell amount, variable buy amount
57
+ * - `buy`: exact buy amount, variable sell amount
58
+ */
59
+ kind: import("@metamask/superstruct").Struct<"sell" | "buy", {
60
+ sell: "sell";
61
+ buy: "buy";
62
+ }>;
63
+ /**
64
+ * Whether the order can be partially filled.
65
+ */
66
+ partiallyFillable: import("@metamask/superstruct").Struct<boolean, null>;
67
+ /**
68
+ * Exact amount of the sell token.
69
+ *
70
+ * Required for `sell` orders.
71
+ */
72
+ sellAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
73
+ /**
74
+ * Exact amount of the buy token.
75
+ *
76
+ * Required for `buy` orders.
77
+ */
78
+ buyAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
79
+ /**
80
+ * Optional order owner / sender address.
81
+ *
82
+ * Provided for convenience when building the EIP-712 domain and message.
83
+ */
84
+ from: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
85
+ }>;
86
+ /**
87
+ * Schema representing an intent submission payload.
88
+ *
89
+ * Wraps the intent order along with protocol and optional routing metadata
90
+ * required by the backend or relayer infrastructure.
91
+ */
92
+ export declare const IntentSchema: import("@metamask/superstruct").Struct<{
93
+ protocol: string;
94
+ order: {
95
+ sellToken: `0x${string}`;
96
+ buyToken: `0x${string}`;
97
+ validTo: string | number;
98
+ appData: string;
99
+ appDataHash: `0x${string}`;
100
+ feeAmount: string;
101
+ kind: "sell" | "buy";
102
+ partiallyFillable: boolean;
103
+ from?: `0x${string}` | undefined;
104
+ receiver?: `0x${string}` | undefined;
105
+ sellAmount?: string | undefined;
106
+ buyAmount?: string | undefined;
107
+ };
108
+ typedData: {
109
+ types: Record<string, {
110
+ name: string;
111
+ type: string;
112
+ }[]>;
113
+ primaryType: string;
114
+ domain: Record<string, any>;
115
+ message: Record<string, any>;
116
+ };
117
+ settlementContract?: `0x${string}` | undefined;
118
+ }, {
119
+ /**
120
+ * Identifier of the intent protocol used to interpret the order.
121
+ */
122
+ protocol: import("@metamask/superstruct").Struct<string, null>;
123
+ /**
124
+ * The intent order to be signed and submitted.
125
+ */
126
+ order: import("@metamask/superstruct").Struct<{
127
+ sellToken: `0x${string}`;
128
+ buyToken: `0x${string}`;
129
+ validTo: string | number;
130
+ appData: string;
131
+ appDataHash: `0x${string}`;
132
+ feeAmount: string;
133
+ kind: "sell" | "buy";
134
+ partiallyFillable: boolean;
135
+ from?: `0x${string}` | undefined;
136
+ receiver?: `0x${string}` | undefined;
137
+ sellAmount?: string | undefined;
138
+ buyAmount?: string | undefined;
139
+ }, {
140
+ /**
141
+ * Address of the token being sold.
142
+ */
143
+ sellToken: import("@metamask/superstruct").Struct<`0x${string}`, null>;
144
+ /**
145
+ * Address of the token being bought.
146
+ */
147
+ buyToken: import("@metamask/superstruct").Struct<`0x${string}`, null>;
148
+ /**
149
+ * Optional receiver of the bought tokens.
150
+ * If omitted, defaults to the signer / order owner.
151
+ */
152
+ receiver: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
153
+ /**
154
+ * Order expiration time.
155
+ *
156
+ * Can be provided as a UNIX timestamp in seconds, either as a number
157
+ * or as a digit string, depending on provider requirements.
158
+ */
159
+ validTo: import("@metamask/superstruct").Struct<string | number, null>;
160
+ /**
161
+ * Arbitrary application-specific data attached to the order.
162
+ */
163
+ appData: import("@metamask/superstruct").Struct<string, null>;
164
+ /**
165
+ * Hash of the `appData` field, used for EIP-712 signing.
166
+ */
167
+ appDataHash: import("@metamask/superstruct").Struct<`0x${string}`, null>;
168
+ /**
169
+ * Fee amount paid for order execution, expressed as a digit string.
170
+ */
171
+ feeAmount: import("@metamask/superstruct").Struct<string, null>;
172
+ /**
173
+ * Order kind.
174
+ *
175
+ * - `sell`: exact sell amount, variable buy amount
176
+ * - `buy`: exact buy amount, variable sell amount
177
+ */
178
+ kind: import("@metamask/superstruct").Struct<"sell" | "buy", {
179
+ sell: "sell";
180
+ buy: "buy";
181
+ }>;
182
+ /**
183
+ * Whether the order can be partially filled.
184
+ */
185
+ partiallyFillable: import("@metamask/superstruct").Struct<boolean, null>;
186
+ /**
187
+ * Exact amount of the sell token.
188
+ *
189
+ * Required for `sell` orders.
190
+ */
191
+ sellAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
192
+ /**
193
+ * Exact amount of the buy token.
194
+ *
195
+ * Required for `buy` orders.
196
+ */
197
+ buyAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
198
+ /**
199
+ * Optional order owner / sender address.
200
+ *
201
+ * Provided for convenience when building the EIP-712 domain and message.
202
+ */
203
+ from: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
204
+ }>;
205
+ /**
206
+ * Optional settlement contract address used for execution.
207
+ */
208
+ settlementContract: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
209
+ /**
210
+ * Optional EIP-712 typed data payload for signing.
211
+ * Must be JSON-serializable and include required EIP-712 fields.
212
+ */
213
+ typedData: import("@metamask/superstruct").Struct<{
214
+ types: Record<string, {
215
+ name: string;
216
+ type: string;
217
+ }[]>;
218
+ primaryType: string;
219
+ domain: Record<string, any>;
220
+ message: Record<string, any>;
221
+ }, {
222
+ types: import("@metamask/superstruct").Struct<Record<string, {
223
+ name: string;
224
+ type: string;
225
+ }[]>, null>;
226
+ primaryType: import("@metamask/superstruct").Struct<string, null>;
227
+ domain: import("@metamask/superstruct").Struct<Record<string, any>, null>;
228
+ message: import("@metamask/superstruct").Struct<Record<string, any>, null>;
229
+ }>;
230
+ }>;
231
+ //# sourceMappingURL=intent.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.d.cts","sourceRoot":"","sources":["../../src/validators/intent.ts"],"names":[],"mappings":"AA0BA;;;;;GAKG;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;IAC5B;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;;;OAKG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;;OAKG;;;;;IAGH;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;EAEH,CAAC;AACH;;;;;GAKG;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;IACvB;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;QAxFH;;WAEG;;QAGH;;WAEG;;QAGH;;;WAGG;;QAGH;;;;;WAKG;;QAGH;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;QAGH;;;;;WAKG;;;;;QAGH;;WAEG;;QAGH;;;;WAIG;;QAGH;;;;WAIG;;QAGH;;;;WAIG;;;IAqBH;;OAEG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;;EAkBH,CAAC"}
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Schema for an intent-based order used for EIP-712 signing and submission.
3
+ *
4
+ * This represents the minimal subset of fields required by intent-based
5
+ * protocols (e.g. CoW Swap) to build, sign, and submit an order.
6
+ */
7
+ export declare const IntentOrderSchema: import("@metamask/superstruct").Struct<{
8
+ sellToken: `0x${string}`;
9
+ buyToken: `0x${string}`;
10
+ validTo: string | number;
11
+ appData: string;
12
+ appDataHash: `0x${string}`;
13
+ feeAmount: string;
14
+ kind: "sell" | "buy";
15
+ partiallyFillable: boolean;
16
+ from?: `0x${string}` | undefined;
17
+ receiver?: `0x${string}` | undefined;
18
+ sellAmount?: string | undefined;
19
+ buyAmount?: string | undefined;
20
+ }, {
21
+ /**
22
+ * Address of the token being sold.
23
+ */
24
+ sellToken: import("@metamask/superstruct").Struct<`0x${string}`, null>;
25
+ /**
26
+ * Address of the token being bought.
27
+ */
28
+ buyToken: import("@metamask/superstruct").Struct<`0x${string}`, null>;
29
+ /**
30
+ * Optional receiver of the bought tokens.
31
+ * If omitted, defaults to the signer / order owner.
32
+ */
33
+ receiver: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
34
+ /**
35
+ * Order expiration time.
36
+ *
37
+ * Can be provided as a UNIX timestamp in seconds, either as a number
38
+ * or as a digit string, depending on provider requirements.
39
+ */
40
+ validTo: import("@metamask/superstruct").Struct<string | number, null>;
41
+ /**
42
+ * Arbitrary application-specific data attached to the order.
43
+ */
44
+ appData: import("@metamask/superstruct").Struct<string, null>;
45
+ /**
46
+ * Hash of the `appData` field, used for EIP-712 signing.
47
+ */
48
+ appDataHash: import("@metamask/superstruct").Struct<`0x${string}`, null>;
49
+ /**
50
+ * Fee amount paid for order execution, expressed as a digit string.
51
+ */
52
+ feeAmount: import("@metamask/superstruct").Struct<string, null>;
53
+ /**
54
+ * Order kind.
55
+ *
56
+ * - `sell`: exact sell amount, variable buy amount
57
+ * - `buy`: exact buy amount, variable sell amount
58
+ */
59
+ kind: import("@metamask/superstruct").Struct<"sell" | "buy", {
60
+ sell: "sell";
61
+ buy: "buy";
62
+ }>;
63
+ /**
64
+ * Whether the order can be partially filled.
65
+ */
66
+ partiallyFillable: import("@metamask/superstruct").Struct<boolean, null>;
67
+ /**
68
+ * Exact amount of the sell token.
69
+ *
70
+ * Required for `sell` orders.
71
+ */
72
+ sellAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
73
+ /**
74
+ * Exact amount of the buy token.
75
+ *
76
+ * Required for `buy` orders.
77
+ */
78
+ buyAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
79
+ /**
80
+ * Optional order owner / sender address.
81
+ *
82
+ * Provided for convenience when building the EIP-712 domain and message.
83
+ */
84
+ from: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
85
+ }>;
86
+ /**
87
+ * Schema representing an intent submission payload.
88
+ *
89
+ * Wraps the intent order along with protocol and optional routing metadata
90
+ * required by the backend or relayer infrastructure.
91
+ */
92
+ export declare const IntentSchema: import("@metamask/superstruct").Struct<{
93
+ protocol: string;
94
+ order: {
95
+ sellToken: `0x${string}`;
96
+ buyToken: `0x${string}`;
97
+ validTo: string | number;
98
+ appData: string;
99
+ appDataHash: `0x${string}`;
100
+ feeAmount: string;
101
+ kind: "sell" | "buy";
102
+ partiallyFillable: boolean;
103
+ from?: `0x${string}` | undefined;
104
+ receiver?: `0x${string}` | undefined;
105
+ sellAmount?: string | undefined;
106
+ buyAmount?: string | undefined;
107
+ };
108
+ typedData: {
109
+ types: Record<string, {
110
+ name: string;
111
+ type: string;
112
+ }[]>;
113
+ primaryType: string;
114
+ domain: Record<string, any>;
115
+ message: Record<string, any>;
116
+ };
117
+ settlementContract?: `0x${string}` | undefined;
118
+ }, {
119
+ /**
120
+ * Identifier of the intent protocol used to interpret the order.
121
+ */
122
+ protocol: import("@metamask/superstruct").Struct<string, null>;
123
+ /**
124
+ * The intent order to be signed and submitted.
125
+ */
126
+ order: import("@metamask/superstruct").Struct<{
127
+ sellToken: `0x${string}`;
128
+ buyToken: `0x${string}`;
129
+ validTo: string | number;
130
+ appData: string;
131
+ appDataHash: `0x${string}`;
132
+ feeAmount: string;
133
+ kind: "sell" | "buy";
134
+ partiallyFillable: boolean;
135
+ from?: `0x${string}` | undefined;
136
+ receiver?: `0x${string}` | undefined;
137
+ sellAmount?: string | undefined;
138
+ buyAmount?: string | undefined;
139
+ }, {
140
+ /**
141
+ * Address of the token being sold.
142
+ */
143
+ sellToken: import("@metamask/superstruct").Struct<`0x${string}`, null>;
144
+ /**
145
+ * Address of the token being bought.
146
+ */
147
+ buyToken: import("@metamask/superstruct").Struct<`0x${string}`, null>;
148
+ /**
149
+ * Optional receiver of the bought tokens.
150
+ * If omitted, defaults to the signer / order owner.
151
+ */
152
+ receiver: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
153
+ /**
154
+ * Order expiration time.
155
+ *
156
+ * Can be provided as a UNIX timestamp in seconds, either as a number
157
+ * or as a digit string, depending on provider requirements.
158
+ */
159
+ validTo: import("@metamask/superstruct").Struct<string | number, null>;
160
+ /**
161
+ * Arbitrary application-specific data attached to the order.
162
+ */
163
+ appData: import("@metamask/superstruct").Struct<string, null>;
164
+ /**
165
+ * Hash of the `appData` field, used for EIP-712 signing.
166
+ */
167
+ appDataHash: import("@metamask/superstruct").Struct<`0x${string}`, null>;
168
+ /**
169
+ * Fee amount paid for order execution, expressed as a digit string.
170
+ */
171
+ feeAmount: import("@metamask/superstruct").Struct<string, null>;
172
+ /**
173
+ * Order kind.
174
+ *
175
+ * - `sell`: exact sell amount, variable buy amount
176
+ * - `buy`: exact buy amount, variable sell amount
177
+ */
178
+ kind: import("@metamask/superstruct").Struct<"sell" | "buy", {
179
+ sell: "sell";
180
+ buy: "buy";
181
+ }>;
182
+ /**
183
+ * Whether the order can be partially filled.
184
+ */
185
+ partiallyFillable: import("@metamask/superstruct").Struct<boolean, null>;
186
+ /**
187
+ * Exact amount of the sell token.
188
+ *
189
+ * Required for `sell` orders.
190
+ */
191
+ sellAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
192
+ /**
193
+ * Exact amount of the buy token.
194
+ *
195
+ * Required for `buy` orders.
196
+ */
197
+ buyAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
198
+ /**
199
+ * Optional order owner / sender address.
200
+ *
201
+ * Provided for convenience when building the EIP-712 domain and message.
202
+ */
203
+ from: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
204
+ }>;
205
+ /**
206
+ * Optional settlement contract address used for execution.
207
+ */
208
+ settlementContract: import("@metamask/superstruct").Struct<`0x${string}` | undefined, null>;
209
+ /**
210
+ * Optional EIP-712 typed data payload for signing.
211
+ * Must be JSON-serializable and include required EIP-712 fields.
212
+ */
213
+ typedData: import("@metamask/superstruct").Struct<{
214
+ types: Record<string, {
215
+ name: string;
216
+ type: string;
217
+ }[]>;
218
+ primaryType: string;
219
+ domain: Record<string, any>;
220
+ message: Record<string, any>;
221
+ }, {
222
+ types: import("@metamask/superstruct").Struct<Record<string, {
223
+ name: string;
224
+ type: string;
225
+ }[]>, null>;
226
+ primaryType: import("@metamask/superstruct").Struct<string, null>;
227
+ domain: import("@metamask/superstruct").Struct<Record<string, any>, null>;
228
+ message: import("@metamask/superstruct").Struct<Record<string, any>, null>;
229
+ }>;
230
+ }>;
231
+ //# sourceMappingURL=intent.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.d.mts","sourceRoot":"","sources":["../../src/validators/intent.ts"],"names":[],"mappings":"AA0BA;;;;;GAKG;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;IAC5B;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;;;OAKG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;;OAKG;;;;;IAGH;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;EAEH,CAAC;AACH;;;;;GAKG;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;IACvB;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;;QAxFH;;WAEG;;QAGH;;WAEG;;QAGH;;;WAGG;;QAGH;;;;;WAKG;;QAGH;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;QAGH;;;;;WAKG;;;;;QAGH;;WAEG;;QAGH;;;;WAIG;;QAGH;;;;WAIG;;QAGH;;;;WAIG;;;IAqBH;;OAEG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;;EAkBH,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { union, number, string, type, optional, enums, boolean, record, array, any } from "@metamask/superstruct";
2
+ import { TruthyDigitStringSchema } from "./number.mjs";
3
+ import { HexString } from "./trade.mjs";
4
+ // Allow digit strings for amounts/validTo for flexibility across providers
5
+ const DigitStringOrNumberSchema = union([TruthyDigitStringSchema, number()]);
6
+ /**
7
+ * Identifier of the intent protocol used for order creation and submission.
8
+ *
9
+ * Examples:
10
+ * - CoW Swap
11
+ * - Other EIP-712–based intent protocols
12
+ */
13
+ const IntentProtocolSchema = string();
14
+ /**
15
+ * Schema for an intent-based order used for EIP-712 signing and submission.
16
+ *
17
+ * This represents the minimal subset of fields required by intent-based
18
+ * protocols (e.g. CoW Swap) to build, sign, and submit an order.
19
+ */
20
+ export const IntentOrderSchema = type({
21
+ /**
22
+ * Address of the token being sold.
23
+ */
24
+ sellToken: HexString,
25
+ /**
26
+ * Address of the token being bought.
27
+ */
28
+ buyToken: HexString,
29
+ /**
30
+ * Optional receiver of the bought tokens.
31
+ * If omitted, defaults to the signer / order owner.
32
+ */
33
+ receiver: optional(HexString),
34
+ /**
35
+ * Order expiration time.
36
+ *
37
+ * Can be provided as a UNIX timestamp in seconds, either as a number
38
+ * or as a digit string, depending on provider requirements.
39
+ */
40
+ validTo: DigitStringOrNumberSchema,
41
+ /**
42
+ * Arbitrary application-specific data attached to the order.
43
+ */
44
+ appData: string(),
45
+ /**
46
+ * Hash of the `appData` field, used for EIP-712 signing.
47
+ */
48
+ appDataHash: HexString,
49
+ /**
50
+ * Fee amount paid for order execution, expressed as a digit string.
51
+ */
52
+ feeAmount: TruthyDigitStringSchema,
53
+ /**
54
+ * Order kind.
55
+ *
56
+ * - `sell`: exact sell amount, variable buy amount
57
+ * - `buy`: exact buy amount, variable sell amount
58
+ */
59
+ kind: enums(['sell', 'buy']),
60
+ /**
61
+ * Whether the order can be partially filled.
62
+ */
63
+ partiallyFillable: boolean(),
64
+ /**
65
+ * Exact amount of the sell token.
66
+ *
67
+ * Required for `sell` orders.
68
+ */
69
+ sellAmount: optional(TruthyDigitStringSchema),
70
+ /**
71
+ * Exact amount of the buy token.
72
+ *
73
+ * Required for `buy` orders.
74
+ */
75
+ buyAmount: optional(TruthyDigitStringSchema),
76
+ /**
77
+ * Optional order owner / sender address.
78
+ *
79
+ * Provided for convenience when building the EIP-712 domain and message.
80
+ */
81
+ from: optional(HexString),
82
+ });
83
+ /**
84
+ * Schema representing an intent submission payload.
85
+ *
86
+ * Wraps the intent order along with protocol and optional routing metadata
87
+ * required by the backend or relayer infrastructure.
88
+ */
89
+ export const IntentSchema = type({
90
+ /**
91
+ * Identifier of the intent protocol used to interpret the order.
92
+ */
93
+ protocol: IntentProtocolSchema,
94
+ /**
95
+ * The intent order to be signed and submitted.
96
+ */
97
+ order: IntentOrderSchema,
98
+ /**
99
+ * Optional settlement contract address used for execution.
100
+ */
101
+ settlementContract: optional(HexString),
102
+ /**
103
+ * Optional EIP-712 typed data payload for signing.
104
+ * Must be JSON-serializable and include required EIP-712 fields.
105
+ */
106
+ typedData: type({
107
+ // Keep values as `any()` here. Using `unknown()` in this record causes
108
+ // TS2321/TS2589 (excessive type instantiation depth) in bridge state
109
+ // inference during build.
110
+ types: record(string(), array(type({
111
+ name: string(),
112
+ type: string(),
113
+ }))),
114
+ primaryType: string(),
115
+ domain: record(string(), any()),
116
+ message: record(string(), any()),
117
+ }),
118
+ });
119
+ //# sourceMappingURL=intent.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intent.mjs","sourceRoot":"","sources":["../../src/validators/intent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,MAAM,EACN,KAAK,EACL,GAAG,EACJ,8BAA8B;AAE/B,OAAO,EAAE,uBAAuB,EAAE,qBAAiB;AACnD,OAAO,EAAE,SAAS,EAAE,oBAAgB;AAEpC,2EAA2E;AAC3E,MAAM,yBAAyB,GAAG,KAAK,CAAC,CAAC,uBAAuB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AAC7E;;;;;;GAMG;AACH,MAAM,oBAAoB,GAAG,MAAM,EAAE,CAAC;AACtC;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;IACpC;;OAEG;IACH,SAAS,EAAE,SAAS;IAEpB;;OAEG;IACH,QAAQ,EAAE,SAAS;IAEnB;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC;IAE7B;;;;;OAKG;IACH,OAAO,EAAE,yBAAyB;IAElC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,WAAW,EAAE,SAAS;IAEtB;;OAEG;IACH,SAAS,EAAE,uBAAuB;IAElC;;;;;OAKG;IACH,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE5B;;OAEG;IACH,iBAAiB,EAAE,OAAO,EAAE;IAE5B;;;;OAIG;IACH,UAAU,EAAE,QAAQ,CAAC,uBAAuB,CAAC;IAE7C;;;;OAIG;IACH,SAAS,EAAE,QAAQ,CAAC,uBAAuB,CAAC;IAE5C;;;;OAIG;IACH,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC;CAC1B,CAAC,CAAC;AACH;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,oBAAoB;IAE9B;;OAEG;IACH,KAAK,EAAE,iBAAiB;IAExB;;OAEG;IACH,kBAAkB,EAAE,QAAQ,CAAC,SAAS,CAAC;IAEvC;;;OAGG;IACH,SAAS,EAAE,IAAI,CAAC;QACd,uEAAuE;QACvE,qEAAqE;QACrE,0BAA0B;QAC1B,KAAK,EAAE,MAAM,CACX,MAAM,EAAE,EACR,KAAK,CACH,IAAI,CAAC;YACH,IAAI,EAAE,MAAM,EAAE;YACd,IAAI,EAAE,MAAM,EAAE;SACf,CAAC,CACH,CACF;QACD,WAAW,EAAE,MAAM,EAAE;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC;QAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC;KACjC,CAAC;CACH,CAAC,CAAC","sourcesContent":["import {\n union,\n number,\n string,\n type,\n optional,\n enums,\n boolean,\n record,\n array,\n any,\n} from '@metamask/superstruct';\n\nimport { TruthyDigitStringSchema } from './number';\nimport { HexString } from './trade';\n\n// Allow digit strings for amounts/validTo for flexibility across providers\nconst DigitStringOrNumberSchema = union([TruthyDigitStringSchema, number()]);\n/**\n * Identifier of the intent protocol used for order creation and submission.\n *\n * Examples:\n * - CoW Swap\n * - Other EIP-712–based intent protocols\n */\nconst IntentProtocolSchema = string();\n/**\n * Schema for an intent-based order used for EIP-712 signing and submission.\n *\n * This represents the minimal subset of fields required by intent-based\n * protocols (e.g. CoW Swap) to build, sign, and submit an order.\n */\n\nexport const IntentOrderSchema = type({\n /**\n * Address of the token being sold.\n */\n sellToken: HexString,\n\n /**\n * Address of the token being bought.\n */\n buyToken: HexString,\n\n /**\n * Optional receiver of the bought tokens.\n * If omitted, defaults to the signer / order owner.\n */\n receiver: optional(HexString),\n\n /**\n * Order expiration time.\n *\n * Can be provided as a UNIX timestamp in seconds, either as a number\n * or as a digit string, depending on provider requirements.\n */\n validTo: DigitStringOrNumberSchema,\n\n /**\n * Arbitrary application-specific data attached to the order.\n */\n appData: string(),\n\n /**\n * Hash of the `appData` field, used for EIP-712 signing.\n */\n appDataHash: HexString,\n\n /**\n * Fee amount paid for order execution, expressed as a digit string.\n */\n feeAmount: TruthyDigitStringSchema,\n\n /**\n * Order kind.\n *\n * - `sell`: exact sell amount, variable buy amount\n * - `buy`: exact buy amount, variable sell amount\n */\n kind: enums(['sell', 'buy']),\n\n /**\n * Whether the order can be partially filled.\n */\n partiallyFillable: boolean(),\n\n /**\n * Exact amount of the sell token.\n *\n * Required for `sell` orders.\n */\n sellAmount: optional(TruthyDigitStringSchema),\n\n /**\n * Exact amount of the buy token.\n *\n * Required for `buy` orders.\n */\n buyAmount: optional(TruthyDigitStringSchema),\n\n /**\n * Optional order owner / sender address.\n *\n * Provided for convenience when building the EIP-712 domain and message.\n */\n from: optional(HexString),\n});\n/**\n * Schema representing an intent submission payload.\n *\n * Wraps the intent order along with protocol and optional routing metadata\n * required by the backend or relayer infrastructure.\n */\n\nexport const IntentSchema = type({\n /**\n * Identifier of the intent protocol used to interpret the order.\n */\n protocol: IntentProtocolSchema,\n\n /**\n * The intent order to be signed and submitted.\n */\n order: IntentOrderSchema,\n\n /**\n * Optional settlement contract address used for execution.\n */\n settlementContract: optional(HexString),\n\n /**\n * Optional EIP-712 typed data payload for signing.\n * Must be JSON-serializable and include required EIP-712 fields.\n */\n typedData: type({\n // Keep values as `any()` here. Using `unknown()` in this record causes\n // TS2321/TS2589 (excessive type instantiation depth) in bridge state\n // inference during build.\n types: record(\n string(),\n array(\n type({\n name: string(),\n type: string(),\n }),\n ),\n ),\n primaryType: string(),\n domain: record(string(), any()),\n message: record(string(), any()),\n }),\n});\n"]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FloatStringSchema = exports.TruthyDigitStringSchema = exports.NumberStringSchema = void 0;
4
+ const superstruct_1 = require("@metamask/superstruct");
5
+ exports.NumberStringSchema = (0, superstruct_1.define)('NumberString', (value) => typeof value === 'string' && /^\d+$/u.test(value));
6
+ exports.TruthyDigitStringSchema = (0, superstruct_1.pattern)((0, superstruct_1.string)(), /^\d+$/u);
7
+ exports.FloatStringSchema = (0, superstruct_1.define)('FloatString', (value) => typeof value === 'string' && /^-*\d*\.*\d+$/u.test(value));
8
+ //# sourceMappingURL=number.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.cjs","sourceRoot":"","sources":["../../src/validators/number.ts"],"names":[],"mappings":";;;AAAA,uDAAgE;AAEnD,QAAA,kBAAkB,GAAG,IAAA,oBAAM,EACtC,cAAc,EACd,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CACtE,CAAC;AAEW,QAAA,uBAAuB,GAAG,IAAA,qBAAO,EAAC,IAAA,oBAAM,GAAE,EAAE,QAAQ,CAAC,CAAC;AAEtD,QAAA,iBAAiB,GAAG,IAAA,oBAAM,EACrC,aAAa,EACb,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAC9E,CAAC","sourcesContent":["import { define, pattern, string } from '@metamask/superstruct';\n\nexport const NumberStringSchema = define<string>(\n 'NumberString',\n (value: unknown) => typeof value === 'string' && /^\\d+$/u.test(value),\n);\n\nexport const TruthyDigitStringSchema = pattern(string(), /^\\d+$/u);\n\nexport const FloatStringSchema = define<string>(\n 'FloatString',\n (value: unknown) => typeof value === 'string' && /^-*\\d*\\.*\\d+$/u.test(value),\n);\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const NumberStringSchema: import("@metamask/superstruct").Struct<string, null>;
2
+ export declare const TruthyDigitStringSchema: import("@metamask/superstruct").Struct<string, null>;
3
+ export declare const FloatStringSchema: import("@metamask/superstruct").Struct<string, null>;
4
+ //# sourceMappingURL=number.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.cts","sourceRoot":"","sources":["../../src/validators/number.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,sDAG9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,sDAA8B,CAAC;AAEnE,eAAO,MAAM,iBAAiB,sDAG7B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const NumberStringSchema: import("@metamask/superstruct").Struct<string, null>;
2
+ export declare const TruthyDigitStringSchema: import("@metamask/superstruct").Struct<string, null>;
3
+ export declare const FloatStringSchema: import("@metamask/superstruct").Struct<string, null>;
4
+ //# sourceMappingURL=number.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.mts","sourceRoot":"","sources":["../../src/validators/number.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,sDAG9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,sDAA8B,CAAC;AAEnE,eAAO,MAAM,iBAAiB,sDAG7B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { define, pattern, string } from "@metamask/superstruct";
2
+ export const NumberStringSchema = define('NumberString', (value) => typeof value === 'string' && /^\d+$/u.test(value));
3
+ export const TruthyDigitStringSchema = pattern(string(), /^\d+$/u);
4
+ export const FloatStringSchema = define('FloatString', (value) => typeof value === 'string' && /^-*\d*\.*\d+$/u.test(value));
5
+ //# sourceMappingURL=number.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.mjs","sourceRoot":"","sources":["../../src/validators/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,8BAA8B;AAEhE,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CACtC,cAAc,EACd,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CACtE,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CACrC,aAAa,EACb,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAC9E,CAAC","sourcesContent":["import { define, pattern, string } from '@metamask/superstruct';\n\nexport const NumberStringSchema = define<string>(\n 'NumberString',\n (value: unknown) => typeof value === 'string' && /^\\d+$/u.test(value),\n);\n\nexport const TruthyDigitStringSchema = pattern(string(), /^\\d+$/u);\n\nexport const FloatStringSchema = define<string>(\n 'FloatString',\n (value: unknown) => typeof value === 'string' && /^-*\\d*\\.*\\d+$/u.test(value),\n);\n"]}