@onekeyfe/hd-core 0.0.1 → 0.0.4

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.
Files changed (195) hide show
  1. package/dist/api/GetFeatures.d.ts +1 -0
  2. package/dist/api/GetFeatures.d.ts.map +1 -1
  3. package/dist/api/SearchDevices.d.ts +1 -0
  4. package/dist/api/SearchDevices.d.ts.map +1 -1
  5. package/dist/api/btc/BTCGetAddress.d.ts +9 -0
  6. package/dist/api/btc/BTCGetAddress.d.ts.map +1 -0
  7. package/dist/api/btc/BTCGetPublicKey.d.ts +9 -0
  8. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -0
  9. package/dist/api/{BTCSignMessage.d.ts → btc/BTCSignMessage.d.ts} +1 -1
  10. package/dist/api/btc/BTCSignMessage.d.ts.map +1 -0
  11. package/dist/api/{BTCSignTransaction.d.ts → btc/BTCSignTransaction.d.ts} +3 -3
  12. package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -0
  13. package/dist/api/{BTCVerifyMessage.d.ts → btc/BTCVerifyMessage.d.ts} +1 -1
  14. package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -0
  15. package/dist/api/{helpers → btc/helpers}/btcParamsUtils.d.ts +0 -0
  16. package/dist/api/btc/helpers/btcParamsUtils.d.ts.map +1 -0
  17. package/dist/api/{helpers/btc → btc/helpers}/signtx.d.ts +0 -0
  18. package/dist/api/{helpers/btc → btc/helpers}/signtx.d.ts.map +1 -1
  19. package/dist/api/{helpers/btc → btc/helpers}/signtxLegacy.d.ts +0 -0
  20. package/dist/api/{helpers/btc → btc/helpers}/signtxLegacy.d.ts.map +1 -1
  21. package/dist/api/{DeviceBackup.d.ts → device/DeviceBackup.d.ts} +1 -1
  22. package/dist/api/device/DeviceBackup.d.ts.map +1 -0
  23. package/dist/api/{DeviceChangePin.d.ts → device/DeviceChangePin.d.ts} +1 -1
  24. package/dist/api/device/DeviceChangePin.d.ts.map +1 -0
  25. package/dist/api/{DeviceFlags.d.ts → device/DeviceFlags.d.ts} +1 -1
  26. package/dist/api/device/DeviceFlags.d.ts.map +1 -0
  27. package/dist/api/{DeviceRebootToBootloader.d.ts → device/DeviceRebootToBootloader.d.ts} +1 -1
  28. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -0
  29. package/dist/api/{DeviceRecovery.d.ts → device/DeviceRecovery.d.ts} +1 -1
  30. package/dist/api/device/DeviceRecovery.d.ts.map +1 -0
  31. package/dist/api/{DeviceReset.d.ts → device/DeviceReset.d.ts} +1 -1
  32. package/dist/api/device/DeviceReset.d.ts.map +1 -0
  33. package/dist/api/{DeviceSettings.d.ts → device/DeviceSettings.d.ts} +1 -1
  34. package/dist/api/device/DeviceSettings.d.ts.map +1 -0
  35. package/dist/api/{DeviceUpdateReboot.d.ts → device/DeviceUpdateReboot.d.ts} +1 -1
  36. package/dist/api/device/DeviceUpdateReboot.d.ts.map +1 -0
  37. package/dist/api/{DeviceWipe.d.ts → device/DeviceWipe.d.ts} +1 -1
  38. package/dist/api/device/DeviceWipe.d.ts.map +1 -0
  39. package/dist/api/evm/EVMGetAddress.d.ts +9 -0
  40. package/dist/api/evm/EVMGetAddress.d.ts.map +1 -0
  41. package/dist/api/evm/EVMGetPublicKey.d.ts +9 -0
  42. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -0
  43. package/dist/api/{EVMSignMessage.d.ts → evm/EVMSignMessage.d.ts} +1 -1
  44. package/dist/api/evm/EVMSignMessage.d.ts.map +1 -0
  45. package/dist/api/{EVMSignMessageEIP712.d.ts → evm/EVMSignMessageEIP712.d.ts} +1 -1
  46. package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -0
  47. package/dist/api/{EVMSignTransaction.d.ts → evm/EVMSignTransaction.d.ts} +2 -8
  48. package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -0
  49. package/dist/api/{EVMSignTypedData.d.ts → evm/EVMSignTypedData.d.ts} +3 -3
  50. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -0
  51. package/dist/api/{EVMVerifyMessage.d.ts → evm/EVMVerifyMessage.d.ts} +1 -1
  52. package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -0
  53. package/dist/api/helpers/pathUtils.d.ts +1 -0
  54. package/dist/api/helpers/pathUtils.d.ts.map +1 -1
  55. package/dist/api/index.d.ts +26 -21
  56. package/dist/api/index.d.ts.map +1 -1
  57. package/dist/api/starcoin/StarcoinGetAddress.d.ts +9 -0
  58. package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -0
  59. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts +9 -0
  60. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -0
  61. package/dist/api/starcoin/StarcoinSignMessage.d.ts +10 -0
  62. package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -0
  63. package/dist/api/starcoin/StarcoinSignTransaction.d.ts +10 -0
  64. package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -0
  65. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts +9 -0
  66. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts.map +1 -0
  67. package/dist/core/index.d.ts.map +1 -1
  68. package/dist/device/Device.d.ts.map +1 -1
  69. package/dist/events/core.d.ts +2 -1
  70. package/dist/events/core.d.ts.map +1 -1
  71. package/dist/events/device.d.ts +15 -0
  72. package/dist/events/device.d.ts.map +1 -1
  73. package/dist/events/ui-request.d.ts +13 -1
  74. package/dist/events/ui-request.d.ts.map +1 -1
  75. package/dist/index.d.ts +204 -42
  76. package/dist/index.js +253 -48
  77. package/dist/inject.d.ts.map +1 -1
  78. package/dist/types/api/btcGetAddress.d.ts +5 -2
  79. package/dist/types/api/btcGetAddress.d.ts.map +1 -1
  80. package/dist/types/api/btcGetPublicKey.d.ts +5 -2
  81. package/dist/types/api/btcGetPublicKey.d.ts.map +1 -1
  82. package/dist/types/api/deviceSettings.d.ts +2 -2
  83. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  84. package/dist/types/api/evmGetAddress.d.ts +6 -3
  85. package/dist/types/api/evmGetAddress.d.ts.map +1 -1
  86. package/dist/types/api/evmGetPublicKey.d.ts +5 -2
  87. package/dist/types/api/evmGetPublicKey.d.ts.map +1 -1
  88. package/dist/types/api/evmSignTransaction.d.ts +8 -4
  89. package/dist/types/api/evmSignTransaction.d.ts.map +1 -1
  90. package/dist/types/api/export.d.ts +22 -0
  91. package/dist/types/api/export.d.ts.map +1 -0
  92. package/dist/types/api/index.d.ts +11 -0
  93. package/dist/types/api/index.d.ts.map +1 -1
  94. package/dist/types/api/init.d.ts +1 -1
  95. package/dist/types/api/init.d.ts.map +1 -1
  96. package/dist/types/api/searchDevices.d.ts +2 -2
  97. package/dist/types/api/searchDevices.d.ts.map +1 -1
  98. package/dist/types/api/starcoinGetAddress.d.ts +14 -0
  99. package/dist/types/api/starcoinGetAddress.d.ts.map +1 -0
  100. package/dist/types/api/starcoinGetPublicKey.d.ts +14 -0
  101. package/dist/types/api/starcoinGetPublicKey.d.ts.map +1 -0
  102. package/dist/types/api/starcoinSignMessage.d.ts +8 -0
  103. package/dist/types/api/starcoinSignMessage.d.ts.map +1 -0
  104. package/dist/types/api/starcoinSignTransaction.d.ts +8 -0
  105. package/dist/types/api/starcoinSignTransaction.d.ts.map +1 -0
  106. package/dist/types/api/starcoinVerifyMessage.d.ts +9 -0
  107. package/dist/types/api/starcoinVerifyMessage.d.ts.map +1 -0
  108. package/dist/types/device.d.ts +8 -0
  109. package/dist/types/device.d.ts.map +1 -1
  110. package/dist/utils/deviceFeaturesUtils.d.ts +1 -0
  111. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  112. package/dist/utils/index.d.ts +1 -0
  113. package/dist/utils/index.d.ts.map +1 -1
  114. package/package.json +3 -3
  115. package/src/api/SearchDevices.ts +6 -1
  116. package/src/api/{BTCGetAddress.ts → btc/BTCGetAddress.ts} +11 -8
  117. package/src/api/{BTCGetPublicKey.ts → btc/BTCGetPublicKey.ts} +12 -8
  118. package/src/api/{BTCSignMessage.ts → btc/BTCSignMessage.ts} +5 -5
  119. package/src/api/{BTCSignTransaction.ts → btc/BTCSignTransaction.ts} +8 -8
  120. package/src/api/{BTCVerifyMessage.ts → btc/BTCVerifyMessage.ts} +4 -4
  121. package/src/api/{helpers → btc/helpers}/btcParamsUtils.ts +3 -3
  122. package/src/api/{helpers/btc → btc/helpers}/signtx.ts +0 -0
  123. package/src/api/{helpers/btc → btc/helpers}/signtxLegacy.ts +0 -0
  124. package/src/api/{DeviceBackup.ts → device/DeviceBackup.ts} +1 -1
  125. package/src/api/{DeviceChangePin.ts → device/DeviceChangePin.ts} +2 -2
  126. package/src/api/{DeviceFlags.ts → device/DeviceFlags.ts} +2 -2
  127. package/src/api/{DeviceRebootToBootloader.ts → device/DeviceRebootToBootloader.ts} +1 -1
  128. package/src/api/{DeviceRecovery.ts → device/DeviceRecovery.ts} +2 -2
  129. package/src/api/{DeviceReset.ts → device/DeviceReset.ts} +2 -2
  130. package/src/api/{DeviceSettings.ts → device/DeviceSettings.ts} +2 -2
  131. package/src/api/{DeviceUpdateReboot.ts → device/DeviceUpdateReboot.ts} +1 -1
  132. package/src/api/{DeviceWipe.ts → device/DeviceWipe.ts} +1 -1
  133. package/src/api/{EVMGetAddress.ts → evm/EVMGetAddress.ts} +13 -8
  134. package/src/api/{EVMGetPublicKey.ts → evm/EVMGetPublicKey.ts} +11 -8
  135. package/src/api/{EVMSignMessage.ts → evm/EVMSignMessage.ts} +5 -5
  136. package/src/api/{EVMSignMessageEIP712.ts → evm/EVMSignMessageEIP712.ts} +5 -5
  137. package/src/api/{EVMSignTransaction.ts → evm/EVMSignTransaction.ts} +10 -15
  138. package/src/api/{EVMSignTypedData.ts → evm/EVMSignTypedData.ts} +8 -8
  139. package/src/api/{EVMVerifyMessage.ts → evm/EVMVerifyMessage.ts} +4 -4
  140. package/src/api/helpers/pathUtils.ts +13 -0
  141. package/src/api/index.ts +26 -21
  142. package/src/api/starcoin/StarcoinGetAddress.ts +57 -0
  143. package/src/api/starcoin/StarcoinGetPublicKey.ts +64 -0
  144. package/src/api/starcoin/StarcoinSignMessage.ts +40 -0
  145. package/src/api/starcoin/StarcoinSignTransaction.ts +36 -0
  146. package/src/api/starcoin/StarcoinVerifyMessage.ts +33 -0
  147. package/src/core/index.ts +25 -0
  148. package/src/device/Device.ts +4 -0
  149. package/src/events/core.ts +8 -1
  150. package/src/events/device.ts +27 -0
  151. package/src/events/ui-request.ts +16 -1
  152. package/src/inject.ts +12 -1
  153. package/src/types/api/btcGetAddress.ts +6 -2
  154. package/src/types/api/btcGetPublicKey.ts +6 -2
  155. package/src/types/api/deviceSettings.ts +5 -2
  156. package/src/types/api/evmGetAddress.ts +7 -3
  157. package/src/types/api/evmGetPublicKey.ts +6 -2
  158. package/src/types/api/evmSignTransaction.ts +9 -4
  159. package/src/types/api/export.ts +35 -0
  160. package/src/types/api/index.ts +13 -0
  161. package/src/types/api/init.ts +1 -1
  162. package/src/types/api/searchDevices.ts +3 -2
  163. package/src/types/api/starcoinGetAddress.ts +21 -0
  164. package/src/types/api/starcoinGetPublicKey.ts +21 -0
  165. package/src/types/api/starcoinSignMessage.ts +12 -0
  166. package/src/types/api/starcoinSignTransaction.ts +12 -0
  167. package/src/types/api/starcoinVerifyMessage.ts +13 -0
  168. package/src/types/device.ts +9 -0
  169. package/src/utils/index.ts +1 -0
  170. package/dist/api/BTCGetAddress.d.ts +0 -8
  171. package/dist/api/BTCGetAddress.d.ts.map +0 -1
  172. package/dist/api/BTCGetPublicKey.d.ts +0 -8
  173. package/dist/api/BTCGetPublicKey.d.ts.map +0 -1
  174. package/dist/api/BTCSignMessage.d.ts.map +0 -1
  175. package/dist/api/BTCSignTransaction.d.ts.map +0 -1
  176. package/dist/api/BTCVerifyMessage.d.ts.map +0 -1
  177. package/dist/api/DeviceBackup.d.ts.map +0 -1
  178. package/dist/api/DeviceChangePin.d.ts.map +0 -1
  179. package/dist/api/DeviceFlags.d.ts.map +0 -1
  180. package/dist/api/DeviceRebootToBootloader.d.ts.map +0 -1
  181. package/dist/api/DeviceRecovery.d.ts.map +0 -1
  182. package/dist/api/DeviceReset.d.ts.map +0 -1
  183. package/dist/api/DeviceSettings.d.ts.map +0 -1
  184. package/dist/api/DeviceUpdateReboot.d.ts.map +0 -1
  185. package/dist/api/DeviceWipe.d.ts.map +0 -1
  186. package/dist/api/EVMGetAddress.d.ts +0 -8
  187. package/dist/api/EVMGetAddress.d.ts.map +0 -1
  188. package/dist/api/EVMGetPublicKey.d.ts +0 -8
  189. package/dist/api/EVMGetPublicKey.d.ts.map +0 -1
  190. package/dist/api/EVMSignMessage.d.ts.map +0 -1
  191. package/dist/api/EVMSignMessageEIP712.d.ts.map +0 -1
  192. package/dist/api/EVMSignTransaction.d.ts.map +0 -1
  193. package/dist/api/EVMSignTypedData.d.ts.map +0 -1
  194. package/dist/api/EVMVerifyMessage.d.ts.map +0 -1
  195. package/dist/api/helpers/btcParamsUtils.d.ts.map +0 -1
