@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,338 @@
1
+ /**
2
+ * Represents the result of checking a domain.
3
+ */
4
+ export type PhishingDetectorResult = {
5
+ /**
6
+ * The name of the configuration object in which the domain was found within
7
+ * an allowlist, blocklist, or fuzzylist.
8
+ */
9
+ name?: string;
10
+ /**
11
+ * The version associated with the configuration object in which the domain
12
+ * was found within an allowlist, blocklist, or fuzzylist.
13
+ */
14
+ version?: string;
15
+ /**
16
+ * Whether the domain is regarded as allowed (true) or not (false).
17
+ */
18
+ result: boolean;
19
+ /**
20
+ * A normalized version of the domain, which is only constructed if the domain
21
+ * is found within a list.
22
+ */
23
+ match?: string;
24
+ /**
25
+ * Which type of list in which the domain was found.
26
+ *
27
+ * - "allowlist" means that the domain was found in the allowlist.
28
+ * - "blocklist" means that the domain was found in the blocklist.
29
+ * - "fuzzy" means that the domain was found in the fuzzylist.
30
+ * - "blacklist" means that the domain was found in a blacklist of a legacy
31
+ * configuration object.
32
+ * - "whitelist" means that the domain was found in a whitelist of a legacy
33
+ * configuration object.
34
+ * - "all" means that the domain was not found in any list.
35
+ */
36
+ type: PhishingDetectorResultType;
37
+ };
38
+ /**
39
+ * The type of list in which the domain was found.
40
+ */
41
+ export declare enum PhishingDetectorResultType {
42
+ All = "all",
43
+ Fuzzy = "fuzzy",
44
+ Blocklist = "blocklist",
45
+ Allowlist = "allowlist",
46
+ Blacklist = "blacklist",
47
+ Whitelist = "whitelist",
48
+ C2DomainBlocklist = "c2DomainBlocklist"
49
+ }
50
+ /**
51
+ * PhishingDetectionScanResult represents the result of a phishing detection scan.
52
+ */
53
+ export type PhishingDetectionScanResult = {
54
+ /**
55
+ * The hostname that was scanned.
56
+ */
57
+ hostname: string;
58
+ /**
59
+ * Indicates the warning level based on risk factors.
60
+ *
61
+ * - "NONE" means it is most likely safe.
62
+ * - "WARN" means there is some risk.
63
+ * - "BLOCK" means it is highly likely to be malicious.
64
+ * - "VERIFIED" means it has been associated as an official domain of a
65
+ * company or organization and/or a top Web3 domain.
66
+ */
67
+ recommendedAction: RecommendedAction;
68
+ /**
69
+ * An optional error message that exists if:
70
+ * - The link requested is not a valid web URL.
71
+ * - Failed to fetch the result from the phishing detector.
72
+ *
73
+ * Consumers can use the existence of this field to retry.
74
+ */
75
+ fetchError?: string;
76
+ };
77
+ /**
78
+ * Indicates the warning level based on risk factors
79
+ */
80
+ export declare enum RecommendedAction {
81
+ /**
82
+ * None means it is most likely safe
83
+ */
84
+ None = "NONE",
85
+ /**
86
+ * Warn means there is some risk
87
+ */
88
+ Warn = "WARN",
89
+ /**
90
+ * Block means it is highly likely to be malicious
91
+ */
92
+ Block = "BLOCK",
93
+ /**
94
+ * Verified means it has been associated as an official domain of a
95
+ * company or organization and/or a top Web3 domain.
96
+ */
97
+ Verified = "VERIFIED"
98
+ }
99
+ /**
100
+ * Request for bulk token scan
101
+ */
102
+ export type BulkTokenScanRequest = {
103
+ chainId: string;
104
+ tokens: string[];
105
+ };
106
+ /**
107
+ * Result type of a token scan
108
+ */
109
+ export declare enum TokenScanResultType {
110
+ Benign = "Benign",
111
+ Warning = "Warning",
112
+ Malicious = "Malicious",
113
+ Spam = "Spam"
114
+ }
115
+ /**
116
+ * Result of a token scan
117
+ */
118
+ export type TokenScanResult = {
119
+ result_type: TokenScanResultType;
120
+ chain: string;
121
+ address: string;
122
+ };
123
+ /**
124
+ * Response for bulk token scan requests
125
+ */
126
+ export type BulkTokenScanResponse = Record<string, TokenScanResult>;
127
+ /**
128
+ * Token data stored in cache (excludes chain and address which are in the key)
129
+ * For now, we only cache the result type, but we could add more data if needed in the future
130
+ */
131
+ export type TokenScanCacheData = Omit<TokenScanResult, 'chain' | 'address'>;
132
+ /**
133
+ * API response from the bulk token scanning endpoint
134
+ */
135
+ export type TokenScanApiResponse = {
136
+ results: Record<string, {
137
+ result_type: TokenScanResultType;
138
+ chain?: string;
139
+ address?: string;
140
+ }>;
141
+ };
142
+ export declare const DEFAULT_CHAIN_ID_TO_NAME: {
143
+ readonly '0x1': "ethereum";
144
+ readonly '0x89': "polygon";
145
+ readonly '0x38': "bsc";
146
+ readonly '0xa4b1': "arbitrum";
147
+ readonly '0xa86a': "avalanche";
148
+ readonly '0x2105': "base";
149
+ readonly '0xa': "optimism";
150
+ readonly '0x76adf1': "zora";
151
+ readonly '0xe708': "linea";
152
+ readonly '0x27bc86aa': "degen";
153
+ readonly '0x144': "zksync";
154
+ readonly '0x82750': "scroll";
155
+ readonly '0x13e31': "blast";
156
+ readonly '0x74c': "soneium";
157
+ readonly '0x79a': "soneium-minato";
158
+ readonly '0x14a34': "base-sepolia";
159
+ readonly '0xab5': "abstract";
160
+ readonly '0x849ea': "zero-network";
161
+ readonly '0x138de': "berachain";
162
+ readonly '0x82': "unichain";
163
+ readonly '0x7e4': "ronin";
164
+ readonly '0x127': "hedera";
165
+ readonly '0x12c': "zksync-sepolia";
166
+ readonly '0xaa36a7': "ethereum-sepolia";
167
+ readonly '0xa869': "avalanche-fuji";
168
+ readonly '0x343b': "immutable-zkevm";
169
+ readonly '0x34a1': "immutable-zkevm-testnet";
170
+ readonly '0x64': "gnosis";
171
+ readonly '0x1e0': "worldchain";
172
+ readonly '0x8173': "apechain";
173
+ readonly '0x138c5': "berachain-bartio";
174
+ readonly '0xdef1': "ink";
175
+ readonly '0xba5ed': "ink-sepolia";
176
+ readonly '0x2b74': "abstract-testnet";
177
+ readonly '0x531': "sei";
178
+ readonly '0x2eb': "flow-evm";
179
+ readonly '0x8f': "monad";
180
+ readonly '0x3e7': "hyperevm";
181
+ readonly '0xc4': "xlayer";
182
+ readonly '0x10e6': "megaeth";
183
+ readonly '0x1079': "tempo";
184
+ readonly '0xa5bf': "tempo-testnet";
185
+ readonly '0x2019': "kaia";
186
+ readonly '0x1237': "robinhood";
187
+ readonly '0x13b2': "arc";
188
+ readonly '0x2611': "plasma";
189
+ readonly '0x1388': "mantle";
190
+ readonly '0xb67d2': "katana";
191
+ readonly '0x18232': "plume";
192
+ readonly '0x93e': "kite-ai";
193
+ readonly '0x279f': "monad-testnet";
194
+ readonly solana: "solana";
195
+ readonly starknet: "starknet";
196
+ readonly 'starknet-sepolia': "starknet-sepolia";
197
+ readonly stellar: "stellar";
198
+ readonly bitcoin: "bitcoin";
199
+ readonly sui: "sui";
200
+ readonly tron: "tron";
201
+ };
202
+ export type ChainIdToNameMap = typeof DEFAULT_CHAIN_ID_TO_NAME;
203
+ /**
204
+ * Result type of an address scan
205
+ */
206
+ export declare enum AddressScanResultType {
207
+ /**
208
+ * Address is benign/safe
209
+ */
210
+ Benign = "Benign",
211
+ /**
212
+ * Address has warning indicators
213
+ */
214
+ Warning = "Warning",
215
+ /**
216
+ * Address is malicious
217
+ */
218
+ Malicious = "Malicious",
219
+ /**
220
+ * Error occurred during scan
221
+ */
222
+ ErrorResult = "ErrorResult"
223
+ }
224
+ /**
225
+ * Result of an address security scan
226
+ */
227
+ export type AddressScanResult = {
228
+ /**
229
+ * The result type indicating the security assessment
230
+ */
231
+ result_type: AddressScanResultType;
232
+ /**
233
+ * Additional label or description for the result
234
+ */
235
+ label: string;
236
+ };
237
+ /**
238
+ * Address data stored in cache (minimal data needed)
239
+ */
240
+ export type AddressScanCacheData = {
241
+ result_type: AddressScanResultType;
242
+ label: string;
243
+ };
244
+ /**
245
+ * Similar address match metadata for address poisoning detection.
246
+ */
247
+ export type SimilarAddressMatch = {
248
+ /**
249
+ * The known recipient address that resembles the candidate address.
250
+ */
251
+ knownAddress: string;
252
+ /**
253
+ * Number of matching characters at the start of the address body.
254
+ */
255
+ prefixMatchLength: number;
256
+ /**
257
+ * Number of matching characters at the end of the address body.
258
+ */
259
+ suffixMatchLength: number;
260
+ /**
261
+ * Combined similarity score used to rank matches.
262
+ */
263
+ poisoningScore: number;
264
+ /**
265
+ * Character positions where the candidate and known addresses differ.
266
+ * Indices are based on the full hex string, including the `0x` prefix.
267
+ */
268
+ diffIndices: number[];
269
+ };
270
+ /**
271
+ * Thresholds for address poisoning similarity detection.
272
+ */
273
+ export type SimilarityOptions = {
274
+ /**
275
+ * Minimum required prefix match length.
276
+ */
277
+ prefixLen?: number;
278
+ /**
279
+ * Minimum required suffix match length.
280
+ */
281
+ suffixLen?: number;
282
+ };
283
+ export declare const APPROVAL_SUPPORTED_CHAINS: readonly ["ethereum", "polygon", "bsc", "avalanche", "arbitrum", "base", "linea", "optimism"];
284
+ export type ApprovalSupportedChain = (typeof APPROVAL_SUPPORTED_CHAINS)[number];
285
+ export declare const TOKEN_SCAN_SUPPORTED_CHAINS: readonly ["arbitrum", "avalanche", "base", "bsc", "ethereum", "optimism", "polygon", "zora", "solana", "starknet", "starknet-sepolia", "stellar", "linea", "degen", "zksync", "scroll", "blast", "soneium-minato", "base-sepolia", "bitcoin", "abstract", "soneium", "ink", "berachain", "unichain", "ronin", "sui", "hedera", "hyperevm", "xlayer", "monad", "megaeth", "tempo", "sei", "kaia", "tron", "robinhood"];
286
+ export type TokenScanSupportedChain = (typeof TOKEN_SCAN_SUPPORTED_CHAINS)[number];
287
+ export declare const ADDRESS_SCAN_SUPPORTED_CHAINS: readonly ["arbitrum", "avalanche", "base", "base-sepolia", "bsc", "ethereum", "optimism", "polygon", "zksync", "zksync-sepolia", "zora", "linea", "blast", "scroll", "ethereum-sepolia", "degen", "avalanche-fuji", "gnosis", "worldchain", "soneium-minato", "ronin", "apechain", "berachain", "berachain-bartio", "ink", "ink-sepolia", "abstract", "abstract-testnet", "soneium", "unichain", "sei", "flow-evm", "hyperevm", "megaeth", "katana", "plume", "xlayer", "monad", "monad-testnet", "tempo", "tempo-testnet", "kite-ai", "kaia", "plasma", "mantle", "robinhood", "arc"];
288
+ export type AddressScanSupportedChain = (typeof ADDRESS_SCAN_SUPPORTED_CHAINS)[number];
289
+ export declare enum ApprovalResultType {
290
+ Malicious = "Malicious",
291
+ Warning = "Warning",
292
+ Benign = "Benign",
293
+ ErrorResult = "Error"
294
+ }
295
+ export declare enum ApprovalFeatureType {
296
+ Malicious = "Malicious",
297
+ Warning = "Warning",
298
+ Benign = "Benign",
299
+ Info = "Info"
300
+ }
301
+ export type ApprovalFeature = {
302
+ feature_id: string;
303
+ type: ApprovalFeatureType;
304
+ description: string;
305
+ };
306
+ export type Allowance = {
307
+ value?: string;
308
+ usd_price?: string;
309
+ };
310
+ export type ApprovalAsset = {
311
+ address: string;
312
+ symbol: string;
313
+ name: string;
314
+ decimals: number;
315
+ logo_url?: string;
316
+ type?: string;
317
+ };
318
+ export type Exposure = {
319
+ usd_price?: string;
320
+ value: string;
321
+ raw_value: string;
322
+ };
323
+ export type Spender = {
324
+ address: string;
325
+ label?: string;
326
+ features?: ApprovalFeature[];
327
+ };
328
+ export type Approval = {
329
+ allowance: Allowance;
330
+ asset: ApprovalAsset;
331
+ exposure: Exposure;
332
+ spender: Spender;
333
+ verdict: ApprovalResultType;
334
+ };
335
+ export type ApprovalsResponse = {
336
+ approvals: Approval[];
337
+ };
338
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;OAWG;IACH,IAAI,EAAE,0BAA0B,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,oBAAY,0BAA0B;IAIpC,GAAG,QAAQ;IAIX,KAAK,UAAU;IAIf,SAAS,cAAc;IAIvB,SAAS,cAAc;IAKvB,SAAS,cAAc;IAKvB,SAAS,cAAc;IAIvB,iBAAiB,sBAAsB;CACxC;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IACrC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,KAAK,UAAU;IACf;;;OAGG;IACH,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,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F,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC"}
@@ -261,4 +261,4 @@ export var ApprovalFeatureType;
261
261
  ApprovalFeatureType["Benign"] = "Benign";
