@ledgerhq/context-module 0.0.0-develop-20241017000946 → 0.0.0-rnble-transport-20250219100517

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 (548) hide show
  1. package/README.md +4 -6
  2. package/lib/cjs/index.js +1 -1126
  3. package/lib/cjs/index.js.map +4 -4
  4. package/lib/cjs/package.json +58 -0
  5. package/lib/cjs/src/ContextModule.js +2 -0
  6. package/lib/cjs/src/ContextModule.js.map +7 -0
  7. package/lib/cjs/src/ContextModuleBuilder.js +2 -0
  8. package/lib/cjs/src/ContextModuleBuilder.js.map +7 -0
  9. package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
  10. package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
  11. package/lib/cjs/src/DefaultContextModule.js +2 -0
  12. package/lib/cjs/src/DefaultContextModule.js.map +7 -0
  13. package/lib/cjs/src/DefaultContextModule.test.js +2 -0
  14. package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
  15. package/lib/cjs/src/config/di/configModuleFactory.js +2 -0
  16. package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -0
  17. package/lib/cjs/src/config/di/configTypes.js +2 -0
  18. package/lib/cjs/src/config/di/configTypes.js.map +7 -0
  19. package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -0
  20. package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -0
  21. package/lib/cjs/src/di.js +2 -0
  22. package/lib/cjs/src/di.js.map +7 -0
  23. package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -0
  24. package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -0
  25. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -0
  26. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -0
  27. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -0
  28. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -0
  29. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  30. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  31. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -0
  32. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -0
  33. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -0
  34. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -0
  35. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -0
  36. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -0
  37. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  38. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  39. package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -0
  40. package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -0
  41. package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -0
  42. package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -0
  43. package/lib/cjs/src/index.js +2 -0
  44. package/lib/cjs/src/index.js.map +7 -0
  45. package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -0
  46. package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -0
  47. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
  48. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  49. package/lib/cjs/src/nft/data/NftDataSource.js +2 -0
  50. package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -0
  51. package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -0
  52. package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -0
  53. package/lib/cjs/src/nft/di/nftTypes.js +2 -0
  54. package/lib/cjs/src/nft/di/nftTypes.js.map +7 -0
  55. package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -0
  56. package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -0
  57. package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
  58. package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
  59. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.js +2 -0
  60. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.js.map +7 -0
  61. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.test.js +2 -0
  62. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.test.js.map +7 -0
  63. package/lib/cjs/src/pki/data/PkiCertificateDataSource.js +2 -0
  64. package/lib/cjs/src/pki/data/PkiCertificateDataSource.js.map +7 -0
  65. package/lib/cjs/src/pki/data/pkiDataSourceTypes.js +2 -0
  66. package/lib/cjs/src/pki/data/pkiDataSourceTypes.js.map +7 -0
  67. package/lib/cjs/src/pki/di/pkiModuleFactory.js +2 -0
  68. package/lib/cjs/src/pki/di/pkiModuleFactory.js.map +7 -0
  69. package/lib/cjs/src/pki/di/pkiTypes.js +2 -0
  70. package/lib/cjs/src/pki/di/pkiTypes.js.map +7 -0
  71. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js +2 -0
  72. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js.map +7 -0
  73. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js +2 -0
  74. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +7 -0
  75. package/lib/cjs/src/pki/domain/PkiCertificateLoader.js +2 -0
  76. package/lib/cjs/src/pki/domain/PkiCertificateLoader.js.map +7 -0
  77. package/lib/cjs/src/pki/model/KeyId.js +2 -0
  78. package/lib/cjs/src/pki/model/KeyId.js.map +7 -0
  79. package/lib/cjs/src/pki/model/KeyUsage.js +2 -0
  80. package/lib/cjs/src/pki/model/KeyUsage.js.map +7 -0
  81. package/lib/cjs/src/pki/model/PkiCertificate.js +2 -0
  82. package/lib/cjs/src/pki/model/PkiCertificate.js.map +7 -0
  83. package/lib/cjs/src/pki/model/PkiCertificateInfo.js +2 -0
  84. package/lib/cjs/src/pki/model/PkiCertificateInfo.js.map +7 -0
  85. package/lib/cjs/src/shared/domain/ContextLoader.js +2 -0
  86. package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -0
  87. package/lib/cjs/src/shared/model/ClearSignContext.js +2 -0
  88. package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -0
  89. package/lib/cjs/src/shared/model/GenericPath.js +2 -0
  90. package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
  91. package/lib/cjs/src/shared/model/SignatureTags.js +2 -0
  92. package/lib/cjs/src/shared/model/SignatureTags.js.map +7 -0
  93. package/lib/cjs/src/shared/model/TransactionContext.js +2 -0
  94. package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -0
  95. package/lib/cjs/src/shared/model/TransactionSubset.js +2 -0
  96. package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -0
  97. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -0
  98. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -0
  99. package/lib/cjs/src/shared/model/TypedDataContext.js +2 -0
  100. package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -0
  101. package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -0
  102. package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -0
  103. package/lib/cjs/src/shared/utils/HexStringUtils.test.js +2 -0
  104. package/lib/cjs/src/shared/utils/HexStringUtils.test.js.map +7 -0
  105. package/lib/cjs/src/shared/utils/KeyUsageMapper.js +2 -0
  106. package/lib/cjs/src/shared/utils/KeyUsageMapper.js.map +7 -0
  107. package/lib/cjs/src/shared/utils/KeyUsageMapper.test.js +2 -0
  108. package/lib/cjs/src/shared/utils/KeyUsageMapper.test.js.map +7 -0
  109. package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -0
  110. package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -0
  111. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
  112. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  113. package/lib/cjs/src/token/data/TokenDataSource.js +2 -0
  114. package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -0
  115. package/lib/cjs/src/token/data/TokenDto.js +2 -0
  116. package/lib/cjs/src/token/data/TokenDto.js.map +7 -0
  117. package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -0
  118. package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -0
  119. package/lib/cjs/src/token/di/tokenTypes.js +2 -0
  120. package/lib/cjs/src/token/di/tokenTypes.js.map +7 -0
  121. package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -0
  122. package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -0
  123. package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
  124. package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
  125. package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
  126. package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
  127. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
  128. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  129. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  130. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  131. package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
  132. package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
  133. package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
  134. package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
  135. package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
  136. package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
  137. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
  138. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  139. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  140. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  141. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  142. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  143. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  144. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  145. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
  146. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  147. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
  148. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  149. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  150. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  151. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
  152. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  153. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  154. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  155. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  156. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  157. package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -0
  158. package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -0
  159. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -0
  160. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -0
  161. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  162. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  163. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -0
  164. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -0
  165. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -0
  166. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -0
  167. package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -0
  168. package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -0
  169. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -0
  170. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -0
  171. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  172. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  173. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -0
  174. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -0
  175. package/lib/cjs/src/uniswap/constants/plugin.js +2 -0
  176. package/lib/cjs/src/uniswap/constants/plugin.js.map +7 -0
  177. package/lib/cjs/src/uniswap/constants/uniswap.js +2 -0
  178. package/lib/cjs/src/uniswap/constants/uniswap.js.map +7 -0
  179. package/lib/cjs/src/uniswap/constants/weth.js +2 -0
  180. package/lib/cjs/src/uniswap/constants/weth.js.map +7 -0
  181. package/lib/cjs/src/uniswap/data/AbiDecoderDataSource.js +2 -0
  182. package/lib/cjs/src/uniswap/data/AbiDecoderDataSource.js.map +7 -0
  183. package/lib/cjs/src/uniswap/data/CommandDecoderDataSource.js +2 -0
  184. package/lib/cjs/src/uniswap/data/CommandDecoderDataSource.js.map +7 -0
  185. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.js +2 -0
  186. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.js.map +7 -0
  187. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.test.js +2 -0
  188. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.test.js.map +7 -0
  189. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.js +2 -0
  190. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.js.map +7 -0
  191. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.test.js +2 -0
  192. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.test.js.map +7 -0
  193. package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js +2 -0
  194. package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js.map +7 -0
  195. package/lib/cjs/src/uniswap/di/uniswapTypes.js +2 -0
  196. package/lib/cjs/src/uniswap/di/uniswapTypes.js.map +7 -0
  197. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.js +2 -0
  198. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.js.map +7 -0
  199. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js +2 -0
  200. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js.map +7 -0
  201. package/lib/esm/index.js +1 -37617
  202. package/lib/esm/index.js.map +4 -4
  203. package/lib/esm/package.json +58 -0
  204. package/lib/esm/src/ContextModule.js +1 -0
  205. package/lib/esm/src/ContextModule.js.map +7 -0
  206. package/lib/esm/src/ContextModuleBuilder.js +2 -0
  207. package/lib/esm/src/ContextModuleBuilder.js.map +7 -0
  208. package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
  209. package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
  210. package/lib/esm/src/DefaultContextModule.js +2 -0
  211. package/lib/esm/src/DefaultContextModule.js.map +7 -0
  212. package/lib/esm/src/DefaultContextModule.test.js +2 -0
  213. package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
  214. package/lib/esm/src/config/di/configModuleFactory.js +2 -0
  215. package/lib/esm/src/config/di/configModuleFactory.js.map +7 -0
  216. package/lib/esm/src/config/di/configTypes.js +2 -0
  217. package/lib/esm/src/config/di/configTypes.js.map +7 -0
  218. package/lib/esm/src/config/model/ContextModuleConfig.js +1 -0
  219. package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -0
  220. package/lib/esm/src/di.js +2 -0
  221. package/lib/esm/src/di.js.map +7 -0
  222. package/lib/esm/src/external-plugin/data/DAppDto.js +1 -0
  223. package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -0
  224. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -0
  225. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -0
  226. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -0
  227. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -0
  228. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  229. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  230. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -0
  231. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -0
  232. package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -0
  233. package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -0
  234. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -0
  235. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -0
  236. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  237. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  238. package/lib/esm/src/external-plugin/model/DappInfos.js +1 -0
  239. package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -0
  240. package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -0
  241. package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -0
  242. package/lib/esm/src/index.js +2 -0
  243. package/lib/esm/src/index.js.map +7 -0
  244. package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -0
  245. package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -0
  246. package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
  247. package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  248. package/lib/esm/src/nft/data/NftDataSource.js +1 -0
  249. package/lib/esm/src/nft/data/NftDataSource.js.map +7 -0
  250. package/lib/esm/src/nft/di/nftModuleFactory.js +2 -0
  251. package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -0
  252. package/lib/esm/src/nft/di/nftTypes.js +2 -0
  253. package/lib/esm/src/nft/di/nftTypes.js.map +7 -0
  254. package/lib/esm/src/nft/domain/NftContextLoader.js +2 -0
  255. package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -0
  256. package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
  257. package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
  258. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.js +2 -0
  259. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.js.map +7 -0
  260. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.test.js +2 -0
  261. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.test.js.map +7 -0
  262. package/lib/esm/src/pki/data/PkiCertificateDataSource.js +1 -0
  263. package/lib/esm/src/pki/data/PkiCertificateDataSource.js.map +7 -0
  264. package/lib/esm/src/pki/data/pkiDataSourceTypes.js +1 -0
  265. package/lib/esm/src/pki/data/pkiDataSourceTypes.js.map +7 -0
  266. package/lib/esm/src/pki/di/pkiModuleFactory.js +2 -0
  267. package/lib/esm/src/pki/di/pkiModuleFactory.js.map +7 -0
  268. package/lib/esm/src/pki/di/pkiTypes.js +2 -0
  269. package/lib/esm/src/pki/di/pkiTypes.js.map +7 -0
  270. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js +2 -0
  271. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js.map +7 -0
  272. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js +2 -0
  273. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +7 -0
  274. package/lib/esm/src/pki/domain/PkiCertificateLoader.js +1 -0
  275. package/lib/esm/src/pki/domain/PkiCertificateLoader.js.map +7 -0
  276. package/lib/esm/src/pki/model/KeyId.js +2 -0
  277. package/lib/esm/src/pki/model/KeyId.js.map +7 -0
  278. package/lib/esm/src/pki/model/KeyUsage.js +2 -0
  279. package/lib/esm/src/pki/model/KeyUsage.js.map +7 -0
  280. package/lib/esm/src/pki/model/PkiCertificate.js +1 -0
  281. package/lib/esm/src/pki/model/PkiCertificate.js.map +7 -0
  282. package/lib/esm/src/pki/model/PkiCertificateInfo.js +1 -0
  283. package/lib/esm/src/pki/model/PkiCertificateInfo.js.map +7 -0
  284. package/lib/esm/src/shared/domain/ContextLoader.js +1 -0
  285. package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -0
  286. package/lib/esm/src/shared/model/ClearSignContext.js +2 -0
  287. package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -0
  288. package/lib/esm/src/shared/model/GenericPath.js +2 -0
  289. package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
  290. package/lib/esm/src/shared/model/SignatureTags.js +2 -0
  291. package/lib/esm/src/shared/model/SignatureTags.js.map +7 -0
  292. package/lib/esm/src/shared/model/TransactionContext.js +1 -0
  293. package/lib/esm/src/shared/model/TransactionContext.js.map +7 -0
  294. package/lib/esm/src/shared/model/TransactionSubset.js +1 -0
  295. package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -0
  296. package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -0
  297. package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -0
  298. package/lib/esm/src/shared/model/TypedDataContext.js +1 -0
  299. package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -0
  300. package/lib/esm/src/shared/utils/HexStringUtils.js +2 -0
  301. package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -0
  302. package/lib/esm/src/shared/utils/HexStringUtils.test.js +2 -0
  303. package/lib/esm/src/shared/utils/HexStringUtils.test.js.map +7 -0
  304. package/lib/esm/src/shared/utils/KeyUsageMapper.js +2 -0
  305. package/lib/esm/src/shared/utils/KeyUsageMapper.js.map +7 -0
  306. package/lib/esm/src/shared/utils/KeyUsageMapper.test.js +2 -0
  307. package/lib/esm/src/shared/utils/KeyUsageMapper.test.js.map +7 -0
  308. package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -0
  309. package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -0
  310. package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
  311. package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  312. package/lib/esm/src/token/data/TokenDataSource.js +1 -0
  313. package/lib/esm/src/token/data/TokenDataSource.js.map +7 -0
  314. package/lib/esm/src/token/data/TokenDto.js +1 -0
  315. package/lib/esm/src/token/data/TokenDto.js.map +7 -0
  316. package/lib/esm/src/token/di/tokenModuleFactory.js +2 -0
  317. package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -0
  318. package/lib/esm/src/token/di/tokenTypes.js +2 -0
  319. package/lib/esm/src/token/di/tokenTypes.js.map +7 -0
  320. package/lib/esm/src/token/domain/TokenContextLoader.js +2 -0
  321. package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -0
  322. package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
  323. package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
  324. package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
  325. package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
  326. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
  327. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  328. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  329. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  330. package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
  331. package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
  332. package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
  333. package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
  334. package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
  335. package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
  336. package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
  337. package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  338. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  339. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  340. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  341. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  342. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  343. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  344. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
  345. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  346. package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
  347. package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  348. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  349. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  350. package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
  351. package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  352. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  353. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  354. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  355. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  356. package/lib/esm/src/typed-data/data/FiltersDto.js +1 -0
  357. package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -0
  358. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -0
  359. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -0
  360. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  361. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  362. package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -0
  363. package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -0
  364. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -0
  365. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -0
  366. package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -0
  367. package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -0
  368. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -0
  369. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -0
  370. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  371. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  372. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -0
  373. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -0
  374. package/lib/esm/src/uniswap/constants/plugin.js +2 -0
  375. package/lib/esm/src/uniswap/constants/plugin.js.map +7 -0
  376. package/lib/esm/src/uniswap/constants/uniswap.js +2 -0
  377. package/lib/esm/src/uniswap/constants/uniswap.js.map +7 -0
  378. package/lib/esm/src/uniswap/constants/weth.js +2 -0
  379. package/lib/esm/src/uniswap/constants/weth.js.map +7 -0
  380. package/lib/esm/src/uniswap/data/AbiDecoderDataSource.js +1 -0
  381. package/lib/esm/src/uniswap/data/AbiDecoderDataSource.js.map +7 -0
  382. package/lib/esm/src/uniswap/data/CommandDecoderDataSource.js +1 -0
  383. package/lib/esm/src/uniswap/data/CommandDecoderDataSource.js.map +7 -0
  384. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.js +2 -0
  385. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.js.map +7 -0
  386. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.test.js +2 -0
  387. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.test.js.map +7 -0
  388. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.js +2 -0
  389. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.js.map +7 -0
  390. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.test.js +2 -0
  391. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.test.js.map +7 -0
  392. package/lib/esm/src/uniswap/di/uniswapModuleFactory.js +2 -0
  393. package/lib/esm/src/uniswap/di/uniswapModuleFactory.js.map +7 -0
  394. package/lib/esm/src/uniswap/di/uniswapTypes.js +2 -0
  395. package/lib/esm/src/uniswap/di/uniswapTypes.js.map +7 -0
  396. package/lib/esm/src/uniswap/domain/UniswapContextLoader.js +2 -0
  397. package/lib/esm/src/uniswap/domain/UniswapContextLoader.js.map +7 -0
  398. package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js +2 -0
  399. package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js.map +7 -0
  400. package/lib/types/src/ContextModule.d.ts +3 -2
  401. package/lib/types/src/ContextModule.d.ts.map +1 -1
  402. package/lib/types/src/ContextModuleBuilder.d.ts +9 -11
  403. package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -1
  404. package/lib/types/src/DefaultContextModule.d.ts +9 -11
  405. package/lib/types/src/DefaultContextModule.d.ts.map +1 -1
  406. package/lib/types/src/config/di/configModuleFactory.d.ts +1 -1
  407. package/lib/types/src/config/di/configModuleFactory.d.ts.map +1 -1
  408. package/lib/types/src/config/model/ContextModuleConfig.d.ts +5 -0
  409. package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -1
  410. package/lib/types/src/di.d.ts +1 -1
  411. package/lib/types/src/di.d.ts.map +1 -1
  412. package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
  413. package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -1
  414. package/lib/types/src/external-plugin/model/DappInfos.d.ts +1 -1
  415. package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -1
  416. package/lib/types/src/index.d.ts +7 -1
  417. package/lib/types/src/index.d.ts.map +1 -1
  418. package/lib/types/src/nft/data/NftDataSource.d.ts +1 -1
  419. package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -1
  420. package/lib/types/src/nft/domain/NftContextLoader.d.ts +2 -1
  421. package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -1
  422. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.d.ts +12 -0
  423. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.d.ts.map +1 -0
  424. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.test.d.ts +2 -0
  425. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.test.d.ts.map +1 -0
  426. package/lib/types/src/pki/data/PkiCertificateDataSource.d.ts +7 -0
  427. package/lib/types/src/pki/data/PkiCertificateDataSource.d.ts.map +1 -0
  428. package/lib/types/src/pki/data/pkiDataSourceTypes.d.ts +23 -0
  429. package/lib/types/src/pki/data/pkiDataSourceTypes.d.ts.map +1 -0
  430. package/lib/types/src/pki/di/pkiModuleFactory.d.ts +3 -0
  431. package/lib/types/src/pki/di/pkiModuleFactory.d.ts.map +1 -0
  432. package/lib/types/src/pki/di/pkiTypes.d.ts +5 -0
  433. package/lib/types/src/pki/di/pkiTypes.d.ts.map +1 -0
  434. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts +10 -0
  435. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts.map +1 -0
  436. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.test.d.ts +2 -0
  437. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.test.d.ts.map +1 -0
  438. package/lib/types/src/pki/domain/PkiCertificateLoader.d.ts +6 -0
  439. package/lib/types/src/pki/domain/PkiCertificateLoader.d.ts.map +1 -0
  440. package/lib/types/src/pki/model/KeyId.d.ts +14 -0
  441. package/lib/types/src/pki/model/KeyId.d.ts.map +1 -0
  442. package/lib/types/src/pki/model/KeyUsage.d.ts +15 -0
  443. package/lib/types/src/pki/model/KeyUsage.d.ts.map +1 -0
  444. package/lib/types/src/pki/model/PkiCertificate.d.ts +5 -0
  445. package/lib/types/src/pki/model/PkiCertificate.d.ts.map +1 -0
  446. package/lib/types/src/pki/model/PkiCertificateInfo.d.ts +7 -0
  447. package/lib/types/src/pki/model/PkiCertificateInfo.d.ts.map +1 -0
  448. package/lib/types/src/shared/domain/ContextLoader.d.ts +3 -2
  449. package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -1
  450. package/lib/types/src/shared/model/ClearSignContext.d.ts +36 -6
  451. package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -1
  452. package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
  453. package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
  454. package/lib/types/src/shared/model/SignatureTags.d.ts +3 -0
  455. package/lib/types/src/shared/model/SignatureTags.d.ts.map +1 -0
  456. package/lib/types/src/shared/model/TransactionContext.d.ts +17 -2
  457. package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -1
  458. package/lib/types/src/shared/utils/HexStringUtils.d.ts +1 -0
  459. package/lib/types/src/shared/utils/HexStringUtils.d.ts.map +1 -1
  460. package/lib/types/src/shared/utils/HexStringUtils.test.d.ts +2 -0
  461. package/lib/types/src/shared/utils/HexStringUtils.test.d.ts.map +1 -0
  462. package/lib/types/src/shared/utils/KeyUsageMapper.d.ts +6 -0
  463. package/lib/types/src/shared/utils/KeyUsageMapper.d.ts.map +1 -0
  464. package/lib/types/src/shared/utils/KeyUsageMapper.test.d.ts +2 -0
  465. package/lib/types/src/shared/utils/KeyUsageMapper.test.d.ts.map +1 -0
  466. package/lib/types/src/token/data/TokenDataSource.d.ts +1 -1
  467. package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -1
  468. package/lib/types/src/token/domain/TokenContextLoader.d.ts +2 -1
  469. package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -1
  470. package/lib/types/src/transaction/data/CalldataDto.d.ts +128 -0
  471. package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
  472. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +23 -0
  473. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
  474. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
  475. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
  476. package/lib/types/src/transaction/data/TransactionDataSource.d.ts +13 -0
  477. package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
  478. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
  479. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
  480. package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
  481. package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
  482. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
  483. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
  484. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
  485. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
  486. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
  487. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
  488. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
  489. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
  490. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
  491. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
  492. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
  493. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
  494. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
  495. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
  496. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
  497. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
  498. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
  499. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
  500. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
  501. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
  502. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +1 -1
  503. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -1
  504. package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
  505. package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -1
  506. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
  507. package/lib/types/src/uniswap/constants/plugin.d.ts +3 -0
  508. package/lib/types/src/uniswap/constants/plugin.d.ts.map +1 -0
  509. package/lib/types/src/uniswap/constants/uniswap.d.ts +21 -0
  510. package/lib/types/src/uniswap/constants/uniswap.d.ts.map +1 -0
  511. package/lib/types/src/uniswap/constants/weth.d.ts +20 -0
  512. package/lib/types/src/uniswap/constants/weth.d.ts.map +1 -0
  513. package/lib/types/src/uniswap/data/AbiDecoderDataSource.d.ts +5 -0
  514. package/lib/types/src/uniswap/data/AbiDecoderDataSource.d.ts.map +1 -0
  515. package/lib/types/src/uniswap/data/CommandDecoderDataSource.d.ts +6 -0
  516. package/lib/types/src/uniswap/data/CommandDecoderDataSource.d.ts.map +1 -0
  517. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.d.ts +14 -0
  518. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.d.ts.map +1 -0
  519. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.test.d.ts +2 -0
  520. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.test.d.ts.map +1 -0
  521. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.d.ts +5 -0
  522. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.d.ts.map +1 -0
  523. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.test.d.ts +2 -0
  524. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.test.d.ts.map +1 -0
  525. package/lib/types/src/uniswap/di/uniswapModuleFactory.d.ts +3 -0
  526. package/lib/types/src/uniswap/di/uniswapModuleFactory.d.ts.map +1 -0
  527. package/lib/types/src/uniswap/di/uniswapTypes.d.ts +6 -0
  528. package/lib/types/src/uniswap/di/uniswapTypes.d.ts.map +1 -0
  529. package/lib/types/src/uniswap/domain/UniswapContextLoader.d.ts +105 -0
  530. package/lib/types/src/uniswap/domain/UniswapContextLoader.d.ts.map +1 -0
  531. package/lib/types/src/uniswap/domain/UniswapContextLoader.test.d.ts +2 -0
  532. package/lib/types/src/uniswap/domain/UniswapContextLoader.test.d.ts.map +1 -0
  533. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  534. package/package.json +21 -18
  535. package/lib/types/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  536. package/lib/types/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  537. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  538. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  539. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.test.d.ts +0 -2
  540. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.test.d.ts.map +0 -1
  541. package/lib/types/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  542. package/lib/types/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  543. package/lib/types/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  544. package/lib/types/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  545. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  546. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  547. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.test.d.ts +0 -2
  548. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.test.d.ts.map +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/data/HttpNftDataSource.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport {\n GetNftInformationsParams,\n GetSetPluginPayloadParams,\n NftDataSource,\n} from \"@/nft/data/NftDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpNftDataSource implements NftDataSource {\n public async getSetPluginPayload({\n chainId,\n address,\n selector,\n }: GetSetPluginPayloadParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<{ payload: string }>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}/plugin-selector/${selector}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.payload\n ? Right(response.data.payload)\n : Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: unexpected empty response\",\n ),\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload\",\n ),\n );\n }\n }\n\n public async getNftInfosPayload({\n chainId,\n address,\n }: GetNftInformationsParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<{ payload: string }>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.payload\n ? Right(response.data.payload)\n : Left(new Error(\"[ContextModule] HttpNftDataSource: no nft metadata\"));\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch nft informations\",\n ),\n );\n }\n }\n}\n"],
