@keyringnetwork/keyring-connect-sdk 3.0.0 → 3.1.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.
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from "@keyringnetwork/contracts-abi";
1
2
  export { KeyringConnect } from "./main";
2
3
  export * from "./types";
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.KeyringConnect = void 0;
18
+ __exportStar(require("@keyringnetwork/contracts-abi"), exports);
18
19
  var main_1 = require("./main");
19
20
  Object.defineProperty(exports, "KeyringConnect", { enumerable: true, get: function () { return main_1.KeyringConnect; } });
20
21
  __exportStar(require("./types"), exports);
package/dist/main.js CHANGED
@@ -45,12 +45,9 @@ class KeyringConnect {
45
45
  */
46
46
  static isKeyringConnectInstalled() {
47
47
  return __awaiter(this, void 0, void 0, function* () {
48
- try {
49
- return this.getExtensionState().then((state) => state ? Boolean(state.manifest) : false);
50
- }
51
- catch (error) {
52
- return false;
53
- }
48
+ return this.getExtensionState()
49
+ .then((state) => (state ? Boolean(state.manifest) : false))
50
+ .catch(() => false);
54
51
  });
55
52
  }
56
53
  /**
@@ -89,12 +86,6 @@ class KeyringConnect {
89
86
  lastStateString = stateString;
90
87
  callback(state);
91
88
  };
92
- const messageHandler = (event) => {
93
- if (event.data.type === types_1.EVENT_ACTIONS.KEYRING_CONNECT_STATUS &&
94
- isActive) {
95
- processState(event.data.data);
96
- }
97
- };
98
89
  const pollStatus = () => {
99
90
  if (!isActive)
100
91
  return;
@@ -103,14 +94,12 @@ class KeyringConnect {
103
94
  .catch(() => processState(null));
104
95
  timerId = setTimeout(pollStatus, interval);
105
96
  };
106
- window.addEventListener("message", messageHandler);
107
97
  // Start polling after initial delay
108
98
  timerId = setTimeout(pollStatus, initialDelay);
109
99
  return () => {
110
100
  isActive = false;
111
101
  if (timerId)
112
102
  clearTimeout(timerId);
113
- window.removeEventListener("message", messageHandler);
114
103
  };
115
104
  }
116
105
  static validateClientConfig(config) {
@@ -158,7 +147,7 @@ class KeyringConnect {
158
147
  return config;
159
148
  }
160
149
  static convertToLaunchConfig(config) {
161
- var _a, _b;
150
+ var _a;
162
151
  const launchConfig = {
163
152
  client: {
164
153
  client_name: config.name,
@@ -178,9 +167,6 @@ class KeyringConnect {
178
167
  }
179
168
  : undefined,
180
169
  proof_config: config.proof_config,
181
- session_info: {
182
- access_token: (_b = config.krn_config) === null || _b === void 0 ? void 0 : _b.keyring_access_token,
183
- },
184
170
  };
185
171
  return launchConfig;
186
172
  }
package/dist/types.d.ts CHANGED
@@ -72,9 +72,6 @@ export type ExtensionLaunchConfig = {
72
72
  notaryUrl?: string;
73
73
  websocketProxyUrl?: string;
74
74
  };
75
- session_info?: {
76
- access_token?: string;
77
- };
78
75
  };
79
76
  export type ExtensionStatus = "idle" | "mounted" | "proving" | "prove_error" | "prove_success" | "error";
80
77
  export type AttestationStatus = "onboarding_required" | "onboarding_pending" | "attestation_ready" | "non_compliant";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keyringnetwork/keyring-connect-sdk",
3
- "version": "3.0.0",
3
+ "version": "3.1.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",
@@ -19,5 +19,8 @@
19
19
  "@types/chrome": "^0.0.268",
20
20
  "ts-node": "^10.9.2",
21
21
  "typescript": "^5.6.3"
22
+ },
23
+ "dependencies": {
24
+ "@keyringnetwork/contracts-abi": "2.5.0"
22
25
  }
23
- }
26
+ }
package/readme.md CHANGED
@@ -42,7 +42,7 @@ const extensionConfig = {
42
42
  policy_id: 123,
43
43
  credential_config: {
44
44
  chain_id: 1,
45
- wallet_address: '0x123abc'
45
+ wallet_address: '0x123abcd'
46
46
  }
47
47
  };
48
48