@keyringnetwork/keyring-connect-sdk 1.1.0 → 1.1.1

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.
@@ -11,42 +11,27 @@
11
11
  "claims": [
12
12
  {
13
13
  "entity_type": "individual",
14
- "id": "109d3384-e2af-4e13-aefe-018aff23e575",
14
+ "id": "binance_kyc_level",
15
15
  "label": "KYC Level >= INTERMEDIATE",
16
- "rule_id": "0x9585e5e99c1d0998cf51549ee4fcb0bb91fcecedcc53d84ef5ef25e6807055ca"
16
+ "rule_id": "binance_kyc_level"
17
17
  },
18
18
  {
19
19
  "entity_type": "individual",
20
- "id": "782f0aac-2655-4b07-8ec7-1f2215fcf996",
20
+ "id": "binance_kyc_not_in_fatf_tlsn-binance-kyc",
21
21
  "label": "User POA Country not on FATF",
22
- "rule_id": "0xfc2234a1fbb0317498957fd4235d31316f0ff2359ed18f4b3f09f86dda3ed189"
22
+ "rule_id": "binance_kyc_not_in_fatf_tlsn-binance-kyc"
23
23
  },
24
24
  {
25
25
  "entity_type": "individual",
26
- "id": "782f0aac-2655-4b07-8ec7-1f2215fcf997",
26
+ "id": "binance_kyc_account_type",
27
27
  "label": "User Account Type",
28
- "rule_id": "0xf1c8b5068f39f13c7bbf5128563be0d7277bb5712e2cada98c8d275170d4c105"
28
+ "rule_id": "binance_kyc_account_type"
29
29
  }
30
30
  ],
