@ledgerhq/context-module 0.0.0-develop-20241011001048 → 0.0.0-develop-20250219001044

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 (753) hide show
  1. package/LICENSE.MD +202 -0
  2. package/README.md +4 -6
  3. package/lib/cjs/index.js +2 -20
  4. package/lib/cjs/index.js.map +7 -1
  5. package/lib/cjs/package.json +54 -59
  6. package/lib/cjs/src/ContextModule.js +2 -3
  7. package/lib/cjs/src/ContextModule.js.map +7 -1
  8. package/lib/cjs/src/ContextModuleBuilder.js +2 -87
  9. package/lib/cjs/src/ContextModuleBuilder.js.map +7 -1
  10. package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
  11. package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
  12. package/lib/cjs/src/DefaultContextModule.js +2 -21
  13. package/lib/cjs/src/DefaultContextModule.js.map +7 -1
  14. package/lib/cjs/src/DefaultContextModule.test.js +2 -0
  15. package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
  16. package/lib/cjs/src/config/di/configModuleFactory.js +2 -10
  17. package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -1
  18. package/lib/cjs/src/config/di/configTypes.js +2 -7
  19. package/lib/cjs/src/config/di/configTypes.js.map +7 -1
  20. package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -3
  21. package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -1
  22. package/lib/cjs/src/di.js +2 -17
  23. package/lib/cjs/src/di.js.map +7 -1
  24. package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -3
  25. package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -1
  26. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -3
  27. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
  28. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -83
  29. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
  30. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  31. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  32. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -13
  33. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
  34. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -8
  35. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -1
  36. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -136
  37. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
  38. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  39. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  40. package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -3
  41. package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -1
  42. package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -3
  43. package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -1
  44. package/lib/cjs/src/index.js +2 -30
  45. package/lib/cjs/src/index.js.map +7 -1
  46. package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -57
  47. package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -1
  48. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
  49. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  50. package/lib/cjs/src/nft/data/NftDataSource.js +2 -3
  51. package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -1
  52. package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -13
  53. package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -1
  54. package/lib/cjs/src/nft/di/nftTypes.js +2 -8
  55. package/lib/cjs/src/nft/di/nftTypes.js.map +7 -1
  56. package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -111
  57. package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -1
  58. package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
  59. package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
  60. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.js +2 -0
  61. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.js.map +7 -0
  62. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.test.js +2 -0
  63. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.test.js.map +7 -0
  64. package/lib/cjs/src/pki/data/PkiCertificateDataSource.js +2 -0
  65. package/lib/cjs/src/pki/data/PkiCertificateDataSource.js.map +7 -0
  66. package/lib/cjs/src/pki/data/pkiDataSourceTypes.js +2 -0
  67. package/lib/cjs/src/pki/data/pkiDataSourceTypes.js.map +7 -0
  68. package/lib/cjs/src/pki/di/pkiModuleFactory.js +2 -0
  69. package/lib/cjs/src/pki/di/pkiModuleFactory.js.map +7 -0
  70. package/lib/cjs/src/pki/di/pkiTypes.js +2 -0
  71. package/lib/cjs/src/pki/di/pkiTypes.js.map +7 -0
  72. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js +2 -0
  73. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js.map +7 -0
  74. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js +2 -0
  75. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +7 -0
  76. package/lib/cjs/src/pki/domain/PkiCertificateLoader.js +2 -0
  77. package/lib/cjs/src/pki/domain/PkiCertificateLoader.js.map +7 -0
  78. package/lib/cjs/src/pki/model/KeyId.js +2 -0
  79. package/lib/cjs/src/pki/model/KeyId.js.map +7 -0
  80. package/lib/cjs/src/pki/model/KeyUsage.js +2 -0
  81. package/lib/cjs/src/pki/model/KeyUsage.js.map +7 -0
  82. package/lib/cjs/src/pki/model/PkiCertificate.js +2 -0
  83. package/lib/cjs/src/pki/model/PkiCertificate.js.map +7 -0
  84. package/lib/cjs/src/pki/model/PkiCertificateInfo.js +2 -0
  85. package/lib/cjs/src/pki/model/PkiCertificateInfo.js.map +7 -0
  86. package/lib/cjs/src/shared/domain/ContextLoader.js +2 -3
  87. package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -1
  88. package/lib/cjs/src/shared/model/ClearSignContext.js +2 -13
  89. package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -1
  90. package/lib/cjs/src/shared/model/GenericPath.js +2 -0
  91. package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
  92. package/lib/cjs/src/shared/model/SignatureTags.js +2 -0
  93. package/lib/cjs/src/shared/model/SignatureTags.js.map +7 -0
  94. package/lib/cjs/src/shared/model/TransactionContext.js +2 -3
  95. package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -1
  96. package/lib/cjs/src/shared/model/TransactionSubset.js +2 -3
  97. package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -1
  98. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -6
  99. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -1
  100. package/lib/cjs/src/shared/model/TypedDataContext.js +2 -3
  101. package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -1
  102. package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -15
  103. package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -1
  104. package/lib/cjs/src/shared/utils/HexStringUtils.test.js +2 -0
  105. package/lib/cjs/src/shared/utils/HexStringUtils.test.js.map +7 -0
  106. package/lib/cjs/src/shared/utils/KeyUsageMapper.js +2 -0
  107. package/lib/cjs/src/shared/utils/KeyUsageMapper.js.map +7 -0
  108. package/lib/cjs/src/shared/utils/KeyUsageMapper.test.js +2 -0
  109. package/lib/cjs/src/shared/utils/KeyUsageMapper.test.js.map +7 -0
  110. package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -83
  111. package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -1
  112. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
  113. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  114. package/lib/cjs/src/token/data/TokenDataSource.js +2 -3
  115. package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -1
  116. package/lib/cjs/src/token/data/TokenDto.js +2 -3
  117. package/lib/cjs/src/token/data/TokenDto.js.map +7 -1
  118. package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -13
  119. package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -1
  120. package/lib/cjs/src/token/di/tokenTypes.js +2 -8
  121. package/lib/cjs/src/token/di/tokenTypes.js.map +7 -1
  122. package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -74
  123. package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -1
  124. package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
  125. package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
  126. package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
  127. package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
  128. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
  129. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  130. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  131. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  132. package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
  133. package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
  134. package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
  135. package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
  136. package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
  137. package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
  138. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
  139. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  140. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  141. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  142. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  143. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  144. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  145. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  146. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
  147. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  148. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
  149. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  150. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  151. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  152. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
  153. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  154. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  155. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  156. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  157. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  158. package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -3
  159. package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -1
  160. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -163
  161. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
  162. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  163. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  164. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -3
  165. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -1
  166. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -13
  167. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
  168. package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -8
  169. package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -1
  170. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -127
  171. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
  172. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  173. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  174. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -3
  175. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
  176. package/lib/cjs/src/uniswap/constants/plugin.js +2 -0
  177. package/lib/cjs/src/uniswap/constants/plugin.js.map +7 -0
  178. package/lib/cjs/src/uniswap/constants/uniswap.js +2 -0
  179. package/lib/cjs/src/uniswap/constants/uniswap.js.map +7 -0
  180. package/lib/cjs/src/uniswap/constants/weth.js +2 -0
  181. package/lib/cjs/src/uniswap/constants/weth.js.map +7 -0
  182. package/lib/cjs/src/uniswap/data/AbiDecoderDataSource.js +2 -0
  183. package/lib/cjs/src/uniswap/data/AbiDecoderDataSource.js.map +7 -0
  184. package/lib/cjs/src/uniswap/data/CommandDecoderDataSource.js +2 -0
  185. package/lib/cjs/src/uniswap/data/CommandDecoderDataSource.js.map +7 -0
  186. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.js +2 -0
  187. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.js.map +7 -0
  188. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.test.js +2 -0
  189. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.test.js.map +7 -0
  190. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.js +2 -0
  191. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.js.map +7 -0
  192. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.test.js +2 -0
  193. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.test.js.map +7 -0
  194. package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js +2 -0
  195. package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js.map +7 -0
  196. package/lib/cjs/src/uniswap/di/uniswapTypes.js +2 -0
  197. package/lib/cjs/src/uniswap/di/uniswapTypes.js.map +7 -0
  198. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.js +2 -0
  199. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.js.map +7 -0
  200. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js +2 -0
  201. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js.map +7 -0
  202. package/lib/esm/index.js +2 -4
  203. package/lib/esm/index.js.map +7 -1
  204. package/lib/esm/package.json +54 -59
  205. package/lib/esm/src/ContextModule.js +1 -2
  206. package/lib/esm/src/ContextModule.js.map +7 -1
  207. package/lib/esm/src/ContextModuleBuilder.js +2 -83
  208. package/lib/esm/src/ContextModuleBuilder.js.map +7 -1
  209. package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
  210. package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
  211. package/lib/esm/src/DefaultContextModule.js +2 -17
  212. package/lib/esm/src/DefaultContextModule.js.map +7 -1
  213. package/lib/esm/src/DefaultContextModule.test.js +2 -0
  214. package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
  215. package/lib/esm/src/config/di/configModuleFactory.js +2 -6
  216. package/lib/esm/src/config/di/configModuleFactory.js.map +7 -1
  217. package/lib/esm/src/config/di/configTypes.js +2 -4
  218. package/lib/esm/src/config/di/configTypes.js.map +7 -1
  219. package/lib/esm/src/config/model/ContextModuleConfig.js +1 -2
  220. package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -1
  221. package/lib/esm/src/di.js +2 -13
  222. package/lib/esm/src/di.js.map +7 -1
  223. package/lib/esm/src/external-plugin/data/DAppDto.js +1 -2
  224. package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -1
  225. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -2
  226. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
  227. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -77
  228. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
  229. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  230. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  231. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -9
  232. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
  233. package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -5
  234. package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -1
  235. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -133
  236. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
  237. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  238. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  239. package/lib/esm/src/external-plugin/model/DappInfos.js +1 -2
  240. package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -1
  241. package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -2
  242. package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -1
  243. package/lib/esm/src/index.js +2 -14
  244. package/lib/esm/src/index.js.map +7 -1
  245. package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -51
  246. package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -1
  247. package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
  248. package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  249. package/lib/esm/src/nft/data/NftDataSource.js +1 -2
  250. package/lib/esm/src/nft/data/NftDataSource.js.map +7 -1
  251. package/lib/esm/src/nft/di/nftModuleFactory.js +2 -9
  252. package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -1
  253. package/lib/esm/src/nft/di/nftTypes.js +2 -5
  254. package/lib/esm/src/nft/di/nftTypes.js.map +7 -1
  255. package/lib/esm/src/nft/domain/NftContextLoader.js +2 -108
  256. package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -1
  257. package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
  258. package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
  259. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.js +2 -0
  260. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.js.map +7 -0
  261. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.test.js +2 -0
  262. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.test.js.map +7 -0
  263. package/lib/esm/src/pki/data/PkiCertificateDataSource.js +1 -0
  264. package/lib/esm/src/pki/data/PkiCertificateDataSource.js.map +7 -0
  265. package/lib/esm/src/pki/data/pkiDataSourceTypes.js +1 -0
  266. package/lib/esm/src/pki/data/pkiDataSourceTypes.js.map +7 -0
  267. package/lib/esm/src/pki/di/pkiModuleFactory.js +2 -0
  268. package/lib/esm/src/pki/di/pkiModuleFactory.js.map +7 -0
  269. package/lib/esm/src/pki/di/pkiTypes.js +2 -0
  270. package/lib/esm/src/pki/di/pkiTypes.js.map +7 -0
  271. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js +2 -0
  272. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js.map +7 -0
  273. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js +2 -0
  274. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +7 -0
  275. package/lib/esm/src/pki/domain/PkiCertificateLoader.js +1 -0
  276. package/lib/esm/src/pki/domain/PkiCertificateLoader.js.map +7 -0
  277. package/lib/esm/src/pki/model/KeyId.js +2 -0
  278. package/lib/esm/src/pki/model/KeyId.js.map +7 -0
  279. package/lib/esm/src/pki/model/KeyUsage.js +2 -0
  280. package/lib/esm/src/pki/model/KeyUsage.js.map +7 -0
  281. package/lib/esm/src/pki/model/PkiCertificate.js +1 -0
  282. package/lib/esm/src/pki/model/PkiCertificate.js.map +7 -0
  283. package/lib/esm/src/pki/model/PkiCertificateInfo.js +1 -0
  284. package/lib/esm/src/pki/model/PkiCertificateInfo.js.map +7 -0
  285. package/lib/esm/src/shared/domain/ContextLoader.js +1 -2
  286. package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -1
  287. package/lib/esm/src/shared/model/ClearSignContext.js +2 -10
  288. package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -1
  289. package/lib/esm/src/shared/model/GenericPath.js +2 -0
  290. package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
  291. package/lib/esm/src/shared/model/SignatureTags.js +2 -0
  292. package/lib/esm/src/shared/model/SignatureTags.js.map +7 -0
  293. package/lib/esm/src/shared/model/TransactionContext.js +1 -2
  294. package/lib/esm/src/shared/model/TransactionContext.js.map +7 -1
  295. package/lib/esm/src/shared/model/TransactionSubset.js +1 -2
  296. package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -1
  297. package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -3
  298. package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -1
  299. package/lib/esm/src/shared/model/TypedDataContext.js +1 -2
  300. package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -1
  301. package/lib/esm/src/shared/utils/HexStringUtils.js +2 -11
  302. package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -1
  303. package/lib/esm/src/shared/utils/HexStringUtils.test.js +2 -0
  304. package/lib/esm/src/shared/utils/HexStringUtils.test.js.map +7 -0
  305. package/lib/esm/src/shared/utils/KeyUsageMapper.js +2 -0
  306. package/lib/esm/src/shared/utils/KeyUsageMapper.js.map +7 -0
  307. package/lib/esm/src/shared/utils/KeyUsageMapper.test.js +2 -0
  308. package/lib/esm/src/shared/utils/KeyUsageMapper.test.js.map +7 -0
  309. package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -77
  310. package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -1
  311. package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
  312. package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  313. package/lib/esm/src/token/data/TokenDataSource.js +1 -2
  314. package/lib/esm/src/token/data/TokenDataSource.js.map +7 -1
  315. package/lib/esm/src/token/data/TokenDto.js +1 -2
  316. package/lib/esm/src/token/data/TokenDto.js.map +7 -1
  317. package/lib/esm/src/token/di/tokenModuleFactory.js +2 -9
  318. package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -1
  319. package/lib/esm/src/token/di/tokenTypes.js +2 -5
  320. package/lib/esm/src/token/di/tokenTypes.js.map +7 -1
  321. package/lib/esm/src/token/domain/TokenContextLoader.js +2 -71
  322. package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -1
  323. package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
  324. package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
  325. package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
  326. package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
  327. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
  328. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  329. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  330. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  331. package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
  332. package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
  333. package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
  334. package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
  335. package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
  336. package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
  337. package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
  338. package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  339. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  340. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  341. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  342. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  343. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  344. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  345. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
  346. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  347. package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
  348. package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  349. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  350. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  351. package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
  352. package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  353. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  354. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  355. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  356. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  357. package/lib/esm/src/typed-data/data/FiltersDto.js +1 -2
  358. package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -1
  359. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -157
  360. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
  361. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  362. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  363. package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -2
  364. package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -1
  365. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -9
  366. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
  367. package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -5
  368. package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -1
  369. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -124
  370. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
  371. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  372. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  373. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -2
  374. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
  375. package/lib/esm/src/uniswap/constants/plugin.js +2 -0
  376. package/lib/esm/src/uniswap/constants/plugin.js.map +7 -0
  377. package/lib/esm/src/uniswap/constants/uniswap.js +2 -0
  378. package/lib/esm/src/uniswap/constants/uniswap.js.map +7 -0
  379. package/lib/esm/src/uniswap/constants/weth.js +2 -0
  380. package/lib/esm/src/uniswap/constants/weth.js.map +7 -0
  381. package/lib/esm/src/uniswap/data/AbiDecoderDataSource.js +1 -0
  382. package/lib/esm/src/uniswap/data/AbiDecoderDataSource.js.map +7 -0
  383. package/lib/esm/src/uniswap/data/CommandDecoderDataSource.js +1 -0
  384. package/lib/esm/src/uniswap/data/CommandDecoderDataSource.js.map +7 -0
  385. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.js +2 -0
  386. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.js.map +7 -0
  387. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.test.js +2 -0
  388. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.test.js.map +7 -0
  389. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.js +2 -0
  390. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.js.map +7 -0
  391. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.test.js +2 -0
  392. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.test.js.map +7 -0
  393. package/lib/esm/src/uniswap/di/uniswapModuleFactory.js +2 -0
  394. package/lib/esm/src/uniswap/di/uniswapModuleFactory.js.map +7 -0
  395. package/lib/esm/src/uniswap/di/uniswapTypes.js +2 -0
  396. package/lib/esm/src/uniswap/di/uniswapTypes.js.map +7 -0
  397. package/lib/esm/src/uniswap/domain/UniswapContextLoader.js +2 -0
  398. package/lib/esm/src/uniswap/domain/UniswapContextLoader.js.map +7 -0
  399. package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js +2 -0
  400. package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js.map +7 -0
  401. package/lib/{cjs → types}/src/ContextModule.d.ts +3 -2
  402. package/lib/types/src/ContextModule.d.ts.map +1 -0
  403. package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +9 -11
  404. package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -0
  405. package/lib/types/src/ContextModuleBuilder.test.d.ts +2 -0
  406. package/lib/types/src/ContextModuleBuilder.test.d.ts.map +1 -0
  407. package/lib/types/src/DefaultContextModule.d.ts +18 -0
  408. package/lib/types/src/DefaultContextModule.d.ts.map +1 -0
  409. package/lib/types/src/DefaultContextModule.test.d.ts +2 -0
  410. package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
  411. package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +1 -1
  412. package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts.map +1 -1
  413. package/lib/types/src/config/model/ContextModuleConfig.d.ts +16 -0
  414. package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -0
  415. package/lib/{cjs → types}/src/di.d.ts +1 -1
  416. package/lib/types/src/di.d.ts.map +1 -0
  417. package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
  418. package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -0
  419. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts +2 -0
  420. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts.map +1 -0
  421. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts +2 -0
  422. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts.map +1 -0
  423. package/lib/types/src/external-plugin/model/DappInfos.d.ts +6 -0
  424. package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -0
  425. package/lib/{cjs → types}/src/index.d.ts +8 -1
  426. package/lib/types/src/index.d.ts.map +1 -0
  427. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts +2 -0
  428. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts.map +1 -0
  429. package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts +1 -1
  430. package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -0
  431. package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts +2 -1
  432. package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -0
  433. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts +2 -0
  434. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts.map +1 -0
  435. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.d.ts +12 -0
  436. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.d.ts.map +1 -0
  437. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.test.d.ts +2 -0
  438. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.test.d.ts.map +1 -0
  439. package/lib/types/src/pki/data/PkiCertificateDataSource.d.ts +7 -0
  440. package/lib/types/src/pki/data/PkiCertificateDataSource.d.ts.map +1 -0
  441. package/lib/types/src/pki/data/pkiDataSourceTypes.d.ts +23 -0
  442. package/lib/types/src/pki/data/pkiDataSourceTypes.d.ts.map +1 -0
  443. package/lib/types/src/pki/di/pkiModuleFactory.d.ts +3 -0
  444. package/lib/types/src/pki/di/pkiModuleFactory.d.ts.map +1 -0
  445. package/lib/types/src/pki/di/pkiTypes.d.ts +5 -0
  446. package/lib/types/src/pki/di/pkiTypes.d.ts.map +1 -0
  447. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts +10 -0
  448. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts.map +1 -0
  449. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.test.d.ts +2 -0
  450. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.test.d.ts.map +1 -0
  451. package/lib/types/src/pki/domain/PkiCertificateLoader.d.ts +6 -0
  452. package/lib/types/src/pki/domain/PkiCertificateLoader.d.ts.map +1 -0
  453. package/lib/types/src/pki/model/KeyId.d.ts +14 -0
  454. package/lib/types/src/pki/model/KeyId.d.ts.map +1 -0
  455. package/lib/types/src/pki/model/KeyUsage.d.ts +15 -0
  456. package/lib/types/src/pki/model/KeyUsage.d.ts.map +1 -0
  457. package/lib/types/src/pki/model/PkiCertificate.d.ts +5 -0
  458. package/lib/types/src/pki/model/PkiCertificate.d.ts.map +1 -0
  459. package/lib/types/src/pki/model/PkiCertificateInfo.d.ts +7 -0
  460. package/lib/types/src/pki/model/PkiCertificateInfo.d.ts.map +1 -0
  461. package/lib/types/src/shared/domain/ContextLoader.d.ts +7 -0
  462. package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -0
  463. package/lib/types/src/shared/model/ClearSignContext.d.ts +51 -0
  464. package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -0
  465. package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
  466. package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
  467. package/lib/types/src/shared/model/SignatureTags.d.ts +3 -0
  468. package/lib/types/src/shared/model/SignatureTags.d.ts.map +1 -0
  469. package/lib/types/src/shared/model/TransactionContext.d.ts +21 -0
  470. package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -0
  471. package/lib/types/src/shared/utils/HexStringUtils.d.ts +5 -0
  472. package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +1 -1
  473. package/lib/types/src/shared/utils/HexStringUtils.test.d.ts +2 -0
  474. package/lib/types/src/shared/utils/HexStringUtils.test.d.ts.map +1 -0
  475. package/lib/types/src/shared/utils/KeyUsageMapper.d.ts +6 -0
  476. package/lib/types/src/shared/utils/KeyUsageMapper.d.ts.map +1 -0
  477. package/lib/types/src/shared/utils/KeyUsageMapper.test.d.ts +2 -0
  478. package/lib/types/src/shared/utils/KeyUsageMapper.test.d.ts.map +1 -0
  479. package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
  480. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
  481. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
  482. package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +1 -1
  483. package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -0
  484. package/lib/types/src/token/data/TokenDto.d.ts +16 -0
  485. package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
  486. package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +2 -1
  487. package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -0
  488. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
  489. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
  490. package/lib/types/src/transaction/data/CalldataDto.d.ts +128 -0
  491. package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
  492. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +23 -0
  493. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
  494. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
  495. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
  496. package/lib/types/src/transaction/data/TransactionDataSource.d.ts +13 -0
  497. package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
  498. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
  499. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
  500. package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
  501. package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
  502. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
  503. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
  504. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
  505. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
  506. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
  507. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
  508. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
  509. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
  510. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
  511. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
  512. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
  513. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
  514. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
  515. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
  516. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
  517. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
  518. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
  519. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
  520. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
  521. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
  522. package/lib/{cjs → types}/src/typed-data/data/FiltersDto.d.ts +3 -0
  523. package/lib/types/src/typed-data/data/FiltersDto.d.ts.map +1 -0
  524. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -0
  525. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +3 -0
  526. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -0
  527. package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
  528. package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -0
  529. package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
  530. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
  531. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
  532. package/lib/types/src/uniswap/constants/plugin.d.ts +3 -0
  533. package/lib/types/src/uniswap/constants/plugin.d.ts.map +1 -0
  534. package/lib/types/src/uniswap/constants/uniswap.d.ts +21 -0
  535. package/lib/types/src/uniswap/constants/uniswap.d.ts.map +1 -0
  536. package/lib/types/src/uniswap/constants/weth.d.ts +20 -0
  537. package/lib/types/src/uniswap/constants/weth.d.ts.map +1 -0
  538. package/lib/types/src/uniswap/data/AbiDecoderDataSource.d.ts +5 -0
  539. package/lib/types/src/uniswap/data/AbiDecoderDataSource.d.ts.map +1 -0
  540. package/lib/types/src/uniswap/data/CommandDecoderDataSource.d.ts +6 -0
  541. package/lib/types/src/uniswap/data/CommandDecoderDataSource.d.ts.map +1 -0
  542. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.d.ts +14 -0
  543. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.d.ts.map +1 -0
  544. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.test.d.ts +2 -0
  545. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.test.d.ts.map +1 -0
  546. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.d.ts +5 -0
  547. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.d.ts.map +1 -0
  548. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.test.d.ts +2 -0
  549. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.test.d.ts.map +1 -0
  550. package/lib/types/src/uniswap/di/uniswapModuleFactory.d.ts +3 -0
  551. package/lib/types/src/uniswap/di/uniswapModuleFactory.d.ts.map +1 -0
  552. package/lib/types/src/uniswap/di/uniswapTypes.d.ts +6 -0
  553. package/lib/types/src/uniswap/di/uniswapTypes.d.ts.map +1 -0
  554. package/lib/types/src/uniswap/domain/UniswapContextLoader.d.ts +105 -0
  555. package/lib/types/src/uniswap/domain/UniswapContextLoader.d.ts.map +1 -0
  556. package/lib/types/src/uniswap/domain/UniswapContextLoader.test.d.ts +2 -0
  557. package/lib/types/src/uniswap/domain/UniswapContextLoader.test.d.ts.map +1 -0
  558. package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
  559. package/package.json +25 -30
  560. package/lib/cjs/src/ContextModule.d.ts.map +0 -1
  561. package/lib/cjs/src/ContextModuleBuilder.d.ts.map +0 -1
  562. package/lib/cjs/src/DefaultContextModule.d.ts +0 -20
  563. package/lib/cjs/src/DefaultContextModule.d.ts.map +0 -1
  564. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts +0 -9
  565. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  566. package/lib/cjs/src/di.d.ts.map +0 -1
  567. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  568. package/lib/cjs/src/external-plugin/model/DappInfos.d.ts +0 -6
  569. package/lib/cjs/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  570. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  571. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  572. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js +0 -3
  573. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  574. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  575. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  576. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -40
  577. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  578. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  579. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  580. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js +0 -13
  581. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  582. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  583. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  584. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js +0 -8
  585. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  586. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  587. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  588. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -66
  589. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  590. package/lib/cjs/src/index.d.ts.map +0 -1
  591. package/lib/cjs/src/nft/data/NftDataSource.d.ts.map +0 -1
  592. package/lib/cjs/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  593. package/lib/cjs/src/shared/domain/ContextLoader.d.ts +0 -6
  594. package/lib/cjs/src/shared/domain/ContextLoader.d.ts.map +0 -1
  595. package/lib/cjs/src/shared/model/ClearSignContext.d.ts +0 -21
  596. package/lib/cjs/src/shared/model/ClearSignContext.d.ts.map +0 -1
  597. package/lib/cjs/src/shared/model/TransactionContext.d.ts +0 -6
  598. package/lib/cjs/src/shared/model/TransactionContext.d.ts.map +0 -1
  599. package/lib/cjs/src/shared/utils/HexStringUtils.d.ts +0 -4
  600. package/lib/cjs/src/token/data/TokenDataSource.d.ts.map +0 -1
  601. package/lib/cjs/src/token/data/TokenDto.d.ts +0 -6
  602. package/lib/cjs/src/token/data/TokenDto.d.ts.map +0 -1
  603. package/lib/cjs/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  604. package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  605. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  606. package/lib/cjs/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  607. package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  608. package/lib/esm/index.d.ts +0 -3
  609. package/lib/esm/index.d.ts.map +0 -1
  610. package/lib/esm/src/ContextModule.d.ts +0 -9
  611. package/lib/esm/src/ContextModule.d.ts.map +0 -1
  612. package/lib/esm/src/ContextModuleBuilder.d.ts +0 -45
  613. package/lib/esm/src/ContextModuleBuilder.d.ts.map +0 -1
  614. package/lib/esm/src/DefaultContextModule.d.ts +0 -20
  615. package/lib/esm/src/DefaultContextModule.d.ts.map +0 -1
  616. package/lib/esm/src/config/di/configModuleFactory.d.ts +0 -4
  617. package/lib/esm/src/config/di/configModuleFactory.d.ts.map +0 -1
  618. package/lib/esm/src/config/di/configTypes.d.ts +0 -4
  619. package/lib/esm/src/config/di/configTypes.d.ts.map +0 -1
  620. package/lib/esm/src/config/model/ContextModuleConfig.d.ts +0 -9
  621. package/lib/esm/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  622. package/lib/esm/src/di.d.ts +0 -8
  623. package/lib/esm/src/di.d.ts.map +0 -1
  624. package/lib/esm/src/external-plugin/data/DAppDto.d.ts +0 -38
  625. package/lib/esm/src/external-plugin/data/DAppDto.d.ts.map +0 -1
  626. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -12
  627. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  628. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -10
  629. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -1
  630. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -3
  631. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -1
  632. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts +0 -5
  633. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -1
  634. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -15
  635. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -1
  636. package/lib/esm/src/external-plugin/model/DappInfos.d.ts +0 -6
  637. package/lib/esm/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  638. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts +0 -8
  639. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts.map +0 -1
  640. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  641. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  642. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js +0 -2
  643. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  644. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  645. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  646. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -34
  647. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  648. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  649. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  650. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js +0 -9
  651. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  652. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  653. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  654. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js +0 -5
  655. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  656. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  657. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  658. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -63
  659. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  660. package/lib/esm/src/index.d.ts +0 -14
  661. package/lib/esm/src/index.d.ts.map +0 -1
  662. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts +0 -7
  663. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts.map +0 -1
  664. package/lib/esm/src/nft/data/NftDataSource.d.ts +0 -15
  665. package/lib/esm/src/nft/data/NftDataSource.d.ts.map +0 -1
  666. package/lib/esm/src/nft/di/nftModuleFactory.d.ts +0 -3
  667. package/lib/esm/src/nft/di/nftModuleFactory.d.ts.map +0 -1
  668. package/lib/esm/src/nft/di/nftTypes.d.ts +0 -5
  669. package/lib/esm/src/nft/di/nftTypes.d.ts.map +0 -1
  670. package/lib/esm/src/nft/domain/NftContextLoader.d.ts +0 -11
  671. package/lib/esm/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  672. package/lib/esm/src/shared/domain/ContextLoader.d.ts +0 -6
  673. package/lib/esm/src/shared/domain/ContextLoader.d.ts.map +0 -1
  674. package/lib/esm/src/shared/model/ClearSignContext.d.ts +0 -21
  675. package/lib/esm/src/shared/model/ClearSignContext.d.ts.map +0 -1
  676. package/lib/esm/src/shared/model/TransactionContext.d.ts +0 -6
  677. package/lib/esm/src/shared/model/TransactionContext.d.ts.map +0 -1
  678. package/lib/esm/src/shared/model/TransactionSubset.d.ts +0 -6
  679. package/lib/esm/src/shared/model/TransactionSubset.d.ts.map +0 -1
  680. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts +0 -33
  681. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -1
  682. package/lib/esm/src/shared/model/TypedDataContext.d.ts +0 -16
  683. package/lib/esm/src/shared/model/TypedDataContext.d.ts.map +0 -1
  684. package/lib/esm/src/shared/utils/HexStringUtils.d.ts +0 -4
  685. package/lib/esm/src/shared/utils/HexStringUtils.d.ts.map +0 -1
  686. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts +0 -9
  687. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts.map +0 -1
  688. package/lib/esm/src/token/data/TokenDataSource.d.ts +0 -9
  689. package/lib/esm/src/token/data/TokenDataSource.d.ts.map +0 -1
  690. package/lib/esm/src/token/data/TokenDto.d.ts +0 -6
  691. package/lib/esm/src/token/data/TokenDto.d.ts.map +0 -1
  692. package/lib/esm/src/token/di/tokenModuleFactory.d.ts +0 -3
  693. package/lib/esm/src/token/di/tokenModuleFactory.d.ts.map +0 -1
  694. package/lib/esm/src/token/di/tokenTypes.d.ts +0 -5
  695. package/lib/esm/src/token/di/tokenTypes.d.ts.map +0 -1
  696. package/lib/esm/src/token/domain/TokenContextLoader.d.ts +0 -15
  697. package/lib/esm/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  698. package/lib/esm/src/typed-data/data/FiltersDto.d.ts +0 -55
  699. package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  700. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -14
  701. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  702. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts +0 -17
  703. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  704. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts +0 -3
  705. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -1
  706. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts +0 -5
  707. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts.map +0 -1
  708. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -13
  709. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -1
  710. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -6
  711. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -1
  712. package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
  713. /package/lib/{cjs → types}/index.d.ts +0 -0
  714. /package/lib/{cjs → types}/index.d.ts.map +0 -0
  715. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts +0 -0
  716. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts.map +0 -0
  717. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts +0 -0
  718. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts.map +0 -0
  719. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -0
  720. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -0
  721. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -0
  722. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -0
  723. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts +0 -0
  724. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -0
  725. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -0
  726. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -0
  727. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts +0 -0
  728. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts.map +0 -0
  729. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts +0 -0
  730. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts.map +0 -0
  731. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts +0 -0
  732. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts.map +0 -0
  733. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts +0 -0
  734. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts.map +0 -0
  735. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
  736. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
  737. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
  738. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
  739. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
  740. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
  741. /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
  742. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts +0 -0
  743. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts.map +0 -0
  744. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts +0 -0
  745. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts.map +0 -0
  746. /package/lib/{cjs → types}/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -0
  747. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts +0 -0
  748. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -0
  749. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts +0 -0
  750. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts.map +0 -0
  751. /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -0
  752. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
  753. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
