@ledgerhq/device-trusted-app-kit-ledger-keyring-protocol 0.0.0-ledger-button-20250806141658

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,68 @@
1
+ import { type InternalApi, UnknownDAError } from "@ledgerhq/device-management-kit";
2
+ import { Either, EitherAsync } from "purify-ts";
3
+ import { type LKRPHttpRequestError, type LKRPMissingDataError, type LKRPParsingError } from "../../../api/app-binder/Errors";
4
+ import { type JWT, type Keypair } from "../../../api/index";
5
+ import { type LKRPDeviceCommandError } from "../../app-binder/command/utils/ledgerKeyringProtocolErrors";
6
+ import { type LKRPDataSource } from "../../lkrp-datasource/data/LKRPDataSource";
7
+ import { LKRPBlock } from "../../utils/LKRPBlock";
8
+ import { LKRPCommand } from "../../utils/LKRPCommand";
9
+ import { CommandTags } from "../../utils/TLVTags";
10
+ import { type EncryptedCommand, type EncryptedDeriveCommand, type EncryptedPublishKeyCommand } from "../../utils/types";
11
+ import { TrustedProperties } from "./utils/TrustedProperties";
12
+ type BlockFlow = {
13
+ type: "derive";
14
+ data: AddMemberBlockData;
15
+ } | {
16
+ type: "addMember";
17
+ data: AddMemberBlockData;
18
+ };
19
+ type AddMemberBlockData = {
20
+ name: string;
21
+ publicKey: Uint8Array;
22
+ permissions: number;
23
+ };
24
+ type HeaderPayload = {
25
+ iv: Uint8Array;
26
+ issuer: Uint8Array;
27
+ };
28
+ type SignaturePayload = {
29
+ secret: Uint8Array;
30
+ signature: Uint8Array;
31
+ };
32
+ type EncryptedBlock = {
33
+ header: HeaderPayload;
34
+ commands: EncryptedCommand[];
35
+ signature: SignaturePayload;
36
+ };
37
+ export type SignBlockError = LKRPDeviceCommandError | LKRPParsingError | LKRPMissingDataError | LKRPHttpRequestError | UnknownDAError;
38
+ export type SignBlockTaskInput = {
39
+ lkrpDataSource: LKRPDataSource;
40
+ trustchainId: string;
41
+ path: string;
42
+ jwt: JWT;
43
+ parent: Uint8Array;
44
+ blockFlow: BlockFlow;
45
+ sessionKeypair: Keypair;
46
+ };
47
+ export declare const ISSUER_PLACEHOLDER: Uint8Array<ArrayBuffer>;
48
+ export declare class SignBlockTask {
49
+ private readonly api;
50
+ constructor(api: InternalApi);
51
+ run({ lkrpDataSource, trustchainId, path, jwt, parent, blockFlow, sessionKeypair, }: SignBlockTaskInput): EitherAsync<SignBlockError, void>;
52
+ signBlockHeader(parent: Uint8Array, commandCount: number): EitherAsync<SignBlockError, HeaderPayload>;
53
+ signBlockSignature(sessionKeypair: Keypair): EitherAsync<SignBlockError, SignaturePayload>;
54
+ signCommands(applicationPath: string, block: BlockFlow): EitherAsync<SignBlockError, EncryptedCommand>[];
55
+ signSingleCommand(command: Uint8Array): EitherAsync<SignBlockError, TrustedProperties>;
56
+ signDeriveCommand(applicationPath: string): EitherAsync<SignBlockError, EncryptedDeriveCommand>;
57
+ signAddMemberCommand({ name, publicKey, permissions }: AddMemberBlockData): EitherAsync<SignBlockError, {
58
+ type: CommandTags.AddMember;
59
+ name: string;
60
+ publicKey: Uint8Array;
61
+ permissions: number;
62
+ }>;
63
+ signPublishKeyCommand({ publicKey }: Pick<AddMemberBlockData, "publicKey">): EitherAsync<SignBlockError, EncryptedPublishKeyCommand>;
64
+ decryptBlock(parent: Uint8Array, { header, commands, signature }: EncryptedBlock): Either<SignBlockError, LKRPBlock>;
65
+ decryptCommand(secret: Uint8Array, command: EncryptedCommand): Either<UnknownDAError, LKRPCommand>;
66
+ }
67
+ export {};
68
+ //# sourceMappingURL=SignBlockTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignBlockTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignBlockTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,cAAc,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAe,MAAM,WAAW,CAAC;AAE7D,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAIpD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAMpF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,KAAK,SAAS,GACV;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAEpD,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AACF,KAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB,sBAAsB,GACtB,gBAAgB,GAChB,oBAAoB,GACpB,oBAAoB,GACpB,cAAc,CAAC;AAEnB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,yBAG7B,CAAC;AAEH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,WAAW;IAE7C,GAAG,CAAC,EACF,cAAc,EACd,YAAY,EACZ,IAAI,EACJ,GAAG,EACH,MAAM,EACN,SAAS,EACT,cAAc,GACf,EAAE,kBAAkB,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,CAAC;IAoBzD,eAAe,CACb,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,MAAM,GACnB,WAAW,CAAC,cAAc,EAAE,aAAa,CAAC;IAgC7C,kBAAkB,CAChB,cAAc,EAAE,OAAO,GACtB,WAAW,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAmBhD,YAAY,CACV,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,SAAS,GACf,WAAW,CAAC,cAAc,EAAE,gBAAgB,CAAC,EAAE;IAgBlD,iBAAiB,CAAC,OAAO,EAAE,UAAU;IAkBrC,iBAAiB,CAAC,eAAe,EAAE,MAAM;IAsBzC,oBAAoB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,kBAAkB;;;;;;IAsBzE,qBAAqB,CAAC,EAAE,SAAS,EAAE,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC;IAqB1E,YAAY,CACV,MAAM,EAAE,UAAU,EAClB,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,cAAc,GAC9C,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC;IAkBpC,cAAc,CACZ,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,gBAAgB,GACxB,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC;CAuBvC"}
@@ -0,0 +1,10 @@
1
+ import { type InternalApi } from "@ledgerhq/device-management-kit";
2
+ import { type Either } from "purify-ts";
3
+ import { type LKRPDeviceCommandError } from "../../app-binder/command/utils/ledgerKeyringProtocolErrors";
4
+ import { type AuthenticationPayload, type Challenge } from "../../lkrp-datasource/data/LKRPDataSource";
5
+ export declare class SignChallengeWithDeviceTask {
6
+ private readonly api;
7
+ constructor(api: InternalApi);
8
+ run(challenge: Challenge): Promise<Either<LKRPDeviceCommandError, AuthenticationPayload>>;
9
+ }
10
+ //# sourceMappingURL=SignChallengeWithDeviceTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignChallengeWithDeviceTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignChallengeWithDeviceTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,MAAM,EAAe,MAAM,WAAW,CAAC;AAGrD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,+CAA+C,CAAC;AAEvD,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,WAAW;IAEvC,GAAG,CACP,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;CAelE"}
@@ -0,0 +1,15 @@
1
+ import { UnknownDAError } from "@ledgerhq/device-management-kit";
2
+ import { EitherAsync } from "purify-ts";
3
+ import { LKRPMissingDataError } from "../../../api/app-binder/Errors";
4
+ import { type Keypair } from "../../../api/app-binder/LKRPTypes";
5
+ import { type AuthenticationPayload, type Challenge } from "../../lkrp-datasource/data/LKRPDataSource";
6
+ export declare class SignChallengeWithKeypairTask {
7
+ private readonly keypair;
8
+ private readonly trustchainId;
9
+ constructor(keypair: Keypair, trustchainId: string);
10
+ run(challenge: Challenge): EitherAsync<LKRPMissingDataError | UnknownDAError, AuthenticationPayload>;
11
+ private getAttestation;
12
+ private getCredential;
13
+ private getUnsignedChallengeTLV;
14
+ }
15
+ //# sourceMappingURL=SignChallengeWithKeypairTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignChallengeWithKeypairTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignChallengeWithKeypairTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAe,WAAW,EAAe,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,+CAA+C,CAAC;AAKvD,qBAAa,4BAA4B;IAErC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM;IAGvC,GAAG,CACD,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,oBAAoB,GAAG,cAAc,EAAE,qBAAqB,CAAC;IAoB5E,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,uBAAuB;CAqDhC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SignChallengeWithKeypairTask.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignChallengeWithKeypairTask.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignChallengeWithKeypairTask.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { Either } from "purify-ts";
2
+ import { type LKRPMissingDataError, LKRPParsingError } from "../../../../api/app-binder/Errors";
3
+ import { TPTags } from "../../../utils/TLVTags";
4
+ type EncryptedTPTag = Exclude<TPTags, TPTags.IV>;
5
+ type EncryptedTP = {
6
+ tag: EncryptedTPTag;
7
+ value: Uint8Array;
8
+ tlv: Uint8Array;
9
+ };
10
+ export declare class TrustedProperties {
11
+ readonly bytes: Uint8Array;
12
+ private readonly parser;
13
+ private iv;
14
+ private encryptedProps;
15
+ constructor(bytes: Uint8Array);
16
+ getIv(): Either<LKRPParsingError, Uint8Array>;
17
+ getIssuer(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
18
+ getXPriv(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
19
+ getEphemeralPublicKey(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
20
+ getCommandIv(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
21
+ getGroupKey(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
22
+ getNewMember(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
23
+ parseEncryptedProps(): Either<LKRPParsingError, Map<EncryptedTPTag, EncryptedTP>>;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=TrustedProperties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrustedProperties.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/app-binder/task/utils/TrustedProperties.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAe,MAAM,WAAW,CAAC;AAEhD,OAAO,EACL,KAAK,oBAAoB,EACzB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,KAAK,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AACjD,KAAK,WAAW,GAAG;IAAE,GAAG,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAE,CAAC;AAE/E,qBAAa,iBAAiB;aAKA,KAAK,EAAE,UAAU;IAJ7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,EAAE,CAA2B;IACrC,OAAO,CAAC,cAAc,CAAiD;gBAE3C,KAAK,EAAE,UAAU;IAI7C,KAAK,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAc7C,SAAS,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IASxE,QAAQ,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IASvE,qBAAqB,IAAI,MAAM,CAC7B,gBAAgB,GAAG,oBAAoB,EACvC,UAAU,CACX;IASD,YAAY,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IAS3E,WAAW,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IAS1E,YAAY,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IAS3E,mBAAmB,IAAI,MAAM,CAC3B,gBAAgB,EAChB,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CACjC;CAUF"}
@@ -0,0 +1,10 @@
1
+ import { type DeviceManagementKit, type DeviceSessionId } from "@ledgerhq/device-management-kit";
2
+ import { Container } from "inversify";
3
+ export type MakeContainerProps = {
4
+ dmk: DeviceManagementKit;
5
+ sessionId: DeviceSessionId;
6
+ baseUrl?: string;
7
+ stub?: boolean;
8
+ };
9
+ export declare const makeContainer: ({ dmk, sessionId, baseUrl, stub, }: MakeContainerProps) => Container;
10
+ //# sourceMappingURL=di.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../../src/internal/di.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAQtC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,mBAAmB,CAAC;IACzB,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,oCAK3B,kBAAkB,cAepB,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const externalTypes: {
2
+ Dmk: symbol;
3
+ SessionId: symbol;
4
+ };
5
+ export type TrustedProperty = {
6
+ iv: Uint8Array;
7
+ issuer: Uint8Array;
8
+ xpriv: Uint8Array;
9
+ ephemeralPubKey: Uint8Array;
10
+ commandIV: Uint8Array;
11
+ groupKey: Uint8Array;
12
+ newMember: Uint8Array;
13
+ };
14
+ //# sourceMappingURL=externalTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"externalTypes.d.ts","sourceRoot":"","sources":["../../../src/internal/externalTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,UAAU,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,UAAU,CAAC;IACrB,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { EitherAsync, Maybe } from "purify-ts";
2
+ import { LKRPHttpRequestError } from "../../../api/app-binder/Errors";
3
+ import { JWT } from "../../../api/app-binder/LKRPTypes";
4
+ import { LKRPBlock } from "../../utils/LKRPBlock";
5
+ import { LKRPBlockStream } from "../../utils/LKRPBlockStream";
6
+ import { AuthenticationPayload, Challenge, LKRPDataSource } from "./LKRPDataSource";
7
+ export declare class HttpLKRPDataSource implements LKRPDataSource {
8
+ private readonly baseUrl;
9
+ constructor(baseUrl: string);
10
+ getChallenge(): EitherAsync<LKRPHttpRequestError, Challenge>;
11
+ authenticate(payload: AuthenticationPayload): EitherAsync<LKRPHttpRequestError, {
12
+ jwt: JWT;
13
+ trustchainId: Maybe<string>;
14
+ }>;
15
+ getTrustchainById(id: string, jwt: JWT): EitherAsync<LKRPHttpRequestError, {
16
+ [k: string]: LKRPBlockStream;
17
+ }>;
18
+ postDerivation(id: string, block: LKRPBlock, jwt: JWT): EitherAsync<LKRPHttpRequestError, void>;
19
+ putCommands(id: string, path: string, block: LKRPBlock, jwt: JWT): EitherAsync<LKRPHttpRequestError, void>;
20
+ private request;
21
+ }
22
+ //# sourceMappingURL=HttpLKRPDataSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpLKRPDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/data/HttpLKRPDataSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAQ,KAAK,EAAkB,MAAM,WAAW,CAAC;AAErE,OAAO,EACL,oBAAoB,EAErB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,cAAc,EACf,MAAM,kBAAkB,CAAC;AAE1B,qBACa,kBAAmB,YAAW,cAAc;IAEhB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM;IAGvE,YAAY;IAIZ,YAAY,CAAC,OAAO,EAAE,qBAAqB;;;;IAc3C,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG;;;IActC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG;IAOrD,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG;IAOhE,OAAO,CAAC,OAAO;CA0ChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HttpLKRPDataSource.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpLKRPDataSource.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/data/HttpLKRPDataSource.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,54 @@
1
+ import { type EitherAsync, type Maybe } from "purify-ts";
2
+ import { type LKRPHttpRequestError } from "../../../api/app-binder/Errors";
3
+ import { type JWT } from "../../../api/app-binder/LKRPTypes";
4
+ import { type LKRPBlock } from "../../utils/LKRPBlock";
5
+ import { type Trustchain } from "../../utils/types";
6
+ export interface LKRPDataSource {
7
+ getChallenge(): EitherAsync<LKRPHttpRequestError, Challenge>;
8
+ authenticate(payload: AuthenticationPayload): EitherAsync<LKRPHttpRequestError, AuthenticationResponse>;
9
+ getTrustchainById(id: string, jwt: JWT): EitherAsync<LKRPHttpRequestError, Trustchain>;
10
+ postDerivation(id: string, blocks: LKRPBlock, jwt: JWT): EitherAsync<LKRPHttpRequestError, void>;
11
+ putCommands(id: string, path: string, block: LKRPBlock, jwt: JWT): EitherAsync<LKRPHttpRequestError, void>;
12
+ }
13
+ export type Challenge = {
14
+ json: ChallengeJSON;
15
+ tlv: string;
16
+ };
17
+ export type AuthenticationResponse = {
18
+ jwt: JWT;
19
+ trustchainId: Maybe<string>;
20
+ };
21
+ export type AuthenticationPayload = {
22
+ challenge: ChallengeJSON;
23
+ signature: ChallengeSignature;
24
+ };
25
+ type ChallengeJSON = {
26
+ version: number;
27
+ challenge: {
28
+ data: string;
29
+ expiry: string;
30
+ };
31
+ host: string;
32
+ rp: {
33
+ credential: Credential;
34
+ signature: string;
35
+ }[];
36
+ protocolVersion: {
37
+ major: number;
38
+ minor: number;
39
+ patch: number;
40
+ };
41
+ };
42
+ type ChallengeSignature = {
43
+ credential: Credential;
44
+ signature: string;
45
+ attestation: string;
46
+ };
47
+ type Credential = {
48
+ version: number;
49
+ curveId: number;
50
+ signAlgorithm: number;
51
+ publicKey: string;
52
+ };
53
+ export {};
54
+ //# sourceMappingURL=LKRPDataSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LKRPDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/data/LKRPDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,cAAc;IAC7B,YAAY,IAAI,WAAW,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IAE7D,YAAY,CACV,OAAO,EAAE,qBAAqB,GAC7B,WAAW,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;IAE7D,iBAAiB,CACf,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,GAAG,GACP,WAAW,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;IAEjD,cAAc,CACZ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,GAAG,GACP,WAAW,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IAE3C,WAAW,CACT,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,GAAG,GACP,WAAW,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;CAC5C;AAED,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpD,eAAe,EAAE;QACf,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from "inversify";
2
+ import { type MakeContainerProps } from "../../di";
3
+ export declare const lkrpDatasourceModuleFactory: ({ baseUrl, }: Pick<MakeContainerProps, "stub" | "baseUrl">) => ContainerModule;
4
+ //# sourceMappingURL=lkrpDatasourceModuleFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lkrpDatasourceModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAMvD,eAAO,MAAM,2BAA2B,GAAI,cAEzC,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC,oBAM3C,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const lkrpDatasourceTypes: {
2
+ readonly LKRPDataSource: symbol;
3
+ readonly BaseUrl: symbol;
4
+ };
5
+ //# sourceMappingURL=lkrpDatasourceTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lkrpDatasourceTypes.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/di/lkrpDatasourceTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { AuthenticateDAReturnType } from "../../../api/app-binder/AuthenticateDeviceActionTypes";
2
+ import { JWT, Keypair, Permissions } from "../../../api/app-binder/LKRPTypes";
3
+ import { LedgerKeyringProtocolBinder } from "../../app-binder/LedgerKeyringProtocolBinder";
4
+ export declare class AuthenticateUseCase {
5
+ private appBinder;
6
+ constructor(appBinder: LedgerKeyringProtocolBinder);
7
+ execute(keypair: Keypair, applicationId: number, clientName: string, permissions: Permissions, trustchainId?: string, jwt?: JWT): AuthenticateDAReturnType;
8
+ }
9
+ //# sourceMappingURL=AuthenticateUseCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthenticateUseCase.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/authentication/AuthenticateUseCase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAE/F,qBACa,mBAAmB;IAG5B,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,2BAA2B;IAGhD,OAAO,CACL,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,GACR,wBAAwB;CAU5B"}
@@ -0,0 +1,3 @@
1
+ import { ContainerModule } from "inversify";
2
+ export declare const useCasesModuleFactory: () => ContainerModule;
3
+ //# sourceMappingURL=useCasesModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCasesModule.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/di/useCasesModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C,eAAO,MAAM,qBAAqB,uBAG9B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const useCasesTypes: {
2
+ AuthenticateUseCase: symbol;
3
+ };
4
+ //# sourceMappingURL=useCasesTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCasesTypes.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/di/useCasesTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Either } from "purify-ts";
2
+ import { type LKRPParsingError } from "../../api/app-binder/Errors";
3
+ import { type LKRPBlockData, type LKRPBlockParsedData } from "./types";
4
+ export declare class LKRPBlock {
5
+ private readonly bytes;
6
+ private hashValue;
7
+ private data;
8
+ constructor(bytes: Uint8Array, data?: LKRPBlockParsedData);
9
+ static fromHex(hex: string): LKRPBlock;
10
+ static fromData(data: LKRPBlockData): LKRPBlock;
11
+ toString(): string;
12
+ toU8A(): Uint8Array;
13
+ parse(): Either<LKRPParsingError, LKRPBlockParsedData>;
14
+ toHuman(): Either<LKRPParsingError, string>;
15
+ hash(): string;
16
+ }
17
+ //# sourceMappingURL=LKRPBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LKRPBlock.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAoC,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEvE,qBAAa,SAAS;IAKlB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,IAAI,CAAuD;gBAGhD,KAAK,EAAE,UAAU,EAClC,IAAI,CAAC,EAAE,mBAAmB;IAK5B,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;IAItC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS;IAkB/C,QAAQ,IAAI,MAAM;IAIlB,KAAK,IAAI,UAAU;IAInB,KAAK,IAAI,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;IAQtD,OAAO,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAmB3C,IAAI,IAAI,MAAM;CAMf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LKRPBlock.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LKRPBlock.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPBlock.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { Either, Maybe } from "purify-ts";
2
+ import { type LKRPParsingError } from "../../api/app-binder/Errors";
3
+ import { type Keypair } from "../../api/app-binder/LKRPTypes";
4
+ import { LKRPBlock } from "./LKRPBlock";
5
+ import { type LKRPBlockData } from "./types";
6
+ import { type PublishedKey } from "./types";
7
+ export declare class LKRPBlockStream {
8
+ private readonly bytes;
9
+ private validation;
10
+ private blocks;
11
+ private path;
12
+ constructor(bytes: Uint8Array, blocks?: LKRPBlock[], path?: string);
13
+ static fromHex(hex: string): LKRPBlockStream;
14
+ static fromPath(path: string): LKRPBlockStream;
15
+ static fromData(blocksData: Omit<LKRPBlockData, "parent">[], parentHash?: string): Promise<LKRPBlockStream>;
16
+ toU8A(): Uint8Array;
17
+ toString(): string;
18
+ parse(): Either<LKRPParsingError, LKRPBlock[]>;
19
+ toHuman(): Either<LKRPParsingError, string>;
20
+ validate(streamParentHash?: string): Promise<boolean>;
21
+ getPath(): Maybe<string>;
22
+ getMemberBlock(member: string): Maybe<LKRPBlockData>;
23
+ hasMember(member: string): boolean;
24
+ getPublishedKey(keypair: Keypair): Maybe<PublishedKey>;
25
+ }
26
+ //# sourceMappingURL=LKRPBlockStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LKRPBlockStream.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPBlockStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,KAAK,EAAkB,MAAM,WAAW,CAAC;AAEhE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIzD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAExE,qBAAa,eAAe;IAMxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IALxB,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,MAAM,CAAyD;IACvE,OAAO,CAAC,IAAI,CAA0B;gBAGnB,KAAK,EAAE,UAAU,EAClC,MAAM,CAAC,EAAE,SAAS,EAAE,EACpB,IAAI,CAAC,EAAE,MAAM;IAMf,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe;IAI5C,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe;WAIjC,QAAQ,CACnB,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,EAC3C,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC;IAoB3B,KAAK,IAAI,UAAU;IAInB,QAAQ,IAAI,MAAM;IAIlB,KAAK,IAAI,MAAM,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAC;IAmB9C,OAAO,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAOrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAmC3D,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;IAsBxB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;IAoBpD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIlC,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC;CAqBvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LKRPBlockStream.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LKRPBlockStream.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPBlockStream.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { type Either, Maybe } from "purify-ts";
2
+ import { type LKRPParsingError } from "../../api/app-binder/Errors";
3
+ import { type EncryptedPublishedKey, type LKRPCommandData, type UnsignedCommandData } from "./types";
4
+ export declare class LKRPCommand {
5
+ private bytes;
6
+ private data;
7
+ constructor(bytes: Uint8Array, data?: LKRPCommandData);
8
+ static fromHex(hex: string): LKRPCommand;
9
+ static fromData(data: LKRPCommandData): LKRPCommand;
10
+ static bytesFromUnsignedData(data: UnsignedCommandData): Uint8Array;
11
+ toString(): string;
12
+ toU8A(): Uint8Array;
13
+ parse(): Either<LKRPParsingError, LKRPCommandData>;
14
+ toHuman(): Either<LKRPParsingError, string>;
15
+ getPublicKey(): Maybe<string>;
16
+ getEncryptedPublichedKey(): Maybe<EncryptedPublishedKey>;
17
+ }
18
+ //# sourceMappingURL=LKRPCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LKRPCommand.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,KAAK,EAAkB,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO/D,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AAEjB,qBAAa,WAAW;IAIpB,OAAO,CAAC,KAAK;IAHf,OAAO,CAAC,IAAI,CAAmD;gBAGrD,KAAK,EAAE,UAAU,EACzB,IAAI,CAAC,EAAE,eAAe;IAKxB,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAIxC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,WAAW;IA6CnD,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,UAAU;IA0BnE,QAAQ,IAAI,MAAM;IAIlB,KAAK,IAAI,UAAU;IAInB,KAAK,IAAI,MAAM,CAAC,gBAAgB,EAAE,eAAe,CAAC;IAQlD,OAAO,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAa3C,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;IAuB7B,wBAAwB,IAAI,KAAK,CAAC,qBAAqB,CAAC;CAqBzD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LKRPCommand.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LKRPCommand.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPCommand.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ export declare class TLVBuilder {
2
+ private items;
3
+ addNull(): this;
4
+ addInt(value: number, length: 1 | 2 | 4): this;
5
+ addHash(value: Uint8Array): this;
6
+ addSignature(value: Uint8Array): this;
7
+ addString(value: string): this;
8
+ addBytes(value: Uint8Array | number[]): this;
9
+ addPublicKey(value: Uint8Array): this;
10
+ build(): Uint8Array;
11
+ with(fn: (builder: TLVBuilder) => void): TLVBuilder;
12
+ push(item: Uint8Array): this;
13
+ private add;
14
+ }
15
+ //# sourceMappingURL=TLVBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TLVBuilder.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/TLVBuilder.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IACrB,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO;IAIP,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IAgBvC,OAAO,CAAC,KAAK,EAAE,UAAU;IAIzB,YAAY,CAAC,KAAK,EAAE,UAAU;IAI9B,SAAS,CAAC,KAAK,EAAE,MAAM;IAIvB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE;IAIrC,YAAY,CAAC,KAAK,EAAE,UAAU;IAI9B,KAAK,IAAI,UAAU;IAInB,IAAI,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,GAAG,UAAU;IAKnD,IAAI,CAAC,IAAI,EAAE,UAAU;IAKrB,OAAO,CAAC,GAAG;CAIZ"}
@@ -0,0 +1,59 @@
1
+ import { type Either } from "purify-ts";
2
+ import { LKRPParsingError } from "../../api/app-binder/Errors";
3
+ import { LKRPCommand } from "./LKRPCommand";
4
+ import { CommandTags, GeneralTags } from "./TLVTags";
5
+ import { type LKRPBlockParsedData, type LKRPCommandData } from "./types";
6
+ type ParserValue = Either<LKRPParsingError, {
7
+ tag: GeneralTags.Null;
8
+ value: null;
9
+ } | {
10
+ tag: GeneralTags.Int;
11
+ value: number;
12
+ } | {
13
+ tag: GeneralTags.Hash;
14
+ value: Uint8Array;
15
+ } | {
16
+ tag: GeneralTags.Signature;
17
+ value: Uint8Array;
18
+ } | {
19
+ tag: GeneralTags.String;
20
+ value: string;
21
+ } | {
22
+ tag: GeneralTags.Bytes;
23
+ value: Uint8Array;
24
+ } | {
25
+ tag: GeneralTags.PublicKey;
26
+ value: Uint8Array;
27
+ } | {
28
+ tag: CommandTags;
29
+ value: Uint8Array;
30
+ } | {
31
+ tag: Exclude<number, GeneralTags | CommandTags>;
32
+ value: null | number | Uint8Array;
33
+ }>;
34
+ export declare class TLVParser {
35
+ private readonly bytes;
36
+ private readonly parser;
37
+ private offset;
38
+ constructor(bytes: Uint8Array);
39
+ get state(): {
40
+ offset: number;
41
+ isDone: boolean;
42
+ };
43
+ parse(): ParserValue;
44
+ tlvEncoded(fn: () => Either<LKRPParsingError, unknown>): Either<LKRPParsingError, Uint8Array>;
45
+ parseNull(): Either<LKRPParsingError, null>;
46
+ parseInt(): Either<LKRPParsingError, number>;
47
+ parseHash(): Either<LKRPParsingError, Uint8Array>;
48
+ parseSignature(): Either<LKRPParsingError, Uint8Array>;
49
+ parseString(): Either<LKRPParsingError, string>;
50
+ parseBytes(): Either<LKRPParsingError, Uint8Array>;
51
+ parsePublicKey(): Either<LKRPParsingError, Uint8Array>;
52
+ parseCommandBytes(): Either<LKRPParsingError, Uint8Array>;
53
+ parseCommandData(): Either<LKRPParsingError, LKRPCommandData>;
54
+ parseCommands(): Either<LKRPParsingError, LKRPCommand[]>;
55
+ parseBlockData(): Either<LKRPParsingError, LKRPBlockParsedData>;
56
+ private parseTLV;
57
+ }
58
+ export {};
59
+ //# sourceMappingURL=TLVParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TLVParser.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/TLVParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAe,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzE,KAAK,WAAW,GAAG,MAAM,CACvB,gBAAgB,EACd;IAAE,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GACtC;IAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAC5C;IAAE,GAAG,EAAE,WAAW,CAAC,SAAS,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACjD;IAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAC7C;IAAE,GAAG,EAAE,WAAW,CAAC,SAAS,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACjD;IAAE,GAAG,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACvC;IACE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC,CAAC;IAChD,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;CACnC,CACJ,CAAC;AAMF,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,MAAM,CAAK;gBAEP,KAAK,EAAE,UAAU;IAK7B,IAAI,KAAK;;;MAKR;IAED,KAAK,IAAI,WAAW;IAIpB,UAAU,CACR,EAAE,EAAE,MAAM,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAC1C,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAKvC,SAAS,IAAI,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC;IAQ3C,QAAQ,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAQ5C,SAAS,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAQjD,cAAc,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAQtD,WAAW,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAQ/C,UAAU,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAQlD,cAAc,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAQtD,iBAAiB,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAazD,gBAAgB,IAAI,MAAM,CAAC,gBAAgB,EAAE,eAAe,CAAC;IAkE7D,aAAa,IAAI,MAAM,CAAC,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAmBxD,cAAc,IAAI,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;IAgB/D,OAAO,CAAE,QAAQ;CAkElB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TLVParser.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TLVParser.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/TLVParser.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ export declare enum GeneralTags {
2
+ Null = 0,
3
+ Int = 1,
4
+ Hash = 2,
5
+ Signature = 3,
6
+ String = 4,
7
+ Bytes = 5,
8
+ PublicKey = 6
9
+ }
10
+ export declare enum CommandTags {
11
+ Seed = 16,
12
+ AddMember = 17,
13
+ PublishKey = 18,
14
+ CloseStream = 19,
15
+ EditMember = 20,
16
+ Derive = 21
17
+ }
18
+ export declare enum TPTags {
19
+ IV = 0,
20
+ ISSUER = 129,
21
+ XPRIV = 130,
22
+ EPHEMERAL_PUBLIC_KEY = 3,
23
+ COMMAND_IV = 4,
24
+ GROUPKEY = 5,
25
+ NEW_MEMBER = 134
26
+ }
27
+ //# sourceMappingURL=TLVTags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TLVTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/TLVTags.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,IAAI,IAAO;IACX,GAAG,IAAO;IACV,IAAI,IAAO;IACX,SAAS,IAAO;IAChB,MAAM,IAAO;IACb,KAAK,IAAO;IACZ,SAAS,IAAO;CACjB;AAED,oBAAY,WAAW;IACrB,IAAI,KAAO;IACX,SAAS,KAAO;IAChB,UAAU,KAAO;IACjB,WAAW,KAAO;IAClB,UAAU,KAAO;IACjB,MAAM,KAAO;CACd;AAID,oBAAY,MAAM;IAChB,EAAE,IAAO;IACT,MAAM,MAAoB;IAC1B,KAAK,MAAoB;IACzB,oBAAoB,IAAO;IAC3B,UAAU,IAAO;IACjB,QAAQ,IAAO;IACf,UAAU,MAAoB;CAC/B"}
@@ -0,0 +1,19 @@
1
+ import { type Keypair } from "../../api/index";
2
+ export declare const AES_BLOCK_SIZE = 16;
3
+ export declare class CryptoUtils {
4
+ static randomBytes(len: number): Uint8Array;
5
+ static randomKeypair(): Keypair;
6
+ static encrypt(key: Uint8Array, iv: Uint8Array, cleartext: Uint8Array): Uint8Array;
7
+ static decrypt(key: Uint8Array, iv: Uint8Array, ciphertext: Uint8Array): Uint8Array;
8
+ static hash(bytes: Uint8Array): Uint8Array;
9
+ static hmac(key: Uint8Array, message: Uint8Array): Uint8Array;
10
+ /**
11
+ * DER specification: https://ledgerhq.atlassian.net/wiki/spaces/TrustServices/pages/3843719348/LNS+Arch+Common+Fields+for+Nano+certificates+and+descriptors#DER-Encoding-spec
12
+ * See: https://ledgerhq.atlassian.net/wiki/spaces/TrustServices/pages/3736863735/LNS+Arch+Nano+Trusted+Names+Descriptor+Format+APIs
13
+ * 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
14
+ * sig_components(r,s) = 0x02 & var(Lr,u8(~)) & sized(8*Lr, r) & 0x02 & var(Ls,u8(~)) & sized(8*Ls, s);
15
+ */
16
+ static derEncode(r: bigint, s: bigint): Uint8Array;
17
+ private static encodeSigComponent;
18
+ }
19
+ //# sourceMappingURL=crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,qBAAa,WAAW;IACtB,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAI3C,MAAM,CAAC,aAAa,IAAI,OAAO;IAI/B,MAAM,CAAC,OAAO,CACZ,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,UAAU,GACpB,UAAU;IAKb,MAAM,CAAC,OAAO,CACZ,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,UAAU,EACd,UAAU,EAAE,UAAU,GACrB,UAAU;IAKb,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU;IAI1C,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU;IAI7D;;;;;OAKG;WACW,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU;IAOzD,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAMlC"}
@@ -0,0 +1,3 @@
1
+ export declare function derivationPathAsString(bytes: Uint8Array): string;
2
+ export declare function derivationPathAsBytes(path: string): Uint8Array;
3
+ //# sourceMappingURL=derivationPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivationPath.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/derivationPath.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAWhE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAe9D"}