@metamask-previews/phishing-controller 17.4.0-preview-4f4c98e → 17.4.0-preview-eb263b0ee

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 (103) hide show
  1. package/CHANGELOG.md +0 -2
  2. package/dist/CacheManager.cjs +177 -0
  3. package/dist/CacheManager.cjs.map +1 -0
  4. package/dist/{CacheManager.d.ts → CacheManager.d.cts} +1 -1
  5. package/dist/CacheManager.d.cts.map +1 -0
  6. package/dist/CacheManager.d.mts +104 -0
  7. package/dist/CacheManager.d.mts.map +1 -0
  8. package/dist/{CacheManager.js → CacheManager.mjs} +2 -2
  9. package/dist/CacheManager.mjs.map +1 -0
  10. package/dist/PathTrie.cjs +169 -0
  11. package/dist/PathTrie.cjs.map +1 -0
  12. package/dist/{PathTrie.d.ts → PathTrie.d.cts} +1 -1
  13. package/dist/PathTrie.d.cts.map +1 -0
  14. package/dist/PathTrie.d.mts +46 -0
  15. package/dist/PathTrie.d.mts.map +1 -0
  16. package/dist/{PathTrie.js → PathTrie.mjs} +2 -2
  17. package/dist/PathTrie.mjs.map +1 -0
  18. package/dist/PhishingController-method-action-types.cjs +7 -0
  19. package/dist/PhishingController-method-action-types.cjs.map +1 -0
  20. package/dist/{PhishingController-method-action-types.d.ts → PhishingController-method-action-types.d.cts} +2 -2
  21. package/dist/PhishingController-method-action-types.d.cts.map +1 -0
  22. package/dist/PhishingController-method-action-types.d.mts +123 -0
  23. package/dist/PhishingController-method-action-types.d.mts.map +1 -0
  24. package/dist/{PhishingController-method-action-types.js → PhishingController-method-action-types.mjs} +1 -1
  25. package/dist/PhishingController-method-action-types.mjs.map +1 -0
  26. package/dist/PhishingController.cjs +1222 -0
  27. package/dist/PhishingController.cjs.map +1 -0
  28. package/dist/{PhishingController.d.ts → PhishingController.d.cts} +10 -10
  29. package/dist/PhishingController.d.cts.map +1 -0
  30. package/dist/PhishingController.d.mts +425 -0
  31. package/dist/PhishingController.d.mts.map +1 -0
  32. package/dist/{PhishingController.js → PhishingController.mjs} +12 -11
  33. package/dist/PhishingController.mjs.map +1 -0
  34. package/dist/PhishingDetector.cjs +277 -0
  35. package/dist/PhishingDetector.cjs.map +1 -0
  36. package/dist/{PhishingDetector.d.ts → PhishingDetector.d.cts} +4 -4
  37. package/dist/PhishingDetector.d.cts.map +1 -0
  38. package/dist/PhishingDetector.d.mts +73 -0
  39. package/dist/PhishingDetector.d.mts.map +1 -0
  40. package/dist/{PhishingDetector.js → PhishingDetector.mjs} +15 -21
  41. package/dist/PhishingDetector.mjs.map +1 -0
  42. package/dist/address-poisoning.cjs +71 -0
  43. package/dist/address-poisoning.cjs.map +1 -0
  44. package/dist/{address-poisoning.d.ts → address-poisoning.d.cts} +2 -2
  45. package/dist/address-poisoning.d.cts.map +1 -0
  46. package/dist/address-poisoning.d.mts +3 -0
  47. package/dist/address-poisoning.d.mts.map +1 -0
  48. package/dist/{address-poisoning.js → address-poisoning.mjs} +2 -2
  49. package/dist/address-poisoning.mjs.map +1 -0
  50. package/dist/index.cjs +36 -0
  51. package/dist/index.cjs.map +1 -0
  52. package/dist/{index.d.ts → index.d.cts} +12 -12
  53. package/dist/index.d.cts.map +1 -0
  54. package/dist/index.d.mts +12 -0
  55. package/dist/index.d.mts.map +1 -0
  56. package/dist/index.mjs +7 -0
  57. package/dist/index.mjs.map +1 -0
  58. package/dist/tests/utils.cjs +102 -0
  59. package/dist/tests/utils.cjs.map +1 -0
  60. package/dist/tests/{utils.d.ts → utils.d.cts} +3 -3
  61. package/dist/tests/utils.d.cts.map +1 -0
  62. package/dist/tests/utils.d.mts +70 -0
  63. package/dist/tests/utils.d.mts.map +1 -0
  64. package/dist/tests/{utils.js → utils.mjs} +2 -2
  65. package/dist/tests/utils.mjs.map +1 -0
  66. package/dist/types.cjs +267 -0
  67. package/dist/types.cjs.map +1 -0
  68. package/dist/{types.d.ts → types.d.cts} +62 -62
  69. package/dist/types.d.cts.map +1 -0
  70. package/dist/types.d.mts +338 -0
  71. package/dist/types.d.mts.map +1 -0
  72. package/dist/{types.js → types.mjs} +1 -1
  73. package/dist/types.mjs.map +1 -0
  74. package/dist/utils.cjs +522 -0
  75. package/dist/utils.cjs.map +1 -0
  76. package/dist/{utils.d.ts → utils.d.cts} +72 -74
  77. package/dist/utils.d.cts.map +1 -0
  78. package/dist/utils.d.mts +302 -0
  79. package/dist/utils.d.mts.map +1 -0
  80. package/dist/{utils.js → utils.mjs} +16 -16
  81. package/dist/utils.mjs.map +1 -0
  82. package/package.json +16 -12
  83. package/dist/CacheManager.d.ts.map +0 -1
  84. package/dist/CacheManager.js.map +0 -1
  85. package/dist/PathTrie.d.ts.map +0 -1
  86. package/dist/PathTrie.js.map +0 -1
  87. package/dist/PhishingController-method-action-types.d.ts.map +0 -1
  88. package/dist/PhishingController-method-action-types.js.map +0 -1
  89. package/dist/PhishingController.d.ts.map +0 -1
  90. package/dist/PhishingController.js.map +0 -1
  91. package/dist/PhishingDetector.d.ts.map +0 -1
  92. package/dist/PhishingDetector.js.map +0 -1
  93. package/dist/address-poisoning.d.ts.map +0 -1
  94. package/dist/address-poisoning.js.map +0 -1
  95. package/dist/index.d.ts.map +0 -1
  96. package/dist/index.js +0 -7
  97. package/dist/index.js.map +0 -1
  98. package/dist/tests/utils.d.ts.map +0 -1
  99. package/dist/tests/utils.js.map +0 -1
  100. package/dist/types.d.ts.map +0 -1
  101. package/dist/types.js.map +0 -1
  102. package/dist/utils.d.ts.map +0 -1
  103. package/dist/utils.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * This file is auto generated.