31
31
  "endpoint": {
32
32
  "body": null,
33
33
  "data_bounds": null,
34
34
  "disclosable_fields": [
35
- {
36
- "label": "first name",
37
- "path": "data.fillInfo.firstName",
38
- "key": "first_name"
39
- },
40
- {
41
- "label": "last name",
42
- "path": "data.fillInfo.lastName",
43
- "key": "last_name"
44
- },
45
- {
46
- "label": "dob",
47
- "path": "data.fillInfo.dob",
48
- "key": "dob"
49
- },
50
35
  {
51
36
  "label": "kyc level",
52
37
  "path": "data.passKycLevel",
@@ -55,7 +40,7 @@
55
40
  {
56
41
  "label": "country of primary address",
57
42
  "path": "data.fillInfo.residenceCountry",
58
- "key": "country_of_primary_address"
43
+ "key": "country"
59
44
  },
60
45
  {
61
46
  "label": "account type",
@@ -82,21 +67,21 @@
82
67
  "claims": [
83
68
  {
84
69
  "entity_type": "business",
85
- "id": "782f0aac-2655-4b07-8ec7-1f2215fcf998",
70
+ "id": "binance_kyb_verified",
86
71
  "label": "KYB Verified",
87
- "rule_id": "0xdf536a0462f3a9d7a67f2f1f1885ea6caa8d146dd247cc22590adb2b63932fc5"
72
+ "rule_id": "binance_kyb_verified"
88
73
  },
89
74
  {
90
75
  "entity_type": "business",
91
- "id": "782f0aac-2655-4b07-8ec7-1f2215fcf999",
76
+ "id": "binance_kyb_not_in_fatf_tlsn-binance-kyb",
92
77
  "label": "Business POA Country not on FATF",
93
- "rule_id": "0xb756ee391611a6e9303e673ee3d65cae1f7a308b3be131d99b2f131a3497a936"
78
+ "rule_id": "binance_kyb_not_in_fatf_tlsn-binance-kyb"
94
79
  },
95
80
  {
96
81
  "entity_type": "business",
97
- "id": "782f0aac-2655-4b07-8ec7-1f2215fd0000",
82
+ "id": "binance_kyb_account_type",
98
83
  "label": "Business Account Type",
99
- "rule_id": "0xd9f75a927c9af7fdbedd3925ed32611d87900c41822faad7ecf9665e179c63db"
84
+ "rule_id": "binance_kyb_account_type"
100
85
  }
101
86
  ],
102
87
  "endpoint": {
@@ -106,22 +91,12 @@
106
91
  {
107
92
  "label": "kyb status",
108
93
  "path": "data.kycStatus",
109
- "key": "kyb_status"
110
- },
111
- {
112
- "label": "company name",
113
- "path": "data.fillInfo.companyName",
114
- "key": "company_name"
94
+ "key": "kyc_status"
115
95
  },
116
96
  {
117
97
  "label": "country of primary address",
118
98
  "path": "data.fillInfo.residenceCountry",
119
- "key": "country_of_primary_address"
120
- },
121
- {
122
- "label": "kyb message detail",
123
- "path": "data.frontDisplayLevelMsg",
124
- "key": "kyb_message_detail"
99
+ "key": "country"
125
100
  },
126
101
  {
127
102
  "label": "account type",
@@ -164,27 +139,27 @@
164
139
  "claims": [
165
140
  {
166
141
  "entity_type": "business",
167
- "id": "241f4b43-8b4f-4760-ac7a-dbb929dd24cf",
142
+ "id": "kraken_kyb_not_in_fatf_tlsn-kraken-kyb",
168
143
  "label": "KYB Tier 4 (Full KYB)",
169
- "rule_id": "e475888c95ee4a6dbfcaeeab5895f389"
144
+ "rule_id": "kraken_kyb_not_in_fatf_tlsn-kraken-kyb"
170
145
  },
171
146
  {
172
147
  "entity_type": "business",
173
- "id": "f9b064c0-b203-4b67-9632-5d6bf3c58940",
148
+ "id": "kraken_kyb_not_in_fatf_tlsn-kraken-kyb",
174
149
  "label": "Business Country not on FATF",
175
- "rule_id": "06058644a4474d4885349d66f2fe3b61"
150
+ "rule_id": "kraken_kyb_not_in_fatf_tlsn-kraken-kyb"
176
151
  },
177
152
  {
178
153
  "entity_type": "business",
179
- "id": "34b778de-2ae1-43fe-afd2-d9d213be0d29",
154
+ "id": "kraken_kyb_account_type",
180
155
  "label": "Pro Business Account Type",
181
- "rule_id": "a272c98c3d014098b250e16965204c9c"
156
+ "rule_id": "kraken_kyb_account_type"
182
157
  },
183
158
  {
184
159
  "entity_type": "business",
185
- "id": "41549275-a867-4c88-aff2-3c591d16c4cb",
160
+ "id": "kraken_kyb_verified_address",
186
161
  "label": "Verified Address",
187
- "rule_id": "a28fd396693d447aa6981c4b67f93bac"
162
+ "rule_id": "kraken_kyb_verified_address"
188
163
  }
189
164
  ],
190
165
  "endpoint": {
@@ -200,12 +175,7 @@
200
175
  "key": "user_kyc"
201
176
  },
202
177
  {
203
- "label": "first name",
204
- "path": "result.first_name",
205
- "key": "first_name"
206
- },
207
- {
208
- "label": "country",
178
+ "label": "country of primary address",
209
179
  "path": "result.country",
210
180
  "key": "country"
211
181
  },
@@ -240,21 +210,21 @@
240
210
  "claims": [
241
211
  {
242
212
  "entity_type": "individual",
243
- "id": "62d7d554-bf4f-4c27-9d20-0a42e10fd717",
213
+ "id": "kraken_kyc_tier",
244
214
  "label": "KYB Tier 3+ (Verified ID)",
245
- "rule_id": "f475888c95ee4a6dbfcaeeab5895f390"
215
+ "rule_id": "kraken_kyc_tier"
246
216
  },
247
217
  {
248
218
  "entity_type": "individual",
249
- "id": "e3aadb6d-04a9-48be-acde-4ebdacfe14c0",
219
+ "id": "kraken_kyc_not_in_fatf_tlsn-kraken-kyc",
250
220
  "label": "Country not on FATF",
251
- "rule_id": "16058644a4474d4885349d66f2fe3b62"
221
+ "rule_id": "kraken_kyc_not_in_fatf_tlsn-kraken-kyc"
252
222
  },
253
223
  {
254
224
  "entity_type": "individual",
255
- "id": "34079544-ea30-42e0-a4f2-9b43bba0a582",
225
+ "id": "kraken_kyc_account_type",
256
226
  "label": "Retail Account Type",
257
- "rule_id": "c272c98c3d014098b250e16965204c9e"
227
+ "rule_id": "kraken_kyc_account_type"
258
228
  }
259
229
  ],
260
230
  "endpoint": {
@@ -270,12 +240,7 @@
270
240
  "key": "user_kyc"
271
241
  },
272
242
  {
273
- "label": "first name",
274
- "path": "result.first_name",
275
- "key": "first_name"
276
- },
277
- {
278
- "label": "country",
243
+ "label": "country of primary address",
279
244
  "path": "result.country",
280
245
  "key": "country"
281
246
  },
@@ -328,19 +293,19 @@
328
293
  "entity_type": "individual",
329
294
  "id": "75eebf24-5dfe-4b3d-b651-f21fff1786c4",
330
295
  "label": "KYC Verified",
331
- "rule_id": "d6f67da1ee70413a98cdf36c273bf7d2"
296
+ "rule_id": "binance_us_kyc_verified"
332
297
  },
333
298
  {
334
299
  "entity_type": "individual",
335
300
  "id": "18e9f113-5110-4abb-b6e9-da07dcfeb41f",
336
301
  "label": "User POA Country not on FATF",
337
- "rule_id": "af82a3a40d4f4da3b4bbde107d6c2955"
302
+ "rule_id": "binance_us_kyc_not_in_fatf_tlsn-binance-us-kyc"
338
303
  },
339
304
  {
340
305
  "entity_type": "individual",
341
306
  "id": "2a5d69a3-1ead-4be6-9112-760b6432c3d8",
342
307
  "label": "Individual Account Type",
343
- "rule_id": "6ee0a58a6caa43bb8f8a769339c50648"
308
+ "rule_id": "binance_us_kyc_account_type"
344
309
  }
345
310
  ],
346
311
  "endpoint": {
@@ -351,7 +316,7 @@
351
316
  },
352
317
  "disclosable_fields": [
353
318
  {
354
- "label": "country",
319
+ "label": "country of primary address",
355
320
  "path": "data.userDetails.country",
356
321
  "key": "country"
357
322
  },
@@ -387,19 +352,19 @@
387
352
  "entity_type": "business",
388
353
  "id": "26db829e-ded2-4046-9626-7a1867d5be06",
389
354
  "label": "KYB Verified",
390
- "rule_id": "991cbd81da01446b86bb0153d3c45243"
355
+ "rule_id": "binance_us_kyb_verified"
391
356
  },
392
357
  {
393
358
  "entity_type": "business",
394
359
  "id": "81d4d669-f626-4dfb-9966-c783d2f3dddb",
395
360
  "label": "Business POA Country not on FATF",
396
- "rule_id": "afe033c3a2ed4094bfedb43b99b35bc9"
361
+ "rule_id": "binance_us_kyb_not_in_fatf_tlsn-binance-us-kyb"
397
362
  },
398
363
  {
399
364
  "entity_type": "business",
400
365
  "id": "a99d0cf5-ee75-4ddf-b3e2-aabb794450f2",
401
366
  "label": "Business Account Type",
402
- "rule_id": "8f7c1dfa4c7c48bca407817c0312c9f7"
367
+ "rule_id": "binance_us_kyb_account_type"
403
368
  }
404
369
  ],
405
370
  "endpoint": {
@@ -412,7 +377,7 @@
412
377
  {
413
378
  "label": "country of primary address",
414
379
  "path": "data.userDetails.country",
415
- "key": "country_of_primary_address"
380
+ "key": "country"
416
381
  },
417
382
  {
418
383
  "label": "kyc level",
@@ -457,7 +422,14 @@
457
422
  "name": "Fidelity",
458
423
  "proof_sources": [
459
424
  {
460
- "claims": [],
425
+ "claims": [
426
+ {
427
+ "entity_type": "individual",
428
+ "id": "fidelity_kyc_verified",
429
+ "label": "KYC Verified",
430
+ "rule_id": "fidelity_kyc_verified"
431
+ }
432
+ ],
461
433
  "endpoint": {
462
434
  "body": "{\"dpIdCache\":null}",
463
435
  "data_bounds": {
@@ -465,11 +437,6 @@
465
437
  "max_sent_data": 5000
466
438
  },
467
439
  "disclosable_fields": [
468
- {
469
- "label": "full name",
470
- "path": "customer.name",
471
- "key": "full_name"
472
- },
473
440
  {
474
441
  "label": "mailing address",
475
442
  "path": "customer.addresses.mailing",
@@ -494,7 +461,7 @@
494
461
  ],
495
462
  "url": "https://digital.fidelity.com/ftgw/digital/profile/api/personal/info"
496
463
  },
497
- "id": "tlsn-fidelity-profile",
464
+ "id": "tlsn-fidelity-kyc",
498
465
  "label": "Profile information from Fidelity"
499
466
  }
500
467
  ],
@@ -517,15 +484,15 @@
517
484
  "claims": [
518
485
  {
519
486
  "entity_type": "individual",
520
- "id": "9c276689-aa24-4e10-847c-6dd8097dabe0",
487
+ "id": "coinbase_kyc_verified",
521
488
  "label": "KYC Verified",
522
- "rule_id": "ac0ced0317ac4543b9761c6c0f54dade"
489
+ "rule_id": "coinbase_kyc_verified"
523
490
  },
524
491
  {
525
492
  "entity_type": "individual",
526
- "id": "3bfbc9f3-edde-44b3-8aec-d514058cc0f3",
493
+ "id": "coinbase_kyc_not_in_fatf_tlsn-coinbase-kyc",
527
494
  "label": "Coinbase Residence country is not on FATF BList",
528
- "rule_id": "c1313e05ee4f488da18be760b24df34d"
495
+ "rule_id": "coinbase_kyc_not_in_fatf_tlsn-coinbase-kyc"
529
496
  }
530
497
  ],
531
498
  "endpoint": {
@@ -533,12 +500,12 @@
533
500
  "data_bounds": null,
534
501
  "disclosable_fields": [
535
502
  {
536
- "label": "next requirement",
503
+ "label": "no remaining kyc requirements",
537
504
  "path": "data.viewer.userProperties.nextRequirement",
538
505
  "key": "next_requirement"
539
506
  },
540
507
  {
541
- "label": "country",
508
+ "label": "country of primary address",
542
509
  "path": "data.viewer.userProperties.country.code",
543
510
  "key": "country"
544
511
  }
@@ -557,7 +524,7 @@
557
524
  "label": "User information from Coinbase"
558
525
  }
559
526
  ],
560
- "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",
527
+ "target_url": "https://www.coinbase.com/graphql/query?&operationName=userQuery&*",
561
528
  "user_actions": [
562
529
  "Login",
563
530
  "Navigate to your profile page",
@@ -576,27 +543,9 @@
576
543
  "claims": [
577
544
  {
578
545
  "entity_type": "individual",
579
- "id": "revolut-kyc-not-fatf-blacklist",
580
- "label": "Not on FATF Blacklist",
581
- "rule_id": "revolut-kyc-not-fatf-blacklist"
582
- },
583
- {
584
- "entity_type": "individual",
585
- "id": "revolut-kyc-user-state",
586
- "label": "User State",
587
- "rule_id": "revolut-kyc-user-state"
588
- },
589
- {
590
- "entity_type": "individual",
591
- "id": "revolut-kyc-user-under-review",
592
- "label": "Under Review",
593
- "rule_id": "revolut-kyc-user-under-review"
594
- },
595
- {
596
- "entity_type": "individual",
597
- "id": "revolut-kyc-user-kyc",
598
- "label": "User KYC",
599
- "rule_id": "revolut-kyc-user-kyc"
546
+ "id": "revolut_kyc_verified",
547
+ "label": "KYC Verified",
548
+ "rule_id": "revolut_kyc_verified"
600
549
  }
601
550
  ],
602
551
  "endpoint": {
@@ -607,22 +556,22 @@
607
556
  },
608
557
  "disclosable_fields": [
609
558
  {
610
- "label": "country address",
559
+ "label": "country of primary address",
611
560
  "path": "user.address.country",
612
- "key": "country_address"
561
+ "key": "country"
613
562
  },
614
563
  {
615
564
  "label": "user status",
616
565
  "path": "user.state",
617
- "key": "user_status"
566
+ "key": "user_state"
618
567
  },
619
568
  {
620
- "label": "kyc verification",
569
+ "label": "user kyc",
621
570
  "path": "user.kyc",
622
- "key": "kyc_verification"
571
+ "key": "user_kyc"
623
572
  },
624
573
  {
625
- "label": "under review",
574
+ "label": "account under review",
626
575
  "path": "user.underReview",
627
576
  "key": "under_review"
628
577
  }
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "@keyringnetwork/keyring-connect-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
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
+ "scripts": {
8
+ "build": "rm -rf dist && pnpm get:datasources && tsc",
9
+ "dev": "pnpm get:datasources && tsc --watch",
10
+ "build_and_publish": "pnpm build && npm publish",
11
+ "get:datasources": "node ../../scripts/parseDatasource.js -o src/constants/datasources.json"
12
+ },
7
13
  "files": [
8
14
  "dist"
9
15
  ],
@@ -16,11 +22,5 @@
16
22
  },
17
23
  "dependencies": {
18
24
  "jwt-decode": "^4.0.0"
19
- },
20
- "scripts": {
21
- "build": "rm -rf dist && pnpm get:datasources && tsc",
22
- "dev": "pnpm get:datasources && tsc --watch",
23
- "build_and_publish": "pnpm build && npm publish",
24
- "get:datasources": "node ../../scripts/parseDatasource.js -o src/constants/datasources.json"
25
25
  }
26
26
  }
package/readme.md CHANGED
@@ -1,16 +1,20 @@
1
1
  # Keyring Connect SDK
2
2
 
3
- A TypeScript/JavaScript SDK for integrating with the Keyring Connect browser extension. This SDK enables seamless interaction with the Keyring Connect extension for user verification and attestation.
3
+ A TypeScript SDK for integrating with the Keyring Connect browser extension. This SDK enables seamless interaction with the Keyring Connect extension for user verification and attestation.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
8
  npm install @keyringnetwork/keyring-connect-sdk
9
+ yarn add @keyringnetwork/keyring-connect-sdk
10
+ pnpm install @keyringnetwork/keyring-connect-sdk
9
11
  ```
10
12
 
11
13
  ## Features
12
14
 
15
+ - Check if the extension is installed
13
16
  - Launch Keyring Connect with custom client configuration
17
+ - Redirect the user back to the app where they left off after extension installation
14
18
  - Monitor extension status and user state
15
19
  - Full TypeScript support with comprehensive type definitions
16
20
 
@@ -19,23 +23,31 @@ npm install @keyringnetwork/keyring-connect-sdk
19
23
  ### Initialize
20
24
 
21
25
  ```typescript
22
- import { KeyringConnect } from '@keyringnetwork/keyring-connect-sdk';
26
+ import { KeyringConnect } from "@keyringnetwork/keyring-connect-sdk";
27
+ ```
28
+
29
+ ### Check if the extension is installed
30
+
31
+ ```typescript
32
+ const isInstalled = await KeyringConnect.isKeyringConnectInstalled();
23
33
  ```
24
34
 
25
35
  ### Launch Keyring Connect
26
36
 
27
37
  ```typescript
28
38
  const extensionConfig = {
29
- name: 'My App',
30
- app_url: 'https://myapp.com',
31
- logo_url: 'https://myapp.com/logo.png',
39
+ name: "My App",
40
+ app_url: "https://myapp.com",
41
+ logo_url: "https://myapp.com/logo.png",
32
42
  policy_id: 123,
33
43
  };
34
44
 
45
+ // This method handles both launching the extension if installed
46
+ // or redirecting to the Chrome Web Store if not installed
35
47
  try {
36
48
  await KeyringConnect.launchExtension(extensionConfig);
37
49
  } catch (error) {
38
- console.error('Failed to launch Keyring Connect:', error);
50
+ console.error("Failed to launch Keyring Connect:", error);
39
51
  }
40
52
  ```
41
53
 
@@ -43,7 +55,7 @@ try {
43
55
 
44
56
  ```typescript
45
57
  export interface ExtensionState {
46
- status: 'idle' | 'mounted' | 'proving' | 'prove_success' | 'error';
58
+ status: "idle" | "mounted" | "proving" | "prove_success" | "error";
47
59
  manifest?: any;
48
60
  error?: string; // error message, only if status is 'error'
49
61
  user?: User;
@@ -52,11 +64,55 @@ export interface ExtensionState {
52
64
  const extensionState = await KeyringConnect.getExtensionState();
53
65
  ```
54
66
 
55
- ## API Reference
67
+ ### Integration Example
56
68
 
57
- ### Key Types
69
+ ```typescript
70
+ import { useEffect, useState } from "react";
71
+ import {
72
+ ExtensionSDKConfig,
73
+ KeyringConnect,
74
+ } from "@keyringnetwork/keyring-connect-sdk";
75
+
76
+ function KeyringConnectButton() {
77
+ const [isInstalled, setIsInstalled] = useState<boolean | undefined>(
78
+ undefined
79
+ );
80
+
81
+ // Check if extension is installed
82
+ useEffect(() => {
83
+ const checkExtension = async () => {
84
+ const isInstalled = await KeyringConnect.isKeyringConnectInstalled();
85
+ setIsInstalled(isInstalled);
86
+ };
87
+ checkExtension();
88
+ }, []);
89
+
90
+ // Configure your app
91
+ const config: ExtensionSDKConfig = {
92
+ app_url: window.location.origin,
93
+ name: "My App",
94
+ logo_url: "https://myapp.com/logo.png",
95
+ policy_id: 7,
96
+ };
97
+
98
+ // Launch the extension (handles both installed and not installed cases)
99
+ const launchExtension = () => {
100
+ KeyringConnect.launchExtension(config);
101
+ };
102
+
103
+ if (isInstalled === undefined) {
104
+ return <button disabled>Checking extension...</button>;
105
+ }
106
+
107
+ return (
108
+ <button onClick={launchExtension}>
109
+ {isInstalled ? "Launch Extension" : "Install Extension"}
110
+ </button>
111
+ );
112
+ }
113
+ ```
58
114
 
59
- > Full type definitions can be found in our [types.ts](https://github.com/Keyring-Network/keyring-connect/blob/master/keyring-connect-sdk/src/types.ts)
115
+ ## API Reference
60
116
 
61
117
  #### Core Types Overview
62
118