@@ -0,0 +1,22 @@
1
+ export type { BTCAddress, BTCGetAddressParams } from './btcGetAddress';
2
+ export type { BTCPublicKey, BTCGetPublicKeyParams } from './btcGetPublicKey';
3
+ export type { BTCSignMessageParams } from './btcSignMessage';
4
+ export type { BTCVerifyMessageParams } from './btcVerifyMessage';
5
+ export type { DeviceChangePinParams } from './deviceChangePin';
6
+ export type { DeviceFlagsParams } from './deviceFlags';
7
+ export type { DeviceRecoveryParams } from './deviceRecovery';
8
+ export type { DeviceResetParams } from './deviceReset';
9
+ export type { DeviceSettingsParams } from './deviceSettings';
10
+ export type { EVMAddress, EVMGetAddressParams } from './evmGetAddress';
11
+ export type { EVMPublicKey, EVMGetPublicKeyParams } from './evmGetPublicKey';
12
+ export type { EVMSignMessageParams } from './evmSignMessage';
13
+ export type { EVMSignMessageEIP712Params } from './evmSignMessageEIP712';
14
+ export type { EVMTransaction, EVMTransactionEIP1559, EVMSignedTx, EVMSignTransactionParams, EVMAccessList, } from './evmSignTransaction';
15
+ export type { EthereumSignTypedDataTypes, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataMessage, EVMSignTypedDataParams, } from './evmSignTypedData';
16
+ export type { EVMVerifyMessageParams } from './evmVerifyMessage';
17
+ export type { StarcoinAddress, StarcoinGetAddressParams } from './starcoinGetAddress';
18
+ export type { StarcoinPublicKey, StarcoinGetPublicKeyParams } from './starcoinGetPublicKey';
19
+ export type { StarcoinSignMessageParams } from './starcoinSignMessage';
20
+ export type { StarcoinSignTransactionParams } from './starcoinSignTransaction';
21
+ export type { StarcoinVerifyMessageParams } from './starcoinVerifyMessage';
22
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/types/api/export.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,wBAAwB,EACxB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,0BAA0B,EAC1B,iCAAiC,EACjC,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACtF,YAAY,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAC5F,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,YAAY,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,YAAY,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC"}
@@ -27,6 +27,12 @@ import { deviceChangePin } from './deviceChangePin';
27
27
  import { deviceSettings } from './deviceSettings';