4
+ * Do not edit manually.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=PhishingController-method-action-types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhishingController-method-action-types.cjs","sourceRoot":"","sources":["../src/PhishingController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { PhishingController } from './PhishingController.js';\n\n/**\n * Finds known recipient addresses that look like an address poisoning match.\n *\n * @param candidate - The recipient address being checked.\n * @returns Similar known recipient matches sorted by score.\n */\nexport type PhishingControllerCheckAddressPoisoningAction = {\n type: `PhishingController:checkAddressPoisoning`;\n handler: PhishingController['checkAddressPoisoning'];\n};\n\n/**\n * Conditionally update the phishing configuration.\n *\n * If the stalelist configuration is out of date, this function will call `updateStalelist`\n * to update the configuration. This will automatically grab the hotlist,\n * so it isn't necessary to continue on to download the hotlist and the c2 domain blocklist.\n *\n */\nexport type PhishingControllerMaybeUpdateStateAction = {\n type: `PhishingController:maybeUpdateState`;\n handler: PhishingController['maybeUpdateState'];\n};\n\n/**\n * Determines if a given origin is unapproved.\n *\n * It is strongly recommended that you call {@link maybeUpdateState} before calling this,\n * to check whether the phishing configuration is up-to-date. It will be updated if necessary\n * by calling {@link updateStalelist} or {@link updateHotlist}.\n *\n * @param origin - Domain origin of a website.\n * @returns Whether the origin is an unapproved origin.\n */\nexport type PhishingControllerTestOriginAction = {\n type: `PhishingController:testOrigin`;\n handler: PhishingController['testOrigin'];\n};\n\n/**\n * Checks if a request URL's domain is blocked against the request blocklist.\n *\n * This method is used to determine if a specific request URL is associated with a malicious\n * command and control (C2) domain. The URL's hostname is hashed and checked against a configured\n * blocklist of known malicious domains.\n *\n * @param origin - The full request URL to be checked.\n * @returns An object indicating whether the URL's domain is blocked and relevant metadata.\n */\nexport type PhishingControllerIsBlockedRequestAction = {\n type: `PhishingController:isBlockedRequest`;\n handler: PhishingController['isBlockedRequest'];\n};\n\n/**\n * Temporarily marks a given origin as approved.\n *\n * @param origin - The origin to mark as approved.\n */\nexport type PhishingControllerBypassAction = {\n type: `PhishingController:bypass`;\n handler: PhishingController['bypass'];\n};\n\n/**\n * Scan a URL for phishing. For most hosts only the hostname is sent to the API; for known\n * shared gateways the pathname is included (see `PHISHING_DETECTION_PATH_BASED_ROOT_DOMAINS`).\n * Only supports web URLs (`http:` / `https:`).\n *\n * @param url - The URL to scan.\n * @returns The phishing detection scan result.\n */\nexport type PhishingControllerScanUrlAction = {\n type: `PhishingController:scanUrl`;\n handler: PhishingController['scanUrl'];\n};\n\n/**\n * Scan multiple URLs for phishing in bulk. It will only scan the hostnames of the URLs.\n * It also only supports web URLs.\n *\n * @param urls - The URLs to scan.\n * @returns A mapping of URLs to their phishing detection scan results and errors.\n */\nexport type PhishingControllerBulkScanUrlsAction = {\n type: `PhishingController:bulkScanUrls`;\n handler: PhishingController['bulkScanUrls'];\n};\n\n/**\n * Scan an address for security alerts.\n *\n * @param chainId - The chain ID in hex format (e.g., '0x1' for Ethereum).\n * @param address - The address to scan.\n * @returns The address scan result.\n */\nexport type PhishingControllerScanAddressAction = {\n type: `PhishingController:scanAddress`;\n handler: PhishingController['scanAddress'];\n};\n\n/**\n * Scan multiple tokens for malicious activity in bulk.\n *\n * @param request - The bulk scan request containing chainId and tokens.\n * @param request.chainId - The chain identifier. Accepts a hex chain ID for\n * EVM chains (e.g. `'0x1'` for Ethereum) or a chain name for non-EVM chains\n * (e.g. `'solana'`).\n * @param request.tokens - Array of token addresses to scan.\n * @returns A mapping of token addresses to their scan results. For EVM chains,\n * addresses are lowercased; for non-EVM chains, original casing is preserved.\n * Tokens that fail to scan are omitted.\n */\nexport type PhishingControllerBulkScanTokensAction = {\n type: `PhishingController:bulkScanTokens`;\n handler: PhishingController['bulkScanTokens'];\n};\n\nexport type PhishingControllerGetApprovalsAction = {\n type: `PhishingController:getApprovals`;\n handler: PhishingController['getApprovals'];\n};\n\n/**\n * Union of all PhishingController action types.\n */\nexport type PhishingControllerMethodActions =\n | PhishingControllerCheckAddressPoisoningAction\n | PhishingControllerMaybeUpdateStateAction\n | PhishingControllerTestOriginAction\n | PhishingControllerIsBlockedRequestAction\n | PhishingControllerBypassAction\n | PhishingControllerScanUrlAction\n | PhishingControllerBulkScanUrlsAction\n | PhishingControllerScanAddressAction\n | PhishingControllerBulkScanTokensAction\n | PhishingControllerGetApprovalsAction;\n"]}
@@ -2,7 +2,7 @@
2
2
  * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
