@metamask-previews/keyring-api 11.0.0-22cd5fe → 11.0.0-b250745

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 (273) hide show
  1. package/dist/api/account.cjs +3 -8
  2. package/dist/api/account.cjs.map +1 -1
  3. package/dist/api/account.d.cts +1 -6
  4. package/dist/api/account.d.cts.map +1 -1
  5. package/dist/api/account.d.mts +1 -6
  6. package/dist/api/account.d.mts.map +1 -1
  7. package/dist/api/account.mjs +3 -8
  8. package/dist/api/account.mjs.map +1 -1
  9. package/dist/api/balance.cjs +3 -4
  10. package/dist/api/balance.cjs.map +1 -1
  11. package/dist/api/balance.d.cts.map +1 -1
  12. package/dist/api/balance.d.mts.map +1 -1
  13. package/dist/api/balance.mjs +1 -2
  14. package/dist/api/balance.mjs.map +1 -1
  15. package/dist/api/caip.cjs +3 -3
  16. package/dist/api/caip.cjs.map +1 -1
  17. package/dist/api/caip.d.cts.map +1 -1
  18. package/dist/api/caip.d.mts.map +1 -1
  19. package/dist/api/caip.mjs +1 -1
  20. package/dist/api/caip.mjs.map +1 -1
  21. package/dist/api/keyring.cjs +2 -0
  22. package/dist/api/keyring.cjs.map +1 -1
  23. package/dist/api/keyring.d.cts.map +1 -1
  24. package/dist/api/keyring.d.mts.map +1 -1
  25. package/dist/api/keyring.mjs +2 -0
  26. package/dist/api/keyring.mjs.map +1 -1
  27. package/dist/api/request.cjs +6 -7
  28. package/dist/api/request.cjs.map +1 -1
  29. package/dist/api/request.d.cts +3 -3
  30. package/dist/api/request.d.cts.map +1 -1
  31. package/dist/api/request.d.mts +3 -3
  32. package/dist/api/request.d.mts.map +1 -1
  33. package/dist/api/request.mjs +1 -2
  34. package/dist/api/request.mjs.map +1 -1
  35. package/dist/api/response.cjs +6 -6
  36. package/dist/api/response.cjs.map +1 -1
  37. package/dist/api/response.d.cts.map +1 -1
  38. package/dist/api/response.d.mts.map +1 -1
  39. package/dist/api/response.mjs +1 -1
  40. package/dist/api/response.mjs.map +1 -1
  41. package/dist/btc/index.cjs +0 -1
  42. package/dist/btc/index.cjs.map +1 -1
  43. package/dist/btc/index.d.cts +0 -1
  44. package/dist/btc/index.d.cts.map +1 -1
  45. package/dist/btc/index.d.mts +0 -1
  46. package/dist/btc/index.d.mts.map +1 -1
  47. package/dist/btc/index.mjs +0 -1
  48. package/dist/btc/index.mjs.map +1 -1
  49. package/dist/btc/types.cjs +2 -2
  50. package/dist/btc/types.cjs.map +1 -1
  51. package/dist/btc/types.d.cts +1 -3
  52. package/dist/btc/types.d.cts.map +1 -1
  53. package/dist/btc/types.d.mts +1 -3
  54. package/dist/btc/types.d.mts.map +1 -1
  55. package/dist/btc/types.mjs +2 -2
  56. package/dist/btc/types.mjs.map +1 -1
  57. package/dist/eth/erc4337/types.cjs +10 -11
  58. package/dist/eth/erc4337/types.cjs.map +1 -1
  59. package/dist/eth/erc4337/types.d.cts +5 -5
  60. package/dist/eth/erc4337/types.d.cts.map +1 -1
  61. package/dist/eth/erc4337/types.d.mts +5 -5
  62. package/dist/eth/erc4337/types.d.mts.map +1 -1
  63. package/dist/eth/erc4337/types.mjs +1 -2
  64. package/dist/eth/erc4337/types.mjs.map +1 -1
  65. package/dist/eth/index.cjs +0 -1
  66. package/dist/eth/index.cjs.map +1 -1
  67. package/dist/eth/index.d.cts +0 -1
  68. package/dist/eth/index.d.cts.map +1 -1
  69. package/dist/eth/index.d.mts +0 -1
  70. package/dist/eth/index.d.mts.map +1 -1
  71. package/dist/eth/index.mjs +0 -1
  72. package/dist/eth/index.mjs.map +1 -1
  73. package/dist/eth/types.cjs +6 -6
  74. package/dist/eth/types.cjs.map +1 -1
  75. package/dist/eth/types.d.cts +2 -6
  76. package/dist/eth/types.d.cts.map +1 -1
  77. package/dist/eth/types.d.mts +2 -6
  78. package/dist/eth/types.d.mts.map +1 -1
  79. package/dist/eth/types.mjs +1 -1
  80. package/dist/eth/types.mjs.map +1 -1
  81. package/dist/eth/utils.cjs.map +1 -1
  82. package/dist/eth/utils.d.cts.map +1 -1
  83. package/dist/eth/utils.d.mts.map +1 -1
  84. package/dist/eth/utils.mjs.map +1 -1
  85. package/dist/events.cjs +67 -1
  86. package/dist/events.cjs.map +1 -1
  87. package/dist/events.d.cts +161 -0
  88. package/dist/events.d.cts.map +1 -1
  89. package/dist/events.d.mts +161 -0
  90. package/dist/events.d.mts.map +1 -1
  91. package/dist/events.mjs +66 -0
  92. package/dist/events.mjs.map +1 -1
  93. package/dist/index.cjs +2 -8
  94. package/dist/index.cjs.map +1 -1
  95. package/dist/index.d.cts +3 -9
  96. package/dist/index.d.cts.map +1 -1
  97. package/dist/index.d.mts +3 -9
  98. package/dist/index.d.mts.map +1 -1
  99. package/dist/index.mjs +2 -8
  100. package/dist/index.mjs.map +1 -1
  101. package/dist/rpc.cjs.map +1 -0
  102. package/dist/rpc.d.cts.map +1 -0
  103. package/dist/rpc.d.mts.map +1 -0
  104. package/dist/rpc.mjs.map +1 -0
  105. package/dist/sol/index.cjs +0 -1
  106. package/dist/sol/index.cjs.map +1 -1
  107. package/dist/sol/index.d.cts +0 -1
  108. package/dist/sol/index.d.cts.map +1 -1
  109. package/dist/sol/index.d.mts +0 -1
  110. package/dist/sol/index.d.mts.map +1 -1
  111. package/dist/sol/index.mjs +0 -1
  112. package/dist/sol/index.mjs.map +1 -1
  113. package/dist/sol/types.cjs +3 -3
  114. package/dist/sol/types.cjs.map +1 -1
  115. package/dist/sol/types.d.cts +1 -3
  116. package/dist/sol/types.d.cts.map +1 -1
  117. package/dist/sol/types.d.mts +1 -3
  118. package/dist/sol/types.d.mts.map +1 -1
  119. package/dist/sol/types.mjs +1 -1
  120. package/dist/sol/types.mjs.map +1 -1
  121. package/package.json +9 -11
  122. package/dist/JsonRpcRequest.cjs +0 -13
  123. package/dist/JsonRpcRequest.cjs.map +0 -1
  124. package/dist/JsonRpcRequest.d.cts +0 -17
  125. package/dist/JsonRpcRequest.d.cts.map +0 -1
  126. package/dist/JsonRpcRequest.d.mts +0 -17
  127. package/dist/JsonRpcRequest.d.mts.map +0 -1
  128. package/dist/JsonRpcRequest.mjs +0 -10
  129. package/dist/JsonRpcRequest.mjs.map +0 -1
  130. package/dist/KeyringClient.cjs +0 -124
  131. package/dist/KeyringClient.cjs.map +0 -1
  132. package/dist/KeyringClient.d.cts +0 -29
  133. package/dist/KeyringClient.d.cts.map +0 -1
  134. package/dist/KeyringClient.d.mts +0 -29
  135. package/dist/KeyringClient.d.mts.map +0 -1
  136. package/dist/KeyringClient.mjs +0 -120
  137. package/dist/KeyringClient.mjs.map +0 -1
  138. package/dist/KeyringSnapRpcClient.cjs +0 -68
  139. package/dist/KeyringSnapRpcClient.cjs.map +0 -1
  140. package/dist/KeyringSnapRpcClient.d.cts +0 -40
  141. package/dist/KeyringSnapRpcClient.d.cts.map +0 -1
  142. package/dist/KeyringSnapRpcClient.d.mts +0 -40
  143. package/dist/KeyringSnapRpcClient.d.mts.map +0 -1
  144. package/dist/KeyringSnapRpcClient.mjs +0 -63
  145. package/dist/KeyringSnapRpcClient.mjs.map +0 -1
  146. package/dist/btc/constants.cjs +0 -13
  147. package/dist/btc/constants.cjs.map +0 -1
  148. package/dist/btc/constants.d.cts +0 -9
  149. package/dist/btc/constants.d.cts.map +0 -1
  150. package/dist/btc/constants.d.mts +0 -9
  151. package/dist/btc/constants.d.mts.map +0 -1
  152. package/dist/btc/constants.mjs +0 -10
  153. package/dist/btc/constants.mjs.map +0 -1
  154. package/dist/eth/constants.cjs +0 -12
  155. package/dist/eth/constants.cjs.map +0 -1
  156. package/dist/eth/constants.d.cts +0 -8
  157. package/dist/eth/constants.d.cts.map +0 -1
  158. package/dist/eth/constants.d.mts +0 -8
  159. package/dist/eth/constants.d.mts.map +0 -1
  160. package/dist/eth/constants.mjs +0 -9
  161. package/dist/eth/constants.mjs.map +0 -1
  162. package/dist/internal/api.cjs +0 -139
  163. package/dist/internal/api.cjs.map +0 -1
  164. package/dist/internal/api.d.cts +0 -431
  165. package/dist/internal/api.d.cts.map +0 -1
  166. package/dist/internal/api.d.mts +0 -431
  167. package/dist/internal/api.d.mts.map +0 -1
  168. package/dist/internal/api.mjs +0 -136
  169. package/dist/internal/api.mjs.map +0 -1
  170. package/dist/internal/eth/EthKeyring.cjs +0 -3
  171. package/dist/internal/eth/EthKeyring.cjs.map +0 -1
  172. package/dist/internal/eth/EthKeyring.d.cts +0 -34
  173. package/dist/internal/eth/EthKeyring.d.cts.map +0 -1
  174. package/dist/internal/eth/EthKeyring.d.mts +0 -34
  175. package/dist/internal/eth/EthKeyring.d.mts.map +0 -1
  176. package/dist/internal/eth/EthKeyring.mjs +0 -2
  177. package/dist/internal/eth/EthKeyring.mjs.map +0 -1
  178. package/dist/internal/eth/index.cjs +0 -3
  179. package/dist/internal/eth/index.cjs.map +0 -1
  180. package/dist/internal/eth/index.d.cts +0 -2
  181. package/dist/internal/eth/index.d.cts.map +0 -1
  182. package/dist/internal/eth/index.d.mts +0 -2
  183. package/dist/internal/eth/index.d.mts.map +0 -1
  184. package/dist/internal/eth/index.mjs +0 -2
  185. package/dist/internal/eth/index.mjs.map +0 -1
  186. package/dist/internal/events.cjs +0 -72
  187. package/dist/internal/events.cjs.map +0 -1
  188. package/dist/internal/events.d.cts +0 -170
  189. package/dist/internal/events.d.cts.map +0 -1
  190. package/dist/internal/events.d.mts +0 -170
  191. package/dist/internal/events.d.mts.map +0 -1
  192. package/dist/internal/events.mjs +0 -69
  193. package/dist/internal/events.mjs.map +0 -1
  194. package/dist/internal/index.cjs +0 -21
  195. package/dist/internal/index.cjs.map +0 -1
  196. package/dist/internal/index.d.cts +0 -6
  197. package/dist/internal/index.d.cts.map +0 -1
  198. package/dist/internal/index.d.mts +0 -6
  199. package/dist/internal/index.d.mts.map +0 -1
  200. package/dist/internal/index.mjs +0 -5
  201. package/dist/internal/index.mjs.map +0 -1
  202. package/dist/internal/rpc.cjs.map +0 -1
  203. package/dist/internal/rpc.d.cts.map +0 -1
  204. package/dist/internal/rpc.d.mts.map +0 -1
  205. package/dist/internal/rpc.mjs.map +0 -1
  206. package/dist/internal/types.cjs +0 -52
  207. package/dist/internal/types.cjs.map +0 -1
  208. package/dist/internal/types.d.cts +0 -402
  209. package/dist/internal/types.d.cts.map +0 -1
  210. package/dist/internal/types.d.mts +0 -402
  211. package/dist/internal/types.d.mts.map +0 -1
  212. package/dist/internal/types.mjs +0 -49
  213. package/dist/internal/types.mjs.map +0 -1
  214. package/dist/rpc-handler.cjs +0 -136
  215. package/dist/rpc-handler.cjs.map +0 -1
  216. package/dist/rpc-handler.d.cts +0 -30
  217. package/dist/rpc-handler.d.cts.map +0 -1
  218. package/dist/rpc-handler.d.mts +0 -30
  219. package/dist/rpc-handler.d.mts.map +0 -1
  220. package/dist/rpc-handler.mjs +0 -131
  221. package/dist/rpc-handler.mjs.map +0 -1
  222. package/dist/snap-utils.cjs +0 -20
  223. package/dist/snap-utils.cjs.map +0 -1
  224. package/dist/snap-utils.d.cts +0 -12
  225. package/dist/snap-utils.d.cts.map +0 -1
  226. package/dist/snap-utils.d.mts +0 -12
  227. package/dist/snap-utils.d.mts.map +0 -1
  228. package/dist/snap-utils.mjs +0 -17
  229. package/dist/snap-utils.mjs.map +0 -1
  230. package/dist/sol/constants.cjs +0 -14
  231. package/dist/sol/constants.cjs.map +0 -1
  232. package/dist/sol/constants.d.cts +0 -10
  233. package/dist/sol/constants.d.cts.map +0 -1
  234. package/dist/sol/constants.d.mts +0 -10
  235. package/dist/sol/constants.d.mts.map +0 -1
  236. package/dist/sol/constants.mjs +0 -11
  237. package/dist/sol/constants.mjs.map +0 -1
  238. package/dist/superstruct.cjs +0 -80
  239. package/dist/superstruct.cjs.map +0 -1
  240. package/dist/superstruct.d.cts +0 -84
  241. package/dist/superstruct.d.cts.map +0 -1
  242. package/dist/superstruct.d.mts +0 -84
  243. package/dist/superstruct.d.mts.map +0 -1
  244. package/dist/superstruct.mjs +0 -74
  245. package/dist/superstruct.mjs.map +0 -1
  246. package/dist/utils/index.cjs +0 -19
  247. package/dist/utils/index.cjs.map +0 -1
  248. package/dist/utils/index.d.cts +0 -3
  249. package/dist/utils/index.d.cts.map +0 -1
  250. package/dist/utils/index.d.mts +0 -3
  251. package/dist/utils/index.d.mts.map +0 -1
  252. package/dist/utils/index.mjs +0 -3
  253. package/dist/utils/index.mjs.map +0 -1
  254. package/dist/utils/types.cjs +0 -29
  255. package/dist/utils/types.cjs.map +0 -1
  256. package/dist/utils/types.d.cts +0 -18
  257. package/dist/utils/types.d.cts.map +0 -1
  258. package/dist/utils/types.d.mts +0 -18
  259. package/dist/utils/types.d.mts.map +0 -1
  260. package/dist/utils/types.mjs +0 -26
  261. package/dist/utils/types.mjs.map +0 -1
  262. package/dist/utils/typing.cjs +0 -20
  263. package/dist/utils/typing.cjs.map +0 -1
  264. package/dist/utils/typing.d.cts +0 -33
  265. package/dist/utils/typing.d.cts.map +0 -1
  266. package/dist/utils/typing.d.mts +0 -33
  267. package/dist/utils/typing.d.mts.map +0 -1
  268. package/dist/utils/typing.mjs +0 -17
  269. package/dist/utils/typing.mjs.map +0 -1
  270. /package/dist/{internal/rpc.cjs → rpc.cjs} +0 -0
  271. /package/dist/{internal/rpc.d.cts → rpc.d.cts} +0 -0
  272. /package/dist/{internal/rpc.d.mts → rpc.d.mts} +0 -0
  273. /package/dist/{internal/rpc.mjs → rpc.mjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"response.mjs","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AAC/D,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,2BAAuB;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;IACzC,MAAM,CAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC;QAEtB;;;;;;WAMG;QACH,QAAQ,EAAE,aAAa,CACrB,MAAM,CAAC;YACL,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;YAChC,GAAG,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;SAC7B,CAAC,CACH;KACF,CAAC;IACF,MAAM,CAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;QAEvB;;WAEG;QACH,MAAM,EAAE,UAAU;KACnB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { literal, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '../superstruct';\n\nexport const KeyringResponseStruct = union([\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to true indicates that the request will be\n * handled asynchronously. The keyring must be called with `approveRequest`\n * or `rejectRequest` to resolve the request.\n */\n pending: literal(true),\n\n /**\n * Redirect URL.\n *\n * If present in the response, MetaMask will display a confirmation dialog\n * with a link to the redirect URL. The user can choose to follow the link\n * or cancel the request.\n */\n redirect: exactOptional(\n object({\n message: exactOptional(string()),\n url: exactOptional(string()),\n }),\n ),\n }),\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to false indicates that the request will be\n * handled synchronously. The keyring must return the result of the\n * request execution.\n */\n pending: literal(false),\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n]);\n\n/**\n * Response to a call to `submitRequest`.\n *\n * Keyring implementations must return a response with `pending: true` if the\n * request will be handled asynchronously. Otherwise, the response must contain\n * the result of the request and `pending: false`.\n *\n * In the asynchronous case, the keyring can return a redirect URL and message\n * to be shown to the user. The user can choose to follow the link or cancel\n * the request. The main use case for this is to redirect the user to the snap\n * dapp to review the request.\n */\nexport type KeyringResponse = Infer<typeof KeyringResponseStruct>;\n"]}
