@metamask/snaps-sdk 2.1.0 → 3.0.1

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 (263) hide show
  1. package/CHANGELOG.md +13 -2
  2. package/dist/index.js +805 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.mjs +810 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/dist/tsconfig.build.tsbuildinfo +1 -0
  7. package/package.json +17 -14
  8. package/dist/cjs/error-wrappers.js +0 -80
  9. package/dist/cjs/error-wrappers.js.map +0 -1
  10. package/dist/cjs/errors.js +0 -162
  11. package/dist/cjs/errors.js.map +0 -1
  12. package/dist/cjs/images.js +0 -54
  13. package/dist/cjs/images.js.map +0 -1
  14. package/dist/cjs/index.js +0 -68
  15. package/dist/cjs/index.js.map +0 -1
  16. package/dist/cjs/internals/error-wrappers.js +0 -39
  17. package/dist/cjs/internals/error-wrappers.js.map +0 -1
  18. package/dist/cjs/internals/errors.js +0 -59
  19. package/dist/cjs/internals/errors.js.map +0 -1
  20. package/dist/cjs/internals/helpers.js +0 -6
  21. package/dist/cjs/internals/helpers.js.map +0 -1
  22. package/dist/cjs/internals/index.js +0 -24
  23. package/dist/cjs/internals/index.js.map +0 -1
  24. package/dist/cjs/internals/structs.js +0 -43
  25. package/dist/cjs/internals/structs.js.map +0 -1
  26. package/dist/cjs/internals/svg.js +0 -49
  27. package/dist/cjs/internals/svg.js.map +0 -1
  28. package/dist/cjs/types/caip.js +0 -10
  29. package/dist/cjs/types/caip.js.map +0 -1
  30. package/dist/cjs/types/global.js +0 -6
  31. package/dist/cjs/types/global.js.map +0 -1
  32. package/dist/cjs/types/handlers/cronjob.js +0 -6
  33. package/dist/cjs/types/handlers/cronjob.js.map +0 -1
  34. package/dist/cjs/types/handlers/home-page.js +0 -6
  35. package/dist/cjs/types/handlers/home-page.js.map +0 -1
  36. package/dist/cjs/types/handlers/index.js +0 -28
  37. package/dist/cjs/types/handlers/index.js.map +0 -1
  38. package/dist/cjs/types/handlers/keyring.js +0 -6
  39. package/dist/cjs/types/handlers/keyring.js.map +0 -1
  40. package/dist/cjs/types/handlers/lifecycle.js +0 -6
  41. package/dist/cjs/types/handlers/lifecycle.js.map +0 -1
  42. package/dist/cjs/types/handlers/name-lookup.js +0 -6
  43. package/dist/cjs/types/handlers/name-lookup.js.map +0 -1
  44. package/dist/cjs/types/handlers/rpc-request.js +0 -6
  45. package/dist/cjs/types/handlers/rpc-request.js.map +0 -1
  46. package/dist/cjs/types/handlers/signature.js +0 -6
  47. package/dist/cjs/types/handlers/signature.js.map +0 -1
  48. package/dist/cjs/types/handlers/transaction.js +0 -16
  49. package/dist/cjs/types/handlers/transaction.js.map +0 -1
  50. package/dist/cjs/types/handlers/user-input.js +0 -51
  51. package/dist/cjs/types/handlers/user-input.js.map +0 -1
  52. package/dist/cjs/types/index.js +0 -29
  53. package/dist/cjs/types/index.js.map +0 -1
  54. package/dist/cjs/types/interface.js +0 -26
  55. package/dist/cjs/types/interface.js.map +0 -1
  56. package/dist/cjs/types/methods/create-interface.js +0 -6
  57. package/dist/cjs/types/methods/create-interface.js.map +0 -1
  58. package/dist/cjs/types/methods/dialog.js +0 -18
  59. package/dist/cjs/types/methods/dialog.js.map +0 -1
  60. package/dist/cjs/types/methods/get-bip32-entropy.js +0 -6
  61. package/dist/cjs/types/methods/get-bip32-entropy.js.map +0 -1
  62. package/dist/cjs/types/methods/get-bip32-public-key.js +0 -6
  63. package/dist/cjs/types/methods/get-bip32-public-key.js.map +0 -1
  64. package/dist/cjs/types/methods/get-bip44-entropy.js +0 -6
  65. package/dist/cjs/types/methods/get-bip44-entropy.js.map +0 -1
  66. package/dist/cjs/types/methods/get-client-status.js +0 -10
  67. package/dist/cjs/types/methods/get-client-status.js.map +0 -1
  68. package/dist/cjs/types/methods/get-entropy.js +0 -6
  69. package/dist/cjs/types/methods/get-entropy.js.map +0 -1
  70. package/dist/cjs/types/methods/get-file.js +0 -18
  71. package/dist/cjs/types/methods/get-file.js.map +0 -1
  72. package/dist/cjs/types/methods/get-interface-state.js +0 -6
  73. package/dist/cjs/types/methods/get-interface-state.js.map +0 -1
  74. package/dist/cjs/types/methods/get-locale.js +0 -10
  75. package/dist/cjs/types/methods/get-locale.js.map +0 -1
  76. package/dist/cjs/types/methods/get-snaps.js +0 -6
  77. package/dist/cjs/types/methods/get-snaps.js.map +0 -1
  78. package/dist/cjs/types/methods/index.js +0 -38
  79. package/dist/cjs/types/methods/index.js.map +0 -1
  80. package/dist/cjs/types/methods/invoke-keyring.js +0 -6
  81. package/dist/cjs/types/methods/invoke-keyring.js.map +0 -1
  82. package/dist/cjs/types/methods/invoke-snap.js +0 -6
  83. package/dist/cjs/types/methods/invoke-snap.js.map +0 -1
  84. package/dist/cjs/types/methods/manage-accounts.js +0 -6
  85. package/dist/cjs/types/methods/manage-accounts.js.map +0 -1
  86. package/dist/cjs/types/methods/manage-state.js +0 -18
  87. package/dist/cjs/types/methods/manage-state.js.map +0 -1
  88. package/dist/cjs/types/methods/methods.js +0 -6
  89. package/dist/cjs/types/methods/methods.js.map +0 -1
  90. package/dist/cjs/types/methods/notify.js +0 -17
  91. package/dist/cjs/types/methods/notify.js.map +0 -1
  92. package/dist/cjs/types/methods/request-snaps.js +0 -6
  93. package/dist/cjs/types/methods/request-snaps.js.map +0 -1
  94. package/dist/cjs/types/methods/update-interface.js +0 -6
  95. package/dist/cjs/types/methods/update-interface.js.map +0 -1
  96. package/dist/cjs/types/permissions.js +0 -6
  97. package/dist/cjs/types/permissions.js.map +0 -1
  98. package/dist/cjs/types/provider.js +0 -6
  99. package/dist/cjs/types/provider.js.map +0 -1
  100. package/dist/cjs/types/snap.js +0 -6
  101. package/dist/cjs/types/snap.js.map +0 -1
  102. package/dist/cjs/ui/builder.js +0 -44
  103. package/dist/cjs/ui/builder.js.map +0 -1
  104. package/dist/cjs/ui/component.js +0 -29
  105. package/dist/cjs/ui/component.js.map +0 -1
  106. package/dist/cjs/ui/components/address.js +0 -30
  107. package/dist/cjs/ui/components/address.js.map +0 -1
  108. package/dist/cjs/ui/components/button.js +0 -59
  109. package/dist/cjs/ui/components/button.js.map +0 -1
  110. package/dist/cjs/ui/components/copyable.js +0 -32
  111. package/dist/cjs/ui/components/copyable.js.map +0 -1
  112. package/dist/cjs/ui/components/divider.js +0 -27
  113. package/dist/cjs/ui/components/divider.js.map +0 -1
  114. package/dist/cjs/ui/components/form.js +0 -41
  115. package/dist/cjs/ui/components/form.js.map +0 -1
  116. package/dist/cjs/ui/components/heading.js +0 -30
  117. package/dist/cjs/ui/components/heading.js.map +0 -1
  118. package/dist/cjs/ui/components/image.js +0 -42
  119. package/dist/cjs/ui/components/image.js.map +0 -1
  120. package/dist/cjs/ui/components/index.js +0 -54
  121. package/dist/cjs/ui/components/index.js.map +0 -1
  122. package/dist/cjs/ui/components/input.js +0 -52
  123. package/dist/cjs/ui/components/input.js.map +0 -1
  124. package/dist/cjs/ui/components/panel.js +0 -65
  125. package/dist/cjs/ui/components/panel.js.map +0 -1
  126. package/dist/cjs/ui/components/row.js +0 -57
  127. package/dist/cjs/ui/components/row.js.map +0 -1
  128. package/dist/cjs/ui/components/spinner.js +0 -27
  129. package/dist/cjs/ui/components/spinner.js.map +0 -1
  130. package/dist/cjs/ui/components/text.js +0 -32
  131. package/dist/cjs/ui/components/text.js.map +0 -1
  132. package/dist/cjs/ui/index.js +0 -28
  133. package/dist/cjs/ui/index.js.map +0 -1
  134. package/dist/cjs/ui/nodes.js +0 -46
  135. package/dist/cjs/ui/nodes.js.map +0 -1
  136. package/dist/esm/error-wrappers.js +0 -128
  137. package/dist/esm/error-wrappers.js.map +0 -1
  138. package/dist/esm/errors.js +0 -155
  139. package/dist/esm/errors.js.map +0 -1
  140. package/dist/esm/images.js +0 -84
  141. package/dist/esm/images.js.map +0 -1
  142. package/dist/esm/index.js +0 -10
  143. package/dist/esm/index.js.map +0 -1
  144. package/dist/esm/internals/error-wrappers.js +0 -39
  145. package/dist/esm/internals/error-wrappers.js.map +0 -1
  146. package/dist/esm/internals/errors.js +0 -58
  147. package/dist/esm/internals/errors.js.map +0 -1
  148. package/dist/esm/internals/helpers.js +0 -3
  149. package/dist/esm/internals/helpers.js.map +0 -1
  150. package/dist/esm/internals/index.js +0 -7
  151. package/dist/esm/internals/index.js.map +0 -1
  152. package/dist/esm/internals/structs.js +0 -59
  153. package/dist/esm/internals/structs.js.map +0 -1
  154. package/dist/esm/internals/svg.js +0 -41
  155. package/dist/esm/internals/svg.js.map +0 -1
  156. package/dist/esm/types/caip.js +0 -7
  157. package/dist/esm/types/caip.js.map +0 -1
  158. package/dist/esm/types/global.js +0 -3
  159. package/dist/esm/types/global.js.map +0 -1
  160. package/dist/esm/types/handlers/cronjob.js +0 -3
  161. package/dist/esm/types/handlers/cronjob.js.map +0 -1
  162. package/dist/esm/types/handlers/home-page.js +0 -3
  163. package/dist/esm/types/handlers/home-page.js.map +0 -1
  164. package/dist/esm/types/handlers/index.js +0 -11
  165. package/dist/esm/types/handlers/index.js.map +0 -1
  166. package/dist/esm/types/handlers/keyring.js +0 -3
  167. package/dist/esm/types/handlers/keyring.js.map +0 -1
  168. package/dist/esm/types/handlers/lifecycle.js +0 -3
  169. package/dist/esm/types/handlers/lifecycle.js.map +0 -1
  170. package/dist/esm/types/handlers/name-lookup.js +0 -3
  171. package/dist/esm/types/handlers/name-lookup.js.map +0 -1
  172. package/dist/esm/types/handlers/rpc-request.js +0 -3
  173. package/dist/esm/types/handlers/rpc-request.js.map +0 -1
  174. package/dist/esm/types/handlers/signature.js +0 -3
  175. package/dist/esm/types/handlers/signature.js.map +0 -1
  176. package/dist/esm/types/handlers/transaction.js +0 -6
  177. package/dist/esm/types/handlers/transaction.js.map +0 -1
  178. package/dist/esm/types/handlers/user-input.js +0 -24
  179. package/dist/esm/types/handlers/user-input.js.map +0 -1
  180. package/dist/esm/types/index.js +0 -12
  181. package/dist/esm/types/index.js.map +0 -1
  182. package/dist/esm/types/interface.js +0 -12
  183. package/dist/esm/types/interface.js.map +0 -1
  184. package/dist/esm/types/methods/create-interface.js +0 -3
  185. package/dist/esm/types/methods/create-interface.js.map +0 -1
  186. package/dist/esm/types/methods/dialog.js +0 -8
  187. package/dist/esm/types/methods/dialog.js.map +0 -1
  188. package/dist/esm/types/methods/get-bip32-entropy.js +0 -3
  189. package/dist/esm/types/methods/get-bip32-entropy.js.map +0 -1
  190. package/dist/esm/types/methods/get-bip32-public-key.js +0 -3
  191. package/dist/esm/types/methods/get-bip32-public-key.js.map +0 -1
  192. package/dist/esm/types/methods/get-bip44-entropy.js +0 -3
  193. package/dist/esm/types/methods/get-bip44-entropy.js.map +0 -1
  194. package/dist/esm/types/methods/get-client-status.js +0 -7
  195. package/dist/esm/types/methods/get-client-status.js.map +0 -1
  196. package/dist/esm/types/methods/get-entropy.js +0 -3
  197. package/dist/esm/types/methods/get-entropy.js.map +0 -1
  198. package/dist/esm/types/methods/get-file.js +0 -8
  199. package/dist/esm/types/methods/get-file.js.map +0 -1
  200. package/dist/esm/types/methods/get-interface-state.js +0 -3
  201. package/dist/esm/types/methods/get-interface-state.js.map +0 -1
  202. package/dist/esm/types/methods/get-locale.js +0 -7
  203. package/dist/esm/types/methods/get-locale.js.map +0 -1
  204. package/dist/esm/types/methods/get-snaps.js +0 -3
  205. package/dist/esm/types/methods/get-snaps.js.map +0 -1
  206. package/dist/esm/types/methods/index.js +0 -21
  207. package/dist/esm/types/methods/index.js.map +0 -1
  208. package/dist/esm/types/methods/invoke-keyring.js +0 -3
  209. package/dist/esm/types/methods/invoke-keyring.js.map +0 -1
  210. package/dist/esm/types/methods/invoke-snap.js +0 -3
  211. package/dist/esm/types/methods/invoke-snap.js.map +0 -1
  212. package/dist/esm/types/methods/manage-accounts.js +0 -3
  213. package/dist/esm/types/methods/manage-accounts.js.map +0 -1
  214. package/dist/esm/types/methods/manage-state.js +0 -8
  215. package/dist/esm/types/methods/manage-state.js.map +0 -1
  216. package/dist/esm/types/methods/methods.js +0 -3
  217. package/dist/esm/types/methods/methods.js.map +0 -1
  218. package/dist/esm/types/methods/notify.js +0 -7
  219. package/dist/esm/types/methods/notify.js.map +0 -1
  220. package/dist/esm/types/methods/request-snaps.js +0 -3
  221. package/dist/esm/types/methods/request-snaps.js.map +0 -1
  222. package/dist/esm/types/methods/update-interface.js +0 -3
  223. package/dist/esm/types/methods/update-interface.js.map +0 -1
  224. package/dist/esm/types/permissions.js +0 -3
  225. package/dist/esm/types/permissions.js.map +0 -1
  226. package/dist/esm/types/provider.js +0 -3
  227. package/dist/esm/types/provider.js.map +0 -1
  228. package/dist/esm/types/snap.js +0 -3
  229. package/dist/esm/types/snap.js.map +0 -1
  230. package/dist/esm/ui/builder.js +0 -50
  231. package/dist/esm/ui/builder.js.map +0 -1
  232. package/dist/esm/ui/component.js +0 -23
  233. package/dist/esm/ui/component.js.map +0 -1
  234. package/dist/esm/ui/components/address.js +0 -22
  235. package/dist/esm/ui/components/address.js.map +0 -1
  236. package/dist/esm/ui/components/button.js +0 -50
  237. package/dist/esm/ui/components/button.js.map +0 -1
  238. package/dist/esm/ui/components/copyable.js +0 -27
  239. package/dist/esm/ui/components/copyable.js.map +0 -1
  240. package/dist/esm/ui/components/divider.js +0 -15
  241. package/dist/esm/ui/components/divider.js.map +0 -1
  242. package/dist/esm/ui/components/form.js +0 -39
  243. package/dist/esm/ui/components/form.js.map +0 -1
  244. package/dist/esm/ui/components/heading.js +0 -22
  245. package/dist/esm/ui/components/heading.js.map +0 -1
  246. package/dist/esm/ui/components/image.js +0 -37
  247. package/dist/esm/ui/components/image.js.map +0 -1
  248. package/dist/esm/ui/components/index.js +0 -14
  249. package/dist/esm/ui/components/index.js.map +0 -1
  250. package/dist/esm/ui/components/input.js +0 -47
  251. package/dist/esm/ui/components/input.js.map +0 -1
  252. package/dist/esm/ui/components/panel.js +0 -66
  253. package/dist/esm/ui/components/panel.js.map +0 -1
  254. package/dist/esm/ui/components/row.js +0 -50
  255. package/dist/esm/ui/components/row.js.map +0 -1
  256. package/dist/esm/ui/components/spinner.js +0 -15
  257. package/dist/esm/ui/components/spinner.js.map +0 -1
  258. package/dist/esm/ui/components/text.js +0 -29
  259. package/dist/esm/ui/components/text.js.map +0 -1
  260. package/dist/esm/ui/index.js +0 -5
  261. package/dist/esm/ui/index.js.map +0 -1
  262. package/dist/esm/ui/nodes.js +0 -29
  263. package/dist/esm/ui/nodes.js.map +0 -1
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- _export_star(require("./cronjob"), exports);
6
- _export_star(require("./home-page"), exports);
7
- _export_star(require("./keyring"), exports);
8
- _export_star(require("./lifecycle"), exports);
9
- _export_star(require("./name-lookup"), exports);
10
- _export_star(require("./rpc-request"), exports);
11
- _export_star(require("./transaction"), exports);
12
- _export_star(require("./signature"), exports);
13
- _export_star(require("./user-input"), exports);
14
- function _export_star(from, to) {
15
- Object.keys(from).forEach(function(k) {
16
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
17
- Object.defineProperty(to, k, {
18
- enumerable: true,
19
- get: function() {
20
- return from[k];
21
- }
22
- });
23
- }
24
- });
25
- return from;
26
- }
27
-
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/handlers/index.ts"],"sourcesContent":["export * from './cronjob';\nexport * from './home-page';\nexport * from './keyring';\nexport * from './lifecycle';\nexport * from './name-lookup';\nexport * from './rpc-request';\nexport * from './transaction';\nexport * from './signature';\nexport * from './user-input';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=keyring.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/handlers/keyring.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=lifecycle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/handlers/lifecycle.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=name-lookup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/handlers/name-lookup.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=rpc-request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/handlers/rpc-request.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=signature.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/handlers/signature.ts"],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "SeverityLevel", {
6
- enumerable: true,
7
- get: function() {
8
- return SeverityLevel;
9
- }
10
- });
11
- var SeverityLevel;
12
- (function(SeverityLevel) {
13
- SeverityLevel["Critical"] = 'critical';
14
- })(SeverityLevel || (SeverityLevel = {}));
15
-
16
- //# sourceMappingURL=transaction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/handlers/transaction.ts"],"sourcesContent":["import type { EnumToUnion } from '../../internals';\nimport type { Component } from '../../ui';\nimport type { ChainId } from '../caip';\n\n/**\n * The severity level of content being returned from a transaction insight.\n * Currently only one level is supported:\n *\n * - `critical` - The transaction is critical and should not be submitted by the\n * user.\n */\nexport enum SeverityLevel {\n Critical = 'critical',\n}\n\n/**\n * An EIP-1559 (type 2) transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property maxFeePerGas - The maximum fee per gas of the transaction.\n * @property maxPriorityFeePerGas - The maximum priority fee per gas of the\n * transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n * @see https://eips.ethereum.org/EIPS/eip-1559\n */\nexport type EIP1559Transaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n maxFeePerGas: string;\n maxPriorityFeePerGas: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A legacy (type \"0\") transaction object.\n *\n * @property from - The address the transaction is being sent from.\n * @property to - The address the transaction is being sent to.\n * @property nonce - The nonce of the transaction.\n * @property value - The value of the transaction.\n * @property data - The data of the transaction.\n * @property gas - The gas limit of the transaction.\n * @property gasPrice - The gas price of the transaction.\n * @property estimateSuggested - The suggested gas price for the transaction.\n * @property estimateUsed - The gas price used for the transaction.\n */\nexport type LegacyTransaction = {\n from: string;\n to: string;\n nonce: string;\n value: string;\n data: string;\n gas: string;\n gasPrice: string;\n estimateSuggested: string;\n estimateUsed: string;\n};\n\n/**\n * A transaction object. This can be either an EIP-1559 transaction or a legacy\n * transaction.\n *\n * @see EIP1559Transaction\n * @see LegacyTransaction\n */\nexport type Transaction = EIP1559Transaction | LegacyTransaction;\n\n/**\n * The `onTransaction` handler. This is called whenever a transaction is\n * submitted to the snap. It can return insights about the transaction, which\n * will be displayed to the user.\n *\n * Note that using this handler requires the `endowment:transaction-insights`\n * permission.\n *\n * @param args - The request arguments.\n * @param args.transaction - The transaction object, containing the address,\n * value, data, and other properties of the transaction.\n * @param args.chainId - The CAIP-2 {@link ChainId} of the network the\n * transaction is being submitted to.\n * @param args.transactionOrigin - The origin of the transaction. This is the\n * URL of the website that submitted the transaction. This is only available if\n * the Snap has enabled the `allowTransactionOrigin` option in the\n * `endowment:transaction-insight` permission.\n * @returns An object containing insights about the transaction. See\n * {@link OnTransactionResponse}. Can also return `null` if no insights are\n * available.\n */\nexport type OnTransactionHandler = (args: {\n transaction: Transaction;\n chainId: ChainId;\n transactionOrigin?: string;\n}) => Promise<OnTransactionResponse | null>;\n\n/**\n * The response from a Snap's `onTransaction` handler.\n *\n * @property component - A custom UI component, that will be shown in MetaMask.\n * @property id - A Snap interface ID.\n * @property severity - The severity level of the content. Currently only one\n * level is supported: `critical`.\n */\nexport type OnTransactionResponse =\n | {\n content: Component;\n severity?: EnumToUnion<SeverityLevel>;\n }\n | {\n id: string;\n severity?: EnumToUnion<SeverityLevel>;\n };\n"],"names":["SeverityLevel","Critical"],"mappings":";;;;;;;;;;IAWO;UAAKA,aAAa;IAAbA,cACVC,cAAW;GADDD,kBAAAA"}
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- UserInputEventType: function() {
13
- return UserInputEventType;
14
- },
15
- GenericEventStruct: function() {
16
- return GenericEventStruct;
17
- },
18
- ButtonClickEventStruct: function() {
19
- return ButtonClickEventStruct;
20
- },
21
- FormSubmitEventStruct: function() {
22
- return FormSubmitEventStruct;
23
- },
24
- UserInputEventStruct: function() {
25
- return UserInputEventStruct;
26
- }
27
- });
28
- const _superstruct = require("superstruct");
29
- var UserInputEventType;
30
- (function(UserInputEventType) {
31
- UserInputEventType["ButtonClickEvent"] = "ButtonClickEvent";
32
- UserInputEventType["FormSubmitEvent"] = "FormSubmitEvent";
33
- })(UserInputEventType || (UserInputEventType = {}));
34
- const GenericEventStruct = (0, _superstruct.object)({
35
- type: (0, _superstruct.string)(),
36
- name: (0, _superstruct.optional)((0, _superstruct.string)())
37
- });
38
- const ButtonClickEventStruct = (0, _superstruct.assign)(GenericEventStruct, (0, _superstruct.object)({
39
- type: (0, _superstruct.literal)(UserInputEventType.ButtonClickEvent)
40
- }));
41
- const FormSubmitEventStruct = (0, _superstruct.assign)(GenericEventStruct, (0, _superstruct.object)({
42
- type: (0, _superstruct.literal)(UserInputEventType.FormSubmitEvent),
43
- value: (0, _superstruct.record)((0, _superstruct.string)(), (0, _superstruct.string)()),
44
- name: (0, _superstruct.string)()
45
- }));
46
- const UserInputEventStruct = (0, _superstruct.union)([
47
- ButtonClickEventStruct,
48
- FormSubmitEventStruct
49
- ]);
50
-
51
- //# sourceMappingURL=user-input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/handlers/user-input.ts"],"sourcesContent":["import type { Infer } from 'superstruct';\nimport {\n assign,\n literal,\n object,\n optional,\n record,\n string,\n union,\n} from 'superstruct';\n\n/**\n * The type of user input event fired.\n * Currently only two events are supported:\n *\n * - `ButtonClickEvent` - A button has been clicked in the UI.\n * - `FormSubmitEvent` - A Form has been submitted in the UI.\n */\nexport enum UserInputEventType {\n ButtonClickEvent = 'ButtonClickEvent',\n FormSubmitEvent = 'FormSubmitEvent',\n}\n\nexport const GenericEventStruct = object({\n type: string(),\n name: optional(string()),\n});\n\nexport const ButtonClickEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.ButtonClickEvent),\n }),\n);\n\nexport const FormSubmitEventStruct = assign(\n GenericEventStruct,\n object({\n type: literal(UserInputEventType.FormSubmitEvent),\n value: record(string(), string()),\n name: string(),\n }),\n);\n\nexport const UserInputEventStruct = union([\n ButtonClickEventStruct,\n FormSubmitEventStruct,\n]);\n\n/**\n * A user input event fired in the UI. This is passed to the params of the `onUserInput` handler.\n *\n * @property type - The type of event fired. See {@link UserInputEventType} for the different types.\n * @property name - The component name that fired the event. It is optional for an {@link UserInputEventType.ButtonClickEvent}.\n * @property value - The value associated with the event. Only available when an {@link UserInputEventType.FormSubmitEvent} is fired.\n * It contains the form values submitted.\n */\ntype UserInputEvent = Infer<typeof UserInputEventStruct>;\n\n/**\n * The `onUserInput` handler. This is called when an user input event is fired in the UI.\n *\n * @param args - The user input event.\n * @param args.id - The user interface id.\n * @param args.event - The {@link UserInputEvent} object, containing the data about the fired event.\n */\nexport type OnUserInputHandler = (args: {\n id: string;\n event: UserInputEvent;\n}) => Promise<void>;\n"],"names":["GenericEventStruct","ButtonClickEventStruct","FormSubmitEventStruct","UserInputEventStruct","UserInputEventType","ButtonClickEvent","FormSubmitEvent","object","type","string","name","optional","assign","literal","value","record","union"],"mappings":";;;;;;;;;;;;;;IAuBaA,kBAAkB;eAAlBA;;IAKAC,sBAAsB;eAAtBA;;IAOAC,qBAAqB;eAArBA;;IASAC,oBAAoB;eAApBA;;;6BAnCN;IASA;UAAKC,kBAAkB;IAAlBA,mBACVC,sBAAAA;IADUD,mBAEVE,qBAAAA;GAFUF,uBAAAA;AAKL,MAAMJ,qBAAqBO,IAAAA,mBAAM,EAAC;IACvCC,MAAMC,IAAAA,mBAAM;IACZC,MAAMC,IAAAA,qBAAQ,EAACF,IAAAA,mBAAM;AACvB;AAEO,MAAMR,yBAAyBW,IAAAA,mBAAM,EAC1CZ,oBACAO,IAAAA,mBAAM,EAAC;IACLC,MAAMK,IAAAA,oBAAO,EAACT,mBAAmBC,gBAAgB;AACnD;AAGK,MAAMH,wBAAwBU,IAAAA,mBAAM,EACzCZ,oBACAO,IAAAA,mBAAM,EAAC;IACLC,MAAMK,IAAAA,oBAAO,EAACT,mBAAmBE,eAAe;IAChDQ,OAAOC,IAAAA,mBAAM,EAACN,IAAAA,mBAAM,KAAIA,IAAAA,mBAAM;IAC9BC,MAAMD,IAAAA,mBAAM;AACd;AAGK,MAAMN,uBAAuBa,IAAAA,kBAAK,EAAC;IACxCf;IACAC;CACD"}
@@ -1,29 +0,0 @@
1
- // This is intentionally imported, rather than re-exported.
2
- // eslint-disable-next-line import/no-unassigned-import
3
- "use strict";
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- require("./global");
8
- _export_star(require("./caip"), exports);
9
- _export_star(require("./handlers"), exports);
10
- _export_star(require("./methods"), exports);
11
- _export_star(require("./permissions"), exports);
12
- _export_star(require("./provider"), exports);
13
- _export_star(require("./snap"), exports);
14
- _export_star(require("./interface"), exports);
15
- function _export_star(from, to) {
16
- Object.keys(from).forEach(function(k) {
17
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
18
- Object.defineProperty(to, k, {
19
- enumerable: true,
20
- get: function() {
21
- return from[k];
22
- }
23
- });
24
- }
25
- });
26
- return from;
27
- }
28
-
29
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/index.ts"],"sourcesContent":["// This is intentionally imported, rather than re-exported.\n// eslint-disable-next-line import/no-unassigned-import\nimport './global';\n\nexport * from './caip';\nexport * from './handlers';\nexport * from './methods';\nexport * from './permissions';\nexport * from './provider';\nexport * from './snap';\nexport * from './interface';\n"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,uDAAuD;;;;;QAChD;qBAEO;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- FormStateStruct: function() {
13
- return FormStateStruct;
14
- },
15
- InterfaceStateStruct: function() {
16
- return InterfaceStateStruct;
17
- }
18
- });
19
- const _superstruct = require("superstruct");
20
- const FormStateStruct = (0, _superstruct.record)((0, _superstruct.string)(), (0, _superstruct.nullable)((0, _superstruct.string)()));
21
- const InterfaceStateStruct = (0, _superstruct.record)((0, _superstruct.string)(), (0, _superstruct.union)([
22
- FormStateStruct,
23
- (0, _superstruct.nullable)((0, _superstruct.string)())
24
- ]));
25
-
26
- //# sourceMappingURL=interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/interface.ts"],"sourcesContent":["import type { Infer } from 'superstruct';\nimport { nullable, record, string, union } from 'superstruct';\n\n/**\n * To avoid typing problems with the interface state when manipulating it we have to differentiate the state of\n * a form (that will be contained inside the root state) and the root state since a key in the root stat can contain\n * either the value of an input or a sub-state of a form.\n */\n\nexport const FormStateStruct = record(string(), nullable(string()));\n\nexport const InterfaceStateStruct = record(\n string(),\n union([FormStateStruct, nullable(string())]),\n);\n\nexport type FormState = Infer<typeof FormStateStruct>;\nexport type InterfaceState = Infer<typeof InterfaceStateStruct>;\n"],"names":["FormStateStruct","InterfaceStateStruct","record","string","nullable","union"],"mappings":";;;;;;;;;;;IASaA,eAAe;eAAfA;;IAEAC,oBAAoB;eAApBA;;;6BAVmC;AAQzC,MAAMD,kBAAkBE,IAAAA,mBAAM,EAACC,IAAAA,mBAAM,KAAIC,IAAAA,qBAAQ,EAACD,IAAAA,mBAAM;AAExD,MAAMF,uBAAuBC,IAAAA,mBAAM,EACxCC,IAAAA,mBAAM,KACNE,IAAAA,kBAAK,EAAC;IAACL;IAAiBI,IAAAA,qBAAQ,EAACD,IAAAA,mBAAM;CAAI"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=create-interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/create-interface.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "DialogType", {
6
- enumerable: true,
7
- get: function() {
8
- return DialogType;
9
- }
10
- });
11
- var DialogType;
12
- (function(DialogType) {
13
- DialogType["Alert"] = 'alert';
14
- DialogType["Confirmation"] = 'confirmation';
15
- DialogType["Prompt"] = 'prompt';
16
- })(DialogType || (DialogType = {}));
17
-
18
- //# sourceMappingURL=dialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/dialog.ts"],"sourcesContent":["import type { EnumToUnion } from '../../internals';\nimport type { Component } from '../../ui';\n\n/**\n * The type of dialog to display.\n *\n * - `alert` - A dialog with a single button.\n * - `confirmation` - A dialog with two buttons, one to confirm and one to\n * cancel.\n * - `prompt` - A dialog with two buttons and a text input.\n */\nexport enum DialogType {\n Alert = 'alert',\n Confirmation = 'confirmation',\n Prompt = 'prompt',\n}\n\n/**\n * An alert dialog.\n *\n * @property type - The type of dialog. Must be `alert`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type AlertDialog =\n | {\n type: EnumToUnion<DialogType.Alert>;\n content: Component;\n }\n | {\n type: EnumToUnion<DialogType.Alert>;\n id: string;\n };\n\n/**\n * A confirmation dialog.\n *\n * @property type - The type of dialog. Must be `confirmation`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n */\nexport type ConfirmationDialog =\n | {\n type: EnumToUnion<DialogType.Confirmation>;\n content: Component;\n }\n | {\n type: EnumToUnion<DialogType.Confirmation>;\n id: string;\n };\n\n/**\n * A prompt dialog.\n *\n * @property type - The type of dialog. Must be `prompt`.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - An optional placeholder text to display in the text\n * input.\n */\nexport type PromptDialog =\n | {\n type: EnumToUnion<DialogType.Prompt>;\n content: Component;\n placeholder?: string;\n }\n | {\n type: EnumToUnion<DialogType.Prompt>;\n id: string;\n placeholder?: string;\n };\n\n/**\n * The request parameters for the `snap_dialog` method.\n *\n * @property type - The type of dialog to display.\n * @property content - The content to display in the dialog.\n * @property id - The Snap interface ID.\n * @property placeholder - The placeholder text to display in the dialog. Only\n * applicable for the `prompt` dialog.\n */\nexport type DialogParams = AlertDialog | ConfirmationDialog | PromptDialog;\n\n/**\n * The result returned by the `snap_dialog` method.\n *\n * - If the dialog is an `alert`, the result is `null`.\n * - If the dialog is a `confirmation`, the result is a boolean indicating\n * whether the user confirmed the dialog.\n * - If the dialog is a `prompt`, the result is the value entered by\n * the user.\n */\nexport type DialogResult = null | boolean | string;\n"],"names":["DialogType","Alert","Confirmation","Prompt"],"mappings":";;;;;;;;;;IAWO;UAAKA,UAAU;IAAVA,WACVC,WAAQ;IADED,WAEVE,kBAAe;IAFLF,WAGVG,YAAS;GAHCH,eAAAA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=get-bip32-entropy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-bip32-entropy.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=get-bip32-public-key.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-bip32-public-key.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=get-bip44-entropy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-bip44-entropy.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- /**
2
- * The request parameters for the `snap_getClientStatus` method.
3
- *
4
- * This method does not accept any parameters.
5
- */ "use strict";
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
-
10
- //# sourceMappingURL=get-client-status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-client-status.ts"],"sourcesContent":["/**\n * The request parameters for the `snap_getClientStatus` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetClientStatusParams = never;\n\n/**\n * The result returned by the `snap_getClientStatus` method.\n *\n * It returns an object containing useful information about the client.\n */\nexport type GetClientStatusResult = { locked: boolean };\n"],"names":[],"mappings":"AAAA;;;;CAIC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=get-entropy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-entropy.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "AuxiliaryFileEncoding", {
6
- enumerable: true,
7
- get: function() {
8
- return AuxiliaryFileEncoding;
9
- }
10
- });
11
- var AuxiliaryFileEncoding;
12
- (function(AuxiliaryFileEncoding) {
13
- AuxiliaryFileEncoding["Base64"] = 'base64';
14
- AuxiliaryFileEncoding["Hex"] = 'hex';
15
- AuxiliaryFileEncoding["Utf8"] = 'utf8';
16
- })(AuxiliaryFileEncoding || (AuxiliaryFileEncoding = {}));
17
-
18
- //# sourceMappingURL=get-file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-file.ts"],"sourcesContent":["import type { EnumToUnion } from '../../internals';\n\n/**\n * The encoding to use when retrieving the file. Defaults to `Base64`.\n */\nexport enum AuxiliaryFileEncoding {\n Base64 = 'base64',\n Hex = 'hex',\n Utf8 = 'utf8',\n}\n\n/**\n * The request parameters for the `snap_getFile` method.\n *\n * @property path - The path to the file to retrieve.\n * @property encoding - The encoding to use when retrieving the file.\n */\nexport type GetFileParams = {\n path: string;\n encoding?: EnumToUnion<AuxiliaryFileEncoding>;\n};\n\n/**\n * The result returned by the `snap_getFile` method.\n */\nexport type GetFileResult = string;\n"],"names":["AuxiliaryFileEncoding","Base64","Hex","Utf8"],"mappings":";;;;;;;;;;IAKO;UAAKA,qBAAqB;IAArBA,sBACVC,YAAS;IADCD,sBAEVE,SAAM;IAFIF,sBAGVG,UAAO;GAHGH,0BAAAA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=get-interface-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-interface-state.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- /**
2
- * The request parameters for the `snap_getLocale` method.
3
- *
4
- * This method does not accept any parameters.
5
- */ "use strict";
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
-
10
- //# sourceMappingURL=get-locale.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-locale.ts"],"sourcesContent":["/**\n * The request parameters for the `snap_getLocale` method.\n *\n * This method does not accept any parameters.\n */\nexport type GetLocaleParams = never;\n\n/**\n * The result returned by the `snap_getLocale` method.\n *\n * It is the locale of the user's MetaMask extension.\n */\nexport type GetLocaleResult = string;\n"],"names":[],"mappings":"AAAA;;;;CAIC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=get-snaps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/get-snaps.ts"],"names":[],"mappings":""}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- _export_star(require("./create-interface"), exports);
6
- _export_star(require("./dialog"), exports);
7
- _export_star(require("./get-bip32-entropy"), exports);
8
- _export_star(require("./get-bip32-public-key"), exports);
9
- _export_star(require("./get-bip44-entropy"), exports);
10
- _export_star(require("./get-client-status"), exports);
11
- _export_star(require("./get-entropy"), exports);
12
- _export_star(require("./get-file"), exports);
13
- _export_star(require("./get-interface-state"), exports);
14
- _export_star(require("./get-locale"), exports);
15
- _export_star(require("./get-snaps"), exports);
16
- _export_star(require("./invoke-keyring"), exports);
17
- _export_star(require("./invoke-snap"), exports);
18
- _export_star(require("./manage-accounts"), exports);
19
- _export_star(require("./manage-state"), exports);
20
- _export_star(require("./methods"), exports);
21
- _export_star(require("./notify"), exports);
22
- _export_star(require("./request-snaps"), exports);
23
- _export_star(require("./update-interface"), exports);
24
- function _export_star(from, to) {
25
- Object.keys(from).forEach(function(k) {
26
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
27
- Object.defineProperty(to, k, {
28
- enumerable: true,
29
- get: function() {
30
- return from[k];
31
- }
32
- });
33
- }
34
- });
35
- return from;
36
- }
37
-
38
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/index.ts"],"sourcesContent":["export * from './create-interface';\nexport * from './dialog';\nexport * from './get-bip32-entropy';\nexport * from './get-bip32-public-key';\nexport * from './get-bip44-entropy';\nexport * from './get-client-status';\nexport * from './get-entropy';\nexport * from './get-file';\nexport * from './get-interface-state';\nexport * from './get-locale';\nexport * from './get-snaps';\nexport * from './invoke-keyring';\nexport * from './invoke-snap';\nexport * from './manage-accounts';\nexport * from './manage-state';\nexport * from './methods';\nexport * from './notify';\nexport * from './request-snaps';\nexport * from './update-interface';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=invoke-keyring.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/invoke-keyring.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=invoke-snap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/invoke-snap.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=manage-accounts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/manage-accounts.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "ManageStateOperation", {
6
- enumerable: true,
7
- get: function() {
8
- return ManageStateOperation;
9
- }
10
- });
11
- var ManageStateOperation;
12
- (function(ManageStateOperation) {
13
- ManageStateOperation["ClearState"] = 'clear';
14
- ManageStateOperation["GetState"] = 'get';
15
- ManageStateOperation["UpdateState"] = 'update';
16
- })(ManageStateOperation || (ManageStateOperation = {}));
17
-
18
- //# sourceMappingURL=manage-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/manage-state.ts"],"sourcesContent":["import type { Json } from '@metamask/utils';\n\nimport type { EnumToUnion } from '../../internals';\n\n/**\n * The operations that can be performed on the state.\n */\nexport enum ManageStateOperation {\n ClearState = 'clear',\n GetState = 'get',\n UpdateState = 'update',\n}\n\n/**\n * The clear state operation, which clears the state.\n *\n * @property operation - The operation to perform on the state. Must be `clear`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type ClearStateOperation = {\n operation: EnumToUnion<ManageStateOperation.ClearState>;\n encrypted?: boolean;\n};\n\n/**\n * The get state operation, which retrieves the state.\n *\n * @property operation - The operation to perform on the state. Must be `get`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n */\nexport type GetStateOperation = {\n operation: EnumToUnion<ManageStateOperation.GetState>;\n encrypted?: boolean;\n};\n\n/**\n * The update state operation, which updates the state.\n *\n * @property operation - The operation to perform on the state. Must be\n * `update`.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state. Encrypted state can only\n * be used if the extension is unlocked, while unencrypted state can be used\n * whether the extension is locked or unlocked.\n * @property newState - The new state to set.\n */\nexport type UpdateStateOperation = {\n operation: EnumToUnion<ManageStateOperation.UpdateState>;\n encrypted?: boolean;\n newState: Record<string, Json>;\n};\n\n/**\n * The request parameters for the `snap_manageState` method.\n *\n * @property operation - The operation to perform on the state.\n * @property encrypted - Whether to use the separate encrypted state, or the\n * unencrypted state. Defaults to the encrypted state.\n * @property newState - The new state to set. Only applicable for the `set`\n * operation.\n */\nexport type ManageStateParams =\n | ClearStateOperation\n | GetStateOperation\n | UpdateStateOperation;\n\n/**\n * The result returned by the `snap_manageState` method.\n *\n * If the operation is `get`, the result is the state. Otherwise, the result is\n * `null`.\n */\nexport type ManageStateResult = Record<string, Json> | null;\n"],"names":["ManageStateOperation","ClearState","GetState","UpdateState"],"mappings":";;;;;;;;;;IAOO;UAAKA,oBAAoB;IAApBA,qBACVC,gBAAa;IADHD,qBAEVE,cAAW;IAFDF,qBAGVG,iBAAc;GAHJH,yBAAAA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=methods.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/methods.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "NotificationType", {
6
- enumerable: true,
7
- get: function() {
8
- return NotificationType;
9
- }
10
- });
11
- var NotificationType;
12
- (function(NotificationType) {
13
- NotificationType["InApp"] = 'inApp';
14
- NotificationType["Native"] = 'native';
15
- })(NotificationType || (NotificationType = {}));
16
-
17
- //# sourceMappingURL=notify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/notify.ts"],"sourcesContent":["import type { EnumToUnion } from '../../internals';\n\n/**\n * The types of notifications that can be displayed.\n *\n * - `InApp` - A notification that is displayed in by the MetaMask extension.\n * - `Native` - A notification that is displayed by the operating system.\n */\nexport enum NotificationType {\n InApp = 'inApp',\n Native = 'native',\n}\n\n/**\n * The request parameters for the `snap_notify` method.\n *\n * @property type - The type of notification to display.\n * @property message - The message to display in the notification.\n */\nexport type NotifyParams = {\n type: EnumToUnion<NotificationType>;\n message: string;\n};\n\n/**\n * The result returned by the `snap_notify` method.\n *\n * This method does not return anything.\n */\nexport type NotifyResult = null;\n"],"names":["NotificationType","InApp","Native"],"mappings":";;;;;;;;;;IAQO;UAAKA,gBAAgB;IAAhBA,iBACVC,WAAQ;IADED,iBAEVE,YAAS;GAFCF,qBAAAA"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=request-snaps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/request-snaps.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=update-interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/types/methods/update-interface.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=permissions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/permissions.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/provider.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=snap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/snap.ts"],"names":[],"mappings":""}