@keyringnetwork/keyring-connect-sdk 1.0.7 → 1.0.8

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,615 @@
1
+ [
2
+ {
3
+ "id": "tlsn-binance",
4
+ "image": "https://main.cdn.krnprod.net/logos/binance.png",
5
+ "label": "binance",
6
+ "link": "https://www.binance.com",
7
+ "login_url": "https://accounts.binance.com/login",
8
+ "name": "Binance",
9
+ "proof_sources": [
10
+ {
11
+ "claims": [
12
+ {
13
+ "entity_type": "individual",
14
+ "id": "109d3384-e2af-4e13-aefe-018aff23e575",
15
+ "label": "KYC Level >= INTERMEDIATE",
16
+ "rule_id": "0x9585e5e99c1d0998cf51549ee4fcb0bb91fcecedcc53d84ef5ef25e6807055ca"
17
+ },
18
+ {
19
+ "entity_type": "individual",
20
+ "id": "782f0aac-2655-4b07-8ec7-1f2215fcf996",
21
+ "label": "User POA Country not on FATF",
22
+ "rule_id": "0xfc2234a1fbb0317498957fd4235d31316f0ff2359ed18f4b3f09f86dda3ed189"
23
+ },
24
+ {
25
+ "entity_type": "individual",
26
+ "id": "782f0aac-2655-4b07-8ec7-1f2215fcf997",
27
+ "label": "User Account Type",
28
+ "rule_id": "0xf1c8b5068f39f13c7bbf5128563be0d7277bb5712e2cada98c8d275170d4c105"
29
+ }
30
+ ],
31
+ "endpoint": {
32
+ "body": null,
33
+ "data_bounds": null,
34
+ "disclosable_fields": [
35
+ {
36
+ "label": "first name",
37
+ "path": "data.fillInfo.firstName"
38
+ },
39
+ {
40
+ "label": "last name",
41
+ "path": "data.fillInfo.lastName"
42
+ },
43
+ {
44
+ "label": "dob",
45
+ "path": "data.fillInfo.dob"
46
+ },
47
+ {
48
+ "label": "kyc level",
49
+ "path": "data.passKycLevel"
50
+ },
51
+ {
52
+ "label": "country of primary address",
53
+ "path": "data.fillInfo.residenceCountry"
54
+ },
55
+ {
56
+ "label": "account type",
57
+ "path": "data.type"
58
+ }
59
+ ],
60
+ "headers": [
61
+ "clienttype",
62
+ "csrftoken",
63
+ "cookie",
64
+ "user-agent"
65
+ ],
66
+ "method": "POST",
67
+ "required_cookies": [
68
+ "p20t"
69
+ ],
70
+ "url": "https://www.binance.com/bapi/kyc/v2/private/certificate/user-kyc/current-kyc-status"
71
+ },
72
+ "id": "tlsn-binance-kyc",
73
+ "label": "KYC from Binance"
74
+ },
75
+ {
76
+ "claims": [
77
+ {
78
+ "entity_type": "business",
79
+ "id": "782f0aac-2655-4b07-8ec7-1f2215fcf998",
80
+ "label": "KYB Verified",
81
+ "rule_id": "0xdf536a0462f3a9d7a67f2f1f1885ea6caa8d146dd247cc22590adb2b63932fc5"
82
+ },
83
+ {
84
+ "entity_type": "business",
85
+ "id": "782f0aac-2655-4b07-8ec7-1f2215fcf999",
86
+ "label": "Business POA Country not on FATF",
87
+ "rule_id": "0xb756ee391611a6e9303e673ee3d65cae1f7a308b3be131d99b2f131a3497a936"
88
+ },
89
+ {
90
+ "entity_type": "business",
91
+ "id": "782f0aac-2655-4b07-8ec7-1f2215fd0000",
92
+ "label": "Business Account Type",
93
+ "rule_id": "0xd9f75a927c9af7fdbedd3925ed32611d87900c41822faad7ecf9665e179c63db"
94
+ }
95
+ ],
96
+ "endpoint": {
97
+ "body": null,
98
+ "data_bounds": null,
99
+ "disclosable_fields": [
100
+ {
101
+ "label": "kyb status",
102
+ "path": "data.kycStatus"
103
+ },
104
+ {
105
+ "label": "company name",
106
+ "path": "data.fillInfo.companyName"
107
+ },
108
+ {
109
+ "label": "country of primary address",
110
+ "path": "data.fillInfo.residenceCountry"
111
+ },
112
+ {
113
+ "label": "kyb message detail",
114
+ "path": "data.frontDisplayLevelMsg"
115
+ },
116
+ {
117
+ "label": "account type",
118
+ "path": "data.type"
119
+ }
120
+ ],
121
+ "headers": [
122
+ "clienttype",
123
+ "csrftoken",
124
+ "cookie",
125
+ "user-agent"
126
+ ],
127
+ "method": "POST",
128
+ "required_cookies": [
129
+ "p20t"
130
+ ],
131
+ "url": "https://www.binance.com/bapi/kyc/v2/private/certificate/user-kyc/current-kyc-status"
132
+ },
133
+ "id": "tlsn-binance-kyb",
134
+ "label": "KYB from Binance"
135
+ }
136
+ ],
137
+ "target_url": null,
138
+ "user_actions": [
139
+ "Login",
140
+ "Navigate to your Dashboard",
141
+ "The verification process will start automatically"
142
+ ]
143
+ },
144
+ {
145
+ "id": "tlsn-kraken",
146
+ "image": "https://main.cdn.krnprod.net/logos/kraken.jpg",
147
+ "label": "Kraken",
148
+ "link": "https://www.kraken.com",
149
+ "login_url": "https://www.kraken.com/sign-in",
150
+ "name": "Kraken",
151
+ "proof_sources": [
152
+ {
153
+ "claims": [
154
+ {
155
+ "entity_type": "business",
156
+ "id": "241f4b43-8b4f-4760-ac7a-dbb929dd24cf",
157
+ "label": "KYB Tier 4 (Full KYB)",
158
+ "rule_id": "e475888c95ee4a6dbfcaeeab5895f389"
159
+ },
160
+ {
161
+ "entity_type": "business",
162
+ "id": "f9b064c0-b203-4b67-9632-5d6bf3c58940",
163
+ "label": "Business Country not on FATF",
164
+ "rule_id": "06058644a4474d4885349d66f2fe3b61"
165
+ },
166
+ {
167
+ "entity_type": "business",
168
+ "id": "34b778de-2ae1-43fe-afd2-d9d213be0d29",
169
+ "label": "Pro Business Account Type",
170
+ "rule_id": "a272c98c3d014098b250e16965204c9c"
171
+ },
172
+ {
173
+ "entity_type": "business",
174
+ "id": "41549275-a867-4c88-aff2-3c591d16c4cb",
175
+ "label": "Verified Address",
176
+ "rule_id": "a28fd396693d447aa6981c4b67f93bac"
177
+ }
178
+ ],
179
+ "endpoint": {
180
+ "body": null,
181
+ "data_bounds": {
182
+ "max_recv_data": 2500,
183
+ "max_sent_data": 800
184
+ },
185
+ "disclosable_fields": [
186
+ {
187
+ "label": "user kyc",
188
+ "path": "result.access.user_kyc"
189
+ },
190
+ {
191
+ "label": "first name",
192
+ "path": "result.first_name"
193
+ },
194
+ {
195
+ "label": "country",
196
+ "path": "result.country"
197
+ },
198
+ {
199
+ "label": "tier bucket",
200
+ "path": "result.tier_bucket"
201
+ },
202
+ {
203
+ "label": "tier verified",
204
+ "path": "result.tier_verified"
205
+ }
206
+ ],
207
+ "headers": [
208
+ "accept",
209
+ "accept-language",
210
+ "cookie",
211
+ "referer",
212
+ "user-agent"
213
+ ],
214
+ "method": "GET",
215
+ "required_cookies": [
216
+ "SESSID"
217
+ ],
218
+ "url": "https://iapi.kraken.com/api/internal/account/profile"
219
+ },
220
+ "id": "tlsn-kraken-kyb",
221
+ "label": "Profile information from Kraken"
222
+ },
223
+ {
224
+ "claims": [
225
+ {
226
+ "entity_type": "individual",
227
+ "id": "62d7d554-bf4f-4c27-9d20-0a42e10fd717",
228
+ "label": "KYB Tier 3+ (Verified ID)",
229
+ "rule_id": "f475888c95ee4a6dbfcaeeab5895f390"
230
+ },
231
+ {
232
+ "entity_type": "individual",
233
+ "id": "e3aadb6d-04a9-48be-acde-4ebdacfe14c0",
234
+ "label": "Country not on FATF",
235
+ "rule_id": "16058644a4474d4885349d66f2fe3b62"
236
+ },
237
+ {
238
+ "entity_type": "individual",
239
+ "id": "34079544-ea30-42e0-a4f2-9b43bba0a582",
240
+ "label": "Retail Account Type",
241
+ "rule_id": "c272c98c3d014098b250e16965204c9e"
242
+ }
243
+ ],
244
+ "endpoint": {
245
+ "body": null,
246
+ "data_bounds": {
247
+ "max_recv_data": 2500,
248
+ "max_sent_data": 800
249
+ },
250
+ "disclosable_fields": [
251
+ {
252
+ "label": "user kyc",
253
+ "path": "result.access.user_kyc"
254
+ },
255
+ {
256
+ "label": "first name",
257
+ "path": "result.first_name"
258
+ },
259
+ {
260
+ "label": "country",
261
+ "path": "result.country"
262
+ },
263
+ {
264
+ "label": "tier bucket",
265
+ "path": "result.tier_bucket"
266
+ },
267
+ {
268
+ "label": "tier verified",
269
+ "path": "result.tier_verified"
270
+ }
271
+ ],
272
+ "headers": [
273
+ "accept",
274
+ "accept-language",
275
+ "cookie",
276
+ "referer",
277
+ "user-agent"
278
+ ],
279
+ "method": "GET",
280
+ "required_cookies": [
281
+ "SESSID"
282
+ ],
283
+ "url": "https://iapi.kraken.com/api/internal/account/profile"
284
+ },
285
+ "id": "tlsn-kraken-kyc",
286
+ "label": "Profile information from Kraken"
287
+ }
288
+ ],
289
+ "target_url": null,
290
+ "user_actions": [
291
+ "Log in",
292
+ "Navigate to your Profile page",
293
+ "The verification process will start automatically"
294
+ ]
295
+ },
296
+ {
297
+ "id": "tlsn-binance-us",
298
+ "image": "https://main.cdn.krnprod.net/logos/binance-us.svg",
299
+ "label": "binance-us",
300
+ "link": "https://www.binance.us",
301
+ "login_url": "https://accounts.binance.us/login",
302
+ "name": "Binance US",
303
+ "proof_sources": [
304
+ {
305
+ "claims": [
306
+ {
307
+ "entity_type": "individual",
308
+ "id": "75eebf24-5dfe-4b3d-b651-f21fff1786c4",
309
+ "label": "KYC Verified",
310
+ "rule_id": "d6f67da1ee70413a98cdf36c273bf7d2"
311
+ },
312
+ {
313
+ "entity_type": "individual",
314
+ "id": "18e9f113-5110-4abb-b6e9-da07dcfeb41f",
315
+ "label": "User POA Country not on FATF",
316
+ "rule_id": "af82a3a40d4f4da3b4bbde107d6c2955"
317
+ },
318
+ {
319
+ "entity_type": "individual",
320
+ "id": "2a5d69a3-1ead-4be6-9112-760b6432c3d8",
321
+ "label": "Individual Account Type",
322
+ "rule_id": "6ee0a58a6caa43bb8f8a769339c50648"
323
+ }
324
+ ],
325
+ "endpoint": {
326
+ "body": null,
327
+ "data_bounds": {
328
+ "max_recv_data": 10000,
329
+ "max_sent_data": 1000
330
+ },
331
+ "disclosable_fields": [
332
+ {
333
+ "label": "country",
334
+ "path": "data.userDetails.country"
335
+ },
336
+ {
337
+ "label": "kyc level",
338
+ "path": "data.userKycStatus.kycLevel"
339
+ },
340
+ {
341
+ "label": "kyc type",
342
+ "path": "data.userKycStatus.kycType"
343
+ }
344
+ ],
345
+ "headers": [
346
+ "clienttype",
347
+ "cookie",
348
+ "user-agent",
349
+ "csrftoken"
350
+ ],
351
+ "method": "GET",
352
+ "required_cookies": [
353
+ "p20t"
354
+ ],
355
+ "url": "https://www.binance.us/gateway/entry/private/v1/web-home/user-details"
356
+ },
357
+ "id": "tlsn-binance-us-kyc",
358
+ "label": "KYC from Binance US"
359
+ },
360
+ {
361
+ "claims": [
362
+ {
363
+ "entity_type": "business",
364
+ "id": "26db829e-ded2-4046-9626-7a1867d5be06",
365
+ "label": "KYB Verified",
366
+ "rule_id": "991cbd81da01446b86bb0153d3c45243"
367
+ },
368
+ {
369
+ "entity_type": "business",
370
+ "id": "81d4d669-f626-4dfb-9966-c783d2f3dddb",
371
+ "label": "Business POA Country not on FATF",
372
+ "rule_id": "afe033c3a2ed4094bfedb43b99b35bc9"
373
+ },
374
+ {
375
+ "entity_type": "business",
376
+ "id": "a99d0cf5-ee75-4ddf-b3e2-aabb794450f2",
377
+ "label": "Business Account Type",
378
+ "rule_id": "8f7c1dfa4c7c48bca407817c0312c9f7"
379
+ }
380
+ ],
381
+ "endpoint": {
382
+ "body": null,
383
+ "data_bounds": {
384
+ "max_recv_data": 10000,
385
+ "max_sent_data": 1000
386
+ },
387
+ "disclosable_fields": [
388
+ {
389
+ "label": "country of primary address",
390
+ "path": "data.userDetails.country"
391
+ },
392
+ {
393
+ "label": "kyc level",
394
+ "path": "data.userKycStatus.kycLevel"
395
+ },
396
+ {
397
+ "label": "kyc type",
398
+ "path": "data.userKycStatus.kycType"
399
+ }
400
+ ],
401
+ "headers": [
402
+ "clienttype",
403
+ "cookie",
404
+ "user-agent",
405
+ "csrftoken"
406
+ ],
407
+ "method": "GET",
408
+ "required_cookies": [
409
+ "p20t"
410
+ ],
411
+ "url": "https://www.binance.us/gateway/entry/private/v1/web-home/user-details"
412
+ },
413
+ "id": "tlsn-binance-us-kyb",
414
+ "label": "KYB from Binance US"
415
+ }
416
+ ],
417
+ "target_url": null,
418
+ "user_actions": [
419
+ "Login",
420
+ "Navigate to your dashboard",
421
+ "The verification process will start automatically"
422
+ ]
423
+ },
424
+ {
425
+ "id": "tlsn-fidelity",
426
+ "image": "https://main.cdn.krnprod.net/logos/fidelity.jpg",
427
+ "label": "fidelity",
428
+ "link": "https://www.fidelity.com",
429
+ "login_url": "https://digital.fidelity.com/ftgw/digital/profile",
430
+ "name": "Fidelity",
431
+ "proof_sources": [
432
+ {
433
+ "claims": [],
434
+ "endpoint": {
435
+ "body": "{\"dpIdCache\":null}",
436
+ "data_bounds": {
437
+ "max_recv_data": 10000,
438
+ "max_sent_data": 5000
439
+ },
440
+ "disclosable_fields": [
441
+ {
442
+ "label": "full name",
443
+ "path": "customer.name"
444
+ },
445
+ {
446
+ "label": "mailing address",
447
+ "path": "customer.addresses.mailing"
448
+ }
449
+ ],
450
+ "headers": [
451
+ "Accept",
452
+ "Content-Type",
453
+ "X-xsrf-token",
454
+ "Cookie",
455
+ "User-Agent"
456
+ ],
457
+ "method": "POST",
458
+ "required_cookies": [
459
+ "ap126386_session",
460
+ "FC",
461
+ "MC",
462
+ "RC",
463
+ "SC",
464
+ "ATC"
465
+ ],
466
+ "url": "https://digital.fidelity.com/ftgw/digital/profile/api/personal/info"
467
+ },
468
+ "id": "tlsn-fidelity-profile",
469
+ "label": "Profile information from Fidelity"
470
+ }
471
+ ],
472
+ "target_url": null,
473
+ "user_actions": [
474
+ "Login",
475
+ "Navigate to your profile page",
476
+ "The verification process will start automatically"
477
+ ]
478
+ },
479
+ {
480
+ "id": "tlsn-coinbase",
481
+ "image": "https://main.cdn.krnprod.net/logos/coinbase.svg",
482
+ "label": "Coinbase",
483
+ "link": "https://www.coinbase.com",
484
+ "login_url": "https://login.coinbase.com/signin",
485
+ "name": "Coinbase",
486
+ "proof_sources": [
487
+ {
488
+ "claims": [
489
+ {
490
+ "entity_type": "individual",
491
+ "id": "9c276689-aa24-4e10-847c-6dd8097dabe0",
492
+ "label": "KYC Verified",
493
+ "rule_id": "ac0ced0317ac4543b9761c6c0f54dade"
494
+ },
495
+ {
496
+ "entity_type": "individual",
497
+ "id": "3bfbc9f3-edde-44b3-8aec-d514058cc0f3",
498
+ "label": "Coinbase Residence country is not on FATF BList",
499
+ "rule_id": "c1313e05ee4f488da18be760b24df34d"
500
+ }
501
+ ],
502
+ "endpoint": {
503
+ "body": null,
504
+ "data_bounds": null,
505
+ "disclosable_fields": [
506
+ {
507
+ "label": "next requirement",
508
+ "path": "data.viewer.userProperties.nextRequirement"
509
+ },
510
+ {
511
+ "label": "country",
512
+ "path": "data.viewer.userProperties.country.code"
513
+ }
514
+ ],
515
+ "headers": [
516
+ "Content-Type",
517
+ "Cookie"
518
+ ],
519
+ "method": "GET",
520
+ "required_cookies": [
521
+ "unified-session-manager-cookie"
522
+ ],
523
+ "url": "https://www.coinbase.com/graphql/query?operationName=userQuery&query=query+userQuery%7Bviewer%7BuserProperties%7BnextRequirement+country%7Bcode%7D%7D%7D%7D&variables=%7B%7D"
524
+ },
525
+ "id": "tlsn-coinbase-kyc",
526
+ "label": "User information from Coinbase"
527
+ }
528
+ ],
529
+ "target_url": "https://www.coinbase.com/graphql/query?&operationName=userQuery&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%229a1820595fa25fa475a39d59515aafbaba7a37ccf8633185957b7508929426e5%22%7D%7D&variables=%7B%7D",
530
+ "user_actions": [
531
+ "Login",
532
+ "Navigate to your profile page",
533
+ "The verification process will start automatically"
534
+ ]
535
+ },
536
+ {
537
+ "id": "tlsn-revolut",
538
+ "image": "https://main.cdn.krnprod.net/logos/revolut.svg",
539
+ "label": "Revolut",
540
+ "link": "https://www.revolut.com",
541
+ "login_url": "https://sso.revolut.com/signin",
542
+ "name": "Revolut",
543
+ "proof_sources": [
544
+ {
545
+ "claims": [
546
+ {
547
+ "entity_type": "individual",
548
+ "id": "revolut-kyc-not-fatf-blacklist",
549
+ "label": "Not on FATF Blacklist",
550
+ "rule_id": "revolut-kyc-not-fatf-blacklist"
551
+ },
552
+ {
553
+ "entity_type": "individual",
554
+ "id": "revolut-kyc-user-state",
555
+ "label": "User State",
556
+ "rule_id": "revolut-kyc-user-state"
557
+ },
558
+ {
559
+ "entity_type": "individual",
560
+ "id": "revolut-kyc-user-under-review",
561
+ "label": "Under Review",
562
+ "rule_id": "revolut-kyc-user-under-review"
563
+ },
564
+ {
565
+ "entity_type": "individual",
566
+ "id": "revolut-kyc-user-kyc",
567
+ "label": "User KYC",
568
+ "rule_id": "revolut-kyc-user-kyc"
569
+ }
570
+ ],
571
+ "endpoint": {
572
+ "body": null,
573
+ "data_bounds": {
574
+ "max_recv_data": 10000,
575
+ "max_sent_data": 5000
576
+ },
577
+ "disclosable_fields": [
578
+ {
579
+ "label": "country address",
580
+ "path": "user.address.country"
581
+ },
582
+ {
583
+ "label": "user status",
584
+ "path": "user.state"
585
+ },
586
+ {
587
+ "label": "kyc verification",
588
+ "path": "user.kyc"
589
+ },
590
+ {
591
+ "label": "under review",
592
+ "path": "user.underReview"
593
+ }
594
+ ],
595
+ "headers": [
596
+ "Cookie",
597
+ "User-Agent",
598
+ "x-device-id"
599
+ ],
600
+ "method": "GET",
601
+ "required_cookies": null,
602
+ "url": "https://app.revolut.com/api/retail/user/current"
603
+ },
604
+ "id": "tlsn-revolut-kyc",
605
+ "label": "User information from revolut"
606
+ }
607
+ ],
608
+ "target_url": "https://app.revolut.com/api/retail/user/current/wallet",
609
+ "user_actions": [
610
+ "Login",
611
+ "Navigate to your profile page",
612
+ "The verification process will start automatically"
613
+ ]
614
+ }
615
+ ]
package/dist/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ExtensionSDKConfig, ExtensionState } from './types';
1
+ import { ExtensionSDKConfig, ExtensionState } from "./types";
2
2
  /**
3
3
  * Class for interacting with the Keyring Connect browser extension
4
4
  */
