@sudobility/mail_box_types 1.0.12 → 1.0.14

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.
@@ -14,72 +14,100 @@ exports.ReviewRejectType = exports.ApplicantType = exports.SumsubReviewAnswer =
14
14
  // Verification Levels
15
15
  // ============================================
16
16
  /**
17
- * Available KYC verification levels
17
+ * Available KYC verification levels.
18
+ *
19
+ * Each level builds on the previous one, requiring progressively more
20
+ * documentation and verification steps. The level determines which
21
+ * Sumsub workflow is initiated.
18
22
  */
19
23
  var KYCVerificationLevel;
20
24
  (function (KYCVerificationLevel) {
21
- /** Age and identity verification (18+) */
25
+ /** Age and identity verification (18+). Requires government-issued ID. */
22
26
  KYCVerificationLevel["Basic"] = "basic";
23
- /** Basic + country verification + AML screening */
27
+ /** Basic + country verification + AML screening. Adds proof of address. */
24
28
  KYCVerificationLevel["Enhanced"] = "enhanced";
25
- /** Enhanced + financial verification for accredited investors */
29
+ /** Enhanced + financial verification for accredited investors. Adds income/asset proof. */
26
30
  KYCVerificationLevel["Accredited"] = "accredited";
27
31
  })(KYCVerificationLevel || (exports.KYCVerificationLevel = KYCVerificationLevel = {}));
28
32
  /**
29
- * Status of a KYC application throughout its lifecycle
33
+ * Status of a KYC application throughout its lifecycle.
34
+ *
35
+ * Applications progress linearly from Pending through to Completed or
36
+ * Rejected. The status is updated by both user actions (submitting
37
+ * documents) and Sumsub webhooks (review results).
30
38
  */
31
39
  var KYCApplicationStatus;
32
40
  (function (KYCApplicationStatus) {
33
- /** User created application but hasn't started */
41
+ /** User created application but hasn't started the Sumsub flow. */
34
42
  KYCApplicationStatus["Pending"] = "PENDING";
35
- /** Sumsub applicant created */
43
+ /** Sumsub applicant has been created and access token generated. */
36
44
  KYCApplicationStatus["Initiated"] = "INITIATED";
37
- /** User is uploading documents */
45
+ /** User is actively uploading documents in the Sumsub SDK. */
38
46
  KYCApplicationStatus["InProgress"] = "IN_PROGRESS";
39
- /** User submitted for review */
47
+ /** User has submitted all documents and is awaiting review. */
40
48
  KYCApplicationStatus["Submitted"] = "SUBMITTED";
41
- /** Verification completed (any result) */
49
+ /** Verification completed with a result (GREEN, RED, or YELLOW). */
42
50
  KYCApplicationStatus["Completed"] = "COMPLETED";
43
- /** Final rejection after max retries */
51
+ /** Final rejection after maximum retry attempts exhausted. */
44
52
  KYCApplicationStatus["Rejected"] = "REJECTED";
45
53
  })(KYCApplicationStatus || (exports.KYCApplicationStatus = KYCApplicationStatus = {}));
46
54
  /**
47
- * Sumsub review status values
55
+ * Sumsub review status values.
56
+ *
57
+ * These map directly to Sumsub's internal review status field
58
+ * returned in webhook payloads and status queries.
48
59
  */
49
60
  var SumsubReviewStatus;
50
61
  (function (SumsubReviewStatus) {
62
+ /** Review has been initialized but not yet started. */
51
63
  SumsubReviewStatus["Init"] = "init";
64
+ /** Review is pending, awaiting moderator action. */
52
65
  SumsubReviewStatus["Pending"] = "pending";
66
+ /** Automated prechecks have been completed. */
53
67
  SumsubReviewStatus["Prechecked"] = "prechecked";
68
+ /** Review is fully completed with a final answer. */
54
69
  SumsubReviewStatus["Completed"] = "completed";
55
70
  })(SumsubReviewStatus || (exports.SumsubReviewStatus = SumsubReviewStatus = {}));
56
71
  /**
57
- * Sumsub review answer (verification result)
72
+ * Sumsub review answer (verification result).
73
+ *
74
+ * The final outcome of a Sumsub review. GREEN means approved, RED means
75
+ * rejected, and YELLOW means manual review is needed.
58
76
  */
