@onekeyfe/hd-core 0.1.18 → 0.1.21

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 (64) hide show
  1. package/dist/api/BaseMethod.d.ts.map +1 -1
  2. package/dist/api/CipherKeyValue.d.ts.map +1 -1
  3. package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
  4. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  5. package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
  6. package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
  7. package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
  8. package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
  9. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
  10. package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
  11. package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
  12. package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
  13. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  14. package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
  15. package/dist/api/nem/NEMGetAddress.d.ts.map +1 -1
  16. package/dist/api/nem/NEMSignTransaction.d.ts.map +1 -1
  17. package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
  18. package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
  19. package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -1
  20. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -1
  21. package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -1
  22. package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -1
  23. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts.map +1 -1
  24. package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
  25. package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
  26. package/dist/core/index.d.ts.map +1 -1
  27. package/dist/device/Device.d.ts +2 -1
  28. package/dist/device/Device.d.ts.map +1 -1
  29. package/dist/events/device.d.ts +8 -2
  30. package/dist/events/device.d.ts.map +1 -1
  31. package/dist/events/firmware.d.ts +9 -2
  32. package/dist/events/firmware.d.ts.map +1 -1
  33. package/dist/index.d.ts +17 -4
  34. package/dist/index.js +52 -13
  35. package/package.json +4 -4
  36. package/src/api/BaseMethod.ts +12 -6
  37. package/src/api/CipherKeyValue.ts +1 -0
  38. package/src/api/btc/BTCGetAddress.ts +1 -0
  39. package/src/api/btc/BTCGetPublicKey.ts +1 -0
  40. package/src/api/btc/BTCSignMessage.ts +1 -0
  41. package/src/api/btc/BTCSignTransaction.ts +1 -0
  42. package/src/api/btc/BTCVerifyMessage.ts +1 -0
  43. package/src/api/evm/EVMGetAddress.ts +1 -0
  44. package/src/api/evm/EVMGetPublicKey.ts +1 -0
  45. package/src/api/evm/EVMSignMessage.ts +1 -0
  46. package/src/api/evm/EVMSignMessageEIP712.ts +1 -0
  47. package/src/api/evm/EVMSignTransaction.ts +1 -0
  48. package/src/api/evm/EVMSignTypedData.ts +1 -0
  49. package/src/api/evm/EVMVerifyMessage.ts +1 -0
  50. package/src/api/nem/NEMGetAddress.ts +1 -0
  51. package/src/api/nem/NEMSignTransaction.ts +1 -0
  52. package/src/api/solana/SolGetAddress.ts +1 -0
  53. package/src/api/solana/SolSignTransaction.ts +1 -0
  54. package/src/api/starcoin/StarcoinGetAddress.ts +1 -0
  55. package/src/api/starcoin/StarcoinGetPublicKey.ts +1 -0
  56. package/src/api/starcoin/StarcoinSignMessage.ts +1 -0
  57. package/src/api/starcoin/StarcoinSignTransaction.ts +1 -0
  58. package/src/api/starcoin/StarcoinVerifyMessage.ts +1 -0
  59. package/src/api/stellar/StellarGetAddress.ts +1 -0
  60. package/src/api/stellar/StellarSignTransaction.ts +2 -4
  61. package/src/core/index.ts +30 -7
  62. package/src/device/Device.ts +13 -2
  63. package/src/events/device.ts +11 -2
  64. package/src/events/firmware.ts +8 -2
