@onekeyfe/hd-core 0.1.44 → 0.1.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -24,8 +24,8 @@
24
24
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
25
25
  },
26
26
  "dependencies": {
27
- "@onekeyfe/hd-shared": "^0.1.44",
28
- "@onekeyfe/hd-transport": "^0.1.44",
27
+ "@onekeyfe/hd-shared": "^0.1.45",
28
+ "@onekeyfe/hd-transport": "^0.1.45",
29
29
  "axios": "^0.27.2",
30
30
  "bignumber.js": "^9.0.2",
31
31
  "js-sha256": "^0.9.0",
@@ -36,5 +36,5 @@
36
36
  "@types/parse-uri": "^1.0.0",
37
37
  "@types/semver": "^7.3.9"
38
38
  },
39
- "gitHead": "fb673918587877267cbbeca6e0c6abbc56a0d0fa"
39
+ "gitHead": "0436f8ff26494933124c1c6f4586d4aeb5526c30"
40
40
  }
@@ -1 +1,5 @@
1
- export const DEFAULT_DOMAIN = `https://jssdk.onekey.so/${process.env.VERSION}/`;
1
+ // eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-unresolved
2
+ const pkg = require('../package.json');
3
+
4
+ export const getSDKVersion = () => pkg.version;
5
+ export const DEFAULT_DOMAIN = `https://jssdk.onekey.so/${getSDKVersion()}/`;
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable vars-on-top */
2
2
 
3
3
  import type { ConnectSettings } from '../types';
4
- import { DEFAULT_DOMAIN } from '../data/config';
4
+ import { DEFAULT_DOMAIN, getSDKVersion } from '../data/config';
5
5
 
6
6
  export const DEFAULT_PRIORITY = 2;
7
7
 
@@ -19,7 +19,7 @@ const initialSettings: ConnectSettings = {
19
19
  trustedHost: false,
20
20
  connectSrc: DEFAULT_DOMAIN,
21
21
  iframeSrc: `${DEFAULT_DOMAIN}iframe.html`,
22
- parentOrigin: window && window.location ? window.location.origin : '',
22
+ parentOrigin: typeof window !== 'undefined' && window.location ? window.location.origin : '',
23
23
  supportedBrowser:
24
24
  typeof navigator !== 'undefined' ? !/Trident|MSIE|Edge/.test(navigator.userAgent) : true,
25
25
  env: 'web',
@@ -107,3 +107,5 @@ export const parseConnectSettings = (input: Partial<ConnectSettings> = {}) => {
107
107
 
108
108
  return settings;
109
109
  };
110
+
111
+ export { getSDKVersion };