59
77
  var SumsubReviewAnswer;
60
78
  (function (SumsubReviewAnswer) {
79
+ /** Verification approved. All checks passed. */
61
80
  SumsubReviewAnswer["Green"] = "GREEN";
81
+ /** Verification rejected. One or more checks failed. */
62
82
  SumsubReviewAnswer["Red"] = "RED";
83
+ /** Needs manual review. Automated checks were inconclusive. */
63
84
  SumsubReviewAnswer["Yellow"] = "YELLOW";
64
85
  })(SumsubReviewAnswer || (exports.SumsubReviewAnswer = SumsubReviewAnswer = {}));
65
86
  /**
66
- * Applicant type for Sumsub verification
87
+ * Applicant type for Sumsub verification.
88
+ *
89
+ * Determines which Sumsub workflow and document requirements apply.
67
90
  */
68
91
  var ApplicantType;
69
92
  (function (ApplicantType) {
93
+ /** Individual person verification. Requires personal ID documents. */
70
94
  ApplicantType["Individual"] = "individual";
95
+ /** Company/organization verification. Requires corporate documents. */
71
96
  ApplicantType["Company"] = "company";
72
97
  })(ApplicantType || (exports.ApplicantType = ApplicantType = {}));
73
98
  /**
74
- * Review rejection type from Sumsub
99
+ * Review rejection type from Sumsub.
100
+ *
101
+ * When a review results in RED, this type indicates whether the user
102
+ * can retry or if the rejection is permanent.
75
103
  */
76
104
  var ReviewRejectType;
77
105
  (function (ReviewRejectType) {
78
- /** Final rejection, no more retries allowed */
106
+ /** Final rejection, no more retries allowed. Application is permanently denied. */
79
107
  ReviewRejectType["Final"] = "FINAL";
80
- /** User can retry the verification */
108
+ /** User can retry the verification with corrected documents. */
81
109
  ReviewRejectType["Retry"] = "RETRY";
82
- /** External review needed */
110
+ /** External review needed. Escalated to compliance team. */
83
111
  ReviewRejectType["External"] = "EXTERNAL";
84
112
  })(ReviewRejectType || (exports.ReviewRejectType = ReviewRejectType = {}));
85
113
  //# sourceMappingURL=kyc-types.js.map
@@ -9,197 +9,328 @@
9
9
  */
10
10
  import type { ChainType } from '@sudobility/types';
11
11
  /**
12
- * Available KYC verification levels
12
+ * Available KYC verification levels.
13
+ *
14
+ * Each level builds on the previous one, requiring progressively more
15
+ * documentation and verification steps. The level determines which
16
+ * Sumsub workflow is initiated.
13
17
  */
14
18
  export declare enum KYCVerificationLevel {
15
- /** Age and identity verification (18+) */
19
+ /** Age and identity verification (18+). Requires government-issued ID. */
16
20
  Basic = "basic",
17
- /** Basic + country verification + AML screening */
21
+ /** Basic + country verification + AML screening. Adds proof of address. */
18
22
  Enhanced = "enhanced",
19
- /** Enhanced + financial verification for accredited investors */
23
+ /** Enhanced + financial verification for accredited investors. Adds income/asset proof. */
20
24
  Accredited = "accredited"
21
25
  }
22
26
  /**
23
- * Status of a KYC application throughout its lifecycle
27
+ * Status of a KYC application throughout its lifecycle.
28
+ *
29
+ * Applications progress linearly from Pending through to Completed or
30
+ * Rejected. The status is updated by both user actions (submitting
31
+ * documents) and Sumsub webhooks (review results).
24
32
  */
25
33
  export declare enum KYCApplicationStatus {
26
- /** User created application but hasn't started */
34
+ /** User created application but hasn't started the Sumsub flow. */
27
35
  Pending = "PENDING",
28
- /** Sumsub applicant created */
36
+ /** Sumsub applicant has been created and access token generated. */
29
37
  Initiated = "INITIATED",
30
- /** User is uploading documents */
38
+ /** User is actively uploading documents in the Sumsub SDK. */
31
39
  InProgress = "IN_PROGRESS",
32
- /** User submitted for review */
40
+ /** User has submitted all documents and is awaiting review. */
33
41
  Submitted = "SUBMITTED",
34
- /** Verification completed (any result) */
42
+ /** Verification completed with a result (GREEN, RED, or YELLOW). */
35
43
  Completed = "COMPLETED",
36
- /** Final rejection after max retries */
44
+ /** Final rejection after maximum retry attempts exhausted. */
37
45
  Rejected = "REJECTED"
38
46
  }
