@keyringnetwork/keyring-connect-sdk 0.0.4 → 0.0.6
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.
- package/dist/main.js +6 -7
- package/dist/types.d.ts +14 -0
- package/package.json +1 -1
- package/readme.md +6 -0
package/dist/main.js
CHANGED
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.KeyringConnect = void 0;
|
|
13
|
-
const env_1 = require("./env");
|
|
14
13
|
const types_1 = require("./types");
|
|
15
14
|
class KeyringConnect {
|
|
16
15
|
static launchExtension(data) {
|
|
@@ -25,13 +24,13 @@ class KeyringConnect {
|
|
|
25
24
|
}
|
|
26
25
|
static isKeyringConnectInstalled() {
|
|
27
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
console.log('checking if keyring connect is installed');
|
|
28
28
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return false;
|
|
29
|
+
const timeout = new Promise((resolve) => {
|
|
30
|
+
setTimeout(() => resolve(false), 2000);
|
|
31
|
+
});
|
|
32
|
+
const checkExtension = this.getExtensionState().then((state) => Boolean(state.manifest));
|
|
33
|
+
return Promise.race([timeout, checkExtension]);
|
|
35
34
|
}
|
|
36
35
|
catch (error) {
|
|
37
36
|
return false;
|
package/dist/types.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export type ExtensionConfig = {
|
|
|
21
21
|
* The policy ID of the client.
|
|
22
22
|
*/
|
|
23
23
|
client_policy_id: number;
|
|
24
|
+
/**
|
|
25
|
+
* The entity ID of the client.
|
|
26
|
+
*/
|
|
27
|
+
client_entity_id?: string;
|
|
24
28
|
};
|
|
25
29
|
proof_config?: {
|
|
26
30
|
/**
|
|
@@ -32,6 +36,16 @@ export type ExtensionConfig = {
|
|
|
32
36
|
*/
|
|
33
37
|
entity_type: string;
|
|
34
38
|
};
|
|
39
|
+
krn_config?: {
|
|
40
|
+
/**
|
|
41
|
+
* The URL of the onboarding API.
|
|
42
|
+
*/
|
|
43
|
+
onboarding_api_url?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The URL of the datastore API.
|
|
46
|
+
*/
|
|
47
|
+
datastore_api_url?: string;
|
|
48
|
+
};
|
|
35
49
|
};
|
|
36
50
|
export type ExtensionStatus = 'idle' | 'mounted' | 'proving' | 'prove_success' | 'error';
|
|
37
51
|
export type AttestationStatus = 'onboarding_required' | 'onboarding_pending' | 'attestation_ready' | 'non_compliant';
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -32,6 +32,7 @@ const extensionConfig = {
|
|
|
32
32
|
client_app_url: 'https://myapp.com',
|
|
33
33
|
client_logo_url: 'https://myapp.com/logo.png',
|
|
34
34
|
client_policy_id: 123,
|
|
35
|
+
client_entity_id: '123',
|
|
35
36
|
},
|
|
36
37
|
// Optional proof configuration
|
|
37
38
|
proof_config: {
|
|
@@ -84,11 +85,16 @@ type ExtensionConfig = {
|
|
|
84
85
|
client_app_url: string; // Your application's URL
|
|
85
86
|
client_logo_url: string; // Your application's logo URL
|
|
86
87
|
client_policy_id: number; // Your Keyring policy ID
|
|
88
|
+
client_entity_id?: string; // Your user's entity ID
|
|
87
89
|
};
|
|
88
90
|
proof_config?: {
|
|
89
91
|
datasource: DataSource; // Configuration for the proof source
|
|
90
92
|
entity_type: string; // Type of entity to verify
|
|
91
93
|
};
|
|
94
|
+
krn_config?: {
|
|
95
|
+
onboarding_api_url?: string; // URL of the onboarding API
|
|
96
|
+
datastore_api_url?: string; // URL of the datastore API
|
|
97
|
+
};
|
|
92
98
|
};
|
|
93
99
|
```
|
|
94
100
|
|