1
+ {"version":3,"file":"response.mjs","sourceRoot":"","sources":["../../src/api/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,8BAA8B;AAC/D,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;IACzC,MAAM,CAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC;QAEtB;;;;;;WAMG;QACH,QAAQ,EAAE,aAAa,CACrB,MAAM,CAAC;YACL,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;YAChC,GAAG,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;SAC7B,CAAC,CACH;KACF,CAAC;IACF,MAAM,CAAC;QACL;;;;;;WAMG;QACH,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;QAEvB;;WAEG;QACH,MAAM,EAAE,UAAU;KACnB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { literal, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nexport const KeyringResponseStruct = union([\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to true indicates that the request will be\n * handled asynchronously. The keyring must be called with `approveRequest`\n * or `rejectRequest` to resolve the request.\n */\n pending: literal(true),\n\n /**\n * Redirect URL.\n *\n * If present in the response, MetaMask will display a confirmation dialog\n * with a link to the redirect URL. The user can choose to follow the link\n * or cancel the request.\n */\n redirect: exactOptional(\n object({\n message: exactOptional(string()),\n url: exactOptional(string()),\n }),\n ),\n }),\n object({\n /**\n * Pending flag.\n *\n * Setting the pending flag to false indicates that the request will be\n * handled synchronously. The keyring must return the result of the\n * request execution.\n */\n pending: literal(false),\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n]);\n\n/**\n * Response to a call to `submitRequest`.\n *\n * Keyring implementations must return a response with `pending: true` if the\n * request will be handled asynchronously. Otherwise, the response must contain\n * the result of the request and `pending: false`.\n *\n * In the asynchronous case, the keyring can return a redirect URL and message\n * to be shown to the user. The user can choose to follow the link or cancel\n * the request. The main use case for this is to redirect the user to the snap\n * dapp to review the request.\n */\nexport type KeyringResponse = Infer<typeof KeyringResponseStruct>;\n"]}
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./constants.cjs"), exports);
18
17
  __exportStar(require("./types.cjs"), exports);