39
47
  /**
40
- * Sumsub review status values
48
+ * Sumsub review status values.
49
+ *
50
+ * These map directly to Sumsub's internal review status field
51
+ * returned in webhook payloads and status queries.
41
52
  */
42
53
  export declare enum SumsubReviewStatus {
54
+ /** Review has been initialized but not yet started. */
43
55
  Init = "init",
56
+ /** Review is pending, awaiting moderator action. */
44
57
  Pending = "pending",
58
+ /** Automated prechecks have been completed. */
45
59
  Prechecked = "prechecked",
60
+ /** Review is fully completed with a final answer. */
46
61
  Completed = "completed"
47
62
  }
48
63
  /**
49
- * Sumsub review answer (verification result)
64
+ * Sumsub review answer (verification result).
65
+ *
66
+ * The final outcome of a Sumsub review. GREEN means approved, RED means
67
+ * rejected, and YELLOW means manual review is needed.
50
68
  */
51
69
  export declare enum SumsubReviewAnswer {
70
+ /** Verification approved. All checks passed. */
52
71
  Green = "GREEN",
72
+ /** Verification rejected. One or more checks failed. */
53
73
  Red = "RED",
74
+ /** Needs manual review. Automated checks were inconclusive. */
54
75
  Yellow = "YELLOW"
55
76
  }
56
77
  /**
57
- * Applicant type for Sumsub verification
78
+ * Applicant type for Sumsub verification.
79
+ *
80
+ * Determines which Sumsub workflow and document requirements apply.
58
81
  */
59
82
  export declare enum ApplicantType {
83
+ /** Individual person verification. Requires personal ID documents. */
60
84
  Individual = "individual",
85
+ /** Company/organization verification. Requires corporate documents. */
61
86
  Company = "company"
62
87
  }
63
88
  /**
64
- * Review rejection type from Sumsub
89
+ * Review rejection type from Sumsub.
90
+ *
91
+ * When a review results in RED, this type indicates whether the user
92
+ * can retry or if the rejection is permanent.
65
93
  */
66
94
  export declare enum ReviewRejectType {
67
- /** Final rejection, no more retries allowed */
95
+ /** Final rejection, no more retries allowed. Application is permanently denied. */
68
96
  Final = "FINAL",
69
- /** User can retry the verification */
97
+ /** User can retry the verification with corrected documents. */
70
98
  Retry = "RETRY",
71
- /** External review needed */
99
+ /** External review needed. Escalated to compliance team. */
72
100
  External = "EXTERNAL"
73
101
  }
74
102
  /**
75
- * KYC Application record
76
- * Main table tracking user's KYC verification applications
103
+ * KYC Application record.
104
+ *
105
+ * Main database model tracking a user's KYC verification application.
106
+ * Each wallet address can have one application per verification level.
107
+ * The application links to the Sumsub applicant via `sumsubApplicantId`.
77
108
  */
78
109
  export interface KYCApplication {
110
+ /** Unique application identifier (UUID) */
79
111
  id: string;
112
+ /** User's blockchain wallet address (EVM 0x format or Solana Base58) */
80
113
  walletAddress: string;
114
+ /** User's email address for notifications */
81
115
  email: string;
116
+ /** Blockchain type the wallet belongs to */
82
117
  chainType: ChainType;
118
+ /** Sumsub applicant ID, null if not yet created */
83
119
  sumsubApplicantId: string | null;
120
+ /** Arbitrary metadata attached to the application */
84
121
  metadata: Record<string, unknown>;
122
+ /** Target verification level for this application */
85
123
  verificationLevel: KYCVerificationLevel;
124
+ /** Current status in the application lifecycle */
86
125
  status: KYCApplicationStatus;
126
+ /** Number of retry attempts made after rejection */
87
127
  retryCount: number;
128
+ /** Timestamp when the application was created */
88
129
  createdAt: Date;
130
+ /** Timestamp when the application was last updated */
89
131
  updatedAt: Date;
90
132
  }
