@ledgerhq/device-trusted-app-kit-ledger-keyring-protocol 0.0.0-develop-20250808001323

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 (510) hide show
  1. package/LICENSE.MD +202 -0
  2. package/README.md +32 -0
  3. package/lib/cjs/api/LedgerKeyringProtocol.js +2 -0
  4. package/lib/cjs/api/LedgerKeyringProtocol.js.map +7 -0
  5. package/lib/cjs/api/LedgerKeyringProtocolBuilder.js +2 -0
  6. package/lib/cjs/api/LedgerKeyringProtocolBuilder.js.map +7 -0
  7. package/lib/cjs/api/app-binder/AddToTrustchainDeviceActionTypes.js +2 -0
  8. package/lib/cjs/api/app-binder/AddToTrustchainDeviceActionTypes.js.map +7 -0
  9. package/lib/cjs/api/app-binder/AuthenticateDeviceActionTypes.js +2 -0
  10. package/lib/cjs/api/app-binder/AuthenticateDeviceActionTypes.js.map +7 -0
  11. package/lib/cjs/api/app-binder/Errors.js +2 -0
  12. package/lib/cjs/api/app-binder/Errors.js.map +7 -0
  13. package/lib/cjs/api/app-binder/GetAppNameCommandTypes.js +2 -0
  14. package/lib/cjs/api/app-binder/GetAppNameCommandTypes.js.map +7 -0
  15. package/lib/cjs/api/app-binder/GetSeedIdCommandTypes.js +2 -0
  16. package/lib/cjs/api/app-binder/GetSeedIdCommandTypes.js.map +7 -0
  17. package/lib/cjs/api/app-binder/GetVersionCommandTypes.js +2 -0
  18. package/lib/cjs/api/app-binder/GetVersionCommandTypes.js.map +7 -0
  19. package/lib/cjs/api/app-binder/GetVersionDeviceActionTypes.js +2 -0
  20. package/lib/cjs/api/app-binder/GetVersionDeviceActionTypes.js.map +7 -0
  21. package/lib/cjs/api/app-binder/InitCommandTypes.js +2 -0
  22. package/lib/cjs/api/app-binder/InitCommandTypes.js.map +7 -0
  23. package/lib/cjs/api/app-binder/KeypairFromBytes.js +2 -0
  24. package/lib/cjs/api/app-binder/KeypairFromBytes.js.map +7 -0
  25. package/lib/cjs/api/app-binder/LKRPTypes.js +2 -0
  26. package/lib/cjs/api/app-binder/LKRPTypes.js.map +7 -0
  27. package/lib/cjs/api/app-binder/ParseStreamBlockCommandCommandTypes.js +2 -0
  28. package/lib/cjs/api/app-binder/ParseStreamBlockCommandCommandTypes.js.map +7 -0
  29. package/lib/cjs/api/app-binder/ParseStreamBlockHeaderCommandTypes.js +2 -0
  30. package/lib/cjs/api/app-binder/ParseStreamBlockHeaderCommandTypes.js.map +7 -0
  31. package/lib/cjs/api/app-binder/ParseStreamBlockSignatureTypes.js +2 -0
  32. package/lib/cjs/api/app-binder/ParseStreamBlockSignatureTypes.js.map +7 -0
  33. package/lib/cjs/api/app-binder/SetTrustedMemberTypes.js +2 -0
  34. package/lib/cjs/api/app-binder/SetTrustedMemberTypes.js.map +7 -0
  35. package/lib/cjs/api/app-binder/SignBlockCommandTypes.js +2 -0
  36. package/lib/cjs/api/app-binder/SignBlockCommandTypes.js.map +7 -0
  37. package/lib/cjs/api/app-binder/SignBlockHeaderCommandTypes.js +2 -0
  38. package/lib/cjs/api/app-binder/SignBlockHeaderCommandTypes.js.map +7 -0
  39. package/lib/cjs/api/app-binder/SignBlockSignatureCommandTypes.js +2 -0
  40. package/lib/cjs/api/app-binder/SignBlockSignatureCommandTypes.js.map +7 -0
  41. package/lib/cjs/api/app-binder/SignBlockSingleCommandTypes.js +2 -0
  42. package/lib/cjs/api/app-binder/SignBlockSingleCommandTypes.js.map +7 -0
  43. package/lib/cjs/api/index.js +2 -0
  44. package/lib/cjs/api/index.js.map +7 -0
  45. package/lib/cjs/index.js +2 -0
  46. package/lib/cjs/index.js.map +7 -0
  47. package/lib/cjs/internal/DefaultLedgerKeyringProtocol.js +2 -0
  48. package/lib/cjs/internal/DefaultLedgerKeyringProtocol.js.map +7 -0
  49. package/lib/cjs/internal/app-binder/LedgerKeyringProtocolBinder.js +2 -0
  50. package/lib/cjs/internal/app-binder/LedgerKeyringProtocolBinder.js.map +7 -0
  51. package/lib/cjs/internal/app-binder/command/GetAppNameCommand.js +2 -0
  52. package/lib/cjs/internal/app-binder/command/GetAppNameCommand.js.map +7 -0
  53. package/lib/cjs/internal/app-binder/command/GetSeedIdCommand.js +2 -0
  54. package/lib/cjs/internal/app-binder/command/GetSeedIdCommand.js.map +7 -0
  55. package/lib/cjs/internal/app-binder/command/GetSeedIdCommand.test.js +27 -0
  56. package/lib/cjs/internal/app-binder/command/GetSeedIdCommand.test.js.map +7 -0
  57. package/lib/cjs/internal/app-binder/command/GetVersionCommand.js +2 -0
  58. package/lib/cjs/internal/app-binder/command/GetVersionCommand.js.map +7 -0
  59. package/lib/cjs/internal/app-binder/command/InitCommand.js +2 -0
  60. package/lib/cjs/internal/app-binder/command/InitCommand.js.map +7 -0
  61. package/lib/cjs/internal/app-binder/command/InitCommand.test.js +2 -0
  62. package/lib/cjs/internal/app-binder/command/InitCommand.test.js.map +7 -0
  63. package/lib/cjs/internal/app-binder/command/ParseBlockSignatureCommand.js +2 -0
  64. package/lib/cjs/internal/app-binder/command/ParseBlockSignatureCommand.js.map +7 -0
  65. package/lib/cjs/internal/app-binder/command/ParseBlockSignatureCommand.test.js +2 -0
  66. package/lib/cjs/internal/app-binder/command/ParseBlockSignatureCommand.test.js.map +7 -0
  67. package/lib/cjs/internal/app-binder/command/ParseStreamBlockCommand.js +2 -0
  68. package/lib/cjs/internal/app-binder/command/ParseStreamBlockCommand.js.map +7 -0
  69. package/lib/cjs/internal/app-binder/command/ParseStreamBlockCommand.test.js +2 -0
  70. package/lib/cjs/internal/app-binder/command/ParseStreamBlockCommand.test.js.map +7 -0
  71. package/lib/cjs/internal/app-binder/command/ParseStreamBlockHeader.js +2 -0
  72. package/lib/cjs/internal/app-binder/command/ParseStreamBlockHeader.js.map +7 -0
  73. package/lib/cjs/internal/app-binder/command/ParseStreamBlockHeader.test.js +2 -0
  74. package/lib/cjs/internal/app-binder/command/ParseStreamBlockHeader.test.js.map +7 -0
  75. package/lib/cjs/internal/app-binder/command/SetTrustedMemberCommand.js +2 -0
  76. package/lib/cjs/internal/app-binder/command/SetTrustedMemberCommand.js.map +7 -0
  77. package/lib/cjs/internal/app-binder/command/SetTrustedMemberCommand.test.js +2 -0
  78. package/lib/cjs/internal/app-binder/command/SetTrustedMemberCommand.test.js.map +7 -0
  79. package/lib/cjs/internal/app-binder/command/SignBlockHeader.js +2 -0
  80. package/lib/cjs/internal/app-binder/command/SignBlockHeader.js.map +7 -0
  81. package/lib/cjs/internal/app-binder/command/SignBlockHeader.test.js +2 -0
  82. package/lib/cjs/internal/app-binder/command/SignBlockHeader.test.js.map +7 -0
  83. package/lib/cjs/internal/app-binder/command/SignBlockSignatureCommand.js +2 -0
  84. package/lib/cjs/internal/app-binder/command/SignBlockSignatureCommand.js.map +7 -0
  85. package/lib/cjs/internal/app-binder/command/SignBlockSignatureCommand.test.js +2 -0
  86. package/lib/cjs/internal/app-binder/command/SignBlockSignatureCommand.test.js.map +7 -0
  87. package/lib/cjs/internal/app-binder/command/SignBlockSingleCommand.js +2 -0
  88. package/lib/cjs/internal/app-binder/command/SignBlockSingleCommand.js.map +7 -0
  89. package/lib/cjs/internal/app-binder/command/SignBlockSingleCommand.test.js +2 -0
  90. package/lib/cjs/internal/app-binder/command/SignBlockSingleCommand.test.js.map +7 -0
  91. package/lib/cjs/internal/app-binder/command/utils/extractTrustedProperty.js +2 -0
  92. package/lib/cjs/internal/app-binder/command/utils/extractTrustedProperty.js.map +7 -0
  93. package/lib/cjs/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.js +2 -0
  94. package/lib/cjs/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.js.map +7 -0
  95. package/lib/cjs/internal/app-binder/device-action/AddToTrustchainDeviceAction.js +2 -0
  96. package/lib/cjs/internal/app-binder/device-action/AddToTrustchainDeviceAction.js.map +7 -0
  97. package/lib/cjs/internal/app-binder/device-action/AuthenticateDeviceAction.js +2 -0
  98. package/lib/cjs/internal/app-binder/device-action/AuthenticateDeviceAction.js.map +7 -0
  99. package/lib/cjs/internal/app-binder/device-action/utils/raiseAndAssign.js +2 -0
  100. package/lib/cjs/internal/app-binder/device-action/utils/raiseAndAssign.js.map +7 -0
  101. package/lib/cjs/internal/app-binder/di/appBinderModule.js +2 -0
  102. package/lib/cjs/internal/app-binder/di/appBinderModule.js.map +7 -0
  103. package/lib/cjs/internal/app-binder/di/appBinderTypes.js +2 -0
  104. package/lib/cjs/internal/app-binder/di/appBinderTypes.js.map +7 -0
  105. package/lib/cjs/internal/app-binder/task/InitTask.js +2 -0
  106. package/lib/cjs/internal/app-binder/task/InitTask.js.map +7 -0
  107. package/lib/cjs/internal/app-binder/task/ParseStreamToDeviceTask.js +2 -0
  108. package/lib/cjs/internal/app-binder/task/ParseStreamToDeviceTask.js.map +7 -0
  109. package/lib/cjs/internal/app-binder/task/SignBlockTask.js +2 -0
  110. package/lib/cjs/internal/app-binder/task/SignBlockTask.js.map +7 -0
  111. package/lib/cjs/internal/app-binder/task/SignChallengeWithDeviceTask.js +2 -0
  112. package/lib/cjs/internal/app-binder/task/SignChallengeWithDeviceTask.js.map +7 -0
  113. package/lib/cjs/internal/app-binder/task/SignChallengeWithKeypairTask.js +2 -0
  114. package/lib/cjs/internal/app-binder/task/SignChallengeWithKeypairTask.js.map +7 -0
  115. package/lib/cjs/internal/app-binder/task/SignChallengeWithKeypairTask.test.js +2 -0
  116. package/lib/cjs/internal/app-binder/task/SignChallengeWithKeypairTask.test.js.map +7 -0
  117. package/lib/cjs/internal/app-binder/task/utils/TrustedProperties.js +2 -0
  118. package/lib/cjs/internal/app-binder/task/utils/TrustedProperties.js.map +7 -0
  119. package/lib/cjs/internal/di.js +2 -0
  120. package/lib/cjs/internal/di.js.map +7 -0
  121. package/lib/cjs/internal/externalTypes.js +2 -0
  122. package/lib/cjs/internal/externalTypes.js.map +7 -0
  123. package/lib/cjs/internal/lkrp-datasource/data/HttpLKRPDataSource.js +2 -0
  124. package/lib/cjs/internal/lkrp-datasource/data/HttpLKRPDataSource.js.map +7 -0
  125. package/lib/cjs/internal/lkrp-datasource/data/HttpLKRPDataSource.test.js +2 -0
  126. package/lib/cjs/internal/lkrp-datasource/data/HttpLKRPDataSource.test.js.map +7 -0
  127. package/lib/cjs/internal/lkrp-datasource/data/LKRPDataSource.js +2 -0
  128. package/lib/cjs/internal/lkrp-datasource/data/LKRPDataSource.js.map +7 -0
  129. package/lib/cjs/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.js +2 -0
  130. package/lib/cjs/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.js.map +7 -0
  131. package/lib/cjs/internal/lkrp-datasource/di/lkrpDatasourceTypes.js +2 -0
  132. package/lib/cjs/internal/lkrp-datasource/di/lkrpDatasourceTypes.js.map +7 -0
  133. package/lib/cjs/internal/use-cases/authentication/AuthenticateUseCase.js +2 -0
  134. package/lib/cjs/internal/use-cases/authentication/AuthenticateUseCase.js.map +7 -0
  135. package/lib/cjs/internal/use-cases/di/useCasesModule.js +2 -0
  136. package/lib/cjs/internal/use-cases/di/useCasesModule.js.map +7 -0
  137. package/lib/cjs/internal/use-cases/di/useCasesTypes.js +2 -0
  138. package/lib/cjs/internal/use-cases/di/useCasesTypes.js.map +7 -0
  139. package/lib/cjs/internal/utils/LKRPBlock.js +5 -0
  140. package/lib/cjs/internal/utils/LKRPBlock.js.map +7 -0
  141. package/lib/cjs/internal/utils/LKRPBlock.test.js +24 -0
  142. package/lib/cjs/internal/utils/LKRPBlock.test.js.map +7 -0
  143. package/lib/cjs/internal/utils/LKRPBlockStream.js +4 -0
  144. package/lib/cjs/internal/utils/LKRPBlockStream.js.map +7 -0
  145. package/lib/cjs/internal/utils/LKRPBlockStream.test.js +39 -0
  146. package/lib/cjs/internal/utils/LKRPBlockStream.test.js.map +7 -0
  147. package/lib/cjs/internal/utils/LKRPCommand.js +3 -0
  148. package/lib/cjs/internal/utils/LKRPCommand.js.map +7 -0
  149. package/lib/cjs/internal/utils/LKRPCommand.test.js +3 -0
  150. package/lib/cjs/internal/utils/LKRPCommand.test.js.map +7 -0
  151. package/lib/cjs/internal/utils/TLVBuilder.js +2 -0
  152. package/lib/cjs/internal/utils/TLVBuilder.js.map +7 -0
  153. package/lib/cjs/internal/utils/TLVParser.js +2 -0
  154. package/lib/cjs/internal/utils/TLVParser.js.map +7 -0
  155. package/lib/cjs/internal/utils/TLVParser.test.js +2 -0
  156. package/lib/cjs/internal/utils/TLVParser.test.js.map +7 -0
  157. package/lib/cjs/internal/utils/TLVTags.js +2 -0
  158. package/lib/cjs/internal/utils/TLVTags.js.map +7 -0
  159. package/lib/cjs/internal/utils/crypto.js +2 -0
  160. package/lib/cjs/internal/utils/crypto.js.map +7 -0
  161. package/lib/cjs/internal/utils/derivationPath.js +2 -0
  162. package/lib/cjs/internal/utils/derivationPath.js.map +7 -0
  163. package/lib/cjs/internal/utils/eitherSeqRecord.js +2 -0
  164. package/lib/cjs/internal/utils/eitherSeqRecord.js.map +7 -0
  165. package/lib/cjs/internal/utils/hex.js +2 -0
  166. package/lib/cjs/internal/utils/hex.js.map +7 -0
  167. package/lib/cjs/internal/utils/required.js +2 -0
  168. package/lib/cjs/internal/utils/required.js.map +7 -0
  169. package/lib/cjs/internal/utils/types.js +2 -0
  170. package/lib/cjs/internal/utils/types.js.map +7 -0
  171. package/lib/cjs/package.json +55 -0
  172. package/lib/esm/api/LedgerKeyringProtocol.js +1 -0
  173. package/lib/esm/api/LedgerKeyringProtocol.js.map +7 -0
  174. package/lib/esm/api/LedgerKeyringProtocolBuilder.js +2 -0
  175. package/lib/esm/api/LedgerKeyringProtocolBuilder.js.map +7 -0
  176. package/lib/esm/api/app-binder/AddToTrustchainDeviceActionTypes.js +1 -0
  177. package/lib/esm/api/app-binder/AddToTrustchainDeviceActionTypes.js.map +7 -0
  178. package/lib/esm/api/app-binder/AuthenticateDeviceActionTypes.js +1 -0
  179. package/lib/esm/api/app-binder/AuthenticateDeviceActionTypes.js.map +7 -0
  180. package/lib/esm/api/app-binder/Errors.js +2 -0
  181. package/lib/esm/api/app-binder/Errors.js.map +7 -0
  182. package/lib/esm/api/app-binder/GetAppNameCommandTypes.js +1 -0
  183. package/lib/esm/api/app-binder/GetAppNameCommandTypes.js.map +7 -0
  184. package/lib/esm/api/app-binder/GetSeedIdCommandTypes.js +1 -0
  185. package/lib/esm/api/app-binder/GetSeedIdCommandTypes.js.map +7 -0
  186. package/lib/esm/api/app-binder/GetVersionCommandTypes.js +1 -0
  187. package/lib/esm/api/app-binder/GetVersionCommandTypes.js.map +7 -0
  188. package/lib/esm/api/app-binder/GetVersionDeviceActionTypes.js +1 -0
  189. package/lib/esm/api/app-binder/GetVersionDeviceActionTypes.js.map +7 -0
  190. package/lib/esm/api/app-binder/InitCommandTypes.js +1 -0
  191. package/lib/esm/api/app-binder/InitCommandTypes.js.map +7 -0
  192. package/lib/esm/api/app-binder/KeypairFromBytes.js +2 -0
  193. package/lib/esm/api/app-binder/KeypairFromBytes.js.map +7 -0
  194. package/lib/esm/api/app-binder/LKRPTypes.js +2 -0
  195. package/lib/esm/api/app-binder/LKRPTypes.js.map +7 -0
  196. package/lib/esm/api/app-binder/ParseStreamBlockCommandCommandTypes.js +1 -0
  197. package/lib/esm/api/app-binder/ParseStreamBlockCommandCommandTypes.js.map +7 -0
  198. package/lib/esm/api/app-binder/ParseStreamBlockHeaderCommandTypes.js +1 -0
  199. package/lib/esm/api/app-binder/ParseStreamBlockHeaderCommandTypes.js.map +7 -0
  200. package/lib/esm/api/app-binder/ParseStreamBlockSignatureTypes.js +1 -0
  201. package/lib/esm/api/app-binder/ParseStreamBlockSignatureTypes.js.map +7 -0
  202. package/lib/esm/api/app-binder/SetTrustedMemberTypes.js +1 -0
  203. package/lib/esm/api/app-binder/SetTrustedMemberTypes.js.map +7 -0
  204. package/lib/esm/api/app-binder/SignBlockCommandTypes.js +1 -0
  205. package/lib/esm/api/app-binder/SignBlockCommandTypes.js.map +7 -0
  206. package/lib/esm/api/app-binder/SignBlockHeaderCommandTypes.js +1 -0
  207. package/lib/esm/api/app-binder/SignBlockHeaderCommandTypes.js.map +7 -0
  208. package/lib/esm/api/app-binder/SignBlockSignatureCommandTypes.js +1 -0
  209. package/lib/esm/api/app-binder/SignBlockSignatureCommandTypes.js.map +7 -0
  210. package/lib/esm/api/app-binder/SignBlockSingleCommandTypes.js +1 -0
  211. package/lib/esm/api/app-binder/SignBlockSingleCommandTypes.js.map +7 -0
  212. package/lib/esm/api/index.js +2 -0
  213. package/lib/esm/api/index.js.map +7 -0
  214. package/lib/esm/index.js +2 -0
  215. package/lib/esm/index.js.map +7 -0
  216. package/lib/esm/internal/DefaultLedgerKeyringProtocol.js +2 -0
  217. package/lib/esm/internal/DefaultLedgerKeyringProtocol.js.map +7 -0
  218. package/lib/esm/internal/app-binder/LedgerKeyringProtocolBinder.js +2 -0
  219. package/lib/esm/internal/app-binder/LedgerKeyringProtocolBinder.js.map +7 -0
  220. package/lib/esm/internal/app-binder/command/GetAppNameCommand.js +2 -0
  221. package/lib/esm/internal/app-binder/command/GetAppNameCommand.js.map +7 -0
  222. package/lib/esm/internal/app-binder/command/GetSeedIdCommand.js +2 -0
  223. package/lib/esm/internal/app-binder/command/GetSeedIdCommand.js.map +7 -0
  224. package/lib/esm/internal/app-binder/command/GetSeedIdCommand.test.js +27 -0
  225. package/lib/esm/internal/app-binder/command/GetSeedIdCommand.test.js.map +7 -0
  226. package/lib/esm/internal/app-binder/command/GetVersionCommand.js +2 -0
  227. package/lib/esm/internal/app-binder/command/GetVersionCommand.js.map +7 -0
  228. package/lib/esm/internal/app-binder/command/InitCommand.js +2 -0
  229. package/lib/esm/internal/app-binder/command/InitCommand.js.map +7 -0
  230. package/lib/esm/internal/app-binder/command/InitCommand.test.js +2 -0
  231. package/lib/esm/internal/app-binder/command/InitCommand.test.js.map +7 -0
  232. package/lib/esm/internal/app-binder/command/ParseBlockSignatureCommand.js +2 -0
  233. package/lib/esm/internal/app-binder/command/ParseBlockSignatureCommand.js.map +7 -0
  234. package/lib/esm/internal/app-binder/command/ParseBlockSignatureCommand.test.js +2 -0
  235. package/lib/esm/internal/app-binder/command/ParseBlockSignatureCommand.test.js.map +7 -0
  236. package/lib/esm/internal/app-binder/command/ParseStreamBlockCommand.js +2 -0
  237. package/lib/esm/internal/app-binder/command/ParseStreamBlockCommand.js.map +7 -0
  238. package/lib/esm/internal/app-binder/command/ParseStreamBlockCommand.test.js +2 -0
  239. package/lib/esm/internal/app-binder/command/ParseStreamBlockCommand.test.js.map +7 -0
  240. package/lib/esm/internal/app-binder/command/ParseStreamBlockHeader.js +2 -0
  241. package/lib/esm/internal/app-binder/command/ParseStreamBlockHeader.js.map +7 -0
  242. package/lib/esm/internal/app-binder/command/ParseStreamBlockHeader.test.js +2 -0
  243. package/lib/esm/internal/app-binder/command/ParseStreamBlockHeader.test.js.map +7 -0
  244. package/lib/esm/internal/app-binder/command/SetTrustedMemberCommand.js +2 -0
  245. package/lib/esm/internal/app-binder/command/SetTrustedMemberCommand.js.map +7 -0
  246. package/lib/esm/internal/app-binder/command/SetTrustedMemberCommand.test.js +2 -0
  247. package/lib/esm/internal/app-binder/command/SetTrustedMemberCommand.test.js.map +7 -0
  248. package/lib/esm/internal/app-binder/command/SignBlockHeader.js +2 -0
  249. package/lib/esm/internal/app-binder/command/SignBlockHeader.js.map +7 -0
  250. package/lib/esm/internal/app-binder/command/SignBlockHeader.test.js +2 -0
  251. package/lib/esm/internal/app-binder/command/SignBlockHeader.test.js.map +7 -0
  252. package/lib/esm/internal/app-binder/command/SignBlockSignatureCommand.js +2 -0
  253. package/lib/esm/internal/app-binder/command/SignBlockSignatureCommand.js.map +7 -0
  254. package/lib/esm/internal/app-binder/command/SignBlockSignatureCommand.test.js +2 -0
  255. package/lib/esm/internal/app-binder/command/SignBlockSignatureCommand.test.js.map +7 -0
  256. package/lib/esm/internal/app-binder/command/SignBlockSingleCommand.js +2 -0
  257. package/lib/esm/internal/app-binder/command/SignBlockSingleCommand.js.map +7 -0
  258. package/lib/esm/internal/app-binder/command/SignBlockSingleCommand.test.js +2 -0
  259. package/lib/esm/internal/app-binder/command/SignBlockSingleCommand.test.js.map +7 -0
  260. package/lib/esm/internal/app-binder/command/utils/extractTrustedProperty.js +2 -0
  261. package/lib/esm/internal/app-binder/command/utils/extractTrustedProperty.js.map +7 -0
  262. package/lib/esm/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.js +2 -0
  263. package/lib/esm/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.js.map +7 -0
  264. package/lib/esm/internal/app-binder/device-action/AddToTrustchainDeviceAction.js +2 -0
  265. package/lib/esm/internal/app-binder/device-action/AddToTrustchainDeviceAction.js.map +7 -0
  266. package/lib/esm/internal/app-binder/device-action/AuthenticateDeviceAction.js +2 -0
  267. package/lib/esm/internal/app-binder/device-action/AuthenticateDeviceAction.js.map +7 -0
  268. package/lib/esm/internal/app-binder/device-action/utils/raiseAndAssign.js +2 -0
  269. package/lib/esm/internal/app-binder/device-action/utils/raiseAndAssign.js.map +7 -0
  270. package/lib/esm/internal/app-binder/di/appBinderModule.js +2 -0
  271. package/lib/esm/internal/app-binder/di/appBinderModule.js.map +7 -0
  272. package/lib/esm/internal/app-binder/di/appBinderTypes.js +2 -0
  273. package/lib/esm/internal/app-binder/di/appBinderTypes.js.map +7 -0
  274. package/lib/esm/internal/app-binder/task/InitTask.js +2 -0
  275. package/lib/esm/internal/app-binder/task/InitTask.js.map +7 -0
  276. package/lib/esm/internal/app-binder/task/ParseStreamToDeviceTask.js +2 -0
  277. package/lib/esm/internal/app-binder/task/ParseStreamToDeviceTask.js.map +7 -0
  278. package/lib/esm/internal/app-binder/task/SignBlockTask.js +2 -0
  279. package/lib/esm/internal/app-binder/task/SignBlockTask.js.map +7 -0
  280. package/lib/esm/internal/app-binder/task/SignChallengeWithDeviceTask.js +2 -0
  281. package/lib/esm/internal/app-binder/task/SignChallengeWithDeviceTask.js.map +7 -0
  282. package/lib/esm/internal/app-binder/task/SignChallengeWithKeypairTask.js +2 -0
  283. package/lib/esm/internal/app-binder/task/SignChallengeWithKeypairTask.js.map +7 -0
  284. package/lib/esm/internal/app-binder/task/SignChallengeWithKeypairTask.test.js +2 -0
  285. package/lib/esm/internal/app-binder/task/SignChallengeWithKeypairTask.test.js.map +7 -0
  286. package/lib/esm/internal/app-binder/task/utils/TrustedProperties.js +2 -0
  287. package/lib/esm/internal/app-binder/task/utils/TrustedProperties.js.map +7 -0
  288. package/lib/esm/internal/di.js +2 -0
  289. package/lib/esm/internal/di.js.map +7 -0
  290. package/lib/esm/internal/externalTypes.js +2 -0
  291. package/lib/esm/internal/externalTypes.js.map +7 -0
  292. package/lib/esm/internal/lkrp-datasource/data/HttpLKRPDataSource.js +2 -0
  293. package/lib/esm/internal/lkrp-datasource/data/HttpLKRPDataSource.js.map +7 -0
  294. package/lib/esm/internal/lkrp-datasource/data/HttpLKRPDataSource.test.js +2 -0
  295. package/lib/esm/internal/lkrp-datasource/data/HttpLKRPDataSource.test.js.map +7 -0
  296. package/lib/esm/internal/lkrp-datasource/data/LKRPDataSource.js +1 -0
  297. package/lib/esm/internal/lkrp-datasource/data/LKRPDataSource.js.map +7 -0
  298. package/lib/esm/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.js +2 -0
  299. package/lib/esm/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.js.map +7 -0
  300. package/lib/esm/internal/lkrp-datasource/di/lkrpDatasourceTypes.js +2 -0
  301. package/lib/esm/internal/lkrp-datasource/di/lkrpDatasourceTypes.js.map +7 -0
  302. package/lib/esm/internal/use-cases/authentication/AuthenticateUseCase.js +2 -0
  303. package/lib/esm/internal/use-cases/authentication/AuthenticateUseCase.js.map +7 -0
  304. package/lib/esm/internal/use-cases/di/useCasesModule.js +2 -0
  305. package/lib/esm/internal/use-cases/di/useCasesModule.js.map +7 -0
  306. package/lib/esm/internal/use-cases/di/useCasesTypes.js +2 -0
  307. package/lib/esm/internal/use-cases/di/useCasesTypes.js.map +7 -0
  308. package/lib/esm/internal/utils/LKRPBlock.js +5 -0
  309. package/lib/esm/internal/utils/LKRPBlock.js.map +7 -0
  310. package/lib/esm/internal/utils/LKRPBlock.test.js +24 -0
  311. package/lib/esm/internal/utils/LKRPBlock.test.js.map +7 -0
  312. package/lib/esm/internal/utils/LKRPBlockStream.js +4 -0
  313. package/lib/esm/internal/utils/LKRPBlockStream.js.map +7 -0
  314. package/lib/esm/internal/utils/LKRPBlockStream.test.js +39 -0
  315. package/lib/esm/internal/utils/LKRPBlockStream.test.js.map +7 -0
  316. package/lib/esm/internal/utils/LKRPCommand.js +3 -0
  317. package/lib/esm/internal/utils/LKRPCommand.js.map +7 -0
  318. package/lib/esm/internal/utils/LKRPCommand.test.js +3 -0
  319. package/lib/esm/internal/utils/LKRPCommand.test.js.map +7 -0
  320. package/lib/esm/internal/utils/TLVBuilder.js +2 -0
  321. package/lib/esm/internal/utils/TLVBuilder.js.map +7 -0
  322. package/lib/esm/internal/utils/TLVParser.js +2 -0
  323. package/lib/esm/internal/utils/TLVParser.js.map +7 -0
  324. package/lib/esm/internal/utils/TLVParser.test.js +2 -0
  325. package/lib/esm/internal/utils/TLVParser.test.js.map +7 -0
  326. package/lib/esm/internal/utils/TLVTags.js +2 -0
  327. package/lib/esm/internal/utils/TLVTags.js.map +7 -0
  328. package/lib/esm/internal/utils/crypto.js +2 -0
  329. package/lib/esm/internal/utils/crypto.js.map +7 -0
  330. package/lib/esm/internal/utils/derivationPath.js +2 -0
  331. package/lib/esm/internal/utils/derivationPath.js.map +7 -0
  332. package/lib/esm/internal/utils/eitherSeqRecord.js +2 -0
  333. package/lib/esm/internal/utils/eitherSeqRecord.js.map +7 -0
  334. package/lib/esm/internal/utils/hex.js +2 -0
  335. package/lib/esm/internal/utils/hex.js.map +7 -0
  336. package/lib/esm/internal/utils/required.js +2 -0
  337. package/lib/esm/internal/utils/required.js.map +7 -0
  338. package/lib/esm/internal/utils/types.js +1 -0
  339. package/lib/esm/internal/utils/types.js.map +7 -0
  340. package/lib/esm/package.json +55 -0
  341. package/lib/types/api/LedgerKeyringProtocol.d.ts +9 -0
  342. package/lib/types/api/LedgerKeyringProtocol.d.ts.map +1 -0
  343. package/lib/types/api/LedgerKeyringProtocolBuilder.d.ts +14 -0
  344. package/lib/types/api/LedgerKeyringProtocolBuilder.d.ts.map +1 -0
  345. package/lib/types/api/app-binder/AddToTrustchainDeviceActionTypes.d.ts +27 -0
  346. package/lib/types/api/app-binder/AddToTrustchainDeviceActionTypes.d.ts.map +1 -0
  347. package/lib/types/api/app-binder/AuthenticateDeviceActionTypes.d.ts +37 -0
  348. package/lib/types/api/app-binder/AuthenticateDeviceActionTypes.d.ts.map +1 -0
  349. package/lib/types/api/app-binder/Errors.d.ts +27 -0
  350. package/lib/types/api/app-binder/Errors.d.ts.map +1 -0
  351. package/lib/types/api/app-binder/GetAppNameCommandTypes.d.ts +5 -0
  352. package/lib/types/api/app-binder/GetAppNameCommandTypes.d.ts.map +1 -0
  353. package/lib/types/api/app-binder/GetSeedIdCommandTypes.d.ts +14 -0
  354. package/lib/types/api/app-binder/GetSeedIdCommandTypes.d.ts.map +1 -0
  355. package/lib/types/api/app-binder/GetVersionCommandTypes.d.ts +5 -0
  356. package/lib/types/api/app-binder/GetVersionCommandTypes.d.ts.map +1 -0
  357. package/lib/types/api/app-binder/GetVersionDeviceActionTypes.d.ts +10 -0
  358. package/lib/types/api/app-binder/GetVersionDeviceActionTypes.d.ts.map +1 -0
  359. package/lib/types/api/app-binder/InitCommandTypes.d.ts +5 -0
  360. package/lib/types/api/app-binder/InitCommandTypes.d.ts.map +1 -0
  361. package/lib/types/api/app-binder/KeypairFromBytes.d.ts +11 -0
  362. package/lib/types/api/app-binder/KeypairFromBytes.d.ts.map +1 -0
  363. package/lib/types/api/app-binder/LKRPTypes.d.ts +24 -0
  364. package/lib/types/api/app-binder/LKRPTypes.d.ts.map +1 -0
  365. package/lib/types/api/app-binder/ParseStreamBlockCommandCommandTypes.d.ts +6 -0
  366. package/lib/types/api/app-binder/ParseStreamBlockCommandCommandTypes.d.ts.map +1 -0
  367. package/lib/types/api/app-binder/ParseStreamBlockHeaderCommandTypes.d.ts +5 -0
  368. package/lib/types/api/app-binder/ParseStreamBlockHeaderCommandTypes.d.ts.map +1 -0
  369. package/lib/types/api/app-binder/ParseStreamBlockSignatureTypes.d.ts +5 -0
  370. package/lib/types/api/app-binder/ParseStreamBlockSignatureTypes.d.ts.map +1 -0
  371. package/lib/types/api/app-binder/SetTrustedMemberTypes.d.ts +6 -0
  372. package/lib/types/api/app-binder/SetTrustedMemberTypes.d.ts.map +1 -0
  373. package/lib/types/api/app-binder/SignBlockCommandTypes.d.ts +9 -0
  374. package/lib/types/api/app-binder/SignBlockCommandTypes.d.ts.map +1 -0
  375. package/lib/types/api/app-binder/SignBlockHeaderCommandTypes.d.ts +5 -0
  376. package/lib/types/api/app-binder/SignBlockHeaderCommandTypes.d.ts.map +1 -0
  377. package/lib/types/api/app-binder/SignBlockSignatureCommandTypes.d.ts +6 -0
  378. package/lib/types/api/app-binder/SignBlockSignatureCommandTypes.d.ts.map +1 -0
  379. package/lib/types/api/app-binder/SignBlockSingleCommandTypes.d.ts +5 -0
  380. package/lib/types/api/app-binder/SignBlockSingleCommandTypes.d.ts.map +1 -0
  381. package/lib/types/api/index.d.ts +7 -0
  382. package/lib/types/api/index.d.ts.map +1 -0
  383. package/lib/types/index.d.ts +3 -0
  384. package/lib/types/index.d.ts.map +1 -0
  385. package/lib/types/internal/DefaultLedgerKeyringProtocol.d.ts +20 -0
  386. package/lib/types/internal/DefaultLedgerKeyringProtocol.d.ts.map +1 -0
  387. package/lib/types/internal/app-binder/LedgerKeyringProtocolBinder.d.ts +29 -0
  388. package/lib/types/internal/app-binder/LedgerKeyringProtocolBinder.d.ts.map +1 -0
  389. package/lib/types/internal/app-binder/command/GetAppNameCommand.d.ts +9 -0
  390. package/lib/types/internal/app-binder/command/GetAppNameCommand.d.ts.map +1 -0
  391. package/lib/types/internal/app-binder/command/GetSeedIdCommand.d.ts +11 -0
  392. package/lib/types/internal/app-binder/command/GetSeedIdCommand.d.ts.map +1 -0
  393. package/lib/types/internal/app-binder/command/GetSeedIdCommand.test.d.ts +2 -0
  394. package/lib/types/internal/app-binder/command/GetSeedIdCommand.test.d.ts.map +1 -0
  395. package/lib/types/internal/app-binder/command/GetVersionCommand.d.ts +9 -0
  396. package/lib/types/internal/app-binder/command/GetVersionCommand.d.ts.map +1 -0
  397. package/lib/types/internal/app-binder/command/InitCommand.d.ts +11 -0
  398. package/lib/types/internal/app-binder/command/InitCommand.d.ts.map +1 -0
  399. package/lib/types/internal/app-binder/command/InitCommand.test.d.ts +2 -0
  400. package/lib/types/internal/app-binder/command/InitCommand.test.d.ts.map +1 -0
  401. package/lib/types/internal/app-binder/command/ParseBlockSignatureCommand.d.ts +11 -0
  402. package/lib/types/internal/app-binder/command/ParseBlockSignatureCommand.d.ts.map +1 -0
  403. package/lib/types/internal/app-binder/command/ParseBlockSignatureCommand.test.d.ts +2 -0
  404. package/lib/types/internal/app-binder/command/ParseBlockSignatureCommand.test.d.ts.map +1 -0
  405. package/lib/types/internal/app-binder/command/ParseStreamBlockCommand.d.ts +11 -0
  406. package/lib/types/internal/app-binder/command/ParseStreamBlockCommand.d.ts.map +1 -0
  407. package/lib/types/internal/app-binder/command/ParseStreamBlockCommand.test.d.ts +2 -0
  408. package/lib/types/internal/app-binder/command/ParseStreamBlockCommand.test.d.ts.map +1 -0
  409. package/lib/types/internal/app-binder/command/ParseStreamBlockHeader.d.ts +11 -0
  410. package/lib/types/internal/app-binder/command/ParseStreamBlockHeader.d.ts.map +1 -0
  411. package/lib/types/internal/app-binder/command/ParseStreamBlockHeader.test.d.ts +2 -0
  412. package/lib/types/internal/app-binder/command/ParseStreamBlockHeader.test.d.ts.map +1 -0
  413. package/lib/types/internal/app-binder/command/SetTrustedMemberCommand.d.ts +11 -0
  414. package/lib/types/internal/app-binder/command/SetTrustedMemberCommand.d.ts.map +1 -0
  415. package/lib/types/internal/app-binder/command/SetTrustedMemberCommand.test.d.ts +2 -0
  416. package/lib/types/internal/app-binder/command/SetTrustedMemberCommand.test.d.ts.map +1 -0
  417. package/lib/types/internal/app-binder/command/SignBlockHeader.d.ts +11 -0
  418. package/lib/types/internal/app-binder/command/SignBlockHeader.d.ts.map +1 -0
  419. package/lib/types/internal/app-binder/command/SignBlockHeader.test.d.ts +2 -0
  420. package/lib/types/internal/app-binder/command/SignBlockHeader.test.d.ts.map +1 -0
  421. package/lib/types/internal/app-binder/command/SignBlockSignatureCommand.d.ts +10 -0
  422. package/lib/types/internal/app-binder/command/SignBlockSignatureCommand.d.ts.map +1 -0
  423. package/lib/types/internal/app-binder/command/SignBlockSignatureCommand.test.d.ts +2 -0
  424. package/lib/types/internal/app-binder/command/SignBlockSignatureCommand.test.d.ts.map +1 -0
  425. package/lib/types/internal/app-binder/command/SignBlockSingleCommand.d.ts +11 -0
  426. package/lib/types/internal/app-binder/command/SignBlockSingleCommand.d.ts.map +1 -0
  427. package/lib/types/internal/app-binder/command/SignBlockSingleCommand.test.d.ts +2 -0
  428. package/lib/types/internal/app-binder/command/SignBlockSingleCommand.test.d.ts.map +1 -0
  429. package/lib/types/internal/app-binder/command/utils/extractTrustedProperty.d.ts +4 -0
  430. package/lib/types/internal/app-binder/command/utils/extractTrustedProperty.d.ts.map +1 -0
  431. package/lib/types/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.d.ts +9 -0
  432. package/lib/types/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.d.ts.map +1 -0
  433. package/lib/types/internal/app-binder/device-action/AddToTrustchainDeviceAction.d.ts +20 -0
  434. package/lib/types/internal/app-binder/device-action/AddToTrustchainDeviceAction.d.ts.map +1 -0
  435. package/lib/types/internal/app-binder/device-action/AuthenticateDeviceAction.d.ts +42 -0
  436. package/lib/types/internal/app-binder/device-action/AuthenticateDeviceAction.d.ts.map +1 -0
  437. package/lib/types/internal/app-binder/device-action/utils/raiseAndAssign.d.ts +41 -0
  438. package/lib/types/internal/app-binder/device-action/utils/raiseAndAssign.d.ts.map +1 -0
  439. package/lib/types/internal/app-binder/di/appBinderModule.d.ts +3 -0
  440. package/lib/types/internal/app-binder/di/appBinderModule.d.ts.map +1 -0
  441. package/lib/types/internal/app-binder/di/appBinderTypes.d.ts +4 -0
  442. package/lib/types/internal/app-binder/di/appBinderTypes.d.ts.map +1 -0
  443. package/lib/types/internal/app-binder/task/InitTask.d.ts +10 -0
  444. package/lib/types/internal/app-binder/task/InitTask.d.ts.map +1 -0
  445. package/lib/types/internal/app-binder/task/ParseStreamToDeviceTask.d.ts +26 -0
  446. package/lib/types/internal/app-binder/task/ParseStreamToDeviceTask.d.ts.map +1 -0
  447. package/lib/types/internal/app-binder/task/SignBlockTask.d.ts +68 -0
  448. package/lib/types/internal/app-binder/task/SignBlockTask.d.ts.map +1 -0
  449. package/lib/types/internal/app-binder/task/SignChallengeWithDeviceTask.d.ts +10 -0
  450. package/lib/types/internal/app-binder/task/SignChallengeWithDeviceTask.d.ts.map +1 -0
  451. package/lib/types/internal/app-binder/task/SignChallengeWithKeypairTask.d.ts +15 -0
  452. package/lib/types/internal/app-binder/task/SignChallengeWithKeypairTask.d.ts.map +1 -0
  453. package/lib/types/internal/app-binder/task/SignChallengeWithKeypairTask.test.d.ts +2 -0
  454. package/lib/types/internal/app-binder/task/SignChallengeWithKeypairTask.test.d.ts.map +1 -0
  455. package/lib/types/internal/app-binder/task/utils/TrustedProperties.d.ts +26 -0
  456. package/lib/types/internal/app-binder/task/utils/TrustedProperties.d.ts.map +1 -0
  457. package/lib/types/internal/di.d.ts +10 -0
  458. package/lib/types/internal/di.d.ts.map +1 -0
  459. package/lib/types/internal/externalTypes.d.ts +14 -0
  460. package/lib/types/internal/externalTypes.d.ts.map +1 -0
  461. package/lib/types/internal/lkrp-datasource/data/HttpLKRPDataSource.d.ts +22 -0
  462. package/lib/types/internal/lkrp-datasource/data/HttpLKRPDataSource.d.ts.map +1 -0
  463. package/lib/types/internal/lkrp-datasource/data/HttpLKRPDataSource.test.d.ts +2 -0
  464. package/lib/types/internal/lkrp-datasource/data/HttpLKRPDataSource.test.d.ts.map +1 -0
  465. package/lib/types/internal/lkrp-datasource/data/LKRPDataSource.d.ts +54 -0
  466. package/lib/types/internal/lkrp-datasource/data/LKRPDataSource.d.ts.map +1 -0
  467. package/lib/types/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.d.ts +4 -0
  468. package/lib/types/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.d.ts.map +1 -0
  469. package/lib/types/internal/lkrp-datasource/di/lkrpDatasourceTypes.d.ts +5 -0
  470. package/lib/types/internal/lkrp-datasource/di/lkrpDatasourceTypes.d.ts.map +1 -0
  471. package/lib/types/internal/use-cases/authentication/AuthenticateUseCase.d.ts +9 -0
  472. package/lib/types/internal/use-cases/authentication/AuthenticateUseCase.d.ts.map +1 -0
  473. package/lib/types/internal/use-cases/di/useCasesModule.d.ts +3 -0
  474. package/lib/types/internal/use-cases/di/useCasesModule.d.ts.map +1 -0
  475. package/lib/types/internal/use-cases/di/useCasesTypes.d.ts +4 -0
  476. package/lib/types/internal/use-cases/di/useCasesTypes.d.ts.map +1 -0
  477. package/lib/types/internal/utils/LKRPBlock.d.ts +17 -0
  478. package/lib/types/internal/utils/LKRPBlock.d.ts.map +1 -0
  479. package/lib/types/internal/utils/LKRPBlock.test.d.ts +2 -0
  480. package/lib/types/internal/utils/LKRPBlock.test.d.ts.map +1 -0
  481. package/lib/types/internal/utils/LKRPBlockStream.d.ts +26 -0
  482. package/lib/types/internal/utils/LKRPBlockStream.d.ts.map +1 -0
  483. package/lib/types/internal/utils/LKRPBlockStream.test.d.ts +2 -0
  484. package/lib/types/internal/utils/LKRPBlockStream.test.d.ts.map +1 -0
  485. package/lib/types/internal/utils/LKRPCommand.d.ts +18 -0
  486. package/lib/types/internal/utils/LKRPCommand.d.ts.map +1 -0
  487. package/lib/types/internal/utils/LKRPCommand.test.d.ts +2 -0
  488. package/lib/types/internal/utils/LKRPCommand.test.d.ts.map +1 -0
  489. package/lib/types/internal/utils/TLVBuilder.d.ts +15 -0
  490. package/lib/types/internal/utils/TLVBuilder.d.ts.map +1 -0
  491. package/lib/types/internal/utils/TLVParser.d.ts +59 -0
  492. package/lib/types/internal/utils/TLVParser.d.ts.map +1 -0
  493. package/lib/types/internal/utils/TLVParser.test.d.ts +2 -0
  494. package/lib/types/internal/utils/TLVParser.test.d.ts.map +1 -0
  495. package/lib/types/internal/utils/TLVTags.d.ts +27 -0
  496. package/lib/types/internal/utils/TLVTags.d.ts.map +1 -0
  497. package/lib/types/internal/utils/crypto.d.ts +19 -0
  498. package/lib/types/internal/utils/crypto.d.ts.map +1 -0
  499. package/lib/types/internal/utils/derivationPath.d.ts +3 -0
  500. package/lib/types/internal/utils/derivationPath.d.ts.map +1 -0
  501. package/lib/types/internal/utils/eitherSeqRecord.d.ts +29 -0
  502. package/lib/types/internal/utils/eitherSeqRecord.d.ts.map +1 -0
  503. package/lib/types/internal/utils/hex.d.ts +3 -0
  504. package/lib/types/internal/utils/hex.d.ts.map +1 -0
  505. package/lib/types/internal/utils/required.d.ts +3 -0
  506. package/lib/types/internal/utils/required.d.ts.map +1 -0
  507. package/lib/types/internal/utils/types.d.ts +73 -0
  508. package/lib/types/internal/utils/types.d.ts.map +1 -0
  509. package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
  510. package/package.json +54 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/internal/utils/TLVParser.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { LKRPParsingError } from \"@api/app-binder/Errors\";\n\nimport { LKRPCommand } from \"./LKRPCommand\";\nimport { TLVParser } from \"./TLVParser\";\nimport { CommandTags, GeneralTags } from \"./TLVTags\";\n\ndescribe(\"TLVParser\", () => {\n describe(\"Block Data Parsing\", () => {\n describe(\"parseCommands\", () => {\n it(\"should parse has many commands has specified by the command count value\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([\n ...[GeneralTags.Int, 1, 0x02], // Command count: 2\n ...[CommandTags.AddMember, 3, ...[GeneralTags.Int, 1, 0x01]], // First command\n ...[CommandTags.Seed, 3, ...[GeneralTags.Int, 1, 0x02]], // Second command\n ]),\n );\n // WHEN\n const commands = parser.parseCommands();\n\n // THEN\n expect(commands).toStrictEqual(\n Right([\n new LKRPCommand(\n new Uint8Array([\n CommandTags.AddMember,\n 3,\n ...[GeneralTags.Int, 1, 0x01],\n ]),\n ),\n new LKRPCommand(\n new Uint8Array([\n CommandTags.Seed,\n 3,\n ...[GeneralTags.Int, 1, 0x02],\n ]),\n ),\n ]),\n );\n });\n });\n\n describe(\"parseBlockData\", () => {\n it(\"should parse a valid block data\", () => {\n // GIVEN\n const parser = new TLVParser(\n Uint8Array.from(\n [\n [GeneralTags.Int, 1, 0x01], // Version\n [GeneralTags.Hash, 3, 0x01, 0x02, 0x03], // Parent\n [GeneralTags.PublicKey, 3, 0x04, 0x05, 0x06], // Issuer\n [GeneralTags.Int, 1, 0x02], // Command count: 2\n [CommandTags.AddMember, 3, ...[GeneralTags.Int, 1, 0x01]], // First command\n [CommandTags.Seed, 3, ...[GeneralTags.Int, 1, 0x02]], // Second command\n [GeneralTags.Signature, 3, 0x07, 0x08, 0x09], // Signature\n ].flat(),\n ),\n );\n // WHEN\n const blockData = parser.parseBlockData();\n\n // THEN\n expect(blockData).toStrictEqual(\n Right({\n parent: \"010203\",\n issuer: new Uint8Array([0x04, 0x05, 0x06]),\n header: Uint8Array.from(\n [\n [GeneralTags.Int, 1, 0x01], // Version\n [GeneralTags.Hash, 3, 0x01, 0x02, 0x03], // Parent\n [GeneralTags.PublicKey, 3, 0x04, 0x05, 0x06], // Issuer\n [GeneralTags.Int, 1, 0x02], // Command count: 2\n ].flat(),\n ),\n\n commands: [\n new LKRPCommand(\n new Uint8Array([\n CommandTags.AddMember,\n 3,\n ...[GeneralTags.Int, 1, 0x01],\n ]),\n ),\n new LKRPCommand(\n new Uint8Array([\n CommandTags.Seed,\n 3,\n ...[GeneralTags.Int, 1, 0x02],\n ]),\n ),\n ],\n signature: Uint8Array.from([\n GeneralTags.Signature,\n 3,\n 0x07,\n 0x08,\n 0x09,\n ]),\n }),\n );\n });\n\n it(\"should fail if the block data is invalid\", () => {\n // GIVEN\n const parser = new TLVParser(new Uint8Array([]));\n // WHEN\n const blockData = parser.parseBlockData();\n // THEN\n expect(blockData).toEqual(\n Left(new LKRPParsingError(\"Unexpected end of TLV\")),\n );\n });\n });\n });\n\n describe(\"Command Data Parsing\", () => {\n describe(\"parseCommandBytes\", () => {\n it(\"should parse a valid command bytes\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([CommandTags.AddMember, 3, 0x01, 0x02, 0x03]),\n );\n // WHEN\n const value = parser.parseCommandBytes();\n // THEN\n expect(value).toEqual(\n Right(new Uint8Array([CommandTags.AddMember, 3, 0x01, 0x02, 0x03])),\n );\n });\n\n it(\"should fail if the tag is not a command\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 1, 0x01]),\n );\n // WHEN\n const value = parser.parseCommandBytes();\n // THEN\n expect(value).toEqual(\n Left(new LKRPParsingError(`Invalid command type: 0x01`)),\n );\n });\n });\n\n describe(\"Parse Seed Command Data\", () => {\n it(\"should parse a valid seed command data\", () => {\n // GIVEN\n const value = new Uint8Array([\n ...[GeneralTags.Bytes, 3, 0x01, 0x02, 0x03], // Topic\n ...[GeneralTags.Int, 2, 0x01, 0x02], // Protocol Version\n ...[GeneralTags.PublicKey, 3, 0x02, 0x04, 0x06], // Group Key\n ...[GeneralTags.Bytes, 3, 0x03, 0x05, 0x07], // Initialization Vector\n ...[GeneralTags.Bytes, 3, 0x04, 0x08, 0x10], // Encrypted xpriv\n ...[GeneralTags.PublicKey, 3, 0x0a, 0x0b, 0x0c], // Ephemeral Public Key\n ]);\n const parser = new TLVParser(\n new Uint8Array([CommandTags.Seed, value.length, ...value]),\n );\n\n // WHEN\n const parsed = parser.parseCommandData();\n\n // THEN\n expect(parsed).toStrictEqual(\n Right({\n type: CommandTags.Seed,\n topic: new Uint8Array([0x01, 0x02, 0x03]),\n protocolVersion: 258, // 0x0102 in big-endian\n groupKey: new Uint8Array([0x02, 0x04, 0x06]),\n initializationVector: new Uint8Array([0x03, 0x05, 0x07]),\n encryptedXpriv: new Uint8Array([0x04, 0x08, 0x10]),\n ephemeralPublicKey: new Uint8Array([0x0a, 0x0b, 0x0c]),\n }),\n );\n });\n\n it(\"should fail if the command data is invalid\", () => {\n // GIVEN\n const value1 = new Uint8Array([\n ...[GeneralTags.Signature, 3, 0x01, 0x02, 0x03], // Wrong type for Topic\n ]);\n const value2 = new Uint8Array([\n ...[GeneralTags.Bytes, 3, 0x01, 0x02, 0x03], // Correct type but the other fields are missing\n ]);\n const parser1 = new TLVParser(\n new Uint8Array([CommandTags.Seed, value1.length, ...value1]),\n );\n const parser2 = new TLVParser(\n new Uint8Array([CommandTags.Seed, value2.length, ...value2]),\n );\n\n // WHEN\n const parsed1 = parser1.parseCommandData();\n const parsed2 = parser2.parseCommandData();\n\n // THEN\n expect(parsed1).toEqual(Left(new LKRPParsingError(\"Expected bytes\")));\n expect(parsed2).toEqual(\n Left(new LKRPParsingError(\"Unexpected end of TLV\")),\n );\n });\n });\n\n describe(\"Parse AddMember Command Data\", () => {\n it(\"should parse a valid add member command data\", () => {\n // GIVEN\n const value = new Uint8Array([\n ...[GeneralTags.String, 5, 0x41, 0x6c, 0x69, 0x63, 0x65], // Name \"Alice\"\n ...[GeneralTags.PublicKey, 3, 0x01, 0x02, 0x03], // Public Key\n ...[GeneralTags.Int, 1, 0x01], // Permissions\n ]);\n const parser = new TLVParser(\n new Uint8Array([CommandTags.AddMember, value.length, ...value]),\n );\n\n // WHEN\n const parsed = parser.parseCommandData();\n\n // THEN\n expect(parsed).toStrictEqual(\n Right({\n type: CommandTags.AddMember,\n name: \"Alice\",\n publicKey: new Uint8Array([0x01, 0x02, 0x03]),\n permissions: 1,\n }),\n );\n });\n\n it(\"should fail if the command data is invalid\", () => {\n // GIVEN\n const value1 = new Uint8Array([\n ...[GeneralTags.Bytes, 3, 0x01, 0x02, 0x03], // Wrong type for Name\n ]);\n const value2 = new Uint8Array([\n ...[GeneralTags.String, 5, 0x41, 0x6c, 0x69, 0x63, 0x65], // Correct type but the other fields are missing\n ]);\n const parser1 = new TLVParser(\n new Uint8Array([CommandTags.AddMember, value1.length, ...value1]),\n );\n const parser2 = new TLVParser(\n new Uint8Array([CommandTags.AddMember, value2.length, ...value2]),\n );\n\n // WHEN\n const parsed1 = parser1.parseCommandData();\n const parsed2 = parser2.parseCommandData();\n\n // THEN\n expect(parsed1).toEqual(\n Left(new LKRPParsingError(\"Expected a string\")),\n );\n expect(parsed2).toEqual(\n Left(new LKRPParsingError(\"Unexpected end of TLV\")),\n );\n });\n });\n\n describe(\"Parse PublishKey Command Data\", () => {\n it(\"should parse a valid publish key command data\", () => {\n // GIVEN\n const value = new Uint8Array([\n ...[GeneralTags.Bytes, 3, 0x01, 0x02, 0x03], // Initialization Vector\n ...[GeneralTags.Bytes, 3, 0x04, 0x05, 0x06], // Encrypted xpriv\n ...[GeneralTags.PublicKey, 3, 0x03, 0x05, 0x07], // Recipient Public Key\n ...[GeneralTags.PublicKey, 3, 0x08, 0x09, 0x0a], // Ephemeral Public Key\n ]);\n const parser = new TLVParser(\n new Uint8Array([CommandTags.PublishKey, value.length, ...value]),\n );\n\n // WHEN\n const parsed = parser.parseCommandData();\n\n // THEN\n expect(parsed).toStrictEqual(\n Right({\n type: CommandTags.PublishKey,\n initializationVector: new Uint8Array([0x01, 0x02, 0x03]),\n encryptedXpriv: new Uint8Array([0x04, 0x05, 0x06]),\n recipient: new Uint8Array([0x03, 0x05, 0x07]),\n ephemeralPublicKey: new Uint8Array([0x08, 0x09, 0x0a]),\n }),\n );\n });\n\n it(\"should fail if the command data is invalid\", () => {\n // GIVEN\n const value1 = new Uint8Array([\n ...[GeneralTags.Int, 2, 0x01, 0x02], // Wrong type for Initialization Vector\n ]);\n const value2 = new Uint8Array([\n ...[GeneralTags.Bytes, 3, 0x01, 0x02, 0x03], // Correct type but the other fields are missing\n ]);\n const parser1 = new TLVParser(\n new Uint8Array([CommandTags.PublishKey, value1.length, ...value1]),\n );\n const parser2 = new TLVParser(\n new Uint8Array([CommandTags.PublishKey, value2.length, ...value2]),\n );\n\n // WHEN\n const parsed1 = parser1.parseCommandData();\n const parsed2 = parser2.parseCommandData();\n\n // THEN\n expect(parsed1).toEqual(Left(new LKRPParsingError(\"Expected bytes\")));\n expect(parsed2).toEqual(\n Left(new LKRPParsingError(\"Unexpected end of TLV\")),\n );\n });\n });\n\n describe(\"Parse Derive Command Data\", () => {\n it(\"should parse a valid derive command data\", () => {\n // GIVEN\n const value = new Uint8Array([\n ...[GeneralTags.Bytes, 4, 0x00, 0x00, 0x00, 0x01], // Path\n ...[GeneralTags.PublicKey, 3, 0x04, 0x05, 0x06], // Group Key\n ...[GeneralTags.Bytes, 3, 0x03, 0x05, 0x07], // Initialization Vector\n ...[GeneralTags.Bytes, 3, 0x08, 0x09, 0x0a], // Encrypted xpriv\n ...[GeneralTags.PublicKey, 3, 0x0a, 0x0b, 0x0c], // Ephemeral Public Key\n ]);\n const parser = new TLVParser(\n new Uint8Array([CommandTags.Derive, value.length, ...value]),\n );\n\n // WHEN\n const parsed = parser.parseCommandData();\n\n // THEN\n expect(parsed).toStrictEqual(\n Right({\n type: CommandTags.Derive,\n path: \"m/1\",\n groupKey: new Uint8Array([0x04, 0x05, 0x06]),\n initializationVector: new Uint8Array([0x03, 0x05, 0x07]),\n encryptedXpriv: new Uint8Array([0x08, 0x09, 0x0a]),\n ephemeralPublicKey: new Uint8Array([0x0a, 0x0b, 0x0c]),\n }),\n );\n });\n\n it(\"should fail if the command data is invalid\", () => {\n // GIVEN\n const value1 = new Uint8Array([\n ...[GeneralTags.Int, 2, 0x01, 0x02], // Wrong type for Path\n ]);\n const value2 = new Uint8Array([\n ...[GeneralTags.Bytes, 3, 0x01, 0x02, 0x03], // Correct type but the other fields are missing\n ]);\n const parser1 = new TLVParser(\n new Uint8Array([CommandTags.Derive, value1.length, ...value1]),\n );\n const parser2 = new TLVParser(\n new Uint8Array([CommandTags.Derive, value2.length, ...value2]),\n );\n\n // WHEN\n const parsed1 = parser1.parseCommandData();\n const parsed2 = parser2.parseCommandData();\n\n // THEN\n expect(parsed1).toEqual(Left(new LKRPParsingError(\"Expected bytes\")));\n expect(parsed2).toEqual(\n Left(new LKRPParsingError(\"Unexpected end of TLV\")),\n );\n });\n });\n\n it(\"should fail on unsupported command type\", () => {\n // GIVEN\n const parser = new TLVParser(new Uint8Array([0x3f, 1, 0x01]));\n // WHEN\n const parsed = parser.parseCommandData();\n // THEN\n expect(parsed).toEqual(\n Left(new LKRPParsingError(\"Unsupported command type: 0x3f\")),\n );\n });\n });\n\n describe(\"General Types Parsing\", () => {\n describe(\"parse\", () => {\n it(\"should parse a valid TLV structure\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 1, 0x01, GeneralTags.Bytes, 0]),\n );\n // WHEN\n const value1 = parser.parse();\n const value2 = parser.parse();\n // THEN\n expect(value1).toEqual(Right({ tag: GeneralTags.Int, value: 1 }));\n expect(value2).toEqual(\n Right({ tag: GeneralTags.Bytes, value: new Uint8Array([]) }),\n );\n });\n\n it(\"should fail on invalid TLV structure\", () => {\n // GIVEN\n const parser1 = new TLVParser(new Uint8Array([]));\n const parser2 = new TLVParser(new Uint8Array([GeneralTags.Int]));\n const parser3 = new TLVParser(new Uint8Array([GeneralTags.Int, 2]));\n // WHEN\n const value1 = parser1.parse();\n const value2 = parser2.parse();\n const value3 = parser3.parse();\n // THEN\n expect(value1).toEqual(\n Left(new LKRPParsingError(\"Unexpected end of TLV\")),\n );\n expect(value2).toEqual(\n Left(new LKRPParsingError(\"Invalid end of TLV, expected length\")),\n );\n expect(value3).toEqual(\n Left(new LKRPParsingError(\"Invalid end of TLV value\")),\n );\n });\n });\n\n describe(\"parseNull\", () => {\n it(\"should parse a null value\", () => {\n // GIVEN\n const parser = new TLVParser(new Uint8Array([GeneralTags.Null, 0]));\n // WHEN\n const value = parser.parseNull();\n // THEN\n expect(value).toEqual(Right(null));\n });\n\n it(\"should fail if the tag is not null\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 1, 0x01]),\n );\n // WHEN\n const value = parser.parseNull();\n // THEN\n expect(value).toEqual(Left(new LKRPParsingError(\"Expected null\")));\n });\n\n it(\"should fail if the format is invalid\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Null, 1, 0x02]),\n );\n // WHEN\n const value = parser.parseNull();\n // THEN\n expect(value).toEqual(\n Left(new LKRPParsingError(\"Invalid null length\")),\n );\n });\n });\n\n describe(\"parseInt\", () => {\n it(\"should parse big endian integer values\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([\n ...[GeneralTags.Int, 1, 0x01], // 1\n ...[GeneralTags.Int, 2, 0x01, 0x00], // 256\n ...[GeneralTags.Int, 4, 0x01, 0x00, 0x00, 0x00], // 16777216\n ]),\n );\n // WHEN\n const value1 = parser.parseInt();\n const value2 = parser.parseInt();\n const value4 = parser.parseInt();\n // THEN\n expect(value1).toEqual(Right(1));\n expect(value2).toEqual(Right(256));\n expect(value4).toEqual(Right(16777216));\n });\n\n it(\"should fail if the tag is not an integer\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Bytes, 1, 0x01]),\n );\n // WHEN\n const value = parser.parseInt();\n // THEN\n expect(value).toEqual(Left(new LKRPParsingError(\"Expected a number\")));\n });\n\n it(\"should fail if the integer is not 1, 2, or 4 bytes\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 3, 0x01, 0x02, 0x03]),\n );\n // WHEN\n const value = parser.parseInt();\n // THEN\n expect(value).toEqual(\n Left(new LKRPParsingError(\"Unsupported integer length\")),\n );\n });\n });\n\n describe(\"parseHash\", () => {\n it(\"should parse a hash value\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Hash, 3, 0x01, 0x02, 0x03]),\n );\n // WHEN\n const value = parser.parseHash();\n // THEN\n expect(value).toEqual(Right(new Uint8Array([0x01, 0x02, 0x03])));\n });\n\n it(\"should fail if the tag is not a hash\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 1, 0x01]),\n );\n // WHEN\n const value = parser.parseHash();\n // THEN\n expect(value).toEqual(Left(new LKRPParsingError(\"Expected a hash\")));\n });\n });\n\n describe(\"parseSignature\", () => {\n it(\"should parse a signature value\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Signature, 3, 0x01, 0x02, 0x03]),\n );\n // WHEN\n const value = parser.parseSignature();\n // THEN\n expect(value).toEqual(Right(new Uint8Array([0x01, 0x02, 0x03])));\n });\n\n it(\"should fail if the tag is not a signature\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 1, 0x01]),\n );\n // WHEN\n const value = parser.parseSignature();\n // THEN\n expect(value).toEqual(\n Left(new LKRPParsingError(\"Expected a signature\")),\n );\n });\n });\n\n describe(\"parseString\", () => {\n it(\"should parse a string value\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.String, 5, 0x48, 0x65, 0x6c, 0x6c, 0x6f]),\n );\n // WHEN\n const value = parser.parseString();\n // THEN\n expect(value).toEqual(Right(\"Hello\"));\n });\n\n it(\"should fail if the tag is not a string\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 1, 0x01]),\n );\n // WHEN\n const value = parser.parseString();\n // THEN\n expect(value).toEqual(Left(new LKRPParsingError(\"Expected a string\")));\n });\n });\n\n describe(\"parseBytes\", () => {\n it(\"should parse a bytes value\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Bytes, 3, 0x01, 0x02, 0x03]),\n );\n // WHEN\n const value = parser.parseBytes();\n // THEN\n expect(value).toEqual(Right(new Uint8Array([0x01, 0x02, 0x03])));\n });\n\n it(\"should fail if the tag is not bytes\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 1, 0x01]),\n );\n // WHEN\n const value = parser.parseBytes();\n // THEN\n expect(value).toEqual(Left(new LKRPParsingError(\"Expected bytes\")));\n });\n });\n\n describe(\"parsePublicKey\", () => {\n it(\"should parse a public key value\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.PublicKey, 3, 0x01, 0x02, 0x03]),\n );\n // WHEN\n const value = parser.parsePublicKey();\n // THEN\n expect(value).toEqual(Right(new Uint8Array([0x01, 0x02, 0x03])));\n });\n\n it(\"should fail if the tag is not a public key\", () => {\n // GIVEN\n const parser = new TLVParser(\n new Uint8Array([GeneralTags.Int, 1, 0x01]),\n );\n // WHEN\n const value = parser.parsePublicKey();\n // THEN\n expect(value).toEqual(\n Left(new LKRPParsingError(\"Expected a public key\")),\n );\n });\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAE5B,OAAS,oBAAAC,MAAwB,yBAEjC,OAAS,eAAAC,MAAmB,gBAC5B,OAAS,aAAAC,MAAiB,cAC1B,OAAS,eAAAC,EAAa,eAAAC,MAAmB,YAEzC,SAAS,YAAa,IAAM,CAC1B,SAAS,qBAAsB,IAAM,CACnC,SAAS,gBAAiB,IAAM,CAC9B,GAAG,0EAA2E,IAAM,CAUlF,MAAMC,EARS,IAAIH,EACjB,IAAI,WAAW,CACTE,EAAY,IAAK,EAAG,EACpBD,EAAY,UAAW,EAAOC,EAAY,IAAK,EAAG,EAClDD,EAAY,KAAM,EAAOC,EAAY,IAAK,EAAG,CACnD,CAAC,CACH,EAEwB,cAAc,EAGtC,OAAOC,CAAQ,EAAE,cACfN,EAAM,CACJ,IAAIE,EACF,IAAI,WAAW,CACbE,EAAY,UACZ,EACIC,EAAY,IAA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names": ["Left", "Right", "LKRPParsingError", "LKRPCommand", "TLVParser", "CommandTags", "GeneralTags", "commands", "blockData", "value", "parsed", "value1", "value2", "parser1", "parser2", "parsed1", "parsed2", "parser", "parser3", "value3", "value4"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var u=(x=>(x[x.Null=0]="Null",x[x.Int=1]="Int",x[x.Hash=2]="Hash",x[x.Signature=3]="Signature",x[x.String=4]="String",x[x.Bytes=5]="Bytes",x[x.PublicKey=6]="PublicKey",x))(u||{}),M=(E=>(E[E.Seed=16]="Seed",E[E.AddMember=17]="AddMember",E[E.PublishKey=18]="PublishKey",E[E.CloseStream=19]="CloseStream",E[E.EditMember=20]="EditMember",E[E.Derive=21]="Derive",E))(M||{});const t=128;var i=(x=>(x[x.IV=0]="IV",x[x.ISSUER=1|t]="ISSUER",x[x.XPRIV=2|t]="XPRIV",x[x.EPHEMERAL_PUBLIC_KEY=3]="EPHEMERAL_PUBLIC_KEY",x[x.COMMAND_IV=4]="COMMAND_IV",x[x.GROUPKEY=5]="GROUPKEY",x[x.NEW_MEMBER=6|t]="NEW_MEMBER",x))(i||{});export{M as CommandTags,u as GeneralTags,i as TPTags};
2
+ //# sourceMappingURL=TLVTags.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/internal/utils/TLVTags.ts"],
4
+ "sourcesContent": ["export enum GeneralTags {\n Null = 0x00,\n Int = 0x01,\n Hash = 0x02,\n Signature = 0x03,\n String = 0x04,\n Bytes = 0x05,\n PublicKey = 0x06,\n}\n\nexport enum CommandTags {\n Seed = 0x10,\n AddMember = 0x11,\n PublishKey = 0x12,\n CloseStream = 0x13,\n EditMember = 0x14,\n Derive = 0x15,\n}\n\nconst TP_ENCRYPT = 1 << 7;\n\nexport enum TPTags {\n IV = 0x00,\n ISSUER = 0x01 | TP_ENCRYPT,\n XPRIV = 0x02 | TP_ENCRYPT,\n EPHEMERAL_PUBLIC_KEY = 0x03,\n COMMAND_IV = 0x04,\n GROUPKEY = 0x05,\n NEW_MEMBER = 0x06 | TP_ENCRYPT,\n}\n"],
5
+ "mappings": "AAAO,IAAKA,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,IAAM,GAAN,MACAA,IAAA,KAAO,GAAP,OACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,OAAS,GAAT,SACAA,IAAA,MAAQ,GAAR,QACAA,IAAA,UAAY,GAAZ,YAPUA,OAAA,IAUAC,OACVA,IAAA,KAAO,IAAP,OACAA,IAAA,UAAY,IAAZ,YACAA,IAAA,WAAa,IAAb,aACAA,IAAA,YAAc,IAAd,cACAA,IAAA,WAAa,IAAb,aACAA,IAAA,OAAS,IAAT,SANUA,OAAA,IASZ,MAAMC,EAAa,IAEZ,IAAKC,OACVA,IAAA,GAAK,GAAL,KACAA,IAAA,OAAS,EAAOD,GAAhB,SACAC,IAAA,MAAQ,EAAOD,GAAf,QACAC,IAAA,qBAAuB,GAAvB,uBACAA,IAAA,WAAa,GAAb,aACAA,IAAA,SAAW,GAAX,WACAA,IAAA,WAAa,EAAOD,GAApB,aAPUC,OAAA",
6
+ "names": ["GeneralTags", "CommandTags", "TP_ENCRYPT", "TPTags"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{gcm as e}from"@noble/ciphers/aes";import{randomBytes as y}from"@noble/ciphers/webcrypto";import{hmac as s}from"@noble/hashes/hmac";import{sha256 as o}from"@noble/hashes/sha256";import{etc as m,utils as p}from"@noble/secp256k1";import{KeypairFromBytes as A}from"../../api/app-binder/KeypairFromBytes";const a=16;class B{static randomBytes(r){return y(r)}static randomKeypair(){return new A(p.randomPrivateKey())}static encrypt(r,t,n){return e(r,t.slice(0,a)).encrypt(n)}static decrypt(r,t,n){return e(r,t.slice(0,a)).decrypt(n)}static hash(r){return o(r)}static hmac(r,t){return s(o,r,t)}static derEncode(r,t){const n=this.encodeSigComponent(r),i=this.encodeSigComponent(t),c=n.length+i.length;return Uint8Array.from([48,c,...n,...i])}static encodeSigComponent(r){const t=m.numberToBytesBE(r),n=t[0]&&t[0]>=128?[0]:[],i=t.length+n.length;return Uint8Array.from([2,i,...n,...t])}}export{a as AES_BLOCK_SIZE,B as CryptoUtils};
2
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/internal/utils/crypto.ts"],
4
+ "sourcesContent": ["import { gcm } from \"@noble/ciphers/aes\";\nimport { randomBytes } from \"@noble/ciphers/webcrypto\";\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { etc, utils } from \"@noble/secp256k1\";\n\nimport { KeypairFromBytes } from \"@api/app-binder/KeypairFromBytes\";\nimport { type Keypair } from \"@api/index\";\n\nexport const AES_BLOCK_SIZE = 16;\n\nexport class CryptoUtils {\n static randomBytes(len: number): Uint8Array {\n return randomBytes(len);\n }\n\n static randomKeypair(): Keypair {\n return new KeypairFromBytes(utils.randomPrivateKey());\n }\n\n static encrypt(\n key: Uint8Array,\n iv: Uint8Array,\n cleartext: Uint8Array,\n ): Uint8Array {\n const cipher = gcm(key, iv.slice(0, AES_BLOCK_SIZE));\n return cipher.encrypt(cleartext);\n }\n\n static decrypt(\n key: Uint8Array,\n iv: Uint8Array,\n ciphertext: Uint8Array,\n ): Uint8Array {\n const cipher = gcm(key, iv.slice(0, AES_BLOCK_SIZE));\n return cipher.decrypt(ciphertext);\n }\n\n static hash(bytes: Uint8Array): Uint8Array {\n return sha256(bytes);\n }\n\n static hmac(key: Uint8Array, message: Uint8Array): Uint8Array {\n return hmac(sha256, key, message);\n }\n\n /**\n * DER specification: https://ledgerhq.atlassian.net/wiki/spaces/TrustServices/pages/3843719348/LNS+Arch+Common+Fields+for+Nano+certificates+and+descriptors#DER-Encoding-spec\n * See: https://ledgerhq.atlassian.net/wiki/spaces/TrustServices/pages/3736863735/LNS+Arch+Nano+Trusted+Names+Descriptor+Format+APIs\n * signature(r,s) = 0x30 & var(L,u8(~)) & sized(8*L, sig_components(r,s)); # DER encoding of the two 32 bytes signature components r & s\n * sig_components(r,s) = 0x02 & var(Lr,u8(~)) & sized(8*Lr, r) & 0x02 & var(Ls,u8(~)) & sized(8*Ls, s);\n */\n public static derEncode(r: bigint, s: bigint): Uint8Array {\n const rBytes = this.encodeSigComponent(r);\n const sBytes = this.encodeSigComponent(s);\n const length = rBytes.length + sBytes.length;\n return Uint8Array.from([0x30, length, ...rBytes, ...sBytes]);\n }\n\n private static encodeSigComponent(number: bigint): Uint8Array {\n const bytes = etc.numberToBytesBE(number);\n const padding = bytes[0] && bytes[0] >= 0x80 ? [0x00] : []; // Add padding if the first byte is >= 0x80 to ensure positive encoding\n const length = bytes.length + padding.length;\n return Uint8Array.from([0x02, length, ...padding, ...bytes]);\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,OAAAA,MAAW,qBACpB,OAAS,eAAAC,MAAmB,2BAC5B,OAAS,QAAAC,MAAY,qBACrB,OAAS,UAAAC,MAAc,uBACvB,OAAS,OAAAC,EAAK,SAAAC,MAAa,mBAE3B,OAAS,oBAAAC,MAAwB,mCAG1B,MAAMC,EAAiB,GAEvB,MAAMC,CAAY,CACvB,OAAO,YAAYC,EAAyB,CAC1C,OAAOR,EAAYQ,CAAG,CACxB,CAEA,OAAO,eAAyB,CAC9B,OAAO,IAAIH,EAAiBD,EAAM,iBAAiB,CAAC,CACtD,CAEA,OAAO,QACLK,EACAC,EACAC,EACY,CAEZ,OADeZ,EAAIU,EAAKC,EAAG,MAAM,EAAGJ,CAAc,CAAC,EACrC,QAAQK,CAAS,CACjC,CAEA,OAAO,QACLF,EACAC,EACAE,EACY,CAEZ,OADeb,EAAIU,EAAKC,EAAG,MAAM,EAAGJ,CAAc,CAAC,EACrC,QAAQM,CAAU,CAClC,CAEA,OAAO,KAAKC,EAA+B,CACzC,OAAOX,EAAOW,CAAK,CACrB,CAEA,OAAO,KAAKJ,EAAiBK,EAAiC,CAC5D,OAAOb,EAAKC,EAAQO,EAAKK,CAAO,CAClC,CAQA,OAAc,UAAU,EAAWC,EAAuB,CACxD,MAAMC,EAAS,KAAK,mBAAmB,CAAC,EAClCC,EAAS,KAAK,mBAAmBF,CAAC,EAClCG,EAASF,EAAO,OAASC,EAAO,OACtC,OAAO,WAAW,KAAK,CAAC,GAAMC,EAAQ,GAAGF,EAAQ,GAAGC,CAAM,CAAC,CAC7D,CAEA,OAAe,mBAAmBE,EAA4B,CAC5D,MAAMN,EAAQV,EAAI,gBAAgBgB,CAAM,EAClCC,EAAUP,EAAM,CAAC,GAAKA,EAAM,CAAC,GAAK,IAAO,CAAC,CAAI,EAAI,CAAC,EACnDK,EAASL,EAAM,OAASO,EAAQ,OACtC,OAAO,WAAW,KAAK,CAAC,EAAMF,EAAQ,GAAGE,EAAS,GAAGP,CAAK,CAAC,CAC7D,CACF",
6
+ "names": ["gcm", "randomBytes", "hmac", "sha256", "etc", "utils", "KeypairFromBytes", "AES_BLOCK_SIZE", "CryptoUtils", "len", "key", "iv", "cleartext", "ciphertext", "bytes", "message", "s", "rBytes", "sBytes", "length", "number", "padding"]
7
+ }
@@ -0,0 +1,2 @@
1
+ function a(t){const n=new DataView(t.buffer);return"m/"+Array.from({length:t.length/4},(r,e)=>e*4).map(r=>n.getUint32(r,!1)).map(r=>r>=2147483648?`${r-2147483648}'`:String(r)).join("/")}function s(t){return new Uint8Array(t.split("/").slice(1).flatMap(n=>{const e=n.endsWith("'")?Number(n.slice(0,-1))+2147483648:Number(n),i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,e,!1),Array.from(i)}))}export{s as derivationPathAsBytes,a as derivationPathAsString};
2
+ //# sourceMappingURL=derivationPath.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/internal/utils/derivationPath.ts"],
4
+ "sourcesContent": ["export function derivationPathAsString(bytes: Uint8Array): string {\n const dataView = new DataView(bytes.buffer);\n return (\n \"m/\" +\n Array.from({ length: bytes.length / 4 }, (_, i) => i * 4)\n .map((offset) => dataView.getUint32(offset, false)) // Big-endian\n .map((segment) =>\n segment >= 0x80000000 ? `${segment - 0x80000000}'` : String(segment),\n )\n .join(\"/\")\n );\n}\n\nexport function derivationPathAsBytes(path: string): Uint8Array {\n return new Uint8Array(\n path\n .split(\"/\")\n .slice(1)\n .flatMap((part) => {\n const hardened = part.endsWith(\"'\");\n const number = hardened\n ? Number(part.slice(0, -1)) + 0x80000000\n : Number(part);\n const result = new Uint8Array(4);\n new DataView(result.buffer).setUint32(0, number, false);\n return Array.from(result);\n }),\n );\n}\n"],
5
+ "mappings": "AAAO,SAASA,EAAuBC,EAA2B,CAChE,MAAMC,EAAW,IAAI,SAASD,EAAM,MAAM,EAC1C,MACE,KACA,MAAM,KAAK,CAAE,OAAQA,EAAM,OAAS,CAAE,EAAG,CAACE,EAAGC,IAAMA,EAAI,CAAC,EACrD,IAAKC,GAAWH,EAAS,UAAUG,EAAQ,EAAK,CAAC,EACjD,IAAKC,GACJA,GAAW,WAAa,GAAGA,EAAU,UAAU,IAAM,OAAOA,CAAO,CACrE,EACC,KAAK,GAAG,CAEf,CAEO,SAASC,EAAsBC,EAA0B,CAC9D,OAAO,IAAI,WACTA,EACG,MAAM,GAAG,EACT,MAAM,CAAC,EACP,QAASC,GAAS,CAEjB,MAAMC,EADWD,EAAK,SAAS,GAAG,EAE9B,OAAOA,EAAK,MAAM,EAAG,EAAE,CAAC,EAAI,WAC5B,OAAOA,CAAI,EACTE,EAAS,IAAI,WAAW,CAAC,EAC/B,WAAI,SAASA,EAAO,MAAM,EAAE,UAAU,EAAGD,EAAQ,EAAK,EAC/C,MAAM,KAAKC,CAAM,CAC1B,CAAC,CACL,CACF",
6
+ "names": ["derivationPathAsString", "bytes", "dataView", "_", "i", "offset", "segment", "derivationPathAsBytes", "path", "part", "number", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Either as i,EitherAsync as s,Right as c}from"purify-ts";function d(o){const n={};for(const[e,t]of Object.entries(o)){const r=typeof t=="function"&&t.length===0&&t();if(!i.isEither(r))Object.assign(n,{[e]:t});else{if(r.isLeft())return r;Object.assign(n,{[e]:r.extract()})}}return c(n)}function T(o){return s.sequence(Object.entries(o).map(([n,e])=>e&&typeof e=="object"&&e.constructor===s?e.map(t=>[n,t]):s.liftEither(c([n,e])))).map(Object.fromEntries)}export{T as eitherAsyncSeqRecord,d as eitherSeqRecord};
2
+ //# sourceMappingURL=eitherSeqRecord.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/internal/utils/eitherSeqRecord.ts"],
4
+ "sourcesContent": ["import { Either, EitherAsync, Right } from \"purify-ts\";\n\n/**\n * Like a lazy version of [Either.sequence](https://gigobyte.github.io/purify/adts/Either#static-sequence) but for records.\n * E.g.:\n * eitherSeqRecord({ a: () => Right(1), b: () => Right(\"a\") }) -> Right({ a: 1, b: \"a\" })\n * eitherSeqRecord({ a: () => Right(1), b: () => Left(\"error\") }) -> Left(\"error\")\n * It also allows with non-Either values:\n * eitherSeqRecord({ a: () => Right(1), b: \"a\" }) -> Right({ a: 1, b: \"a\" })\n */\n\nexport function eitherSeqRecord<T extends object>(\n record: T,\n): EitherSeqRecord<T> {\n const result: Partial<EitherSeqRecord<T>> = {};\n for (const [key, value] of Object.entries(record) as [string, T[keyof T]][]) {\n const res =\n typeof value === \"function\" &&\n value.length === 0 &&\n (value as () => unknown)();\n\n if (!Either.isEither(res)) {\n Object.assign(result, { [key]: value });\n } else if (res.isLeft()) {\n return res as EitherSeqRecord<T>;\n } else {\n Object.assign(result, { [key]: res.extract() });\n }\n }\n return Right(result) as EitherSeqRecord<T>;\n}\n\ntype EitherSeqRecord<T extends object> = Either<\n UnionOfLeft<T>,\n RecordOfNonLeft<T>\n>;\n\ntype RecordOfNonLeft<T extends object> = {\n [K in keyof T]: T[K] extends () => Either<unknown, infer R> ? R : T[K];\n};\n\ntype UnionOfLeft<T extends object> =\n T extends Record<string, infer U>\n ? U extends () => Either<infer L, unknown>\n ? L\n : never\n : never;\n\n/**\n * eitherAsyncSeqRecord: like eitherSeqRecord but for EitherAsync.\n * (but not wrapped in a function as EitherAsync are already lazy).\n * E.g.:\n * eitherSeqRecordAsync({ a: EitherAsync<ErrA, 1>, b: EitherAsync<ErrB, \"a\"> }) -> EitherAsync(ErrA | ErrB, { a: 1, b: \"a\" }>\n */\nexport function eitherAsyncSeqRecord<T extends object>(\n record: T,\n): EitherAsyncSeqRecord<T> {\n return EitherAsync.sequence(\n Object.entries(record).map(([key, value]) =>\n value &&\n typeof value === \"object\" &&\n (value as object).constructor === EitherAsync\n ? (value as EitherAsync<unknown, unknown>).map((v) => [key, v])\n : EitherAsync.liftEither(Right([key, value])),\n ),\n ).map(Object.fromEntries) as EitherAsyncSeqRecord<T>;\n}\n\ntype EitherAsyncSeqRecord<T extends object> = EitherAsync<\n UnionOfLeftAsync<T>,\n RecordOfNonLeftAsync<T>\n>;\n\ntype RecordOfNonLeftAsync<T extends object> = {\n [K in keyof T]: T[K] extends EitherAsync<unknown, infer R> ? R : T[K];\n};\n\ntype UnionOfLeftAsync<T extends object> =\n T extends Record<string, infer U>\n ? U extends EitherAsync<infer L, unknown>\n ? L\n : never\n : never;\n"],
5
+ "mappings": "AAAA,OAAS,UAAAA,EAAQ,eAAAC,EAAa,SAAAC,MAAa,YAWpC,SAASC,EACdC,EACoB,CACpB,MAAMC,EAAsC,CAAC,EAC7C,SAAW,CAACC,EAAKC,CAAK,IAAK,OAAO,QAAQH,CAAM,EAA6B,CAC3E,MAAMI,EACJ,OAAOD,GAAU,YACjBA,EAAM,SAAW,GAChBA,EAAwB,EAE3B,GAAI,CAACP,EAAO,SAASQ,CAAG,EACtB,OAAO,OAAOH,EAAQ,CAAE,CAACC,CAAG,EAAGC,CAAM,CAAC,MACjC,IAAIC,EAAI,OAAO,EACpB,OAAOA,EAEP,OAAO,OAAOH,EAAQ,CAAE,CAACC,CAAG,EAAGE,EAAI,QAAQ,CAAE,CAAC,EAElD,CACA,OAAON,EAAMG,CAAM,CACrB,CAwBO,SAASI,EACdL,EACyB,CACzB,OAAOH,EAAY,SACjB,OAAO,QAAQG,CAAM,EAAE,IAAI,CAAC,CAACE,EAAKC,CAAK,IACrCA,GACA,OAAOA,GAAU,UAChBA,EAAiB,cAAgBN,EAC7BM,EAAwC,IAAKG,GAAM,CAACJ,EAAKI,CAAC,CAAC,EAC5DT,EAAY,WAAWC,EAAM,CAACI,EAAKC,CAAK,CAAC,CAAC,CAChD,CACF,EAAE,IAAI,OAAO,WAAW,CAC1B",
6
+ "names": ["Either", "EitherAsync", "Right", "eitherSeqRecord", "record", "result", "key", "value", "res", "eitherAsyncSeqRecord", "v"]
7
+ }
@@ -0,0 +1,2 @@
1
+ function t(r){return Uint8Array.from(Buffer.from(r,"hex"))}function e(r){return Buffer.from(r).toString("hex")}export{e as bytesToHex,t as hexToBytes};
2
+ //# sourceMappingURL=hex.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/internal/utils/hex.ts"],
4
+ "sourcesContent": ["export function hexToBytes(hex: string): Uint8Array {\n return Uint8Array.from(Buffer.from(hex, \"hex\"));\n}\n\nexport function bytesToHex(bytes: Uint8Array): string {\n return Buffer.from(bytes).toString(\"hex\");\n}\n"],
5
+ "mappings": "AAAO,SAASA,EAAWC,EAAyB,CAClD,OAAO,WAAW,KAAK,OAAO,KAAKA,EAAK,KAAK,CAAC,CAChD,CAEO,SAASC,EAAWC,EAA2B,CACpD,OAAO,OAAO,KAAKA,CAAK,EAAE,SAAS,KAAK,CAC1C",
6
+ "names": ["hexToBytes", "hex", "bytesToHex", "bytes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Maybe as i}from"purify-ts";import{LKRPMissingDataError as n}from"../../api/app-binder/Errors";function u(r,e){return i.fromNullable(r).toEither(new n(e))}export{u as required};
2
+ //# sourceMappingURL=required.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/internal/utils/required.ts"],
4
+ "sourcesContent": ["import { Maybe } from \"purify-ts\";\n\nimport { LKRPMissingDataError } from \"@api/app-binder/Errors\";\n\nexport function required<T>(prop: T | undefined | null, errorMsg: string) {\n return Maybe.fromNullable(prop).toEither(new LKRPMissingDataError(errorMsg));\n}\n"],
5
+ "mappings": "AAAA,OAAS,SAAAA,MAAa,YAEtB,OAAS,wBAAAC,MAA4B,yBAE9B,SAASC,EAAYC,EAA4BC,EAAkB,CACxE,OAAOJ,EAAM,aAAaG,CAAI,EAAE,SAAS,IAAIF,EAAqBG,CAAQ,CAAC,CAC7E",
6
+ "names": ["Maybe", "LKRPMissingDataError", "required", "prop", "errorMsg"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@ledgerhq/device-trusted-app-kit-ledger-keyring-protocol",
3
+ "version": "0.0.0",
4
+ "license": "Apache-2.0",
5
+ "private": false,
6
+ "exports": {
7
+ ".": {
8
+ "types": "./lib/types/index.d.ts",
9
+ "import": "./lib/esm/index.js",
10
+ "require": "./lib/cjs/index.js"
11
+ },
12
+ "./*": {
13
+ "types": "./lib/types/*",
14
+ "import": "./lib/esm/*",
15
+ "require": "./lib/cjs/*"
16
+ }
17
+ },
18
+ "files": [
19
+ "./lib"
20
+ ],
21
+ "scripts": {
22
+ "prebuild": "rimraf lib",
23
+ "build": "pnpm ldmk-tool build --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
24
+ "dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
25
+ "watch:builds": "pnpm ldmk-tool watch --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
26
+ "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\"",
27
+ "lint": "eslint",
28
+ "lint:fix": "pnpm lint --fix",
29
+ "postpack": "find . -name '*.tgz' -exec cp {} ../../dist/ \\; ",
30
+ "prettier": "prettier . --check",
31
+ "prettier:fix": "prettier . --write",
32
+ "typecheck": "tsc --noEmit",
33
+ "test": "vitest run --passWithNoTests",
34
+ "test:watch": "vitest --passWithNoTests",
35
+ "test:coverage": "vitest run --coverage --passWithNoTests"
36
+ },
37
+ "dependencies": {
38
+ "@ledgerhq/device-management-kit": "workspace:*",
39
+ "@ledgerhq/signer-utils": "workspace:*",
40
+ "@noble/ciphers": "^1.3.0",
41
+ "@noble/hashes": "^1.8.0",
42
+ "@noble/secp256k1": "^2.3.0",
43
+ "inversify": "catalog:",
44
+ "purify-ts": "catalog:",
45
+ "reflect-metadata": "catalog:",
46
+ "xstate": "catalog:"
47
+ },
48
+ "devDependencies": {
49
+ "@ledgerhq/eslint-config-dsdk": "workspace:*",
50
+ "@ledgerhq/ldmk-tool": "workspace:*",
51
+ "@ledgerhq/prettier-config-dsdk": "workspace:*",
52
+ "@ledgerhq/tsconfig-dsdk": "workspace:*",
53
+ "@ledgerhq/vitest-config-dmk": "workspace:*"
54
+ }
55
+ }
@@ -0,0 +1,9 @@
1
+ import { type Maybe } from "purify-ts";
2
+ import { type AuthenticateDAReturnType } from "./app-binder/AuthenticateDeviceActionTypes";
3
+ import { type JWT, type Keypair, type Permissions } from "./app-binder/LKRPTypes";
4
+ export interface LedgerKeyringProtocol {
5
+ authenticate: (keypair: Keypair, applicationId: number, clientName: string, permissions: Permissions, trustchainId?: string, JWT?: JWT) => AuthenticateDAReturnType;
6
+ encryptData: (xpriv: Uint8Array, data: Uint8Array) => Uint8Array;
7
+ decryptData: (xpriv: Uint8Array, data: Uint8Array) => Maybe<Uint8Array>;
8
+ }
9
+ //# sourceMappingURL=LedgerKeyringProtocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LedgerKeyringProtocol.d.ts","sourceRoot":"","sources":["../../../src/api/LedgerKeyringProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,WAAW,EACjB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,CACZ,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,WAAW,EACxB,YAAY,CAAC,EAAE,MAAM,EACrB,GAAG,CAAC,EAAE,GAAG,KACN,wBAAwB,CAAC;IAE9B,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,KAAK,UAAU,CAAC;IAEjE,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,KAAK,KAAK,CAAC,UAAU,CAAC,CAAC;CACzE"}
@@ -0,0 +1,14 @@
1
+ import { type DeviceManagementKit, type DeviceSessionId } from "@ledgerhq/device-management-kit";
2
+ import { type LedgerKeyringProtocol } from "./LedgerKeyringProtocol";
3
+ export declare class LedgerKeyringProtocolBuilder {
4
+ private readonly dmk;
5
+ private readonly sessionId;
6
+ private readonly baseUrl;
7
+ constructor({ dmk, sessionId, baseUrl, }: {
8
+ dmk: DeviceManagementKit;
9
+ sessionId: DeviceSessionId;
10
+ baseUrl: string;
11
+ });
12
+ build(): LedgerKeyringProtocol;
13
+ }
14
+ //# sourceMappingURL=LedgerKeyringProtocolBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LedgerKeyringProtocolBuilder.d.ts","sourceRoot":"","sources":["../../../src/api/LedgerKeyringProtocolBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,qBAAa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAsB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,EACV,GAAG,EACH,SAAS,EACT,OAAO,GACR,EAAE;QACD,GAAG,EAAE,mBAAmB,CAAC;QACzB,SAAS,EAAE,eAAe,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;KACjB;IAMD,KAAK,IAAI,qBAAqB;CAO/B"}
@@ -0,0 +1,27 @@
1
+ import { type OpenAppDAError, type UnknownDAError } from "@ledgerhq/device-management-kit";
2
+ import { type Either } from "purify-ts";
3
+ import { type LKRPDeviceCommandError } from "../../internal/app-binder/command/utils/ledgerKeyringProtocolErrors";
4
+ import { type LKRPDataSource } from "../../internal/lkrp-datasource/data/LKRPDataSource";
5
+ import { type LKRPBlockStream } from "../../internal/utils/LKRPBlockStream";
6
+ import { type Trustchain } from "../../internal/utils/types";
7
+ import { type LKRPHttpRequestError, type LKRPMissingDataError, type LKRPParsingError } from "./Errors";
8
+ import { type JWT, type Keypair, type Permissions } from "./LKRPTypes";
9
+ export type AddToTrustchainDAOutput = undefined;
10
+ export type AddToTrustchainDAInput = Either<LKRPMissingDataError, {
11
+ readonly lkrpDataSource: LKRPDataSource;
12
+ readonly keypair: Keypair;
13
+ readonly jwt: JWT;
14
+ readonly trustchainId: string;
15
+ readonly trustchain: Trustchain;
16
+ readonly applicationStream: LKRPBlockStream;
17
+ readonly clientName: string;
18
+ readonly permissions: Permissions;
19
+ }>;
20
+ export type AddToTrustchainDAError = LKRPDeviceCommandError | LKRPHttpRequestError | LKRPParsingError | LKRPMissingDataError | OpenAppDAError | UnknownDAError;
21
+ export type AddToTrustchainDAIntermediateValue = {
22
+ readonly requiredUserInteraction: string;
23
+ };
24
+ export type AddToTrustchainDAInternalState = Either<AddToTrustchainDAError, {
25
+ readonly sessionKeypair: Keypair | null;
26
+ }>;
27
+ //# sourceMappingURL=AddToTrustchainDeviceActionTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddToTrustchainDeviceActionTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/AddToTrustchainDeviceActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEvE,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC;AAEhD,MAAM,MAAM,sBAAsB,GAAG,MAAM,CACzC,oBAAoB,EACpB;IACE,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,eAAe,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC,CACF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9B,sBAAsB,GACtB,oBAAoB,GACpB,gBAAgB,GAChB,oBAAoB,GACpB,cAAc,GACd,cAAc,CAAC;AAEnB,MAAM,MAAM,kCAAkC,GAAG;IAC/C,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,MAAM,CACjD,sBAAsB,EACtB;IACE,QAAQ,CAAC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;CACzC,CACF,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { type ExecuteDeviceActionReturnType, type OpenAppDAError, type UnknownDAError } from "@ledgerhq/device-management-kit";
2
+ import { type Either } from "purify-ts";
3
+ import { type LKRPDeviceCommandError } from "../../internal/app-binder/command/utils/ledgerKeyringProtocolErrors";
4
+ import { type LKRPDataSource } from "../../internal/lkrp-datasource/data/LKRPDataSource";
5
+ import { type LKRPBlockStream } from "../../internal/utils/LKRPBlockStream";
6
+ import { type Trustchain } from "../../internal/utils/types";
7
+ import { type LKRPHttpRequestError, type LKRPMissingDataError, type LKRPParsingError, type LKRPUnhandledState } from "./Errors";
8
+ import { type JWT, type Keypair, type Permissions } from "./LKRPTypes";
9
+ export type AuthenticateDAReturnType = ExecuteDeviceActionReturnType<AuthenticateDAOutput, AuthenticateDAError, AuthenticateDAIntermediateValue>;
10
+ export type AuthenticateDAInput = {
11
+ readonly lkrpDataSource: LKRPDataSource;
12
+ readonly applicationId: number;
13
+ readonly keypair: Keypair;
14
+ readonly clientName: string;
15
+ readonly permissions: Permissions;
16
+ readonly trustchainId: string | null;
17
+ readonly jwt: JWT | null;
18
+ };
19
+ export type AuthenticateDAOutput = {
20
+ readonly jwt: JWT | null;
21
+ readonly trustchainId: string | null;
22
+ readonly applicationPath: string | null;
23
+ readonly encryptionKey: Uint8Array | null;
24
+ };
25
+ export type AuthenticateDAError = LKRPDeviceCommandError | LKRPHttpRequestError | LKRPParsingError | LKRPMissingDataError | LKRPUnhandledState | OpenAppDAError | UnknownDAError;
26
+ export type AuthenticateDAIntermediateValue = {
27
+ readonly requiredUserInteraction: string;
28
+ };
29
+ export type AuthenticateDAInternalState = Either<AuthenticateDAError, {
30
+ readonly trustchainId: string | null;
31
+ readonly jwt: JWT | null;
32
+ readonly trustchain: Trustchain | null;
33
+ readonly applicationStream: LKRPBlockStream | null;
34
+ readonly encryptionKey: Uint8Array | null;
35
+ readonly wasAddedToTrustchain: boolean;
36
+ }>;
37
+ //# sourceMappingURL=AuthenticateDeviceActionTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthenticateDeviceActionTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/AuthenticateDeviceActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEvE,MAAM,MAAM,wBAAwB,GAAG,6BAA6B,CAClE,oBAAoB,EACpB,mBAAmB,EACnB,+BAA+B,CAChC,CAAC;AAEF,MAAM,MAAM,mBAAm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,CACF,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { GeneralDmkError } from "@ledgerhq/device-management-kit";
2
+ export declare class LKRPHttpRequestError extends GeneralDmkError {
3
+ readonly err?: unknown | undefined;
4
+ _tag: string;
5
+ constructor(err?: unknown | undefined);
6
+ }
7
+ export declare class LKRPUnauthorizedError extends LKRPHttpRequestError {
8
+ err?: unknown | undefined;
9
+ _tag: string;
10
+ constructor(err?: unknown | undefined);
11
+ }
12
+ export declare class LKRPParsingError extends GeneralDmkError {
13
+ readonly err?: unknown | undefined;
14
+ readonly _tag = "LKRPParsingError";
15
+ constructor(err?: unknown | undefined);
16
+ }
17
+ export declare class LKRPMissingDataError extends GeneralDmkError {
18
+ readonly err?: unknown | undefined;
19
+ readonly _tag = "LKRPMissingDataError";
20
+ constructor(err?: unknown | undefined);
21
+ }
22
+ export declare class LKRPUnhandledState extends GeneralDmkError {
23
+ readonly err?: unknown | undefined;
24
+ readonly _tag = "LKRPUnhandledState";
25
+ constructor(err?: unknown | undefined);
26
+ }
27
+ //# sourceMappingURL=Errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,qBAAa,oBAAqB,SAAQ,eAAe;IAE3C,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO;IADzB,IAAI,SAA0B;gBAClB,GAAG,CAAC,EAAE,OAAO,YAAA;CAGnC;AAED,qBAAa,qBAAsB,SAAQ,oBAAoB;IAExC,GAAG,CAAC,EAAE,OAAO;IADzB,IAAI,SAA2B;gBACnB,GAAG,CAAC,EAAE,OAAO,YAAA;CAGnC;AAED,qBAAa,gBAAiB,SAAQ,eAAe;IAEvC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO;IADlC,SAAkB,IAAI,sBAAsB;gBACvB,GAAG,CAAC,EAAE,OAAO,YAAA;CAGnC;AAED,qBAAa,oBAAqB,SAAQ,eAAe;IAE3C,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO;IADlC,SAAkB,IAAI,0BAA0B;gBAC3B,GAAG,CAAC,EAAE,OAAO,YAAA;CAGnC;AAED,qBAAa,kBAAmB,SAAQ,eAAe;IAEzC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO;IADlC,SAAkB,IAAI,wBAAwB;gBACzB,GAAG,CAAC,EAAE,OAAO,YAAA;CAGnC"}
@@ -0,0 +1,5 @@
1
+ export type GetAppNameCommandResponse = {
2
+ readonly name: string;
3
+ };
4
+ export type GetAppNameCommandArgs = undefined;
5
+ //# sourceMappingURL=GetAppNameCommandTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetAppNameCommandTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/GetAppNameCommandTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type GetSeedIdCommandResponse = {
2
+ readonly credential: {
3
+ readonly version: number;
4
+ readonly curveId: number;
5
+ readonly signAlgorithm: number;
6
+ readonly publicKey: string;
7
+ };
8
+ readonly signature: string;
9
+ readonly attestation: string;
10
+ };
11
+ export type GetSeedIdCommandArgs = {
12
+ readonly challengeTLV: string;
13
+ };
14
+ //# sourceMappingURL=GetSeedIdCommandTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetSeedIdCommandTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/GetSeedIdCommandTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type GetVersionCommandResponse = {
2
+ readonly version: string;
3
+ };
4
+ export type GetVersionCommandArgs = undefined;
5
+ //# sourceMappingURL=GetVersionCommandTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetVersionCommandTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/GetVersionCommandTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type CommandErrorResult, type ExecuteDeviceActionReturnType, type OpenAppDAError, type SendCommandInAppDAIntermediateValue, type SendCommandInAppDAOutput, type UserInteractionRequired } from "@ledgerhq/device-management-kit";
2
+ import { type GetVersionCommandResponse } from "../app-binder/GetVersionCommandTypes";
3
+ import { type LedgerKeyringProtocolErrorCodes } from "../../internal/app-binder/command/utils/ledgerKeyringProtocolErrors";
4
+ type GetVersionDAUserInteractionRequired = UserInteractionRequired.None;
5
+ export type GetVersionDAOutput = SendCommandInAppDAOutput<GetVersionCommandResponse>;
6
+ export type GetVersionDAError = OpenAppDAError | CommandErrorResult<LedgerKeyringProtocolErrorCodes>["error"];
7
+ export type GetVersionDAIntermediateValue = SendCommandInAppDAIntermediateValue<GetVersionDAUserInteractionRequired>;
8
+ export type GetVersionDAReturnType = ExecuteDeviceActionReturnType<GetVersionDAOutput, GetVersionDAError, GetVersionDAIntermediateValue>;
9
+ export {};
10
+ //# sourceMappingURL=GetVersionDeviceActionTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetVersionDeviceActionTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/GetVersionDeviceActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EAClC,KAAK,cAAc,EACnB,KAAK,mCAAmC,EACxC,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,gEAAgE,CAAC;AAEtH,KAAK,mCAAmC,GAAG,uBAAuB,CAAC,IAAI,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAC5B,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,kBAAkB,CAAC,+BAA+B,CAAC,CAAC,OAAO,CAAC,CAAC;AAEjE,MAAM,MAAM,6BAA6B,GACvC,mCAAmC,CAAC,mCAAmC,CAAC,CAAC;AAE3E,MAAM,MAAM,sBAAsB,GAAG,6BAA6B,CAChE,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,CAC9B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type InitCommandResponse = void;
2
+ export type InitCommandArgs = {
3
+ publicKey: Uint8Array;
4
+ };
5
+ //# sourceMappingURL=InitCommandTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitCommandTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/InitCommandTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type Keypair } from "../index";
2
+ export declare class KeypairFromBytes implements Keypair {
3
+ private readonly privateKey;
4
+ private readonly publicKey;
5
+ constructor(privateKey: Uint8Array, publicKey?: import("@noble/secp256k1").Bytes);
6
+ pubKeyToU8a(): Uint8Array;
7
+ pubKeyToHex(): string;
8
+ sign(message: Uint8Array): Promise<Uint8Array>;
9
+ ecdh(publicKey: Uint8Array, isCompressed?: boolean): Uint8Array;
10
+ }
11
+ //# sourceMappingURL=KeypairFromBytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeypairFromBytes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/KeypairFromBytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,qBAAa,gBAAiB,YAAW,OAAO;IAE5C,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,UAAU,EAAE,UAAU,EACtB,SAAS,mCAA2B;IAGvD,WAAW,IAAI,UAAU;IAIzB,WAAW,IAAI,MAAM;IAIf,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAKpD,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,UAAO,GAAG,UAAU;CAG7D"}
@@ -0,0 +1,24 @@
1
+ export interface Keypair {
2
+ pubKeyToU8a(): Uint8Array;
3
+ pubKeyToHex(): string;
4
+ sign(message: Uint8Array): Promise<Uint8Array>;
5
+ ecdh(publicKey: Uint8Array): Uint8Array;
6
+ }
7
+ export type JWT = {
8
+ access_token: string;
9
+ permissions: {
10
+ [trustchainId: string]: {
11
+ [path: string]: string[];
12
+ };
13
+ };
14
+ };
15
+ /**
16
+ * https://ledgerhq.atlassian.net/wiki/spaces/TA/pages/5865144361/ARCH+LKRP+-+v2+specifications#Member-permissions
17
+ */
18
+ export declare enum Permissions {
19
+ OWNER = 4294967295,// Owners of the stream have access to everything
20
+ CAN_ENCRYPT = 1,// The member can have access to the stream private key
21
+ CAN_DERIVE = 2,// The member can have access to the stream chain code (if a member have access to the private key and the chain code it is able to derive sub-streams)
22
+ CAN_ADD_BLOCK = 4
23
+ }
24
+ //# sourceMappingURL=LKRPTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LKRPTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/LKRPTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,WAAW,IAAI,UAAU,CAAC;IAC1B,WAAW,IAAI,MAAM,CAAC;IACtB,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC;CACzC;AAED,MAAM,MAAM,GAAG,GAAG;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE;QACX,CAAC,YAAY,EAAE,MAAM,GAAG;YACtB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;SAC1B,CAAC;KACH,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,oBAAY,WAAW;IACrB,KAAK,aAAa,CAAE,iDAAiD;IACrE,WAAW,IAAI,CAAE,uDAAuD;IACxE,UAAU,IAAS,CAAE,uJAAuJ;IAC5K,aAAa,IAAS;CACvB"}
@@ -0,0 +1,6 @@
1
+ export type ParseSingleCommandArgs = {
2
+ command: Uint8Array;
3
+ outputTrustedParam?: boolean;
4
+ };
5
+ export type ParseSingleCommandResponse = Uint8Array;
6
+ //# sourceMappingURL=ParseStreamBlockCommandCommandTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParseStreamBlockCommandCommandTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/ParseStreamBlockCommandCommandTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,UAAU,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type ParseBlockHeaderCommandResponse = Uint8Array;
2
+ export type ParseBlockHeaderCommandArgs = {
3
+ header: Uint8Array;
4
+ };
5
+ //# sourceMappingURL=ParseStreamBlockHeaderCommandTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParseStreamBlockHeaderCommandTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/ParseStreamBlockHeaderCommandTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,+BAA+B,GAAG,UAAU,CAAC;AAEzD,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type ParseBlockSignatureCommandResponse = Uint8Array;
2
+ export type ParseBlockSignatureCommandArgs = {
3
+ signature: Uint8Array;
4
+ };
5
+ //# sourceMappingURL=ParseStreamBlockSignatureTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParseStreamBlockSignatureTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/ParseStreamBlockSignatureTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kCAAkC,GAAG,UAAU,CAAC;AAE5D,MAAM,MAAM,8BAA8B,GAAG;IAAE,SAAS,EAAE,UAAU,CAAA;CAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type SetTrustedMemberCommandResponse = void;
2
+ export type SetTrustedMemberCommandArgs = {
3
+ readonly iv: Uint8Array;
4
+ readonly memberTlv: Uint8Array;
5
+ };
6
+ //# sourceMappingURL=SetTrustedMemberTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetTrustedMemberTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/SetTrustedMemberTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC;AAEnD,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type TrustedProperty } from "../../internal/externalTypes";
2
+ export type SignBlockCommandResponse = {
3
+ readonly trustedProperty: Partial<TrustedProperty>;
4
+ };
5
+ export type SignBlockCommandArgs = {
6
+ readonly p1: 0x00 | 0x01 | 0x02;
7
+ readonly payload: Uint8Array;
8
+ };
9
+ //# sourceMappingURL=SignBlockCommandTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignBlockCommandTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/SignBlockCommandTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface SignBlockHeaderCommandArgs {
2
+ header: Uint8Array;
3
+ }
4
+ export type SignBlockHeaderCommandResponse = Uint8Array;
5
+ //# sourceMappingURL=SignBlockHeaderCommandTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignBlockHeaderCommandTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/SignBlockHeaderCommandTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,UAAU,CAAC;CACpB;AAED,MAAM,MAAM,8BAA8B,GAAG,UAAU,CAAC"}