@@ -1 +1 @@
1
- {"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAmC,MAAM,WAAW,CAAC;AAGzE,8BAAsB,UAAU,CAAC,MAAM,GAAG,SAAS;IACjD,UAAU,EAAE,MAAM,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAOf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAK5B,SAAS,EAAE,OAAO,CAAC;IAKnB,eAAe,EAAE,MAAM,EAAE,CAAC;IAK1B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAK5B,qBAAqB,UAAQ;IAK7B,aAAa,UAAS;IAGtB,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;gBAEhC,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE;IAYlD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAE5B,eAAe,IAAI,mBAAmB;IAItC,SAAS,CAAC,MAAM,EAAE,MAAM;IAKxB,oBAAoB;IAYpB,OAAO;CACR"}
1
+ {"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":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,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAA0B,MAAM,UAAU,CAAC;AAGpE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,EAAE,CAAC;IAC9E,SAAS,UAAS;IAElB,IAAI;IAoCE,GAAG;CAkBV"}
1
+ {"version":3,"file":"CipherKeyValue.d.ts","sourceRoot":"","sources":["../../src/api/CipherKeyValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGlF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAA0B,MAAM,UAAU,CAAC;AAGpE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,EAAE,CAAC;IAC9E,SAAS,UAAS;IAElB,IAAI;IAqCE,GAAG;CAkBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"BTCGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAGhF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,UAAU,EAAE,CAAC;IACjE,SAAS,UAAS;IAElB,IAAI;IA4CE,GAAG;CAkBV"}
1
+ {"version":3,"file":"BTCGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAGhF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,UAAU,EAAE,CAAC;IACjE,SAAS,UAAS;IAElB,IAAI;IA6CE,GAAG;CAkBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"BTCGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,YAAY,EAAE,CAAC;IACrE,SAAS,UAAS;IAElB,IAAI;IA2CE,GAAG;CAkBV"}
1
+ {"version":3,"file":"BTCGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,YAAY,EAAE,CAAC;IACrE,SAAS,UAAS;IAElB,IAAI;IA4CE,GAAG;CAkBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"BTCSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,WAAW,CAAC;IACjE,IAAI;IAuBE,GAAG;CAOV"}
1
+ {"version":3,"file":"BTCSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,WAAW,CAAC;IACjE,IAAI;IAwBE,GAAG;CAOV"}
@@ -1 +1 @@
1
- {"version":3,"file":"BTCSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAKnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAEhB,cAAc,EACd,kBAAkB,EACnB,MAAM,oCAAoC,CAAC;AAK5C,aAAK,MAAM,GAAG;IACZ,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,MAAM,CAAC;IAChE,IAAI;IA+FE,GAAG;CAmBV"}
1
+ {"version":3,"file":"BTCSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAKnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAEhB,cAAc,EACd,kBAAkB,EACnB,MAAM,oCAAoC,CAAC;AAK5C,aAAK,MAAM,GAAG;IACZ,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,MAAM,CAAC;IAChE,IAAI;IAgGE,GAAG;CAmBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"BTCVerifyMessage.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCVerifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa,CAAC;IACrE,IAAI;IAuBE,GAAG;CAOV"}
1
+ {"version":3,"file":"BTCVerifyMessage.d.ts","sourceRoot":"","sources":["../../../src/api/btc/BTCVerifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa,CAAC;IACrE,IAAI;IAwBE,GAAG;CAOV"}
@@ -1 +1 @@
1
- {"version":3,"file":"EVMGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACzE,SAAS,UAAS;IAElB,IAAI;IA4BE,GAAG;CAoBV"}
1
+ {"version":3,"file":"EVMGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,+BAA+B,CAAC;AAEhF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACzE,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAoBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"EVMGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAyB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEtF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,oBAAoB,EAAE,CAAC;IAC7E,SAAS,UAAS;IAElB,IAAI;IA4BE,GAAG;CAsBV"}
1
+ {"version":3,"file":"EVMGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAyB,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEtF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,oBAAoB,EAAE,CAAC;IAC7E,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAsBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"EVMSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,mBAAmB,CAAC;IACzE,IAAI;IAoBE,GAAG;CAWV"}
1
+ {"version":3,"file":"EVMSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,mBAAmB,CAAC;IACzE,IAAI;IAqBE,GAAG;CAWV"}
@@ -1 +1 @@
1
- {"version":3,"file":"EVMSignMessageEIP712.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignMessageEIP712.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU,CAAC,yBAAyB,CAAC;IACrF,IAAI;IAoBJ,eAAe;;;;;IAQT,GAAG;CAWV"}
1
+ {"version":3,"file":"EVMSignMessageEIP712.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignMessageEIP712.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU,CAAC,yBAAyB,CAAC;IACrF,IAAI;IAqBJ,eAAe;;;;;IAQT,GAAG;CAWV"}
@@ -1 +1 @@
1
- {"version":3,"file":"EVMSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAKlG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,WAAW,EAEX,cAAc,EACd,qBAAqB,EACtB,MAAM,oCAAoC,CAAC;AAI5C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU;IACxD,QAAQ,EAAE,MAAM,EAAE,CAAM;IAExB,SAAS,UAAS;IAElB,WAAW,EAAE,cAAc,GAAG,qBAAqB,GAAG,SAAS,CAAC;IAEhE,IAAI;IAmCJ,gBAAgB,YACL,iBAAiB,QACpB,MAAM,YACF,MAAM,GAAG,SAAS,KAC3B,QAAQ,WAAW,CAAC,CA+BrB;IAEF,SAAS,aAAoB,MAAM,EAAE,MAAM,cAAc,0BAuCvD;IAEF,gBAAgB,aAAoB,MAAM,EAAE,MAAM,qBAAqB,0BAyCrE;IAEF,eAAe;;;;;IAeT,GAAG;CASV"}
1
+ {"version":3,"file":"EVMSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAKlG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,WAAW,EAEX,cAAc,EACd,qBAAqB,EACtB,MAAM,oCAAoC,CAAC;AAI5C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU;IACxD,QAAQ,EAAE,MAAM,EAAE,CAAM;IAExB,SAAS,UAAS;IAElB,WAAW,EAAE,cAAc,GAAG,qBAAqB,GAAG,SAAS,CAAC;IAEhE,IAAI;IAoCJ,gBAAgB,YACL,iBAAiB,QACpB,MAAM,YACF,MAAM,GAAG,SAAS,KAC3B,QAAQ,WAAW,CAAC,CA+BrB;IAEF,SAAS,aAAoB,MAAM,EAAE,MAAM,cAAc,0BAuCvD;IAEF,gBAAgB,aAAoB,MAAM,EAAE,MAAM,qBAAqB,0BAyCrE;IAEF,eAAe;;;;;IAeT,GAAG;CASV"}
@@ -1 +1 @@
1
- {"version":3,"file":"EVMSignTypedData.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignTypedData.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,KAAK,EACV,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAE1C,oBAAY,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,4BAA4B,CAAC,0BAA0B,CAAC,CAAC;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IAC9E,IAAI;IAkCE,aAAa;;;;IAkHnB,eAAe;;;;;IAQf,gBAAgB;IAcV,GAAG;CAiDV"}
1
+ {"version":3,"file":"EVMSignTypedData.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignTypedData.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,KAAK,EACV,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAE1C,oBAAY,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,4BAA4B,CAAC,0BAA0B,CAAC,CAAC;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IAC9E,IAAI;IAmCE,aAAa;;;;IAkHnB,eAAe;;;;;IAQf,gBAAgB;IAcV,GAAG;CAiDV"}
@@ -1 +1 @@
1
- {"version":3,"file":"EVMVerifyMessage.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMVerifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,qBAAqB,CAAC;IAC3E,IAAI;IAkBE,GAAG;CAOV"}
1
+ {"version":3,"file":"EVMVerifyMessage.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMVerifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,qBAAqB,CAAC;IAC3E,IAAI;IAmBE,GAAG;CAOV"}
@@ -1 +1 @@
1
- {"version":3,"file":"NEMGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/nem/NEMGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAI9D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAC5E,SAAS,UAAS;IAElB,IAAI;IA8BE,GAAG;CAkBV"}
1
+ {"version":3,"file":"NEMGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/nem/NEMGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGhF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAI9D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAC5E,SAAS,UAAS;IAElB,IAAI;IA+BE,GAAG;CAkBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"NEMSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/nem/NEMSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EAEjB,qBAAqB,EACrB,qBAAqB,EACrB,SAAS,EACT,oBAAoB,EACpB,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACxB,4BAA4B,EAC5B,gCAAgC,EAChC,0BAA0B,EAC1B,cAAc,EACd,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAYrB,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,SAAS,CAAC;IACnE,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAG3C;IAEF,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAG7C;IAEF,gCAAgC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGtD;IAEF,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGnD;IAEF,SAAS,OAAQ,cAAc,uCAAyB,oBAAoB,CAQ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W,CAgBzD;IAEF,yBAAyB,OAAQ,wBAAwB,KAAG,qBAAqB,CAI9E;IAEH,4BAA4B,OACtB,mCAAmC,KACtC,wBAAwB,CAazB;IAEF,yBAAyB,OAAQ,gCAAgC,KAAG,qBAAqB,CAKtF;IAEH,qBAAqB,OAAQ,4BAA4B,KAAG,iBAAiB,CA6C3E;IAEF,mBAAmB,OAAQ,0BAA0B,KAAG,qBAAqB,CAM1E;IAEH,OAAO,OAAQ,cAAc,aAAa,MAAM,EAAE,eAuDhD;IAEF,IAAI;IAcE,GAAG;CAOV"}
@@ -1 +1 @@
1
- {"version":3,"file":"SolGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/solana/SolGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,gBAAgB,EAAE,CAAC;IACvE,SAAS,UAAS;IAElB,IAAI;IA4BE,GAAG;CAsBV"}
1
+ {"version":3,"file":"SolGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/solana/SolGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,gBAAgB,EAAE,CAAC;IACvE,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAsBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"SolSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/solana/SolSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,cAAc,EAA+B,MAAM,aAAa,CAAC;AAG1E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,oBAAoB,EAAE,CAAC;IAChF,SAAS,UAAS;IAElB,IAAI;IA0BJ,eAAe;;;;;;;;IAWT,GAAG;CAsBV"}
1
+ {"version":3,"file":"SolSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/solana/SolSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,cAAc,EAA+B,MAAM,aAAa,CAAC;AAG1E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,oBAAoB,EAAE,CAAC;IAChF,SAAS,UAAS;IAElB,IAAI;IA2BJ,eAAe;;;;;;;;IAWT,GAAG;CAsBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"StarcoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,oCAAoC,CAAC;AAE/F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IA4BE,GAAG;CAkBV"}
1
+ {"version":3,"file":"StarcoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAA4B,MAAM,oCAAoC,CAAC;AAE/F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,0BAA0B,EAAE,CAAC;IACtF,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAkBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"StarcoinGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAG9F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,iBAAiB,EAElB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU,CAAC,4BAA4B,EAAE,CAAC;IAC1F,SAAS,UAAS;IAElB,IAAI;IA4BE,GAAG;CAsBV"}
1
+ {"version":3,"file":"StarcoinGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,IAAI,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAG9F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,iBAAiB,EAElB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU,CAAC,4BAA4B,EAAE,CAAC;IAC1F,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAsBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"StarcoinSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAG5F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC,2BAA2B,CAAC;IACtF,IAAI;IAoBE,GAAG;CAWV"}
1
+ {"version":3,"file":"StarcoinSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAG5F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC,2BAA2B,CAAC;IACtF,IAAI;IAqBE,GAAG;CAWV"}
@@ -1 +1 @@
1
- {"version":3,"file":"StarcoinSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU,CAAC,cAAc,CAAC;IAC7E,IAAI;IAoBE,GAAG;CAOV"}
1
+ {"version":3,"file":"StarcoinSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU,CAAC,cAAc,CAAC;IAC7E,IAAI;IAqBE,GAAG;CAOV"}
@@ -1 +1 @@
1
- {"version":3,"file":"StarcoinVerifyMessage.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinVerifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,IAAI,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAEhG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,6BAA6B,CAAC;IACnF,IAAI;IAkBE,GAAG;CAOV"}
1
+ {"version":3,"file":"StarcoinVerifyMessage.d.ts","sourceRoot":"","sources":["../../../src/api/starcoin/StarcoinVerifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,IAAI,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAEhG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,6BAA6B,CAAC;IACnF,IAAI;IAmBE,GAAG;CAOV"}
@@ -1 +1 @@
1
- {"version":3,"file":"StellarGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAA2B,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,EAAE,CAAC;IACpF,SAAS,UAAS;IAElB,IAAI;IA4BE,GAAG;CAoBV"}
1
+ {"version":3,"file":"StellarGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGxF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAA2B,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,EAAE,CAAC;IACpF,SAAS,UAAS;IAElB,IAAI;IA6BE,GAAG;CAoBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"StellarSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarSignTransaction.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,aAAa,IAAI,qBAAqB,EACvC,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAgC,MAAM,aAAa,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU,CAAC,qBAAqB,CAAC;IACnF,UAAU,EAAE,GAAG,EAAE,CAAM;IAEvB,cAAc,OAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoIpC;IAEF,IAAI;IA8CJ,gBAAgB,eAAsB,GAAG,SAAS,MAAM,KAAG,QAAQ,eAAe,CAAC,CAYjF;IAEI,GAAG;CAKV"}
1
+ {"version":3,"file":"StellarSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/stellar/StellarSignTransaction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,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O,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAGzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAmBnE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAQlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAoBxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBA6KjD,CAAC;AAuKF,eAAO,MAAM,MAAM,0CAkBlB,CAAC;AAiFF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA+BxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAGzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAmBnE,CAAC"}
@@ -5,7 +5,7 @@ import { Deferred } from '@onekeyfe/hd-shared';
5
5
  import DeviceConnector from './DeviceConnector';
6
6
  import { DeviceCommands } from './DeviceCommands';
7
7
  import type { Features, Device as DeviceTyped, UnavailableCapabilities } from '../types';
8
- import { DEVICE, DeviceButtonRequestPayload } from '../events';
8
+ import { DEVICE, DeviceButtonRequestPayload, DeviceFeaturesPayload } from '../events';
9
9
  import { PROTO } from '../constants';
10
10
  declare type RunOptions = {
11
11
  keepSession?: boolean;
@@ -14,6 +14,7 @@ export interface DeviceEvents {
14
14
  [DEVICE.PIN]: [Device, PROTO.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
15
15
  [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, ((response: any) => void)?];
16
16
  [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
17
+ [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
17
18
  }
18
19
  export interface Device {
19
20
  on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
@@ -1 +1 @@
1
- {"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../src/device/Device.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAkB,QAAQ,EAA6B,MAAM,qBAAqB,CAAC;AAE1F,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUlD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,WAAW,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAIrC,aAAK,UAAU,GAAG;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AASF,MAAM,WAAW,YAAY;IAC3B,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,GAAG,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC;IAChG,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,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} from '../types/device';
3
3
  import { MessageFactoryFn } from './utils';
4
4
  export declare const DEVICE_EVENT = "DEVICE_EVENT";
5
5
  export declare const DEVICE: {
@@ -19,6 +19,7 @@ export declare const DEVICE: {
19
19
  readonly PASSPHRASE: "passphrase";
20
20
  readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
21
21
  readonly WORD: "word";
22
+ readonly FEATURES: "features";
22
23
  };
23
24
  export interface DeviceButtonRequestPayload extends Omit<PROTO.ButtonRequest, 'code'> {
24
25
  code?: PROTO.ButtonRequest['code'] | 'ButtonRequest_FirmwareUpdate';
@@ -29,7 +30,12 @@ export interface DeviceButtonRequest {
29
30
  device: Device | null;
30
31
  };
31
32
  }
32
- export declare type DeviceEvent = DeviceButtonRequest;
33
+ export declare type DeviceFeaturesPayload = Features;
34
+ export interface DeviceSendFeatures {
35
+ type: typeof DEVICE.FEATURES;
36
+ payload: DeviceFeaturesPayload;
37
+ }
38
+ export declare type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures;
33
39
  export declare type DeviceEventMessage = DeviceEvent & {
34
40
  event: typeof DEVICE_EVENT;
35
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/events/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;CAqBT,CAAC;AAEX,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC;IACnF,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,8BAA8B,CAAC;CACrE;AAED,MAAM,W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;AAE7C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,MAAM,CAAC,QAAQ,CAAC;IAC7B,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED,oBAAY,WAAW,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAEnE,oBAAY,kBAAkB,GAAG,WAAW,GAAG;IAAE,KAAK,EAAE,OAAO,YAAY,CAAA;CAAE,CAAC;AAE9E,oBAAY,qBAAqB,GAAG,CAClC,IAAI,EAAE,OAAO,YAAY,EACzB,EAAE,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,KACpC,IAAI,CAAC;AAEV,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,YAAY,EAAE,WAAW,CAQxE,CAAC"}
@@ -1,17 +1,24 @@
1
1
  import { MessageFactoryFn } from './utils';
2
2
  import { getBleFirmwareReleaseInfo, getFirmwareReleaseInfo } from '../api/firmware/releaseHelper';
3
+ import { Features } from '../types';
3
4
  export declare const FIRMWARE_EVENT = "FIRMWARE_EVENT";
4
5
  export declare const FIRMWARE: {
5
6
  readonly RELEASE_INFO: "firmware-release-info";
6
7
  readonly BLE_RELEASE_INFO: "ble-firmware-release-info";
7
8
  };
9
+ export declare type ReleaseInfoPayload = ReturnType<typeof getFirmwareReleaseInfo> & {
10
+ features: Features;
11
+ };
8
12
  export interface ReleaseInfoEvent {
9
13
  type: typeof FIRMWARE.RELEASE_INFO;
10
- payload: ReturnType<typeof getFirmwareReleaseInfo>;
14
+ payload: ReleaseInfoPayload;
11
15
  }
16
+ export declare type BleReleaseInfoPayload = ReturnType<typeof getBleFirmwareReleaseInfo> & {
17
+ features: Features;
18
+ };
12
19
  export interface BleReleaseInfoEvent {
13
20
  type: typeof FIRMWARE.BLE_RELEASE_INFO;
14
- payload: ReturnType<typeof getBleFirmwareReleaseInfo>;
21
+ payload: BleReleaseInfoPayload;
15
22
  }
16
23
  export declare type FirmwareEvent = ReleaseInfoEvent | BleReleaseInfoEvent;
17
24
  export declare type FirmwareMessage = FirmwareEvent & {
@@ -1 +1 @@
1
- {"version":3,"file":"firmware.d.ts","sourceRoot":"","sources":["../../src/events/firmware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAElG,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,QAAQ,CAAC,YAAY,CAAC;IACnC,OAAO,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IACvC,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;CACvD;AAED,oBAAY,aAAa,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEnE,oBAAY,eAAe,GAAG,aAAa,GAAG;IAAE,KAAK,EAAE,OAAO,cAAc,CAAA;CAAE,CAAC;AAE/E,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,OAAO,cAAc,EAAE,aAAa,CAQ9E,CAAC"}
1
+ {"version":3,"file":"firmware.d.ts","sourceRoot":"","sources":["../../src/events/firmware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,oBAAY,kBAAkB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAC;AACpG,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,QAAQ,CAAC,YAAY,CAAC;IACnC,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,oBAAY,qBAAqB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,GAAG;IACjF,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IACvC,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED,oBAAY,aAAa,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEnE,oBAAY,eAAe,GAAG,aAAa,GAAG;IAAE,KAAK,EAAE,OAAO,cAAc,CAAA;CAAE,CAAC;AAE/E,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,OAAO,cAAc,EAAE,aAAa,CAQ9E,CAAC"}
package/dist/index.d.ts CHANGED
@@ -968,6 +968,7 @@ declare const DEVICE: {
968
968
  readonly PASSPHRASE: "passphrase";
969
969
  readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
970
970
  readonly WORD: "word";
971
+ readonly FEATURES: "features";
971
972
  };
972
973
  interface DeviceButtonRequestPayload extends Omit<Messages.ButtonRequest, 'code'> {
973
974
  code?: Messages.ButtonRequest['code'] | 'ButtonRequest_FirmwareUpdate';
@@ -978,7 +979,12 @@ interface DeviceButtonRequest {
978
979
  device: KnownDevice | null;
979
980
  };
980
981
  }
981
- declare type DeviceEvent = DeviceButtonRequest;
982
+ declare type DeviceFeaturesPayload = Features;
983
+ interface DeviceSendFeatures {
984
+ type: typeof DEVICE.FEATURES;
985
+ payload: DeviceFeaturesPayload;
986
+ }
987
+ declare type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures;
982
988
  declare type DeviceEventMessage = DeviceEvent & {
983
989
  event: typeof DEVICE_EVENT;
984
990
  };
@@ -1140,13 +1146,19 @@ declare const FIRMWARE: {
1140
1146
  readonly RELEASE_INFO: "firmware-release-info";
1141
1147
  readonly BLE_RELEASE_INFO: "ble-firmware-release-info";
1142
1148
  };
1149
+ declare type ReleaseInfoPayload = ReturnType<typeof getFirmwareReleaseInfo> & {
1150
+ features: Features;
1151
+ };
1143
1152
  interface ReleaseInfoEvent {
1144
1153
  type: typeof FIRMWARE.RELEASE_INFO;
1145
- payload: ReturnType<typeof getFirmwareReleaseInfo>;
1154
+ payload: ReleaseInfoPayload;
1146
1155
  }
1156
+ declare type BleReleaseInfoPayload = ReturnType<typeof getBleFirmwareReleaseInfo> & {
1157
+ features: Features;
1158
+ };
1147
1159
  interface BleReleaseInfoEvent {
1148
1160
  type: typeof FIRMWARE.BLE_RELEASE_INFO;
1149
- payload: ReturnType<typeof getBleFirmwareReleaseInfo>;
1161
+ payload: BleReleaseInfoPayload;
1150
1162
  }
1151
1163
  declare type FirmwareEvent = ReleaseInfoEvent | BleReleaseInfoEvent;
1152
1164
  declare type FirmwareMessage = FirmwareEvent & {
@@ -1226,6 +1238,7 @@ interface DeviceEvents {
1226
1238
  [DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
1227
1239
  [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, ((response: any) => void)?];
1228
1240
  [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
1241
+ [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
1229
1242
  }
1230
1243
  interface Device {
1231
1244
  on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
@@ -1393,4 +1406,4 @@ declare class DataManager {
1393
1406
 
1394
1407
  declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, }: InjectApi) => CoreApi;
1395
1408
 
1396
- export { AccountAddress, AccountAddresses, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BleReleaseInfoEvent, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSettingsParams, DeviceStatus, DeviceTypeMap, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FirmwareEvent, FirmwareMessage, FirmwareProgress, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, LOG, LOG_EVENT, LogEvent, LogEventMessage, LogOutput, LoggerNames, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, Params, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, TransactionOptions, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getHDPath, getLog, getLogger, getScriptType, getTimeStamp, httpRequest, init as initCore, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, versionCompare, versionSplit };
1409
+ export { AccountAddress, AccountAddresses, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSettingsParams, DeviceStatus, DeviceTypeMap, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FirmwareEvent, FirmwareMessage, FirmwareProgress, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, LOG, LOG_EVENT, LogEvent, LogEventMessage, LogOutput, LoggerNames, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, Params, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, TransactionOptions, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getHDPath, getLog, getLogger, getScriptType, getTimeStamp, httpRequest, init as initCore, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, versionCompare, versionSplit };
package/dist/index.js CHANGED
@@ -10090,6 +10090,7 @@ const DEVICE = {
10090
10090
  PASSPHRASE: 'passphrase',
10091
10091
  PASSPHRASE_ON_DEVICE: 'passphrase_on_device',
10092
10092
  WORD: 'word',
10093
+ FEATURES: 'features',
10093
10094
  };
10094
10095
  const createDeviceMessage = (type, payload) => ({
10095
10096
  event: DEVICE_EVENT,
@@ -10528,6 +10529,7 @@ class Device extends events.exports {
10528
10529
  feat.unlocked = feat.unlocked || true;
10529
10530
  this.features = feat;
10530
10531
  this.featuresNeedsReload = false;
10532
+ this.emit(DEVICE.FEATURES, this, feat);
10531
10533
  }
10532
10534
  updateDescriptor(descriptor, forceUpdate = false) {
10533
10535
  const env = DataManager.getSettings('env');
@@ -10573,6 +10575,9 @@ class Device extends events.exports {
10573
10575
  }
10574
10576
  catch (error) {
10575
10577
  this.runPromise = null;
10578
+ if (error instanceof hdShared.HardwareError) {
10579
+ return Promise.reject(error);
10580
+ }
10576
10581
  return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceInitializeFailed, `Initialize failed: ${error.message}, code: ${error.code}`));
10577
10582
  }
10578
10583
  }
@@ -10797,13 +10802,9 @@ class BaseMethod {
10797
10802
  if (!this.device || !this.device.features)
10798
10803
  return;
10799
10804
  const releaseInfo = getFirmwareReleaseInfo(this.device.features);
10800
- if (['outdated', 'required'].includes(releaseInfo.status)) {
10801
- this.postMessage(createFirmwareMessage(FIRMWARE.RELEASE_INFO, releaseInfo));
10802
- }
10805
+ this.postMessage(createFirmwareMessage(FIRMWARE.RELEASE_INFO, Object.assign(Object.assign({}, releaseInfo), { features: this.device.features })));
10803
10806
  const bleReleaseInfo = getBleFirmwareReleaseInfo(this.device.features);
10804
- if (['outdated', 'required'].includes(bleReleaseInfo.status)) {
10805
- this.postMessage(createFirmwareMessage(FIRMWARE.BLE_RELEASE_INFO, bleReleaseInfo));
10806
- }
10807
+ this.postMessage(createFirmwareMessage(FIRMWARE.BLE_RELEASE_INFO, Object.assign(Object.assign({}, bleReleaseInfo), { features: this.device.features })));
10807
10808
  }
10808
10809
  dispose() { }
10809
10810
  }
@@ -10955,6 +10956,7 @@ class CipherKeyValue extends BaseMethod {
10955
10956
  }
10956
10957
  init() {
10957
10958
  var _a;
10959
+ this.checkDeviceId = true;
10958
10960
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
10959
10961
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
10960
10962
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -11243,6 +11245,7 @@ class BTCGetAddress extends BaseMethod {
11243
11245
  this.hasBundle = false;
11244
11246
  }
11245
11247
  init() {
11248
+ this.checkDeviceId = true;
11246
11249
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11247
11250
  this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
11248
11251
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -11296,6 +11299,7 @@ class BTCGetPublicKey extends BaseMethod {
11296
11299
  this.hasBundle = false;
11297
11300
  }
11298
11301
  init() {
11302
+ this.checkDeviceId = true;
11299
11303
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11300
11304
  this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
11301
11305
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -11343,6 +11347,7 @@ class BTCGetPublicKey extends BaseMethod {
11343
11347
 
11344
11348
  class BTCSignMessage extends BaseMethod {
11345
11349
  init() {
11350
+ this.checkDeviceId = true;
11346
11351
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11347
11352
  validateParams(this.payload, [
11348
11353
  { name: 'path', required: true },
@@ -11641,6 +11646,7 @@ var signtxLegacy = (typedCall, inputs, outputs, refTxsArray, options, coinName)
11641
11646
 
11642
11647
  class BTCSignTransaction extends BaseMethod {
11643
11648
  init() {
11649
+ this.checkDeviceId = true;
11644
11650
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11645
11651
  validateParams(this.payload, [
11646
11652
  { name: 'coin', type: 'string', required: true },
@@ -11731,6 +11737,7 @@ class BTCSignTransaction extends BaseMethod {
11731
11737
 
11732
11738
  class BTCVerifyMessage extends BaseMethod {
11733
11739
  init() {
11740
+ this.checkDeviceId = true;
11734
11741
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11735
11742
  validateParams(this.payload, [
11736
11743
  { name: 'address', type: 'string', required: true },
@@ -12046,6 +12053,7 @@ class EvmGetAddress extends BaseMethod {
12046
12053
  }
12047
12054
  init() {
12048
12055
  var _a;
12056
+ this.checkDeviceId = true;
12049
12057
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12050
12058
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
12051
12059
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -12089,6 +12097,7 @@ class EVMGetPublicKey extends BaseMethod {
12089
12097
  }
12090
12098
  init() {
12091
12099
  var _a;
12100
+ this.checkDeviceId = true;
12092
12101
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12093
12102
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
12094
12103
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -12123,6 +12132,7 @@ class EVMGetPublicKey extends BaseMethod {
12123
12132
 
12124
12133
  class EVMSignMessage$2 extends BaseMethod {
12125
12134
  init() {
12135
+ this.checkDeviceId = true;
12126
12136
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12127
12137
  validateParams(this.payload, [
12128
12138
  { name: 'path', required: true },
@@ -12145,6 +12155,7 @@ class EVMSignMessage$2 extends BaseMethod {
12145
12155
 
12146
12156
  class EVMSignMessageEIP712 extends BaseMethod {
12147
12157
  init() {
12158
+ this.checkDeviceId = true;
12148
12159
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12149
12160
  validateParams(this.payload, [
12150
12161
  { name: 'path', required: true },
@@ -12258,6 +12269,7 @@ class EVMSignTransaction extends BaseMethod {
12258
12269
  });
12259
12270
  }
12260
12271
  init() {
12272
+ this.checkDeviceId = true;
12261
12273
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12262
12274
  validateParams(this.payload, [
12263
12275
  { name: 'path', required: true },
@@ -12424,6 +12436,7 @@ const getFieldType = (typeName, types) => {
12424
12436
 
12425
12437
  class EVMSignTypedData extends BaseMethod {
12426
12438
  init() {
12439
+ this.checkDeviceId = true;
12427
12440
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12428
12441
  validateParams(this.payload, [
12429
12442
  { name: 'path', required: true },
@@ -12586,6 +12599,7 @@ class EVMSignTypedData extends BaseMethod {
12586
12599
 
12587
12600
  class EVMSignMessage$1 extends BaseMethod {
12588
12601
  init() {
12602
+ this.checkDeviceId = true;
12589
12603
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12590
12604
  validateParams(this.payload, [
12591
12605
  { name: 'address', type: 'string', required: true },
@@ -12614,6 +12628,7 @@ class StarcoinGetAddress extends BaseMethod {
12614
12628
  }
12615
12629
  init() {
12616
12630
  var _a;
12631
+ this.checkDeviceId = true;
12617
12632
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12618
12633
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
12619
12634
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -12653,6 +12668,7 @@ class StarcoinGetPublicKey extends BaseMethod {
12653
12668
  }
12654
12669
  init() {
12655
12670
  var _a;
12671
+ this.checkDeviceId = true;
12656
12672
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12657
12673
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
12658
12674
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -12687,6 +12703,7 @@ class StarcoinGetPublicKey extends BaseMethod {
12687
12703
 
12688
12704
  class StarcoinSignMessage extends BaseMethod {
12689
12705
  init() {
12706
+ this.checkDeviceId = true;
12690
12707
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12691
12708
  validateParams(this.payload, [
12692
12709
  { name: 'path', required: true },
@@ -12709,6 +12726,7 @@ class StarcoinSignMessage extends BaseMethod {
12709
12726
 
12710
12727
  class StarcoinSignTransaction extends BaseMethod {
12711
12728
  init() {
12729
+ this.checkDeviceId = true;
12712
12730
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12713
12731
  validateParams(this.payload, [
12714
12732
  { name: 'path', required: true },
@@ -12731,6 +12749,7 @@ class StarcoinSignTransaction extends BaseMethod {
12731
12749
 
12732
12750
  class EVMSignMessage extends BaseMethod {
12733
12751
  init() {
12752
+ this.checkDeviceId = true;
12734
12753
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12735
12754
  validateParams(this.payload, [
12736
12755
  { name: 'publicKey', type: 'string', required: true },
@@ -12760,6 +12779,7 @@ class NEMGetAddress extends BaseMethod {
12760
12779
  }
12761
12780
  init() {
12762
12781
  var _a;
12782
+ this.checkDeviceId = true;
12763
12783
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12764
12784
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
12765
12785
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -12966,6 +12986,7 @@ class NEMSignTransaction extends BaseMethod {
12966
12986
  };
12967
12987
  }
12968
12988
  init() {
12989
+ this.checkDeviceId = true;
12969
12990
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12970
12991
  validateParams(this.payload, [
12971
12992
  { name: 'path', required: true },
@@ -12990,6 +13011,7 @@ class SolGetAddress extends BaseMethod {
12990
13011
  }
12991
13012
  init() {
12992
13013
  var _a;
13014
+ this.checkDeviceId = true;
12993
13015
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12994
13016
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
12995
13017
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -13033,6 +13055,7 @@ class SolSignTransaction extends BaseMethod {
13033
13055
  }
13034
13056
  init() {
13035
13057
  var _a;
13058
+ this.checkDeviceId = true;
13036
13059
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
13037
13060
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
13038
13061
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -13084,6 +13107,7 @@ class StellarGetAddress extends BaseMethod {
13084
13107
  }
13085
13108
  init() {
13086
13109
  var _a;
13110
+ this.checkDeviceId = true;
13087
13111
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
13088
13112
  this.hasBundle = !!((_a = this.payload) === null || _a === void 0 ? void 0 : _a.bundle);
13089
13113
  const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
@@ -13247,6 +13271,7 @@ class StellarSignTransaction extends BaseMethod {
13247
13271
  });
13248
13272
  }
13249
13273
  init() {
13274
+ this.checkDeviceId = true;
13250
13275
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
13251
13276
  validateParams(this.payload, [
13252
13277
  { name: 'path', required: true },
@@ -13693,9 +13718,8 @@ const callAPI = (message) => __awaiter(void 0, void 0, void 0, function* () {
13693
13718
  Log.debug('Call API - setDevice: ', device.mainId);
13694
13719
  (_a = method.setDevice) === null || _a === void 0 ? void 0 : _a.call(method, device);
13695
13720
  device.on(DEVICE.PIN, onDevicePinHandler);
13696
- device.on(DEVICE.BUTTON, (d, code) => {
13697
- onDeviceButtonHandler(d, code);
13698
- });
13721
+ device.on(DEVICE.BUTTON, onDeviceButtonHandler);
13722
+ device.on(DEVICE.FEATURES, onDeviceFeaturesHandler);
13699
13723
  try {
13700
13724
  const inner = () => __awaiter(void 0, void 0, void 0, function* () {
13701
13725
  const deviceType = getDeviceType(device.features);
@@ -13775,6 +13799,7 @@ const callAPI = (message) => __awaiter(void 0, void 0, void 0, function* () {
13775
13799
  }
13776
13800
  closePopup();
13777
13801
  cleanup();
13802
+ removeDeviceListener(device);
13778
13803
  }
13779
13804
  });
13780
13805
  function initDeviceList(method) {
@@ -13842,14 +13867,14 @@ const ensureConnected = (method, pollingId) => __awaiter(void 0, void 0, void 0,
13842
13867
  return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
13843
13868
  if (!pollingState[pollingId]) {
13844
13869
  Log.debug('EnsureConnected function stop, polling id: ', pollingId);
13845
- reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Polling stop'));
13870
+ reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.PollingStop));
13846
13871
  return;
13847
13872
  }
13848
13873
  if (timer) {
13849
13874
  clearTimeout(timer);
13850
13875
  }
13851
13876
  timer = setTimeout(() => {
13852
- reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Polling timeout'));
13877
+ reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.PollingTimeout));
13853
13878
  }, TIME_OUT);
13854
13879
  tryCount += 1;
13855
13880
  Log.debug('EnsureConnected function try count: ', tryCount, ' poll interval time: ', time);
@@ -13858,7 +13883,8 @@ const ensureConnected = (method, pollingId) => __awaiter(void 0, void 0, void 0,
13858
13883
  }
13859
13884
  catch (error) {
13860
13885
  Log.debug('device list error: ', error);
13861
- if (error.errorCode === hdShared.HardwareErrorCode.BridgeNotInstalled) {
13886
+ if ([hdShared.HardwareErrorCode.BridgeNotInstalled, hdShared.HardwareErrorCode.BridgeTimeoutError].includes(error.errorCode)) {
13887
+ _deviceList = undefined;
13862
13888
  reject(error);
13863
13889
  return;
13864
13890
  }
@@ -13889,7 +13915,12 @@ const ensureConnected = (method, pollingId) => __awaiter(void 0, void 0, void 0,
13889
13915
  }
13890
13916
  catch (error) {
13891
13917
  Log.debug('device error: ', error);
13892
- if (error.errorCode === hdShared.HardwareErrorCode.BlePermissionError) {
13918
+ if ([
13919
+ hdShared.HardwareErrorCode.BlePermissionError,
13920
+ hdShared.HardwareErrorCode.BleLocationError,
13921
+ hdShared.HardwareErrorCode.BleDeviceNotBonded,
13922
+ hdShared.HardwareErrorCode.BleCharacteristicNotifyError,
13923
+ ].includes(error.errorCode)) {
13893
13924
  reject(error);
13894
13925
  return;
13895
13926
  }
@@ -13932,6 +13963,11 @@ const cleanup = () => {
13932
13963
  _uiPromises = [];
13933
13964
  Log.debug('Cleanup...');
13934
13965
  };
13966
+ const removeDeviceListener = (device) => {
13967
+ device.removeListener(DEVICE.PIN, onDevicePinHandler);
13968
+ device.removeListener(DEVICE.BUTTON, onDeviceButtonHandler);
13969
+ device.removeListener(DEVICE.FEATURES, onDeviceFeaturesHandler);
13970
+ };
13935
13971
  const closePopup = () => {
13936
13972
  postMessage(createUiMessage(UI_REQUEST$1.CLOSE_UI_WINDOW));
13937
13973
  };
@@ -13957,6 +13993,9 @@ const onDeviceButtonHandler = (...[device, request]) => {
13957
13993
  postMessage(createUiMessage(UI_REQUEST$1.REQUEST_BUTTON, { device: device.toMessageObject() }));
13958
13994
  }
13959
13995
  };
13996
+ const onDeviceFeaturesHandler = (...[_, features]) => {
13997
+ postMessage(createDeviceMessage(DEVICE.FEATURES, Object.assign({}, features)));
13998
+ };
13960
13999
  const postMessage = (message) => {
13961
14000
  _core.emit(CORE_EVENT, message);
13962
14001
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.1.18",
3
+ "version": "0.1.21",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@onekeyfe/hd-shared": "^0.1.18",
29
- "@onekeyfe/hd-transport": "^0.1.18",
28
+ "@onekeyfe/hd-shared": "^0.1.21",
29
+ "@onekeyfe/hd-transport": "^0.1.21",
30
30
  "axios": "^0.27.2",
31
31
  "bignumber.js": "^9.0.2",
32
32
  "js-sha256": "^0.9.0",
@@ -37,5 +37,5 @@
37
37
  "@types/parse-uri": "^1.0.0",
38
38
  "@types/semver": "^7.3.9"
39
39
  },
40
- "gitHead": "eebfd1dd46b146c64a8bfda691dc4d8402fa105b"
40
+ "gitHead": "807593129b0b2e55dc2beeb7b824494ec8cb07ad"
41
41
  }
@@ -96,13 +96,19 @@ export abstract class BaseMethod<Params = undefined> {
96
96
  checkFirmwareRelease() {
97
97
  if (!this.device || !this.device.features) return;
98
98
  const releaseInfo = getFirmwareReleaseInfo(this.device.features);
99
- if (['outdated', 'required'].includes(releaseInfo.status)) {
100
- this.postMessage(createFirmwareMessage(FIRMWARE.RELEASE_INFO, releaseInfo));
101
- }
99
+ this.postMessage(
100
+ createFirmwareMessage(FIRMWARE.RELEASE_INFO, {
101
+ ...releaseInfo,
102
+ features: this.device.features,
103
+ })
104
+ );
102
105
  const bleReleaseInfo = getBleFirmwareReleaseInfo(this.device.features);
103
- if (['outdated', 'required'].includes(bleReleaseInfo.status)) {
104
- this.postMessage(createFirmwareMessage(FIRMWARE.BLE_RELEASE_INFO, bleReleaseInfo));
105
- }
106
+ this.postMessage(
107
+ createFirmwareMessage(FIRMWARE.BLE_RELEASE_INFO, {
108
+ ...bleReleaseInfo,
109
+ features: this.device.features,
110
+ })
111
+ );
106
112
  }
107
113
 
108
114
  dispose() {}
@@ -10,6 +10,7 @@ export default class CipherKeyValue extends BaseMethod<HardwareCipherKeyValue[]>
10
10
  hasBundle = false;
11
11
 
12
12
  init() {
13
+ this.checkDeviceId = true;
13
14
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
14
15
 
15
16
  this.hasBundle = !!this.payload?.bundle;
@@ -10,6 +10,7 @@ export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
10
10
  hasBundle = false;
11
11
 
12
12
  init() {
13
+ this.checkDeviceId = true;
13
14
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
14
15
 
15
16
  this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
@@ -11,6 +11,7 @@ export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
11
11
  hasBundle = false;
12
12
 
13
13
  init() {
14
+ this.checkDeviceId = true;
14
15
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
15
16
 
16
17
  this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
@@ -8,6 +8,7 @@ import { getCoinAndScriptType } from './helpers/btcParamsUtils';
8
8
 
9
9
  export default class BTCSignMessage extends BaseMethod<SignMessage> {
10
10
  init() {
11
+ this.checkDeviceId = true;
11
12
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12
13
 
13
14
  validateParams(this.payload, [
@@ -25,6 +25,7 @@ type Params = {
25
25
  };
26
26
  export default class BTCSignTransaction extends BaseMethod<Params> {
27
27
  init() {
28
+ this.checkDeviceId = true;
28
29
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
29
30
 
30
31
  validateParams(this.payload, [
@@ -8,6 +8,7 @@ import { getCoinInfo } from './helpers/btcParamsUtils';
8
8
 
9
9
  export default class BTCVerifyMessage extends BaseMethod<VerifyMessage> {
10
10
  init() {
11
+ this.checkDeviceId = true;
11
12
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
12
13
 
13
14
  validateParams(this.payload, [
@@ -9,6 +9,7 @@ export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {
9
9
  hasBundle = false;
10
10
 
11
11
  init() {
12
+ this.checkDeviceId = true;
12
13
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
13
14
 
14
15
  this.hasBundle = !!this.payload?.bundle;
@@ -9,6 +9,7 @@ export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKey[]>
9
9
  hasBundle = false;
10
10
 
11
11
  init() {
12
+ this.checkDeviceId = true;
12
13
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
13
14
 
14
15
  this.hasBundle = !!this.payload?.bundle;
@@ -7,6 +7,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
7
7
 
8
8
  export default class EVMSignMessage extends BaseMethod<EthereumSignMessage> {
9
9
  init() {
10
+ this.checkDeviceId = true;
10
11
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11
12
 
12
13
  // check payload
@@ -7,6 +7,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
7
7
 
8
8
  export default class EVMSignMessageEIP712 extends BaseMethod<EthereumSignMessageEIP712> {
9
9
  init() {
10
+ this.checkDeviceId = true;
10
11
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11
12
 
12
13
  validateParams(this.payload, [
@@ -22,6 +22,7 @@ export default class EVMSignTransaction extends BaseMethod {
22
22
  formattedTx: EVMTransaction | EVMTransactionEIP1559 | undefined;
23
23
 
24
24
  init() {
25
+ this.checkDeviceId = true;
25
26
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
26
27
 
27
28
  validateParams(this.payload, [
@@ -26,6 +26,7 @@ export type EVMSignTypedDataParams = {
26
26
 
27
27
  export default class EVMSignTypedData extends BaseMethod<EVMSignTypedDataParams> {
28
28
  init() {
29
+ this.checkDeviceId = true;
29
30
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
30
31
 
31
32
  validateParams(this.payload, [
@@ -6,6 +6,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
6
6
 
7
7
  export default class EVMSignMessage extends BaseMethod<EthereumVerifyMessage> {
8
8
  init() {
9
+ this.checkDeviceId = true;
9
10
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
10
11
 
11
12
  validateParams(this.payload, [
@@ -11,6 +11,7 @@ export default class NEMGetAddress extends BaseMethod<HardwareNEMGetAddress[]> {
11
11
  hasBundle = false;
12
12
 
13
13
  init() {
14
+ this.checkDeviceId = true;
14
15
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
15
16
 
16
17
  this.hasBundle = !!this.payload?.bundle;
@@ -227,6 +227,7 @@ export default class NEMSignTransaction extends BaseMethod<NEMSignTx> {
227
227
  };
228
228
 
229
229
  init() {
230
+ this.checkDeviceId = true;
230
231
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
231
232
 
232
233
  validateParams(this.payload, [
@@ -9,6 +9,7 @@ export default class SolGetAddress extends BaseMethod<SolanaGetAddress[]> {
9
9
  hasBundle = false;
10
10
 
11
11
  init() {
12
+ this.checkDeviceId = true;
12
13
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
13
14
 
14
15
  this.hasBundle = !!this.payload?.bundle;
@@ -10,6 +10,7 @@ export default class SolSignTransaction extends BaseMethod<HardwareSolanaSignTx[
10
10
  hasBundle = false;
11
11
 
12
12
  init() {
13
+ this.checkDeviceId = true;
13
14
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
14
15
 
15
16
  this.hasBundle = !!this.payload?.bundle;
@@ -9,6 +9,7 @@ export default class StarcoinGetAddress extends BaseMethod<HardwareStarcoinGetAd
9
9
  hasBundle = false;
10
10
 
11
11
  init() {
12
+ this.checkDeviceId = true;
12
13
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
13
14
 
14
15
  this.hasBundle = !!this.payload?.bundle;
@@ -12,6 +12,7 @@ export default class StarcoinGetPublicKey extends BaseMethod<HardwareStarcoinGet
12
12
  hasBundle = false;
13
13
 
14
14
  init() {
15
+ this.checkDeviceId = true;
15
16
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
16
17
 
17
18
  this.hasBundle = !!this.payload?.bundle;
@@ -7,6 +7,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
7
7
 
8
8
  export default class StarcoinSignMessage extends BaseMethod<HardwareStarcoinSignMessage> {
9
9
  init() {
10
+ this.checkDeviceId = true;
10
11
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11
12
 
12
13
  // check payload
@@ -7,6 +7,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
7
7
 
8
8
  export default class StarcoinSignTransaction extends BaseMethod<StarcoinSignTx> {
9
9
  init() {
10
+ this.checkDeviceId = true;
10
11
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
11
12
 
12
13
  // check payload
@@ -6,6 +6,7 @@ import { formatAnyHex } from '../helpers/hexUtils';
6
6
 
7
7
  export default class EVMSignMessage extends BaseMethod<HardwareStarcoinVerifyMessage> {
8
8
  init() {
9
+ this.checkDeviceId = true;
9
10
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
10
11
 
11
12
  validateParams(this.payload, [
@@ -9,6 +9,7 @@ export default class StellarGetAddress extends BaseMethod<HardwareStellarGetAddr
9
9
  hasBundle = false;
10
10
 
11
11
  init() {
12
+ this.checkDeviceId = true;
12
13
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
13
14
 
14
15
  this.hasBundle = !!this.payload?.bundle;
@@ -1,7 +1,4 @@
1
- import {
2
- StellarSignedTx,
3
- StellarSignTx as HardwareStellarSignTx,
4
- } from '@onekeyfe/hd-transport';
1
+ import { StellarSignedTx, StellarSignTx as HardwareStellarSignTx } from '@onekeyfe/hd-transport';
5
2
  import { UI_REQUEST } from '../../constants/ui-request';
6
3
  import { validatePath } from '../helpers/pathUtils';
7
4
  import { BaseMethod } from '../BaseMethod';
@@ -146,6 +143,7 @@ export default class StellarSignTransaction extends BaseMethod<HardwareStellarSi
146
143
  };
147
144
 
148
145
  init() {
146
+ this.checkDeviceId = true;
149
147
  this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
150
148
 
151
149
  // check payload
package/src/core/index.ts CHANGED
@@ -95,9 +95,8 @@ export const callAPI = async (message: CoreMessage) => {
95
95
  method.setDevice?.(device);
96
96
 
97
97
  device.on(DEVICE.PIN, onDevicePinHandler);
98
- device.on(DEVICE.BUTTON, (d, code) => {
99
- onDeviceButtonHandler(d, code);
100
- });
98
+ device.on(DEVICE.BUTTON, onDeviceButtonHandler);
99
+ device.on(DEVICE.FEATURES, onDeviceFeaturesHandler);
101
100
 
102
101
  try {
103
102
  const inner = async (): Promise<void> => {
@@ -214,6 +213,8 @@ export const callAPI = async (message: CoreMessage) => {
214
213
  closePopup();
215
214
 
216
215
  cleanup();
216
+
217
+ removeDeviceListener(device);
217
218
  // TODO: 方法执行后,检查队列内是否有等待调用的 API,依次调用
218
219
  }
219
220
  };
@@ -298,7 +299,7 @@ const ensureConnected = async (method: BaseMethod, pollingId: number) => {
298
299
  new Promise(async (resolve, reject) => {
299
300
  if (!pollingState[pollingId]) {
300
301
  Log.debug('EnsureConnected function stop, polling id: ', pollingId);
301
- reject(ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'Polling stop'));
302
+ reject(ERRORS.TypedError(HardwareErrorCode.PollingStop));
302
303
  return;
303
304
  }
304
305
 
@@ -307,7 +308,7 @@ const ensureConnected = async (method: BaseMethod, pollingId: number) => {
307
308
  clearTimeout(timer);
308
309
  }
309
310
  timer = setTimeout(() => {
310
- reject(ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'Polling timeout'));
311
+ reject(ERRORS.TypedError(HardwareErrorCode.PollingTimeout));
311
312
  }, TIME_OUT);
312
313
 
313
314
  tryCount += 1;
@@ -316,7 +317,12 @@ const ensureConnected = async (method: BaseMethod, pollingId: number) => {
316
317
  await initDeviceList(method);
317
318
  } catch (error) {
318
319
  Log.debug('device list error: ', error);
319
- if (error.errorCode === HardwareErrorCode.BridgeNotInstalled) {
320
+ if (
321
+ [HardwareErrorCode.BridgeNotInstalled, HardwareErrorCode.BridgeTimeoutError].includes(
322
+ error.errorCode
323
+ )
324
+ ) {
325
+ _deviceList = undefined;
320
326
  reject(error);
321
327
  return;
322
328
  }
@@ -350,7 +356,14 @@ const ensureConnected = async (method: BaseMethod, pollingId: number) => {
350
356
  }
351
357
  } catch (error) {
352
358
  Log.debug('device error: ', error);
353
- if (error.errorCode === HardwareErrorCode.BlePermissionError) {
359
+ if (
360
+ [
361
+ HardwareErrorCode.BlePermissionError,
362
+ HardwareErrorCode.BleLocationError,
363
+ HardwareErrorCode.BleDeviceNotBonded,
364
+ HardwareErrorCode.BleCharacteristicNotifyError,
365
+ ].includes(error.errorCode)
366
+ ) {
354
367
  reject(error);
355
368
  return;
356
369
  }
@@ -396,6 +409,12 @@ const cleanup = () => {
396
409
  Log.debug('Cleanup...');
397
410
  };
398
411
 
412
+ const removeDeviceListener = (device: Device) => {
413
+ device.removeListener(DEVICE.PIN, onDevicePinHandler);
414
+ device.removeListener(DEVICE.BUTTON, onDeviceButtonHandler);
415
+ device.removeListener(DEVICE.FEATURES, onDeviceFeaturesHandler);
416
+ };
417
+
399
418
  /**
400
419
  * Force close popup
401
420
  */
@@ -435,6 +454,10 @@ const onDeviceButtonHandler = (...[device, request]: [...DeviceEvents['button']]
435
454
  }
436
455
  };
437
456
 
457
+ const onDeviceFeaturesHandler = (...[_, features]: [...DeviceEvents['features']]) => {
458
+ postMessage(createDeviceMessage(DEVICE.FEATURES, { ...features }));
459
+ };
460
+
438
461
  /**
439
462
  * Emit message to listener (parent).
440
463
  * Clear method reference from _callMethods
@@ -1,6 +1,12 @@
1
1
  import EventEmitter from 'events';
2
2
  import { OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
3
- import { createDeferred, Deferred, HardwareErrorCode, ERRORS } from '@onekeyfe/hd-shared';
3
+ import {
4
+ createDeferred,
5
+ Deferred,
6
+ HardwareErrorCode,
7
+ ERRORS,
8
+ HardwareError,
9
+ } from '@onekeyfe/hd-shared';
4
10
 
5
11
  import DeviceConnector from './DeviceConnector';
6
12
  import { DeviceCommands } from './DeviceCommands';
@@ -14,7 +20,7 @@ import {
14
20
  getDeviceTypeOnBootloader,
15
21
  } from '../utils/deviceFeaturesUtils';
16
22
  import type { Features, Device as DeviceTyped, UnavailableCapabilities } from '../types';
17
- import { DEVICE, DeviceButtonRequestPayload } from '../events';
23
+ import { DEVICE, DeviceButtonRequestPayload, DeviceFeaturesPayload } from '../events';
18
24
  import { UI_REQUEST } from '../constants/ui-request';
19
25
  import { PROTO } from '../constants';
20
26
  import { getLogger, LoggerNames } from '../utils';
@@ -35,6 +41,7 @@ export interface DeviceEvents {
35
41
  [DEVICE.PIN]: [Device, PROTO.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
36
42
  [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, ((response: any) => void)?];
37
43
  [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
44
+ [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
38
45
  }
39
46
 
40
47
  export interface Device {
@@ -263,6 +270,7 @@ export class Device extends EventEmitter {
263
270
 
264
271
  this.features = feat;
265
272
  this.featuresNeedsReload = false;
273
+ this.emit(DEVICE.FEATURES, this, feat);
266
274
  }
267
275
 
268
276
  /**
@@ -317,6 +325,9 @@ export class Device extends EventEmitter {
317
325
  }
318
326
  } catch (error) {
319
327
  this.runPromise = null;
328
+ if (error instanceof HardwareError) {
329
+ return Promise.reject(error);
330
+ }
320
331
  return Promise.reject(
321
332
  ERRORS.TypedError(
322
333
  HardwareErrorCode.DeviceInitializeFailed,
@@ -1,5 +1,5 @@
1
1
  import type { PROTO } from '../constants';
2
- import type { KnownDevice as Device } from '../types/device';
2
+ import type { Features, KnownDevice as Device } from '../types/device';
3
3
  import { MessageFactoryFn } from './utils';
4
4
 
5
5
  export const DEVICE_EVENT = 'DEVICE_EVENT';
@@ -24,6 +24,8 @@ export const DEVICE = {
24
24
  PASSPHRASE: 'passphrase',
25
25
  PASSPHRASE_ON_DEVICE: 'passphrase_on_device',
26
26
  WORD: 'word',
27
+
28
+ FEATURES: 'features',
27
29
  } as const;
28
30
 
29
31
  export interface DeviceButtonRequestPayload extends Omit<PROTO.ButtonRequest, 'code'> {
@@ -35,7 +37,14 @@ export interface DeviceButtonRequest {
35
37
  payload: DeviceButtonRequestPayload & { device: Device | null };
36
38
  }
37
39
 
38
- export type DeviceEvent = DeviceButtonRequest;
40
+ export type DeviceFeaturesPayload = Features;
41
+
42
+ export interface DeviceSendFeatures {
43
+ type: typeof DEVICE.FEATURES;
44
+ payload: DeviceFeaturesPayload;
45
+ }
46
+
47
+ export type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures;
39
48
 
40
49
  export type DeviceEventMessage = DeviceEvent & { event: typeof DEVICE_EVENT };
41
50
 
@@ -1,5 +1,6 @@
1
1
  import { MessageFactoryFn } from './utils';
2
2
  import { getBleFirmwareReleaseInfo, getFirmwareReleaseInfo } from '../api/firmware/releaseHelper';
3
+ import { Features } from '../types';
3
4
 
4
5
  export const FIRMWARE_EVENT = 'FIRMWARE_EVENT';
5
6
  export const FIRMWARE = {
@@ -7,14 +8,19 @@ export const FIRMWARE = {
7
8
  BLE_RELEASE_INFO: 'ble-firmware-release-info',
8
9
  } as const;
9
10
 
11
+ export type ReleaseInfoPayload = ReturnType<typeof getFirmwareReleaseInfo> & { features: Features };
10
12
  export interface ReleaseInfoEvent {
11
13
  type: typeof FIRMWARE.RELEASE_INFO;
12
- payload: ReturnType<typeof getFirmwareReleaseInfo>;
14
+ payload: ReleaseInfoPayload;
13
15
  }
14
16
 
17
+ export type BleReleaseInfoPayload = ReturnType<typeof getBleFirmwareReleaseInfo> & {
18
+ features: Features;
19
+ };
20
+
15
21
  export interface BleReleaseInfoEvent {
16
22
  type: typeof FIRMWARE.BLE_RELEASE_INFO;
17
- payload: ReturnType<typeof getBleFirmwareReleaseInfo>;
23
+ payload: BleReleaseInfoPayload;
18
24
  }
19
25
 
20
26
  export type FirmwareEvent = ReleaseInfoEvent | BleReleaseInfoEvent;