262
262
  ApprovalFeatureType["Info"] = "Info";
263
263
  })(ApprovalFeatureType || (ApprovalFeatureType = {}));
264
- //# sourceMappingURL=types.js.map
264
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAuCA;;GAEG;AACH,MAAM,CAAN,IAAY,0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AAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;AACvB,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,oCAAa,CAAA;AACf,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\n/**\n * Represents the result of checking a domain.\n */\nexport type PhishingDetectorResult = {\n /**\n * The name of the configuration object in which the domain was found within\n * an allowlist, blocklist, or fuzzylist.\n */\n name?: string;\n /**\n * The version associated with the configuration object in which the domain\n * was found within an allowlist, blocklist, or fuzzylist.\n */\n version?: string;\n /**\n * Whether the domain is regarded as allowed (true) or not (false).\n */\n result: boolean;\n /**\n * A normalized version of the domain, which is only constructed if the domain\n * is found within a list.\n */\n match?: string;\n /**\n * Which type of list in which the domain was found.\n *\n * - \"allowlist\" means that the domain was found in the allowlist.\n * - \"blocklist\" means that the domain was found in the blocklist.\n * - \"fuzzy\" means that the domain was found in the fuzzylist.\n * - \"blacklist\" means that the domain was found in a blacklist of a legacy\n * configuration object.\n * - \"whitelist\" means that the domain was found in a whitelist of a legacy\n * configuration object.\n * - \"all\" means that the domain was not found in any list.\n */\n type: PhishingDetectorResultType;\n};\n\n/**\n * The type of list in which the domain was found.\n */\nexport enum PhishingDetectorResultType {\n /*\n * \"all\" means that the domain was not found in any list.\n */\n All = 'all',\n /*\n * \"fuzzy\" means that the domain was found in the fuzzylist.\n */\n Fuzzy = 'fuzzy',\n /*\n * \"blocklist\" means that the domain was found in the blocklist.\n */\n Blocklist = 'blocklist',\n /*\n * \"allowlist\" means that the domain was found in the allowlist.\n */\n Allowlist = 'allowlist',\n /*\n * \"blacklist\" means that the domain was found in a blacklist of a legacy\n * configuration object.\n */\n Blacklist = 'blacklist',\n /*\n * \"whitelist\" means that the domain was found in a whitelist of a legacy\n * configuration object.\n */\n Whitelist = 'whitelist',\n /*\n * \"c2DomainBlocklist\" means that the domain was found in the C2 domain blocklist.\n */\n C2DomainBlocklist = 'c2DomainBlocklist',\n}\n\n/**\n * PhishingDetectionScanResult represents the result of a phishing detection scan.\n */\nexport type PhishingDetectionScanResult = {\n /**\n * The hostname that was scanned.\n */\n hostname: string;\n /**\n * Indicates the warning level based on risk factors.\n *\n * - \"NONE\" means it is most likely safe.\n * - \"WARN\" means there is some risk.\n * - \"BLOCK\" means it is highly likely to be malicious.\n * - \"VERIFIED\" means it has been associated as an official domain of a\n * company or organization and/or a top Web3 domain.\n */\n recommendedAction: RecommendedAction;\n /**\n * An optional error message that exists if:\n * - The link requested is not a valid web URL.\n * - Failed to fetch the result from the phishing detector.\n *\n * Consumers can use the existence of this field to retry.\n */\n fetchError?: string;\n};\n\n/**\n * Indicates the warning level based on risk factors\n */\nexport enum RecommendedAction {\n /**\n * None means it is most likely safe\n */\n None = 'NONE',\n /**\n * Warn means there is some risk\n */\n Warn = 'WARN',\n /**\n * Block means it is highly likely to be malicious\n */\n Block = 'BLOCK',\n /**\n * Verified means it has been associated as an official domain of a\n * company or organization and/or a top Web3 domain.\n */\n Verified = 'VERIFIED',\n}\n\n/**\n * Request for bulk token scan\n */\nexport type BulkTokenScanRequest = {\n chainId: string;\n tokens: string[];\n};\n\n/**\n * Result type of a token scan\n */\nexport enum TokenScanResultType {\n Benign = 'Benign',\n Warning = 'Warning',\n Malicious = 'Malicious',\n Spam = 'Spam',\n}\n\n/**\n * Result of a token scan\n */\nexport type TokenScanResult = {\n result_type: TokenScanResultType;\n chain: string;\n address: string;\n};\n\n/**\n * Response for bulk token scan requests\n */\nexport type BulkTokenScanResponse = Record<string, TokenScanResult>;\n\n/**\n * Token data stored in cache (excludes chain and address which are in the key)\n * For now, we only cache the result type, but we could add more data if needed in the future\n */\nexport type TokenScanCacheData = Omit<TokenScanResult, 'chain' | 'address'>;\n\n/**\n * API response from the bulk token scanning endpoint\n */\nexport type TokenScanApiResponse = {\n results: Record<\n string,\n {\n result_type: TokenScanResultType;\n chain?: string;\n address?: string;\n }\n >;\n};\n\nexport const DEFAULT_CHAIN_ID_TO_NAME = {\n '0x1': 'ethereum',\n '0x89': 'polygon',\n '0x38': 'bsc',\n '0xa4b1': 'arbitrum',\n '0xa86a': 'avalanche',\n '0x2105': 'base',\n '0xa': 'optimism',\n '0x76adf1': 'zora',\n '0xe708': 'linea',\n '0x27bc86aa': 'degen',\n '0x144': 'zksync',\n '0x82750': 'scroll',\n '0x13e31': 'blast',\n '0x74c': 'soneium',\n '0x79a': 'soneium-minato',\n '0x14a34': 'base-sepolia',\n '0xab5': 'abstract',\n '0x849ea': 'zero-network',\n '0x138de': 'berachain',\n '0x82': 'unichain',\n '0x7e4': 'ronin',\n '0x127': 'hedera',\n '0x12c': 'zksync-sepolia',\n '0xaa36a7': 'ethereum-sepolia',\n '0xa869': 'avalanche-fuji',\n '0x343b': 'immutable-zkevm',\n '0x34a1': 'immutable-zkevm-testnet',\n '0x64': 'gnosis',\n '0x1e0': 'worldchain',\n '0x8173': 'apechain',\n '0x138c5': 'berachain-bartio',\n '0xdef1': 'ink',\n '0xba5ed': 'ink-sepolia',\n '0x2b74': 'abstract-testnet',\n '0x531': 'sei',\n '0x2eb': 'flow-evm',\n '0x8f': 'monad',\n '0x3e7': 'hyperevm',\n '0xc4': 'xlayer',\n '0x10e6': 'megaeth',\n '0x1079': 'tempo',\n '0xa5bf': 'tempo-testnet',\n '0x2019': 'kaia',\n '0x1237': 'robinhood',\n '0x13b2': 'arc',\n '0x2611': 'plasma',\n '0x1388': 'mantle',\n '0xb67d2': 'katana',\n '0x18232': 'plume',\n '0x93e': 'kite-ai',\n '0x279f': 'monad-testnet',\n solana: 'solana',\n starknet: 'starknet',\n 'starknet-sepolia': 'starknet-sepolia',\n stellar: 'stellar',\n bitcoin: 'bitcoin',\n sui: 'sui',\n tron: 'tron',\n} as const;\n\nexport type ChainIdToNameMap = typeof DEFAULT_CHAIN_ID_TO_NAME;\n\n/**\n * Result type of an address scan\n */\nexport enum AddressScanResultType {\n /**\n * Address is benign/safe\n */\n Benign = 'Benign',\n /**\n * Address has warning indicators\n */\n Warning = 'Warning',\n /**\n * Address is malicious\n */\n Malicious = 'Malicious',\n /**\n * Error occurred during scan\n */\n ErrorResult = 'ErrorResult',\n}\n\n/**\n * Result of an address security scan\n */\nexport type AddressScanResult = {\n /**\n * The result type indicating the security assessment\n */\n result_type: AddressScanResultType;\n /**\n * Additional label or description for the result\n */\n label: string;\n};\n\n/**\n * Address data stored in cache (minimal data needed)\n */\nexport type AddressScanCacheData = {\n result_type: AddressScanResultType;\n label: string;\n};\n\n/**\n * Similar address match metadata for address poisoning detection.\n */\nexport type SimilarAddressMatch = {\n /**\n * The known recipient address that resembles the candidate address.\n */\n knownAddress: string;\n /**\n * Number of matching characters at the start of the address body.\n */\n prefixMatchLength: number;\n /**\n * Number of matching characters at the end of the address body.\n */\n suffixMatchLength: number;\n /**\n * Combined similarity score used to rank matches.\n */\n poisoningScore: number;\n /**\n * Character positions where the candidate and known addresses differ.\n * Indices are based on the full hex string, including the `0x` prefix.\n */\n diffIndices: number[];\n};\n\n/**\n * Thresholds for address poisoning similarity detection.\n */\nexport type SimilarityOptions = {\n /**\n * Minimum required prefix match length.\n */\n prefixLen?: number;\n /**\n * Minimum required suffix match length.\n */\n suffixLen?: number;\n};\n\nexport const APPROVAL_SUPPORTED_CHAINS = [\n 'ethereum',\n 'polygon',\n 'bsc',\n 'avalanche',\n 'arbitrum',\n 'base',\n 'linea',\n 'optimism',\n] as const;\n\nexport type ApprovalSupportedChain = (typeof APPROVAL_SUPPORTED_CHAINS)[number];\n\nexport const TOKEN_SCAN_SUPPORTED_CHAINS = [\n 'arbitrum',\n 'avalanche',\n 'base',\n 'bsc',\n 'ethereum',\n 'optimism',\n 'polygon',\n 'zora',\n 'solana',\n 'starknet',\n 'starknet-sepolia',\n 'stellar',\n 'linea',\n 'degen',\n 'zksync',\n 'scroll',\n 'blast',\n 'soneium-minato',\n 'base-sepolia',\n 'bitcoin',\n 'abstract',\n 'soneium',\n 'ink',\n 'berachain',\n 'unichain',\n 'ronin',\n 'sui',\n 'hedera',\n 'hyperevm',\n 'xlayer',\n 'monad',\n 'megaeth',\n 'tempo',\n 'sei',\n 'kaia',\n 'tron',\n 'robinhood',\n] as const;\n\nexport type TokenScanSupportedChain =\n (typeof TOKEN_SCAN_SUPPORTED_CHAINS)[number];\n\nexport const ADDRESS_SCAN_SUPPORTED_CHAINS = [\n 'arbitrum',\n 'avalanche',\n 'base',\n 'base-sepolia',\n 'bsc',\n 'ethereum',\n 'optimism',\n 'polygon',\n 'zksync',\n 'zksync-sepolia',\n 'zora',\n 'linea',\n 'blast',\n 'scroll',\n 'ethereum-sepolia',\n 'degen',\n 'avalanche-fuji',\n 'gnosis',\n 'worldchain',\n 'soneium-minato',\n 'ronin',\n 'apechain',\n 'berachain',\n 'berachain-bartio',\n 'ink',\n 'ink-sepolia',\n 'abstract',\n 'abstract-testnet',\n 'soneium',\n 'unichain',\n 'sei',\n 'flow-evm',\n 'hyperevm',\n 'megaeth',\n 'katana',\n 'plume',\n 'xlayer',\n 'monad',\n 'monad-testnet',\n 'tempo',\n 'tempo-testnet',\n 'kite-ai',\n 'kaia',\n 'plasma',\n 'mantle',\n 'robinhood',\n 'arc',\n] as const;\n\nexport type AddressScanSupportedChain =\n (typeof ADDRESS_SCAN_SUPPORTED_CHAINS)[number];\n\nexport enum ApprovalResultType {\n Malicious = 'Malicious',\n Warning = 'Warning',\n Benign = 'Benign',\n ErrorResult = 'Error',\n}\n\nexport enum ApprovalFeatureType {\n Malicious = 'Malicious',\n Warning = 'Warning',\n Benign = 'Benign',\n Info = 'Info',\n}\n\nexport type ApprovalFeature = {\n feature_id: string;\n type: ApprovalFeatureType;\n description: string;\n};\n\nexport type Allowance = {\n value?: string;\n usd_price?: string;\n};\n\nexport type ApprovalAsset = {\n address: string;\n symbol: string;\n name: string;\n decimals: number;\n logo_url?: string;\n type?: string;\n};\n\nexport type Exposure = {\n usd_price?: string;\n value: string;\n raw_value: string;\n};\n\nexport type Spender = {\n address: string;\n label?: string;\n features?: ApprovalFeature[];\n};\n\nexport type Approval = {\n allowance: Allowance;\n asset: ApprovalAsset;\n exposure: Exposure;\n spender: Spender;\n verdict: ApprovalResultType;\n};\n\nexport type ApprovalsResponse = {\n approvals: Approval[];\n};\n"]}