5
+ "mappings": "wMAAA,OAAOA,MAAW,QAClB,OAAS,cAAAC,MAAkB,YAC3B,OAAiB,QAAAC,EAAM,SAAAC,MAAa,YAOpC,OAAOC,MAAa,qBAGb,IAAMC,EAAN,KAAiD,CACtD,MAAa,oBAAoB,CAC/B,QAAAC,EACA,QAAAC,EACA,SAAAC,CACF,EAA8D,CAC5D,GAAI,CACF,MAAMC,EAAW,MAAMC,EAAM,QAA6B,CACxD,OAAQ,MACR,IAAK,+CAA+CJ,CAAO,cAAcC,CAAO,oBAAoBC,CAAQ,GAC5G,QAAS,CACP,0BAA2B,kBAAkBG,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,QACjBG,EAAMH,EAAS,KAAK,OAAO,EAC3BI,EACE,IAAI,MACF,8DACF,CACF,CACN,MAAiB,CACf,OAAOA,EACL,IAAI,MACF,uEACF,CACF,CACF,CACF,CAEA,MAAa,mBAAmB,CAC9B,QAAAP,EACA,QAAAC,CACF,EAA6D,CAC3D,GAAI,CACF,MAAME,EAAW,MAAMC,EAAM,QAA6B,CACxD,OAAQ,MACR,IAAK,+CAA+CJ,CAAO,cAAcC,CAAO,GAChF,QAAS,CACP,0BAA2B,kBAAkBI,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,QACjBG,EAAMH,EAAS,KAAK,OAAO,EAC3BI,EAAK,IAAI,MAAM,oDAAoD,CAAC,CAC1E,MAAiB,CACf,OAAOA,EACL,IAAI,MACF,qEACF,CACF,CACF,CACF,CACF,EAvDaR,EAANS,EAAA,CADNC,EAAW,GACCV",
6
+ "names": ["axios", "injectable", "Left", "Right", "PACKAGE", "HttpNftDataSource", "chainId", "address", "selector", "response", "axios", "PACKAGE", "Right", "Left", "__decorateClass", "injectable"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import o from"axios";import r from"../../../package.json";import{HttpNftDataSource as s}from"./HttpNftDataSource";vi.mock("axios");describe("HttpNftDataSource",()=>{let a;beforeAll(()=>{a=new s,vi.clearAllMocks()}),it("should call axios with the ledger client version header",async()=>{const e=`context-module/${r.version}`,t=vi.fn(()=>Promise.resolve({data:[]}));vi.spyOn(o,"request").mockImplementation(t),await a.getNftInfosPayload({address:"0x00",chainId:1}),await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"}),expect(t).toHaveBeenNthCalledWith(1,expect.objectContaining({headers:{"X-Ledger-Client-Version":e}})),expect(t).toHaveBeenNthCalledWith(2,expect.objectContaining({headers:{"X-Ledger-Client-Version":e}}))}),describe("getNftInfosPayload",()=>{it("should return an error when axios throws an error",async()=>{vi.spyOn(o,"request").mockRejectedValue(new Error("error"));const e=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(e.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"))}),it("should return an error when the response is empty",async()=>{const e={data:{}};vi.spyOn(o,"request").mockResolvedValue(e);const t=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(t.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: no nft metadata"))}),it("should return the payload",async()=>{const e={data:{payload:"payload"}};vi.spyOn(o,"request").mockResolvedValue(e);const t=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(t.extract()).toEqual("payload")})}),describe("getSetPluginPayload",()=>{it("should return an error when axios throws an error",async()=>{vi.spyOn(o,"request").mockRejectedValue(new Error("error"));const e=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(e.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"))}),it("should return an error when the response is empty",async()=>{const e={data:{}};vi.spyOn(o,"request").mockResolvedValue(e);const t=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(t.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"))}),it("should return the payload",async()=>{const e={data:{payload:"payload"}};vi.spyOn(o,"request").mockResolvedValue(e);const t=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(t.extract()).toEqual("payload")})})});
2
+ //# sourceMappingURL=HttpNftDataSource.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/data/HttpNftDataSource.test.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\n\nimport PACKAGE from \"@root/package.json\";\n\nimport { HttpNftDataSource } from \"./HttpNftDataSource\";\nimport { type NftDataSource } from \"./NftDataSource\";\n\nvi.mock(\"axios\");\n\ndescribe(\"HttpNftDataSource\", () => {\n let datasource: NftDataSource;\n\n beforeAll(() => {\n datasource = new HttpNftDataSource();\n vi.clearAllMocks();\n });\n\n it(\"should call axios with the ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = vi.fn(() => Promise.resolve({ data: [] }));\n vi.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getNftInfosPayload({ address: \"0x00\", chainId: 1 });\n await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenNthCalledWith(\n 1,\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n expect(requestSpy).toHaveBeenNthCalledWith(\n 2,\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n describe(\"getNftInfosPayload\", () => {\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch nft informations\",\n ),\n );\n });\n\n it(\"should return an error when the response is empty\", async () => {\n // GIVEN\n const response = { data: {} };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\"[ContextModule] HttpNftDataSource: no nft metadata\"),\n );\n });\n\n it(\"should return the payload\", async () => {\n // GIVEN\n const response = { data: { payload: \"payload\" } };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\"payload\");\n });\n });\n\n describe(\"getSetPluginPayload\", () => {\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload\",\n ),\n );\n });\n\n it(\"should return an error when the response is empty\", async () => {\n // GIVEN\n const response = { data: {} };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: unexpected empty response\",\n ),\n );\n });\n\n it(\"should return the payload\", async () => {\n // GIVEN\n const response = { data: { payload: \"payload\" } };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\"payload\");\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["axios", "PACKAGE", "HttpNftDataSource", "datasource", "version", "requestSpy", "result", "response"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=NftDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{ContainerModule as r}from"inversify";import{HttpNftDataSource as e}from"../../nft/data/HttpNftDataSource";import{nftTypes as o}from"../../nft/di/nftTypes";import{NftContextLoader as n}from"../../nft/domain/NftContextLoader";const c=()=>new r((t,f,a,m)=>{t(o.NftDataSource).to(e),t(o.NftContextLoader).to(n)});export{c as nftModuleFactory};
2
+ //# sourceMappingURL=nftModuleFactory.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/di/nftModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpNftDataSource } from \"@/nft/data/HttpNftDataSource\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { NftContextLoader } from \"@/nft/domain/NftContextLoader\";\n\nexport const nftModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(nftTypes.NftDataSource).to(HttpNftDataSource);\n bind(nftTypes.NftContextLoader).to(NftContextLoader);\n });\n"],
5
+ "mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,qBAAAC,MAAyB,+BAClC,OAAS,YAAAC,MAAgB,oBACzB,OAAS,oBAAAC,MAAwB,gCAE1B,MAAMC,EAAmB,IAC9B,IAAIJ,EAAgB,CAACK,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAKH,EAAS,aAAa,EAAE,GAAGD,CAAiB,EACjDI,EAAKH,EAAS,gBAAgB,EAAE,GAAGC,CAAgB,CACrD,CAAC",
6
+ "names": ["ContainerModule", "HttpNftDataSource", "nftTypes", "NftContextLoader", "nftModuleFactory", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -0,0 +1,2 @@
1
+ const t={NftDataSource:Symbol.for("nftDataSource"),NftContextLoader:Symbol.for("nftContextLoader")};export{t as nftTypes};
2
+ //# sourceMappingURL=nftTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/di/nftTypes.ts"],
4
+ "sourcesContent": ["export const nftTypes = {\n NftDataSource: Symbol.for(\"nftDataSource\"),\n NftContextLoader: Symbol.for(\"nftContextLoader\"),\n};\n"],
5
+ "mappings": "AAAO,MAAMA,EAAW,CACtB,cAAe,OAAO,IAAI,eAAe,EACzC,iBAAkB,OAAO,IAAI,kBAAkB,CACjD",
6
+ "names": ["nftTypes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var y=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var c=(i,e,r,t)=>{for(var n=t>1?void 0:t?x(e,r):e,a=i.length-1,l;a>=0;a--)(l=i[a])&&(n=(t?l(e,r,n):l(n))||n);return t&&n&&y(e,r,n),n},f=(i,e)=>(r,t)=>e(r,t,i);import{isHexaString as m}from"@ledgerhq/device-management-kit";import{inject as S,injectable as h}from"inversify";import{nftTypes as F}from"../../nft/di/nftTypes";import{ClearSignContextType as o}from"../../shared/model/ClearSignContext";var u=(a=>(a.Approve="0x095ea7b3",a.SetApprovalForAll="0xa22cb465",a.TransferFrom="0x23b872dd",a.SafeTransferFrom="0x42842e0e",a.SafeTransferFromWithData="0xb88d4fde",a))(u||{}),g=(t=>(t.SetApprovalForAll="0xa22cb465",t.SafeTransferFrom="0xf242432a",t.SafeBatchTransferFrom="0x2eb2c2d6",t))(g||{});const I=[...Object.values(u),...Object.values(g)];let d=class{_dataSource;constructor(e){this._dataSource=e}async load(e){const r=[];if(!e.to||!e.data||e.data==="0x")return[];const t=e.data.slice(0,10);if(!m(t))return[{type:o.ERROR,error:new Error("Invalid selector")}];if(!this.isSelectorSupported(t))return[];const a=(await this._dataSource.getSetPluginPayload({chainId:e.chainId,address:e.to,selector:t})).caseOf({Left:s=>({type:o.ERROR,error:s}),Right:s=>({type:o.PLUGIN,payload:s})});if(a.type===o.ERROR)return[a];r.push(a);const p=(await this._dataSource.getNftInfosPayload({chainId:e.chainId,address:e.to})).caseOf({Left:s=>({type:o.ERROR,error:s}),Right:s=>({type:o.NFT,payload:s})});return p.type===o.ERROR?[p]:(r.push(p),r)}async loadField(e){return e.type!==o.NFT?null:(await this._dataSource.getNftInfosPayload({address:e.address,chainId:e.chainId})).caseOf({Left:t=>({type:o.ERROR,error:t}),Right:t=>({type:o.NFT,payload:t})})}isSelectorSupported(e){return Object.values(I).includes(e)}};d=c([h(),f(0,S(F.NftDataSource))],d);export{d as NftContextLoader};
2
+ //# sourceMappingURL=NftContextLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/domain/NftContextLoader.ts"],
4
+ "sourcesContent": ["import { HexaString, isHexaString } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport type { NftDataSource } from \"@/nft/data/NftDataSource\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport {\n TransactionContext,\n TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\n\nenum ERC721_SUPPORTED_SELECTOR {\n Approve = \"0x095ea7b3\",\n SetApprovalForAll = \"0xa22cb465\",\n TransferFrom = \"0x23b872dd\",\n SafeTransferFrom = \"0x42842e0e\",\n SafeTransferFromWithData = \"0xb88d4fde\",\n}\n\nenum ERC1155_SUPPORTED_SELECTOR {\n SetApprovalForAll = \"0xa22cb465\",\n SafeTransferFrom = \"0xf242432a\",\n SafeBatchTransferFrom = \"0x2eb2c2d6\",\n}\n\nconst SUPPORTED_SELECTORS: HexaString[] = [\n ...Object.values(ERC721_SUPPORTED_SELECTOR),\n ...Object.values(ERC1155_SUPPORTED_SELECTOR),\n];\n\n@injectable()\nexport class NftContextLoader implements ContextLoader {\n private _dataSource: NftDataSource;\n\n constructor(@inject(nftTypes.NftDataSource) dataSource: NftDataSource) {\n this._dataSource = dataSource;\n }\n\n async load(transaction: TransactionContext): Promise<ClearSignContext[]> {\n const responses: ClearSignContext[] = [];\n\n if (!transaction.to || !transaction.data || transaction.data === \"0x\") {\n return [];\n }\n\n const selector = transaction.data.slice(0, 10);\n\n if (!isHexaString(selector)) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ];\n }\n\n if (!this.isSelectorSupported(selector)) {\n return [];\n }\n\n // EXAMPLE:\n // https://nft.api.live.ledger.com/v1/ethereum/1/contracts/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/plugin-selector/0x095ea7b3\n const getPluginPayloadResponse = await this._dataSource.getSetPluginPayload(\n {\n chainId: transaction.chainId,\n address: transaction.to,\n selector,\n },\n );\n\n const pluginPayload = getPluginPayloadResponse.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.PLUGIN,\n payload: value,\n }),\n });\n\n if (pluginPayload.type === ClearSignContextType.ERROR) {\n return [pluginPayload];\n }\n\n responses.push(pluginPayload);\n\n const getNftInfosPayloadResponse =\n await this._dataSource.getNftInfosPayload({\n chainId: transaction.chainId,\n address: transaction.to,\n });\n\n const nftInfosPayload = getNftInfosPayloadResponse.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.NFT,\n payload: value,\n }),\n });\n\n if (nftInfosPayload.type === ClearSignContextType.ERROR) {\n return [nftInfosPayload];\n }\n\n responses.push(nftInfosPayload);\n\n return responses;\n }\n\n async loadField(\n field: TransactionFieldContext,\n ): Promise<ClearSignContext | null> {\n if (field.type !== ClearSignContextType.NFT) {\n return null;\n }\n const payload = await this._dataSource.getNftInfosPayload({\n address: field.address,\n chainId: field.chainId,\n });\n return payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.NFT,\n payload: value,\n }),\n });\n }\n\n private isSelectorSupported(selector: HexaString) {\n return Object.values(SUPPORTED_SELECTORS).includes(selector);\n }\n}\n"],
5
+ "mappings": "iOAAA,OAAqB,gBAAAA,MAAoB,kCACzC,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YAGnC,OAAS,YAAAC,MAAgB,oBAEzB,OAEE,wBAAAC,MACK,kCAMP,IAAKC,OACHA,EAAA,QAAU,aACVA,EAAA,kBAAoB,aACpBA,EAAA,aAAe,aACfA,EAAA,iBAAmB,aACnBA,EAAA,yBAA2B,aALxBA,OAAA,IAQAC,OACHA,EAAA,kBAAoB,aACpBA,EAAA,iBAAmB,aACnBA,EAAA,sBAAwB,aAHrBA,OAAA,IAML,MAAMC,EAAoC,CACxC,GAAG,OAAO,OAAOF,CAAyB,EAC1C,GAAG,OAAO,OAAOC,CAA0B,CAC7C,EAGO,IAAME,EAAN,KAAgD,CAC7C,YAER,YAA4CC,EAA2B,CACrE,KAAK,YAAcA,CACrB,CAEA,MAAM,KAAKC,EAA8D,CACvE,MAAMC,EAAgC,CAAC,EAEvC,GAAI,CAACD,EAAY,IAAM,CAACA,EAAY,MAAQA,EAAY,OAAS,KAC/D,MAAO,CAAC,EAGV,MAAME,EAAWF,EAAY,KAAK,MAAM,EAAG,EAAE,EAE7C,GAAI,CAACG,EAAaD,CAAQ,EACxB,MAAO,CACL,CACE,KAAME,EAAqB,MAC3B,MAAO,IAAI,MAAM,kBAAkB,CACrC,CACF,EAGF,GAAI,CAAC,KAAK,oBAAoBF,CAAQ,EACpC,MAAO,CAAC,EAaV,MAAMG,GAR2B,MAAM,KAAK,YAAY,oBACtD,CACE,QAASL,EAAY,QACrB,QAASA,EAAY,GACrB,SAAAE,CACF,CACF,GAE+C,OAAO,CACpD,KAAOI,IAA6B,CAClC,KAAMF,EAAqB,MAC3B,MAAAE,CACF,GACA,MAAQC,IAA6B,CACnC,KAAMH,EAAqB,OAC3B,QAASG,CACX,EACF,CAAC,EAED,GAAIF,EAAc,OAASD,EAAqB,MAC9C,MAAO,CAACC,CAAa,EAGvBJ,EAAU,KAAKI,CAAa,EAQ5B,MAAMG,GALJ,MAAM,KAAK,YAAY,mBAAmB,CACxC,QAASR,EAAY,QACrB,QAASA,EAAY,EACvB,CAAC,GAEgD,OAAO,CACxD,KAAOM,IAA6B,CAClC,KAAMF,EAAqB,MAC3B,MAAAE,CACF,GACA,MAAQC,IAA6B,CACnC,KAAMH,EAAqB,IAC3B,QAASG,CACX,EACF,CAAC,EAED,OAAIC,EAAgB,OAASJ,EAAqB,MACzC,CAACI,CAAe,GAGzBP,EAAU,KAAKO,CAAe,EAEvBP,EACT,CAEA,MAAM,UACJQ,EACkC,CAClC,OAAIA,EAAM,OAASL,EAAqB,IAC/B,MAEO,MAAM,KAAK,YAAY,mBAAmB,CACxD,QAASK,EAAM,QACf,QAASA,EAAM,OACjB,CAAC,GACc,OAAO,CACpB,KAAOH,IAA6B,CAClC,KAAMF,EAAqB,MAC3B,MAAAE,CACF,GACA,MAAQC,IAA6B,CACnC,KAAMH,EAAqB,IAC3B,QAASG,CACX,EACF,CAAC,CACH,CAEQ,oBAAoBL,EAAsB,CAChD,OAAO,OAAO,OAAOL,CAAmB,EAAE,SAASK,CAAQ,CAC7D,CACF,EA3GaJ,EAANY,EAAA,CADNC,EAAW,EAIGC,EAAA,EAAAC,EAAOC,EAAS,aAAa,IAH/BhB",
6
+ "names": ["isHexaString", "inject", "injectable", "nftTypes", "ClearSignContextType", "ERC721_SUPPORTED_SELECTOR", "ERC1155_SUPPORTED_SELECTOR", "SUPPORTED_SELECTORS", "NftContextLoader", "dataSource", "transaction", "responses", "selector", "isHexaString", "ClearSignContextType", "pluginPayload", "error", "value", "nftInfosPayload", "field", "__decorateClass", "injectable", "__decorateParam", "inject", "nftTypes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Left as c,Right as s}from"purify-ts";import{NftContextLoader as l}from"../../nft/domain/NftContextLoader";import{ClearSignContextType as o}from"../../shared/model/ClearSignContext";describe("NftContextLoader",()=>{const n=vi.fn(),r=vi.fn();let d,e;beforeEach(()=>{vi.restoreAllMocks(),d={getNftInfosPayload:n,getSetPluginPayload:r},e=new l(d)}),describe("load function",()=>{it("should return an empty array if no dest",async()=>{const t={to:void 0,data:"0x01"},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if undefined data",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:void 0},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if empty data",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x"},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if selector not supported",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b20000000000000"},a=await e.load(t);expect(a).toEqual([])}),it("should return an error when transaction data is not a valid hex string",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"notahexstring"},a=await e.load(t);expect(a).toEqual([{type:o.ERROR,error:new Error("Invalid selector")}])}),it("should return an error when datasource get plugin payload return a Left",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b30000000000000"};r.mockResolvedValueOnce(c(new Error("error")));const a=await e.load(t);expect(a).toEqual([{type:o.ERROR,error:new Error("error")}])}),it("should return an error when datasource get nft infos payload return a Left",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b30000000000000"};r.mockResolvedValueOnce(s("payload1")),n.mockResolvedValueOnce(c(new Error("error")));const a=await e.load(t);expect(a).toEqual([{type:o.ERROR,error:new Error("error")}])}),it("should return a response",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b30000000000000"};r.mockResolvedValueOnce(s("payload1")),n.mockResolvedValueOnce(s("payload2"));const a=await e.load(t);expect(a).toEqual([{type:o.PLUGIN,payload:"payload1"},{type:o.NFT,payload:"payload2"}])})}),describe("loadField function",()=>{it("should return an error when field type if not supported",async()=>{const t={type:o.TOKEN,chainId:7,address:"0x1234"},a=await e.loadField(t);expect(a).toEqual(null)}),it("should return a payload",async()=>{const t={type:o.NFT,chainId:7,address:"0x1234"};n.mockResolvedValueOnce(s("payload"));const a=await e.loadField(t);expect(a).toEqual({type:o.NFT,payload:"payload"})}),it("should return an error when unable to fetch the datasource",async()=>{const t={type:o.NFT,chainId:7,address:"0x1234"};n.mockResolvedValueOnce(c(new Error("error")));const a=await e.loadField(t);expect(a).toEqual({type:o.ERROR,error:new Error("error")})})})});
2
+ //# sourceMappingURL=NftContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/domain/NftContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { type NftDataSource } from \"@/nft/data/NftDataSource\";\nimport { NftContextLoader } from \"@/nft/domain/NftContextLoader\";\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\n\ndescribe(\"NftContextLoader\", () => {\n const spyGetNftInfosPayload = vi.fn();\n const spyGetPluginPayload = vi.fn();\n let mockDataSource: NftDataSource;\n let loader: NftContextLoader;\n\n beforeEach(() => {\n vi.restoreAllMocks();\n mockDataSource = {\n getNftInfosPayload: spyGetNftInfosPayload,\n getSetPluginPayload: spyGetPluginPayload,\n };\n loader = new NftContextLoader(mockDataSource);\n });\n\n describe(\"load function\", () => {\n it(\"should return an empty array if no dest\", async () => {\n const transaction = { to: undefined, data: \"0x01\" } as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if undefined data\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: undefined,\n } as unknown as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if empty data\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x\",\n } as unknown as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if selector not supported\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b20000000000000\",\n } as unknown as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([]);\n });\n\n it(\"should return an error when transaction data is not a valid hex string\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"notahexstring\",\n } as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ]);\n });\n\n it(\"should return an error when datasource get plugin payload return a Left\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b30000000000000\",\n } as TransactionContext;\n spyGetPluginPayload.mockResolvedValueOnce(Left(new Error(\"error\")));\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n ]);\n });\n\n it(\"should return an error when datasource get nft infos payload return a Left\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b30000000000000\",\n } as TransactionContext;\n spyGetPluginPayload.mockResolvedValueOnce(Right(\"payload1\"));\n spyGetNftInfosPayload.mockResolvedValueOnce(Left(new Error(\"error\")));\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n ]);\n });\n\n it(\"should return a response\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b30000000000000\",\n } as TransactionContext;\n spyGetPluginPayload.mockResolvedValueOnce(Right(\"payload1\"));\n spyGetNftInfosPayload.mockResolvedValueOnce(Right(\"payload2\"));\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.PLUGIN,\n payload: \"payload1\",\n },\n {\n type: ClearSignContextType.NFT,\n payload: \"payload2\",\n },\n ]);\n });\n });\n\n describe(\"loadField function\", () => {\n it(\"should return an error when field type if not supported\", async () => {\n const field: TransactionFieldContext = {\n type: ClearSignContextType.TOKEN,\n chainId: 7,\n address: \"0x1234\",\n };\n\n const result = await loader.loadField(field);\n\n expect(result).toEqual(null);\n });\n\n it(\"should return a payload\", async () => {\n // GIVEN\n const field: TransactionFieldContext = {\n type: ClearSignContextType.NFT,\n chainId: 7,\n address: \"0x1234\",\n };\n\n // WHEN\n spyGetNftInfosPayload.mockResolvedValueOnce(Right(\"payload\"));\n const result = await loader.loadField(field);\n\n // THEN\n expect(result).toEqual({\n type: ClearSignContextType.NFT,\n payload: \"payload\",\n });\n });\n\n it(\"should return an error when unable to fetch the datasource\", async () => {\n // GIVEN\n const field: TransactionFieldContext = {\n type: ClearSignContextType.NFT,\n chainId: 7,\n address: \"0x1234\",\n };\n\n // WHEN\n spyGetNftInfosPayload.mockResolvedValueOnce(Left(new Error(\"error\")));\n const result = await loader.loadField(field);\n\n // THEN\n expect(result).toEqual({\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n });\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["Left", "Right", "NftContextLoader", "ClearSignContextType", "spyGetNftInfosPayload", "spyGetPluginPayload", "mockDataSource", "loader", "transaction", "result", "field"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var d=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=(o,e,r,t)=>{for(var i=t>1?void 0:t?m(e,r):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(i=(t?n(e,r,i):n(i))||i);return t&&i&&d(e,r,i),i},p=(o,e)=>(r,t)=>e(r,t,o);import{hexaStringToBuffer as g}from"@ledgerhq/device-management-kit";import u from"axios";import{inject as l,injectable as C}from"inversify";import{Left as c,Right as y}from"purify-ts";import{configTypes as k}from"../../config/di/configTypes";import{SIGNATURE_TAG as P}from"../../shared/model/SignatureTags";import{HexStringUtils as h}from"../../shared/utils/HexStringUtils";import{KeyUsageMapper as x}from"../../shared/utils/KeyUsageMapper";import M from"../../../package.json";let a=class{constructor(e){this.config=e}async fetchCertificate(e){const r={output:"descriptor",target_device:e.targetDevice,latest:!0,public_key_id:e.keyId,public_key_usage:e.keyUsage};try{const t=await u.request({method:"GET",url:`${this.config.cal.url}/certificates`,params:r,headers:{"X-Ledger-Client-Version":`context-module/${M.version}`}});if(t.status==200&&t.data!==void 0&&t.data.length>0&&this.isValidPkiCertificateResponse(t.data[0],this.config.cal.mode)){const i=g(h.appendSignatureToPayload(t.data[0].descriptor.data,t.data[0].descriptor.signatures[this.config.cal.mode],P));if(!i)return c(Error("[ContextModule] HttpPkiCertificateDataSource: Cannot generate payload from fetched PKI Certificate"));const s={payload:i,keyUsageNumber:x.mapKeyUsageForFirmware(e.keyUsage)};return y(s)}else return c(Error("[ContextModule] HttpPkiCertificateDataSource: failed to fetch PKI for given descriptor"))}catch{return c(Error("[ContextModule] HttpPkiCertificateDataSource: failed to fetch PKI for given descriptor"))}}isValidPkiCertificateResponse(e,r){return typeof e=="object"&&e!==null&&"descriptor"in e&&typeof e.descriptor=="object"&&e.descriptor!==null&&"data"in e.descriptor&&typeof e.descriptor.data=="string"&&"signatures"in e.descriptor&&typeof e.descriptor.signatures=="object"&&e.descriptor.signatures!==null&&r in e.descriptor.signatures&&typeof e.descriptor.signatures[r]=="string"}};a=f([C(),p(0,l(k.Config))],a);export{a as HttpPkiCertificateDataSource};
2
+ //# sourceMappingURL=HttpPkiCertificateDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/data/HttpPkiCertificateDataSource.ts"],
4
+ "sourcesContent": ["import { hexaStringToBuffer } from \"@ledgerhq/device-management-kit\";\nimport axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type {\n ContextModuleCalMode,\n ContextModuleConfig,\n} from \"@/config/model/ContextModuleConfig\";\nimport { PkiCertificate } from \"@/pki/model/PkiCertificate\";\nimport { PkiCertificateInfo } from \"@/pki/model/PkiCertificateInfo\";\nimport { SIGNATURE_TAG } from \"@/shared/model/SignatureTags\";\nimport { HexStringUtils } from \"@/shared/utils/HexStringUtils\";\nimport { KeyUsageMapper } from \"@/shared/utils/KeyUsageMapper\";\nimport PACKAGE from \"@root/package.json\";\n\nimport { type PkiCertificateDataSource } from \"./PkiCertificateDataSource\";\nimport {\n type PkiCertificateRequestDto,\n type PkiCertificateResponseDto,\n} from \"./pkiDataSourceTypes\";\n\n@injectable()\nexport class HttpPkiCertificateDataSource implements PkiCertificateDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n async fetchCertificate(\n pkiCertificateInfo: PkiCertificateInfo,\n ): Promise<Either<Error, PkiCertificate | undefined>> {\n const requestDto: PkiCertificateRequestDto = {\n output: \"descriptor\",\n target_device: pkiCertificateInfo.targetDevice,\n latest: true,\n public_key_id: pkiCertificateInfo.keyId,\n public_key_usage: pkiCertificateInfo.keyUsage,\n };\n\n try {\n const pkiCertificateResponse = await axios.request<\n PkiCertificateResponseDto[]\n >({\n method: \"GET\",\n url: `${this.config.cal.url}/certificates`,\n params: requestDto,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n if (\n pkiCertificateResponse.status == 200 &&\n pkiCertificateResponse.data !== undefined &&\n pkiCertificateResponse.data.length > 0 &&\n this.isValidPkiCertificateResponse(\n pkiCertificateResponse.data[0],\n this.config.cal.mode,\n )\n ) {\n const payload = hexaStringToBuffer(\n HexStringUtils.appendSignatureToPayload(\n pkiCertificateResponse.data[0].descriptor.data,\n pkiCertificateResponse.data[0].descriptor.signatures[\n this.config.cal.mode\n ],\n SIGNATURE_TAG,\n ),\n );\n if (!payload) {\n return Left(\n Error(\n \"[ContextModule] HttpPkiCertificateDataSource: Cannot generate payload from fetched PKI Certificate\",\n ),\n );\n }\n const pkiCertificate: PkiCertificate = {\n payload: payload,\n keyUsageNumber: KeyUsageMapper.mapKeyUsageForFirmware(\n pkiCertificateInfo.keyUsage,\n ),\n };\n return Right(pkiCertificate);\n } else {\n return Left(\n Error(\n \"[ContextModule] HttpPkiCertificateDataSource: failed to fetch PKI for given descriptor\",\n ),\n );\n }\n } catch (_error) {\n return Left(\n Error(\n \"[ContextModule] HttpPkiCertificateDataSource: failed to fetch PKI for given descriptor\",\n ),\n );\n }\n }\n\n private isValidPkiCertificateResponse(\n value: unknown,\n mode: ContextModuleCalMode,\n ): value is PkiCertificateResponseDto {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"descriptor\" in value &&\n typeof value.descriptor === \"object\" &&\n value.descriptor !== null &&\n \"data\" in value.descriptor &&\n typeof value.descriptor.data === \"string\" &&\n \"signatures\" in value.descriptor &&\n typeof value.descriptor.signatures === \"object\" &&\n value.descriptor.signatures !== null &&\n mode in value.descriptor.signatures &&\n typeof (value.descriptor.signatures as Record<string, unknown>)[mode] ===\n \"string\"\n );\n }\n}\n"],
5
+ "mappings": "iOAAA,OAAS,sBAAAA,MAA0B,kCACnC,OAAOC,MAAW,QAClB,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YACnC,OAAiB,QAAAC,EAAM,SAAAC,MAAa,YAEpC,OAAS,eAAAC,MAAmB,0BAO5B,OAAS,iBAAAC,MAAqB,+BAC9B,OAAS,kBAAAC,MAAsB,gCAC/B,OAAS,kBAAAC,MAAsB,gCAC/B,OAAOC,MAAa,qBASb,IAAMC,EAAN,KAAuE,CAC5E,YAC+CC,EAC7C,CAD6C,YAAAA,CAC5C,CAEH,MAAM,iBACJC,EACoD,CACpD,MAAMC,EAAuC,CAC3C,OAAQ,aACR,cAAeD,EAAmB,aAClC,OAAQ,GACR,cAAeA,EAAmB,MAClC,iBAAkBA,EAAmB,QACvC,EAEA,GAAI,CACF,MAAME,EAAyB,MAAMC,EAAM,QAEzC,CACA,OAAQ,MACR,IAAK,GAAG,KAAK,OAAO,IAAI,GAAG,gBAC3B,OAAQF,EACR,QAAS,CACP,0BAA2B,kBAAkBG,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,GACEF,EAAuB,QAAU,KACjCA,EAAuB,OAAS,QAChCA,EAAuB,KAAK,OAAS,GACrC,KAAK,8BACHA,EAAuB,KAAK,CAAC,EAC7B,KAAK,OAAO,IAAI,IAClB,EACA,CACA,MAAMG,EAAUC,EACdC,EAAe,yBACbL,EAAuB,KAAK,CAAC,EAAE,WAAW,KAC1CA,EAAuB,KAAK,CAAC,EAAE,WAAW,WACxC,KAAK,OAAO,IAAI,IAClB,EACAM,CACF,CACF,EACA,GAAI,CAACH,EACH,OAAOI,EACL,MACE,oGACF,CACF,EAEF,MAAMC,EAAiC,CACrC,QAASL,EACT,eAAgBM,EAAe,uBAC7BX,EAAmB,QACrB,CACF,EACA,OAAOY,EAAMF,CAAc,CAC7B,KACE,QAAOD,EACL,MACE,wFACF,CACF,CAEJ,MAAiB,CACf,OAAOA,EACL,MACE,wFACF,CACF,CACF,CACF,CAEQ,8BACNI,EACAC,EACoC,CACpC,OACE,OAAOD,GAAU,UACjBA,IAAU,MACV,eAAgBA,GAChB,OAAOA,EAAM,YAAe,UAC5BA,EAAM,aAAe,MACrB,SAAUA,EAAM,YAChB,OAAOA,EAAM,WAAW,MAAS,UACjC,eAAgBA,EAAM,YACtB,OAAOA,EAAM,WAAW,YAAe,UACvCA,EAAM,WAAW,aAAe,MAChCC,KAAQD,EAAM,WAAW,YACzB,OAAQA,EAAM,WAAW,WAAuCC,CAAI,GAClE,QAEN,CACF,EAhGahB,EAANiB,EAAA,CADNC,EAAW,EAGPC,EAAA,EAAAC,EAAOC,EAAY,MAAM,IAFjBrB",
6
+ "names": ["hexaStringToBuffer", "axios", "inject", "injectable", "Left", "Right", "configTypes", "SIGNATURE_TAG", "HexStringUtils", "KeyUsageMapper", "PACKAGE", "HttpPkiCertificateDataSource", "config", "pkiCertificateInfo", "requestDto", "pkiCertificateResponse", "axios", "PACKAGE", "payload", "hexaStringToBuffer", "HexStringUtils", "SIGNATURE_TAG", "Left", "pkiCertificate", "KeyUsageMapper", "Right", "value", "mode", "__decorateClass", "injectable", "__decorateParam", "inject", "configTypes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import r from"axios";import{Left as c,Right as n}from"purify-ts";import{HttpPkiCertificateDataSource as i}from"../../pki/data/HttpPkiCertificateDataSource";import{KeyUsage as o}from"../../pki/model/KeyUsage";vi.mock("axios");describe("HttpPkiCertificateDataSource",()=>{const a={cal:{url:"https://cal.com",mode:"test",branch:"main"}};describe("fetchCertificate",()=>{it("should return certificate",async()=>{const e={targetDevice:"targetDevice",keyUsage:o.Calldata,keyId:"keyId"};vi.spyOn(r,"request").mockResolvedValue({status:200,data:[{descriptor:{data:"01020304",signatures:{test:"05060708"}}}]});const t=await new i(a).fetchCertificate(e);expect(t).toEqual(n({keyUsageNumber:11,payload:new Uint8Array([1,2,3,4,21,4,5,6,7,8])}))}),it("should return an error when certificate is not found",async()=>{const e={targetDevice:"targetDevice",keyUsage:o.Calldata,keyId:"keyId"};vi.spyOn(r,"request").mockResolvedValue({status:200,data:[]});const t=await new i(a).fetchCertificate(e);expect(t).toEqual(c(Error("[ContextModule] HttpPkiCertificateDataSource: failed to fetch PKI for given descriptor")))}),it("should return an error when axios request fails",async()=>{const e={targetDevice:"targetDevice",keyUsage:o.Calldata,keyId:"keyId"};vi.spyOn(r,"request").mockRejectedValue(new Error("error"));const t=await new i(a).fetchCertificate(e);expect(t).toEqual(c(Error("[ContextModule] HttpPkiCertificateDataSource: failed to fetch PKI for given descriptor")))}),it("should return an error when payload cannot be generated",async()=>{const e={targetDevice:"targetDevice",keyUsage:o.Calldata,keyId:"keyId"};vi.spyOn(r,"request").mockResolvedValue({status:200,data:[{descriptor:{data:"corrupteddata",signatures:{test:"05060708"}}}]});const t=await new i(a).fetchCertificate(e);expect(t).toEqual(c(Error("[ContextModule] HttpPkiCertificateDataSource: Cannot generate payload from fetched PKI Certificate")))})})});
2
+ //# sourceMappingURL=HttpPkiCertificateDataSource.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/data/HttpPkiCertificateDataSource.test.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { Left, Right } from \"purify-ts\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { HttpPkiCertificateDataSource } from \"@/pki/data/HttpPkiCertificateDataSource\";\nimport { KeyUsage } from \"@/pki/model/KeyUsage\";\nimport { type PkiCertificateInfo } from \"@/pki/model/PkiCertificateInfo\";\n\nvi.mock(\"axios\");\n\ndescribe(\"HttpPkiCertificateDataSource\", () => {\n const config = {\n cal: {\n url: \"https://cal.com\",\n mode: \"test\",\n branch: \"main\",\n },\n } as ContextModuleConfig;\n\n describe(\"fetchCertificate\", () => {\n it(\"should return certificate\", async () => {\n // GIVEN\n const pkiCertificateInfo: PkiCertificateInfo = {\n targetDevice: \"targetDevice\",\n keyUsage: KeyUsage.Calldata,\n keyId: \"keyId\",\n };\n vi.spyOn(axios, \"request\").mockResolvedValue({\n status: 200,\n data: [\n {\n descriptor: {\n data: \"01020304\",\n signatures: {\n test: \"05060708\",\n },\n },\n },\n ],\n });\n\n // WHEN\n const result = await new HttpPkiCertificateDataSource(\n config,\n ).fetchCertificate(pkiCertificateInfo);\n\n // THEN\n expect(result).toEqual(\n Right({\n keyUsageNumber: 11,\n payload: new Uint8Array([\n 0x01, 0x02, 0x03, 0x04, 0x15, 0x04, 0x05, 0x06, 0x07, 0x08,\n ]),\n }),\n );\n });\n\n it(\"should return an error when certificate is not found\", async () => {\n // GIVEN\n const pkiCertificateInfo: PkiCertificateInfo = {\n targetDevice: \"targetDevice\",\n keyUsage: KeyUsage.Calldata,\n keyId: \"keyId\",\n };\n vi.spyOn(axios, \"request\").mockResolvedValue({\n status: 200,\n data: [],\n });\n\n // WHEN\n const result = await new HttpPkiCertificateDataSource(\n config,\n ).fetchCertificate(pkiCertificateInfo);\n\n // THEN\n expect(result).toEqual(\n Left(\n Error(\n \"[ContextModule] HttpPkiCertificateDataSource: failed to fetch PKI for given descriptor\",\n ),\n ),\n );\n });\n\n it(\"should return an error when axios request fails\", async () => {\n // GIVEN\n const pkiCertificateInfo: PkiCertificateInfo = {\n targetDevice: \"targetDevice\",\n keyUsage: KeyUsage.Calldata,\n keyId: \"keyId\",\n };\n vi.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await new HttpPkiCertificateDataSource(\n config,\n ).fetchCertificate(pkiCertificateInfo);\n\n // THEN\n expect(result).toEqual(\n Left(\n Error(\n \"[ContextModule] HttpPkiCertificateDataSource: failed to fetch PKI for given descriptor\",\n ),\n ),\n );\n });\n\n it(\"should return an error when payload cannot be generated\", async () => {\n // GIVEN\n const pkiCertificateInfo: PkiCertificateInfo = {\n targetDevice: \"targetDevice\",\n keyUsage: KeyUsage.Calldata,\n keyId: \"keyId\",\n };\n vi.spyOn(axios, \"request\").mockResolvedValue({\n status: 200,\n data: [\n {\n descriptor: {\n data: \"corrupteddata\",\n signatures: {\n test: \"05060708\",\n },\n },\n },\n ],\n });\n\n // WHEN\n const result = await new HttpPkiCertificateDataSource(\n config,\n ).fetchCertificate(pkiCertificateInfo);\n\n // THEN\n expect(result).toEqual(\n Left(\n Error(\n \"[ContextModule] HttpPkiCertificateDataSource: Cannot generate payload from fetched PKI Certificate\",\n ),\n ),\n );\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAOA,MAAW,QAClB,OAAS,QAAAC,EAAM,SAAAC,MAAa,YAG5B,OAAS,gCAAAC,MAAoC,0CAC7C,OAAS,YAAAC,MAAgB,uBAGzB,GAAG,KAAK,OAAO,EAEf,SAAS,+BAAgC,IAAM,CAC7C,MAAMC,EAAS,CACb,IAAK,CACH,IAAK,kBACL,KAAM,OACN,OAAQ,MACV,CACF,EAEA,SAAS,mBAAoB,IAAM,CACjC,GAAG,4BAA6B,SAAY,CAE1C,MAAMC,EAAyC,CAC7C,aAAc,eACd,SAAUF,EAAS,SACnB,MAAO,OACT,EACA,GAAG,MAAMJ,EAAO,SAAS,EAAE,kBAAkB,CAC3C,OAAQ,IACR,KAAM,CACJ,CACE,WAAY,CACV,KAAM,WACN,WAAY,CACV,KAAM,UACR,CACF,CACF,CACF,CACF,CAAC,EAGD,MAAMO,EAAS,MAAM,IAAIJ,EACvBE,CACF,EAAE,iBAAiBC,CAAkB,EAGrC,OAAOC,CAAM,EAAE,QACbL,EAAM,CACJ,eAAgB,GAChB,QAAS,IAAI,WAAW,CACtB,EAAM,EAAM,EAAM,EAAM,GAAM,EAAM,EAAM,EAAM,EAAM,CACxD,CAAC,CACH,CAAC,CACH,CACF,CAAC,EAED,GAAG,uDAAwD,SAAY,CAErE,MAAMI,EAAyC,CAC7C,aAAc,eACd,SAAUF,EAAS,SACnB,MAAO,OACT,EACA,GAAG,MAAMJ,EAAO,SAAS,EAAE,kBAAkB,CAC3C,OAAQ,IACR,KAAM,CAAC,CACT,CAAC,EAGD,MAAMO,EAAS,MAAM,IAAIJ,EACvBE,CACF,EAAE,iBAAiBC,CAAkB,EAGrC,OAAOC,CAAM,EAAE,QACbN,EACE,MACE,wFACF,CACF,CACF,CACF,CAAC,EAED,GAAG,kDAAmD,SAAY,CAEhE,MAAMK,EAAyC,CAC7C,aAAc,eACd,SAAUF,EAAS,SACnB,MAAO,OACT,EACA,GAAG,MAAMJ,EAAO,SAAS,EAAE,kBAAkB,IAAI,MAAM,OAAO,CAAC,EAG/D,MAAMO,EAAS,MAAM,IAAIJ,EACvBE,CACF,EAAE,iBAAiBC,CAAkB,EAGrC,OAAOC,CAAM,EAAE,QACbN,EACE,MACE,wFACF,CACF,CACF,CACF,CAAC,EAED,GAAG,0DAA2D,SAAY,CAExE,MAAMK,EAAyC,CAC7C,aAAc,eACd,SAAUF,EAAS,SACnB,MAAO,OACT,EACA,GAAG,MAAMJ,EAAO,SAAS,EAAE,kBAAkB,CAC3C,OAAQ,IACR,KAAM,CACJ,CACE,WAAY,CACV,KAAM,gBACN,WAAY,CACV,KAAM,UACR,CACF,CACF,CACF,CACF,CAAC,EAGD,MAAMO,EAAS,MAAM,IAAIJ,EACvBE,CACF,EAAE,iBAAiBC,CAAkB,EAGrC,OAAOC,CAAM,EAAE,QACbN,EACE,MACE,oGACF,CACF,CACF,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["axios", "Left", "Right", "HttpPkiCertificateDataSource", "KeyUsage", "config", "pkiCertificateInfo", "result"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=PkiCertificateDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=pkiDataSourceTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import{ContainerModule as i}from"inversify";import{HttpPkiCertificateDataSource as e}from"../../pki/data/HttpPkiCertificateDataSource";import{DefaultPkiCertificateLoader as r}from"../../pki/domain/DefaultPkiCertificateLoader";import{pkiTypes as o}from"./pkiTypes";const d=()=>new i((t,a,f,n)=>{t(o.PkiCertificateDataSource).to(e),t(o.PkiCertificateLoader).to(r)});export{d as nanoPkiModuleFactory};
2
+ //# sourceMappingURL=pkiModuleFactory.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/di/pkiModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpPkiCertificateDataSource } from \"@/pki/data/HttpPkiCertificateDataSource\";\nimport { DefaultPkiCertificateLoader } from \"@/pki/domain/DefaultPkiCertificateLoader\";\n\nimport { pkiTypes } from \"./pkiTypes\";\n\nexport const nanoPkiModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(pkiTypes.PkiCertificateDataSource).to(HttpPkiCertificateDataSource);\n bind(pkiTypes.PkiCertificateLoader).to(DefaultPkiCertificateLoader);\n });\n"],
5
+ "mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,gCAAAC,MAAoC,0CAC7C,OAAS,+BAAAC,MAAmC,2CAE5C,OAAS,YAAAC,MAAgB,aAElB,MAAMC,EAAuB,IAClC,IAAIJ,EAAgB,CAACK,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAKF,EAAS,wBAAwB,EAAE,GAAGF,CAA4B,EACvEI,EAAKF,EAAS,oBAAoB,EAAE,GAAGD,CAA2B,CACpE,CAAC",
6
+ "names": ["ContainerModule", "HttpPkiCertificateDataSource", "DefaultPkiCertificateLoader", "pkiTypes", "nanoPkiModuleFactory", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -0,0 +1,2 @@
1
+ const e={PkiCertificateDataSource:Symbol.for("PkiCertificateDataSource"),PkiCertificateLoader:Symbol.for("PkiCertificateLoader")};export{e as pkiTypes};
2
+ //# sourceMappingURL=pkiTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/di/pkiTypes.ts"],
4
+ "sourcesContent": ["export const pkiTypes = {\n PkiCertificateDataSource: Symbol.for(\"PkiCertificateDataSource\"),\n PkiCertificateLoader: Symbol.for(\"PkiCertificateLoader\"),\n};\n"],
5
+ "mappings": "AAAO,MAAMA,EAAW,CACtB,yBAA0B,OAAO,IAAI,0BAA0B,EAC/D,qBAAsB,OAAO,IAAI,sBAAsB,CACzD",
6
+ "names": ["pkiTypes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var m=(a,t,e,r)=>{for(var i=r>1?void 0:r?s(t,e):t,o=a.length-1,f;o>=0;o--)(f=a[o])&&(i=(r?f(t,e,i):f(i))||i);return r&&i&&n(t,e,i),i},p=(a,t)=>(e,r)=>t(e,r,a);import{inject as u,injectable as C}from"inversify";import{pkiTypes as k}from"../../pki/di/pkiTypes";let c=class{_dataSource;constructor(t){this._dataSource=t}async loadCertificate(t){return(await this._dataSource.fetchCertificate(t)).orDefault(void 0)}};c=m([C(),p(0,u(k.PkiCertificateDataSource))],c);export{c as DefaultPkiCertificateLoader};
2
+ //# sourceMappingURL=DefaultPkiCertificateLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/domain/DefaultPkiCertificateLoader.ts"],
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { type PkiCertificateDataSource } from \"@/pki/data/PkiCertificateDataSource\";\nimport { pkiTypes } from \"@/pki/di/pkiTypes\";\nimport { type PkiCertificate } from \"@/pki/model/PkiCertificate\";\nimport { type PkiCertificateInfo } from \"@/pki/model/PkiCertificateInfo\";\n\nimport { PkiCertificateLoader } from \"./PkiCertificateLoader\";\n\n@injectable()\nexport class DefaultPkiCertificateLoader implements PkiCertificateLoader {\n private _dataSource: PkiCertificateDataSource;\n\n constructor(\n @inject(pkiTypes.PkiCertificateDataSource)\n dataSource: PkiCertificateDataSource,\n ) {\n this._dataSource = dataSource;\n }\n\n async loadCertificate(\n certificateInfos: PkiCertificateInfo,\n ): Promise<PkiCertificate | undefined> {\n const certificate =\n await this._dataSource.fetchCertificate(certificateInfos);\n\n return certificate.orDefault(undefined);\n }\n}\n"],
5
+ "mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAGnC,OAAS,YAAAC,MAAgB,oBAOlB,IAAMC,EAAN,KAAkE,CAC/D,YAER,YAEEC,EACA,CACA,KAAK,YAAcA,CACrB,CAEA,MAAM,gBACJC,EACqC,CAIrC,OAFE,MAAM,KAAK,YAAY,iBAAiBA,CAAgB,GAEvC,UAAU,MAAS,CACxC,CACF,EAlBaF,EAANG,EAAA,CADNC,EAAW,EAKPC,EAAA,EAAAC,EAAOC,EAAS,wBAAwB,IAJhCP",
6
+ "names": ["inject", "injectable", "pkiTypes", "DefaultPkiCertificateLoader", "dataSource", "certificateInfos", "__decorateClass", "injectable", "__decorateParam", "inject", "pkiTypes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Right as r}from"purify-ts";import{DefaultPkiCertificateLoader as c}from"../../pki/domain/DefaultPkiCertificateLoader";import{KeyUsage as o}from"../../pki/model/KeyUsage";describe("DefaultPkiCertificateLoader",()=>{describe("loadCertificate",()=>{it("should call loadCertificate",async()=>{const e={targetDevice:"targetDevice",keyUsage:o.Calldata,keyId:"keyId"},t={keyUsageNumber:11,payload:new Uint8Array([1,2,3,4,21,4,5,6,7,8])},a={fetchCertificate:vi.fn().mockResolvedValue(r(t))},i=await new c(a).loadCertificate(e);expect(i).toEqual(t),expect(a.fetchCertificate).toHaveBeenCalledWith(e)})})});
2
+ //# sourceMappingURL=DefaultPkiCertificateLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/domain/DefaultPkiCertificateLoader.test.ts"],
4
+ "sourcesContent": ["import { Right } from \"purify-ts\";\n\nimport { DefaultPkiCertificateLoader } from \"@/pki/domain/DefaultPkiCertificateLoader\";\nimport { KeyUsage } from \"@/pki/model/KeyUsage\";\nimport { type PkiCertificateInfo } from \"@/pki/model/PkiCertificateInfo\";\n\ndescribe(\"DefaultPkiCertificateLoader\", () => {\n describe(\"loadCertificate\", () => {\n it(\"should call loadCertificate\", async () => {\n // GIVEN\n const certificateInfos: PkiCertificateInfo = {\n targetDevice: \"targetDevice\",\n keyUsage: KeyUsage.Calldata,\n keyId: \"keyId\",\n };\n const certificate = {\n keyUsageNumber: 11,\n payload: new Uint8Array([\n 0x01, 0x02, 0x03, 0x04, 0x15, 0x04, 0x05, 0x06, 0x07, 0x08,\n ]),\n };\n const dataSource = {\n fetchCertificate: vi.fn().mockResolvedValue(Right(certificate)),\n };\n\n // WHEN\n const loader = new DefaultPkiCertificateLoader(dataSource);\n const result = await loader.loadCertificate(certificateInfos);\n\n // THEN\n expect(result).toEqual(certificate);\n expect(dataSource.fetchCertificate).toHaveBeenCalledWith(\n certificateInfos,\n );\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,SAAAA,MAAa,YAEtB,OAAS,+BAAAC,MAAmC,2CAC5C,OAAS,YAAAC,MAAgB,uBAGzB,SAAS,8BAA+B,IAAM,CAC5C,SAAS,kBAAmB,IAAM,CAChC,GAAG,8BAA+B,SAAY,CAE5C,MAAMC,EAAuC,CAC3C,aAAc,eACd,SAAUD,EAAS,SACnB,MAAO,OACT,EACME,EAAc,CAClB,eAAgB,GAChB,QAAS,IAAI,WAAW,CACtB,EAAM,EAAM,EAAM,EAAM,GAAM,EAAM,EAAM,EAAM,EAAM,CACxD,CAAC,CACH,EACMC,EAAa,CACjB,iBAAkB,GAAG,GAAG,EAAE,kBAAkBL,EAAMI,CAAW,CAAC,CAChE,EAIME,EAAS,MADA,IAAIL,EAA4BI,CAAU,EAC7B,gBAAgBF,CAAgB,EAG5D,OAAOG,CAAM,EAAE,QAAQF,CAAW,EAClC,OAAOC,EAAW,gBAAgB,EAAE,qBAClCF,CACF,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["Right", "DefaultPkiCertificateLoader", "KeyUsage", "certificateInfos", "certificate", "dataSource", "result"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=PkiCertificateLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ var t=(a=>(a.Test="test",a.PersoV2="persov2",a.LedgerRootV3="ledger_root_v3",a.PluginSelectorKey="plugin_selector_key",a.NftMetadataKey="nft_metadata_key",a.PartnerMetadataKey="partner_metadata_key",a.Erc20MetadataKey="erc20_metadata_key",a.DomainMetadataKey="domain_metadata_key",a.CalCalldataKey="cal_calldata_key",a.CalTrustedNameKey="cal_trusted_name_key",a.CalNetwork="cal_network",a))(t||{});export{t as KeyId};
2
+ //# sourceMappingURL=KeyId.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/model/KeyId.ts"],
4
+ "sourcesContent": ["export enum KeyId {\n Test = \"test\",\n PersoV2 = \"persov2\",\n LedgerRootV3 = \"ledger_root_v3\",\n PluginSelectorKey = \"plugin_selector_key\",\n NftMetadataKey = \"nft_metadata_key\",\n PartnerMetadataKey = \"partner_metadata_key\",\n Erc20MetadataKey = \"erc20_metadata_key\",\n DomainMetadataKey = \"domain_metadata_key\",\n CalCalldataKey = \"cal_calldata_key\",\n CalTrustedNameKey = \"cal_trusted_name_key\",\n CalNetwork = \"cal_network\",\n}\n"],
5
+ "mappings": "AAAO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,aAAe,iBACfA,EAAA,kBAAoB,sBACpBA,EAAA,eAAiB,mBACjBA,EAAA,mBAAqB,uBACrBA,EAAA,iBAAmB,qBACnBA,EAAA,kBAAoB,sBACpBA,EAAA,eAAiB,mBACjBA,EAAA,kBAAoB,uBACpBA,EAAA,WAAa,cAXHA,OAAA",
6
+ "names": ["KeyId"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var r=(t=>(t.GenuineCheck="genuine_check",t.ExchangePayload="exchange_payload",t.NftMeta="nft_meta",t.TrustedName="trusted_name",t.BackupProvider="backup_provider",t.ProtectOrchestrator="protect_orchestrator",t.PluginMeta="plugin_meta",t.CoinMeta="coin_meta",t.SeedIdAuth="seed_id_auth",t.TxSimulationSigner="tx_simu_signer",t.Calldata="calldata",t.Network="network",t))(r||{});export{r as KeyUsage};
2
+ //# sourceMappingURL=KeyUsage.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/model/KeyUsage.ts"],
4
+ "sourcesContent": ["export enum KeyUsage {\n GenuineCheck = \"genuine_check\",\n ExchangePayload = \"exchange_payload\",\n NftMeta = \"nft_meta\",\n TrustedName = \"trusted_name\",\n BackupProvider = \"backup_provider\",\n ProtectOrchestrator = \"protect_orchestrator\",\n PluginMeta = \"plugin_meta\",\n CoinMeta = \"coin_meta\",\n SeedIdAuth = \"seed_id_auth\",\n TxSimulationSigner = \"tx_simu_signer\",\n Calldata = \"calldata\",\n Network = \"network\",\n}\n"],
5
+ "mappings": "AAAO,IAAKA,OACVA,EAAA,aAAe,gBACfA,EAAA,gBAAkB,mBAClBA,EAAA,QAAU,WACVA,EAAA,YAAc,eACdA,EAAA,eAAiB,kBACjBA,EAAA,oBAAsB,uBACtBA,EAAA,WAAa,cACbA,EAAA,SAAW,YACXA,EAAA,WAAa,eACbA,EAAA,mBAAqB,iBACrBA,EAAA,SAAW,WACXA,EAAA,QAAU,UAZAA,OAAA",
6
+ "names": ["KeyUsage"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=PkiCertificate.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=PkiCertificateInfo.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=ContextLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ var t=(e=>(e.TOKEN="token",e.NFT="nft",e.TRUSTED_NAME="trustedName",e.PLUGIN="plugin",e.EXTERNAL_PLUGIN="externalPlugin",e.TRANSACTION_INFO="transactionInfo",e.ENUM="enum",e.TRANSACTION_FIELD_DESCRIPTION="transactionFieldDescription",e.ERROR="error",e))(t||{});export{t as ClearSignContextType};
2
+ //# sourceMappingURL=ClearSignContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/ClearSignContext.ts"],
4
+ "sourcesContent": ["import { type PkiCertificate } from \"@/pki/model/PkiCertificate\";\n\nimport { type GenericPath } from \"./GenericPath\";\n\nexport enum ClearSignContextType {\n TOKEN = \"token\",\n NFT = \"nft\",\n TRUSTED_NAME = \"trustedName\",\n PLUGIN = \"plugin\",\n EXTERNAL_PLUGIN = \"externalPlugin\",\n TRANSACTION_INFO = \"transactionInfo\",\n ENUM = \"enum\",\n TRANSACTION_FIELD_DESCRIPTION = \"transactionFieldDescription\",\n ERROR = \"error\",\n}\n\nexport type ClearSignContextReferenceType =\n | ClearSignContextType.TOKEN\n | ClearSignContextType.NFT\n | ClearSignContextType.ENUM\n | ClearSignContextType.TRUSTED_NAME;\n\nexport type ClearSignContextReference<\n Type extends ClearSignContextReferenceType = ClearSignContextReferenceType,\n> = Type extends ClearSignContextType.ENUM\n ? {\n type: ClearSignContextType.ENUM;\n valuePath: GenericPath;\n id: number; // enum id to reference\n }\n : Type extends ClearSignContextType.TRUSTED_NAME\n ? {\n type: ClearSignContextType.TRUSTED_NAME;\n valuePath: GenericPath;\n types: string[];\n sources: string[];\n }\n :\n | {\n type: Type;\n valuePath: GenericPath;\n value?: never;\n }\n | {\n type: Type;\n valuePath?: never;\n value: string;\n };\n\nexport type ClearSignContextSuccessType = Exclude<\n ClearSignContextType,\n ClearSignContextType.ERROR\n>;\n\n// NOTE: this is a union of all possible success types\n// There is currently two types of success:\n// - ENUM: which is a special case, we need to handle it differently\n// because we don't want to send the whole enum\n// but only the parts that are needed.\n// - id: the enum id to reference\n// - payload: the payload to send with a provideEnum command\n// - name: the name of the enum to be displayed on the device\n// - value: the value of the enum to be retrieved from the transaction\n// - All other types\n// - payload: the payload to send with a provide command\n// - reference: the reference to the value to be retrieved from the transaction\nexport type ClearSignContextSuccess<\n Type extends ClearSignContextSuccessType = ClearSignContextSuccessType,\n> = Type extends ClearSignContextType.ENUM\n ? {\n type: ClearSignContextType.ENUM;\n id: number;\n payload: string;\n value: number;\n certificate?: PkiCertificate;\n }\n : {\n type: Exclude<\n ClearSignContextType,\n ClearSignContextType.ENUM | ClearSignContextType.ERROR\n >;\n payload: string;\n reference?: ClearSignContextReference;\n certificate?: PkiCertificate;\n };\n\nexport type ClearSignContextError = {\n type: ClearSignContextType.ERROR;\n error: Error;\n};\n\nexport type ClearSignContext = ClearSignContextSuccess | ClearSignContextError;\n"],
5
+ "mappings": "AAIO,IAAKA,OACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,aAAe,cACfA,EAAA,OAAS,SACTA,EAAA,gBAAkB,iBAClBA,EAAA,iBAAmB,kBACnBA,EAAA,KAAO,OACPA,EAAA,8BAAgC,8BAChCA,EAAA,MAAQ,QATEA,OAAA",
6
+ "names": ["ClearSignContextType"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var E=(a=>(a.FROM="FROM",a.TO="TO",a.VALUE="VALUE",a))(E||{}),r=(e=>(e.TUPLE="TUPLE",e.ARRAY="ARRAY",e.REF="REF",e.LEAF="LEAF",e.SLICE="SLICE",e))(r||{}),A=(t=>(t.STATIC_LEAF="STATIC_LEAF",t.DYNAMIC_LEAF="DYNAMIC_LEAF",t.TUPLE_LEAF="TUPLE_LEAF",t.ARRAY_LEAF="ARRAY_LEAF",t))(A||{});export{E as ContainerPath,r as DataPathElementType,A as DataPathLeafType};
2
+ //# sourceMappingURL=GenericPath.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/GenericPath.ts"],
4
+ "sourcesContent": ["/**\n * Generic binary paths are a way to to navigate in any kind of structured binary data such as:\n * - transactions\n * - typed messages (EIP-712)\n * - meta transactions (EIP-2771)\n * - user operations (EIP-4337)\n * - ...\n * We follow here the concepts defined in the clear signing standard:\n * https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/specs/erc-7730.md#structured-data\n *\n * - The container is the structure to be signed, for instance a transaction\n * - The structured data is the data we want to navigate in, for instance a transaction calldata\n *\n * A generic path is either a field of the container, or a path in the structured data.\n * Those path will also be handled by the devices:\n * https://github.com/LedgerHQ/generic_parser/blob/master/specs.md#path_element\n */\n\n// A generic path is either a path in the container, or a path in its data.\n// Path in the data is a list of steps to apply\nexport type GenericPath = ContainerPathValues | DataPathElement[];\n\n// Path in the container is only a finite list of known attributes\nexport enum ContainerPath {\n FROM = \"FROM\",\n TO = \"TO\",\n VALUE = \"VALUE\",\n}\nexport type ContainerPathValues = keyof typeof ContainerPath;\n\n/**\n * A path in binary data will be composed of:\n * - any number of steps of which:\n * - Tuple: a set of elements which size if known\n * - Array: an array of elements with dynamic size\n * - Reference: a pointer to dereference\n * - one leaf at the end to indicate the returned element type\n * - static leaf: 1 fixed-size chunk is returned\n * - dynamic leaf: element of variable size is returned\n * - optionally a slice element, only allowed after the leaf, to slice the result\n *\n * An example for a transaction with that ethereum smart contract:\n * function requestWithdrawalsWithPermit(uint256[] _amounts, address _owner, (uint256,uint256,uint8,bytes32,bytes32) _permit)\n * In that case:\n * - _amounts is an array\n * - _permit is a tuple\n * We could have a tuple in an array, or an array in a tuple, in which case we would have several steps in the binary path.\n */\nexport type DataPathElement =\n | DataPathElementTuple\n | DataPathElementArray\n | DataPathElementRef\n | DataPathElementLeaf\n | DataPathElementSlice;\nexport enum DataPathElementType {\n TUPLE = \"TUPLE\",\n ARRAY = \"ARRAY\",\n REF = \"REF\",\n LEAF = \"LEAF\",\n SLICE = \"SLICE\",\n}\nexport type DataPathElementTypeValues = keyof typeof DataPathElementType;\n\n/**\n * Path element to navigate in a tuple.\n * - offset: the item of the tuple to select\n */\nexport interface DataPathElementTuple {\n type: \"TUPLE\";\n offset: number;\n}\n\n/**\n * Path element to navigate in an array of variable size.\n * - itemSize: the length of each item in that array (not the number of items which is variable).\n * - start: the start of the array slice to iterate on. If unset, start from the beginning of that array.\n * - end: the end of the array slice to iterate on (exclusive). If unset, iterate until the end of that array.\n */\nexport interface DataPathElementArray {\n type: \"ARRAY\";\n itemSize: number;\n start?: number;\n end?: number;\n}\n\n// Path element to indicate the current item should be de-referenced (its value contains a pointer).\nexport interface DataPathElementRef {\n type: \"REF\";\n}\n\n/**\n * Path element to represent the leaf of the path, to be returned.\n * It is mandatory, and only allowed at the end of the path.\n * It indicates the type of data to return:\n * - Static leaf: data of static size, typically 1 chunk\n * - Dynamic leaf: data of dynamic size, typically length+data\n * - Tuple leaf: returned data is a tuple (a set of a static number of elements)\n * - Array leaf: returned data is an array (dynamic number of elements)\n */\nexport interface DataPathElementLeaf {\n type: \"LEAF\";\n leafType: DataPathLeafTypeValues;\n}\nexport enum DataPathLeafType {\n STATIC_LEAF = \"STATIC_LEAF\",\n DYNAMIC_LEAF = \"DYNAMIC_LEAF\",\n TUPLE_LEAF = \"TUPLE_LEAF\",\n ARRAY_LEAF = \"ARRAY_LEAF\",\n}\nexport type DataPathLeafTypeValues = keyof typeof DataPathLeafType;\n\n/**\n * Path element to represent a slice.\n * It is optional and only allowed at the end of a path, after the leaf.\n * It means the leaf shall be sliced before being returned.\n */\nexport interface DataPathElementSlice {\n type: \"SLICE\";\n start?: number;\n end?: number;\n}\n"],
5
+ "mappings": "AAuBO,IAAKA,OACVA,EAAA,KAAO,OACPA,EAAA,GAAK,KACLA,EAAA,MAAQ,QAHEA,OAAA,IA+BAC,OACVA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,MAAQ,QALEA,OAAA,IAiDAC,OACVA,EAAA,YAAc,cACdA,EAAA,aAAe,eACfA,EAAA,WAAa,aACbA,EAAA,WAAa,aAJHA,OAAA",
6
+ "names": ["ContainerPath", "DataPathElementType", "DataPathLeafType"]
7
+ }
@@ -0,0 +1,2 @@
1
+ const o="15",t="81ff";export{t as INFO_SIGNATURE_TAG,o as SIGNATURE_TAG};
2
+ //# sourceMappingURL=SignatureTags.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/SignatureTags.ts"],
4
+ "sourcesContent": ["export const SIGNATURE_TAG = \"15\";\nexport const INFO_SIGNATURE_TAG = \"81ff\";\n"],
5
+ "mappings": "AAAO,MAAMA,EAAgB,KAChBC,EAAqB",
6
+ "names": ["SIGNATURE_TAG", "INFO_SIGNATURE_TAG"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=TransactionContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=TransactionSubset.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ const e=255;export{e as VERIFYING_CONTRACT_TOKEN_INDEX};
2
+ //# sourceMappingURL=TypedDataClearSignContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TypedDataClearSignContext.ts"],
4
+ "sourcesContent": ["// The general informations for a typed message\nexport type TypedDataMessageInfo = {\n displayName: string;\n filtersCount: number;\n signature: string;\n};\n\n// Token index and descriptor. Needed for tokens that are referenced by a typed message\nexport type TypedDataTokenIndex = number;\nexport type TypedDataToken = string;\n// Special token index value when the referenced token is the verifying contract\nexport const VERIFYING_CONTRACT_TOKEN_INDEX = 255;\n\n// Typed message filters, to select fields to display, and provide formatting informations\nexport type TypedDataFilterPath = string;\nexport type TypedDataFilter =\n | {\n type: \"datetime\" | \"raw\";\n displayName: string;\n path: TypedDataFilterPath;\n signature: string;\n }\n | {\n type: \"amount\" | \"token\";\n displayName: string;\n tokenIndex: TypedDataTokenIndex;\n path: TypedDataFilterPath;\n signature: string;\n };\n\n// Clear signing context for a typed message\nexport type TypedDataClearSignContextSuccess = {\n type: \"success\";\n messageInfo: TypedDataMessageInfo;\n filters: Record<TypedDataFilterPath, TypedDataFilter>;\n tokens: Record<TypedDataTokenIndex, TypedDataToken>;\n};\nexport type TypedDataClearSignContextError = {\n type: \"error\";\n error: Error;\n};\nexport type TypedDataClearSignContext =\n | TypedDataClearSignContextSuccess\n | TypedDataClearSignContextError;\n"],
5
+ "mappings": "AAWO,MAAMA,EAAiC",
6
+ "names": ["VERIFYING_CONTRACT_TOKEN_INDEX"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=TypedDataContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ class g{static stringToHex(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r).toString(16);t+=n.padStart(2,"0")}return t}static appendSignatureToPayload(e,t,r){t.length%2!==0&&(t="0"+t);let n=(t.length/2).toString(16);return n.length%2!==0&&(n="0"+n),`${e}${r}${n}${t}`}}export{g as HexStringUtils};
2
+ //# sourceMappingURL=HexStringUtils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/HexStringUtils.ts"],
4
+ "sourcesContent": ["export class HexStringUtils {\n static stringToHex(str: string): string {\n let hexString = \"\";\n for (let i = 0; i < str.length; i++) {\n const hex = str.charCodeAt(i).toString(16);\n hexString += hex.padStart(2, \"0\"); // Ensure each hex code is at least 2 characters long\n }\n return hexString;\n }\n\n static appendSignatureToPayload(\n payload: string,\n signature: string,\n tag: string,\n ): string {\n // Ensure correct padding\n if (signature.length % 2 !== 0) {\n signature = \"0\" + signature;\n }\n // TLV encoding as according to trusted name documentation\n let signatureLength = (signature.length / 2).toString(16);\n if (signatureLength.length % 2 !== 0) {\n signatureLength = \"0\" + signatureLength;\n }\n\n return `${payload}${tag}${signatureLength}${signature}`;\n }\n}\n"],
5
+ "mappings": "AAAO,MAAMA,CAAe,CAC1B,OAAO,YAAYC,EAAqB,CACtC,IAAIC,EAAY,GAChB,QAASC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,IAAK,CACnC,MAAMC,EAAMH,EAAI,WAAWE,CAAC,EAAE,SAAS,EAAE,EACzCD,GAAaE,EAAI,SAAS,EAAG,GAAG,CAClC,CACA,OAAOF,CACT,CAEA,OAAO,yBACLG,EACAC,EACAC,EACQ,CAEJD,EAAU,OAAS,IAAM,IAC3BA,EAAY,IAAMA,GAGpB,IAAIE,GAAmBF,EAAU,OAAS,GAAG,SAAS,EAAE,EACxD,OAAIE,EAAgB,OAAS,IAAM,IACjCA,EAAkB,IAAMA,GAGnB,GAAGH,CAAO,GAAGE,CAAG,GAAGC,CAAe,GAAGF,CAAS,EACvD,CACF",
6
+ "names": ["HexStringUtils", "str", "hexString", "i", "hex", "payload", "signature", "tag", "signatureLength"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{HexStringUtils as e}from"../../shared/utils/HexStringUtils";describe("HexStringUtils",()=>{describe("appendSignatureToPayload",()=>{it("should append signature to payload",()=>{const s=e.appendSignatureToPayload("01020304","05060708","15");expect(s).toEqual("01020304150405060708")}),it("should append signature to payload with odd length",()=>{const s=e.appendSignatureToPayload("01020304","5060708","15");expect(s).toEqual("01020304150405060708")})}),describe("stringToHex",()=>{it("should convert string to hex",()=>{const t=e.stringToHex("test");expect(t).toEqual("74657374")}),it("should convert string to hex with odd length",()=>{const t=e.stringToHex("test1");expect(t).toEqual("7465737431")})})});
2
+ //# sourceMappingURL=HexStringUtils.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/HexStringUtils.test.ts"],
4
+ "sourcesContent": ["import { HexStringUtils } from \"@/shared/utils/HexStringUtils\";\n\ndescribe(\"HexStringUtils\", () => {\n describe(\"appendSignatureToPayload\", () => {\n it(\"should append signature to payload\", () => {\n // GIVEN\n const payload = \"01020304\";\n const signature = \"05060708\";\n const tag = \"15\";\n // WHEN\n const result = HexStringUtils.appendSignatureToPayload(\n payload,\n signature,\n tag,\n );\n // THEN\n expect(result).toEqual(\"01020304150405060708\");\n });\n\n it(\"should append signature to payload with odd length\", () => {\n // GIVEN\n const payload = \"01020304\";\n const signature = \"5060708\";\n const tag = \"15\";\n // WHEN\n const result = HexStringUtils.appendSignatureToPayload(\n payload,\n signature,\n tag,\n );\n // THEN\n expect(result).toEqual(\"01020304150405060708\");\n });\n });\n\n describe(\"stringToHex\", () => {\n it(\"should convert string to hex\", () => {\n // GIVEN\n const str = \"test\";\n // WHEN\n const result = HexStringUtils.stringToHex(str);\n // THEN\n expect(result).toEqual(\"74657374\");\n });\n\n it(\"should convert string to hex with odd length\", () => {\n // GIVEN\n const str = \"test1\";\n // WHEN\n const result = HexStringUtils.stringToHex(str);\n // THEN\n expect(result).toEqual(\"7465737431\");\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,kBAAAA,MAAsB,gCAE/B,SAAS,iBAAkB,IAAM,CAC/B,SAAS,2BAA4B,IAAM,CACzC,GAAG,qCAAsC,IAAM,CAM7C,MAAMC,EAASD,EAAe,yBAJd,WACE,WACN,IAMZ,EAEA,OAAOC,CAAM,EAAE,QAAQ,sBAAsB,CAC/C,CAAC,EAED,GAAG,qDAAsD,IAAM,CAM7D,MAAMA,EAASD,EAAe,yBAJd,WACE,UACN,IAMZ,EAEA,OAAOC,CAAM,EAAE,QAAQ,sBAAsB,CAC/C,CAAC,CACH,CAAC,EAED,SAAS,cAAe,IAAM,CAC5B,GAAG,+BAAgC,IAAM,CAIvC,MAAMA,EAASD,EAAe,YAFlB,MAEiC,EAE7C,OAAOC,CAAM,EAAE,QAAQ,UAAU,CACnC,CAAC,EAED,GAAG,+CAAgD,IAAM,CAIvD,MAAMA,EAASD,EAAe,YAFlB,OAEiC,EAE7C,OAAOC,CAAM,EAAE,QAAQ,YAAY,CACrC,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["HexStringUtils", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{KeyUsage as e}from"../../pki/model/KeyUsage";class s{static keyUsageMap=new Map([[e.GenuineCheck,1],[e.ExchangePayload,2],[e.NftMeta,3],[e.TrustedName,4],[e.BackupProvider,5],[e.ProtectOrchestrator,6],[e.PluginMeta,7],[e.CoinMeta,8],[e.SeedIdAuth,9],[e.TxSimulationSigner,10],[e.Calldata,11],[e.Network,12]]);static mapKeyUsageForFirmware(a){return this.keyUsageMap.get(a)??-1}}export{s as KeyUsageMapper};
2
+ //# sourceMappingURL=KeyUsageMapper.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/KeyUsageMapper.ts"],
4
+ "sourcesContent": ["import { KeyUsage } from \"@/pki/model/KeyUsage\";\n\nexport class KeyUsageMapper {\n private static keyUsageMap = new Map<KeyUsage, number>([\n [KeyUsage.GenuineCheck, 1],\n [KeyUsage.ExchangePayload, 2],\n [KeyUsage.NftMeta, 3],\n [KeyUsage.TrustedName, 4],\n [KeyUsage.BackupProvider, 5],\n [KeyUsage.ProtectOrchestrator, 6],\n [KeyUsage.PluginMeta, 7],\n [KeyUsage.CoinMeta, 8],\n [KeyUsage.SeedIdAuth, 9],\n [KeyUsage.TxSimulationSigner, 10],\n [KeyUsage.Calldata, 11],\n [KeyUsage.Network, 12],\n ]);\n\n static mapKeyUsageForFirmware(keyUsage: KeyUsage): number {\n return this.keyUsageMap.get(keyUsage as KeyUsage) ?? -1;\n }\n}\n"],
5
+ "mappings": "AAAA,OAAS,YAAAA,MAAgB,uBAElB,MAAMC,CAAe,CAC1B,OAAe,YAAc,IAAI,IAAsB,CACrD,CAACD,EAAS,aAAc,CAAC,EACzB,CAACA,EAAS,gBAAiB,CAAC,EAC5B,CAACA,EAAS,QAAS,CAAC,EACpB,CAACA,EAAS,YAAa,CAAC,EACxB,CAACA,EAAS,eAAgB,CAAC,EAC3B,CAACA,EAAS,oBAAqB,CAAC,EAChC,CAACA,EAAS,WAAY,CAAC,EACvB,CAACA,EAAS,SAAU,CAAC,EACrB,CAACA,EAAS,WAAY,CAAC,EACvB,CAACA,EAAS,mBAAoB,EAAE,EAChC,CAACA,EAAS,SAAU,EAAE,EACtB,CAACA,EAAS,QAAS,EAAE,CACvB,CAAC,EAED,OAAO,uBAAuBE,EAA4B,CACxD,OAAO,KAAK,YAAY,IAAIA,CAAoB,GAAK,EACvD,CACF",
6
+ "names": ["KeyUsage", "KeyUsageMapper", "keyUsage"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{KeyUsage as e}from"../../pki/model/KeyUsage";import{KeyUsageMapper as r}from"../../shared/utils/KeyUsageMapper";describe("KeyUsageMapper",()=>{describe("mapKeyUsageForFirmware",()=>{it.each([[e.GenuineCheck,1],[e.ExchangePayload,2],[e.NftMeta,3],[e.TrustedName,4],[e.BackupProvider,5],[e.ProtectOrchestrator,6],[e.PluginMeta,7],[e.CoinMeta,8],[e.SeedIdAuth,9],[e.TxSimulationSigner,10],[e.Calldata,11],[e.Network,12]])("should map key usage %s to %i",(a,t)=>{const o=r.mapKeyUsageForFirmware(a);expect(o).toEqual(t)}),it("should return -1 when key usage is not found",()=>{const a=r.mapKeyUsageForFirmware("unknown");expect(a).toEqual(-1)})})});
2
+ //# sourceMappingURL=KeyUsageMapper.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/KeyUsageMapper.test.ts"],
4
+ "sourcesContent": ["import { KeyUsage } from \"@/pki/model/KeyUsage\";\nimport { KeyUsageMapper } from \"@/shared/utils/KeyUsageMapper\";\n\ndescribe(\"KeyUsageMapper\", () => {\n describe(\"mapKeyUsageForFirmware\", () => {\n it.each([\n [KeyUsage.GenuineCheck, 1],\n [KeyUsage.ExchangePayload, 2],\n [KeyUsage.NftMeta, 3],\n [KeyUsage.TrustedName, 4],\n [KeyUsage.BackupProvider, 5],\n [KeyUsage.ProtectOrchestrator, 6],\n [KeyUsage.PluginMeta, 7],\n [KeyUsage.CoinMeta, 8],\n [KeyUsage.SeedIdAuth, 9],\n [KeyUsage.TxSimulationSigner, 10],\n [KeyUsage.Calldata, 11],\n [KeyUsage.Network, 12],\n ])(`should map key usage %s to %i`, (keyUsage, expected) => {\n // WHEN\n const result = KeyUsageMapper.mapKeyUsageForFirmware(keyUsage);\n\n // THEN\n expect(result).toEqual(expected);\n });\n\n it(\"should return -1 when key usage is not found\", () => {\n // WHEN\n const result = KeyUsageMapper.mapKeyUsageForFirmware(\n \"unknown\" as KeyUsage,\n );\n\n // THEN\n expect(result).toEqual(-1);\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,YAAAA,MAAgB,uBACzB,OAAS,kBAAAC,MAAsB,gCAE/B,SAAS,iBAAkB,IAAM,CAC/B,SAAS,yBAA0B,IAAM,CACvC,GAAG,KAAK,CACN,CAACD,EAAS,aAAc,CAAC,EACzB,CAACA,EAAS,gBAAiB,CAAC,EAC5B,CAACA,EAAS,QAAS,CAAC,EACpB,CAACA,EAAS,YAAa,CAAC,EACxB,CAACA,EAAS,eAAgB,CAAC,EAC3B,CAACA,EAAS,oBAAqB,CAAC,EAChC,CAACA,EAAS,WAAY,CAAC,EACvB,CAACA,EAAS,SAAU,CAAC,EACrB,CAACA,EAAS,WAAY,CAAC,EACvB,CAACA,EAAS,mBAAoB,EAAE,EAChC,CAACA,EAAS,SAAU,EAAE,EACtB,CAACA,EAAS,QAAS,EAAE,CACvB,CAAC,EAAE,gCAAiC,CAACE,EAAUC,IAAa,CAE1D,MAAMC,EAASH,EAAe,uBAAuBC,CAAQ,EAG7D,OAAOE,CAAM,EAAE,QAAQD,CAAQ,CACjC,CAAC,EAED,GAAG,+CAAgD,IAAM,CAEvD,MAAMC,EAASH,EAAe,uBAC5B,SACF,EAGA,OAAOG,CAAM,EAAE,QAAQ,EAAE,CAC3B,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["KeyUsage", "KeyUsageMapper", "keyUsage", "expected", "result"]
7
+ }