@keyringnetwork/keyring-connect-sdk 4.1.0-alpha.2 → 4.1.0-alpha.3
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.cjs +3279 -0
- package/dist/index.d.cts +263 -0
- package/dist/index.d.ts +263 -3
- package/dist/index.js +3251 -21
- package/package.json +10 -6
- package/readme.md +20 -75
- package/dist/core/VerificationSession.d.ts +0 -62
- package/dist/core/VerificationSession.js +0 -404
- package/dist/core/errors.d.ts +0 -49
- package/dist/core/errors.js +0 -81
- package/dist/core/htppClient.d.ts +0 -17
- package/dist/core/htppClient.js +0 -160
- package/dist/core/keyringConnectExtension.d.ts +0 -45
- package/dist/core/keyringConnectExtension.js +0 -241
- package/dist/core/websocketClient.d.ts +0 -23
- package/dist/core/websocketClient.js +0 -220
- package/dist/types/api.d.ts +0 -24
- package/dist/types/api.js +0 -2
- package/dist/types/core.d.ts +0 -78
- package/dist/types/core.js +0 -2
- package/dist/types/extension.d.ts +0 -59
- package/dist/types/extension.js +0 -9
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.js +0 -20
- package/dist/types/websocket.d.ts +0 -68
- package/dist/types/websocket.js +0 -3
- package/dist/ui/UIManager.d.ts +0 -52
- package/dist/ui/UIManager.js +0 -257
- package/dist/ui/components/keyring-button.d.ts +0 -12
- package/dist/ui/components/keyring-button.js +0 -140
- package/dist/ui/components/keyring-text.d.ts +0 -12
- package/dist/ui/components/keyring-text.js +0 -169
- package/dist/ui/composites/keyring-complete-modal.d.ts +0 -19
- package/dist/ui/composites/keyring-complete-modal.js +0 -200
- package/dist/ui/composites/keyring-mobile-modal.d.ts +0 -25
- package/dist/ui/composites/keyring-mobile-modal.js +0 -308
- package/dist/ui/composites/keyring-qr-modal.d.ts +0 -32
- package/dist/ui/composites/keyring-qr-modal.js +0 -464
- package/dist/ui/composites/keyring-selection-modal.d.ts +0 -25
- package/dist/ui/composites/keyring-selection-modal.js +0 -342
- package/dist/ui/composites/keyring-terminated-modal.d.ts +0 -14
- package/dist/ui/composites/keyring-terminated-modal.js +0 -121
- package/dist/ui/icons/apple-icon.d.ts +0 -4
- package/dist/ui/icons/apple-icon.js +0 -47
- package/dist/ui/icons/check-circle.d.ts +0 -4
- package/dist/ui/icons/check-circle.js +0 -35
- package/dist/ui/icons/checkmark.d.ts +0 -4
- package/dist/ui/icons/checkmark.js +0 -37
- package/dist/ui/icons/close-circle.d.ts +0 -4
- package/dist/ui/icons/close-circle.js +0 -35
- package/dist/ui/icons/error-circle.d.ts +0 -4
- package/dist/ui/icons/error-circle.js +0 -48
- package/dist/ui/icons/extension-grid.d.ts +0 -4
- package/dist/ui/icons/extension-grid.js +0 -79
- package/dist/ui/icons/google-icon.d.ts +0 -4
- package/dist/ui/icons/google-icon.js +0 -55
- package/dist/ui/icons/gradient-donut.d.ts +0 -8
- package/dist/ui/icons/gradient-donut.js +0 -85
- package/dist/ui/icons/keyring.d.ts +0 -4
- package/dist/ui/icons/keyring.js +0 -71
- package/dist/ui/icons/mobile-grid.d.ts +0 -4
- package/dist/ui/icons/mobile-grid.js +0 -68
- package/dist/ui/icons/success.d.ts +0 -4
- package/dist/ui/icons/success.js +0 -54
- package/dist/utils/environment.d.ts +0 -34
- package/dist/utils/environment.js +0 -67
- package/dist/utils/logger.d.ts +0 -7
- package/dist/utils/logger.js +0 -40
- package/dist/utils/platformUtils.d.ts +0 -24
- package/dist/utils/platformUtils.js +0 -64
package/dist/utils/logger.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.KeyringLogger = void 0;
|
|
7
|
-
const pino_1 = __importDefault(require("pino"));
|
|
8
|
-
const package_json_1 = __importDefault(require("../../package.json"));
|
|
9
|
-
class KeyringLogger {
|
|
10
|
-
static init(scope) {
|
|
11
|
-
const logger = this.createPinoLogger(scope);
|
|
12
|
-
return logger;
|
|
13
|
-
}
|
|
14
|
-
static createPinoLogger(scope) {
|
|
15
|
-
const metadata = {
|
|
16
|
-
scope,
|
|
17
|
-
packageVersion: this.packageVersion,
|
|
18
|
-
};
|
|
19
|
-
const logger = (0, pino_1.default)({
|
|
20
|
-
name: this.prefix,
|
|
21
|
-
level: "debug",
|
|
22
|
-
browser: {
|
|
23
|
-
asObject: true,
|
|
24
|
-
formatters: {
|
|
25
|
-
level: (label) => ({
|
|
26
|
-
level: label.toUpperCase(),
|
|
27
|
-
}),
|
|
28
|
-
log(object) {
|
|
29
|
-
return Object.assign(Object.assign({}, object), { metadata });
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
timestamp: () => `${new Date(Date.now()).toISOString()}`,
|
|
34
|
-
});
|
|
35
|
-
return logger;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.KeyringLogger = KeyringLogger;
|
|
39
|
-
KeyringLogger.prefix = "[Keyring SDK]";
|
|
40
|
-
KeyringLogger.packageVersion = package_json_1.default.version;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface PlatformInfo {
|
|
2
|
-
isDesktop: boolean;
|
|
3
|
-
isMobile: boolean;
|
|
4
|
-
isAndroid: boolean;
|
|
5
|
-
isIOS: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare class PlatformUtils {
|
|
8
|
-
/**
|
|
9
|
-
* Detect the current platform and capabilities
|
|
10
|
-
*/
|
|
11
|
-
static detectPlatform(): PlatformInfo;
|
|
12
|
-
/**
|
|
13
|
-
* Check if Chrome runtime is available for extension communication
|
|
14
|
-
*/
|
|
15
|
-
static isChromeRuntimeAvailable(): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Check if running in browser environment
|
|
18
|
-
*/
|
|
19
|
-
static isBrowser(): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Wait for online status
|
|
22
|
-
*/
|
|
23
|
-
static waitForOnline(timeout?: number): Promise<boolean>;
|
|
24
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlatformUtils = void 0;
|
|
4
|
-
class PlatformUtils {
|
|
5
|
-
/**
|
|
6
|
-
* Detect the current platform and capabilities
|
|
7
|
-
*/
|
|
8
|
-
static detectPlatform() {
|
|
9
|
-
const userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "";
|
|
10
|
-
const isAndroid = /Android/i.test(userAgent);
|
|
11
|
-
const isIOS = /iPad|iPhone|iPod/.test(userAgent);
|
|
12
|
-
const isMobile = isAndroid ||
|
|
13
|
-
isIOS ||
|
|
14
|
-
/Mobile|Opera Mini|Fennec|webOS|BlackBerry|PlayBook|BB10|IEMobile/i.test(userAgent);
|
|
15
|
-
const isDesktop = !isMobile;
|
|
16
|
-
return {
|
|
17
|
-
isDesktop,
|
|
18
|
-
isMobile,
|
|
19
|
-
isAndroid,
|
|
20
|
-
isIOS,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Check if Chrome runtime is available for extension communication
|
|
25
|
-
*/
|
|
26
|
-
static isChromeRuntimeAvailable() {
|
|
27
|
-
var _a;
|
|
28
|
-
try {
|
|
29
|
-
return typeof ((_a = chrome === null || chrome === void 0 ? void 0 : chrome.runtime) === null || _a === void 0 ? void 0 : _a.sendMessage) === "function";
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Check if running in browser environment
|
|
37
|
-
*/
|
|
38
|
-
static isBrowser() {
|
|
39
|
-
return typeof window !== "undefined";
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Wait for online status
|
|
43
|
-
*/
|
|
44
|
-
static waitForOnline(timeout = 30000) {
|
|
45
|
-
return new Promise((resolve) => {
|
|
46
|
-
if (typeof navigator === "undefined" || navigator.onLine) {
|
|
47
|
-
resolve(true);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
let timeoutId;
|
|
51
|
-
const onOnline = () => {
|
|
52
|
-
clearTimeout(timeoutId);
|
|
53
|
-
window.removeEventListener("online", onOnline);
|
|
54
|
-
resolve(true);
|
|
55
|
-
};
|
|
56
|
-
window.addEventListener("online", onOnline);
|
|
57
|
-
timeoutId = setTimeout(() => {
|
|
58
|
-
window.removeEventListener("online", onOnline);
|
|
59
|
-
resolve(false);
|
|
60
|
-
}, timeout);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.PlatformUtils = PlatformUtils;
|