91
133
  /**
92
- * Verification Result record
93
- * Stores the outcome of verification for each level
134
+ * Verification Result record.
135
+ *
136
+ * Stores the outcome of a Sumsub review for a specific verification level.
137
+ * One KYC application can have multiple verification results (one per level).
138
+ * Results include identity, country, and accreditation details.
94
139
  */
95
140
  export interface VerificationResult {
141
+ /** Unique result identifier (UUID) */
96
142
  id: string;
143
+ /** Foreign key to the parent KYC application */
97
144
  kycApplicationId: string;
145
+ /** Verification level this result applies to */
98
146
  verificationLevel: KYCVerificationLevel;
147
+ /** Sumsub review answer (GREEN/RED/YELLOW) */
99
148
  status: SumsubReviewAnswer;
149
+ /** Sumsub review processing status */
100
150
  reviewStatus: SumsubReviewStatus;
151
+ /** ISO 3166-1 alpha-2 country code, null if not determined */
101
152
  countryCode: string | null;
153
+ /** Whether the user's age has been verified as 18+ */
102
154
  ageVerified: boolean;
155
+ /** Whether the user qualifies as an accredited investor */
103
156
  accreditedInvestor: boolean;
157
+ /** Date when verification was completed, null if pending */
104
158
  verificationDate: Date | null;
159
+ /** Expiry date for the verification subscription (12 months from verification) */
105
160
  subscriptionExpiresAt: Date | null;
161
+ /** Sumsub review ID for audit trail */
106
162
  sumsubReviewId: string | null;
163
+ /** Sumsub inspection ID for audit trail */
107
164
  sumsubInspectionId: string | null;
165
+ /** Additional metadata from the verification process */
108
166
  metadata: Record<string, unknown>;
167
+ /** Timestamp when the result record was created */
109
168
  createdAt: Date;
169
+ /** Timestamp when the result record was last updated */
110
170
  updatedAt: Date;
111
171
  }
112
172
  /**
113
- * User Consent record
114
- * Tracks user consent for third-party DApp access
173
+ * User Consent record.
174
+ *
175
+ * Tracks user consent granted to third-party DApps for accessing
176
+ * KYC verification data. Consent is cryptographically signed by the
177
+ * user's wallet and can be revoked at any time.
115
178
  */
116
179
  export interface UserConsent {
180
+ /** Unique consent identifier (UUID) */
117
181
  id: string;
182
+ /** Wallet address of the user granting consent */
118
183
  walletAddress: string;
184
+ /** Identifier for the DApp receiving consent (domain or app name) */
119
185
  dappIdentifier: string;
186
+ /** The consent message that was presented to the user */
120
187
  signedMessage: string;
188
+ /** Wallet signature of the consent message */
121
189
  signature: string;
190
+ /** Scope of data the DApp is allowed to access */
122
191
  consentScope: {
192
+ /** Verification levels the DApp can query */
123
193
  levels: KYCVerificationLevel[];
194
+ /** Specific data fields the DApp can access */
124
195
  fields: string[];
125
196
  };
197
+ /** Timestamp when consent was granted */
126
198
  grantedAt: Date;
199
+ /** Timestamp when consent expires, null for indefinite */
127
200
  expiresAt: Date | null;
201
+ /** Whether the consent has been revoked */
128
202
  revoked: boolean;
203
+ /** Timestamp when consent was revoked, null if still active */
129
204
  revokedAt: Date | null;
130
205
  }
131
206
  /**
132
- * Sumsub configuration
207
+ * Sumsub SDK and API configuration.
208
+ *
209
+ * Required credentials and endpoints for communicating with the
210
+ * Sumsub identity verification platform.
133
211
  */
134
212
  export interface SumsubConfig {
213
+ /** Sumsub application token for API authentication */
135
214
  appToken: string;
215
+ /** Sumsub secret key for request signing */
136
216
  secretKey: string;
217
+ /** Sumsub API base URL (e.g., "https://api.sumsub.com") */
137
218
  baseUrl: string;
219
+ /** Secret key for verifying Sumsub webhook signatures */
138
220
  webhookSecret: string;
139
221
  }
