@onekeyfe/hd-core 0.2.49-alpha.0 → 0.2.49

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.2.49-alpha.0",
3
+ "version": "0.2.49",
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.2.49-alpha.0",
28
- "@onekeyfe/hd-transport": "^0.2.49-alpha.0",
27
+ "@onekeyfe/hd-shared": "^0.2.49",
28
+ "@onekeyfe/hd-transport": "^0.2.49",
29
29
  "axios": "^0.27.2",
30
30
  "bignumber.js": "^9.0.2",
31
31
  "bytebuffer": "^5.0.1",
@@ -43,5 +43,5 @@
43
43
  "@types/semver": "^7.3.9",
44
44
  "ripple-keypairs": "^1.1.4"
45
45
  },
46
- "gitHead": "73d0abae059ddb37b7b1fe3afd8877eb200b2cf3"
46
+ "gitHead": "11a6405ff3dadf35e10d9f85b6796c82a04ac8b0"
47
47
  }
@@ -56,7 +56,7 @@ export default class CardanoGetAddress extends BaseMethod<CardanoGetAddressParam
56
56
  getVersionRange() {
57
57
  return {
58
58
  model_mini: {
59
- min: '2.11.0',
59
+ min: '3.0.0',
60
60
  },
61
61
  model_touch: {
62
62
  min: '4.1.0',
@@ -40,7 +40,7 @@ export default class CardanoGetPublicKey extends BaseMethod<CardanoPublicKeyPara
40
40
  getVersionRange() {
41
41
  return {
42
42
  model_mini: {
43
- min: '2.11.0',
43
+ min: '3.0.0',
44
44
  },
45
45
  model_touch: {
46
46
  min: '4.1.0',
@@ -38,7 +38,7 @@ export default class CardanoSignMessage extends BaseMethod<CardanoSignMessagePar
38
38
  getVersionRange() {
39
39
  return {
40
40
  model_mini: {
41
- min: '2.11.0',
41
+ min: '3.0.0',
42
42
  },
43
43
  model_touch: {
44
44
  min: '4.1.0',
@@ -32,7 +32,7 @@ export default class CardanoSignTransaction extends BaseMethod<any> {
32
32
  getVersionRange() {
33
33
  return {
34
34
  model_mini: {
35
- min: '2.11.0',
35
+ min: '3.0.0',
36
36
  },
37
37
  model_touch: {
38
38
  min: '4.1.0',
package/src/index.ts CHANGED
@@ -1,11 +1,6 @@
1
1
  import { inject, InjectApi } from './inject';
2
- import { lowLevelInject, LowLevelInjectApi, LowLevelCoreApi } from './lowLevelInject';
3
- import { topLevelInject } from './topLevelInject';
4
2
  import { CoreApi } from './types/api';
5
3
 
6
- export type { LowLevelCoreApi, LowLevelInjectApi } from './lowLevelInject';
7
- export type { TopLevelInjectApi } from './topLevelInject';
8
-
9
4
  export { default as Core, init as initCore } from './core';
10
5
 
11
6
  export * from './constants';
@@ -31,27 +26,4 @@ const HardwareSdk = ({
31
26
  cancel,
32
27
  });
33
28
 
34
- const HardwareSDKLowLevel = ({
35
- init,
36
- call,
37
- dispose,
38
- eventEmitter,
39
- addHardwareGlobalEventListener,
40
- uiResponse,
41
- cancel,
42
- }: LowLevelInjectApi): LowLevelCoreApi =>
43
- lowLevelInject({
44
- init,
45
- call,
46
- dispose,
47
- eventEmitter,
48
- addHardwareGlobalEventListener,
49
- uiResponse,
50
- cancel,
51
- });
52
-
53
- const HardwareTopLevelSdk = (): CoreApi => topLevelInject();
54
-
55
- export { HardwareTopLevelSdk, HardwareSDKLowLevel };
56
-
57
29
  export default HardwareSdk;
package/src/inject.ts CHANGED
@@ -24,8 +24,6 @@ export const inject = ({
24
24
  eventEmitter.on(type, fn);
25
25
  },
26
26
 
27
- emit: () => {},
28
-
29
27
  off: (type, fn) => {
30
28
  eventEmitter.removeListener(type, fn);
31
29
  },
@@ -44,207 +42,193 @@ export const inject = ({
44
42
 
45
43
  cancel,
46
44
 
47
- ...createCoreApi(call),
45
+ getLogs: () => call({ method: 'getLogs' }),
46
+ /**
47
+ * 搜索设备
48
+ */
49
+ searchDevices: () => call({ method: 'searchDevices' }),
50
+
51
+ /**
52
+ * 获取设备信息
53
+ */
54
+ getFeatures: connectId => call({ connectId, method: 'getFeatures' }),
55
+
56
+ /**
57
+ * 检查固件版本
58
+ */
59
+ checkFirmwareRelease: connectId => call({ connectId, method: 'checkFirmwareRelease' }),
60
+
61
+ /**
62
+ * 检查蓝牙固件版本
63
+ */
64
+ checkBLEFirmwareRelease: connectId => call({ connectId, method: 'checkBLEFirmwareRelease' }),
65
+
66
+ /**
67
+ * 检查 bridge 版本
68
+ */
69
+ checkTransportRelease: () => call({ method: 'checkTransportRelease' }),
70
+
71
+ /**
72
+ * 检查 Bridge 是否安装
73
+ */
74
+ checkBridgeStatus: () => call({ method: 'checkBridgeStatus' }),
75
+
76
+ checkBootloaderRelease: connectId => call({ connectId, method: 'checkBootloaderRelease' }),
77
+
78
+ cipherKeyValue: (connectId, deviceId, params) =>
79
+ call({ ...params, connectId, deviceId, method: 'cipherKeyValue' }),
80
+
81
+ deviceBackup: connectId => call({ connectId, method: 'deviceBackup' }),
82
+ deviceChangePin: (connectId, params) =>
83
+ call({ ...params, connectId, method: 'deviceChangePin' }),
84
+ deviceFlags: (connectId, params) => call({ ...params, connectId, method: 'deviceFlags' }),
85
+ deviceRebootToBoardloader: connectId =>
86
+ call({ connectId, method: 'deviceRebootToBoardloader' }),
87
+ deviceRebootToBootloader: connectId => call({ connectId, method: 'deviceRebootToBootloader' }),
88
+ deviceRecovery: (connectId, params) => call({ ...params, connectId, method: 'deviceRecovery' }),
89
+ deviceReset: (connectId, params) => call({ ...params, connectId, method: 'deviceReset' }),
90
+ deviceSettings: (connectId, params) => call({ ...params, connectId, method: 'deviceSettings' }),
91
+ deviceUpdateReboot: connectId => call({ connectId, method: 'deviceUpdateReboot' }),
92
+ deviceUploadResource: (connectId, params) =>
93
+ call({ ...params, connectId, method: 'deviceUploadResource' }),
94
+ deviceSupportFeatures: connectId => call({ connectId, method: 'deviceSupportFeatures' }),
95
+ deviceVerify: (connectId, params) => call({ ...params, connectId, method: 'deviceVerify' }),
96
+ deviceWipe: connectId => call({ connectId, method: 'deviceWipe' }),
97
+ deviceFullyUploadResource: connectId =>
98
+ call({ connectId, method: 'deviceFullyUploadResource' }),
99
+ deviceUpdateBootloader: connectId => call({ connectId, method: 'deviceUpdateBootloader' }),
100
+ getPassphraseState: (connectId, params) =>
101
+ call({ ...params, connectId, method: 'getPassphraseState' }),
102
+
103
+ evmGetAddress: (connectId, deviceId, params) =>
104
+ call({ ...params, connectId, deviceId, method: 'evmGetAddress' }),
105
+ evmGetPublicKey: (connectId, deviceId, params) =>
106
+ call({ ...params, connectId, deviceId, method: 'evmGetPublicKey' }),
107
+ evmSignMessage: (connectId, deviceId, params) =>
108
+ call({ ...params, connectId, deviceId, method: 'evmSignMessage' }),
109
+ evmSignMessageEIP712: (connectId, deviceId, params) =>
110
+ call({ ...params, connectId, deviceId, method: 'evmSignMessageEIP712' }),
111
+ evmSignTransaction: (connectId, deviceId, params) =>
112
+ call({ ...params, connectId, deviceId, method: 'evmSignTransaction' }),
113
+ evmSignTypedData: (connectId, deviceId, params) =>
114
+ call({ ...params, connectId, deviceId, method: 'evmSignTypedData' }),
115
+ evmVerifyMessage: (connectId, deviceId, params) =>
116
+ call({ ...params, connectId, deviceId, method: 'evmVerifyMessage' }),
117
+
118
+ btcGetAddress: (connectId, deviceId, params) =>
119
+ call({ ...params, connectId, deviceId, method: 'btcGetAddress' }),
120
+ btcGetPublicKey: (connectId, deviceId, params) =>
121
+ call({ ...params, connectId, deviceId, method: 'btcGetPublicKey' }),
122
+ btcSignMessage: (connectId, deviceId, params) =>
123
+ call({ ...params, connectId, deviceId, method: 'btcSignMessage' }),
124
+ btcSignTransaction: (connectId, deviceId, params) =>
125
+ call({ ...params, connectId, deviceId, method: 'btcSignTransaction' }),
126
+ btcVerifyMessage: (connectId, deviceId, params) =>
127
+ call({ ...params, connectId, deviceId, method: 'btcVerifyMessage' }),
128
+
129
+ starcoinGetAddress: (connectId, deviceId, params) =>
130
+ call({ ...params, connectId, deviceId, method: 'starcoinGetAddress' }),
131
+ starcoinGetPublicKey: (connectId, deviceId, params) =>
132
+ call({ ...params, connectId, deviceId, method: 'starcoinGetPublicKey' }),
133
+ starcoinSignMessage: (connectId, deviceId, params) =>
134
+ call({ ...params, connectId, deviceId, method: 'starcoinSignMessage' }),
135
+ starcoinSignTransaction: (connectId, deviceId, params) =>
136
+ call({ ...params, connectId, deviceId, method: 'starcoinSignTransaction' }),
137
+ starcoinVerifyMessage: (connectId, deviceId, params) =>
138
+ call({ ...params, connectId, deviceId, method: 'starcoinVerifyMessage' }),
139
+
140
+ nemGetAddress: (connectId, deviceId, params) =>
141
+ call({ ...params, connectId, deviceId, method: 'nemGetAddress' }),
142
+ nemSignTransaction: (connectId, deviceId, params) =>
143
+ call({ ...params, connectId, deviceId, method: 'nemSignTransaction' }),
144
+
145
+ solGetAddress: (connectId, deviceId, params) =>
146
+ call({ ...params, connectId, deviceId, method: 'solGetAddress' }),
147
+ solSignTransaction: (connectId, deviceId, params) =>
148
+ call({ ...params, connectId, deviceId, method: 'solSignTransaction' }),
149
+
150
+ stellarGetAddress: (connectId, deviceId, params) =>
151
+ call({ ...params, connectId, deviceId, method: 'stellarGetAddress' }),
152
+ stellarSignTransaction: (connectId, deviceId, params) =>
153
+ call({ ...params, connectId, deviceId, method: 'stellarSignTransaction' }),
154
+
155
+ firmwareUpdate: (connectId, params) => call({ ...params, connectId, method: 'firmwareUpdate' }),
156
+ firmwareUpdateV2: (connectId, params) =>
157
+ call({ ...params, connectId, method: 'firmwareUpdateV2' }),
158
+ requestWebUsbDevice: () => call({ method: 'requestWebUsbDevice' }),
159
+
160
+ tronGetAddress: (connectId, deviceId, params) =>
161
+ call({ ...params, connectId, deviceId, method: 'tronGetAddress' }),
162
+ tronSignMessage: (connectId, deviceId, params) =>
163
+ call({ ...params, connectId, deviceId, method: 'tronSignMessage' }),
164
+ tronSignTransaction: (connectId, deviceId, params) =>
165
+ call({ ...params, connectId, deviceId, method: 'tronSignTransaction' }),
166
+
167
+ confluxGetAddress: (connectId, deviceId, params) =>
168
+ call({ ...params, connectId, deviceId, method: 'confluxGetAddress' }),
169
+ confluxSignMessage: (connectId, deviceId, params) =>
170
+ call({ ...params, connectId, deviceId, method: 'confluxSignMessage' }),
171
+ confluxSignMessageCIP23: (connectId, deviceId, params) =>
172
+ call({ ...params, connectId, deviceId, method: 'confluxSignMessageCIP23' }),
173
+ confluxSignTransaction: (connectId, deviceId, params) =>
174
+ call({ ...params, connectId, deviceId, method: 'confluxSignTransaction' }),
175
+
176
+ nearGetAddress: (connectId, deviceId, params) =>
177
+ call({ ...params, connectId, deviceId, method: 'nearGetAddress' }),
178
+ nearSignTransaction: (connectId, deviceId, params) =>
179
+ call({ ...params, connectId, deviceId, method: 'nearSignTransaction' }),
180
+
181
+ aptosGetAddress: (connectId, deviceId, params) =>
182
+ call({ ...params, connectId, deviceId, method: 'aptosGetAddress' }),
183
+ aptosGetPublicKey: (connectId, deviceId, params) =>
184
+ call({ ...params, connectId, deviceId, method: 'aptosGetPublicKey' }),
185
+ aptosSignMessage: (connectId, deviceId, params) =>
186
+ call({ ...params, connectId, deviceId, method: 'aptosSignMessage' }),
187
+ aptosSignTransaction: (connectId, deviceId, params) =>
188
+ call({ ...params, connectId, deviceId, method: 'aptosSignTransaction' }),
189
+
190
+ algoGetAddress: (connectId, deviceId, params) =>
191
+ call({ ...params, connectId, deviceId, method: 'algoGetAddress' }),
192
+ algoSignTransaction: (connectId, deviceId, params) =>
193
+ call({ ...params, connectId, deviceId, method: 'algoSignTransaction' }),
194
+
195
+ cosmosGetAddress: (connectId, deviceId, params) =>
196
+ call({ ...params, connectId, deviceId, method: 'cosmosGetAddress' }),
197
+ cosmosGetPublicKey: (connectId, deviceId, params) =>
198
+ call({ ...params, connectId, deviceId, method: 'cosmosGetPublicKey' }),
199
+ cosmosSignTransaction: (connectId, deviceId, params) =>
200
+ call({ ...params, connectId, deviceId, method: 'cosmosSignTransaction' }),
201
+
202
+ xrpGetAddress: (connectId, deviceId, params) =>
203
+ call({ ...params, connectId, deviceId, method: 'xrpGetAddress' }),
204
+ xrpSignTransaction: (connectId, deviceId, params) =>
205
+ call({ ...params, connectId, deviceId, method: 'xrpSignTransaction' }),
206
+
207
+ suiGetAddress: (connectId, deviceId, params) =>
208
+ call({ ...params, connectId, deviceId, method: 'suiGetAddress' }),
209
+ suiGetPublicKey: (connectId, deviceId, params) =>
210
+ call({ ...params, connectId, deviceId, method: 'suiGetPublicKey' }),
211
+ suiSignTransaction: (connectId, deviceId, params) =>
212
+ call({ ...params, connectId, deviceId, method: 'suiSignTransaction' }),
213
+
214
+ cardanoGetAddress: (connectId, deviceId, params) =>
215
+ call({ ...params, connectId, deviceId, method: 'cardanoGetAddress' }),
216
+ cardanoGetPublicKey: (connectId, deviceId, params) =>
217
+ call({ ...params, connectId, deviceId, method: 'cardanoGetPublicKey' }),
218
+ cardanoSignTransaction: (connectId, deviceId, params) =>
219
+ call({ ...params, connectId, deviceId, method: 'cardanoSignTransaction' }),
220
+ cardanoSignMessage: (connectId, deviceId, params) =>
221
+ call({ ...params, connectId, deviceId, method: 'cardanoSignMessage' }),
222
+
223
+ filecoinGetAddress: (connectId, deviceId, params) =>
224
+ call({ ...params, connectId, deviceId, method: 'filecoinGetAddress' }),
225
+ filecoinSignTransaction: (connectId, deviceId, params) =>
226
+ call({ ...params, connectId, deviceId, method: 'filecoinSignTransaction' }),
227
+
228
+ polkadotGetAddress: (connectId, deviceId, params) =>
229
+ call({ ...params, connectId, deviceId, method: 'polkadotGetAddress' }),
230
+ polkadotSignTransaction: (connectId, deviceId, params) =>
231
+ call({ ...params, connectId, deviceId, method: 'polkadotSignTransaction' }),
48
232
  };
49
233
  return api;
50
234
  };
51
-
52
- export const createCoreApi = (
53
- call: CoreApi['call']
54
- ): Omit<
55
- CoreApi,
56
- | 'on'
57
- | 'off'
58
- | 'emit'
59
- | 'removeAllListeners'
60
- | 'init'
61
- | 'call'
62
- | 'dispose'
63
- | 'uiResponse'
64
- | 'cancel'
65
- > => ({
66
- getLogs: () => call({ method: 'getLogs' }),
67
- /**
68
- * 搜索设备
69
- */
70
- searchDevices: () => call({ method: 'searchDevices' }),
71
-
72
- /**
73
- * 获取设备信息
74
- */
75
- getFeatures: connectId => call({ connectId, method: 'getFeatures' }),
76
-
77
- /**
78
- * 检查固件版本
79
- */
80
- checkFirmwareRelease: connectId => call({ connectId, method: 'checkFirmwareRelease' }),
81
-
82
- /**
83
- * 检查蓝牙固件版本
84
- */
85
- checkBLEFirmwareRelease: connectId => call({ connectId, method: 'checkBLEFirmwareRelease' }),
86
-
87
- /**
88
- * 检查 bridge 版本
89
- */
90
- checkTransportRelease: () => call({ method: 'checkTransportRelease' }),
91
-
92
- /**
93
- * 检查 Bridge 是否安装
94
- */
95
- checkBridgeStatus: () => call({ method: 'checkBridgeStatus' }),
96
-
97
- checkBootloaderRelease: connectId => call({ connectId, method: 'checkBootloaderRelease' }),
98
-
99
- cipherKeyValue: (connectId, deviceId, params) =>
100
- call({ ...params, connectId, deviceId, method: 'cipherKeyValue' }),
101
-
102
- deviceBackup: connectId => call({ connectId, method: 'deviceBackup' }),
103
- deviceChangePin: (connectId, params) => call({ ...params, connectId, method: 'deviceChangePin' }),
104
- deviceFlags: (connectId, params) => call({ ...params, connectId, method: 'deviceFlags' }),
105
- deviceRebootToBoardloader: connectId => call({ connectId, method: 'deviceRebootToBoardloader' }),
106
- deviceRebootToBootloader: connectId => call({ connectId, method: 'deviceRebootToBootloader' }),
107
- deviceRecovery: (connectId, params) => call({ ...params, connectId, method: 'deviceRecovery' }),
108
- deviceReset: (connectId, params) => call({ ...params, connectId, method: 'deviceReset' }),
109
- deviceSettings: (connectId, params) => call({ ...params, connectId, method: 'deviceSettings' }),
110
- deviceUpdateReboot: connectId => call({ connectId, method: 'deviceUpdateReboot' }),
111
- deviceUploadResource: (connectId, params) =>
112
- call({ ...params, connectId, method: 'deviceUploadResource' }),
113
- deviceSupportFeatures: connectId => call({ connectId, method: 'deviceSupportFeatures' }),
114
- deviceVerify: (connectId, params) => call({ ...params, connectId, method: 'deviceVerify' }),
115
- deviceWipe: connectId => call({ connectId, method: 'deviceWipe' }),
116
- deviceFullyUploadResource: connectId => call({ connectId, method: 'deviceFullyUploadResource' }),
117
- deviceUpdateBootloader: connectId => call({ connectId, method: 'deviceUpdateBootloader' }),
118
- getPassphraseState: (connectId, params) =>
119
- call({ ...params, connectId, method: 'getPassphraseState' }),
120
-
121
- evmGetAddress: (connectId, deviceId, params) =>
122
- call({ ...params, connectId, deviceId, method: 'evmGetAddress' }),
123
- evmGetPublicKey: (connectId, deviceId, params) =>
124
- call({ ...params, connectId, deviceId, method: 'evmGetPublicKey' }),
125
- evmSignMessage: (connectId, deviceId, params) =>
126
- call({ ...params, connectId, deviceId, method: 'evmSignMessage' }),
127
- evmSignMessageEIP712: (connectId, deviceId, params) =>
128
- call({ ...params, connectId, deviceId, method: 'evmSignMessageEIP712' }),
129
- evmSignTransaction: (connectId, deviceId, params) =>
130
- call({ ...params, connectId, deviceId, method: 'evmSignTransaction' }),
131
- evmSignTypedData: (connectId, deviceId, params) =>
132
- call({ ...params, connectId, deviceId, method: 'evmSignTypedData' }),
133
- evmVerifyMessage: (connectId, deviceId, params) =>
134
- call({ ...params, connectId, deviceId, method: 'evmVerifyMessage' }),
135
-
136
- btcGetAddress: (connectId, deviceId, params) =>
137
- call({ ...params, connectId, deviceId, method: 'btcGetAddress' }),
138
- btcGetPublicKey: (connectId, deviceId, params) =>
139
- call({ ...params, connectId, deviceId, method: 'btcGetPublicKey' }),
140
- btcSignMessage: (connectId, deviceId, params) =>
141
- call({ ...params, connectId, deviceId, method: 'btcSignMessage' }),
142
- btcSignTransaction: (connectId, deviceId, params) =>
143
- call({ ...params, connectId, deviceId, method: 'btcSignTransaction' }),
144
- btcVerifyMessage: (connectId, deviceId, params) =>
145
- call({ ...params, connectId, deviceId, method: 'btcVerifyMessage' }),
146
-
147
- starcoinGetAddress: (connectId, deviceId, params) =>
148
- call({ ...params, connectId, deviceId, method: 'starcoinGetAddress' }),
149
- starcoinGetPublicKey: (connectId, deviceId, params) =>
150
- call({ ...params, connectId, deviceId, method: 'starcoinGetPublicKey' }),
151
- starcoinSignMessage: (connectId, deviceId, params) =>
152
- call({ ...params, connectId, deviceId, method: 'starcoinSignMessage' }),
153
- starcoinSignTransaction: (connectId, deviceId, params) =>
154
- call({ ...params, connectId, deviceId, method: 'starcoinSignTransaction' }),
155
- starcoinVerifyMessage: (connectId, deviceId, params) =>
156
- call({ ...params, connectId, deviceId, method: 'starcoinVerifyMessage' }),
157
-
158
- nemGetAddress: (connectId, deviceId, params) =>
159
- call({ ...params, connectId, deviceId, method: 'nemGetAddress' }),
160
- nemSignTransaction: (connectId, deviceId, params) =>
161
- call({ ...params, connectId, deviceId, method: 'nemSignTransaction' }),
162
-
163
- solGetAddress: (connectId, deviceId, params) =>
164
- call({ ...params, connectId, deviceId, method: 'solGetAddress' }),
165
- solSignTransaction: (connectId, deviceId, params) =>
166
- call({ ...params, connectId, deviceId, method: 'solSignTransaction' }),
167
-
168
- stellarGetAddress: (connectId, deviceId, params) =>
169
- call({ ...params, connectId, deviceId, method: 'stellarGetAddress' }),
170
- stellarSignTransaction: (connectId, deviceId, params) =>
171
- call({ ...params, connectId, deviceId, method: 'stellarSignTransaction' }),
172
-
173
- firmwareUpdate: (connectId, params) => call({ ...params, connectId, method: 'firmwareUpdate' }),
174
- firmwareUpdateV2: (connectId, params) =>
175
- call({ ...params, connectId, method: 'firmwareUpdateV2' }),
176
- requestWebUsbDevice: () => call({ method: 'requestWebUsbDevice' }),
177
-
178
- tronGetAddress: (connectId, deviceId, params) =>
179
- call({ ...params, connectId, deviceId, method: 'tronGetAddress' }),
180
- tronSignMessage: (connectId, deviceId, params) =>
181
- call({ ...params, connectId, deviceId, method: 'tronSignMessage' }),
182
- tronSignTransaction: (connectId, deviceId, params) =>
183
- call({ ...params, connectId, deviceId, method: 'tronSignTransaction' }),
184
-
185
- confluxGetAddress: (connectId, deviceId, params) =>
186
- call({ ...params, connectId, deviceId, method: 'confluxGetAddress' }),
187
- confluxSignMessage: (connectId, deviceId, params) =>
188
- call({ ...params, connectId, deviceId, method: 'confluxSignMessage' }),
189
- confluxSignMessageCIP23: (connectId, deviceId, params) =>
190
- call({ ...params, connectId, deviceId, method: 'confluxSignMessageCIP23' }),
191
- confluxSignTransaction: (connectId, deviceId, params) =>
192
- call({ ...params, connectId, deviceId, method: 'confluxSignTransaction' }),
193
-
194
- nearGetAddress: (connectId, deviceId, params) =>
195
- call({ ...params, connectId, deviceId, method: 'nearGetAddress' }),
196
- nearSignTransaction: (connectId, deviceId, params) =>
197
- call({ ...params, connectId, deviceId, method: 'nearSignTransaction' }),
198
-
199
- aptosGetAddress: (connectId, deviceId, params) =>
200
- call({ ...params, connectId, deviceId, method: 'aptosGetAddress' }),
201
- aptosGetPublicKey: (connectId, deviceId, params) =>
202
- call({ ...params, connectId, deviceId, method: 'aptosGetPublicKey' }),
203
- aptosSignMessage: (connectId, deviceId, params) =>
204
- call({ ...params, connectId, deviceId, method: 'aptosSignMessage' }),
205
- aptosSignTransaction: (connectId, deviceId, params) =>
206
- call({ ...params, connectId, deviceId, method: 'aptosSignTransaction' }),
207
-
208
- algoGetAddress: (connectId, deviceId, params) =>
209
- call({ ...params, connectId, deviceId, method: 'algoGetAddress' }),
210
- algoSignTransaction: (connectId, deviceId, params) =>
211
- call({ ...params, connectId, deviceId, method: 'algoSignTransaction' }),
212
-
213
- cosmosGetAddress: (connectId, deviceId, params) =>
214
- call({ ...params, connectId, deviceId, method: 'cosmosGetAddress' }),
215
- cosmosGetPublicKey: (connectId, deviceId, params) =>
216
- call({ ...params, connectId, deviceId, method: 'cosmosGetPublicKey' }),
217
- cosmosSignTransaction: (connectId, deviceId, params) =>
218
- call({ ...params, connectId, deviceId, method: 'cosmosSignTransaction' }),
219
-
220
- xrpGetAddress: (connectId, deviceId, params) =>
221
- call({ ...params, connectId, deviceId, method: 'xrpGetAddress' }),
222
- xrpSignTransaction: (connectId, deviceId, params) =>
223
- call({ ...params, connectId, deviceId, method: 'xrpSignTransaction' }),
224
-
225
- suiGetAddress: (connectId, deviceId, params) =>
226
- call({ ...params, connectId, deviceId, method: 'suiGetAddress' }),
227
- suiGetPublicKey: (connectId, deviceId, params) =>
228
- call({ ...params, connectId, deviceId, method: 'suiGetPublicKey' }),
229
- suiSignTransaction: (connectId, deviceId, params) =>
230
- call({ ...params, connectId, deviceId, method: 'suiSignTransaction' }),
231
-
232
- cardanoGetAddress: (connectId, deviceId, params) =>
233
- call({ ...params, connectId, deviceId, method: 'cardanoGetAddress' }),
234
- cardanoGetPublicKey: (connectId, deviceId, params) =>
235
- call({ ...params, connectId, deviceId, method: 'cardanoGetPublicKey' }),
236
- cardanoSignTransaction: (connectId, deviceId, params) =>
237
- call({ ...params, connectId, deviceId, method: 'cardanoSignTransaction' }),
238
- cardanoSignMessage: (connectId, deviceId, params) =>
239
- call({ ...params, connectId, deviceId, method: 'cardanoSignMessage' }),
240
-
241
- filecoinGetAddress: (connectId, deviceId, params) =>
242
- call({ ...params, connectId, deviceId, method: 'filecoinGetAddress' }),
243
- filecoinSignTransaction: (connectId, deviceId, params) =>
244
- call({ ...params, connectId, deviceId, method: 'filecoinSignTransaction' }),
245
-
246
- polkadotGetAddress: (connectId, deviceId, params) =>
247
- call({ ...params, connectId, deviceId, method: 'polkadotGetAddress' }),
248
- polkadotSignTransaction: (connectId, deviceId, params) =>
249
- call({ ...params, connectId, deviceId, method: 'polkadotSignTransaction' }),
250
- });
@@ -113,7 +113,6 @@ export type CoreApi = {
113
113
  init: typeof init;
114
114
  on: typeof on;
115
115
  off: typeof off;
116
- emit: (event: string, ...args: any[]) => void;
117
116
  removeAllListeners: typeof removeAllListeners;
118
117
  dispose: () => void;
119
118
  call: (params: any) => Promise<any>;
@@ -1,7 +1,3 @@
1
- import { LowLevelCoreApi } from '../../lowLevelInject';
2
1
  import type { ConnectSettings } from '../settings';
3
2
 
4
- export declare function init(
5
- settings: Partial<ConnectSettings>,
6
- lowLevelApi?: LowLevelCoreApi
7
- ): Promise<boolean>;
3
+ export declare function init(settings: Partial<ConnectSettings>): Promise<boolean>;
@@ -1,20 +0,0 @@
1
- /// <reference types="node" />
2
- import { EventEmitter } from 'events';
3
- import { CallMethod, CoreMessage } from './events';
4
- import { CoreApi } from './types/api';
5
- declare type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
6
- export interface LowLevelInjectApi {
7
- call: CallMethod;
8
- eventEmitter: EventEmitter;
9
- init: CoreApi['init'];
10
- dispose: CoreApi['dispose'];
11
- uiResponse: CoreApi['uiResponse'];
12
- cancel: CoreApi['cancel'];
13
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
14
- }
15
- export declare type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
16
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
17
- };
18
- export declare const lowLevelInject: ({ call, cancel, dispose, eventEmitter, init, uiResponse, addHardwareGlobalEventListener, }: LowLevelInjectApi) => LowLevelCoreApi;
19
- export {};
20
- //# sourceMappingURL=lowLevelInject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lowLevelInject.d.ts","sourceRoot":"","sources":["../src/lowLevelInject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,aAAK,+BAA+B,GAAG,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,8BAA8B,EAAE,CAAC,QAAQ,EAAE,+BAA+B,KAAK,IAAI,CAAC;CACrF;AAED,oBAAY,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,KAAK,CAAC,GAAG;IAC1D,8BAA8B,EAAE,CAAC,QAAQ,EAAE,+BAA+B,KAAK,IAAI,CAAC;CACrF,CAAC;AAEF,eAAO,MAAM,cAAc,+FAQxB,iBAAiB,KAAG,eAsBtB,CAAC"}
@@ -1,7 +0,0 @@
1
- import { CoreApi } from './types/api';
2
- export interface TopLevelInjectApi {
3
- init: CoreApi['init'];
4
- call: CoreApi['call'];
5
- }
6
- export declare const topLevelInject: () => CoreApi;
7
- //# sourceMappingURL=topLevelInject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"topLevelInject.d.ts","sourceRoot":"","sources":["../src/topLevelInject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACvB;AAMD,eAAO,MAAM,cAAc,eAwC1B,CAAC"}
@@ -1,52 +0,0 @@
1
- import { EventEmitter } from 'events';
2
- import { CallMethod, CoreMessage } from './events';
3
- import { CoreApi } from './types/api';
4
- import { createCoreApi } from './inject';
5
-
6
- type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
7
-
8
- export interface LowLevelInjectApi {
9
- call: CallMethod;
10
- eventEmitter: EventEmitter;
11
- init: CoreApi['init'];
12
- dispose: CoreApi['dispose'];
13
- uiResponse: CoreApi['uiResponse'];
14
- cancel: CoreApi['cancel'];
15
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
16
- }
17
-
18
- export type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
19
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
20
- };
21
-
22
- export const lowLevelInject = ({
23
- call,
24
- cancel,
25
- dispose,
26
- eventEmitter,
27
- init,
28
- uiResponse,
29
- addHardwareGlobalEventListener,
30
- }: LowLevelInjectApi): LowLevelCoreApi => {
31
- const api: LowLevelCoreApi = {
32
- addHardwareGlobalEventListener,
33
- removeAllListeners: type => {
34
- eventEmitter.removeAllListeners(type);
35
- },
36
-
37
- init,
38
-
39
- call,
40
-
41
- dispose,
42
-
43
- uiResponse,
44
-
45
- cancel,
46
-
47
- emit: () => {},
48
-
49
- ...createCoreApi(call),
50
- };
51
- return api;
52
- };