@keyringnetwork/keyring-connect-sdk 2.1.1 → 2.3.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.
@@ -164,10 +164,7 @@
164
164
  ],
165
165
  "endpoint": {
166
166
  "body": null,
167
- "data_bounds": {
168
- "max_recv_data": 2500,
169
- "max_sent_data": 800
170
- },
167
+ "data_bounds": null,
171
168
  "disclosable_fields": [
172
169
  {
173
170
  "label": "user kyc",
@@ -229,10 +226,7 @@
229
226
  ],
230
227
  "endpoint": {
231
228
  "body": null,
232
- "data_bounds": {
233
- "max_recv_data": 2500,
234
- "max_sent_data": 800
235
- },
229
+ "data_bounds": null,
236
230
  "disclosable_fields": [
237
231
  {
238
232
  "label": "user kyc",
@@ -310,10 +304,7 @@
310
304
  ],
311
305
  "endpoint": {
312
306
  "body": null,
313
- "data_bounds": {
314
- "max_recv_data": 10000,
315
- "max_sent_data": 1000
316
- },
307
+ "data_bounds": null,
317
308
  "disclosable_fields": [
318
309
  {
319
310
  "label": "country of primary address",
@@ -369,10 +360,7 @@
369
360
  ],
370
361
  "endpoint": {
371
362
  "body": null,
372
- "data_bounds": {
373
- "max_recv_data": 10000,
374
- "max_sent_data": 1000
375
- },
363
+ "data_bounds": null,
376
364
  "disclosable_fields": [
377
365
  {
378
366
  "label": "country of primary address",
@@ -432,10 +420,7 @@
432
420
  ],
433
421
  "endpoint": {
434
422
  "body": "{\"dpIdCache\":null}",
435
- "data_bounds": {
436
- "max_recv_data": 10000,
437
- "max_sent_data": 5000
438
- },
423
+ "data_bounds": null,
439
424
  "disclosable_fields": [
440
425
  {
441
426
  "label": "mailing address",
@@ -536,7 +521,7 @@
536
521
  "image": "https://main.cdn.krnprod.net/logos/revolut.svg",
537
522
  "label": "Revolut",
538
523
  "link": "https://www.revolut.com",
539
- "login_url": "https://sso.revolut.com/signin",
524
+ "login_url": "https://app.revolut.com/start",
540
525
  "name": "Revolut",
541
526
  "proof_sources": [
542
527
  {
@@ -568,10 +553,7 @@
568
553
  ],
569
554
  "endpoint": {
570
555
  "body": null,
571
- "data_bounds": {
572
- "max_recv_data": 10000,
573
- "max_sent_data": 5000
574
- },
556
+ "data_bounds": null,
575
557
  "disclosable_fields": [
576
558
  {
577
559
  "label": "country of primary address",
@@ -659,5 +641,50 @@
659
641
  "Make sure you have logged in",
660
642
  "Navigate to the marketplace"
661
643
  ]
644
+ },
645
+ {
646
+ "id": "tlsn-fireblocks",
647
+ "image": "https://main.cdn.krnprod.net/logos/fireblocks.png",
648
+ "label": "fireblocks",
649
+ "link": "https://console.fireblocks.io",
650
+ "login_url": "https://console.fireblocks.io/login",
651
+ "name": "Fireblocks",
652
+ "proof_sources": [
653
+ {
654
+ "claims": [
655
+ {
656
+ "entity_type": "business",
657
+ "id": "fireblocks_kyb",
658
+ "label": "Account Status Ready",
659
+ "rule_id": "fireblocks_kyb"
660
+ }
661
+ ],
662
+ "endpoint": {
663
+ "body": null,
664
+ "data_bounds": null,
665
+ "disclosable_fields": [
666
+ {
667
+ "label": "status",
668
+ "path": "status",
669
+ "key": "kyb_status"
670
+ }
671
+ ],
672
+ "required_cookies": null,
673
+ "headers": [
674
+ "x-csrf-token",
675
+ "cookie"
676
+ ],
677
+ "method": "GET",
678
+ "url": "https://console-api.fireblocks.io/get_logged_user"
679
+ },
680
+ "id": "tlsn-fireblocks-kyb",
681
+ "label": "KYB from Fireblocks"
682
+ }
683
+ ],
684
+ "target_url": null,
685
+ "user_actions": [
686
+ "Make sure you have logged in",
687
+ "Navigate to your Dashboard"
688
+ ]
662
689
  }
663
690
  ]
package/dist/main.d.ts CHANGED
@@ -20,6 +20,15 @@ export declare class KeyringConnect {
20
20
  * @returns Promise that resolves with extension state or null if unavailable
21
21
  */
22
22
  static getExtensionState(): Promise<ExtensionState | null>;
23
+ /**
24
+ * Subscribe to extension state changes
25
+ * @param callback Function called with extension state updates
26
+ * The state parameter will be null if the extension is not installed
27
+ * or if an error occurs during state retrieval which indicates that
28
+ * the extension is not available (e.g. was disabled)
29
+ * @returns Unsubscribe function to stop polling
30
+ */
31
+ static subscribeToExtensionState(callback: (state: ExtensionState | null) => void): () => void;
23
32
  private static validateClientConfig;
24
33
  private static validateCredentialConfig;
25
34
  private static validateProofConfig;
package/dist/main.js CHANGED
@@ -80,6 +80,52 @@ class KeyringConnect {
80
80
  return Promise.race([timeout, extensionResponse]);
81
81
  });
82
82
  }
83
+ /**
84
+ * Subscribe to extension state changes
85
+ * @param callback Function called with extension state updates
86
+ * The state parameter will be null if the extension is not installed
87
+ * or if an error occurs during state retrieval which indicates that
88
+ * the extension is not available (e.g. was disabled)
89
+ * @returns Unsubscribe function to stop polling
90
+ */
91
+ static subscribeToExtensionState(callback) {
92
+ const interval = 3000;
93
+ const initialDelay = 0;
94
+ let isActive = true;
95
+ let timerId = null;
96
+ let lastStateString = "";
97
+ const processState = (state) => {
98
+ // Deduplicate state updates
99
+ const stateString = JSON.stringify(state);
100
+ if (stateString === lastStateString)
101
+ return;
102
+ lastStateString = stateString;
103
+ callback(state);
104
+ };
105
+ const messageHandler = (event) => {
106
+ if (event.data.type === types_1.EVENT_ACTIONS.KEYRING_CONNECT_STATUS &&
107
+ isActive) {
108
+ processState(event.data.data);
109
+ }
110
+ };
111
+ const pollStatus = () => {
112
+ if (!isActive)
113
+ return;
114
+ this.getExtensionState()
115
+ .then((state) => processState(state))
116
+ .catch(() => processState(null));
117
+ timerId = setTimeout(pollStatus, interval);
118
+ };
119
+ window.addEventListener("message", messageHandler);
120
+ // Start polling after initial delay
121
+ timerId = setTimeout(pollStatus, initialDelay);
122
+ return () => {
123
+ isActive = false;
124
+ if (timerId)
125
+ clearTimeout(timerId);
126
+ window.removeEventListener("message", messageHandler);
127
+ };
128
+ }
83
129
  static validateClientConfig(config) {
84
130
  if (!config.name) {
85
131
  throw new Error("Name is required");
package/package.json CHANGED
@@ -1,15 +1,9 @@
1
1
  {
2
2
  "name": "@keyringnetwork/keyring-connect-sdk",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
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
- },
13
7
  "files": [
14
8
  "dist"
15
9
  ],
@@ -17,10 +11,16 @@
17
11
  "author": "",
18
12
  "license": "ISC",
19
13
  "dependencies": {
20
- "@keyringnetwork/contracts-abi": "2.2.0"
14
+ "@keyringnetwork/contracts-abi": "2.4.0"
21
15
  },
22
16
  "devDependencies": {
23
17
  "ts-node": "^10.9.2",
24
18
  "typescript": "^5.6.3"
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
+ }