140
222
  /**
141
- * Data required to create a Sumsub applicant
223
+ * Data required to create a Sumsub applicant.
224
+ *
225
+ * Sent to Sumsub when initiating a new verification flow.
226
+ * The externalUserId links the Sumsub applicant back to the wallet.
142
227
  */
143
228
  export interface SumsubApplicantData {
229
+ /** External user ID, typically the wallet address */
144
230
  externalUserId: string;
231
+ /** User's email address for Sumsub notifications */
145
232
  email: string;
233
+ /** Whether this is an individual or company applicant */
146
234
  type: ApplicantType;
235
+ /** Pre-populated applicant information */
147
236
  fixedInfo?: {
237
+ /** ISO 3166-1 alpha-2 country code */
148
238
  country?: string;
149
239
  };
150
240
  }
151
241
  /**
152
- * Sumsub webhook payload structure
242
+ * Sumsub webhook payload structure.
243
+ *
244
+ * Received from Sumsub when a review status changes. This payload
245
+ * is signed with the webhook secret and must be verified before processing.
153
246
  */
154
247
  export interface SumsubWebhookPayload {
248
+ /** Sumsub applicant identifier */
155
249
  applicantId: string;
250
+ /** Sumsub inspection identifier for this review */
156
251
  inspectionId: string;
252
+ /** Type of applicant (individual or company) */
157
253
  applicantType: ApplicantType;
254
+ /** Unique correlation ID for tracking this webhook event */
158
255
  correlationId: string;
256
+ /** External user ID (wallet address) */
159
257
  externalUserId: string;
258
+ /** Name of the Sumsub verification level/workflow */
160
259
  levelName: string;
260
+ /** Whether this event originated from sandbox/test mode */
161
261
  sandboxMode: boolean;
262
+ /** Current review status */
162
263
  reviewStatus: SumsubReviewStatus;
264
+ /** Detailed review result with moderation details */
163
265
  reviewResult: {
266
+ /** Internal moderator comment (not shown to user) */
164
267
  moderationComment: string;
268
+ /** Comment visible to the client/user */
165
269
  clientComment: string;
270
+ /** Final review answer (GREEN/RED/YELLOW) */
166
271
  reviewAnswer: SumsubReviewAnswer;
272
+ /** Labels describing rejection reasons */
167
273
  rejectLabels: string[];
274
+ /** Type of rejection (FINAL/RETRY/EXTERNAL) */
168
275
  reviewRejectType: ReviewRejectType;
169
276
  };
277
+ /** Timestamp when the event was created (milliseconds, as string) */
170
278
  createdAtMs: string;
279
+ /** Sumsub client identifier */
171
280
  clientId: string;
172
281
  }
173
282
  /**
174
- * Sumsub applicant status response
283
+ * Sumsub applicant status response.
284
+ *
285
+ * Returned when querying an applicant's current verification status
286
+ * from the Sumsub API. Includes review results and extracted document info.
175
287
  */
