@ledgerhq/context-module 0.0.0-develop-20241017000946 → 0.0.0-rn-hid-20250221112139

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../index.ts", "../../src/external-plugin/di/externalPluginTypes.ts", "../../src/forward-domain/di/forwardDomainTypes.ts", "../../src/nft/di/nftTypes.ts", "../../src/token/di/tokenTypes.ts", "../../src/typed-data/di/typedDataTypes.ts", "../../src/DefaultContextModule.ts", "../../src/di.ts", "../../src/config/di/configModuleFactory.ts", "../../src/config/di/configTypes.ts", "../../src/external-plugin/di/externalPluginModuleFactory.ts", "../../src/external-plugin/data/HttpExternalPluginDataSource.ts", "../../package.json", "../../src/external-plugin/domain/ExternalPluginContextLoader.ts", "../../src/shared/model/ClearSignContext.ts", "../../src/forward-domain/di/forwardDomainModuleFactory.ts", "../../src/forward-domain/data/HttpForwardDomainDataSource.ts", "../../src/forward-domain/domain/ForwardDomainContextLoader.ts", "../../src/nft/di/nftModuleFactory.ts", "../../src/nft/data/HttpNftDataSource.ts", "../../src/nft/domain/NftContextLoader.ts", "../../src/token/di/tokenModuleFactory.ts", "../../src/token/data/HttpTokenDataSource.ts", "../../src/token/domain/TokenContextLoader.ts", "../../src/typed-data/di/typedDataModuleFactory.ts", "../../src/typed-data/data/HttpTypedDataDataSource.ts", "../../src/typed-data/domain/DefaultTypedDataContextLoader.ts", "../../src/shared/model/TypedDataClearSignContext.ts", "../../src/ContextModuleBuilder.ts"],
4
- "sourcesContent": ["// inversify requirement\nimport \"reflect-metadata\";\n\nexport * from \"./src/index\";\n", "export const externalPluginTypes = {\n ExternalPluginDataSource: Symbol.for(\"externalPluginDataSource\"),\n ExternalPluginContextLoader: Symbol.for(\"externalPluginContextLoader\"),\n};\n", "export const forwardDomainTypes = {\n ForwardDomainDataSource: Symbol.for(\"forwardDomainDataSource\"),\n ForwardDomainContextLoader: Symbol.for(\"forwardDomainContextLoader\"),\n};\n", "export const nftTypes = {\n NftDataSource: Symbol.for(\"nftDataSource\"),\n NftContextLoader: Symbol.for(\"nftContextLoader\"),\n};\n", "export const tokenTypes = {\n TokenDataSource: Symbol.for(\"TokenDataSource\"),\n TokenContextLoader: Symbol.for(\"TokenContextLoader\"),\n};\n", "export const typedDataTypes = {\n TypedDataDataSource: Symbol.for(\"TypedDataDataSource\"),\n TypedDataContextLoader: Symbol.for(\"TypedDataContextLoader\"),\n};\n", "import type { TypedDataClearSignContext } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\n\nimport { ContextLoader } from \"./shared/domain/ContextLoader\";\nimport { ClearSignContext } from \"./shared/model/ClearSignContext\";\nimport { TransactionContext } from \"./shared/model/TransactionContext\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { ContextModule } from \"./ContextModule\";\n\ntype DefaultContextModuleConstructorArgs = {\n loaders: ContextLoader[];\n typedDataLoader: TypedDataContextLoader;\n};\n\nexport class DefaultContextModule implements ContextModule {\n private _loaders: ContextLoader[];\n private _typedDataLoader: TypedDataContextLoader;\n\n constructor(args: DefaultContextModuleConstructorArgs) {\n this._loaders = args.loaders;\n this._typedDataLoader = args.typedDataLoader;\n }\n\n public async getContexts(\n transaction: TransactionContext,\n ): Promise<ClearSignContext[]> {\n const promises = this._loaders.map((fetcher) => fetcher.load(transaction));\n const responses = await Promise.all(promises);\n return responses.flat();\n }\n\n public async getTypedDataFilters(\n typedData: TypedDataContext,\n ): Promise<TypedDataClearSignContext> {\n return this._typedDataLoader.load(typedData);\n }\n}\n", "import { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { forwardDomainModuleFactory } from \"@/forward-domain/di/forwardDomainModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container.load(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n forwardDomainModuleFactory(),\n nftModuleFactory(),\n tokenModuleFactory(),\n typedDataModuleFactory(),\n );\n\n return container;\n};\n", "import { ContainerModule } from \"inversify\";\n\nimport { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\n\nimport { configTypes } from \"./configTypes\";\n\nexport const configModuleFactory = (config: ContextModuleConfig) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind<ContextModuleConfig>(configTypes.Config).toConstantValue(config);\n });\n", "export const configTypes = {\n Config: Symbol.for(\"config\"),\n};\n", "import { ContainerModule } from \"inversify\";\n\nimport { HttpExternalPluginDataSource } from \"@/external-plugin/data/HttpExternalPluginDataSource\";\nimport { externalPluginTypes } from \"@/external-plugin/di/externalPluginTypes\";\nimport { ExternalPluginContextLoader } from \"@/external-plugin/domain/ExternalPluginContextLoader\";\n\nexport const externalPluginModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(externalPluginTypes.ExternalPluginDataSource).to(\n HttpExternalPluginDataSource,\n );\n bind(externalPluginTypes.ExternalPluginContextLoader).to(\n ExternalPluginContextLoader,\n );\n });\n", "import axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { DAppDto } from \"@/external-plugin/data/DAppDto\";\nimport {\n ExternalPluginDataSource,\n GetDappInfos,\n} from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { DappInfos } from \"@/external-plugin/model/DappInfos\";\nimport { SelectorDetails } from \"@/external-plugin/model/SelectorDetails\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpExternalPluginDataSource implements ExternalPluginDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n async getDappInfos({\n chainId,\n address,\n selector,\n }: GetDappInfos): Promise<Either<Error, DappInfos | undefined>> {\n try {\n const dappInfos = await axios.request<DAppDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/dapps`,\n params: {\n output: \"b2c,b2c_signatures,abis\",\n chain_id: chainId,\n contracts: address,\n },\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n if (!dappInfos.data[0]) {\n return Right(undefined);\n }\n\n // Normalize the address and selector\n address = address.toLowerCase();\n selector = `0x${selector.slice(2).toLowerCase()}`;\n\n const { erc20OfInterest, method, plugin } =\n dappInfos.data[0].b2c?.contracts?.find((c) => c.address === address)\n ?.selectors?.[selector] || {};\n const { signature, serialized_data: serializedData } =\n dappInfos.data[0].b2c_signatures?.[address]?.[selector] || {};\n\n if (\n !erc20OfInterest ||\n !method ||\n !plugin ||\n !signature ||\n !serializedData\n ) {\n return Right(undefined);\n }\n\n const abi = dappInfos.data[0].abis?.[address];\n\n if (!abi) {\n return Right(undefined);\n }\n\n const selectorDetails: SelectorDetails = {\n method,\n plugin,\n erc20OfInterest,\n signature,\n serializedData,\n };\n\n return Right({ selectorDetails, abi });\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos\",\n ),\n );\n }\n }\n}\n", "{\n \"name\": \"@ledgerhq/context-module\",\n \"version\": \"1.0.0\",\n \"license\": \"MIT\",\n \"exports\": {\n \".\": {\n \"types\": \"./lib/types/index.d.ts\",\n \"import\": \"./lib/esm/index.js\",\n \"require\": \"./lib/cjs/index.js\"\n },\n \"./*\": {\n \"types\": \"./lib/types/*\"\n }\n },\n \"files\": [\n \"./lib\"\n ],\n \"scripts\": {\n \"prebuild\": \"rimraf lib\",\n \"build\": \"pnpm lmdk-build --entryPoints index.ts --tsconfig tsconfig.prod.json\",\n \"dev\": \"concurrently \\\"pnpm watch:builds\\\" \\\"pnpm watch:types\\\"\",\n \"watch:builds\": \"pnpm lmdk-watch --entryPoints index.ts --tsconfig tsconfig.prod.json\",\n \"watch:types\": \"concurrently \\\"tsc --watch -p tsconfig.prod.json\\\" \\\"tsc-alias --watch -p tsconfig.prod.json\\\"\",\n \"lint\": \"eslint\",\n \"lint:fix\": \"pnpm lint --fix\",\n \"postpack\": \"find . -name '*.tgz' -exec cp {} ../../../dist/ \\\\; \",\n \"prettier\": \"prettier . --check\",\n \"prettier:fix\": \"prettier . --write\",\n \"test\": \"jest\",\n \"test:watch\": \"pnpm test -- --watch\",\n \"test:coverage\": \"pnpm test -- --coverage\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"devDependencies\": {\n \"@ledgerhq/esbuild-tools\": \"workspace:*\",\n \"@ledgerhq/device-management-kit\": \"workspace:*\",\n \"@ledgerhq/eslint-config-dsdk\": \"workspace:*\",\n \"@ledgerhq/jest-config-dsdk\": \"workspace:*\",\n \"@ledgerhq/prettier-config-dsdk\": \"workspace:*\",\n \"@ledgerhq/tsconfig-dsdk\": \"workspace:*\",\n \"@types/crypto-js\": \"^4.2.2\",\n \"ts-node\": \"^10.9.2\"\n },\n \"dependencies\": {\n \"axios\": \"^1.7.7\",\n \"crypto-js\": \"^4.2.0\",\n \"ethers\": \"^6.13.2\",\n \"inversify\": \"^6.0.2\",\n \"purify-ts\": \"^2.1.0\",\n \"reflect-metadata\": \"^0.2.2\"\n },\n \"peerDependencies\": {\n \"@ledgerhq/device-management-kit\": \"workspace:*\"\n }\n}\n", "import { HexaString, isHexaString } from \"@ledgerhq/device-management-kit\";\nimport { ethers, Interface } from \"ethers\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, EitherAsync, Left, Right } from \"purify-ts\";\n\nimport type { ExternalPluginDataSource } from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { externalPluginTypes } from \"@/external-plugin/di/externalPluginTypes\";\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport { TransactionContext } from \"@/shared/model/TransactionContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\n\n@injectable()\nexport class ExternalPluginContextLoader implements ContextLoader {\n private _externalPluginDataSource: ExternalPluginDataSource;\n private _tokenDataSource: TokenDataSource;\n\n constructor(\n @inject(externalPluginTypes.ExternalPluginDataSource)\n externalPluginDataSource: ExternalPluginDataSource,\n @inject(tokenTypes.TokenDataSource) tokenDataSource: TokenDataSource,\n ) {\n this._externalPluginDataSource = externalPluginDataSource;\n this._tokenDataSource = tokenDataSource;\n }\n\n async load(transaction: TransactionContext): Promise<ClearSignContext[]> {\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 const eitherDappInfos = await this._externalPluginDataSource.getDappInfos({\n address: transaction.to,\n chainId: transaction.chainId,\n selector,\n });\n\n return EitherAsync<Error, ClearSignContext[]>(async ({ liftEither }) => {\n const dappInfos = await liftEither(eitherDappInfos);\n\n // if the dappInfos is null, return an empty array\n // this means that the selector is not a known selector\n if (!dappInfos) {\n return [];\n }\n\n const externalPluginContext: ClearSignContext = {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: dappInfos.selectorDetails.serializedData.concat(\n dappInfos.selectorDetails.signature,\n ),\n };\n\n const decodedCallData = this.getDecodedCallData(\n dappInfos.abi,\n dappInfos.selectorDetails.method,\n transaction.data!, // trasaction.data is not null and not infered correctly\n );\n\n // if the call data cannot be decoded, return the error\n // but also the externalPluginContext because it is still valid\n if (decodedCallData.isLeft()) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: decodedCallData.extract(),\n },\n externalPluginContext,\n ];\n }\n\n // decodedCallData is a Right so we can extract it safely\n const extractedDecodedCallData =\n decodedCallData.extract() as ethers.Result;\n\n // get the token payload for each erc20OfInterest\n // and return the payload or the error\n const promises = dappInfos.selectorDetails.erc20OfInterest.map(\n async (erc20Path) =>\n this.getTokenPayload(\n transaction,\n erc20Path,\n extractedDecodedCallData,\n ),\n );\n\n const tokensPayload = await Promise.all(promises);\n\n // map the payload or the error to a ClearSignContext\n const contexts: ClearSignContext[] = tokensPayload.map((eitherToken) =>\n eitherToken.caseOf<ClearSignContext>({\n Left: (error) => ({ type: ClearSignContextType.ERROR, error }),\n Right: (payload) => ({ type: ClearSignContextType.TOKEN, payload }),\n }),\n );\n\n return [...contexts, externalPluginContext];\n }).caseOf<ClearSignContext[]>({\n // parse all errors into ClearSignContext\n Left: (error) => [{ type: ClearSignContextType.ERROR, error }],\n Right: (contexts) => contexts,\n });\n }\n\n private getTokenPayload(\n transaction: TransactionContext,\n erc20Path: string,\n decodedCallData: ethers.Result,\n ) {\n const address = this.getAddressFromPath(erc20Path, decodedCallData);\n\n return EitherAsync<Error, string>(({ fromPromise }) =>\n fromPromise(\n this._tokenDataSource.getTokenInfosPayload({\n address,\n chainId: transaction.chainId,\n }),\n ),\n );\n }\n\n private getDecodedCallData(\n abi: object[],\n method: string,\n data: string,\n ): Either<Error, ethers.Result> {\n try {\n const contractInterface = new Interface(abi);\n return Right(contractInterface.decodeFunctionData(method, data));\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] ExternalPluginContextLoader: Unable to parse abi\",\n ),\n );\n }\n }\n\n private getAddressFromPath(\n path: string,\n decodedCallData: ethers.Result,\n ): HexaString {\n // ethers.Result is a record string, any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let value: any = decodedCallData;\n for (const key of path.split(\".\")) {\n // In Solidity, a struct cannot begin with a number\n // Additionally, when we use -1, it signifies the last element of the array.\n if (key === \"-1\") {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n value = value[value.length - 1];\n } else {\n // This access can throw a RangeError error in case of an invalid key\n // but is correctly caught by the liftEither above\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n value = value[key];\n }\n }\n\n if (!isHexaString(value)) {\n throw new Error(\n \"[ContextModule] ExternalPluginContextLoader: Unable to get address\",\n );\n }\n\n return value;\n }\n}\n", "export enum ClearSignContextType {\n TOKEN = \"token\",\n NFT = \"nft\",\n DOMAIN_NAME = \"domainName\",\n PLUGIN = \"plugin\",\n EXTERNAL_PLUGIN = \"externalPlugin\",\n ERROR = \"error\",\n}\n\nexport type ClearSignContextSuccess = {\n type: Exclude<ClearSignContextType, ClearSignContextType.ERROR>;\n /**\n * Hexadecimal string representation of the payload.\n */\n payload: string;\n};\n\nexport type ClearSignContextError = {\n type: ClearSignContextType.ERROR;\n error: Error;\n};\n\nexport type ClearSignContext = ClearSignContextSuccess | ClearSignContextError;\n", "import { ContainerModule } from \"inversify\";\n\nimport { HttpForwardDomainDataSource } from \"@/forward-domain/data/HttpForwardDomainDataSource\";\nimport { forwardDomainTypes } from \"@/forward-domain/di/forwardDomainTypes\";\nimport { ForwardDomainContextLoader } from \"@/forward-domain/domain/ForwardDomainContextLoader\";\n\nexport const forwardDomainModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(forwardDomainTypes.ForwardDomainDataSource).to(\n HttpForwardDomainDataSource,\n );\n bind(forwardDomainTypes.ForwardDomainContextLoader).to(\n ForwardDomainContextLoader,\n );\n });\n", "import axios from \"axios\";\nimport { injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport {\n ForwardDomainDataSource,\n GetForwardDomainInfosParams,\n} from \"@/forward-domain/data/ForwardDomainDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpForwardDomainDataSource implements ForwardDomainDataSource {\n public async getDomainNamePayload({\n domain,\n challenge,\n }: GetForwardDomainInfosParams): 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/names/ens/forward/${domain}?challenge=${challenge}`,\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] HttpForwardDomainDataSource: error getting domain payload\",\n ),\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpForwardDomainDataSource: Failed to fetch domain name\",\n ),\n );\n }\n }\n}\n", "import { inject, injectable } from \"inversify\";\n\nimport type { ForwardDomainDataSource } from \"@/forward-domain/data/ForwardDomainDataSource\";\nimport { forwardDomainTypes } from \"@/forward-domain/di/forwardDomainTypes\";\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport { TransactionContext } from \"@/shared/model/TransactionContext\";\n\n@injectable()\nexport class ForwardDomainContextLoader implements ContextLoader {\n private _dataSource: ForwardDomainDataSource;\n\n constructor(\n @inject(forwardDomainTypes.ForwardDomainDataSource)\n dataSource: ForwardDomainDataSource,\n ) {\n this._dataSource = dataSource;\n }\n\n async load(\n transactionContext: TransactionContext,\n ): Promise<ClearSignContext[]> {\n const { domain, challenge } = transactionContext;\n\n if (!domain) {\n return [];\n }\n\n if (!this.isDomainValid(domain)) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\n \"[ContextModule] ForwardDomainLoader: invalid domain\",\n ),\n },\n ];\n }\n\n const payload = await this._dataSource.getDomainNamePayload({\n domain: domain,\n challenge: challenge,\n });\n\n return [\n payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error: error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.DOMAIN_NAME,\n payload: value,\n }),\n }),\n ];\n }\n\n private isDomainValid(domain: string) {\n const lengthIsValid = domain.length > 0 && Number(domain.length) < 30;\n const containsOnlyValidChars = new RegExp(\"^[a-zA-Z0-9\\\\-\\\\_\\\\.]+$\").test(\n domain,\n );\n\n return lengthIsValid && containsOnlyValidChars;\n }\n}\n", "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", "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", "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 { TransactionContext } 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 private isSelectorSupported(selector: HexaString) {\n return Object.values(SUPPORTED_SELECTORS).includes(selector);\n }\n}\n", "import { ContainerModule } from \"inversify\";\n\nimport { HttpTokenDataSource } from \"@/token/data/HttpTokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport { TokenContextLoader } from \"@/token/domain/TokenContextLoader\";\n\nexport const tokenModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(tokenTypes.TokenDataSource).to(HttpTokenDataSource);\n bind(tokenTypes.TokenContextLoader).to(TokenContextLoader);\n });\n", "import axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport PACKAGE from \"@root/package.json\";\n\nimport { GetTokenInfosParams, TokenDataSource } from \"./TokenDataSource\";\nimport { TokenDto } from \"./TokenDto\";\n\n@injectable()\nexport class HttpTokenDataSource implements TokenDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n public async getTokenInfosPayload({\n chainId,\n address,\n }: GetTokenInfosParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<TokenDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/tokens`,\n params: {\n contract_address: address,\n chain_id: chainId,\n output: \"descriptor,ticker\",\n ref: `branch:${this.config.cal.branch}`,\n },\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n const tokenInfos = response.data?.[0];\n\n if (\n !tokenInfos ||\n !tokenInfos.ticker ||\n !tokenInfos.descriptor ||\n !tokenInfos.descriptor.data ||\n !tokenInfos.descriptor.signatures ||\n typeof tokenInfos.descriptor.signatures[this.config.cal.mode] !==\n \"string\"\n ) {\n return Left(\n new Error(\n `[ContextModule] HttpTokenDataSource: no token metadata for address ${address} on chain ${chainId}`,\n ),\n );\n }\n\n // 1 byte for the length of the ticker\n const tickerLengthBuff = tokenInfos.ticker.length\n .toString(16)\n .padStart(2, \"0\");\n\n return Right(\n [\n tickerLengthBuff,\n tokenInfos.descriptor.data,\n tokenInfos.descriptor.signatures[this.config.cal.mode],\n ].join(\"\"),\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpTokenDataSource: Failed to fetch token informations\",\n ),\n );\n }\n }\n}\n", "import { HexaString, isHexaString } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport { TransactionContext } from \"@/shared/model/TransactionContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\n\nexport enum ERC20_SUPPORTED_SELECTORS {\n Approve = \"0x095ea7b3\",\n Transfer = \"0xa9059cbb\",\n}\n\nconst SUPPORTED_SELECTORS: HexaString[] = Object.values(\n ERC20_SUPPORTED_SELECTORS,\n);\n\n@injectable()\nexport class TokenContextLoader implements ContextLoader {\n private _dataSource: TokenDataSource;\n\n constructor(@inject(tokenTypes.TokenDataSource) dataSource: TokenDataSource) {\n this._dataSource = dataSource;\n }\n\n async load(transaction: TransactionContext): Promise<ClearSignContext[]> {\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 const payload = await this._dataSource.getTokenInfosPayload({\n address: transaction.to,\n chainId: transaction.chainId,\n });\n\n return [\n payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.TOKEN,\n payload: value,\n }),\n }),\n ];\n }\n\n private isSelectorSupported(selector: HexaString) {\n return Object.values(SUPPORTED_SELECTORS).includes(selector);\n }\n}\n", "import { ContainerModule } from \"inversify\";\n\nimport { HttpTypedDataDataSource } from \"@/typed-data/data/HttpTypedDataDataSource\";\nimport { typedDataTypes } from \"@/typed-data/di/typedDataTypes\";\nimport { DefaultTypedDataContextLoader } from \"@/typed-data/domain/DefaultTypedDataContextLoader\";\n\nexport const typedDataModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(typedDataTypes.TypedDataDataSource).to(HttpTypedDataDataSource);\n bind(typedDataTypes.TypedDataContextLoader).to(\n DefaultTypedDataContextLoader,\n );\n });\n", "import axios from \"axios\";\nimport SHA224 from \"crypto-js/sha224\";\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 type {\n TypedDataFilter,\n TypedDataMessageInfo,\n} from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataSchema } from \"@/shared/model/TypedDataContext\";\nimport PACKAGE from \"@root/package.json\";\n\nimport type {\n FiltersDto,\n InstructionContractInfo,\n InstructionField,\n InstructionFieldV1,\n InstructionFieldV2,\n InstructionFieldV2WithCoinRef,\n} from \"./FiltersDto\";\nimport {\n GetTypedDataFiltersParams,\n GetTypedDataFiltersResult,\n TypedDataDataSource,\n} from \"./TypedDataDataSource\";\n\n@injectable()\nexport class HttpTypedDataDataSource implements TypedDataDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n public async getTypedDataFilters({\n chainId,\n address,\n schema,\n version,\n }: GetTypedDataFiltersParams): Promise<\n Either<Error, GetTypedDataFiltersResult>\n > {\n let messageInfo: TypedDataMessageInfo | undefined = undefined;\n\n try {\n const response = await axios.request<FiltersDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/dapps`,\n params: {\n contracts: address,\n chain_id: chainId,\n output: \"descriptors_eip712\",\n descriptors_eip712_version: version,\n descriptors_eip712: \"<set>\",\n ref: `branch:${this.config.cal.branch}`,\n },\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n // Try to get the filters JSON descriptor, from address and schema hash\n const schemaHash = SHA224(\n JSON.stringify(this.sortTypes(schema)).replace(\" \", \"\"),\n ).toString();\n address = address.toLowerCase();\n const filtersJson =\n response.data?.[0]?.descriptors_eip712?.[address]?.[schemaHash];\n if (!filtersJson) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n // Parse the message type, if available\n if (!filtersJson.schema || !Array.isArray(filtersJson.instructions)) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n // Parse all the filters\n const filters: TypedDataFilter[] = [];\n for (const field of filtersJson.instructions) {\n if (this.isInstructionContractInfo(field, this.config.cal.mode)) {\n messageInfo = {\n displayName: field.display_name,\n signature: field.signatures[this.config.cal.mode],\n filtersCount: field.field_mappers_count,\n };\n } else if (\n version === \"v1\" &&\n this.isInstructionFieldV1(field, this.config.cal.mode)\n ) {\n filters.push({\n type: \"raw\",\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n });\n } else if (this.isInstructionFieldV2(field, this.config.cal.mode)) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n });\n } else if (\n this.isInstructionFieldV2WithCoinRef(field, this.config.cal.mode)\n ) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n tokenIndex: field.coin_ref,\n });\n } else {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n }\n\n if (!messageInfo) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n return Right({ messageInfo, filters });\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations\",\n ),\n );\n }\n }\n\n private isInstructionFieldV1(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV1 & {\n signatures: { [key in ContextModuleCalMode]: string };\n } {\n // NOTE: Currently the backend return the same structure for V1 and V2,\n // so we can't distinguish them here, but we can still check the required fields\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\"\n );\n }\n\n private isInstructionFieldV2(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2 & {\n signatures: { [key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\"raw\", \"datetime\"].includes(data.format) &&\n data.coin_ref === undefined\n );\n }\n\n private isInstructionFieldV2WithCoinRef(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2WithCoinRef & {\n signatures: { [key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\"token\", \"amount\"].includes(data.format) &&\n typeof data.coin_ref === \"number\"\n );\n }\n\n private isInstructionContractInfo(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionContractInfo & {\n signatures: { [key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_mappers_count === \"number\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n data.field_path === undefined\n );\n }\n\n private sortTypes(types: TypedDataSchema): TypedDataSchema {\n return Object.fromEntries(\n Object.entries(types)\n .sort(([aKey], [bKey]) => aKey.localeCompare(bKey))\n .map(([key, value]) => [\n key,\n value.map((v) => ({ name: v.name, type: v.type })),\n ]),\n );\n }\n}\n", "import type { HexaString } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport type {\n TypedDataClearSignContext,\n TypedDataFilter,\n TypedDataFilterPath,\n TypedDataToken,\n TypedDataTokenIndex,\n} from \"@/shared/model/TypedDataClearSignContext\";\nimport { VERIFYING_CONTRACT_TOKEN_INDEX } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport type { TypedDataDataSource } from \"@/typed-data/data/TypedDataDataSource\";\nimport { typedDataTypes } from \"@/typed-data/di/typedDataTypes\";\nimport type { TypedDataContextLoader } from \"@/typed-data/domain/TypedDataContextLoader\";\n\n@injectable()\nexport class DefaultTypedDataContextLoader implements TypedDataContextLoader {\n constructor(\n @inject(typedDataTypes.TypedDataDataSource)\n private dataSource: TypedDataDataSource,\n @inject(tokenTypes.TokenDataSource)\n private tokenDataSource: TokenDataSource,\n ) {}\n\n async load(typedData: TypedDataContext): Promise<TypedDataClearSignContext> {\n // Get the typed data filters from the data source\n const data = await this.dataSource.getTypedDataFilters({\n address: typedData.verifyingContract,\n chainId: typedData.chainId,\n version: typedData.version,\n schema: typedData.schema,\n });\n\n // If there was an error getting the typed data filters, return an error immediately\n if (data.isLeft()) {\n return {\n type: \"error\",\n error: data.extract(),\n };\n }\n\n // Else, extract the message info and filters\n const { messageInfo, filters } = data.unsafeCoerce();\n\n // Loop through the typed data filters to extract informations\n const mappedFilters: Record<TypedDataFilterPath, TypedDataFilter> = {};\n const mappedTokens: Record<TypedDataTokenIndex, TypedDataToken> = {};\n for (const filter of filters) {\n // Add the filter to the clear signing context\n mappedFilters[filter.path] = filter;\n if (filter.type !== \"token\" && filter.type !== \"amount\") {\n continue; // no token reference\n }\n\n // If the filter references a token, retrieve its descriptor from the tokens data source\n const tokenIndex = filter.tokenIndex;\n if (mappedTokens[tokenIndex] !== undefined) {\n continue; // Already fetched for a previous filter\n }\n\n // If the filter is a token, get token address from typed message values, and fetch descriptor\n if (filter.type === \"token\") {\n const value = typedData.fieldsValues.find(\n (entry) => entry.path === filter.path,\n );\n if (value === undefined) {\n return {\n type: \"error\",\n error: new Error(\n `The token filter references the value ${filter.path} which is absent from the message`,\n ),\n };\n }\n // Fetch descriptor\n const address = this.convertAddressToHexaString(value.value);\n const chainId = typedData.chainId;\n const payload = await this.tokenDataSource.getTokenInfosPayload({\n address,\n chainId,\n });\n if (payload.isLeft()) {\n return {\n type: \"error\",\n error: payload.extract(),\n };\n }\n payload.ifRight((payload) => {\n mappedTokens[tokenIndex] = payload;\n });\n }\n\n // If the filter is an amount with a reference to the verifyingContract, fetch verifyingContract descriptor.\n // This is because descriptors data-sources should be compatible with Ledger devices specifications:\n // https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#amount-join-value\n else if (\n filter.type === \"amount\" &&\n tokenIndex === VERIFYING_CONTRACT_TOKEN_INDEX\n ) {\n const address = typedData.verifyingContract;\n const chainId = typedData.chainId;\n const payload = await this.tokenDataSource.getTokenInfosPayload({\n address,\n chainId,\n });\n if (payload.isLeft()) {\n return {\n type: \"error\",\n error: payload.extract(),\n };\n }\n payload.ifRight((payload) => {\n mappedTokens[tokenIndex] = payload;\n });\n }\n }\n\n return {\n type: \"success\",\n messageInfo,\n filters: mappedFilters,\n tokens: mappedTokens,\n };\n }\n\n private convertAddressToHexaString(address: Uint8Array): HexaString {\n // Address size is 20 bytes so 40 characters, padded with zeros on the left\n return `0x${Array.from(address, (byte) =>\n byte.toString(16).padStart(2, \"0\"),\n )\n .join(\"\")\n .padStart(40, \"0\")}`;\n }\n}\n", "// 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", "import { externalPluginTypes } from \"@/external-plugin/di/externalPluginTypes\";\nimport { forwardDomainTypes } from \"@/forward-domain/di/forwardDomainTypes\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport { typedDataTypes } from \"@/typed-data/di/typedDataTypes\";\n\nimport { ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport { ExternalPluginContextLoader } from \"./external-plugin/domain/ExternalPluginContextLoader\";\nimport { ForwardDomainContextLoader } from \"./forward-domain/domain/ForwardDomainContextLoader\";\nimport { NftContextLoader } from \"./nft/domain/NftContextLoader\";\nimport { ContextLoader } from \"./shared/domain/ContextLoader\";\nimport { TokenContextLoader } from \"./token/domain/TokenContextLoader\";\nimport { type TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { ContextModule } from \"./ContextModule\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\nimport { makeContainer } from \"./di\";\n\nconst DEFAULT_CAL_URL = \"https://crypto-assets-service.api.ledger.com/v1\";\n\nexport const DEFAULT_CONFIG: ContextModuleConfig = {\n cal: {\n url: DEFAULT_CAL_URL,\n mode: \"prod\",\n branch: \"main\",\n },\n};\n\nexport class ContextModuleBuilder {\n private config: Partial<ContextModuleConfig> = {};\n private customLoaders: ContextLoader[] = [];\n private defaultLoaders: ContextLoader[] = [];\n private customTypedDataLoader?: TypedDataContextLoader;\n\n constructor() {}\n\n /**\n * Remove default loaders from the list of loaders\n *\n * @returns this\n */\n withoutDefaultLoaders() {\n this.defaultLoaders = [];\n return this;\n }\n\n /**\n * Add a custom loader to the list of loaders\n *\n * @param loader loader to add to the list of loaders\n * @returns this\n */\n addLoader(loader: ContextLoader) {\n this.customLoaders.push(loader);\n return this;\n }\n\n /**\n * Replace the default loader for typed data clear signing contexts\n *\n * @returns this\n */\n withTypedDataLoader(loader: TypedDataContextLoader) {\n this.customTypedDataLoader = loader;\n return this;\n }\n\n /**\n * Set the configuration for the context module\n *\n * @param config configuration for the context module\n * @returns this\n */\n withConfig(config: Partial<ContextModuleConfig>) {\n this.config = config;\n return this;\n }\n\n /**\n * Build the context module\n *\n * @returns the context module\n */\n build(): ContextModule {\n const container = makeContainer({\n config: { ...DEFAULT_CONFIG, ...this.config },\n });\n\n this.defaultLoaders = [\n container.get<ExternalPluginContextLoader>(\n externalPluginTypes.ExternalPluginContextLoader,\n ),\n container.get<ForwardDomainContextLoader>(\n forwardDomainTypes.ForwardDomainContextLoader,\n ),\n container.get<NftContextLoader>(nftTypes.NftContextLoader),\n container.get<TokenContextLoader>(tokenTypes.TokenContextLoader),\n ];\n const defaultTypedDataLoader = container.get<TypedDataContextLoader>(\n typedDataTypes.TypedDataContextLoader,\n );\n\n const loaders = [...this.defaultLoaders, ...this.customLoaders];\n return new DefaultContextModule({\n loaders,\n typedDataLoader: this.customTypedDataLoader ?? defaultTypedDataLoader,\n });\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,8BAAO;;;ACDA,IAAM,sBAAsB;AAAA,EACjC,0BAA0B,OAAO,IAAI,0BAA0B;AAAA,EAC/D,6BAA6B,OAAO,IAAI,6BAA6B;AACvE;;;ACHO,IAAM,qBAAqB;AAAA,EAChC,yBAAyB,OAAO,IAAI,yBAAyB;AAAA,EAC7D,4BAA4B,OAAO,IAAI,4BAA4B;AACrE;;;ACHO,IAAM,WAAW;AAAA,EACtB,eAAe,OAAO,IAAI,eAAe;AAAA,EACzC,kBAAkB,OAAO,IAAI,kBAAkB;AACjD;;;ACHO,IAAM,aAAa;AAAA,EACxB,iBAAiB,OAAO,IAAI,iBAAiB;AAAA,EAC7C,oBAAoB,OAAO,IAAI,oBAAoB;AACrD;;;ACHO,IAAM,iBAAiB;AAAA,EAC5B,qBAAqB,OAAO,IAAI,qBAAqB;AAAA,EACrD,wBAAwB,OAAO,IAAI,wBAAwB;AAC7D;;;ACWO,IAAM,uBAAN,MAAoD;AAAA,EACjD;AAAA,EACA;AAAA,EAER,YAAY,MAA2C;AACrD,SAAK,WAAW,KAAK;AACrB,SAAK,mBAAmB,KAAK;AAAA,EAC/B;AAAA,EAEA,MAAa,YACX,aAC6B;AAC7B,UAAM,WAAW,KAAK,SAAS,IAAI,CAAC,YAAY,QAAQ,KAAK,WAAW,CAAC;AACzE,UAAM,YAAY,MAAM,QAAQ,IAAI,QAAQ;AAC5C,WAAO,UAAU,KAAK;AAAA,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AAAA,EAQA,WAAW,QAAsC;AAC/C,SAAK,SAAS;AACd,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,QAAuB;AACrB,UAAM,YAAY,cAAc;AAAA,MAC9B,QAAQ,EAAE,GAAG,gBAAgB,GAAG,KAAK,OAAO;AAAA,IAC9C,CAAC;AAED,SAAK,iBAAiB;AAAA,MACpB,UAAU;AAAA,QACR,oBAAoB;AAAA,MACtB;AAAA,MACA,UAAU;AAAA,QACR,mBAAmB;AAAA,MACrB;AAAA,MACA,UAAU,IAAsB,SAAS,gBAAgB;AAAA,MACzD,UAAU,IAAwB,WAAW,kBAAkB;AAAA,IACjE;AACA,UAAM,yBAAyB,UAAU;AAAA,MACvC,eAAe;AAAA,IACjB;AAEA,UAAM,UAAU,CAAC,GAAG,KAAK,gBAAgB,GAAG,KAAK,aAAa;AAC9D,WAAO,IAAI,qBAAqB;AAAA,MAC9B;AAAA,MACA,iBAAiB,KAAK,yBAAyB;AAAA,IACjD,CAAC;AAAA,EACH;AACF;",
6
- "names": ["import_inversify", "import_inversify", "import_inversify", "axios", "import_inversify", "import_purify_ts", "ClearSignContextType", "import_inversify", "import_axios", "import_inversify", "import_purify_ts", "axios", "import_inversify", "import_inversify", "import_axios", "import_inversify", "import_purify_ts", "axios", "import_device_management_kit", "import_inversify", "ERC721_SUPPORTED_SELECTOR", "ERC1155_SUPPORTED_SELECTOR", "import_inversify", "import_axios", "import_inversify", "import_purify_ts", "axios", "import_device_management_kit", "import_inversify", "ERC20_SUPPORTED_SELECTORS", "SUPPORTED_SELECTORS", "import_inversify", "import_axios", "import_inversify", "import_purify_ts", "axios", "SHA224", "import_inversify", "payload"]
3
+ "sources": ["../../index.ts"],
4
+ "sourcesContent": ["// inversify requirement\nimport \"reflect-metadata\";\n\nexport * from \"./src/index\";\n"],
5
+ "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GACA,IAAAE,EAAO,4BAEPC,EAAAH,EAAc,uBAHd",
6
+ "names": ["index_exports", "__toCommonJS", "import_reflect_metadata", "__reExport"]
7
7
  }
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@ledgerhq/context-module",
3
+ "version": "1.2.0",
4
+ "private": false,
5
+ "license": "Apache-2.0",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./lib/types/index.d.ts",
9
+ "import": "./lib/esm/index.js",
10
+ "require": "./lib/cjs/index.js"
11
+ },
12
+ "./*": {
13
+ "types": "./lib/types/*",
14
+ "import": "./lib/esm/*",
15
+ "require": "./lib/cjs/*"
16
+ }
17
+ },
18
+ "files": [
19
+ "./lib"
20
+ ],
21
+ "scripts": {
22
+ "prebuild": "rimraf lib",
23
+ "build": "pnpm lmdk-build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
24
+ "dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
25
+ "watch:builds": "pnpm lmdk-watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
26
+ "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\"",
27
+ "lint": "eslint",
28
+ "lint:fix": "pnpm lint --fix",
29
+ "postpack": "find . -name '*.tgz' -exec cp {} ../../../dist/ \\; ",
30
+ "prettier": "prettier . --check",
31
+ "prettier:fix": "prettier . --write",
32
+ "test": "vitest run",
33
+ "test:watch": "vitest",
34
+ "test:coverage": "vitest run --coverage",
35
+ "typecheck": "tsc --noEmit"
36
+ },
37
+ "devDependencies": {
38
+ "@ledgerhq/device-management-kit": "workspace:*",
39
+ "@ledgerhq/esbuild-tools": "workspace:*",
40
+ "@ledgerhq/eslint-config-dsdk": "workspace:*",
41
+ "@ledgerhq/prettier-config-dsdk": "workspace:*",
42
+ "@ledgerhq/tsconfig-dsdk": "workspace:*",
43
+ "@ledgerhq/vitest-config-dmk": "workspace:*",
44
+ "@types/crypto-js": "^4.2.2",
45
+ "ts-node": "^10.9.2"
46
+ },
47
+ "dependencies": {
48
+ "axios": "^1.7.9",
49
+ "crypto-js": "^4.2.0",
50
+ "ethers": "6.13.4",
51
+ "inversify": "^6.2.2",
52
+ "purify-ts": "^2.1.0",
53
+ "reflect-metadata": "^0.2.2"
54
+ },
55
+ "peerDependencies": {
56
+ "@ledgerhq/device-management-kit": "workspace:*"
57
+ }
58
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var x=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of C(t))!p.call(e,o)&&o!==r&&a(e,o,{get:()=>t[o],enumerable:!(n=i(t,o))||n.enumerable});return e};var m=e=>x(a({},"__esModule",{value:!0}),e);var y={};module.exports=m(y);
2
+ //# sourceMappingURL=ContextModule.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ContextModule.ts"],
4
+ "sourcesContent": ["import { type ClearSignContext } from \"@/shared/model/ClearSignContext\";\n\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"./shared/model/TransactionContext\";\nimport { type TypedDataClearSignContext } from \"./shared/model/TypedDataClearSignContext\";\nimport { type TypedDataContext } from \"./shared/model/TypedDataContext\";\n\nexport interface ContextModule {\n getContext(field: TransactionFieldContext): Promise<ClearSignContext>;\n getContexts(transaction: TransactionContext): Promise<ClearSignContext[]>;\n getTypedDataFilters(\n typedData: TypedDataContext,\n ): Promise<TypedDataClearSignContext>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["ContextModule_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var C=(o,t)=>{for(var r in t)a(o,r,{get:t[r],enumerable:!0})},f=(o,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of u(t))!l.call(o,e)&&e!==r&&a(o,e,{get:()=>t[e],enumerable:!(n=s(t,e))||n.enumerable});return o};var p=o=>f(a({},"__esModule",{value:!0}),o);var L={};C(L,{ContextModuleBuilder:()=>m,DEFAULT_CONFIG:()=>d});module.exports=p(L);var i=require("./DefaultContextModule");const c="https://crypto-assets-service.api.ledger.com/v1",d={cal:{url:c,mode:"prod",branch:"main"},defaultLoaders:!0,customLoaders:[],customTypedDataLoader:void 0};class m{config=d;constructor(){}removeDefaultLoaders(){return this.config.defaultLoaders=!1,this}addLoader(t){return this.config.customLoaders.push(t),this}addTypedDataLoader(t){return this.config.customTypedDataLoader=t,this}addCalConfig(t){return this.config.cal={...d.cal,...t},this}build(){return new i.DefaultContextModule(this.config)}}0&&(module.exports={ContextModuleBuilder,DEFAULT_CONFIG});
2
+ //# sourceMappingURL=ContextModuleBuilder.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ContextModuleBuilder.ts"],
4
+ "sourcesContent": ["import {\n type ContextModuleCalConfig,\n type ContextModuleConfig,\n} from \"./config/model/ContextModuleConfig\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport { type TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\nconst DEFAULT_CAL_URL = \"https://crypto-assets-service.api.ledger.com/v1\";\n\nexport const DEFAULT_CONFIG: ContextModuleConfig = {\n cal: {\n url: DEFAULT_CAL_URL,\n mode: \"prod\",\n branch: \"main\",\n },\n defaultLoaders: true,\n customLoaders: [],\n customTypedDataLoader: undefined,\n};\n\nexport class ContextModuleBuilder {\n private config: ContextModuleConfig = DEFAULT_CONFIG;\n\n constructor() {}\n\n /**\n * Remove default loaders from the list of loaders\n *\n * @returns this\n */\n removeDefaultLoaders() {\n this.config.defaultLoaders = false;\n return this;\n }\n\n /**\n * Add a custom loader to the list of loaders\n *\n * @param loader loader to add to the list of loaders\n * @returns this\n */\n addLoader(loader: ContextLoader) {\n this.config.customLoaders.push(loader);\n return this;\n }\n\n /**\n * Replace the default loader for typed data clear signing contexts\n *\n * @param loader loader to use for typed data clear signing contexts\n * @returns this\n */\n addTypedDataLoader(loader: TypedDataContextLoader) {\n this.config.customTypedDataLoader = loader;\n return this;\n }\n\n /**\n * Add a custom CAL configuration\n *\n * @param calConfig\n * @returns this\n */\n addCalConfig(calConfig: ContextModuleCalConfig) {\n this.config.cal = { ...DEFAULT_CONFIG.cal, ...calConfig };\n return this;\n }\n\n /**\n * Build the context module\n *\n * @returns the context module\n */\n build(): ContextModule {\n return new DefaultContextModule(this.config);\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAOA,IAAAK,EAAqC,kCAErC,MAAMC,EAAkB,kDAEXH,EAAsC,CACjD,IAAK,CACH,IAAKG,EACL,KAAM,OACN,OAAQ,MACV,EACA,eAAgB,GAChB,cAAe,CAAC,EAChB,sBAAuB,MACzB,EAEO,MAAMJ,CAAqB,CACxB,OAA8BC,EAEtC,aAAc,CAAC,CAOf,sBAAuB,CACrB,YAAK,OAAO,eAAiB,GACtB,IACT,CAQA,UAAUI,EAAuB,CAC/B,YAAK,OAAO,cAAc,KAAKA,CAAM,EAC9B,IACT,CAQA,mBAAmBA,EAAgC,CACjD,YAAK,OAAO,sBAAwBA,EAC7B,IACT,CAQA,aAAaC,EAAmC,CAC9C,YAAK,OAAO,IAAM,CAAE,GAAGL,EAAe,IAAK,GAAGK,CAAU,EACjD,IACT,CAOA,OAAuB,CACrB,OAAO,IAAI,uBAAqB,KAAK,MAAM,CAC7C,CACF",
6
+ "names": ["ContextModuleBuilder_exports", "__export", "ContextModuleBuilder", "DEFAULT_CONFIG", "__toCommonJS", "import_DefaultContextModule", "DEFAULT_CAL_URL", "loader", "calConfig"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var o=require("./ContextModuleBuilder"),d=require("./DefaultContextModule");describe("ContextModuleBuilder",()=>{const u={url:"https://crypto-assets-service.api.ledger.com/v1",mode:"prod",branch:"main"};it("should return a default context module",()=>{const e=new o.ContextModuleBuilder().build();expect(e).toBeInstanceOf(d.DefaultContextModule)}),it("should return a custom context module",()=>{const t=new o.ContextModuleBuilder,e={load:vi.fn()},n=t.removeDefaultLoaders().addLoader(e).build();expect(n).toBeInstanceOf(d.DefaultContextModule)}),it("should return a custom context module with a custom typed data loader",()=>{const t=new o.ContextModuleBuilder,e={load:vi.fn()},n=t.removeDefaultLoaders().addTypedDataLoader(e).build();expect(n).toBeInstanceOf(d.DefaultContextModule)}),it("should return a custom context module with a custom config",()=>{const e=new o.ContextModuleBuilder().addCalConfig(u).build();expect(e).toBeInstanceOf(d.DefaultContextModule)})});
2
+ //# sourceMappingURL=ContextModuleBuilder.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ContextModuleBuilder.test.ts"],
4
+ "sourcesContent": ["import { type ContextModuleCalConfig } from \"./config/model/ContextModuleConfig\";\nimport { ContextModuleBuilder } from \"./ContextModuleBuilder\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\ndescribe(\"ContextModuleBuilder\", () => {\n const defaultCalConfig: ContextModuleCalConfig = {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n };\n it(\"should return a default context module\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n\n const res = contextModuleBuilder.build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n const customLoader = { load: vi.fn() };\n\n const res = contextModuleBuilder\n .removeDefaultLoaders()\n .addLoader(customLoader)\n .build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module with a custom typed data loader\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n const customLoader = { load: vi.fn() };\n\n const res = contextModuleBuilder\n .removeDefaultLoaders()\n .addTypedDataLoader(customLoader)\n .build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module with a custom config\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n\n const res = contextModuleBuilder.addCalConfig(defaultCalConfig).build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n});\n"],
5
+ "mappings": "aACA,IAAAA,EAAqC,kCACrCC,EAAqC,kCAErC,SAAS,uBAAwB,IAAM,CACrC,MAAMC,EAA2C,CAC/C,IAAK,kDACL,KAAM,OACN,OAAQ,MACV,EACA,GAAG,yCAA0C,IAAM,CAGjD,MAAMC,EAFuB,IAAI,uBAAqB,EAErB,MAAM,EAEvC,OAAOA,CAAG,EAAE,eAAe,sBAAoB,CACjD,CAAC,EAED,GAAG,wCAAyC,IAAM,CAChD,MAAMC,EAAuB,IAAI,uBAC3BC,EAAe,CAAE,KAAM,GAAG,GAAG,CAAE,EAE/BF,EAAMC,EACT,qBAAqB,EACrB,UAAUC,CAAY,EACtB,MAAM,EAET,OAAOF,CAAG,EAAE,eAAe,sBAAoB,CACjD,CAAC,EAED,GAAG,wEAAyE,IAAM,CAChF,MAAMC,EAAuB,IAAI,uBAC3BC,EAAe,CAAE,KAAM,GAAG,GAAG,CAAE,EAE/BF,EAAMC,EACT,qBAAqB,EACrB,mBAAmBC,CAAY,EAC/B,MAAM,EAET,OAAOF,CAAG,EAAE,eAAe,sBAAoB,CACjD,CAAC,EAED,GAAG,6DAA8D,IAAM,CAGrE,MAAMA,EAFuB,IAAI,uBAAqB,EAErB,aAAaD,CAAgB,EAAE,MAAM,EAEtE,OAAOC,CAAG,EAAE,eAAe,sBAAoB,CACjD,CAAC,CACH,CAAC",
6
+ "names": ["import_ContextModuleBuilder", "import_DefaultContextModule", "defaultCalConfig", "res", "contextModuleBuilder", "customLoader"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var u=(o,t)=>{for(var a in t)n(o,a,{get:t[a],enumerable:!0})},c=(o,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of L(t))!T.call(o,e)&&e!==a&&n(o,e,{get:()=>t[e],enumerable:!(r=f(t,e))||r.enumerable});return o};var g=o=>c(n({},"__esModule",{value:!0}),o);var _={};u(_,{DefaultContextModule:()=>D});module.exports=g(_);var i=require("./transaction/di/transactionTypes"),p=require("./trusted-name/di/trustedNameTypes"),d=require("./external-plugin/di/externalPluginTypes"),s=require("./nft/di/nftTypes"),m=require("./shared/model/ClearSignContext"),C=require("./token/di/tokenTypes"),l=require("./typed-data/di/typedDataTypes"),x=require("./uniswap/di/uniswapTypes"),y=require("./di");class D{_container;_loaders;_typedDataLoader;constructor(t){this._container=(0,y.makeContainer)({config:t}),this._loaders=t.defaultLoaders?this._getDefaultLoaders():[],this._loaders.push(...t.customLoaders),this._typedDataLoader=t.customTypedDataLoader??this._getDefaultTypedDataLoader()}_getDefaultLoaders(){return[this._container.get(d.externalPluginTypes.ExternalPluginContextLoader),this._container.get(p.trustedNameTypes.TrustedNameContextLoader),this._container.get(s.nftTypes.NftContextLoader),this._container.get(C.tokenTypes.TokenContextLoader),this._container.get(i.transactionTypes.TransactionContextLoader),this._container.get(x.uniswapTypes.UniswapContextLoader)]}_getDefaultTypedDataLoader(){return this._container.get(l.typedDataTypes.TypedDataContextLoader)}async getContexts(t){const a=this._loaders.map(e=>e.load(t));return(await Promise.all(a)).flat()}async getContext(t){const a=this._loaders.filter(e=>e.loadField).map(e=>e.loadField(t));return(await Promise.all(a)).find(e=>e!==null)||{type:m.ClearSignContextType.ERROR,error:new Error(`Field type not supported: ${t.type}`)}}async getTypedDataFilters(t){return this._typedDataLoader.load(t)}}0&&(module.exports={DefaultContextModule});
2
+ //# sourceMappingURL=DefaultContextModule.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/DefaultContextModule.ts"],
4
+ "sourcesContent": ["import { type Container } from \"inversify\";\n\nimport type { TypedDataClearSignContext } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport { transactionTypes } from \"@/transaction/di/transactionTypes\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\n\nimport { type ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport { externalPluginTypes } from \"./external-plugin/di/externalPluginTypes\";\nimport { type ExternalPluginContextLoader } from \"./external-plugin/domain/ExternalPluginContextLoader\";\nimport { nftTypes } from \"./nft/di/nftTypes\";\nimport { type NftContextLoader } from \"./nft/domain/NftContextLoader\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport {\n type ClearSignContext,\n ClearSignContextType,\n} from \"./shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"./shared/model/TransactionContext\";\nimport { tokenTypes } from \"./token/di/tokenTypes\";\nimport { type TokenContextLoader } from \"./token/domain/TokenContextLoader\";\nimport { type TransactionContextLoader } from \"./transaction/domain/TransactionContextLoader\";\nimport { type TrustedNameContextLoader } from \"./trusted-name/domain/TrustedNameContextLoader\";\nimport { typedDataTypes } from \"./typed-data/di/typedDataTypes\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { uniswapTypes } from \"./uniswap/di/uniswapTypes\";\nimport { type UniswapContextLoader } from \"./uniswap/domain/UniswapContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { makeContainer } from \"./di\";\n\nexport class DefaultContextModule implements ContextModule {\n private _container: Container;\n private _loaders: ContextLoader[];\n private _typedDataLoader: TypedDataContextLoader;\n\n constructor(args: ContextModuleConfig) {\n this._container = makeContainer({ config: args });\n this._loaders = args.defaultLoaders ? this._getDefaultLoaders() : [];\n this._loaders.push(...args.customLoaders);\n this._typedDataLoader =\n args.customTypedDataLoader ?? this._getDefaultTypedDataLoader();\n }\n\n private _getDefaultLoaders(): ContextLoader[] {\n return [\n this._container.get<ExternalPluginContextLoader>(\n externalPluginTypes.ExternalPluginContextLoader,\n ),\n this._container.get<TrustedNameContextLoader>(\n trustedNameTypes.TrustedNameContextLoader,\n ),\n this._container.get<NftContextLoader>(nftTypes.NftContextLoader),\n this._container.get<TokenContextLoader>(tokenTypes.TokenContextLoader),\n this._container.get<TransactionContextLoader>(\n transactionTypes.TransactionContextLoader,\n ),\n this._container.get<UniswapContextLoader>(\n uniswapTypes.UniswapContextLoader,\n ),\n ];\n }\n\n private _getDefaultTypedDataLoader(): TypedDataContextLoader {\n return this._container.get<TypedDataContextLoader>(\n typedDataTypes.TypedDataContextLoader,\n );\n }\n\n public async getContexts(\n transaction: TransactionContext,\n ): Promise<ClearSignContext[]> {\n const promises = this._loaders.map((fetcher) => fetcher.load(transaction));\n const responses = await Promise.all(promises);\n return responses.flat();\n }\n\n public async getContext(\n field: TransactionFieldContext,\n ): Promise<ClearSignContext> {\n const promises = this._loaders\n .filter((fetcher) => fetcher.loadField)\n .map((fetcher) => fetcher.loadField!(field));\n const responses = await Promise.all(promises);\n return (\n responses.find((resp) => resp !== null) || {\n type: ClearSignContextType.ERROR,\n error: new Error(`Field type not supported: ${field.type}`),\n }\n );\n }\n\n public async getTypedDataFilters(\n typedData: TypedDataContext,\n ): Promise<TypedDataClearSignContext> {\n return this._typedDataLoader.load(typedData);\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAIA,IAAAI,EAAiC,6CACjCC,EAAiC,8CAGjCC,EAAoC,oDAEpCC,EAAyB,6BAGzBC,EAGO,2CAKPC,EAA2B,iCAI3BC,EAA+B,0CAE/BC,EAA6B,qCAG7BC,EAA8B,gBAEvB,MAAMV,CAA8C,CACjD,WACA,SACA,iBAER,YAAYW,EAA2B,CACrC,KAAK,cAAa,iBAAc,CAAE,OAAQA,CAAK,CAAC,EAChD,KAAK,SAAWA,EAAK,eAAiB,KAAK,mBAAmB,EAAI,CAAC,EACnE,KAAK,SAAS,KAAK,GAAGA,EAAK,aAAa,EACxC,KAAK,iBACHA,EAAK,uBAAyB,KAAK,2BAA2B,CAClE,CAEQ,oBAAsC,CAC5C,MAAO,CACL,KAAK,WAAW,IACd,sBAAoB,2BACtB,EACA,KAAK,WAAW,IACd,mBAAiB,wBACnB,EACA,KAAK,WAAW,IAAsB,WAAS,gBAAgB,EAC/D,KAAK,WAAW,IAAwB,aAAW,kBAAkB,EACrE,KAAK,WAAW,IACd,mBAAiB,wBACnB,EACA,KAAK,WAAW,IACd,eAAa,oBACf,CACF,CACF,CAEQ,4BAAqD,CAC3D,OAAO,KAAK,WAAW,IACrB,iBAAe,sBACjB,CACF,CAEA,MAAa,YACXC,EAC6B,CAC7B,MAAMC,EAAW,KAAK,SAAS,IAAKC,GAAYA,EAAQ,KAAKF,CAAW,CAAC,EAEzE,OADkB,MAAM,QAAQ,IAAIC,CAAQ,GAC3B,KAAK,CACxB,CAEA,MAAa,WACXE,EAC2B,CAC3B,MAAMF,EAAW,KAAK,SACnB,OAAQC,GAAYA,EAAQ,SAAS,EACrC,IAAKA,GAAYA,EAAQ,UAAWC,CAAK,CAAC,EAE7C,OADkB,MAAM,QAAQ,IAAIF,CAAQ,GAEhC,KAAMG,GAASA,IAAS,IAAI,GAAK,CACzC,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,6BAA6BD,EAAM,IAAI,EAAE,CAC5D,CAEJ,CAEA,MAAa,oBACXE,EACoC,CACpC,OAAO,KAAK,iBAAiB,KAAKA,CAAS,CAC7C,CACF",
6
+ "names": ["DefaultContextModule_exports", "__export", "DefaultContextModule", "__toCommonJS", "import_transactionTypes", "import_trustedNameTypes", "import_externalPluginTypes", "import_nftTypes", "import_ClearSignContext", "import_tokenTypes", "import_typedDataTypes", "import_uniswapTypes", "import_di", "args", "transaction", "promises", "fetcher", "field", "resp", "typedData"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var o=require("./DefaultContextModule");const l=()=>({load:vi.fn(),loadField:vi.fn()});describe("DefaultContextModule",()=>{const d={load:vi.fn()},a={customLoaders:[],defaultLoaders:!1,customTypedDataLoader:d,cal:{url:"https://crypto-assets-service.api.ledger.com/v1",mode:"prod",branch:"main"}};beforeEach(()=>{vi.restoreAllMocks()}),it("should initialize the context module with all the default loaders",async()=>{const t=await new o.DefaultContextModule(a).getContexts({});expect(t).toEqual([])}),it("should return an empty array when no loaders",async()=>{const t=await new o.DefaultContextModule(a).getContexts({});expect(t).toEqual([])}),it("should call all fetch method from metadata fetcher",async()=>{const e=l();await new o.DefaultContextModule({...a,customLoaders:[e,e]}).getContexts({}),expect(e.load).toHaveBeenCalledTimes(2)}),it("should return an array of context response",async()=>{const e=l(),t=[[{type:"provideERC20Info",payload:"payload1"}],[{type:"provideERC20Info",payload:"payload2"},{type:"plugin",payload:"payload3"}]];vi.spyOn(e,"load").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new o.DefaultContextModule({...a,customLoaders:[e,e]}).getContexts({});expect(e.load).toHaveBeenCalledTimes(2),expect(n).toEqual(t.flat())}),it("should call the typed data loader",async()=>{await new o.DefaultContextModule({...a,customTypedDataLoader:d}).getTypedDataFilters({}),expect(d.load).toHaveBeenCalledTimes(1)}),it("should return a single context",async()=>{const e=l(),t=[null,{type:"token",payload:"payload"}];vi.spyOn(e,"loadField").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new o.DefaultContextModule({...a,customLoaders:[e,{load:vi.fn()},e]}).getContext({type:"token"});expect(e.loadField).toHaveBeenCalledTimes(2),expect(n).toEqual({type:"token",payload:"payload"})}),it("context field not supported",async()=>{const e=l(),t=[null,null];vi.spyOn(e,"loadField").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new o.DefaultContextModule({...a,customLoaders:[e,{load:vi.fn()},e]}).getContext({type:"token"});expect(e.loadField).toHaveBeenCalledTimes(2),expect(n).toEqual({type:"error",error:new Error("Field type not supported: token")})}),it("getField not implemented",async()=>{const t=await new o.DefaultContextModule({...a,customLoaders:[{load:vi.fn()}]}).getContext({type:"token"});expect(t).toEqual({type:"error",error:new Error("Field type not supported: token")})})});
2
+ //# sourceMappingURL=DefaultContextModule.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/DefaultContextModule.test.ts"],
4
+ "sourcesContent": ["import { type ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"./shared/model/TransactionContext\";\nimport { type TypedDataContext } from \"./shared/model/TypedDataContext\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\nconst contextLoaderStubBuilder = () => {\n return { load: vi.fn(), loadField: vi.fn() };\n};\n\ndescribe(\"DefaultContextModule\", () => {\n const typedDataLoader: TypedDataContextLoader = { load: vi.fn() };\n const defaultContextModuleConfig: ContextModuleConfig = {\n customLoaders: [],\n defaultLoaders: false,\n customTypedDataLoader: typedDataLoader,\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n },\n };\n\n beforeEach(() => {\n vi.restoreAllMocks();\n });\n\n it(\"should initialize the context module with all the default loaders\", async () => {\n const contextModule = new DefaultContextModule(defaultContextModuleConfig);\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(res).toEqual([]);\n });\n\n it(\"should return an empty array when no loaders\", async () => {\n const contextModule = new DefaultContextModule(defaultContextModuleConfig);\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(res).toEqual([]);\n });\n\n it(\"should call all fetch method from metadata fetcher\", async () => {\n const loader = contextLoaderStubBuilder();\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, loader],\n });\n\n await contextModule.getContexts({} as TransactionContext);\n\n expect(loader.load).toHaveBeenCalledTimes(2);\n });\n\n it(\"should return an array of context response\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [\n [{ type: \"provideERC20Info\", payload: \"payload1\" }],\n [\n { type: \"provideERC20Info\", payload: \"payload2\" },\n { type: \"plugin\", payload: \"payload3\" },\n ],\n ];\n vi.spyOn(loader, \"load\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, loader],\n });\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(loader.load).toHaveBeenCalledTimes(2);\n expect(res).toEqual(responses.flat());\n });\n\n it(\"should call the typed data loader\", async () => {\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customTypedDataLoader: typedDataLoader,\n });\n\n await contextModule.getTypedDataFilters({} as TypedDataContext);\n\n expect(typedDataLoader.load).toHaveBeenCalledTimes(1);\n });\n\n it(\"should return a single context\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [null, { type: \"token\", payload: \"payload\" }];\n vi.spyOn(loader, \"loadField\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, { load: vi.fn() }, loader],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(loader.loadField).toHaveBeenCalledTimes(2);\n expect(res).toEqual({ type: \"token\", payload: \"payload\" });\n });\n\n it(\"context field not supported\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [null, null];\n vi.spyOn(loader, \"loadField\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, { load: vi.fn() }, loader],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(loader.loadField).toHaveBeenCalledTimes(2);\n expect(res).toEqual({\n type: \"error\",\n error: new Error(\"Field type not supported: token\"),\n });\n });\n\n it(\"getField not implemented\", async () => {\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [{ load: vi.fn() }],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(res).toEqual({\n type: \"error\",\n error: new Error(\"Field type not supported: token\"),\n });\n });\n});\n"],
5
+ "mappings": "aAOA,IAAAA,EAAqC,kCAErC,MAAMC,EAA2B,KACxB,CAAE,KAAM,GAAG,GAAG,EAAG,UAAW,GAAG,GAAG,CAAE,GAG7C,SAAS,uBAAwB,IAAM,CACrC,MAAMC,EAA0C,CAAE,KAAM,GAAG,GAAG,CAAE,EAC1DC,EAAkD,CACtD,cAAe,CAAC,EAChB,eAAgB,GAChB,sBAAuBD,EACvB,IAAK,CACH,IAAK,kDACL,KAAM,OACN,OAAQ,MACV,CACF,EAEA,WAAW,IAAM,CACf,GAAG,gBAAgB,CACrB,CAAC,EAED,GAAG,oEAAqE,SAAY,CAGlF,MAAME,EAAM,MAFU,IAAI,uBAAqBD,CAA0B,EAEzC,YAAY,CAAC,CAAuB,EAEpE,OAAOC,CAAG,EAAE,QAAQ,CAAC,CAAC,CACxB,CAAC,EAED,GAAG,+CAAgD,SAAY,CAG7D,MAAMA,EAAM,MAFU,IAAI,uBAAqBD,CAA0B,EAEzC,YAAY,CAAC,CAAuB,EAEpE,OAAOC,CAAG,EAAE,QAAQ,CAAC,CAAC,CACxB,CAAC,EAED,GAAG,qDAAsD,SAAY,CACnE,MAAMC,EAASJ,EAAyB,EAMxC,MALsB,IAAI,uBAAqB,CAC7C,GAAGE,EACH,cAAe,CAACE,EAAQA,CAAM,CAChC,CAAC,EAEmB,YAAY,C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D,OAAOD,CAAG,EAAE,QAAQ,CAAE,KAAM,QAAS,QAAS,SAAU,CAAC,CAC3D,CAAC,EAED,GAAG,8BAA+B,SAAY,CAC5C,MAAMC,EAASJ,EAAyB,EAClCK,EAAY,CAAC,KAAM,IAAI,EAC7B,GAAG,MAAMD,EAAQ,WAAW,EACzB,sBAAsBC,EAAU,CAAC,CAAC,EAClC,sBAAsBA,EAAU,CAAC,CAAC,EAMrC,MAAMF,EAAM,MALU,IAAI,uBAAqB,CAC7C,GAAGD,EACH,cAAe,CAACE,EAAQ,CAAE,KAAM,GAAG,GAAG,CAAE,EAAGA,CAAM,CACnD,CAAC,EAE+B,WAAW,CACzC,KAAM,OACR,CAA4B,EAE5B,OAAOA,EAAO,SAAS,EAAE,sBAAsB,CAAC,EAChD,OAAOD,CAAG,EAAE,QAAQ,CAClB,KAAM,QACN,MAAO,IAAI,MAAM,iCAAiC,CACpD,CAAC,CACH,CAAC,EAED,GAAG,2BAA4B,SAAY,CAMzC,MAAMA,EAAM,MALU,IAAI,uBAAqB,CAC7C,GAAGD,EACH,cAAe,CAAC,CAAE,KAAM,GAAG,GAAG,CAAE,CAAC,CACnC,CAAC,EAE+B,WAAW,CACzC,KAAM,OACR,CAA4B,EAE5B,OAAOC,CAAG,EAAE,QAAQ,CAClB,KAAM,QACN,MAAO,IAAI,MAAM,iCAAiC,CACpD,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_DefaultContextModule", "contextLoaderStubBuilder", "typedDataLoader", "defaultContextModuleConfig", "res", "loader", "responses"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var l=(n,o)=>{for(var e in o)r(n,e,{get:o[e],enumerable:!0})},m=(n,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of u(o))!g.call(n,t)&&t!==e&&r(n,t,{get:()=>o[t],enumerable:!(i=d(o,t))||i.enumerable});return n};var p=n=>m(r({},"__esModule",{value:!0}),n);var a={};l(a,{configModuleFactory:()=>M});module.exports=p(a);var f=require("inversify"),C=require("./configTypes");const M=n=>new f.ContainerModule((o,e,i,t)=>{o(C.configTypes.Config).toConstantValue(n)});0&&(module.exports={configModuleFactory});
2
+ //# sourceMappingURL=configModuleFactory.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/config/di/configModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\n\nimport { configTypes } from \"./configTypes\";\n\nexport const configModuleFactory = (config: ContextModuleConfig) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind<ContextModuleConfig>(configTypes.Config).toConstantValue(config);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAIhCC,EAA4B,yBAErB,MAAMH,EAAuBI,GAClC,IAAI,kBAAgB,CAACC,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAA0B,cAAY,MAAM,EAAE,gBAAgBD,CAAM,CACtE,CAAC",
6
+ "names": ["configModuleFactory_exports", "__export", "configModuleFactory", "__toCommonJS", "import_inversify", "import_configTypes", "config", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var g=Object.defineProperty;var e=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var s=(f,o)=>{for(var c in o)g(f,c,{get:o[c],enumerable:!0})},t=(f,o,c,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of p(o))!r.call(f,n)&&n!==c&&g(f,n,{get:()=>o[n],enumerable:!(i=e(o,n))||i.enumerable});return f};var y=f=>t(g({},"__esModule",{value:!0}),f);var l={};s(l,{configTypes:()=>b});module.exports=y(l);const b={Config:Symbol.for("config")};0&&(module.exports={configTypes});
2
+ //# sourceMappingURL=configTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/config/di/configTypes.ts"],
4
+ "sourcesContent": ["export const configTypes = {\n Config: Symbol.for(\"config\"),\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAc,CACzB,OAAQ,OAAO,IAAI,QAAQ,CAC7B",
6
+ "names": ["configTypes_exports", "__export", "configTypes", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var d=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var p=(o,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of C(e))!l.call(o,t)&&t!==n&&d(o,t,{get:()=>e[t],enumerable:!(a=r(e,t))||a.enumerable});return o};var x=o=>p(d({},"__esModule",{value:!0}),o);var u={};module.exports=x(u);
2
+ //# sourceMappingURL=ContextModuleConfig.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/config/model/ContextModuleConfig.ts"],
4
+ "sourcesContent": ["import { type ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport { type TypedDataContextLoader } from \"@/typed-data/domain/TypedDataContextLoader\";\n\nexport type ContextModuleCalMode = \"prod\" | \"test\";\nexport type ContextModuleCalBranch = \"next\" | \"main\" | \"demo\";\n\nexport type ContextModuleCalConfig = {\n url: string;\n mode: ContextModuleCalMode;\n branch: ContextModuleCalBranch;\n};\n\nexport type ContextModuleConfig = {\n cal: ContextModuleCalConfig;\n defaultLoaders: boolean;\n customLoaders: ContextLoader[];\n customTypedDataLoader?: TypedDataContextLoader;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["ContextModuleConfig_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var s=(r,o)=>{for(var e in o)n(r,e,{get:o[e],enumerable:!0})},k=(r,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of C(o))!g.call(r,t)&&t!==e&&n(r,t,{get:()=>o[t],enumerable:!(a=F(o,t))||a.enumerable});return r};var x=r=>k(n({},"__esModule",{value:!0}),r);var A={};s(A,{makeContainer:()=>w});module.exports=x(A);var i=require("inversify"),m=require("./config/di/configModuleFactory"),f=require("./external-plugin/di/externalPluginModuleFactory"),p=require("./nft/di/nftModuleFactory"),c=require("./pki/di/pkiModuleFactory"),u=require("./token/di/tokenModuleFactory"),d=require("./transaction/di/transactionModuleFactory"),l=require("./trusted-name/di/trustedNameModuleFactory"),M=require("./typed-data/di/typedDataModuleFactory"),y=require("./uniswap/di/uniswapModuleFactory");const w=({config:r})=>{const o=new i.Container;return o.load((0,m.configModuleFactory)(r),(0,f.externalPluginModuleFactory)(),(0,p.nftModuleFactory)(),(0,u.tokenModuleFactory)(),(0,d.transactionModuleFactory)(),(0,l.trustedNameModuleFactory)(),(0,M.typedDataModuleFactory)(),(0,c.nanoPkiModuleFactory)(),(0,y.uniswapModuleFactory)()),o};0&&(module.exports={makeContainer});
2
+ //# sourceMappingURL=di.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/di.ts"],
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { nanoPkiModuleFactory } from \"@/pki/di/pkiModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { transactionModuleFactory } from \"@/transaction/di/transactionModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\nimport { uniswapModuleFactory } from \"@/uniswap/di/uniswapModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container.load(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n nftModuleFactory(),\n tokenModuleFactory(),\n transactionModuleFactory(),\n trustedNameModuleFactory(),\n typedDataModuleFactory(),\n nanoPkiModuleFactory(),\n uniswapModuleFactory(),\n );\n\n return container;\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0B,qBAE1BC,EAAoC,2CAEpCC,EAA4C,4DAC5CC,EAAiC,qCACjCC,EAAqC,qCACrCC,EAAmC,yCACnCC,EAAyC,qDACzCC,EAAyC,sDACzCC,EAAuC,kDACvCC,EAAqC,6CAM9B,MAAMX,EAAgB,CAAC,CAAE,OAAAY,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAI,YAEtB,OAAAA,EAAU,QACR,uBAAoBD,CAAM,KAC1B,+BAA4B,KAC5B,oBAAiB,KACjB,sBAAmB,KACnB,4BAAyB,KACzB,4BAAyB,KACzB,0BAAuB,KACvB,wBAAqB,KACrB,wBAAqB,CACvB,EAEOC,CACT",
6
+ "names": ["di_exports", "__export", "makeContainer", "__toCommonJS", "import_inversify", "import_configModuleFactory", "import_externalPluginModuleFactory", "import_nftModuleFactory", "import_pkiModuleFactory", "import_tokenModuleFactory", "import_transactionModuleFactory", "import_trustedNameModuleFactory", "import_typedDataModuleFactory", "import_uniswapModuleFactory", "config", "container"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var o=(r,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of a(t))!g.call(r,e)&&e!==s&&i(r,e,{get:()=>t[e],enumerable:!(n=c(t,e))||n.enumerable});return r};var d=r=>o(i({},"__esModule",{value:!0}),r);var l={};module.exports=d(l);
2
+ //# sourceMappingURL=DAppDto.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/external-plugin/data/DAppDto.ts"],
4
+ "sourcesContent": ["export interface DAppDto {\n b2c: B2c;\n abis: Abis;\n b2c_signatures: B2cSignatures;\n}\n\nexport interface B2c {\n blockchainName: string;\n chainId: number;\n contracts: Contract[];\n name: string;\n}\n\ninterface Contract {\n address: string;\n contractName: string;\n selectors: { [selector: string]: ContractSelector };\n}\n\ninterface ContractSelector {\n erc20OfInterest: string[];\n method: string;\n plugin: string;\n}\n\nexport interface Abis {\n [address: string]: object[];\n}\n\nexport interface B2cSignatures {\n [address: string]: {\n [selector: string]: B2cSignature;\n };\n}\n\ninterface B2cSignature {\n plugin: string;\n serialized_data: string;\n signature: string;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["DAppDto_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var o=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(r,e,a,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of i(e))!s.call(r,t)&&t!==a&&o(r,t,{get:()=>e[t],enumerable:!(p=n(e,t))||p.enumerable});return r};var m=r=>f(o({},"__esModule",{value:!0}),r);var D={};module.exports=m(D);
2
+ //# sourceMappingURL=ExternalPluginDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/external-plugin/data/ExternalPluginDataSource.ts"],
4
+ "sourcesContent": ["import { type HexaString } from \"@ledgerhq/device-management-kit\";\nimport { type Either } from \"purify-ts\";\n\nimport { type DappInfos } from \"@/external-plugin/model/DappInfos\";\n\nexport type GetDappInfos = {\n address: string;\n selector: HexaString;\n chainId: number;\n};\n\nexport interface ExternalPluginDataSource {\n getDappInfos(\n params: GetDappInfos,\n ): Promise<Either<Error, DappInfos | undefined>>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["ExternalPluginDataSource_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var _=Object.create;var f=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var o in t)f(e,o,{get:t[o],enumerable:!0})},D=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of w(t))!G.call(e,r)&&r!==o&&f(e,r,{get:()=>t[r],enumerable:!(i=g(t,r))||i.enumerable});return e};var C=(e,t,o)=>(o=e!=null?_(A(e)):{},D(t||!e||!e.__esModule?f(o,"default",{value:e,enumerable:!0}):o,e)),M=e=>D(f({},"__esModule",{value:!0}),e),h=(e,t,o,i)=>{for(var r=i>1?void 0:i?g(t,o):t,a=e.length-1,s;a>=0;a--)(s=e[a])&&(r=(i?s(t,o,r):s(r))||r);return i&&r&&f(t,o,r),r},b=(e,t)=>(o,i)=>t(o,i,e);var $={};L($,{HttpExternalPluginDataSource:()=>p});module.exports=M($);var x=C(require("axios")),c=require("inversify"),n=require("purify-ts"),E=require("../../config/di/configTypes"),I=C(require("../../../package.json"));let p=class{constructor(t){this.config=t}async getDappInfos({chainId:t,address:o,selector:i}){try{const r=await x.default.request({method:"GET",url:`${this.config.cal.url}/dapps`,params:{output:"b2c,b2c_signatures,abis",chain_id:t,contracts:o},headers:{"X-Ledger-Client-Version":`context-module/${I.default.version}`}});if(!r.data[0])return(0,n.Right)(void 0);o=o.toLowerCase(),i=`0x${i.slice(2).toLowerCase()}`;const{erc20OfInterest:a,method:s,plugin:m}=r.data[0].b2c?.contracts?.find(y=>y.address===o)?.selectors?.[i]||{},{signature:l,serialized_data:u}=r.data[0].b2c_signatures?.[o]?.[i]||{};if(!a||!s||!m||!l||!u)return(0,n.Right)(void 0);const d=r.data[0].abis?.[o];return d?(0,n.Right)({selectorDetails:{method:s,plugin:m,erc20OfInterest:a,signature:l,serializedData:u},abi:d}):(0,n.Right)(void 0)}catch{return(0,n.Left)(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"))}}};p=h([(0,c.injectable)(),b(0,(0,c.inject)(E.configTypes.Config))],p);0&&(module.exports={HttpExternalPluginDataSource});
2
+ //# sourceMappingURL=HttpExternalPluginDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { DAppDto } from \"@/external-plugin/data/DAppDto\";\nimport {\n ExternalPluginDataSource,\n GetDappInfos,\n} from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { DappInfos } from \"@/external-plugin/model/DappInfos\";\nimport { SelectorDetails } from \"@/external-plugin/model/SelectorDetails\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpExternalPluginDataSource implements ExternalPluginDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n async getDappInfos({\n chainId,\n address,\n selector,\n }: GetDappInfos): Promise<Either<Error, DappInfos | undefined>> {\n try {\n const dappInfos = await axios.request<DAppDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/dapps`,\n params: {\n output: \"b2c,b2c_signatures,abis\",\n chain_id: chainId,\n contracts: address,\n },\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n if (!dappInfos.data[0]) {\n return Right(undefined);\n }\n\n // Normalize the address and selector\n address = address.toLowerCase();\n selector = `0x${selector.slice(2).toLowerCase()}`;\n\n const { erc20OfInterest, method, plugin } =\n dappInfos.data[0].b2c?.contracts?.find((c) => c.address === address)\n ?.selectors?.[selector] || {};\n const { signature, serialized_data: serializedData } =\n dappInfos.data[0].b2c_signatures?.[address]?.[selector] || {};\n\n if (\n !erc20OfInterest ||\n !method ||\n !plugin ||\n !signature ||\n !serializedData\n ) {\n return Right(undefined);\n }\n\n const abi = dappInfos.data[0].abis?.[address];\n\n if (!abi) {\n return Right(undefined);\n }\n\n const selectorDetails: SelectorDetails = {\n method,\n plugin,\n erc20OfInterest,\n signature,\n serializedData,\n };\n\n return Right({ selectorDetails, abi });\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos\",\n ),\n );\n }\n }\n}\n"],
5
+ "mappings": "qtBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,oBAClBC,EAAmC,qBACnCC,EAAoC,qBAEpCC,EAA4B,mCAS5BC,EAAoB,iCAGb,IAAMC,EAAN,KAAuE,CAC5E,YAC+CC,EAC7C,CAD6C,YAAAA,CAC5C,CAEH,MAAM,aAAa,CACjB,QAAAC,EACA,QAAAC,EACA,SAAAC,CACF,EAAgE,CAC9D,GAAI,CACF,MAAMC,EAAY,MAAM,EAAAC,QAAM,QAAmB,CAC/C,OAAQ,MACR,IAAK,GAAG,KAAK,OAAO,IAAI,GAAG,SAC3B,OAAQ,CACN,OAAQ,0BACR,SAAUJ,EACV,UAAWC,CACb,EACA,QAAS,CACP,0BAA2B,kBAAkB,EAAAI,QAAQ,OAAO,EAC9D,CACF,CAAC,EAED,GAAI,CAACF,EAAU,KAAK,CAAC,EACnB,SAAO,SAAM,MAAS,EAIxBF,EAAUA,EAAQ,YAAY,EAC9BC,EAAW,KAAKA,EAAS,MAAM,CAAC,EAAE,YAAY,CAAC,GAE/C,KAAM,CAAE,gBAAAI,EAAiB,OAAAC,EAAQ,OAAAC,CAAO,EACtCL,EAAU,KAAK,CAAC,EAAE,KAAK,WAAW,KAAMM,GAAMA,EAAE,UAAYR,CAAO,GAC/D,YAAYC,CAAQ,GAAK,CAAC,EAC1B,CAAE,UAAAQ,EAAW,gBAAiBC,CAAe,EACjDR,EAAU,KAAK,CAAC,EAAE,iBAAiBF,CAAO,IAAIC,CAAQ,GAAK,CAAC,EAE9D,GACE,CAACI,GACD,CAACC,GACD,CAACC,GACD,CAACE,GACD,CAACC,EAED,SAAO,SAAM,MAAS,EAGxB,MAAMC,EAAMT,EAAU,KAAK,CAAC,EAAE,OAAOF,CAAO,EAE5C,OAAKW,KAYE,SAAM,CAAE,gBAR0B,CACvC,OAAAL,EACA,OAAAC,EACA,gBAAAF,EACA,UAAAI,EACA,eAAAC,CACF,EAEgC,IAAAC,CAAI,CAAC,KAX5B,SAAM,MAAS,CAY1B,MAAiB,CACf,SAAO,QACL,IAAI,MACF,yEACF,CACF,CACF,CACF,CACF,EAvEad,EAANe,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,cAAY,MAAM,IAFjBhB",
6
+ "names": ["HttpExternalPluginDataSource_exports", "__export", "HttpExternalPluginDataSource", "__toCommonJS", "import_axios", "import_inversify", "import_purify_ts", "import_configTypes", "import_package", "HttpExternalPluginDataSource", "config", "chainId", "address", "selector", "dappInfos", "axios", "PACKAGE", "erc20OfInterest", "method", "plugin", "c", "signature", "serializedData", "abi", "__decorateClass", "__decorateParam"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var x=Object.create;var l=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var I=(s,n,c,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of m(n))!h.call(s,e)&&e!==c&&l(s,e,{get:()=>n[e],enumerable:!(o=b(n,e))||o.enumerable});return s};var d=(s,n,c)=>(c=s!=null?x(g(s)):{},I(n||!s||!s.__esModule?l(c,"default",{value:s,enumerable:!0}):c,s));var a=d(require("axios")),u=d(require("@/external-plugin/__tests__/abi.json")),p=require("../../external-plugin/data/HttpExternalPluginDataSource"),f=d(require("../../../package.json"));vi.mock("axios");const r=s=>({data:s});describe("HttpExternalPuginDataSource",()=>{let s;const n={blockchainName:"ethereum",chainId:1,contracts:[{address:"0x1ef",contractName:"otherName",selectors:{"0x01ee":{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin"}}},{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin"}}}],name:"test"},c={"0x1ef":u.default,"0x0abc":u.default},o={"0x1ef":{"0x01ee":{plugin:"plugin",serialized_data:"0x001",signature:"0x002"}},"0x0abc":{"0x01ff":{plugin:"plugin",serialized_data:"0x001",signature:"0x002"}}};beforeAll(()=>{const e={cal:{url:"https://crypto-assets-service.api.ledger.com/v1"}};s=new p.HttpExternalPluginDataSource(e),vi.clearAllMocks()}),it("should call axios with the ledger client version header",async()=>{const e=`context-module/${f.default.version}`,t=vi.fn(()=>Promise.resolve({data:[]}));vi.spyOn(a.default,"request").mockImplementation(t),await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"}),expect(t).toHaveBeenCalledWith(expect.objectContaining({headers:{"X-Ledger-Client-Version":e}}))}),it("should return undefined when no abis is undefined",async()=>{const e=r([{b2c:n,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(e);const t=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(t.extract()).toEqual(void 0)}),it("should return undefined when no selectors",async()=>{const e=r([{abis:c,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(e);const t=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(t.extract()).toEqual(void 0)}),it("should return undefined when no abis data",async()=>{const e=r([{abis:{},b2c:n,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(e);const t=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(t.extract()).toEqual(void 0)}),it("should return undefined when no abis data",async()=>{const e=r([{abis:{},b2c:n,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(e);const t=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(t.extract()).toEqual(void 0)}),it("should return undefined when no abis data for the contract address",async()=>{const t=r([{abis:{"0x1":u.default},b2c:n,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(t);const i=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(i.extract()).toEqual(void 0)}),it("should return undefined when no b2c signature",async()=>{const e=r([{b2c:n,abis:c}]);vi.spyOn(a.default,"request").mockResolvedValue(e);const t=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(t.extract()).toEqual(void 0)}),it("should return undefined when no ecc20OfInterest",async()=>{const t=r([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{method:"swap",plugin:"plugin"}}}],name:"test"},abis:c,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(t);const i=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(i.extract()).toEqual(void 0)}),it("should return undefined when no method",async()=>{const t=r([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],plugin:"plugin"}}}],name:"test"},abis:c,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(t);const i=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(i.extract()).toEqual(void 0)}),it("should return undefined when no plugin",async()=>{const t=r([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],method:"swap"}}}],name:"test"},abis:c,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(t);const i=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(i.extract()).toEqual(void 0)}),it("should return undefined when no method",async()=>{const t=r([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],plugin:"plugin"}}}],name:"test"},abis:c,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(t);const i=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(i.extract()).toEqual(void 0)}),it("should return undefined when no signature",async()=>{const t=r([{b2c:n,abis:c,b2c_signatures:{"0x0abc":{"0x01ff":{plugin:"plugin",serialized_data:"0x001"}}}}]);vi.spyOn(a.default,"request").mockResolvedValue(t);const i=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(i.extract()).toEqual(void 0)}),it("should return undefined when no serialized data",async()=>{const t=r([{b2c:n,abis:c,b2c_signatures:{"0x0abc":{"0x01ff":{plugin:"plugin",signature:"0x002"}}}}]);vi.spyOn(a.default,"request").mockResolvedValue(t);const i=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(i.extract()).toEqual(void 0)}),it("should return a correct response",async()=>{const e=r([{b2c:n,abis:c,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(e);const t=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(t.extract()).toEqual({abi:u.default,selectorDetails:{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin",serializedData:"0x001",signature:"0x002"}})}),it("should normalize the address and selector",async()=>{const e=r([{b2c:n,abis:c,b2c_signatures:o}]);vi.spyOn(a.default,"request").mockResolvedValue(e);const t=await s.getDappInfos({chainId:1,address:"0x0AbC",selector:"0x01Ff"});expect(t.extract()).toEqual({abi:u.default,selectorDetails:{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin",serializedData:"0x001",signature:"0x002"}})}),it("should return an error when axios throws an error",async()=>{vi.spyOn(a.default,"request").mockRejectedValue(new Error("error"));const e=await s.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"))})});
2
+ //# sourceMappingURL=HttpExternalPluginDataSource.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.test.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport ABI from \"@/external-plugin/__tests__/abi.json\";\nimport {\n type Abis,\n type B2c,\n type B2cSignatures,\n type DAppDto,\n} from \"@/external-plugin/data/DAppDto\";\nimport { type ExternalPluginDataSource } from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { HttpExternalPluginDataSource } from \"@/external-plugin/data/HttpExternalPluginDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\nvi.mock(\"axios\");\n\nconst axiosResponseBuilder = (dto: Partial<DAppDto>[]) => {\n return { data: dto };\n};\n\ndescribe(\"HttpExternalPuginDataSource\", () => {\n let datasource: ExternalPluginDataSource;\n const exampleB2c: B2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x1ef\",\n contractName: \"otherName\",\n selectors: {\n \"0x01ee\": {\n erc20OfInterest: [\"fromToken\"],\n method: \"swap\",\n plugin: \"plugin\",\n },\n },\n },\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": {\n erc20OfInterest: [\"fromToken\"],\n method: \"swap\",\n plugin: \"plugin\",\n },\n },\n },\n ],\n name: \"test\",\n };\n const exampleAbis: Abis = { \"0x1ef\": ABI, \"0x0abc\": ABI };\n const exampleB2cSignatures: B2cSignatures = {\n \"0x1ef\": {\n \"0x01ee\": {\n plugin: \"plugin\",\n serialized_data: \"0x001\",\n signature: \"0x002\",\n },\n },\n \"0x0abc\": {\n \"0x01ff\": {\n plugin: \"plugin\",\n serialized_data: \"0x001\",\n signature: \"0x002\",\n },\n },\n };\n\n beforeAll(() => {\n const config = {\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n },\n } as ContextModuleConfig;\n datasource = new HttpExternalPluginDataSource(config);\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.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n it(\"should return undefined when no abis is undefined\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { b2c: exampleB2c, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no selectors\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no abis data\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { abis: {}, b2c: exampleB2c, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no abis data\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { abis: {}, b2c: exampleB2c, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no abis data for the contract address\", async () => {\n // GIVEN\n const abis: Abis = { \"0x1\": ABI };\n const response = axiosResponseBuilder([\n { abis, b2c: exampleB2c, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no b2c signature\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { b2c: exampleB2c, abis: exampleAbis },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no ecc20OfInterest\", async () => {\n // GIVEN\n const b2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": { method: \"swap\", plugin: \"plugin\" },\n },\n },\n ],\n name: \"test\",\n } as unknown as B2c;\n const response = axiosResponseBuilder([\n { b2c, abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no method\", async () => {\n // GIVEN\n const b2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": { erc20OfInterest: [\"fromToken\"], plugin: \"plugin\" },\n },\n },\n ],\n name: \"test\",\n } as unknown as B2c;\n const response = axiosResponseBuilder([\n { b2c, abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no plugin\", async () => {\n // GIVEN\n const b2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": { erc20OfInterest: [\"fromToken\"], method: \"swap\" },\n },\n },\n ],\n name: \"test\",\n } as unknown as B2c;\n const response = axiosResponseBuilder([\n { b2c, abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no method\", async () => {\n // GIVEN\n const b2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": { erc20OfInterest: [\"fromToken\"], plugin: \"plugin\" },\n },\n },\n ],\n name: \"test\",\n } as unknown as B2c;\n const response = axiosResponseBuilder([\n { b2c, abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no signature\", async () => {\n // GIVEN\n const B2CSignature = {\n \"0x0abc\": { \"0x01ff\": { plugin: \"plugin\", serialized_data: \"0x001\" } },\n } as unknown as B2cSignatures;\n\n // FIXME\n const response = axiosResponseBuilder([\n { b2c: exampleB2c, abis: exampleAbis, b2c_signatures: B2CSignature },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no serialized data\", async () => {\n // GIVEN\n const B2CSignature = {\n \"0x0abc\": { \"0x01ff\": { plugin: \"plugin\", signature: \"0x002\" } },\n } as unknown as B2cSignatures;\n\n // FIXME\n const response = axiosResponseBuilder([\n { b2c: exampleB2c, abis: exampleAbis, b2c_signatures: B2CSignature },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return a correct response\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n {\n b2c: exampleB2c,\n abis: exampleAbis,\n b2c_signatures: exampleB2cSignatures,\n },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"swap\",\n plugin: \"plugin\",\n serializedData: \"0x001\",\n signature: \"0x002\",\n },\n });\n });\n\n it(\"should normalize the address and selector\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n {\n b2c: exampleB2c,\n abis: exampleAbis,\n b2c_signatures: exampleB2cSignatures,\n },\n ]);\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0AbC\",\n selector: \"0x01Ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"swap\",\n plugin: \"plugin\",\n serializedData: \"0x001\",\n signature: \"0x002\",\n },\n });\n });\n\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.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos\",\n ),\n );\n });\n});\n"],
5
+ "mappings": "wdAAA,IAAAA,EAAkB,oBAGlBC,EAAgB,mDAQhBC,EAA6C,+DAC7CC,EAAoB,iCAEpB,GAAG,KAAK,OAAO,EAEf,MAAMC,EAAwBC,IACrB,CAAE,KAAMA,CAAI,GAGrB,SAAS,8BAA+B,IAAM,CAC5C,IAAIC,EACJ,MAAMC,EAAkB,CACtB,eAAgB,WAChB,QAAS,EACT,UAAW,CACT,CACE,QAAS,QACT,aAAc,YACd,UAAW,CACT,SAAU,CACR,gBAAiB,CAAC,WA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AWZ,EAAqB,CACpC,CACE,IAAKG,EACL,KAAMC,EACN,eAAgBE,CAClB,CACF,CAAC,EACD,GAAG,MAAM,EAAAK,QAAO,SAAS,EAAE,kBAAkBC,CAAQ,EAGrD,MAAMC,EAAS,MAAMX,EAAW,aAAa,CAC3C,QAAS,EACT,QAAS,SACT,SAAU,QACZ,CAAC,EAGD,OAAOW,EAAO,QAAQ,CAAC,EAAE,QAAQ,CAC/B,IAAK,EAAAR,QACL,gBAAiB,CACf,gBAAiB,CAAC,WAAW,EAC7B,OAAQ,OACR,OAAQ,SACR,eAAgB,QAChB,UAAW,OACb,CACF,CAAC,CACH,CAAC,EAED,GAAG,oDAAqD,SAAY,CAElE,GAAG,MAAM,EAAAM,QAAO,SAAS,EAAE,kBAAkB,IAAI,MAAM,OAAO,CAAC,EAG/D,MAAME,EAAS,MAAMX,EAAW,aAAa,CAC3C,QAAS,EACT,QAAS,SACT,SAAU,QACZ,CAAC,EAGD,OAAOW,EAAO,QAAQ,CAAC,EAAE,QACvB,IAAI,MACF,yEACF,CACF,CACF,CAAC,CACH,CAAC",
6
+ "names": ["import_axios", "import_abi", "import_HttpExternalPluginDataSource", "import_package", "axiosResponseBuilder", "dto", "datasource", "exampleB2c", "exampleAbis", "ABI", "exampleB2cSignatures", "config", "version", "PACKAGE", "requestSpy", "axios", "response", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var g=(t,o)=>{for(var r in o)a(t,r,{get:o[r],enumerable:!0})},P=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of p(o))!d.call(t,e)&&e!==r&&a(t,e,{get:()=>o[e],enumerable:!(n=m(o,e))||n.enumerable});return t};var c=t=>P(a({},"__esModule",{value:!0}),t);var E={};g(E,{externalPluginModuleFactory:()=>f});module.exports=c(E);var i=require("inversify"),u=require("../../external-plugin/data/HttpExternalPluginDataSource"),l=require("../../external-plugin/di/externalPluginTypes"),x=require("../../external-plugin/domain/ExternalPluginContextLoader");const f=()=>new i.ContainerModule((t,o,r,n)=>{t(l.externalPluginTypes.ExternalPluginDataSource).to(u.HttpExternalPluginDataSource),t(l.externalPluginTypes.ExternalPluginContextLoader).to(x.ExternalPluginContextLoader)});0&&(module.exports={externalPluginModuleFactory});
2
+ //# sourceMappingURL=externalPluginModuleFactory.js.map