@@ -19,5 +19,7 @@ export declare class KeyringConnect {
19
19
  static getExtensionState(): Promise<ExtensionState>;
20
20
  private static validateClientConfig;
21
21
  private static validateProofConfig;
22
+ private static validateDatasource;
23
+ private static validateConfigData;
22
24
  private static convertToLaunchConfig;
23
25
  }
package/dist/main.js CHANGED
@@ -8,9 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.KeyringConnect = void 0;
13
16
  const jwt_decode_1 = require("jwt-decode");
17
+ const datasources_json_1 = __importDefault(require("./constants/datasources.json"));
14
18
  const types_1 = require("./types");
15
19
  /**
16
20
  * Class for interacting with the Keyring Connect browser extension
@@ -35,9 +39,8 @@ class KeyringConnect {
35
39
  }
36
40
  return;
37
41
  }
38
- this.validateClientConfig(data);
39
- this.validateProofConfig(data);
40
- let launchConfig = this.convertToLaunchConfig(data);
42
+ const validatedConfig = this.validateConfigData(data);
43
+ let launchConfig = this.convertToLaunchConfig(validatedConfig);
41
44
  if ((_a = data.krn_config) === null || _a === void 0 ? void 0 : _a.auth0_id_token) {
42
45
  try {
43
46
  const decodedJwt = (0, jwt_decode_1.jwtDecode)(data.krn_config.auth0_id_token);
@@ -111,6 +114,26 @@ class KeyringConnect {
111
114
  }
112
115
  }
113
116
  }
117
+ static validateDatasource(config) {
118
+ var _a;
119
+ const datasource = datasources_json_1.default.find((datasource) => { var _a, _b; return datasource.id === ((_b = (_a = config.proof_config) === null || _a === void 0 ? void 0 : _a.datasource) === null || _b === void 0 ? void 0 : _b.id); });
120
+ const knownDatasources = datasources_json_1.default
121
+ .map((datasource) => datasource.name)
122
+ .join(", ");
123
+ if (!datasource) {
124
+ throw new Error(`Unsupported datasource. Connect to either of the supported datasources: ${knownDatasources}`);
125
+ }
126
+ return Object.assign(Object.assign({}, config), { proof_config: {
127
+ entity_type: (_a = config.proof_config) === null || _a === void 0 ? void 0 : _a.entity_type,
128
+ datasource,
129
+ } });
130
+ }
131
+ static validateConfigData(config) {
132
+ const validatedConfig = this.validateDatasource(config);
133
+ this.validateClientConfig(validatedConfig);
134
+ this.validateProofConfig(validatedConfig);
135
+ return validatedConfig;
136
+ }
114
137
  static convertToLaunchConfig(config) {
115
138
  var _a;
116
139
  const launchConfig = {
@@ -123,7 +146,8 @@ class KeyringConnect {
123
146
  },
124
147
  krn_config: config.krn_config
125
148
  ? {
126
- keyring_api_url: config.krn_config.keyring_api_url,
149
+ onboarding_api_url: config.krn_config.onboarding_api_url,
150
+ datastore_api_url: config.krn_config.datastore_api_url,
127
151
  analytics_api_url: config.krn_config.analytics_api_url,
128
152
  isolate_proving: config.krn_config.isolate_proving,
129
153
  notaryUrl: config.krn_config.notaryUrl,
package/dist/types.d.ts CHANGED
@@ -3,6 +3,12 @@ export declare enum EVENT_ACTIONS {
3
3
  GET_STATUS = "GET_STATUS",
4
4
  KEYRING_CONNECT_STATUS = "KEYRING_CONNECT_STATUS"
5
5
  }
6
+ export type PartialDataSource = Pick<DataSource, "id"> & Partial<DataSource>;
7
+ export type ValidatedConfig = ExtensionSDKConfig & {
8
+ proof_config: {
9
+ datasource: DataSource;
10
+ };
11
+ };
6
12
  export type ExtensionSDKConfig = {
7
13
  /**
8
14
  * The name of the client.
@@ -25,7 +31,7 @@ export type ExtensionSDKConfig = {
25
31
  * @note should be used with caution as strict validation is applied to the proof config.
26
32
  */