@@ -1,133 +1,2 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- import { isHexaString } from "@ledgerhq/device-management-kit";
14
- import { Interface } from "ethers";
15
- import { inject, injectable } from "inversify";
16
- import { EitherAsync, Left, Right } from "purify-ts";
17
- import { externalPluginTypes } from "../../external-plugin/di/externalPluginTypes";
18
- import { ClearSignContextType, } from "../../shared/model/ClearSignContext";
19
- import { tokenTypes } from "../../token/di/tokenTypes";
20
- let ExternalPluginContextLoader = class ExternalPluginContextLoader {
21
- _externalPluginDataSource;
22
- _tokenDataSource;
23
- constructor(externalPluginDataSource, tokenDataSource) {
24
- this._externalPluginDataSource = externalPluginDataSource;
25
- this._tokenDataSource = tokenDataSource;
26
- }
27
- async load(transaction) {
28
- if (!transaction.to || !transaction.data || transaction.data === "0x") {
29
- return [];
30
- }
31
- const selector = transaction.data.slice(0, 10);
32
- if (!isHexaString(selector)) {
33
- return [
34
- {
35
- type: ClearSignContextType.ERROR,
36
- error: new Error("Invalid selector"),
37
- },
38
- ];
39
- }
40
- const eitherDappInfos = await this._externalPluginDataSource.getDappInfos({
41
- address: transaction.to,
42
- chainId: transaction.chainId,
43
- selector,
44
- });
45
- return EitherAsync(async ({ liftEither }) => {
46
- const dappInfos = await liftEither(eitherDappInfos);
47
- // if the dappInfos is null, return an empty array
48
- // this means that the selector is not a known selector
49
- if (!dappInfos) {
50
- return [];
51
- }
52
- const externalPluginContext = {
53
- type: ClearSignContextType.EXTERNAL_PLUGIN,
54
- payload: dappInfos.selectorDetails.serializedData.concat(dappInfos.selectorDetails.signature),
55
- };
56
- const decodedCallData = this.getDecodedCallData(dappInfos.abi, dappInfos.selectorDetails.method, transaction.data);
57
- // if the call data cannot be decoded, return the error
58
- // but also the externalPluginContext because it is still valid
59
- if (decodedCallData.isLeft()) {
60
- return [
61
- {
62
- type: ClearSignContextType.ERROR,
63
- error: decodedCallData.extract(),
64
- },
65
- externalPluginContext,
66
- ];
67
- }
68
- // decodedCallData is a Right so we can extract it safely
69
- const extractedDecodedCallData = decodedCallData.extract();
70
- // get the token payload for each erc20OfInterest
71
- // and return the payload or the error
72
- const promises = dappInfos.selectorDetails.erc20OfInterest.map(async (erc20Path) => this.getTokenPayload(transaction, erc20Path, extractedDecodedCallData));
73
- const tokensPayload = await Promise.all(promises);
74
- // map the payload or the error to a ClearSignContext
75
- const contexts = tokensPayload.map((eitherToken) => eitherToken.caseOf({
76
- Left: (error) => ({ type: ClearSignContextType.ERROR, error }),
77
- Right: (payload) => ({ type: ClearSignContextType.TOKEN, payload }),
78
- }));
79
- return [...contexts, externalPluginContext];
80
- }).caseOf({
81
- // parse all errors into ClearSignContext
82
- Left: (error) => [{ type: ClearSignContextType.ERROR, error }],
83
- Right: (contexts) => contexts,
84
- });
85
- }
86
- getTokenPayload(transaction, erc20Path, decodedCallData) {
87
- const address = this.getAddressFromPath(erc20Path, decodedCallData);
88
- return EitherAsync(({ fromPromise }) => fromPromise(this._tokenDataSource.getTokenInfosPayload({
89
- address,
90
- chainId: transaction.chainId,
91
- })));
92
- }
93
- getDecodedCallData(abi, method, data) {
94
- try {
95
- const contractInterface = new Interface(abi);
96
- return Right(contractInterface.decodeFunctionData(method, data));
97
- }
98
- catch (_error) {
99
- return Left(new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi"));
100
- }
101
- }
102
- getAddressFromPath(path, decodedCallData) {
103
- // ethers.Result is a record string, any
104
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
105
- let value = decodedCallData;
106
- for (const key of path.split(".")) {
107
- // In Solidity, a struct cannot begin with a number
108
- // Additionally, when we use -1, it signifies the last element of the array.
109
- if (key === "-1") {
110
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
111
- value = value[value.length - 1];
112
- }
113
- else {
114
- // This access can throw a RangeError error in case of an invalid key
115
- // but is correctly caught by the liftEither above
116
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
117
- value = value[key];
118
- }
119
- }
120
- if (!isHexaString(value)) {
121
- throw new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address");
122
- }
123
- return value;
124
- }
125
- };
126
- ExternalPluginContextLoader = __decorate([
127
- injectable(),
128
- __param(0, inject(externalPluginTypes.ExternalPluginDataSource)),
129
- __param(1, inject(tokenTypes.TokenDataSource)),
130
- __metadata("design:paramtypes", [Object, Object])
131
- ], ExternalPluginContextLoader);
132
- export { ExternalPluginContextLoader };
133
- //# sourceMappingURL=ExternalPluginContextLoader.js.map
1
+ var C=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var g=(s,e,a,r)=>{for(var t=r>1?void 0:r?S(e,a):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(t=(r?n(e,a,t):n(t))||t);return r&&t&&C(e,a,t),t},p=(s,e)=>(a,r)=>e(a,r,s);import{isHexaString as x}from"@ledgerhq/device-management-kit";import{Interface as y}from"ethers";import{inject as f,injectable as E}from"inversify";import{EitherAsync as m,Left as R,Right as P}from"purify-ts";import{externalPluginTypes as k}from"../../external-plugin/di/externalPluginTypes";import{ClearSignContextType as i}from"../../shared/model/ClearSignContext";import{tokenTypes as T}from"../../token/di/tokenTypes";let l=class{_externalPluginDataSource;_tokenDataSource;constructor(e,a){this._externalPluginDataSource=e,this._tokenDataSource=a}async load(e){if(!e.to||!e.data||e.data==="0x")return[];const a=e.data.slice(0,10);if(!x(a))return[{type:i.ERROR,error:new Error("Invalid selector")}];const r=await this._externalPluginDataSource.getDappInfos({address:e.to,chainId:e.chainId,selector:a});return m(async({liftEither:t})=>{const o=await t(r);if(!o)return[];const n={type:i.EXTERNAL_PLUGIN,payload:o.selectorDetails.serializedData.concat(o.selectorDetails.signature)},c=this.getDecodedCallData(o.abi,o.selectorDetails.method,e.data);if(c.isLeft())return[{type:i.ERROR,error:c.extract()},n];const D=c.extract(),h=o.selectorDetails.erc20OfInterest.map(async d=>this.getTokenPayload(e,d,D));return[...(await Promise.all(h)).map(d=>d.caseOf({Left:u=>({type:i.ERROR,error:u}),Right:u=>({type:i.TOKEN,payload:u})})),n]}).caseOf({Left:t=>[{type:i.ERROR,error:t}],Right:t=>t})}getTokenPayload(e,a,r){const t=this.getAddressFromPath(a,r);return m(({fromPromise:o})=>o(this._tokenDataSource.getTokenInfosPayload({address:t,chainId:e.chainId})))}getDecodedCallData(e,a,r){try{const t=new y(e);return P(t.decodeFunctionData(a,r))}catch{return R(new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi"))}}getAddressFromPath(e,a){let r=a;for(const t of e.split("."))t==="-1"?r=r[r.length-1]:r=r[t];if(!x(r))throw new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address");return r}};l=g([E(),p(0,f(k.ExternalPluginDataSource)),p(1,f(T.TokenDataSource))],l);export{l as ExternalPluginContextLoader};
2
+ //# sourceMappingURL=ExternalPluginContextLoader.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"ExternalPluginContextLoader.js","sourceRoot":"","sources":["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAU,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAU,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAEL,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG5C,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAC9B,yBAAyB,CAA2B;IACpD,gBAAgB,CAAkB;IAE1C,YAEE,wBAAkD,EACd,eAAgC;QAEpE,IAAI,CAAC,yBAAyB,GAAG,wBAAwB,CAAC;QAC1D,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAA+B;QACxC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,I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CAAA;AArKY,2BAA2B;IADvC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,mBAAmB,CAAC,wBAAwB,CAAC,CAAA;IAEpD,WAAA,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;;GAP1B,2BAA2B,CAqKvC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.ts"],
4
+ "sourcesContent": ["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"],
5
+ "mappings": "iOAAA,OAAqB,gBAAAA,MAAoB,kCACzC,OAAiB,aAAAC,MAAiB,SAClC,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YACnC,OAAiB,eAAAC,EAAa,QAAAC,EAAM,SAAAC,MAAa,YAGjD,OAAS,uBAAAC,MAA2B,2CAEpC,OAEE,wBAAAC,MACK,kCAGP,OAAS,cAAAC,MAAkB,wBAGpB,IAAMC,EAAN,KAA2D,CACxD,0BACA,iBAER,YAEEC,EACoCC,EACpC,CACA,KAAK,0BAA4BD,EACjC,KAAK,iBAAmBC,CAC1B,CAEA,MAAM,KAAKC,EAA8D,CACvE,GAAI,CAACA,EAAY,IAAM,CAACA,EAAY,MAAQA,EAAY,OAAS,KAC/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ACAH,EACA,CACA,MAAMQ,EAAU,KAAK,mBAAmBL,EAAWH,CAAe,EAElE,OAAOJ,EAA2B,CAAC,CAAE,YAAAa,CAAY,IAC/CA,EACE,KAAK,iBAAiB,qBAAqB,CACzC,QAAAD,EACA,QAASjB,EAAY,OACvB,CAAC,CACH,CACF,CACF,CAEQ,mBACNmB,EACAC,EACAC,EAC8B,CAC9B,GAAI,CACF,MAAMC,EAAoB,IAAIC,EAAUJ,CAAG,EAC3C,OAAOK,EAAMF,EAAkB,mBAAmBF,EAAQC,CAAI,CAAC,CACjE,MAAiB,CACf,OAAOI,EACL,IAAI,MACF,kEACF,CACF,CACF,CACF,CAEQ,mBACNC,EACAjB,EACY,CAGZ,IAAIkB,EAAalB,EACjB,UAAWmB,KAAOF,EAAK,MAAM,GAAG,EAG1BE,IAAQ,KAEVD,EAAQA,EAAMA,EAAM,OAAS,CAAC,EAK9BA,EAAQA,EAAMC,CAAG,EAIrB,GAAI,CAAC1B,EAAayB,CAAK,EACrB,MAAM,IAAI,MACR,oEACF,EAGF,OAAOA,CACT,CACF,EArKa9B,EAANgC,EAAA,CADNC,EAAW,EAMPC,EAAA,EAAAC,EAAOC,EAAoB,wBAAwB,GAEnDF,EAAA,EAAAC,EAAOE,EAAW,eAAe,IAPzBrC",
6
+ "names": ["isHexaString", "Interface", "inject", "injectable", "EitherAsync", "Left", "Right", "externalPluginTypes", "ClearSignContextType", "tokenTypes", "ExternalPluginContextLoader", "externalPluginDataSource", "tokenDataSource", "transaction", "selector", "isHexaString", "ClearSignContextType", "eitherDappInfos", "EitherAsync", "liftEither", "dappInfos", "externalPluginContext", "decodedCallData", "extractedDecodedCallData", "promises", "erc20Path", "eitherToken", "error", "payload", "contexts", "address", "fromPromise", "abi", "method", "data", "contractInterface", "Interface", "Right", "Left", "path", "value", "key", "__decorateClass", "injectable", "__decorateParam", "inject", "externalPluginTypes", "tokenTypes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Interface as u}from"ethers";import{Left as i,Right as c}from"purify-ts";import o from"@/external-plugin/__tests__/abi.json";import{ExternalPluginContextLoader as m}from"../../external-plugin/domain/ExternalPluginContextLoader";import{ClearSignContextType as t}from"../../shared/model/ClearSignContext";const p=({abi:d,selectorDetails:s})=>({abi:d,selectorDetails:{erc20OfInterest:[],method:"",plugin:"",serializedData:"123456",signature:"7890",...s}}),l=(d,s,n)=>({to:"0x0",data:new u(JSON.stringify(d)).encodeFunctionData(s,n)});describe("ExternalPluginContextLoader",()=>{const d={getTokenInfosPayload:vi.fn()},s={getDappInfos:vi.fn()},n=new m(s,d);beforeEach(()=>{vi.clearAllMocks(),vi.spyOn(d,"getTokenInfosPayload").mockImplementation(({address:e})=>Promise.resolve(c(`payload-${e}`)))}),describe("load function",async()=>{it("should return an empty array if no destination address is provided",async()=>{const e={},a=()=>n.load(e);await expect(a()).resolves.toEqual([])}),it("should return an empty array if data is undefined",async()=>{const e={to:"0x0"},a=await n.load(e);expect(a).toEqual([])}),it("should return an empty array if no data provided",async()=>{const e={to:"0x0",data:"0x"},a=await n.load(e);expect(a).toEqual([])}),it("should return an empty array if no dapp info is povided",async()=>{const e=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(void 0));const a=await n.load(e);expect(a).toEqual([])}),it("should return e plugin if no erc20OfInterest is provided",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:[],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return a list of context responses when one erc20OfInterest is provided for a single parameter",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual(expect.arrayContaining([{type:t.EXTERNAL_PLUGIN,payload:"1234567890"},{type:t.TOKEN,payload:"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"}]))}),it("should return a context response with only set external plugin when one erc20OfInterest is provided for a single parameter but no payload is feched",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e)),vi.spyOn(d,"getTokenInfosPayload").mockResolvedValue(i(Error("error")));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new Error("error")},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return a list of context responses when two erc20OfInterest are provided for two parameters",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken","toToken"],method:"multipleParams"}}),a=l(o,"multipleParams",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual(expect.arrayContaining([{type:t.EXTERNAL_PLUGIN,payload:"1234567890"},{type:t.TOKEN,payload:"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{type:t.TOKEN,payload:"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7"}]))}),it("should return a list of context responses when one erc20OfInterest is an array",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken.0","fromToken.1","fromToken.2","fromToken.-1"],method:"arrayParam"}}),a=l(o,"arrayParam",[["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7","0xB8c77482e45F1F44dE1745F52C74426C631bDD52"]]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.TOKEN,payload:"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{type:t.TOKEN,payload:"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7"},{type:t.TOKEN,payload:"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52"},{type:t.TOKEN,payload:"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52"},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return an error when a token datasource returns an error",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e)),vi.spyOn(d,"getTokenInfosPayload").mockResolvedValue(i(new Error("error")));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new Error("error")},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return an error when the abi is not conform",async()=>{const e=p({abi:[{fakeabi:"notworking"}],selectorDetails:{erc20OfInterest:["fromToken"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi")},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should throw an error when the erc20OfInterest doest not exist in the transaction",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["notFound"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address")}])}),it("should throw an error when an out-of-bounds element is present in erc20OfInterest",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken.3"],method:"arrayParam"}}),a=l(o,"arrayParam",[["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7","0xB8c77482e45F1F44dE1745F52C74426C631bDD52"]]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new RangeError("out of result range")}])}),it("should return a list of context responses when one erc20OfInterest is a complex struct",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["complexStruct.address1","complexStruct.param1.param2.0.param3.addresses.0","complexStruct.param1.param2.0.param3.addresses.1","complexStruct.param1.param2.0.param3.addresses.-1","complexStruct.param1.param2.1.param3.addresses.0","complexStruct.param1.param2.-1.param3.addresses.0"],method:"complexStructParam"}}),a=l(o,"complexStructParam",[{address1:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",param1:{param2:[{param3:{addresses:["0xdAC17F958D2ee523a2206206994597C13D831ec7","0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"]}},{param3:{addresses:["0xB8c77482e45F1F44dE1745F52C74426C631bDD52"]}}]}}]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.TOKEN,payload:"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{type:t.TOKEN,payload:"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7"},{type:t.TOKEN,payload:"payload-0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"},{type:t.TOKEN,payload:"payload-0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"},{type:t.TOKEN,payload:"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52"},{type:t.TOKEN,payload:"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52"},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return an error when datasource return a Left",async()=>{const e=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(i(new Error("error")));const a=await n.load(e);expect(a).toEqual([{type:t.ERROR,error:new Error("error")}])}),it("should return an error when transaction data is not a valid hex string",async()=>{const e={to:"0x0",data:"notAHexString"},a=await n.load(e);expect(a).toEqual([{type:t.ERROR,error:new Error("Invalid selector")}])})})});
2
+ //# sourceMappingURL=ExternalPluginContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Interface } from \"ethers\";\nimport { Left, Right } from \"purify-ts\";\n\nimport ABI from \"@/external-plugin/__tests__/abi.json\";\nimport { type ExternalPluginDataSource } from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { ExternalPluginContextLoader } from \"@/external-plugin/domain/ExternalPluginContextLoader\";\nimport { type DappInfos } from \"@/external-plugin/model/DappInfos\";\nimport { type SelectorDetails } from \"@/external-plugin/model/SelectorDetails\";\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport { type TransactionContext } from \"@/shared/model/TransactionContext\";\nimport { type TokenDataSource } from \"@/token/data/TokenDataSource\";\n\nconst dappInfosBuilder = ({\n abi,\n selectorDetails,\n}: {\n abi?: object[];\n selectorDetails?: Partial<SelectorDetails>;\n}) => {\n return {\n abi: abi,\n selectorDetails: {\n erc20OfInterest: [],\n method: \"\",\n plugin: \"\",\n serializedData: \"123456\",\n signature: \"7890\",\n ...selectorDetails,\n },\n } as DappInfos;\n};\n\nconst transactionBuilder = (\n abi: object,\n functionName: string,\n params: unknown[],\n): TransactionContext => {\n const contract = new Interface(JSON.stringify(abi));\n const data = contract.encodeFunctionData(functionName, params);\n return {\n to: \"0x0\",\n data,\n } as TransactionContext;\n};\n\ndescribe(\"ExternalPluginContextLoader\", () => {\n const mockTokenDataSource: TokenDataSource = {\n getTokenInfosPayload: vi.fn(),\n };\n const mockExternalPluginDataSource: ExternalPluginDataSource = {\n getDappInfos: vi.fn(),\n };\n const loader = new ExternalPluginContextLoader(\n mockExternalPluginDataSource,\n mockTokenDataSource,\n );\n\n beforeEach(() => {\n vi.clearAllMocks();\n vi.spyOn(mockTokenDataSource, \"getTokenInfosPayload\").mockImplementation(\n ({ address }) => Promise.resolve(Right(`payload-${address}`)),\n );\n });\n\n describe(\"load function\", async () => {\n it(\"should return an empty array if no destination address is provided\", async () => {\n // GIVEN\n const transaction = {} as TransactionContext;\n\n // WHEN\n const promise = () => loader.load(transaction);\n\n // THEN\n await expect(promise()).resolves.toEqual([]);\n });\n\n it(\"should return an empty array if data is undefined\", async () => {\n // GIVEN\n const transaction = { to: \"0x0\" } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if no data provided\", async () => {\n // GIVEN\n const transaction = { to: \"0x0\", data: \"0x\" } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if no dapp info is povided\", async () => {\n // GIVEN\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(undefined),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return e plugin if no erc20OfInterest is provided\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return a list of context responses when one erc20OfInterest is provided for a single parameter\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual(\n expect.arrayContaining([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n },\n ]),\n );\n });\n\n it(\"should return a context response with only set external plugin when one erc20OfInterest is provided for a single parameter but no payload is feched\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n vi.spyOn(mockTokenDataSource, \"getTokenInfosPayload\").mockResolvedValue(\n Left(Error(\"error\")),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return a list of context responses when two erc20OfInterest are provided for two parameters\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\", \"toToken\"],\n method: \"multipleParams\",\n },\n });\n const transaction = transactionBuilder(ABI, \"multipleParams\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual(\n expect.arrayContaining([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n },\n ]),\n );\n });\n\n it(\"should return a list of context responses when one erc20OfInterest is an array\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\n \"fromToken.0\",\n \"fromToken.1\",\n \"fromToken.2\",\n \"fromToken.-1\",\n ],\n method: \"arrayParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"arrayParam\", [\n [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n ],\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n },\n // fromToken.2\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n },\n // fromToken.-1\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return an error when a token datasource returns an error\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n vi.spyOn(mockTokenDataSource, \"getTokenInfosPayload\").mockResolvedValue(\n Left(new Error(\"error\")),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return an error when the abi is not conform\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: [{ fakeabi: \"notworking\" }],\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\n \"[ContextModule] ExternalPluginContextLoader: Unable to parse abi\",\n ),\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should throw an error when the erc20OfInterest doest not exist in the transaction\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"notFound\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\n \"[ContextModule] ExternalPluginContextLoader: Unable to get address\",\n ),\n },\n ]);\n });\n\n it(\"should throw an error when an out-of-bounds element is present in erc20OfInterest\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken.3\"],\n method: \"arrayParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"arrayParam\", [\n [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n ],\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new RangeError(\"out of result range\"),\n },\n ]);\n });\n\n it(\"should return a list of context responses when one erc20OfInterest is a complex struct\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\n \"complexStruct.address1\",\n \"complexStruct.param1.param2.0.param3.addresses.0\",\n \"complexStruct.param1.param2.0.param3.addresses.1\",\n \"complexStruct.param1.param2.0.param3.addresses.-1\",\n \"complexStruct.param1.param2.1.param3.addresses.0\",\n \"complexStruct.param1.param2.-1.param3.addresses.0\",\n ],\n method: \"complexStructParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"complexStructParam\", [\n {\n address1: \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n param1: {\n param2: [\n {\n param3: {\n addresses: [\n \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE\",\n ],\n },\n },\n {\n param3: {\n addresses: [\"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\"],\n },\n },\n ],\n },\n },\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Right(dappInfos),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return an error when datasource return a Left\", async () => {\n // GIVEN\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n vi.spyOn(mockExternalPluginDataSource, \"getDappInfos\").mockResolvedValue(\n Left(new Error(\"error\")),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n ]);\n });\n\n it(\"should return an error when transaction data is not a valid hex string\", async () => {\n // GIVEN\n const transaction = {\n to: \"0x0\",\n data: \"notAHexString\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ]);\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,aAAAA,MAAiB,SAC1B,OAAS,QAAAC,EAAM,SAAAC,MAAa,YAE5B,OAAOC,MAAS,uCAEhB,OAAS,+BAAAC,MAAmC,uDAG5C,OAAS,wBAAAC,MAA4B,kCAIrC,MAAMC,EAAmB,CAAC,CACxB,IAAAC,EACA,gBAAAC,CACF,KAIS,CACL,IAAKD,EACL,gBAAiB,CACf,gBAAiB,CAAC,EAClB,OAAQ,GACR,OAAQ,GACR,eAAgB,SAChB,UAAW,OACX,GAAGC,CACL,CACF,GAGIC,EAAqB,CACzBF,EACAG,EACAC,KAIO,CACL,GAAI,MACJ,KAJe,IAAIX,EAAU,KAAK,UAAUO,CAAG,CAAC,EAC5B,mBAAmBG,EAAcC,CAAM,CAI7D,GAGF,SAAS,8BAA+B,IAAM,CAC5C,MAAMC,EAAuC,CAC3C,qBAAsB,GAAG,GAAG,CAC9B,EACMC,EAAyD,CAC7D,aAAc,GAAG,GAAG,CACtB,EACMC,EAAS,IAAIV,EACjBS,EACAD,CACF,EAEA,WAAW,IAAM,CACf,GAAG,cAAc,EACjB,GAAG,MAAMA,EAAqB,sBAAsB,EAAE,mBACpD,CAAC,CAAE,QAAAG,CAAQ,IAAM,QAAQ,QAAQb,EAAM,WAAWa,CAAO,EAAE,CAAC,CAC9D,C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,GAAG,MAAMU,EAA8B,cAAc,EAAE,kBACrDZ,EAAK,IAAI,MAAM,OAAO,CAAC,CACzB,EAGA,MAAMiB,EAAS,MAAMJ,EAAO,KAAKE,CAAW,EAG5C,OAAOE,CAAM,EAAE,QAAQ,CACrB,CACE,KAAMb,EAAqB,MAC3B,MAAO,IAAI,MAAM,OAAO,CAC1B,CACF,CAAC,CACH,CAAC,EAED,GAAG,yEAA0E,SAAY,CAEvF,MAAMW,EAAc,CAClB,GAAI,MACJ,KAAM,eACR,EAGME,EAAS,MAAMJ,EAAO,KAAKE,CAAW,EAG5C,OAAOE,CAAM,EAAE,QAAQ,CACrB,CACE,KAAMb,EAAqB,MAC3B,MAAO,IAAI,MAAM,kBAAkB,CACrC,CACF,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["Interface", "Left", "Right", "ABI", "ExternalPluginContextLoader", "ClearSignContextType", "dappInfosBuilder", "abi", "selectorDetails", "transactionBuilder", "functionName", "params", "mockTokenDataSource", "mockExternalPluginDataSource", "loader", "address", "transaction", "promise", "result", "dappInfos"]
7
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=DappInfos.js.map
1
+ //# sourceMappingURL=DappInfos.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"DappInfos.js","sourceRoot":"","sources":["../../../../../src/external-plugin/model/DappInfos.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=SelectorDetails.js.map
1
+ //# sourceMappingURL=SelectorDetails.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"SelectorDetails.js","sourceRoot":"","sources":["../../../../../src/external-plugin/model/SelectorDetails.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,14 +1,2 @@
1
- export * from "./config/model/ContextModuleConfig";
2
- export * from "./ContextModule";
3
- export * from "./ContextModuleBuilder";
4
- export * from "./DefaultContextModule";
5
- export * from "./external-plugin/domain/ExternalPluginContextLoader";
6
- export * from "./forward-domain/domain/ForwardDomainContextLoader";
7
- export * from "./nft/domain/NftContextLoader";
8
- export * from "./shared/model/ClearSignContext";
9
- export * from "./shared/model/TransactionContext";
10
- export * from "./shared/model/TransactionSubset";
11
- export * from "./shared/model/TypedDataClearSignContext";
12
- export * from "./shared/model/TypedDataContext";
13
- export * from "./token/domain/TokenContextLoader";
14
- //# sourceMappingURL=index.js.map
1
+ export*from"./config/model/ContextModuleConfig";export*from"./ContextModule";export*from"./ContextModuleBuilder";export*from"./DefaultContextModule";export*from"./external-plugin/domain/ExternalPluginContextLoader";export*from"./nft/domain/NftContextLoader";export*from"./pki/domain/PkiCertificateLoader";export*from"./pki/model/KeyId";export*from"./pki/model/KeyUsage";export*from"./pki/model/PkiCertificate";export*from"./pki/model/PkiCertificateInfo";export*from"./shared/domain/ContextLoader";export*from"./shared/model/ClearSignContext";export*from"./shared/model/GenericPath";export*from"./shared/model/TransactionContext";export*from"./shared/model/TransactionSubset";export*from"./shared/model/TypedDataClearSignContext";export*from"./shared/model/TypedDataContext";export*from"./token/domain/TokenContextLoader";export*from"./trusted-name/domain/TrustedNameContextLoader";
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/index.ts"],
4
+ "sourcesContent": ["export * from \"./config/model/ContextModuleConfig\";\nexport * from \"./ContextModule\";\nexport * from \"./ContextModuleBuilder\";\nexport * from \"./DefaultContextModule\";\nexport * from \"./external-plugin/domain/ExternalPluginContextLoader\";\nexport * from \"./nft/domain/NftContextLoader\";\nexport * from \"./pki/domain/PkiCertificateLoader\";\nexport * from \"./pki/model/KeyId\";\nexport * from \"./pki/model/KeyUsage\";\nexport * from \"./pki/model/PkiCertificate\";\nexport * from \"./pki/model/PkiCertificateInfo\";\nexport * from \"./shared/domain/ContextLoader\";\nexport * from \"./shared/model/ClearSignContext\";\nexport * from \"./shared/model/GenericPath\";\nexport * from \"./shared/model/TransactionContext\";\nexport * from \"./shared/model/TransactionSubset\";\nexport * from \"./shared/model/TypedDataClearSignContext\";\nexport * from \"./shared/model/TypedDataContext\";\nexport * from \"./token/domain/TokenContextLoader\";\nexport * from \"./trusted-name/domain/TrustedNameContextLoader\";\n"],
5
+ "mappings": "AAAA,WAAc,qCACd,WAAc,kBACd,WAAc,yBACd,WAAc,yBACd,WAAc,uDACd,WAAc,gCACd,WAAc,oCACd,WAAc,oBACd,WAAc,uBACd,WAAc,6BACd,WAAc,iCACd,WAAc,gCACd,WAAc,kCACd,WAAc,6BACd,WAAc,oCACd,WAAc,mCACd,WAAc,2CACd,WAAc,kCACd,WAAc,oCACd,WAAc",
6
+ "names": []
7
+ }
@@ -1,51 +1,2 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import axios from "axios";
8
- import { injectable } from "inversify";
9
- import { Left, Right } from "purify-ts";
10
- import PACKAGE from "../../../package.json";
11
- let HttpNftDataSource = class HttpNftDataSource {
12
- async getSetPluginPayload({ chainId, address, selector, }) {
13
- try {
14
- const response = await axios.request({
15
- method: "GET",
16
- url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}/plugin-selector/${selector}`,
17
- headers: {
18
- "X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
19
- },
20
- });
21
- return response.data.payload
22
- ? Right(response.data.payload)
23
- : Left(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"));
24
- }
25
- catch (_error) {
26
- return Left(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"));
27
- }
28
- }
29
- async getNftInfosPayload({ chainId, address, }) {
30
- try {
31
- const response = await axios.request({
32
- method: "GET",
33
- url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}`,
34
- headers: {
35
- "X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
36
- },
37
- });
38
- return response.data.payload
39
- ? Right(response.data.payload)
40
- : Left(new Error("[ContextModule] HttpNftDataSource: no nft metadata"));
41
- }
42
- catch (_error) {
43
- return Left(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"));
44
- }
45
- }
46
- };
47
- HttpNftDataSource = __decorate([
48
- injectable()
49
- ], HttpNftDataSource);
50
- export { HttpNftDataSource };
51
- //# sourceMappingURL=HttpNftDataSource.js.map
1
+ var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var d=(i,r,o,e)=>{for(var t=e>1?void 0:e?f(r,o):r,s=i.length-1,l;s>=0;s--)(l=i[s])&&(t=(e?l(r,o,t):l(t))||t);return e&&t&&u(r,o,t),t};import m from"axios";import{injectable as g}from"inversify";import{Left as a,Right as p}from"purify-ts";import c from"../../../package.json";let n=class{async getSetPluginPayload({chainId:r,address:o,selector:e}){try{const t=await m.request({method:"GET",url:`https://nft.api.live.ledger.com/v1/ethereum/${r}/contracts/${o}/plugin-selector/${e}`,headers:{"X-Ledger-Client-Version":`context-module/${c.version}`}});return t.data.payload?p(t.data.payload):a(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"))}catch{return a(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"))}}async getNftInfosPayload({chainId:r,address:o}){try{const e=await m.request({method:"GET",url:`https://nft.api.live.ledger.com/v1/ethereum/${r}/contracts/${o}`,headers:{"X-Ledger-Client-Version":`context-module/${c.version}`}});return e.data.payload?p(e.data.payload):a(new Error("[ContextModule] HttpNftDataSource: no nft metadata"))}catch{return a(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"))}}};n=d([g()],n);export{n as HttpNftDataSource};
2
+ //# sourceMappingURL=HttpNftDataSource.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"HttpNftDataSource.js","sourceRoot":"","sources":["../../../../../src/nft/data/HttpNftDataSource.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAU,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAOhD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAGlC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IACrB,KAAK,CAAC,mBAAmB,CAAC,EAC/B,OAAO,EACP,OAAO,EACP,QAAQ,GACkB;QAC1B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAsB;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,+CAA+C,OAAO,cAAc,OAAO,oBAAoB,QAAQ,EAAE;gBAC9G,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,OAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO;gBAC1B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9B,CAAC,CAAC,IAAI,CACF,IAAI,KAAK,CACP,8DAA8D,CAC/D,CACF,CAAC;QACR,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CACT,IAAI,KAAK,CACP,uEAAuE,CACxE,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,EAC9B,OAAO,EACP,OAAO,GACkB;QACzB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAsB;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,+CAA+C,OAAO,cAAc,OAAO,EAAE;gBAClF,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,OAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO;gBAC1B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9B,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CACT,IAAI,KAAK,CACP,qEAAqE,CACtE,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAvDY,iBAAiB;IAD7B,UAAU,EAAE;GACA,iBAAiB,CAuD7B"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/data/HttpNftDataSource.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport {\n GetNftInformationsParams,\n GetSetPluginPayloadParams,\n NftDataSource,\n} from \"@/nft/data/NftDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpNftDataSource implements NftDataSource {\n public async getSetPluginPayload({\n chainId,\n address,\n selector,\n }: GetSetPluginPayloadParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<{ payload: string }>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}/plugin-selector/${selector}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.payload\n ? Right(response.data.payload)\n : Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: unexpected empty response\",\n ),\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload\",\n ),\n );\n }\n }\n\n public async getNftInfosPayload({\n chainId,\n address,\n }: GetNftInformationsParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<{ payload: string }>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.payload\n ? Right(response.data.payload)\n : Left(new Error(\"[ContextModule] HttpNftDataSource: no nft metadata\"));\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch nft informations\",\n ),\n );\n }\n }\n}\n"],
5
+ "mappings": "wMAAA,OAAOA,MAAW,QAClB,OAAS,cAAAC,MAAkB,YAC3B,OAAiB,QAAAC,EAAM,SAAAC,MAAa,YAOpC,OAAOC,MAAa,qBAGb,IAAMC,EAAN,KAAiD,CACtD,MAAa,oBAAoB,CAC/B,QAAAC,EACA,QAAAC,EACA,SAAAC,CACF,EAA8D,CAC5D,GAAI,CACF,MAAMC,EAAW,MAAMC,EAAM,QAA6B,CACxD,OAAQ,MACR,IAAK,+CAA+CJ,CAAO,cAAcC,CAAO,oBAAoBC,CAAQ,GAC5G,QAAS,CACP,0BAA2B,kBAAkBG,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,QACjBG,EAAMH,EAAS,KAAK,OAAO,EAC3BI,EACE,IAAI,MACF,8DACF,CACF,CACN,MAAiB,CACf,OAAOA,EACL,IAAI,MACF,uEACF,CACF,CACF,CACF,CAEA,MAAa,mBAAmB,CAC9B,QAAAP,EACA,QAAAC,CACF,EAA6D,CAC3D,GAAI,CACF,MAAME,EAAW,MAAMC,EAAM,QAA6B,CACxD,OAAQ,MACR,IAAK,+CAA+CJ,CAAO,cAAcC,CAAO,GAChF,QAAS,CACP,0BAA2B,kBAAkBI,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,QACjBG,EAAMH,EAAS,KAAK,OAAO,EAC3BI,EAAK,IAAI,MAAM,oDAAoD,CAAC,CAC1E,MAAiB,CACf,OAAOA,EACL,IAAI,MACF,qEACF,CACF,CACF,CACF,CACF,EAvDaR,EAANS,EAAA,CADNC,EAAW,GACCV",
6
+ "names": ["axios", "injectable", "Left", "Right", "PACKAGE", "HttpNftDataSource", "chainId", "address", "selector", "response", "axios", "PACKAGE", "Right", "Left", "__decorateClass", "injectable"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import o from"axios";import r from"../../../package.json";import{HttpNftDataSource as s}from"./HttpNftDataSource";vi.mock("axios");describe("HttpNftDataSource",()=>{let a;beforeAll(()=>{a=new s,vi.clearAllMocks()}),it("should call axios with the ledger client version header",async()=>{const e=`context-module/${r.version}`,t=vi.fn(()=>Promise.resolve({data:[]}));vi.spyOn(o,"request").mockImplementation(t),await a.getNftInfosPayload({address:"0x00",chainId:1}),await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"}),expect(t).toHaveBeenNthCalledWith(1,expect.objectContaining({headers:{"X-Ledger-Client-Version":e}})),expect(t).toHaveBeenNthCalledWith(2,expect.objectContaining({headers:{"X-Ledger-Client-Version":e}}))}),describe("getNftInfosPayload",()=>{it("should return an error when axios throws an error",async()=>{vi.spyOn(o,"request").mockRejectedValue(new Error("error"));const e=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(e.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"))}),it("should return an error when the response is empty",async()=>{const e={data:{}};vi.spyOn(o,"request").mockResolvedValue(e);const t=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(t.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: no nft metadata"))}),it("should return the payload",async()=>{const e={data:{payload:"payload"}};vi.spyOn(o,"request").mockResolvedValue(e);const t=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(t.extract()).toEqual("payload")})}),describe("getSetPluginPayload",()=>{it("should return an error when axios throws an error",async()=>{vi.spyOn(o,"request").mockRejectedValue(new Error("error"));const e=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(e.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"))}),it("should return an error when the response is empty",async()=>{const e={data:{}};vi.spyOn(o,"request").mockResolvedValue(e);const t=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(t.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"))}),it("should return the payload",async()=>{const e={data:{payload:"payload"}};vi.spyOn(o,"request").mockResolvedValue(e);const t=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(t.extract()).toEqual("payload")})})});
2
+ //# sourceMappingURL=HttpNftDataSource.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/data/HttpNftDataSource.test.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\n\nimport PACKAGE from \"@root/package.json\";\n\nimport { HttpNftDataSource } from \"./HttpNftDataSource\";\nimport { type NftDataSource } from \"./NftDataSource\";\n\nvi.mock(\"axios\");\n\ndescribe(\"HttpNftDataSource\", () => {\n let datasource: NftDataSource;\n\n beforeAll(() => {\n datasource = new HttpNftDataSource();\n vi.clearAllMocks();\n });\n\n it(\"should call axios with the ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = vi.fn(() => Promise.resolve({ data: [] }));\n vi.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getNftInfosPayload({ address: \"0x00\", chainId: 1 });\n await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenNthCalledWith(\n 1,\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n expect(requestSpy).toHaveBeenNthCalledWith(\n 2,\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n describe(\"getNftInfosPayload\", () => {\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch nft informations\",\n ),\n );\n });\n\n it(\"should return an error when the response is empty\", async () => {\n // GIVEN\n const response = { data: {} };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\"[ContextModule] HttpNftDataSource: no nft metadata\"),\n );\n });\n\n it(\"should return the payload\", async () => {\n // GIVEN\n const response = { data: { payload: \"payload\" } };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\"payload\");\n });\n });\n\n describe(\"getSetPluginPayload\", () => {\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload\",\n ),\n );\n });\n\n it(\"should return an error when the response is empty\", async () => {\n // GIVEN\n const response = { data: {} };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: unexpected empty response\",\n ),\n );\n });\n\n it(\"should return the payload\", async () => {\n // GIVEN\n const response = { data: { payload: \"payload\" } };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\"payload\");\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAOA,MAAW,QAElB,OAAOC,MAAa,qBAEpB,OAAS,qBAAAC,MAAyB,sBAGlC,GAAG,KAAK,OAAO,EAEf,SAAS,oBAAqB,IAAM,CAClC,IAAIC,EAEJ,UAAU,IAAM,CACdA,EAAa,IAAID,EACjB,GAAG,cAAc,CACnB,CAAC,EAED,GAAG,0DAA2D,SAAY,CAExE,MAAME,EAAU,kBAAkBH,EAAQ,OAAO,GAC3CI,EAAa,GAAG,GAAG,IAAM,QAAQ,QAAQ,CAAE,KAAM,CAAC,CAAE,CAAC,CAAC,EAC5D,GAAG,MAAML,EAAO,SAAS,EAAE,mBAAmBK,CAAU,EAGxD,MAAMF,EAAW,mBAAmB,CAAE,QAAS,OAAQ,QAAS,CAAE,CAAC,EACnE,MAAMA,EAAW,oBAAoB,CACnC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AAMM,EAAS,MAAMH,EAAW,oBAAoB,CAClD,QAAS,OACT,QAAS,EACT,SAAU,MACZ,CAAC,EAGD,OAAOG,EAAO,QAAQ,CAAC,EAAE,QACvB,IAAI,MACF,uEACF,CACF,CACF,CAAC,EAED,GAAG,oDAAqD,SAAY,CAElE,MAAMC,EAAW,CAAE,KAAM,CAAC,CAAE,EAC5B,GAAG,MAAMP,EAAO,SAAS,EAAE,kBAAkBO,CAAQ,EAGrD,MAAMD,EAAS,MAAMH,EAAW,oBAAoB,CAClD,QAAS,OACT,QAAS,EACT,SAAU,MACZ,CAAC,EAGD,OAAOG,EAAO,QAAQ,CAAC,EAAE,QACvB,IAAI,MACF,8DACF,CACF,CACF,CAAC,EAED,GAAG,4BAA6B,SAAY,CAE1C,MAAMC,EAAW,CAAE,KAAM,CAAE,QAAS,SAAU,CAAE,EAChD,GAAG,MAAMP,EAAO,SAAS,EAAE,kBAAkBO,CAAQ,EAGrD,MAAMD,EAAS,MAAMH,EAAW,oBAAoB,CAClD,QAAS,OACT,QAAS,EACT,SAAU,MACZ,CAAC,EAGD,OAAOG,EAAO,QAAQ,CAAC,EAAE,QAAQ,SAAS,CAC5C,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["axios", "PACKAGE", "HttpNftDataSource", "datasource", "version", "requestSpy", "result", "response"]
7
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=NftDataSource.js.map
1
+ //# sourceMappingURL=NftDataSource.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"NftDataSource.js","sourceRoot":"","sources":["../../../../../src/nft/data/NftDataSource.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,9 +1,2 @@
1
- import { ContainerModule } from "inversify";
2
- import { HttpNftDataSource } from "../../nft/data/HttpNftDataSource";
3
- import { nftTypes } from "../../nft/di/nftTypes";
4
- import { NftContextLoader } from "../../nft/domain/NftContextLoader";
5
- export const nftModuleFactory = () => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
6
- bind(nftTypes.NftDataSource).to(HttpNftDataSource);
7
- bind(nftTypes.NftContextLoader).to(NftContextLoader);
8
- });
9
- //# sourceMappingURL=nftModuleFactory.js.map
1
+ import{ContainerModule as r}from"inversify";import{HttpNftDataSource as e}from"../../nft/data/HttpNftDataSource";import{nftTypes as o}from"../../nft/di/nftTypes";import{NftContextLoader as n}from"../../nft/domain/NftContextLoader";const c=()=>new r((t,f,a,m)=>{t(o.NftDataSource).to(e),t(o.NftContextLoader).to(n)});export{c as nftModuleFactory};
2
+ //# sourceMappingURL=nftModuleFactory.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"nftModuleFactory.js","sourceRoot":"","sources":["../../../../../src/nft/di/nftModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/di/nftModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpNftDataSource } from \"@/nft/data/HttpNftDataSource\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { NftContextLoader } from \"@/nft/domain/NftContextLoader\";\n\nexport const nftModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(nftTypes.NftDataSource).to(HttpNftDataSource);\n bind(nftTypes.NftContextLoader).to(NftContextLoader);\n });\n"],
5
+ "mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,qBAAAC,MAAyB,+BAClC,OAAS,YAAAC,MAAgB,oBACzB,OAAS,oBAAAC,MAAwB,gCAE1B,MAAMC,EAAmB,IAC9B,IAAIJ,EAAgB,CAACK,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAKH,EAAS,aAAa,EAAE,GAAGD,CAAiB,EACjDI,EAAKH,EAAS,gBAAgB,EAAE,GAAGC,CAAgB,CACrD,CAAC",
6
+ "names": ["ContainerModule", "HttpNftDataSource", "nftTypes", "NftContextLoader", "nftModuleFactory", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -1,5 +1,2 @@
1
- export const nftTypes = {
2
- NftDataSource: Symbol.for("nftDataSource"),
3
- NftContextLoader: Symbol.for("nftContextLoader"),
4
- };
5
- //# sourceMappingURL=nftTypes.js.map
1
+ const t={NftDataSource:Symbol.for("nftDataSource"),NftContextLoader:Symbol.for("nftContextLoader")};export{t as nftTypes};
2
+ //# sourceMappingURL=nftTypes.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"nftTypes.js","sourceRoot":"","sources":["../../../../../src/nft/di/nftTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;IAC1C,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC;CACjD,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/di/nftTypes.ts"],
4
+ "sourcesContent": ["export const nftTypes = {\n NftDataSource: Symbol.for(\"nftDataSource\"),\n NftContextLoader: Symbol.for(\"nftContextLoader\"),\n};\n"],
5
+ "mappings": "AAAO,MAAMA,EAAW,CACtB,cAAe,OAAO,IAAI,eAAe,EACzC,iBAAkB,OAAO,IAAI,kBAAkB,CACjD",
6
+ "names": ["nftTypes"]
7
+ }