@metamask-previews/bridge-controller 77.3.2-preview-0e180da1e → 77.3.2-preview-b3fa32653

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 +0 -4
  2. package/dist/bridge-controller.cjs.map +1 -1
  3. package/dist/bridge-controller.d.cts +2 -3
  4. package/dist/bridge-controller.d.cts.map +1 -1
  5. package/dist/bridge-controller.d.mts +2 -3
  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 +30 -36
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +5 -14
  12. package/dist/index.d.cts.map +1 -1
  13. package/dist/index.d.mts +5 -14
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +4 -10
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/selectors.cjs.map +1 -1
  18. package/dist/selectors.d.cts +6483 -5934
  19. package/dist/selectors.d.cts.map +1 -1
  20. package/dist/selectors.d.mts +6483 -5934
  21. package/dist/selectors.d.mts.map +1 -1
  22. package/dist/selectors.mjs.map +1 -1
  23. package/dist/types.cjs +12 -1
  24. package/dist/types.cjs.map +1 -1
  25. package/dist/types.d.cts +41 -21
  26. package/dist/types.d.cts.map +1 -1
  27. package/dist/types.d.mts +41 -21
  28. package/dist/types.d.mts.map +1 -1
  29. package/dist/types.mjs +11 -0
  30. package/dist/types.mjs.map +1 -1
  31. package/dist/utils/bridge.cjs +0 -1
  32. package/dist/utils/bridge.cjs.map +1 -1
  33. package/dist/utils/bridge.d.cts +3 -4
  34. package/dist/utils/bridge.d.cts.map +1 -1
  35. package/dist/utils/bridge.d.mts +3 -4
  36. package/dist/utils/bridge.d.mts.map +1 -1
  37. package/dist/utils/bridge.mjs +0 -1
  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 +11 -16
  46. package/dist/utils/fetch.cjs.map +1 -1
  47. package/dist/utils/fetch.d.cts +1 -3
  48. package/dist/utils/fetch.d.cts.map +1 -1
  49. package/dist/utils/fetch.d.mts +1 -3
  50. package/dist/utils/fetch.d.mts.map +1 -1
  51. package/dist/utils/fetch.mjs +4 -9
  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 +2 -4
  56. package/dist/utils/metrics/properties.d.cts.map +1 -1
  57. package/dist/utils/metrics/properties.d.mts +2 -4
  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 +1 -2
  63. package/dist/utils/metrics/types.d.cts.map +1 -1
  64. package/dist/utils/metrics/types.d.mts +1 -2
  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 +1 -2
  68. package/dist/utils/quote-fees.cjs.map +1 -1
  69. package/dist/utils/quote-fees.d.cts +1 -2
  70. package/dist/utils/quote-fees.d.cts.map +1 -1
  71. package/dist/utils/quote-fees.d.mts +1 -2
  72. package/dist/utils/quote-fees.d.mts.map +1 -1
  73. package/dist/utils/quote-fees.mjs +1 -2
  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 +2 -5
  78. package/dist/utils/quote.d.cts.map +1 -1
  79. package/dist/utils/quote.d.mts +2 -5
  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/trade-utils.cjs +66 -7
  84. package/dist/utils/trade-utils.cjs.map +1 -1
  85. package/dist/utils/trade-utils.d.cts +54 -1
  86. package/dist/utils/trade-utils.d.cts.map +1 -1
  87. package/dist/utils/trade-utils.d.mts +54 -1
  88. package/dist/utils/trade-utils.d.mts.map +1 -1
  89. package/dist/utils/trade-utils.mjs +56 -1
  90. package/dist/utils/trade-utils.mjs.map +1 -1
  91. package/dist/utils/validators.cjs +471 -0
  92. package/dist/utils/validators.cjs.map +1 -0
  93. package/dist/utils/validators.d.cts +1765 -0
  94. package/dist/utils/validators.d.cts.map +1 -0
  95. package/dist/utils/validators.d.mts +1765 -0
  96. package/dist/utils/validators.d.mts.map +1 -0
  97. package/dist/utils/validators.mjs +461 -0
  98. package/dist/utils/validators.mjs.map +1 -0
  99. package/package.json +4 -4
  100. package/dist/utils/struct-error.cjs +0 -16
  101. package/dist/utils/struct-error.cjs.map +0 -1
  102. package/dist/utils/struct-error.d.cts +0 -11
  103. package/dist/utils/struct-error.d.cts.map +0 -1
  104. package/dist/utils/struct-error.d.mts +0 -11
  105. package/dist/utils/struct-error.d.mts.map +0 -1
  106. package/dist/utils/struct-error.mjs +0 -12
  107. package/dist/utils/struct-error.mjs.map +0 -1
  108. package/dist/validators/batch-sell.cjs +0 -39
  109. package/dist/validators/batch-sell.cjs.map +0 -1
  110. package/dist/validators/batch-sell.d.cts +0 -79
  111. package/dist/validators/batch-sell.d.cts.map +0 -1
  112. package/dist/validators/batch-sell.d.mts +0 -79
  113. package/dist/validators/batch-sell.d.mts.map +0 -1
  114. package/dist/validators/batch-sell.mjs +0 -35
  115. package/dist/validators/batch-sell.mjs.map +0 -1
  116. package/dist/validators/bridge-asset.cjs +0 -42
  117. package/dist/validators/bridge-asset.cjs.map +0 -1
  118. package/dist/validators/bridge-asset.d.cts +0 -52
  119. package/dist/validators/bridge-asset.d.cts.map +0 -1
  120. package/dist/validators/bridge-asset.d.mts +0 -52
  121. package/dist/validators/bridge-asset.d.mts.map +0 -1
  122. package/dist/validators/bridge-asset.mjs +0 -38
  123. package/dist/validators/bridge-asset.mjs.map +0 -1
  124. package/dist/validators/feature-flags.cjs +0 -110
  125. package/dist/validators/feature-flags.cjs.map +0 -1
  126. package/dist/validators/feature-flags.d.cts +0 -264
  127. package/dist/validators/feature-flags.d.cts.map +0 -1
  128. package/dist/validators/feature-flags.d.mts +0 -264
  129. package/dist/validators/feature-flags.d.mts.map +0 -1
  130. package/dist/validators/feature-flags.mjs +0 -106
  131. package/dist/validators/feature-flags.mjs.map +0 -1
  132. package/dist/validators/intent.cjs +0 -122
  133. package/dist/validators/intent.cjs.map +0 -1
  134. package/dist/validators/intent.d.cts +0 -231
  135. package/dist/validators/intent.d.cts.map +0 -1
  136. package/dist/validators/intent.d.mts +0 -231
  137. package/dist/validators/intent.d.mts.map +0 -1
  138. package/dist/validators/intent.mjs +0 -119
  139. package/dist/validators/intent.mjs.map +0 -1
  140. package/dist/validators/number.cjs +0 -8
  141. package/dist/validators/number.cjs.map +0 -1
  142. package/dist/validators/number.d.cts +0 -4
  143. package/dist/validators/number.d.cts.map +0 -1
  144. package/dist/validators/number.d.mts +0 -4
  145. package/dist/validators/number.d.mts.map +0 -1
  146. package/dist/validators/number.mjs +0 -5
  147. package/dist/validators/number.mjs.map +0 -1
  148. package/dist/validators/quote-response-v1.cjs +0 -31
  149. package/dist/validators/quote-response-v1.cjs.map +0 -1
  150. package/dist/validators/quote-response-v1.d.cts +0 -658
  151. package/dist/validators/quote-response-v1.d.cts.map +0 -1
  152. package/dist/validators/quote-response-v1.d.mts +0 -658
  153. package/dist/validators/quote-response-v1.d.mts.map +0 -1
  154. package/dist/validators/quote-response-v1.mjs +0 -27
  155. package/dist/validators/quote-response-v1.mjs.map +0 -1
  156. package/dist/validators/quote-stream-complete.cjs +0 -29
  157. package/dist/validators/quote-stream-complete.cjs.map +0 -1
  158. package/dist/validators/quote-stream-complete.d.cts +0 -39
  159. package/dist/validators/quote-stream-complete.d.cts.map +0 -1
  160. package/dist/validators/quote-stream-complete.d.mts +0 -39
  161. package/dist/validators/quote-stream-complete.d.mts.map +0 -1
  162. package/dist/validators/quote-stream-complete.mjs +0 -25
  163. package/dist/validators/quote-stream-complete.mjs.map +0 -1
  164. package/dist/validators/quote.cjs +0 -96
  165. package/dist/validators/quote.cjs.map +0 -1
  166. package/dist/validators/quote.d.cts +0 -230
  167. package/dist/validators/quote.d.cts.map +0 -1
  168. package/dist/validators/quote.d.mts +0 -230
  169. package/dist/validators/quote.d.mts.map +0 -1
  170. package/dist/validators/quote.mjs +0 -93
  171. package/dist/validators/quote.mjs.map +0 -1
  172. package/dist/validators/step.cjs +0 -20
  173. package/dist/validators/step.cjs.map +0 -1
  174. package/dist/validators/step.d.cts +0 -148
  175. package/dist/validators/step.d.cts.map +0 -1
  176. package/dist/validators/step.d.mts +0 -148
  177. package/dist/validators/step.d.mts.map +0 -1
  178. package/dist/validators/step.mjs +0 -17
  179. package/dist/validators/step.mjs.map +0 -1
  180. package/dist/validators/token-feature.cjs +0 -22
  181. package/dist/validators/token-feature.cjs.map +0 -1
  182. package/dist/validators/token-feature.d.cts +0 -26
  183. package/dist/validators/token-feature.d.cts.map +0 -1
  184. package/dist/validators/token-feature.d.mts +0 -26
  185. package/dist/validators/token-feature.d.mts.map +0 -1
  186. package/dist/validators/token-feature.mjs +0 -18
  187. package/dist/validators/token-feature.mjs.map +0 -1
  188. package/dist/validators/trade.cjs +0 -94
  189. package/dist/validators/trade.cjs.map +0 -1
  190. package/dist/validators/trade.d.cts +0 -121
  191. package/dist/validators/trade.d.cts.map +0 -1
  192. package/dist/validators/trade.d.mts +0 -121
  193. package/dist/validators/trade.d.mts.map +0 -1
  194. package/dist/validators/trade.mjs +0 -86
  195. package/dist/validators/trade.mjs.map +0 -1
