@ukeyfe/hardware-web-sdk 1.1.13

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/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # `@ukeyfe/hardware-web-sdk`
2
+
3
+ `@ukeyfe/hardware-web-sdk` is a browser implementation of hardware-sdk that creates an iframe and communicates with transport through the iframe to avoid cross-domain issues.
4
+
5
+ ## Installation
6
+
7
+ Install library as npm module:
8
+
9
+ ```javascript
10
+ npm install @ukeyfe/hardware-web-sdk
11
+ ```
12
+
13
+ or
14
+
15
+ ```javascript
16
+ yarn add @ukeyfe/hardware-web-sdk
17
+ ```
18
+
19
+ ## Initialization
20
+
21
+ ```javascript
22
+ import { HardwareSDK } from '@ukeyfe/hardware-web-sdk';
23
+
24
+ function init() {
25
+ HardwareSDK.init({
26
+ debug: false,
27
+ connectSrc: 'https://jssdk.ukey.so/'
28
+ });
29
+ }
30
+ ```
31
+
32
+ ## Docs
33
+
34
+ Documentation is available [hardware-js-sdk](https://developer.ukey.so/connect-to-hardware/hardware-sdk/start)
@@ -0,0 +1,44 @@
1
+ [
2
+ { "name": "Bitcoin", "label": "BTC", "slip44": 0 },
3
+ { "name": "Regtest", "label": "REGTEST", "slip44": 1 },
4
+ { "name": "Testnet", "label": "TEST", "slip44": 1 },
5
+ { "name": "Actinium", "label": "ACM", "slip44": 228 },
6
+ { "name": "Axe", "label": "AXE", "slip44": 4242 },
7
+ { "name": "Bcash", "label": "BCH", "slip44": 145 },
8
+ { "name": "Bitcore", "label": "BTX", "slip44": 160 },
9
+ { "name": "Dash", "label": "DASH", "slip44": 5 },
10
+ { "name": "Dash Testnet", "label": "tDASH", "slip44": 1 },
11
+ { "name": "Decred", "label": "DCR", "slip44": 42 },
12
+ { "name": "Decred Testnet", "label": "TDCR", "slip44": 1 },
13
+ { "name": "DigiByte", "label": "DGB", "slip44": 20 },
14
+ { "name": "Dogecoin", "label": "DOGE", "slip44": 3 },
15
+ { "name": "Feathercoin", "label": "FTC", "slip44": 8 },
16
+ { "name": "Firo", "label": "FIRO", "slip44": 136 },
17
+ { "name": "Firo Testnet", "label": "tFIRO", "slip44": 1 },
18
+ { "name": "Fujicoin", "label": "FJC", "slip44": 75 },
19
+ { "name": "GameCredits", "label": "GAME", "slip44": 101 },
20
+ { "name": "Komodo", "label": "KMD", "slip44": 141 },
21
+ { "name": "Koto", "label": "KOTO", "slip44": 510 },
22
+ { "name": "Litecoin", "label": "LTC", "slip44": 2 },
23
+ { "name": "Litecoin Testnet", "label": "tLTC", "slip44": 1 },
24
+ { "name": "Monacoin", "label": "MONA", "slip44": 22 },
25
+ { "name": "MonetaryUnit", "label": "MUE", "slip44": 31 },
26
+ { "name": "NIX", "label": "NIX", "slip44": 400 },
27
+ { "name": "Namecoin", "label": "NMC", "slip44": 7 },
28
+ { "name": "Peercoin", "label": "PPC", "slip44": 6 },
29
+ { "name": "Peercoin Testnet", "label": "tPPC", "slip44": 1 },
30
+ { "name": "Polis", "label": "POLIS", "slip44": 1997 },
31
+ { "name": "Primecoin", "label": "XPM", "slip44": 24 },
32
+ { "name": "Ravencoin", "label": "RVN", "slip44": 175 },
33
+ { "name": "Ritocoin", "label": "RITO", "slip44": 19169 },
34
+ { "name": "Stakenet", "label": "XSN", "slip44": 199 },
35
+ { "name": "Syscoin", "label": "SYS", "slip44": 57 },
36
+ { "name": "Unobtanium", "label": "UNO", "slip44": 92 },
37
+ { "name": "Verge", "label": "XVG", "slip44": 77 },
38
+ { "name": "Vertcoin", "label": "VTC", "slip44": 28 },
39
+ { "name": "Viacoin", "label": "VIA", "slip44": 14 },
40
+ { "name": "ZCore", "label": "ZCR", "slip44": 428 },
41
+ { "name": "Zcash", "label": "ZEC", "slip44": 133 },
42
+ { "name": "Zcash Testnet", "label": "TAZ", "slip44": 1 },
43
+ { "name": "Neurai", "label": "XNA", "slip44": 1900 }
44
+ ]
@@ -0,0 +1,25 @@
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()}/`;
6
+
7
+ export const whitelist = [
8
+ // Electron local file
9
+ { origin: 'file://' },
10
+ // UKey App
11
+ { origin: '1key.so' },
12
+ { origin: 'onekey.so' },
13
+ { origin: 'onekeycn.com' },
14
+ { origin: 'onekeytest.com' },
15
+ { origin: 'localhost' },
16
+ ];
17
+
18
+ export const whitelistExtension = [
19
+ // UKey
20
+ 'jnmbobjmhlngoefaiojfljckilhhlhcj',
21
+ // Rabby
22
+ 'acmacodkjbdgmoleebolmdjonilkdbch',
23
+ // OKX
24
+ 'mcohilncbfahbmgdjkbpemcciiolgcge',
25
+ ];