19
18
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,8CAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB","sourcesContent":["export * from './types';\n"]}
@@ -1,3 +1,2 @@
1
- export * from "./constants.cjs";
2
1
  export * from "./types.cjs";
3
2
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
@@ -1,3 +1,2 @@
1
- export * from "./constants.mjs";
2
1
  export * from "./types.mjs";
3
2
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
@@ -1,3 +1,2 @@
1
- export * from "./constants.mjs";
2
1
  export * from "./types.mjs";
3
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB","sourcesContent":["export * from './types';\n"]}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BtcP2wpkhAccountStruct = exports.BtcMethod = exports.BtcP2wpkhAddressStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
4
5
  const superstruct_1 = require("@metamask/superstruct");
5
6
  const bech32_1 = require("bech32");
6
7
  const api_1 = require("../api/index.cjs");
7
- const superstruct_2 = require("../superstruct.cjs");
8
8
  exports.BtcP2wpkhAddressStruct = (0, superstruct_1.refine)((0, superstruct_1.string)(), 'BtcP2wpkhAddressStruct', (address) => {
9
9
  try {
10
10
  bech32_1.bech32.decode(address);
@@ -22,7 +22,7 @@ var BtcMethod;
22
22
  // General transaction methods
23
23
  BtcMethod["SendBitcoin"] = "sendBitcoin";
24
24
  })(BtcMethod || (exports.BtcMethod = BtcMethod = {}));
25
- exports.BtcP2wpkhAccountStruct = (0, superstruct_2.object)({
25
+ exports.BtcP2wpkhAccountStruct = (0, keyring_utils_1.object)({
26
26
  ...api_1.KeyringAccountStruct.schema,
27
27
  /**
28
28
  * Account address.
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":";;;AACA,uDAA8E;AAC9E,mCAAgC;AAEhC,0CAA8D;AAC9D,oDAAwC;AAE3B,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAC1C,IAAA,oBAAM,GAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,eAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAAC;IAC3C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,8BAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { KeyringAccountStruct, BtcAccountType } from '../api';\nimport { object } from '../superstruct';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAA8E;AAC9E,mCAAgC;AAEhC,0CAA8D;AAEjD,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAC1C,IAAA,oBAAM,GAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,eAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,sBAAsB,GAAG,IAAA,sBAAM,EAAC;IAC3C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,8BAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { BtcAccountType, KeyringAccountStruct } from '../api';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
@@ -7,10 +7,9 @@ export declare enum BtcMethod {
7
7
  SendBitcoin = "sendBitcoin"
8
8
  }
9
9
  export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Struct<{
10
- type: "bip122:p2wpkh";
11
10
  id: string;
11
+ type: "bip122:p2wpkh";
12
12
  address: string;
13
- scopes: string[];
14
13
  options: Record<string, import("@metamask/utils").Json>;
15
14
  methods: "sendBitcoin"[];
16
15
  }, {
@@ -29,7 +28,6 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
29
28
  sendBitcoin: "sendBitcoin";
30
29
  }>>;
31
30
  id: import("@metamask/superstruct").Struct<string, null>;
32
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
33
31
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
34
32
  }>;
35
33
  export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -7,10 +7,9 @@ export declare enum BtcMethod {
7
7
  SendBitcoin = "sendBitcoin"
8
8
  }
9
9
  export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Struct<{
10
- type: "bip122:p2wpkh";
11
10
  id: string;
11
+ type: "bip122:p2wpkh";
12
12
  address: string;
13
- scopes: string[];
14
13
  options: Record<string, import("@metamask/utils").Json>;
15
14
  methods: "sendBitcoin"[];
16
15
  }, {
@@ -29,7 +28,6 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
29
28
  sendBitcoin: "sendBitcoin";
30
29
  }>>;
31
30
  id: import("@metamask/superstruct").Struct<string, null>;
32
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
33
31
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
34
32
  }>;
35
33
  export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
+ import { object } from "@metamask/keyring-utils";
1
2
  import { string, array, enums, refine, literal } from "@metamask/superstruct";
2
3
  import { bech32 } from "bech32";
3
- import { KeyringAccountStruct, BtcAccountType } from "../api/index.mjs";
4
- import { object } from "../superstruct.mjs";
4
+ import { BtcAccountType, KeyringAccountStruct } from "../api/index.mjs";
5
5
  export const BtcP2wpkhAddressStruct = refine(string(), 'BtcP2wpkhAddressStruct', (address) => {
6
6
  try {
7
7
  bech32.decode(address);
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B;AAC9E,OAAO,EAAE,MAAM,EAAE,eAAe;AAEhC,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,yBAAe;AAC9D,OAAO,EAAE,MAAM,EAAE,2BAAuB;AAExC,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAC1C,MAAM,EAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,sBAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { KeyringAccountStruct, BtcAccountType } from '../api';\nimport { object } from '../superstruct';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B;AAC9E,OAAO,EAAE,MAAM,EAAE,eAAe;AAEhC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,yBAAe;AAE9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAC1C,MAAM,EAAE,EACR,wBAAwB,EACxB,CAAC,OAAe,EAAE,EAAE;IAClB,IAAI,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,KAAK,CACd,oCAAqC,KAAe,CAAC,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA8B;IAC9B,wCAA2B,CAAA;AAC7B,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,sBAAsB;IAE/B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;IAEzC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { string, array, enums, refine, literal } from '@metamask/superstruct';\nimport { bech32 } from 'bech32';\n\nimport { BtcAccountType, KeyringAccountStruct } from '../api';\n\nexport const BtcP2wpkhAddressStruct = refine(\n string(),\n 'BtcP2wpkhAddressStruct',\n (address: string) => {\n try {\n bech32.decode(address);\n } catch (error) {\n return new Error(\n `Could not decode P2WPKH address: ${(error as Error).message}`,\n );\n }\n return true;\n },\n);\n\n/**\n * Supported Bitcoin methods.\n */\nexport enum BtcMethod {\n // General transaction methods\n SendBitcoin = 'sendBitcoin',\n}\n\nexport const BtcP2wpkhAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: BtcP2wpkhAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${BtcAccountType.P2wpkh}`),\n\n /**\n * Account supported methods.\n */\n methods: array(enums([`${BtcMethod.SendBitcoin}`])),\n});\n\nexport type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;\n"]}
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EthUserOperationPatchStruct = exports.EthBaseUserOperationStruct = exports.EthBaseTransactionStruct = exports.EthUserOperationStruct = void 0;
4
- const superstruct_1 = require("../../superstruct.cjs");
5
- const utils_1 = require("../../utils/index.cjs");
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
6
5
  const types_1 = require("../types.cjs");
7
6
  /**
8
7
  * Struct of a UserOperation as defined by ERC-4337.
9
8
  *
10
9
  * @see https://eips.ethereum.org/EIPS/eip-4337#definitions
11
10
  */
12
- exports.EthUserOperationStruct = (0, superstruct_1.object)({
11
+ exports.EthUserOperationStruct = (0, keyring_utils_1.object)({
13
12
  sender: types_1.EthAddressStruct,
14
13
  nonce: types_1.EthUint256Struct,
15
14
  initCode: types_1.EthBytesStruct,
@@ -26,7 +25,7 @@ exports.EthUserOperationStruct = (0, superstruct_1.object)({
26
25
  * Struct containing the most basic transaction information required to
27
26
  * construct a UserOperation.
28
27
  */
29
- exports.EthBaseTransactionStruct = (0, superstruct_1.object)({
28
+ exports.EthBaseTransactionStruct = (0, keyring_utils_1.object)({
30
29
  /**
31
30
  * Address of the transaction recipient.
32
31
  */
@@ -40,23 +39,23 @@ exports.EthBaseTransactionStruct = (0, superstruct_1.object)({
40
39
  */
41
40
  data: types_1.EthBytesStruct,
42
41
  });
43
- exports.EthBaseUserOperationStruct = (0, superstruct_1.object)({
42
+ exports.EthBaseUserOperationStruct = (0, keyring_utils_1.object)({
44
43
  nonce: types_1.EthUint256Struct,
45
44
  initCode: types_1.EthBytesStruct,
46
45
  callData: types_1.EthBytesStruct,
47
- gasLimits: (0, superstruct_1.exactOptional)((0, superstruct_1.object)({
46
+ gasLimits: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
48
47
  callGasLimit: types_1.EthUint256Struct,
49
48
  verificationGasLimit: types_1.EthUint256Struct,
50
49
  preVerificationGas: types_1.EthUint256Struct,
51
50
  })),
52
51
  dummyPaymasterAndData: types_1.EthBytesStruct,
53
52
  dummySignature: types_1.EthBytesStruct,
54
- bundlerUrl: utils_1.UrlStruct,
53
+ bundlerUrl: keyring_utils_1.UrlStruct,
55
54
  });
56
- exports.EthUserOperationPatchStruct = (0, superstruct_1.object)({
55
+ exports.EthUserOperationPatchStruct = (0, keyring_utils_1.object)({
57
56
  paymasterAndData: types_1.EthBytesStruct,
58
- callGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
59
- verificationGasLimit: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
60
- preVerificationGas: (0, superstruct_1.exactOptional)(types_1.EthUint256Struct),
57
+ callGasLimit: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
58
+ verificationGasLimit: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
59
+ preVerificationGas: (0, keyring_utils_1.exactOptional)(types_1.EthUint256Struct),
61
60
  });
62
61
  //# sourceMappingURL=types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAEA,uDAA0D;AAC1D,iDAAwC;AACxC,wCAA8E;AAE9E;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,IAAA,oBAAM,EAAC;IAC3C,MAAM,EAAE,wBAAgB;IACxB,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,kBAAkB,EAAE,wBAAgB;IACpC,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,gBAAgB,EAAE,sBAAc;IAChC,SAAS,EAAE,sBAAc;CAC1B,CAAC,CAAC;AAIH;;;GAGG;AACU,QAAA,wBAAwB,GAAG,IAAA,oBAAM,EAAC;IAC7C;;OAEG;IACH,EAAE,EAAE,wBAAgB;IAEpB;;OAEG;IACH,KAAK,EAAE,wBAAgB;IAEvB;;OAEG;IACH,IAAI,EAAE,sBAAc;CACrB,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,SAAS,EAAE,IAAA,2BAAa,EACtB,IAAA,oBAAM,EAAC;QACL,YAAY,EAAE,wBAAgB;QAC9B,oBAAoB,EAAE,wBAAgB;QACtC,kBAAkB,EAAE,wBAAgB;KACrC,CAAC,CACH;IACD,qBAAqB,EAAE,sBAAc;IACrC,cAAc,EAAE,sBAAc;IAC9B,UAAU,EAAE,iBAAS;CACtB,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,oBAAM,EAAC;IAChD,gBAAgB,EAAE,sBAAc;IAChC,YAAY,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;IAC7C,oBAAoB,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;IACrD,kBAAkB,EAAE,IAAA,2BAAa,EAAC,wBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { type Infer } from '@metamask/superstruct';\n\nimport { exactOptional, object } from '../../superstruct';\nimport { UrlStruct } from '../../utils';\nimport { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types';\n\n/**\n * Struct of a UserOperation as defined by ERC-4337.\n *\n * @see https://eips.ethereum.org/EIPS/eip-4337#definitions\n */\nexport const EthUserOperationStruct = object({\n sender: EthAddressStruct,\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n maxFeePerGas: EthUint256Struct,\n maxPriorityFeePerGas: EthUint256Struct,\n paymasterAndData: EthBytesStruct,\n signature: EthBytesStruct,\n});\n\nexport type EthUserOperation = Infer<typeof EthUserOperationStruct>;\n\n/**\n * Struct containing the most basic transaction information required to\n * construct a UserOperation.\n */\nexport const EthBaseTransactionStruct = object({\n /**\n * Address of the transaction recipient.\n */\n to: EthAddressStruct,\n\n /**\n * Amount of wei to transfer to the recipient.\n */\n value: EthUint256Struct,\n\n /**\n * Data to pass to the recipient.\n */\n data: EthBytesStruct,\n});\n\nexport type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;\n\nexport const EthBaseUserOperationStruct = object({\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n gasLimits: exactOptional(\n object({\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n }),\n ),\n dummyPaymasterAndData: EthBytesStruct,\n dummySignature: EthBytesStruct,\n bundlerUrl: UrlStruct,\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n callGasLimit: exactOptional(EthUint256Struct),\n verificationGasLimit: exactOptional(EthUint256Struct),\n preVerificationGas: exactOptional(EthUint256Struct),\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":";;;AAAA,2DAA2E;AAG3E,wCAA8E;AAE9E;;;;GAIG;AACU,QAAA,sBAAsB,GAAG,IAAA,sBAAM,EAAC;IAC3C,MAAM,EAAE,wBAAgB;IACxB,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,kBAAkB,EAAE,wBAAgB;IACpC,YAAY,EAAE,wBAAgB;IAC9B,oBAAoB,EAAE,wBAAgB;IACtC,gBAAgB,EAAE,sBAAc;IAChC,SAAS,EAAE,sBAAc;CAC1B,CAAC,CAAC;AAIH;;;GAGG;AACU,QAAA,wBAAwB,GAAG,IAAA,sBAAM,EAAC;IAC7C;;OAEG;IACH,EAAE,EAAE,wBAAgB;IAEpB;;OAEG;IACH,KAAK,EAAE,wBAAgB;IAEvB;;OAEG;IACH,IAAI,EAAE,sBAAc;CACrB,CAAC,CAAC;AAIU,QAAA,0BAA0B,GAAG,IAAA,sBAAM,EAAC;IAC/C,KAAK,EAAE,wBAAgB;IACvB,QAAQ,EAAE,sBAAc;IACxB,QAAQ,EAAE,sBAAc;IACxB,SAAS,EAAE,IAAA,6BAAa,EACtB,IAAA,sBAAM,EAAC;QACL,YAAY,EAAE,wBAAgB;QAC9B,oBAAoB,EAAE,wBAAgB;QACtC,kBAAkB,EAAE,wBAAgB;KACrC,CAAC,CACH;IACD,qBAAqB,EAAE,sBAAc;IACrC,cAAc,EAAE,sBAAc;IAC9B,UAAU,EAAE,yBAAS;CACtB,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,gBAAgB,EAAE,sBAAc;IAChC,YAAY,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;IAC7C,oBAAoB,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;IACrD,kBAAkB,EAAE,IAAA,6BAAa,EAAC,wBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UrlStruct } from '@metamask/keyring-utils';\nimport { type Infer } from '@metamask/superstruct';\n\nimport { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types';\n\n/**\n * Struct of a UserOperation as defined by ERC-4337.\n *\n * @see https://eips.ethereum.org/EIPS/eip-4337#definitions\n */\nexport const EthUserOperationStruct = object({\n sender: EthAddressStruct,\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n maxFeePerGas: EthUint256Struct,\n maxPriorityFeePerGas: EthUint256Struct,\n paymasterAndData: EthBytesStruct,\n signature: EthBytesStruct,\n});\n\nexport type EthUserOperation = Infer<typeof EthUserOperationStruct>;\n\n/**\n * Struct containing the most basic transaction information required to\n * construct a UserOperation.\n */\nexport const EthBaseTransactionStruct = object({\n /**\n * Address of the transaction recipient.\n */\n to: EthAddressStruct,\n\n /**\n * Amount of wei to transfer to the recipient.\n */\n value: EthUint256Struct,\n\n /**\n * Data to pass to the recipient.\n */\n data: EthBytesStruct,\n});\n\nexport type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;\n\nexport const EthBaseUserOperationStruct = object({\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n gasLimits: exactOptional(\n object({\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n }),\n ),\n dummyPaymasterAndData: EthBytesStruct,\n dummySignature: EthBytesStruct,\n bundlerUrl: UrlStruct,\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n callGasLimit: exactOptional(EthUint256Struct),\n verificationGasLimit: exactOptional(EthUint256Struct),\n preVerificationGas: exactOptional(EthUint256Struct),\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
@@ -36,8 +36,8 @@ export type EthUserOperation = Infer<typeof EthUserOperationStruct>;
36
36
  */
37
37
  export declare const EthBaseTransactionStruct: import("@metamask/superstruct").Struct<{
38
38
  value: string;
39
- data: string;
40
39
  to: string;
40
+ data: string;
41
41
  }, {
42
42
  /**
43
43
  * Address of the transaction recipient.
@@ -69,7 +69,7 @@ export declare const EthBaseUserOperationStruct: import("@metamask/superstruct")
69
69
  nonce: import("@metamask/superstruct").Struct<string, null>;
70
70
  initCode: import("@metamask/superstruct").Struct<string, null>;
71
71
  callData: import("@metamask/superstruct").Struct<string, null>;
72
- gasLimits: import("@metamask/superstruct").Struct<import("../../superstruct.cjs").ExactOptionalTag | {
72
+ gasLimits: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
73
73
  callGasLimit: string;
74
74
  verificationGasLimit: string;
75
75
  preVerificationGas: string;
@@ -90,9 +90,9 @@ export declare const EthUserOperationPatchStruct: import("@metamask/superstruct"
90
90
  preVerificationGas?: string;
91
91
  }, {
92
92
  paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
93
- callGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
94
- verificationGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
95
- preVerificationGas: import("@metamask/superstruct").Struct<string | import("../../superstruct.cjs").ExactOptionalTag, null>;
93
+ callGasLimit: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
94
+ verificationGasLimit: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
95
+ preVerificationGas: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
96
96
  }>;
97
97
  export type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
98
98
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,8BAA8B;AAMnD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAYjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;IACnC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;;;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,8BAA8B;AAInD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAYjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;IACnC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;;;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -36,8 +36,8 @@ export type EthUserOperation = Infer<typeof EthUserOperationStruct>;
36
36
  */
37
37
  export declare const EthBaseTransactionStruct: import("@metamask/superstruct").Struct<{
38
38
  value: string;
39
- data: string;
40
39
  to: string;
40
+ data: string;
41
41
  }, {
42
42
  /**
43
43
  * Address of the transaction recipient.
@@ -69,7 +69,7 @@ export declare const EthBaseUserOperationStruct: import("@metamask/superstruct")
69
69
  nonce: import("@metamask/superstruct").Struct<string, null>;
70
70
  initCode: import("@metamask/superstruct").Struct<string, null>;
71
71
  callData: import("@metamask/superstruct").Struct<string, null>;
72
- gasLimits: import("@metamask/superstruct").Struct<import("../../superstruct.mjs").ExactOptionalTag | {
72
+ gasLimits: import("@metamask/superstruct").Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
73
73
  callGasLimit: string;
74
74
  verificationGasLimit: string;
75
75
  preVerificationGas: string;
@@ -90,9 +90,9 @@ export declare const EthUserOperationPatchStruct: import("@metamask/superstruct"
90
90
  preVerificationGas?: string;
91
91
  }, {
92
92
  paymasterAndData: import("@metamask/superstruct").Struct<string, null>;
93
- callGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct.mjs").ExactOptionalTag, null>;
94
- verificationGasLimit: import("@metamask/superstruct").Struct<string | import("../../superstruct.mjs").ExactOptionalTag, null>;
95
- preVerificationGas: import("@metamask/superstruct").Struct<string | import("../../superstruct.mjs").ExactOptionalTag, null>;
93
+ callGasLimit: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
94
+ verificationGasLimit: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
95
+ preVerificationGas: import("@metamask/superstruct").Struct<string | import("@metamask/keyring-utils").ExactOptionalTag, null>;
96
96
  }>;
97
97
  export type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;
98
98
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,8BAA8B;AAMnD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAYjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;IACnC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;;;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,8BAA8B;AAInD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAYjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;IACnC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;;;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -1,5 +1,4 @@
1
- import { exactOptional, object } from "../../superstruct.mjs";
2
- import { UrlStruct } from "../../utils/index.mjs";
1
+ import { exactOptional, object, UrlStruct } from "@metamask/keyring-utils";
3
2
  import { EthAddressStruct, EthBytesStruct, EthUint256Struct } from "../types.mjs";
4
3
  /**
5
4
  * Struct of a UserOperation as defined by ERC-4337.
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,8BAA0B;AAC1D,OAAO,EAAE,SAAS,EAAE,8BAAoB;AACxC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,qBAAiB;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc;IACxB,YAAY,EAAE,gBAAgB;IAC9B,oBAAoB,EAAE,gBAAgB;IACtC,kBAAkB,EAAE,gBAAgB;IACpC,YAAY,EAAE,gBAAgB;IAC9B,oBAAoB,EAAE,gBAAgB;IACtC,gBAAgB,EAAE,cAAc;IAChC,SAAS,EAAE,cAAc;CAC1B,CAAC,CAAC;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;IAC7C;;OAEG;IACH,EAAE,EAAE,gBAAgB;IAEpB;;OAEG;IACH,KAAK,EAAE,gBAAgB;IAEvB;;OAEG;IACH,IAAI,EAAE,cAAc;CACrB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;IAC/C,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc;IACxB,SAAS,EAAE,aAAa,CACtB,MAAM,CAAC;QACL,YAAY,EAAE,gBAAgB;QAC9B,oBAAoB,EAAE,gBAAgB;QACtC,kBAAkB,EAAE,gBAAgB;KACrC,CAAC,CACH;IACD,qBAAqB,EAAE,cAAc;IACrC,cAAc,EAAE,cAAc;IAC9B,UAAU,EAAE,SAAS;CACtB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,gBAAgB,EAAE,cAAc;IAChC,YAAY,EAAE,aAAa,CAAC,gBAAgB,CAAC;IAC7C,oBAAoB,EAAE,aAAa,CAAC,gBAAgB,CAAC;IACrD,kBAAkB,EAAE,aAAa,CAAC,gBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { type Infer } from '@metamask/superstruct';\n\nimport { exactOptional, object } from '../../superstruct';\nimport { UrlStruct } from '../../utils';\nimport { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types';\n\n/**\n * Struct of a UserOperation as defined by ERC-4337.\n *\n * @see https://eips.ethereum.org/EIPS/eip-4337#definitions\n */\nexport const EthUserOperationStruct = object({\n sender: EthAddressStruct,\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n maxFeePerGas: EthUint256Struct,\n maxPriorityFeePerGas: EthUint256Struct,\n paymasterAndData: EthBytesStruct,\n signature: EthBytesStruct,\n});\n\nexport type EthUserOperation = Infer<typeof EthUserOperationStruct>;\n\n/**\n * Struct containing the most basic transaction information required to\n * construct a UserOperation.\n */\nexport const EthBaseTransactionStruct = object({\n /**\n * Address of the transaction recipient.\n */\n to: EthAddressStruct,\n\n /**\n * Amount of wei to transfer to the recipient.\n */\n value: EthUint256Struct,\n\n /**\n * Data to pass to the recipient.\n */\n data: EthBytesStruct,\n});\n\nexport type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;\n\nexport const EthBaseUserOperationStruct = object({\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n gasLimits: exactOptional(\n object({\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n }),\n ),\n dummyPaymasterAndData: EthBytesStruct,\n dummySignature: EthBytesStruct,\n bundlerUrl: UrlStruct,\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n callGasLimit: exactOptional(EthUint256Struct),\n verificationGasLimit: exactOptional(EthUint256Struct),\n preVerificationGas: exactOptional(EthUint256Struct),\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/eth/erc4337/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,gCAAgC;AAG3E,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,qBAAiB;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc;IACxB,YAAY,EAAE,gBAAgB;IAC9B,oBAAoB,EAAE,gBAAgB;IACtC,kBAAkB,EAAE,gBAAgB;IACpC,YAAY,EAAE,gBAAgB;IAC9B,oBAAoB,EAAE,gBAAgB;IACtC,gBAAgB,EAAE,cAAc;IAChC,SAAS,EAAE,cAAc;CAC1B,CAAC,CAAC;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;IAC7C;;OAEG;IACH,EAAE,EAAE,gBAAgB;IAEpB;;OAEG;IACH,KAAK,EAAE,gBAAgB;IAEvB;;OAEG;IACH,IAAI,EAAE,cAAc;CACrB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;IAC/C,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc;IACxB,SAAS,EAAE,aAAa,CACtB,MAAM,CAAC;QACL,YAAY,EAAE,gBAAgB;QAC9B,oBAAoB,EAAE,gBAAgB;QACtC,kBAAkB,EAAE,gBAAgB;KACrC,CAAC,CACH;IACD,qBAAqB,EAAE,cAAc;IACrC,cAAc,EAAE,cAAc;IAC9B,UAAU,EAAE,SAAS;CACtB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,gBAAgB,EAAE,cAAc;IAChC,YAAY,EAAE,aAAa,CAAC,gBAAgB,CAAC;IAC7C,oBAAoB,EAAE,aAAa,CAAC,gBAAgB,CAAC;IACrD,kBAAkB,EAAE,aAAa,CAAC,gBAAgB,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import { exactOptional, object, UrlStruct } from '@metamask/keyring-utils';\nimport { type Infer } from '@metamask/superstruct';\n\nimport { EthAddressStruct, EthBytesStruct, EthUint256Struct } from '../types';\n\n/**\n * Struct of a UserOperation as defined by ERC-4337.\n *\n * @see https://eips.ethereum.org/EIPS/eip-4337#definitions\n */\nexport const EthUserOperationStruct = object({\n sender: EthAddressStruct,\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n maxFeePerGas: EthUint256Struct,\n maxPriorityFeePerGas: EthUint256Struct,\n paymasterAndData: EthBytesStruct,\n signature: EthBytesStruct,\n});\n\nexport type EthUserOperation = Infer<typeof EthUserOperationStruct>;\n\n/**\n * Struct containing the most basic transaction information required to\n * construct a UserOperation.\n */\nexport const EthBaseTransactionStruct = object({\n /**\n * Address of the transaction recipient.\n */\n to: EthAddressStruct,\n\n /**\n * Amount of wei to transfer to the recipient.\n */\n value: EthUint256Struct,\n\n /**\n * Data to pass to the recipient.\n */\n data: EthBytesStruct,\n});\n\nexport type EthBaseTransaction = Infer<typeof EthBaseTransactionStruct>;\n\nexport const EthBaseUserOperationStruct = object({\n nonce: EthUint256Struct,\n initCode: EthBytesStruct,\n callData: EthBytesStruct,\n gasLimits: exactOptional(\n object({\n callGasLimit: EthUint256Struct,\n verificationGasLimit: EthUint256Struct,\n preVerificationGas: EthUint256Struct,\n }),\n ),\n dummyPaymasterAndData: EthBytesStruct,\n dummySignature: EthBytesStruct,\n bundlerUrl: UrlStruct,\n});\n\nexport type EthBaseUserOperation = Infer<typeof EthBaseUserOperationStruct>;\n\nexport const EthUserOperationPatchStruct = object({\n paymasterAndData: EthBytesStruct,\n callGasLimit: exactOptional(EthUint256Struct),\n verificationGasLimit: exactOptional(EthUint256Struct),\n preVerificationGas: exactOptional(EthUint256Struct),\n});\n\nexport type EthUserOperationPatch = Infer<typeof EthUserOperationPatchStruct>;\n"]}
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./constants.cjs"), exports);
18
17
  __exportStar(require("./erc4337/index.cjs"), exports);
19
18
  __exportStar(require("./types.cjs"), exports);
20
19
  __exportStar(require("./utils.cjs"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,sDAA0B;AAC1B,8CAAwB;AACxB,8CAAwB","sourcesContent":["export * from './constants';\nexport * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAA0B;AAC1B,8CAAwB;AACxB,8CAAwB","sourcesContent":["export * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
@@ -1,4 +1,3 @@
1
- export * from "./constants.cjs";
2
1
  export * from "./erc4337/index.cjs";
3
2
  export * from "./types.cjs";
4
3
  export * from "./utils.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
@@ -1,4 +1,3 @@
1
- export * from "./constants.mjs";
2
1
  export * from "./erc4337/index.mjs";
3
2
  export * from "./types.mjs";
4
3
  export * from "./utils.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
@@ -1,4 +1,3 @@
1
- export * from "./constants.mjs";
2
1
  export * from "./erc4337/index.mjs";
3
2
  export * from "./types.mjs";
4
3
  export * from "./utils.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB","sourcesContent":["export * from './constants';\nexport * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB","sourcesContent":["export * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EthErc4337AccountStruct = exports.EthEoaAccountStruct = exports.EthMethod = exports.EthUint256Struct = exports.EthAddressStruct = exports.EthBytesStruct = void 0;
4
+ const keyring_utils_1 = require("@metamask/keyring-utils");
4
5
  const superstruct_1 = require("@metamask/superstruct");
5
6
  const api_1 = require("../api/index.cjs");
6
- const superstruct_2 = require("../superstruct.cjs");
7
- exports.EthBytesStruct = (0, superstruct_2.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
8
- exports.EthAddressStruct = (0, superstruct_2.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
9
- exports.EthUint256Struct = (0, superstruct_2.definePattern)('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
7
+ exports.EthBytesStruct = (0, keyring_utils_1.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
8
+ exports.EthAddressStruct = (0, keyring_utils_1.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
9
+ exports.EthUint256Struct = (0, keyring_utils_1.definePattern)('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
10
10
  /**
11
11
  * Supported Ethereum methods.
12
12
  */
@@ -24,7 +24,7 @@ var EthMethod;
24
24
  EthMethod["PatchUserOperation"] = "eth_patchUserOperation";
25
25
  EthMethod["SignUserOperation"] = "eth_signUserOperation";
26
26
  })(EthMethod || (exports.EthMethod = EthMethod = {}));
27
- exports.EthEoaAccountStruct = (0, superstruct_2.object)({
27
+ exports.EthEoaAccountStruct = (0, keyring_utils_1.object)({
28
28
  ...api_1.KeyringAccountStruct.schema,
29
29
  /**
30
30
  * Account address.
@@ -46,7 +46,7 @@ exports.EthEoaAccountStruct = (0, superstruct_2.object)({
46
46
  `${EthMethod.SignTypedDataV4}`,
47
47
  ])),
48
48
  });
49
- exports.EthErc4337AccountStruct = (0, superstruct_2.object)({
49
+ exports.EthErc4337AccountStruct = (0, keyring_utils_1.object)({
50
50
  ...api_1.KeyringAccountStruct.schema,
51
51
  /**
52
52
  * Account address.
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AACA,uDAA8D;AAE9D,0CAA8D;AAC9D,oDAAuD;AAE1C,QAAA,cAAc,GAAG,IAAA,2BAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,2BAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,2BAAa,EAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,oBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;KAC/B,CAAC,CACH;CACF,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IAC5C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,oBAAoB,EAAE;QACnC,GAAG,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/superstruct';\n\nimport { EthAccountType, KeyringAccountStruct } from '../api';\nimport { object, definePattern } from '../superstruct';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,uDAA8D;AAE9D,0CAA8D;AAEjD,QAAA,cAAc,GAAG,IAAA,6BAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,sBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;KAC/B,CAAC,CACH;CACF,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAG,IAAA,sBAAM,EAAC;IAC5C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,oBAAoB,EAAE;QACnC,GAAG,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import { object, definePattern } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/superstruct';\n\nimport { EthAccountType, KeyringAccountStruct } from '../api';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
@@ -17,10 +17,9 @@ export declare enum EthMethod {
17
17
  SignUserOperation = "eth_signUserOperation"
18
18
  }
19
19
  export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct<{
20
- type: "eip155:eoa";
21
20
  id: string;
21
+ type: "eip155:eoa";
22
22
  address: string;
23
- scopes: string[];
24
23
  options: Record<string, import("@metamask/utils").Json>;
25
24
  methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
26
25
  }, {
@@ -44,15 +43,13 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
44
43
  eth_signTypedData_v4: "eth_signTypedData_v4";
45
44
  }>>;
46
45
  id: import("@metamask/superstruct").Struct<string, null>;
47
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
48
46
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
49
47
  }>;
50
48
  export type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
51
49
  export declare const EthErc4337AccountStruct: import("@metamask/superstruct").Struct<{
52
- type: "eip155:erc4337";
53
50
  id: string;
51
+ type: "eip155:erc4337";
54
52
  address: string;
55
- scopes: string[];
56
53
  options: Record<string, import("@metamask/utils").Json>;
57
54
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
58
55
  }, {
@@ -78,7 +75,6 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
78
75
  eth_signUserOperation: "eth_signUserOperation";
79
76
  }>>;
80
77
  id: import("@metamask/superstruct").Struct<string, null>;
81
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
82
78
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
83
79
  }>;
84
80
  export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -17,10 +17,9 @@ export declare enum EthMethod {
17
17
  SignUserOperation = "eth_signUserOperation"
18
18
  }
19
19
  export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct<{
20
- type: "eip155:eoa";
21
20
  id: string;
21
+ type: "eip155:eoa";
22
22
  address: string;
23
- scopes: string[];
24
23
  options: Record<string, import("@metamask/utils").Json>;
25
24
  methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
26
25
  }, {
@@ -44,15 +43,13 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
44
43
  eth_signTypedData_v4: "eth_signTypedData_v4";
45
44
  }>>;
46
45
  id: import("@metamask/superstruct").Struct<string, null>;
47
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
48
46
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
49
47
  }>;
50
48
  export type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;
51
49
  export declare const EthErc4337AccountStruct: import("@metamask/superstruct").Struct<{
52
- type: "eip155:erc4337";
53
50
  id: string;
51
+ type: "eip155:erc4337";
54
52
  address: string;
55
- scopes: string[];
56
53
  options: Record<string, import("@metamask/utils").Json>;
57
54
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
58
55
  }, {
@@ -78,7 +75,6 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
78
75
  eth_signUserOperation: "eth_signUserOperation";
79
76
  }>>;
80
77
  id: import("@metamask/superstruct").Struct<string, null>;
81
- scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
82
78
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
83
79
  }>;
84
80
  export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
+ import { object, definePattern } from "@metamask/keyring-utils";
1
2
  import { array, enums, literal } from "@metamask/superstruct";
2
3
  import { EthAccountType, KeyringAccountStruct } from "../api/index.mjs";
3
- import { object, definePattern } from "../superstruct.mjs";
4
4
  export const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);
5
5
  export const EthAddressStruct = definePattern('EthAddress', /^0x[0-9a-f]{40}$/iu);
6
6
  export const EthUint256Struct = definePattern('EthUint256', /^0x([1-9a-f][0-9a-f]*|0)$/iu);
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,8BAA8B;AAE9D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,yBAAe;AAC9D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,2BAAuB;AAEvD,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,KAAT,SAAS,QAYpB;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;IACxC,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,EAAE,KAAK,CACZ,KAAK,CAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;KAC/B,CAAC,CACH;CACF,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;IAC5C,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,KAAK,CACZ,KAAK,CAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,oBAAoB,EAAE;QACnC,GAAG,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/superstruct';\n\nimport { EthAccountType, KeyringAccountStruct } from '../api';\nimport { object, definePattern } from '../superstruct';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gCAAgC;AAEhE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,8BAA8B;AAE9D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,yBAAe;AAE9D,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,KAAT,SAAS,QAYpB;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;IACxC,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,EAAE,KAAK,CACZ,KAAK,CAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;KAC/B,CAAC,CACH;CACF,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;IAC5C,GAAG,oBAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,KAAK,CACZ,KAAK,CAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,oBAAoB,EAAE;QACnC,GAAG,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import { object, definePattern } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/superstruct';\n\nimport { EthAccountType, KeyringAccountStruct } from '../api';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}