28
28
  import { deviceFlags } from './deviceFlags';
29
29
  import { deviceUpdateReboot } from './deviceUpdateReboot';
30
+ import { starcoinGetAddress } from './starcoinGetAddress';
31
+ import { starcoinGetPublicKey } from './starcoinGetPublicKey';
32
+ import { starcoinSignMessage } from './starcoinSignMessage';
33
+ import { starcoinSignTransaction } from './starcoinSignTransaction';
34
+ import { starcoinVerifyMessage } from './starcoinVerifyMessage';
35
+ export * from './export';
30
36
  export declare type CoreApi = {
31
37
  init: typeof init;
32
38
  on: typeof on;
@@ -62,5 +68,10 @@ export declare type CoreApi = {
62
68
  btcSignMessage: typeof btcSignMessage;
63
69
  btcSignTransaction: typeof btcSignTransaction;
64
70
  btcVerifyMessage: typeof btcVerifyMessage;
71
+ starcoinGetAddress: typeof starcoinGetAddress;
72
+ starcoinGetPublicKey: typeof starcoinGetPublicKey;
73
+ starcoinSignMessage: typeof starcoinSignMessage;
74
+ starcoinSignTransaction: typeof starcoinSignTransaction;
75
+ starcoinVerifyMessage: typeof starcoinVerifyMessage;
65
76
  };
66
77
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,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,gBAAgB,CAAC;IAE1C,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAE1C,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;CACrD,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import type { ConnectSettings } from '../settings';
2
- export declare function init(settings: Partial<ConnectSettings>): Promise<void> | void;
2
+ export declare function init(settings: Partial<ConnectSettings>): Promise<boolean>;
3
3
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/types/api/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/types/api/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
1
+ import { SearchDevice } from '../device';
2
2
  import { Response } from '../params';
3
- export declare function searchDevices(): Response<DeviceDescriptor[]>;
3
+ export declare function searchDevices(): Response<SearchDevice[]>;
4
4
  //# sourceMappingURL=searchDevices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"searchDevices.d.ts","sourceRoot":"","sources":["../../../src/types/api/searchDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,aAAa,IAAI,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"searchDevices.d.ts","sourceRoot":"","sources":["../../../src/types/api/searchDevices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,aAAa,IAAI,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { StarcoinAddress as HardwareStarcoinAddress } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import type { CommonParams, Response } from '../params';
3
+ export declare type StarcoinAddress = {
4
+ path: string;
5
+ } & HardwareStarcoinAddress;
6
+ export declare type StarcoinGetAddressParams = {
7
+ path: string | number[];
8
+ showOnOneKey?: boolean;
9
+ };
10
+ export declare function starcoinGetAddress(connectId: string, params: CommonParams & StarcoinGetAddressParams): Response<StarcoinAddress>;
11
+ export declare function starcoinGetAddress(connectId: string, params: CommonParams & {
12
+ bundle?: StarcoinGetAddressParams[];
13
+ }): Response<Array<StarcoinAddress>>;
14
+ //# sourceMappingURL=starcoinGetAddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starcoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACvG,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,uBAAuB,CAAC;AAE5B,oBAAY,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,wBAAwB,GAC9C,QAAQ,CAAC,eAAe,CAAC,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,wBAAwB,EAAE,CAAA;CAAE,GAC7D,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { StarcoinPublicKey as HardwareStarcoinPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import type { CommonParams, Response } from '../params';
3
+ export declare type StarcoinPublicKey = {
4
+ path: string;
5
+ } & HardwareStarcoinPublicKey;
6
+ export declare type StarcoinGetPublicKeyParams = {
7
+ path: string | number[];
8
+ showOnOneKey?: boolean;
9
+ };
10
+ export declare function starcoinGetPublicKey(connectId: string, params: CommonParams & StarcoinGetPublicKeyParams): Response<StarcoinPublicKey>;
11
+ export declare function starcoinGetPublicKey(connectId: string, params: CommonParams & {
12
+ bundle?: StarcoinGetPublicKeyParams[];
13
+ }): Response<Array<StarcoinPublicKey>>;
14
+ //# sourceMappingURL=starcoinGetPublicKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starcoinGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAC3G,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,yBAAyB,CAAC;AAE9B,oBAAY,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,0BAA0B,GAChD,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAE/B,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,0BAA0B,EAAE,CAAA;CAAE,GAC/D,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { StarcoinMessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import type { CommonParams, Response } from '../params';
3
+ export declare type StarcoinSignMessageParams = {
4
+ path: string | number[];
5
+ messageHex: string;
6
+ };
7
+ export declare function starcoinSignMessage(connectId: string, params: CommonParams & StarcoinSignMessageParams): Response<StarcoinMessageSignature>;
8
+ //# sourceMappingURL=starcoinSignMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starcoinSignMessage.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,yBAAyB,GAC/C,QAAQ,CAAC,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { StarcoinSignedTx } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import type { CommonParams, Response } from '../params';
3
+ export declare type StarcoinSignTransactionParams = {
4
+ path: string | number[];
5
+ rawTx: string;
6
+ };
7
+ export declare function starcoinSignTransaction(connectId: string, params: CommonParams & StarcoinSignTransactionParams): Response<StarcoinSignedTx>;
8
+ //# sourceMappingURL=starcoinSignTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starcoinSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,6BAA6B,GACnD,QAAQ,CAAC,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Success } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import type { CommonParams, Response } from '../params';
3
+ export declare type StarcoinVerifyMessageParams = {
4
+ publicKey: string;
5
+ messageHex: string;
6
+ signature: string;
7
+ };
8
+ export declare function starcoinVerifyMessage(connectId: string, params: CommonParams & StarcoinVerifyMessageParams): Response<Success>;
9
+ //# sourceMappingURL=starcoinVerifyMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starcoinVerifyMessage.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinVerifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,2BAA2B,GAAG;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,2BAA2B,GACjD,QAAQ,CAAC,OAAO,CAAC,CAAC"}
@@ -13,6 +13,7 @@ export declare type KnownDevice = {
13
13
  deviceType: IDeviceType;
14
14
  path: string;
15
15
  label: string;
16
+ name: string;
16
17
  error?: typeof undefined;
17
18
  mode: DeviceMode;
18
19
  features: PROTO.Features;
@@ -20,6 +21,13 @@ export declare type KnownDevice = {
20
21
  bleFirmwareVersion: IVersionArray | null;
21
22
  firmwareVersion: IVersionArray | null;
22
23
  };
24
+ export declare type SearchDevice = {
25
+ connectId: string | null;
26
+ uuid: string;
27
+ deviceId: string | null;
28
+ deviceType: IDeviceType;
29
+ name: string;
30
+ };
23
31
  export declare type Device = KnownDevice;
24
32
  export declare type Features = PROTO.Features;
25
33
  export declare type IDeviceType = 'classic' | 'mini' | 'touch' | 'pro';
@@ -1 +1 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/types/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,YAAY,GAAG,WAAW,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,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/D,oBAAY,qBAAqB,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3F,oBAAY,wBAAwB,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9F,oBAAY,gBAAgB,GAAG,OAAO,GAAG,UAAU,CAAC"}
@@ -5,6 +5,7 @@ export declare const getDeviceType: (features?: {
5
5
  se_ver: string;
6
6
  serial_no: string;
7
7
  onekey_version: string;
8
+ ble_name: string;
8
9
  ble_ver: string;
9
10
  ble_enable: boolean;
10
11
  major_version: number;
@@ -1 +1 @@
1
- {"version":3,"file":"deviceFeaturesUtils.d.ts","sourceRoot":"","sources":["../../src/utils/deviceFeaturesUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAErE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAA0B,WASnD,CAAC;AAEF,eAAO,MAAM,aAAa,aAAc,QAAQ,WAM/C,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,QAAQ,WAOhD,CAAC;AAKF,eAAO,MAAM,wBAAwB,aAAc,QAAQ,kBAK1D,CAAC;AAKF,eAAO,MAAM,2BAA2B,aAAc,QAAQ,KAAG,aAAa,GAAG,IAKhF,CAAC"}
1
+ {"version":3,"file":"deviceFeaturesUtils.d.ts","sourceRoot":"","sources":["../../src/utils/deviceFeaturesUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAErE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAA0B,WASnD,CAAC;AAEF,eAAO,MAAM,aAAa,aAAc,QAAQ,WAM/C,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,QAAQ,WAOhD,CAAC;AAKF,eAAO,MAAM,wBAAwB,aAAc,QAAQ,kBAK1D,CAAC;AAKF,eAAO,MAAM,2BAA2B,aAAc,QAAQ,KAAG,aAAa,GAAG,IAKhF,CAAC"}
@@ -2,5 +2,6 @@ import { initLog, enableLog } from './logger';
2
2
  export * from './assets';
3
3
  export * from './versionUtils';
4
4
  export * from './deferred';
5
+ export * from './deviceFeaturesUtils';
5
6
  export { initLog, enableLog };
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -25,7 +25,7 @@
25
25
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@onekeyfe/hd-transport": "*",
28
+ "@onekeyfe/hd-transport": "^0.0.4",
29
29
  "axios": "^0.27.2",
30
30
  "bignumber.js": "^9.0.2",
31
31
  "parse-uri": "^1.0.7",
@@ -35,5 +35,5 @@
35
35
  "@types/parse-uri": "^1.0.0",
36
36
  "@types/semver": "^7.3.9"
37
37
  },
38
- "gitHead": "20ce0ad2bd0388f9286be7b08cb76d94946a48c1"
38
+ "gitHead": "cabba10f92c55ebbe16c54a329c892d03a0c05fb"
39
39
  }
@@ -23,7 +23,12 @@ export default class SearchDevices extends BaseMethod {
23
23
  * to avoid device pairing
24
24
  */
25
25
  if (env === 'react-native') {
26
- return devicesDescriptor.map(device => ({ ...device, connectId: device.id }));
26
+ return devicesDescriptor.map(device => ({
27
+ ...device,
28
+ connectId: device.id,
29
+ // 蓝牙场景只有 classic 能被搜索到
30
+ deviceType: 'classic',
31
+ }));
27
32
  }
28
33
 
29
34
  const devices = [];
@@ -1,9 +1,9 @@
1
- import { Address, GetAddress } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { UI_REQUEST } from '../constants/ui-request';
3
- import { getScriptType, validatePath } from './helpers/pathUtils';
4
- import { BaseMethod } from './BaseMethod';
5
- import { validateParams } from './helpers/paramsValidator';
6
- import { BTCGetAddressParams } from '../types/api/btcGetAddress';
1
+ import { GetAddress } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import { UI_REQUEST } from '../../constants/ui-request';
3
+ import { getScriptType, serializedPath, validatePath } from '../helpers/pathUtils';
4
+ import { BaseMethod } from '../BaseMethod';
5
+ import { validateParams } from '../helpers/paramsValidator';
6
+ import { BTCAddress, BTCGetAddressParams } from '../../types/api/btcGetAddress';
7
7
  import { getCoinInfo } from './helpers/btcParamsUtils';
8
8
 
9
9
  export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
@@ -54,7 +54,7 @@ export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
54
54
  }
55
55
 
56
56
  async run() {
57
- const responses: Address[] = [];
57
+ const responses: BTCAddress[] = [];
58
58
 
59
59
  for (let i = 0; i < this.params.length; i++) {
60
60
  const param = this.params[i];
@@ -63,7 +63,10 @@ export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
63
63
  ...param,
64
64
  });
65
65
 
66
- responses.push(res.message);
66
+ responses.push({
67
+ path: serializedPath(param.address_n),
68
+ ...res.message,
69
+ });
67
70
  }
68
71
 
69
72
  return Promise.resolve(this.hasBundle ? responses : responses[0]);
@@ -1,10 +1,11 @@
1
- import { GetPublicKey, PublicKey } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { UI_REQUEST } from '../constants/ui-request';
3
- import { getScriptType, validatePath } from './helpers/pathUtils';
4
- import { BaseMethod } from './BaseMethod';
5
- import { validateParams } from './helpers/paramsValidator';
6
- import { BTCGetAddressParams } from '../types/api/btcGetAddress';
1
+ import { GetPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import { UI_REQUEST } from '../../constants/ui-request';
3
+ import { getScriptType, serializedPath, validatePath } from '../helpers/pathUtils';
4
+ import { BaseMethod } from '../BaseMethod';
5
+ import { validateParams } from '../helpers/paramsValidator';
6
+ import { BTCGetAddressParams } from '../../types/api/btcGetAddress';
7
7
  import { getCoinInfo } from './helpers/btcParamsUtils';
8
+ import { BTCPublicKey } from '../../types/api/btcGetPublicKey';
8
9
 
9
10
  export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
10
11
  hasBundle = false;
@@ -53,7 +54,7 @@ export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
53
54
  }
54
55
 
55
56
  async run() {
56
- const responses: PublicKey[] = [];
57
+ const responses: BTCPublicKey[] = [];
57
58
 
58
59
  for (let i = 0; i < this.params.length; i++) {
59
60
  const param = this.params[i];
@@ -62,7 +63,10 @@ export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
62
63
  ...param,
63
64
  });
64
65
 
65
- responses.push(res.message);
66
+ responses.push({
67
+ path: serializedPath(param.address_n),
68
+ ...res.message,
69
+ });
66
70
  }
67
71
 
68
72
  return Promise.resolve(this.hasBundle ? responses : responses[0]);
@@ -1,9 +1,9 @@
1
1
  import { SignMessage } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { UI_REQUEST } from '../constants/ui-request';
3
- import { validatePath } from './helpers/pathUtils';
4
- import { BaseMethod } from './BaseMethod';
5
- import { validateParams } from './helpers/paramsValidator';
6
- import { formatAnyHex } from './helpers/hexUtils';
2
+ import { UI_REQUEST } from '../../constants/ui-request';
3
+ import { validatePath } from '../helpers/pathUtils';
4
+ import { BaseMethod } from '../BaseMethod';
5
+ import { validateParams } from '../helpers/paramsValidator';
6
+ import { formatAnyHex } from '../helpers/hexUtils';
7
7
  import { getCoinAndScriptType } from './helpers/btcParamsUtils';
8
8
 
9
9
  export default class BTCSignMessage extends BaseMethod<SignMessage> {
@@ -1,18 +1,18 @@
1
1
  import { TxInputType, TxOutputType } from '@onekeyfe/hd-transport/src/types/messages';
2
2
 
3
- import { UI_REQUEST } from '../constants/ui-request';
4
- import { getOutputScriptType, isSegwitPath, validatePath } from './helpers/pathUtils';
5
- import { BaseMethod } from './BaseMethod';
6
- import { validateParams } from './helpers/paramsValidator';
3
+ import { UI_REQUEST } from '../../constants/ui-request';
4
+ import { getOutputScriptType, isSegwitPath, validatePath } from '../helpers/pathUtils';
5
+ import { BaseMethod } from '../BaseMethod';
6
+ import { validateParams } from '../helpers/paramsValidator';
7
7
  import {
8
8
  AccountAddresses,
9
9
  BTCSignTransactionParams,
10
10
  RefTransaction,
11
11
  TransactionOptions,
12
- } from '../types/api/btcSignTransaction';
13
- import { ERRORS } from '../constants';
14
- import signtx from './helpers/btc/signtx';
15
- import signtxLegacy from './helpers/btc/signtxLegacy';
12
+ } from '../../types/api/btcSignTransaction';
13
+ import { ERRORS } from '../../constants';
14
+ import signtx from './helpers/signtx';
15
+ import signtxLegacy from './helpers/signtxLegacy';
16
16
  import { getCoinInfo } from './helpers/btcParamsUtils';
17
17
 
18
18
  type Params = {
@@ -1,9 +1,9 @@
1
1
  import { VerifyMessage } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { UI_REQUEST } from '../constants/ui-request';
2
+ import { UI_REQUEST } from '../../constants/ui-request';
3
3
 
4
- import { BaseMethod } from './BaseMethod';
5
- import { validateParams } from './helpers/paramsValidator';
6
- import { formatAnyHex } from './helpers/hexUtils';
4
+ import { BaseMethod } from '../BaseMethod';
5
+ import { validateParams } from '../helpers/paramsValidator';
6
+ import { formatAnyHex } from '../helpers/hexUtils';
7
7
  import { getCoinInfo } from './helpers/btcParamsUtils';
8
8
 
9
9
  export default class BTCVerifyMessage extends BaseMethod<VerifyMessage> {
@@ -1,6 +1,6 @@
1
- import { ERRORS } from '../../constants';
2
- import { getScriptType, isMultisigPath, fromHardened } from './pathUtils';
3
- import bitcoin from '../../data/coins/bitcoin.json';
1
+ import { ERRORS } from '../../../constants';
2
+ import { getScriptType, isMultisigPath, fromHardened } from '../../helpers/pathUtils';
3
+ import bitcoin from '../../../data/coins/bitcoin.json';
4
4
 
5
5
  export type BitcoinInfo = {
6
6
  name: string;
File without changes
@@ -1,5 +1,5 @@
1
1
  import { BackupDevice } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
2
+ import { BaseMethod } from '../BaseMethod';
3
3
 
4
4
  export default class DeviceBackup extends BaseMethod<BackupDevice> {
5
5
  init() {}
@@ -1,6 +1,6 @@
1
1
  import { ChangePin } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
3
- import { validateParams } from './helpers/paramsValidator';
2
+ import { BaseMethod } from '../BaseMethod';
3
+ import { validateParams } from '../helpers/paramsValidator';
4
4
 
5
5
  export default class DeviceChangePin extends BaseMethod<ChangePin> {
6
6
  init() {
@@ -1,6 +1,6 @@
1
1
  import { ApplyFlags } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
3
- import { validateParams } from './helpers/paramsValidator';
2
+ import { BaseMethod } from '../BaseMethod';
3
+ import { validateParams } from '../helpers/paramsValidator';
4
4
 
5
5
  export default class DeviceFlags extends BaseMethod<ApplyFlags> {
6
6
  init() {
@@ -1,5 +1,5 @@
1
1
  import { RebootToBootloader } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
2
+ import { BaseMethod } from '../BaseMethod';
3
3
 
4
4
  // Reboot BootLoader
5
5
  export default class DeviceRebootToBootloader extends BaseMethod<RebootToBootloader> {
@@ -1,6 +1,6 @@
1
1
  import { RecoveryDevice } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
3
- import { validateParams } from './helpers/paramsValidator';
2
+ import { BaseMethod } from '../BaseMethod';
3
+ import { validateParams } from '../helpers/paramsValidator';
4
4
 
5
5
  export default class DeviceRecovery extends BaseMethod<RecoveryDevice> {
6
6
  init() {
@@ -1,6 +1,6 @@
1
1
  import { ResetDevice } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
3
- import { validateParams } from './helpers/paramsValidator';
2
+ import { BaseMethod } from '../BaseMethod';
3
+ import { validateParams } from '../helpers/paramsValidator';
4
4
 
5
5
  export default class DeviceReset extends BaseMethod<ResetDevice> {
6
6
  init() {
@@ -1,6 +1,6 @@
1
1
  import { ApplySettings } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
3
- import { validateParams } from './helpers/paramsValidator';
2
+ import { BaseMethod } from '../BaseMethod';
3
+ import { validateParams } from '../helpers/paramsValidator';
4
4
 
5
5
  export default class DeviceSettings extends BaseMethod<ApplySettings> {
6
6
  init() {
@@ -1,5 +1,5 @@
1
1
  import { BixinReboot } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
2
+ import { BaseMethod } from '../BaseMethod';
3
3
 
4
4
  // Upload hint Reboot BootLoader
5
5
  export default class DeviceUpdateReboot extends BaseMethod<BixinReboot> {
@@ -1,5 +1,5 @@
1
1
  import { WipeDevice } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { BaseMethod } from './BaseMethod';
2
+ import { BaseMethod } from '../BaseMethod';
3
3
 
4
4
  export default class DeviceWipe extends BaseMethod<WipeDevice> {
5
5
  init() {}
@@ -1,9 +1,9 @@
1
- import { EthereumAddress, EthereumGetAddress } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { UI_REQUEST } from '../constants/ui-request';
3
- import { validatePath } from './helpers/pathUtils';
4
- import { BaseMethod } from './BaseMethod';
5
- import { validateParams } from './helpers/paramsValidator';
6
- import { EVMGetAddressParams } from '../types/api/evmGetAddress';
1
+ import { EthereumGetAddress } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import { UI_REQUEST } from '../../constants/ui-request';
3
+ import { serializedPath, validatePath } from '../helpers/pathUtils';
4
+ import { BaseMethod } from '../BaseMethod';
5
+ import { validateParams } from '../helpers/paramsValidator';
6
+ import { EVMAddress, EVMGetAddressParams } from '../../types/api/evmGetAddress';
7
7
 
8
8
  export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {
9
9
  hasBundle = false;
@@ -37,7 +37,7 @@ export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {
37
37
  }
38
38
 
39
39
  async run() {
40
- const responses: EthereumAddress[] = [];
40
+ const responses: EVMAddress[] = [];
41
41
 
42
42
  for (let i = 0; i < this.params.length; i++) {
43
43
  const param = this.params[i];
@@ -46,7 +46,12 @@ export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {
46
46
  ...param,
47
47
  });
48
48
 
49
- responses.push(res.message);
49
+ const { address } = res.message;
50
+
51
+ responses.push({
52
+ path: serializedPath(param.address_n),
53
+ address,
54
+ });
50
55
  }
51
56
 
52
57
  return Promise.resolve(this.hasBundle ? responses : responses[0]);
@@ -1,9 +1,9 @@
1
- import { EthereumGetPublicKey, EthereumPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { UI_REQUEST } from '../constants/ui-request';
3
- import { validatePath } from './helpers/pathUtils';
4
- import { BaseMethod } from './BaseMethod';
5
- import { validateParams } from './helpers/paramsValidator';
6
- import { EVMGetPublicKeyParams } from '../types/api/evmGetPublicKey';
1
+ import { EthereumGetPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
2
+ import { UI_REQUEST } from '../../constants/ui-request';
3
+ import { serializedPath, validatePath } from '../helpers/pathUtils';
4
+ import { BaseMethod } from '../BaseMethod';
5
+ import { validateParams } from '../helpers/paramsValidator';
6
+ import { EVMGetPublicKeyParams, EVMPublicKey } from '../../types/api/evmGetPublicKey';
7
7
 
8
8
  export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKey[]> {
9
9
  hasBundle = false;
@@ -37,7 +37,7 @@ export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKey[]>
37
37
  }
38
38
 
39
39
  async run() {
40
- const responses: EthereumPublicKey[] = [];
40
+ const responses: EVMPublicKey[] = [];
41
41
 
42
42
  for (let i = 0; i < this.params.length; i++) {
43
43
  const param = this.params[i];
@@ -50,7 +50,10 @@ export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKey[]>
50
50
  }
51
51
  );
52
52
 
53
- responses.push(res.message);
53
+ responses.push({
54
+ path: serializedPath(param.address_n),
55
+ ...res.message,
56
+ });
54
57
  }
55
58
 
56
59
  return Promise.resolve(this.hasBundle ? responses : responses[0]);
@@ -1,9 +1,9 @@
1
1
  import { EthereumSignMessage } from '@onekeyfe/hd-transport/src/types/messages';
2
- import { UI_REQUEST } from '../constants/ui-request';
3
- import { validatePath } from './helpers/pathUtils';
4
- import { BaseMethod } from './BaseMethod';
5
- import { validateParams } from './helpers/paramsValidator';
6
- import { formatAnyHex } from './helpers/hexUtils';
2
+ import { UI_REQUEST } from '../../constants/ui-request';
3
+ import { validatePath } from '../helpers/pathUtils';
4
+ import { BaseMethod } from '../BaseMethod';
5
+ import { validateParams } from '../helpers/paramsValidator';
6
+ import { formatAnyHex } from '../helpers/hexUtils';
7
7
 
8
8
  export default class EVMSignMessage extends BaseMethod<EthereumSignMessage> {
9
9
  init() {