@@ -1,122 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IntentSchema = exports.IntentOrderSchema = void 0;
4
- const superstruct_1 = require("@metamask/superstruct");
5
- const number_1 = require("./number.cjs");
6
- const trade_1 = require("./trade.cjs");
7
- // Allow digit strings for amounts/validTo for flexibility across providers
8
- const DigitStringOrNumberSchema = (0, superstruct_1.union)([number_1.TruthyDigitStringSchema, (0, superstruct_1.number)()]);
9
- /**
10
- * Identifier of the intent protocol used for order creation and submission.
11
- *
12
- * Examples:
13
- * - CoW Swap
14
- * - Other EIP-712–based intent protocols
15
- */
16
- const IntentProtocolSchema = (0, superstruct_1.string)();
17
- /**
18
- * Schema for an intent-based order used for EIP-712 signing and submission.
19
- *
20
- * This represents the minimal subset of fields required by intent-based
21
- * protocols (e.g. CoW Swap) to build, sign, and submit an order.
22
- */
23
- exports.IntentOrderSchema = (0, superstruct_1.type)({
24
- /**
25
- * Address of the token being sold.
26
- */
27
- sellToken: trade_1.HexString,
28
- /**
29
- * Address of the token being bought.
30
- */
31
- buyToken: trade_1.HexString,
32
- /**
33
- * Optional receiver of the bought tokens.
34
- * If omitted, defaults to the signer / order owner.
35
- */
36
- receiver: (0, superstruct_1.optional)(trade_1.HexString),
37
- /**
38
- * Order expiration time.
39
- *
40
- * Can be provided as a UNIX timestamp in seconds, either as a number
41
- * or as a digit string, depending on provider requirements.
42
- */
43
- validTo: DigitStringOrNumberSchema,
44
- /**
45
- * Arbitrary application-specific data attached to the order.
46
- */
47
- appData: (0, superstruct_1.string)(),
48
- /**
49
- * Hash of the `appData` field, used for EIP-712 signing.
50
- */
51
- appDataHash: trade_1.HexString,
52
- /**
53
- * Fee amount paid for order execution, expressed as a digit string.
54
- */
55
- feeAmount: number_1.TruthyDigitStringSchema,
56
- /**
57
- * Order kind.
58
- *
59
- * - `sell`: exact sell amount, variable buy amount
60
- * - `buy`: exact buy amount, variable sell amount
61
- */
62
- kind: (0, superstruct_1.enums)(['sell', 'buy']),
63
- /**
64
- * Whether the order can be partially filled.
65
- */
66
- partiallyFillable: (0, superstruct_1.boolean)(),
67
- /**
68
- * Exact amount of the sell token.
69
- *
70
- * Required for `sell` orders.
71
- */
72
- sellAmount: (0, superstruct_1.optional)(number_1.TruthyDigitStringSchema),
73
- /**
74
- * Exact amount of the buy token.
75
- *
76
- * Required for `buy` orders.
77
- */
78
- buyAmount: (0, superstruct_1.optional)(number_1.TruthyDigitStringSchema),
79
- /**
80
- * Optional order owner / sender address.
81
- *
82
- * Provided for convenience when building the EIP-712 domain and message.
83
- */
84
- from: (0, superstruct_1.optional)(trade_1.HexString),
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
- exports.IntentSchema = (0, superstruct_1.type)({
93
- /**
94
- * Identifier of the intent protocol used to interpret the order.
95
- */
96
- protocol: IntentProtocolSchema,
97
- /**
98
- * The intent order to be signed and submitted.
99
- */
100
- order: exports.IntentOrderSchema,
101
- /**
102
- * Optional settlement contract address used for execution.
103
- */
104
- settlementContract: (0, superstruct_1.optional)(trade_1.HexString),
105
- /**
106
- * Optional EIP-712 typed data payload for signing.
107
- * Must be JSON-serializable and include required EIP-712 fields.
108
- */
109
- typedData: (0, superstruct_1.type)({
110
- // Keep values as `any()` here. Using `unknown()` in this record causes
111
- // TS2321/TS2589 (excessive type instantiation depth) in bridge state
112
- // inference during build.
113
- types: (0, superstruct_1.record)((0, superstruct_1.string)(), (0, superstruct_1.array)((0, superstruct_1.type)({
114
- name: (0, superstruct_1.string)(),
115
- type: (0, superstruct_1.string)(),
116
- }))),
117
- primaryType: (0, superstruct_1.string)(),
118
- domain: (0, superstruct_1.record)((0, superstruct_1.string)(), (0, superstruct_1.any)()),
119
- message: (0, superstruct_1.record)((0, superstruct_1.string)(), (0, superstruct_1.any)()),
120
- }),
121
- });
122
- //# sourceMappingURL=intent.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent.cjs","sourceRoot":"","sources":["../../src/validators/intent.ts"],"names":[],"mappings":";;;AAAA,uDAW+B;AAE/B,yCAAmD;AACnD,uCAAoC;AAEpC,2EAA2E;AAC3E,MAAM,yBAAyB,GAAG,IAAA,mBAAK,EAAC,CAAC,gCAAuB,EAAE,IAAA,oBAAM,GAAE,CAAC,CAAC,CAAC;AAC7E;;;;;;GAMG;AACH,MAAM,oBAAoB,GAAG,IAAA,oBAAM,GAAE,CAAC;AACtC;;;;;GAKG;AAEU,QAAA,iBAAiB,GAAG,IAAA,kBAAI,EAAC;IACpC;;OAEG;IACH,SAAS,EAAE,iBAAS;IAEpB;;OAEG;IACH,QAAQ,EAAE,iBAAS;IAEnB;;;OAGG;IACH,QAAQ,EAAE,IAAA,sBAAQ,EAAC,iBAAS,CAAC;IAE7B;;;;;OAKG;IACH,OAAO,EAAE,yBAAyB;IAElC;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,WAAW,EAAE,iBAAS;IAEtB;;OAEG;IACH,SAAS,EAAE,gCAAuB;IAElC;;;;;OAKG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE5B;;OAEG;IACH,iBAAiB,EAAE,IAAA,qBAAO,GAAE;IAE5B;;;;OAIG;IACH,UAAU,EAAE,IAAA,sBAAQ,EAAC,gCAAuB,CAAC;IAE7C;;;;OAIG;IACH,SAAS,EAAE,IAAA,sBAAQ,EAAC,gCAAuB,CAAC;IAE5C;;;;OAIG;IACH,IAAI,EAAE,IAAA,sBAAQ,EAAC,iBAAS,CAAC;CAC1B,CAAC,CAAC;AACH;;;;;GAKG;AAEU,QAAA,YAAY,GAAG,IAAA,kBAAI,EAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,oBAAoB;IAE9B;;OAEG;IACH,KAAK,EAAE,yBAAiB;IAExB;;OAEG;IACH,kBAAkB,EAAE,IAAA,sBAAQ,EAAC,iBAAS,CAAC;IAEvC;;;OAGG;IACH,SAAS,EAAE,IAAA,kBAAI,EAAC;QACd,uEAAuE;QACvE,qEAAqE;QACrE,0BAA0B;QAC1B,KAAK,EAAE,IAAA,oBAAM,EACX,IAAA,oBAAM,GAAE,EACR,IAAA,mBAAK,EACH,IAAA,kBAAI,EAAC;YACH,IAAI,EAAE,IAAA,oBAAM,GAAE;YACd,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC,CACH,CACF;QACD,WAAW,EAAE,IAAA,oBAAM,GAAE;QACrB,MAAM,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,iBAAG,GAAE,CAAC;QAC/B,OAAO,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,iBAAG,GAAE,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"]}
@@ -1,231 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,231 +0,0 @@
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
@@ -1 +0,0 @@
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"}