- import type { PhishingController } from './PhishingController.js';
5
+ import type { PhishingController } from "./PhishingController.cjs";
6
6
  /**
7
7
  * Finds known recipient addresses that look like an address poisoning match.
8
8
  *
@@ -120,4 +120,4 @@ export type PhishingControllerGetApprovalsAction = {
120
120
  * Union of all PhishingController action types.
121
121
  */
122
122
  export type PhishingControllerMethodActions = PhishingControllerCheckAddressPoisoningAction | PhishingControllerMaybeUpdateStateAction | PhishingControllerTestOriginAction | PhishingControllerIsBlockedRequestAction | PhishingControllerBypassAction | PhishingControllerScanUrlAction | PhishingControllerBulkScanUrlsAction | PhishingControllerScanAddressAction | PhishingControllerBulkScanTokensAction | PhishingControllerGetApprovalsAction;
123
- //# sourceMappingURL=PhishingController-method-action-types.d.ts.map
123
+ //# sourceMappingURL=PhishingController-method-action-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhishingController-method-action-types.d.cts","sourceRoot":"","sources":["../src/PhishingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iCAAgC;AAElE;;;;;GAKG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACvC,6CAA6C,GAC7C,wCAAwC,GACxC,kCAAkC,GAClC,wCAAwC,GACxC,8BAA8B,GAC9B,+BAA+B,GAC/B,oCAAoC,GACpC,mCAAmC,GACnC,sCAAsC,GACtC,oCAAoC,CAAC"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { PhishingController } from "./PhishingController.mjs";
6
+ /**
7
+ * Finds known recipient addresses that look like an address poisoning match.
8
+ *
9
+ * @param candidate - The recipient address being checked.
10
+ * @returns Similar known recipient matches sorted by score.
11
+ */
12
+ export type PhishingControllerCheckAddressPoisoningAction = {
13
+ type: `PhishingController:checkAddressPoisoning`;
14
+ handler: PhishingController['checkAddressPoisoning'];
15
+ };
16
+ /**
17
+ * Conditionally update the phishing configuration.
18
+ *
19
+ * If the stalelist configuration is out of date, this function will call `updateStalelist`
20
+ * to update the configuration. This will automatically grab the hotlist,
21
+ * so it isn't necessary to continue on to download the hotlist and the c2 domain blocklist.
22
+ *
23
+ */
24
+ export type PhishingControllerMaybeUpdateStateAction = {
25
+ type: `PhishingController:maybeUpdateState`;
26
+ handler: PhishingController['maybeUpdateState'];
27
+ };
28
+ /**
29
+ * Determines if a given origin is unapproved.
30
+ *
31
+ * It is strongly recommended that you call {@link maybeUpdateState} before calling this,
32
+ * to check whether the phishing configuration is up-to-date. It will be updated if necessary
33
+ * by calling {@link updateStalelist} or {@link updateHotlist}.
34
+ *
35
+ * @param origin - Domain origin of a website.
36
+ * @returns Whether the origin is an unapproved origin.
37
+ */
38
+ export type PhishingControllerTestOriginAction = {
39
+ type: `PhishingController:testOrigin`;
40
+ handler: PhishingController['testOrigin'];
41
+ };
42
+ /**
43
+ * Checks if a request URL's domain is blocked against the request blocklist.
44
+ *
45
+ * This method is used to determine if a specific request URL is associated with a malicious
46
+ * command and control (C2) domain. The URL's hostname is hashed and checked against a configured
47
+ * blocklist of known malicious domains.
48
+ *
49
+ * @param origin - The full request URL to be checked.
50
+ * @returns An object indicating whether the URL's domain is blocked and relevant metadata.
51
+ */
52
+ export type PhishingControllerIsBlockedRequestAction = {
53
+ type: `PhishingController:isBlockedRequest`;
54
+ handler: PhishingController['isBlockedRequest'];
55
+ };
56
+ /**
57
+ * Temporarily marks a given origin as approved.
58
+ *
59
+ * @param origin - The origin to mark as approved.
60
+ */
61
+ export type PhishingControllerBypassAction = {
62
+ type: `PhishingController:bypass`;
63
+ handler: PhishingController['bypass'];
64
+ };
65
+ /**
66
+ * Scan a URL for phishing. For most hosts only the hostname is sent to the API; for known
67
+ * shared gateways the pathname is included (see `PHISHING_DETECTION_PATH_BASED_ROOT_DOMAINS`).
68
+ * Only supports web URLs (`http:` / `https:`).
69
+ *
70
+ * @param url - The URL to scan.
71
+ * @returns The phishing detection scan result.
72
+ */
73
+ export type PhishingControllerScanUrlAction = {
74
+ type: `PhishingController:scanUrl`;
75
+ handler: PhishingController['scanUrl'];
76
+ };
77
+ /**
78
+ * Scan multiple URLs for phishing in bulk. It will only scan the hostnames of the URLs.
79
+ * It also only supports web URLs.
80
+ *
81
+ * @param urls - The URLs to scan.
82
+ * @returns A mapping of URLs to their phishing detection scan results and errors.
83
+ */
84
+ export type PhishingControllerBulkScanUrlsAction = {
85
+ type: `PhishingController:bulkScanUrls`;
86
+ handler: PhishingController['bulkScanUrls'];
87
+ };
88
+ /**
89
+ * Scan an address for security alerts.
90
+ *
91
+ * @param chainId - The chain ID in hex format (e.g., '0x1' for Ethereum).
92
+ * @param address - The address to scan.
93
+ * @returns The address scan result.
94
+ */
95
+ export type PhishingControllerScanAddressAction = {
96
+ type: `PhishingController:scanAddress`;
97
+ handler: PhishingController['scanAddress'];
98
+ };
99
+ /**
100
+ * Scan multiple tokens for malicious activity in bulk.
101
+ *
102
+ * @param request - The bulk scan request containing chainId and tokens.
103
+ * @param request.chainId - The chain identifier. Accepts a hex chain ID for
104
+ * EVM chains (e.g. `'0x1'` for Ethereum) or a chain name for non-EVM chains
105
+ * (e.g. `'solana'`).
106
+ * @param request.tokens - Array of token addresses to scan.
107
+ * @returns A mapping of token addresses to their scan results. For EVM chains,
108
+ * addresses are lowercased; for non-EVM chains, original casing is preserved.
109
+ * Tokens that fail to scan are omitted.
110
+ */
111
+ export type PhishingControllerBulkScanTokensAction = {
112
+ type: `PhishingController:bulkScanTokens`;
113
+ handler: PhishingController['bulkScanTokens'];
114
+ };
115
+ export type PhishingControllerGetApprovalsAction = {
116
+ type: `PhishingController:getApprovals`;
117
+ handler: PhishingController['getApprovals'];
118
+ };
119
+ /**
120
+ * Union of all PhishingController action types.
121
+ */
122
+ export type PhishingControllerMethodActions = PhishingControllerCheckAddressPoisoningAction | PhishingControllerMaybeUpdateStateAction | PhishingControllerTestOriginAction | PhishingControllerIsBlockedRequestAction | PhishingControllerBypassAction | PhishingControllerScanUrlAction | PhishingControllerBulkScanUrlsAction | PhishingControllerScanAddressAction | PhishingControllerBulkScanTokensAction | PhishingControllerGetApprovalsAction;
123
+ //# sourceMappingURL=PhishingController-method-action-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhishingController-method-action-types.d.mts","sourceRoot":"","sources":["../src/PhishingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iCAAgC;AAElE;;;;;GAKG;AACH,MAAM,MAAM,6CAA6C,GAAG;IAC1D,IAAI,EAAE,0CAA0C,CAAC;IACjD,OAAO,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,CAAC;CACtD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAC7C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,sCAAsC,GAAG;IACnD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACvC,6CAA6C,GAC7C,wCAAwC,GACxC,kCAAkC,GAClC,wCAAwC,GACxC,8BAA8B,GAC9B,+BAA+B,GAC/B,oCAAoC,GACpC,mCAAmC,GACnC,sCAAsC,GACtC,oCAAoC,CAAC"}
@@ -3,4 +3,4 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=PhishingController-method-action-types.js.map
6
+ //# sourceMappingURL=PhishingController-method-action-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhishingController-method-action-types.mjs","sourceRoot":"","sources":["../src/PhishingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { PhishingController } from './PhishingController.js';\n\n/**\n * Finds known recipient addresses that look like an address poisoning match.\n *\n * @param candidate - The recipient address being checked.\n * @returns Similar known recipient matches sorted by score.\n */\nexport type PhishingControllerCheckAddressPoisoningAction = {\n type: `PhishingController:checkAddressPoisoning`;\n handler: PhishingController['checkAddressPoisoning'];\n};\n\n/**\n * Conditionally update the phishing configuration.\n *\n * If the stalelist configuration is out of date, this function will call `updateStalelist`\n * to update the configuration. This will automatically grab the hotlist,\n * so it isn't necessary to continue on to download the hotlist and the c2 domain blocklist.\n *\n */\nexport type PhishingControllerMaybeUpdateStateAction = {\n type: `PhishingController:maybeUpdateState`;\n handler: PhishingController['maybeUpdateState'];\n};\n\n/**\n * Determines if a given origin is unapproved.\n *\n * It is strongly recommended that you call {@link maybeUpdateState} before calling this,\n * to check whether the phishing configuration is up-to-date. It will be updated if necessary\n * by calling {@link updateStalelist} or {@link updateHotlist}.\n *\n * @param origin - Domain origin of a website.\n * @returns Whether the origin is an unapproved origin.\n */\nexport type PhishingControllerTestOriginAction = {\n type: `PhishingController:testOrigin`;\n handler: PhishingController['testOrigin'];\n};\n\n/**\n * Checks if a request URL's domain is blocked against the request blocklist.\n *\n * This method is used to determine if a specific request URL is associated with a malicious\n * command and control (C2) domain. The URL's hostname is hashed and checked against a configured\n * blocklist of known malicious domains.\n *\n * @param origin - The full request URL to be checked.\n * @returns An object indicating whether the URL's domain is blocked and relevant metadata.\n */\nexport type PhishingControllerIsBlockedRequestAction = {\n type: `PhishingController:isBlockedRequest`;\n handler: PhishingController['isBlockedRequest'];\n};\n\n/**\n * Temporarily marks a given origin as approved.\n *\n * @param origin - The origin to mark as approved.\n */\nexport type PhishingControllerBypassAction = {\n type: `PhishingController:bypass`;\n handler: PhishingController['bypass'];\n};\n\n/**\n * Scan a URL for phishing. For most hosts only the hostname is sent to the API; for known\n * shared gateways the pathname is included (see `PHISHING_DETECTION_PATH_BASED_ROOT_DOMAINS`).\n * Only supports web URLs (`http:` / `https:`).\n *\n * @param url - The URL to scan.\n * @returns The phishing detection scan result.\n */\nexport type PhishingControllerScanUrlAction = {\n type: `PhishingController:scanUrl`;\n handler: PhishingController['scanUrl'];\n};\n\n/**\n * Scan multiple URLs for phishing in bulk. It will only scan the hostnames of the URLs.\n * It also only supports web URLs.\n *\n * @param urls - The URLs to scan.\n * @returns A mapping of URLs to their phishing detection scan results and errors.\n */\nexport type PhishingControllerBulkScanUrlsAction = {\n type: `PhishingController:bulkScanUrls`;\n handler: PhishingController['bulkScanUrls'];\n};\n\n/**\n * Scan an address for security alerts.\n *\n * @param chainId - The chain ID in hex format (e.g., '0x1' for Ethereum).\n * @param address - The address to scan.\n * @returns The address scan result.\n */\nexport type PhishingControllerScanAddressAction = {\n type: `PhishingController:scanAddress`;\n handler: PhishingController['scanAddress'];\n};\n\n/**\n * Scan multiple tokens for malicious activity in bulk.\n *\n * @param request - The bulk scan request containing chainId and tokens.\n * @param request.chainId - The chain identifier. Accepts a hex chain ID for\n * EVM chains (e.g. `'0x1'` for Ethereum) or a chain name for non-EVM chains\n * (e.g. `'solana'`).\n * @param request.tokens - Array of token addresses to scan.\n * @returns A mapping of token addresses to their scan results. For EVM chains,\n * addresses are lowercased; for non-EVM chains, original casing is preserved.\n * Tokens that fail to scan are omitted.\n */\nexport type PhishingControllerBulkScanTokensAction = {\n type: `PhishingController:bulkScanTokens`;\n handler: PhishingController['bulkScanTokens'];\n};\n\nexport type PhishingControllerGetApprovalsAction = {\n type: `PhishingController:getApprovals`;\n handler: PhishingController['getApprovals'];\n};\n\n/**\n * Union of all PhishingController action types.\n */\nexport type PhishingControllerMethodActions =\n | PhishingControllerCheckAddressPoisoningAction\n | PhishingControllerMaybeUpdateStateAction\n | PhishingControllerTestOriginAction\n | PhishingControllerIsBlockedRequestAction\n | PhishingControllerBypassAction\n | PhishingControllerScanUrlAction\n | PhishingControllerBulkScanUrlsAction\n | PhishingControllerScanAddressAction\n | PhishingControllerBulkScanTokensAction\n | PhishingControllerGetApprovalsAction;\n"]}