176
288
  export interface SumsubApplicantStatus {
289
+ /** Sumsub applicant identifier */
177
290
  applicantId: string;
291
+ /** Current review processing status */
178
292
  reviewStatus: SumsubReviewStatus;
293
+ /** Review result, present only after review is completed */
179
294
  reviewResult?: {
295
+ /** Final review answer (GREEN/RED/YELLOW) */
180
296
  reviewAnswer: SumsubReviewAnswer;
297
+ /** Labels describing rejection reasons */
181
298
  rejectLabels: string[];
182
299
  };
300
+ /** Extracted applicant information from submitted documents */
183
301
  info?: {
302
+ /** Identity documents with extracted fields */
184
303
  idDocs?: Array<{
304
+ /** ISO 3166-1 alpha-2 country code from the document */
185
305
  country?: string;
306
+ /** Extracted fields from the identity document */
186
307
  fields?: {
308
+ /** Date of birth (YYYY-MM-DD format) */
187
309
  dob?: string;
310
+ /** First/given name */
188
311
  firstName?: string;
312
+ /** Last/family name */
189
313
  lastName?: string;
190
314
  };
191
315
  }>;
316
+ /** Address documents with country information */
192
317
  addresses?: Array<{
318
+ /** ISO 3166-1 alpha-2 country code from address proof */
193
319
  country?: string;
194
320
  }>;
321
+ /** Questionnaire responses for accredited investor verification */
195
322
  questionnaires?: Array<{
323
+ /** Questionnaire sections with financial data */
196
324
  sections?: {
325
+ /** Income information */
197
326
  income?: {
198
327
  annualIncome?: string;
199
328
  };
329
+ /** Wealth information */
200
330
  wealth?: {
201
331
  netWorth?: string;
202
332
  };
333
+ /** Professional credentials */
203
334
  professional?: {
204
335
  designation?: string;
205
336
  };
@@ -208,98 +339,174 @@ export interface SumsubApplicantStatus {
208
339
  };
209
340
  }
210
341
  /**
211
- * Request to initiate KYC verification
342
+ * Request to initiate KYC verification.
343
+ *
344
+ * Sent by the client to start a new KYC verification flow. Creates a
345
+ * Sumsub applicant and returns an access token for the Sumsub Web SDK.
212
346
  */
213
347
  export interface InitiateKYCRequest {
348
+ /** User's blockchain wallet address */
214
349
  walletAddress: string;
350
+ /** Blockchain type the wallet belongs to */
215
351
  chainType: ChainType;
352
+ /** Target verification level to achieve */
216
353
  verificationLevel: KYCVerificationLevel;
217
354
  }
218
355
  /**
219
- * Response from initiating KYC verification
356
+ * Response from initiating KYC verification.
357
+ *
358
+ * Contains the Sumsub access token needed to embed the Sumsub Web SDK
359
+ * in the client application for document upload and verification.
220
360
  */
221
361
  export interface InitiateKYCResponse {
362
+ /** Unique application identifier for tracking */
222
363
  applicationId: string;
364
+ /** Sumsub access token for embedding the Web SDK */
223
365
  sumsubAccessToken: string;
366
+ /** Initial application status (typically INITIATED) */
224
367
  status: KYCApplicationStatus;
368
+ /** Verification level being processed */
225
369
  verificationLevel: KYCVerificationLevel;
226
370
  }
227
371
  /**
228
- * Response from getting KYC status
372
+ * Response from getting KYC status.
373
+ *
374
+ * Provides a comprehensive view of a user's KYC verification progress
375
+ * across all levels, including retry information.
229
376
  */
230
377
  export interface GetKYCStatusResponse {
378
+ /** Unique application identifier */
231
379
  applicationId: string;
380
+ /** User's wallet address */
232
381
  walletAddress: string;
382
+ /** Current target verification level */
233
383
  verificationLevel: KYCVerificationLevel;
384
+ /** Current application status */
234
385
  status: KYCApplicationStatus;
386
+ /** Verification results for each level (absent if not attempted) */
235
387
  results: {
388
+ /** Basic level verification status */
236
389
  basic?: VerificationLevelStatus;
390
+ /** Enhanced level verification status */
237
391
  enhanced?: VerificationLevelStatus;
392
+ /** Accredited level verification status */
238
393
  accredited?: VerificationLevelStatus;
239
394
  };
395
+ /** Whether the user can retry after a rejection */
240
396
  canRetry: boolean;
397
+ /** Number of retry attempts remaining */
241
398
  retriesRemaining: number;
242
399
  }
243
400
  /**
244
- * Status for a specific verification level
401
+ * Status for a specific verification level.
402
+ *
403
+ * Represents the outcome of verification for a single level (basic,
404
+ * enhanced, or accredited). Included in GetKYCStatusResponse.
245
405
  */
246
406
  export interface VerificationLevelStatus {
407
+ /** Whether this level has been successfully verified */
247
408
  verified: boolean;
409
+ /** Sumsub review answer for this level */
248
410
  status: SumsubReviewAnswer;
411
+ /** Whether age has been verified as 18+ (basic level) */
249
412
  ageVerified?: boolean;
413
+ /** Whether the user's country is in the allowed list (enhanced level) */
250
414
  countryAllowed?: boolean;
415
+ /** ISO 3166-1 alpha-2 country code determined during verification */
251
416
  countryCode?: string;
417
+ /** Whether the user qualifies as an accredited investor (accredited level) */
252
418
  accreditedInvestor?: boolean;
419
+ /** Timestamp when this level was verified */
253
420
  verifiedAt?: Date;
421
+ /** Expiry date for the verification (12 months from verification) */
254
422
  subscriptionExpiresAt?: Date;
255
423
  }
256
424
  /**
257
- * Request from third-party DApp to verify a user
425
+ * Request from third-party DApp to verify a user.
426
+ *
427
+ * DApps send this request with a user-signed consent message to check
428
+ * whether a wallet has passed a specific KYC verification level.
258
429
  */
259
430
  export interface VerifyUserRequest {
431
+ /** Wallet address of the user to verify */
260
432
  walletAddress: string;
433
+ /** User's wallet signature approving DApp access to KYC data */
261
434
  signedConsent: string;
435
+ /** Original consent message that was signed */
262
436
  consentMessage: string;
437
+ /** DApp identifier (domain name or app name) */
263
438
  dappIdentifier: string;
439
+ /** Minimum KYC verification level required by the DApp */
264
440
  requestedLevel: KYCVerificationLevel;
265
441
  }
266
442
  /**
267
- * Response to third-party DApp verification request
443
+ * Response to third-party DApp verification request.
444
+ *
445
+ * Returns the verification status and details for the requested level.
446
+ * Only returns data that the user has consented to share.
268
447
  */
269
448
  export interface VerifyUserResponse {
449
+ /** Whether the user meets the requested verification level */
270
450
  verified: boolean;
451
+ /** Highest verified KYC level for this user */
271
452
  level: KYCVerificationLevel;
453
+ /** Whether the user's age has been verified as 18+ */
272
454
  ageVerified: boolean;
455
+ /** Whether the user's country is in the allowed list */
273
456
  countryAllowed: boolean;
457
+ /** Whether the user qualifies as an accredited investor */
274
458
  accreditedInvestor: boolean;
459
+ /** Timestamp when verification was completed */
275
460
  verifiedAt: Date;
461
+ /** Expiry date for the verification subscription */
276
462
  subscriptionExpiresAt: Date;
277
463
  }
278
464
  /**
279
- * Request to revoke consent for a DApp
465
+ * Request to revoke consent for a DApp.
466
+ *
467
+ * Users can revoke previously granted consent at any time.
468
+ * Requires a wallet signature to prove ownership.
280
469
  */
281
470
  export interface RevokeConsentRequest {
471
+ /** Wallet address of the user revoking consent */
282
472
  walletAddress: string;
473
+ /** DApp identifier whose consent is being revoked */
283
474
  dappIdentifier: string;
475
+ /** Wallet signature proving ownership of the wallet address */
284
476
  signature: string;
285
477
  }
286
478
  /**
287
- * Response to consent revocation
479
+ * Response to consent revocation.
480
+ *
481
+ * Confirms that the consent has been successfully revoked and
482
+ * the DApp can no longer access the user's KYC data.
288
483
  */
289
484
  export interface RevokeConsentResponse {
485
+ /** Whether the revocation was successful */
290
486
  success: boolean;
487
+ /** Timestamp when the consent was revoked */
291
488
  revokedAt: Date;
292
489
  }
293
490
  /**
294
- * Get user's granted consents
491
+ * Get user's granted consents.
492
+ *
493
+ * Returns all active consents that a user has granted to third-party
494
+ * DApps, including the scope of data each DApp can access.
295
495
  */
296
496
  export interface GetConsentsResponse {
497
+ /** List of active consent grants */
297
498
  consents: Array<{
499
+ /** DApp identifier that received consent */
298
500
  dappIdentifier: string;
501
+ /** Timestamp when consent was granted */
299
502
  grantedAt: Date;
503
+ /** Timestamp when consent expires, null for indefinite */
300
504
  expiresAt: Date | null;
505
+ /** Scope of data the DApp can access */
301
506
  scope: {
507
+ /** Verification levels the DApp can query */
302
508
  levels: KYCVerificationLevel[];
509
+ /** Specific data fields the DApp can access */
303
510
  fields: string[];
304
511
  };
305
512
  }>;