27
33
  proof_config?: {
28
- datasource: DataSource;
34
+ datasource: PartialDataSource;
29
35
  entity_type?: string;
30
36
  };
31
37
  /**
@@ -33,7 +39,8 @@ export type ExtensionSDKConfig = {
33
39
  * @note this is meant to be used for internal testing and development purposes.
34
40
  */
35
41
  krn_config?: {
36
- keyring_api_url?: string;
42
+ onboarding_api_url?: string;
43
+ datastore_api_url?: string;
37
44
  analytics_api_url?: string;
38
45
  auth0_id_token?: string;
39
46
  entity_id?: string;
@@ -56,7 +63,8 @@ export type ExtensionLaunchConfig = {
56
63
  entity_type?: string;
57
64
  };
58
65
  krn_config?: {
59
- keyring_api_url?: string;
66
+ onboarding_api_url?: string;
67
+ datastore_api_url?: string;
60
68
  analytics_api_url?: string;
61
69
  isolate_proving?: boolean;
62
70
  notaryUrl?: string;
@@ -65,9 +73,9 @@ export type ExtensionLaunchConfig = {
65
73
  };
66
74
  auth_user?: any;
67
75
  };
68
- export type ExtensionStatus = "idle" | "mounted" | "proving" | "prove_success" | "error";
69
- export type AttestationStatus = "onboarding_required" | "onboarding_pending" | "attestation_ready" | "non_compliant";
70
- export type CredentialStatus = "expired" | "valid" | "none";
76
+ export type ExtensionStatus = 'idle' | 'mounted' | 'proving' | 'prove_success' | 'error';
77
+ export type AttestationStatus = 'onboarding_required' | 'onboarding_pending' | 'attestation_ready' | 'non_compliant';
78
+ export type CredentialStatus = 'expired' | 'valid' | 'none';
71
79
  export type User = {
72
80
  /**
73
81
  * Off-chain attestation status.
@@ -101,7 +109,7 @@ export interface DataSource {
101
109
  id: string;
102
110
  name: string;
103
111
  label: string;
104
- user_actions: string[];
112
+ user_actions?: string[];
105
113
  link: string;
106
114
  login_url: string;
107
115
  target_url: string | null;
@@ -119,9 +127,9 @@ export interface TlsnEndpoint {
119
127
  method: string;
120
128
  headers: string[];
121
129
  disclosable_fields: DisclosableField[];
122
- required_cookies: string[] | null;
123
- data_bounds: DataBounds | null;
124
- body: string | null;
130
+ required_cookies?: string[] | null;
131
+ data_bounds?: DataBounds | null;
132
+ body?: string | null;
125
133
  }
126
134
  export interface Claim {
127
135
  id: string;
@@ -136,5 +144,4 @@ export interface DataBounds {
136
144
  export interface DisclosableField {
137
145
  label: string;
138
146
  path: string;
139
- key: string;
140
147
  }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@keyringnetwork/keyring-connect-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "An SDK for interacting with Keyring Connect browser extension",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
- "build": "rm -rf dist && tsc",
9
- "dev": "tsc --watch",
10
- "publish": "pnpm build && npm publish"
8
+ "build": "rm -rf dist && pnpm get:datasources && tsc",
9
+ "dev": "pnpm get:datasources && tsc --watch",
10
+ "publish:sdk": "pnpm build && npm publish",
11
+ "get:datasources": "node ../../scripts/parseDatasource.js -o src/constants/datasources.json"
11
12
  },
12
13
  "files": [
13
14
  "dist"