@portal-hq/web 3.7.0 → 3.8.0

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.
@@ -0,0 +1,337 @@
1
+
2
+ export interface ScanEVMRequest {
3
+ transaction: TransactionObject
4
+ url?: string
5
+ blockNumber?: number
6
+ validateNonce?: boolean
7
+ showFullFindings?: boolean
8
+ policy?: string
9
+ }
10
+
11
+ export interface ScanEVMResponse {
12
+ data: {
13
+ rawResponse: {
14
+ success: boolean
15
+ data: TransactionRiskData
16
+ error: string | null
17
+ version?: string
18
+ service?: string
19
+ }
20
+ }
21
+ }
22
+
23
+ export interface ScanEip712Request {
24
+ walletAddress: string
25
+ chainId: string
26
+ eip712Message: Eip712TypedData
27
+ showFullFindings?: boolean
28
+ policy?: string
29
+ }
30
+
31
+ export interface ScanEip712Response {
32
+ data: {
33
+ rawResponse: {
34
+ success: boolean
35
+ data: TypedMessageRiskData
36
+ error: string | null
37
+ version?: string
38
+ service?: string
39
+ }
40
+ }
41
+ }
42
+
43
+ export interface ScanSolanaRequest {
44
+ transaction: SolanaTransaction
45
+ url?: string
46
+ validateRecentBlockHash?: boolean
47
+ showFullFindings?: boolean
48
+ policy?: string
49
+ }
50
+
51
+ export interface ScanSolanaResponse {
52
+ data: {
53
+ rawResponse: {
54
+ success: boolean
55
+ data: SolanaTransactionRiskData
56
+ error: string | null
57
+ version?: string
58
+ service?: string
59
+ }
60
+ }
61
+ }
62
+
63
+ export type ScanNftsRequest = ScanNftRequestItem[]
64
+
65
+ export interface ScanNftsResponse {
66
+ data: {
67
+ rawResponse: {
68
+ success: boolean
69
+ data: {
70
+ nfts: ScanNftResponseItem[]
71
+ }
72
+ error: string | null
73
+ version?: string
74
+ service?: string
75
+ }
76
+ }
77
+ }
78
+
79
+ export type ScanTokensRequest = ScanTokenRequestItem[]
80
+
81
+ export interface ScanTokensResponse {
82
+ data: {
83
+ rawResponse: {
84
+ success: boolean
85
+ data: {
86
+ tokens: ScanTokenResponseItem[]
87
+ }
88
+ error: string | null
89
+ version?: string
90
+ service?: string
91
+ }
92
+ }
93
+ }
94
+
95
+ export type ScanUrlRequest = string
96
+
97
+ export interface ScanUrlResponse {
98
+ data: {
99
+ rawResponse: {
100
+ success: boolean
101
+ data: {
102
+ isMalicious: boolean
103
+ deepScanTriggered?: boolean
104
+ }
105
+ error: string | null
106
+ version?: string
107
+ service?: string
108
+ }
109
+ }
110
+ }
111
+
112
+ export interface ScreenAddressResponse {
113
+ address: string
114
+ recommendation: string
115
+ severity: string
116
+ totalIncomingUsd: number
117
+ policyId: string
118
+ timestamp: string
119
+ flags: Flag[]
120
+ }
121
+
122
+ export interface Flag {
123
+ title: string
124
+ flagId: string
125
+ chain: string
126
+ severity: string
127
+ lastUpdate?: string
128
+ events: HypernativeEvent[]
129
+ exposures: Exposure[]
130
+ }
131
+
132
+ export interface HypernativeEvent {
133
+ eventId: string
134
+ address: string
135
+ chain: string
136
+ flagId: string
137
+ timestampEvent: string
138
+ txHash: string
139
+ direction: string
140
+ hop: number
141
+ counterpartyAddress: string
142
+ counterpartyAlias?: string
143
+ counterpartyFlagId: string
144
+ tokenSymbol: string
145
+ tokenAmount: number
146
+ tokenUsdValue: number
147
+ reason: string
148
+ source: string
149
+ originalFlaggedAddress: string
150
+ originalFlaggedAlias?: string
151
+ originalFlaggedChain: string
152
+ }
153
+
154
+ export interface Exposure {
155
+ exposurePortion: number
156
+ exposureType?: string
157
+ totalExposureUsd: number
158
+ flaggedInteractions: FlaggedInteraction[]
159
+ }
160
+
161
+ export interface FlaggedInteraction {
162
+ address: string
163
+ chain: string
164
+ alias?: string
165
+ minHop: number
166
+ totalExposureUsd: number
167
+ }
168
+
169
+ export interface TransactionRiskData {
170
+ assessmentId?: string
171
+ assessmentTimestamp?: string
172
+ recommendation: 'accept' | 'notes' | 'warn' | 'deny' | 'autoAccept'
173
+ expectedStatus?: 'success' | 'fail'
174
+ findings?: Finding[]
175
+ involvedAssets?: Asset[]
176
+ balanceChanges?: Record<string, BalanceChange[]> | null
177
+ parsedActions?: Record<string, unknown[]>
178
+ blockNumber?: number
179
+ riIds?: string[]
180
+ signature?: string
181
+ }
182
+
183
+ export interface TypedMessageRiskData {
184
+ assessmentId?: string
185
+ assessmentTimestamp?: string
186
+ blockNumber?: number
187
+ recommendation: 'accept' | 'notes' | 'warn' | 'deny' | 'autoAccept'
188
+ findings?: Finding[]
189
+ involvedAssets?: Asset[]
190
+ parsedActions?: Record<string, unknown[]>
191
+ riIds?: string[]
192
+ }
193
+
194
+ export interface SolanaTransactionRiskData {
195
+ recommendation: 'accept' | 'notes' | 'warn' | 'deny' | 'autoAccept'
196
+ expectedStatus?: 'success' | 'fail'
197
+ findings?: Finding[]
198
+ involvedAssets?: Asset[]
199
+ balanceChanges?: Record<string, BalanceChange[]> | null
200
+ parsedActions?: Record<string, unknown[]>
201
+ blockNumber?: number
202
+ riIds?: string[]
203
+ }
204
+
205
+ export interface Finding {
206
+ typeId: string
207
+ title: string
208
+ description: string
209
+ details?: string
210
+ severity: 'Accept' | 'Notes' | 'Warn' | 'Deny' | 'AutoAccept'
211
+ relatedAssets?: Asset[]
212
+ }
213
+
214
+ export interface Asset {
215
+ chain: string
216
+ evmChainId?: string
217
+ address: string
218
+ type: 'Wallet' | 'Contract'
219
+ involvementTypes: string[]
220
+ tag: string
221
+ alias?: string
222
+ note?: string
223
+ }
224
+
225
+ export interface BalanceChange {
226
+ changeType: 'send' | 'receive'
227
+ tokenSymbol: string
228
+ tokenAddress?: string
229
+ usdValue?: string
230
+ amount: string
231
+ chain: string
232
+ evmChainId?: string
233
+ }
234
+
235
+ export interface ScanNftRequestItem {
236
+ address: string
237
+ chain?: string
238
+ evmChainId?: number | string
239
+ }
240
+
241
+ export interface ScanNftResponseItem {
242
+ address: string
243
+ chain: string
244
+ evmChainId: string
245
+ accept: boolean
246
+ }
247
+
248
+ export interface ScanTokenRequestItem {
249
+ address: string
250
+ chain?: string
251
+ evmChainId?: number | string
252
+ }
253
+
254
+ export interface ScanTokenResponseItem {
255
+ address: string
256
+ chain: string
257
+ reputation?: {
258
+ recommendation: 'accept' | 'deny'
259
+ }
260
+ }
261
+
262
+ export interface TransactionObject {
263
+ chain: string
264
+ fromAddress: string
265
+ toAddress: string
266
+ input?: string
267
+ value?: string | number
268
+ nonce?: string | number
269
+ hash?: string
270
+ gas?: string | number
271
+ gasPrice?: string | number
272
+ maxPriorityFeePerGas?: string | number
273
+ maxFeePerGas?: string | number
274
+ }
275
+
276
+ export interface Eip712TypeProperty {
277
+ name: string
278
+ type: string
279
+ }
280
+
281
+ export type Eip712Value =
282
+ | string
283
+ | number
284
+ | boolean
285
+ | null
286
+ | undefined
287
+ | Eip712Value[]
288
+ | { [key: string]: Eip712Value }
289
+
290
+ export interface Eip712Domain {
291
+ name?: string
292
+ version?: string
293
+ chainId?: number | string
294
+ verifyingContract?: string
295
+ salt?: string
296
+ [key: string]: Eip712Value
297
+ }
298
+
299
+ export interface Eip712TypedData {
300
+ primaryType: string
301
+ types: Record<string, Eip712TypeProperty[]>
302
+ domain: Eip712Domain
303
+ message: Record<string, Eip712Value>
304
+ }
305
+
306
+ export interface SolanaHeader {
307
+ numRequiredSignatures?: number
308
+ numReadonlySignedAccounts?: number
309
+ numReadonlyUnsignedAccounts?: number
310
+ }
311
+
312
+ export interface SolanaInstruction {
313
+ accounts: number[]
314
+ data: string
315
+ programIdIndex: number
316
+ }
317
+
318
+ export interface AddressTableLookup {
319
+ accountKey: string
320
+ writableIndexes: number[]
321
+ readonlyIndexes: number[]
322
+ }
323
+
324
+ export interface SolanaMessage {
325
+ accountKeys: string[]
326
+ header: SolanaHeader
327
+ instructions: SolanaInstruction[]
328
+ addressTableLookups?: AddressTableLookup[]
329
+ recentBlockhash: string
330
+ }
331
+
332
+ export interface SolanaTransaction {
333
+ message?: SolanaMessage
334
+ signatures?: string[]
335
+ rawTransaction?: string
336
+ version?: 'legacy' | '0'
337
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shared types barrel export
3
+ *
4
+ * This module exports all shared types used by both browser and iframe packages
5
+ */
6
+
7
+ // Common types
8
+ export * from './common'
9
+
10
+ // API types
11
+ export * from './api'
12
+
13
+ // Third-party integration types
14
+ export * from './yieldxyz'
15
+ export * from './zero-x'
16
+ export * from './lifi'
17
+ export * from './hypernative'