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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (548) hide show
  1. package/README.md +4 -6
  2. package/lib/cjs/index.js +1 -1126
  3. package/lib/cjs/index.js.map +4 -4
  4. package/lib/cjs/package.json +58 -0
  5. package/lib/cjs/src/ContextModule.js +2 -0
  6. package/lib/cjs/src/ContextModule.js.map +7 -0
  7. package/lib/cjs/src/ContextModuleBuilder.js +2 -0
  8. package/lib/cjs/src/ContextModuleBuilder.js.map +7 -0
  9. package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
  10. package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
  11. package/lib/cjs/src/DefaultContextModule.js +2 -0
  12. package/lib/cjs/src/DefaultContextModule.js.map +7 -0
  13. package/lib/cjs/src/DefaultContextModule.test.js +2 -0
  14. package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
  15. package/lib/cjs/src/config/di/configModuleFactory.js +2 -0
  16. package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -0
  17. package/lib/cjs/src/config/di/configTypes.js +2 -0
  18. package/lib/cjs/src/config/di/configTypes.js.map +7 -0
  19. package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -0
  20. package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -0
  21. package/lib/cjs/src/di.js +2 -0
  22. package/lib/cjs/src/di.js.map +7 -0
  23. package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -0
  24. package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -0
  25. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -0
  26. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -0
  27. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -0
  28. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -0
  29. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  30. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  31. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -0
  32. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -0
  33. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -0
  34. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -0
  35. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -0
  36. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -0
  37. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  38. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  39. package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -0
  40. package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -0
  41. package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -0
  42. package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -0
  43. package/lib/cjs/src/index.js +2 -0
  44. package/lib/cjs/src/index.js.map +7 -0
  45. package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -0
  46. package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -0
  47. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
  48. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  49. package/lib/cjs/src/nft/data/NftDataSource.js +2 -0
  50. package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -0
  51. package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -0
  52. package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -0
  53. package/lib/cjs/src/nft/di/nftTypes.js +2 -0
  54. package/lib/cjs/src/nft/di/nftTypes.js.map +7 -0
  55. package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -0
  56. package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -0
  57. package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
  58. package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
  59. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.js +2 -0
  60. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.js.map +7 -0
  61. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.test.js +2 -0
  62. package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.test.js.map +7 -0
  63. package/lib/cjs/src/pki/data/PkiCertificateDataSource.js +2 -0
  64. package/lib/cjs/src/pki/data/PkiCertificateDataSource.js.map +7 -0
  65. package/lib/cjs/src/pki/data/pkiDataSourceTypes.js +2 -0
  66. package/lib/cjs/src/pki/data/pkiDataSourceTypes.js.map +7 -0
  67. package/lib/cjs/src/pki/di/pkiModuleFactory.js +2 -0
  68. package/lib/cjs/src/pki/di/pkiModuleFactory.js.map +7 -0
  69. package/lib/cjs/src/pki/di/pkiTypes.js +2 -0
  70. package/lib/cjs/src/pki/di/pkiTypes.js.map +7 -0
  71. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js +2 -0
  72. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js.map +7 -0
  73. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js +2 -0
  74. package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +7 -0
  75. package/lib/cjs/src/pki/domain/PkiCertificateLoader.js +2 -0
  76. package/lib/cjs/src/pki/domain/PkiCertificateLoader.js.map +7 -0
  77. package/lib/cjs/src/pki/model/KeyId.js +2 -0
  78. package/lib/cjs/src/pki/model/KeyId.js.map +7 -0
  79. package/lib/cjs/src/pki/model/KeyUsage.js +2 -0
  80. package/lib/cjs/src/pki/model/KeyUsage.js.map +7 -0
  81. package/lib/cjs/src/pki/model/PkiCertificate.js +2 -0
  82. package/lib/cjs/src/pki/model/PkiCertificate.js.map +7 -0
  83. package/lib/cjs/src/pki/model/PkiCertificateInfo.js +2 -0
  84. package/lib/cjs/src/pki/model/PkiCertificateInfo.js.map +7 -0
  85. package/lib/cjs/src/shared/domain/ContextLoader.js +2 -0
  86. package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -0
  87. package/lib/cjs/src/shared/model/ClearSignContext.js +2 -0
  88. package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -0
  89. package/lib/cjs/src/shared/model/GenericPath.js +2 -0
  90. package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
  91. package/lib/cjs/src/shared/model/SignatureTags.js +2 -0
  92. package/lib/cjs/src/shared/model/SignatureTags.js.map +7 -0
  93. package/lib/cjs/src/shared/model/TransactionContext.js +2 -0
  94. package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -0
  95. package/lib/cjs/src/shared/model/TransactionSubset.js +2 -0
  96. package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -0
  97. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -0
  98. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -0
  99. package/lib/cjs/src/shared/model/TypedDataContext.js +2 -0
  100. package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -0
  101. package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -0
  102. package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -0
  103. package/lib/cjs/src/shared/utils/HexStringUtils.test.js +2 -0
  104. package/lib/cjs/src/shared/utils/HexStringUtils.test.js.map +7 -0
  105. package/lib/cjs/src/shared/utils/KeyUsageMapper.js +2 -0
  106. package/lib/cjs/src/shared/utils/KeyUsageMapper.js.map +7 -0
  107. package/lib/cjs/src/shared/utils/KeyUsageMapper.test.js +2 -0
  108. package/lib/cjs/src/shared/utils/KeyUsageMapper.test.js.map +7 -0
  109. package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -0
  110. package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -0
  111. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
  112. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  113. package/lib/cjs/src/token/data/TokenDataSource.js +2 -0
  114. package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -0
  115. package/lib/cjs/src/token/data/TokenDto.js +2 -0
  116. package/lib/cjs/src/token/data/TokenDto.js.map +7 -0
  117. package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -0
  118. package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -0
  119. package/lib/cjs/src/token/di/tokenTypes.js +2 -0
  120. package/lib/cjs/src/token/di/tokenTypes.js.map +7 -0
  121. package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -0
  122. package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -0
  123. package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
  124. package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
  125. package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
  126. package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
  127. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
  128. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  129. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  130. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  131. package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
  132. package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
  133. package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
  134. package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
  135. package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
  136. package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
  137. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
  138. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  139. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  140. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  141. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  142. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  143. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  144. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  145. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
  146. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  147. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
  148. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  149. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  150. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  151. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
  152. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  153. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  154. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  155. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  156. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  157. package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -0
  158. package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -0
  159. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -0
  160. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -0
  161. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  162. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  163. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -0
  164. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -0
  165. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -0
  166. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -0
  167. package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -0
  168. package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -0
  169. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -0
  170. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -0
  171. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  172. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  173. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -0
  174. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -0
  175. package/lib/cjs/src/uniswap/constants/plugin.js +2 -0
  176. package/lib/cjs/src/uniswap/constants/plugin.js.map +7 -0
  177. package/lib/cjs/src/uniswap/constants/uniswap.js +2 -0
  178. package/lib/cjs/src/uniswap/constants/uniswap.js.map +7 -0
  179. package/lib/cjs/src/uniswap/constants/weth.js +2 -0
  180. package/lib/cjs/src/uniswap/constants/weth.js.map +7 -0
  181. package/lib/cjs/src/uniswap/data/AbiDecoderDataSource.js +2 -0
  182. package/lib/cjs/src/uniswap/data/AbiDecoderDataSource.js.map +7 -0
  183. package/lib/cjs/src/uniswap/data/CommandDecoderDataSource.js +2 -0
  184. package/lib/cjs/src/uniswap/data/CommandDecoderDataSource.js.map +7 -0
  185. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.js +2 -0
  186. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.js.map +7 -0
  187. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.test.js +2 -0
  188. package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.test.js.map +7 -0
  189. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.js +2 -0
  190. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.js.map +7 -0
  191. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.test.js +2 -0
  192. package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.test.js.map +7 -0
  193. package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js +2 -0
  194. package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js.map +7 -0
  195. package/lib/cjs/src/uniswap/di/uniswapTypes.js +2 -0
  196. package/lib/cjs/src/uniswap/di/uniswapTypes.js.map +7 -0
  197. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.js +2 -0
  198. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.js.map +7 -0
  199. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js +2 -0
  200. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js.map +7 -0
  201. package/lib/esm/index.js +1 -37617
  202. package/lib/esm/index.js.map +4 -4
  203. package/lib/esm/package.json +58 -0
  204. package/lib/esm/src/ContextModule.js +1 -0
  205. package/lib/esm/src/ContextModule.js.map +7 -0
  206. package/lib/esm/src/ContextModuleBuilder.js +2 -0
  207. package/lib/esm/src/ContextModuleBuilder.js.map +7 -0
  208. package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
  209. package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
  210. package/lib/esm/src/DefaultContextModule.js +2 -0
  211. package/lib/esm/src/DefaultContextModule.js.map +7 -0
  212. package/lib/esm/src/DefaultContextModule.test.js +2 -0
  213. package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
  214. package/lib/esm/src/config/di/configModuleFactory.js +2 -0
  215. package/lib/esm/src/config/di/configModuleFactory.js.map +7 -0
  216. package/lib/esm/src/config/di/configTypes.js +2 -0
  217. package/lib/esm/src/config/di/configTypes.js.map +7 -0
  218. package/lib/esm/src/config/model/ContextModuleConfig.js +1 -0
  219. package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -0
  220. package/lib/esm/src/di.js +2 -0
  221. package/lib/esm/src/di.js.map +7 -0
  222. package/lib/esm/src/external-plugin/data/DAppDto.js +1 -0
  223. package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -0
  224. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -0
  225. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -0
  226. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -0
  227. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -0
  228. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  229. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  230. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -0
  231. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -0
  232. package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -0
  233. package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -0
  234. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -0
  235. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -0
  236. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  237. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  238. package/lib/esm/src/external-plugin/model/DappInfos.js +1 -0
  239. package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -0
  240. package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -0
  241. package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -0
  242. package/lib/esm/src/index.js +2 -0
  243. package/lib/esm/src/index.js.map +7 -0
  244. package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -0
  245. package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -0
  246. package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
  247. package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  248. package/lib/esm/src/nft/data/NftDataSource.js +1 -0
  249. package/lib/esm/src/nft/data/NftDataSource.js.map +7 -0
  250. package/lib/esm/src/nft/di/nftModuleFactory.js +2 -0
  251. package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -0
  252. package/lib/esm/src/nft/di/nftTypes.js +2 -0
  253. package/lib/esm/src/nft/di/nftTypes.js.map +7 -0
  254. package/lib/esm/src/nft/domain/NftContextLoader.js +2 -0
  255. package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -0
  256. package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
  257. package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
  258. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.js +2 -0
  259. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.js.map +7 -0
  260. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.test.js +2 -0
  261. package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.test.js.map +7 -0
  262. package/lib/esm/src/pki/data/PkiCertificateDataSource.js +1 -0
  263. package/lib/esm/src/pki/data/PkiCertificateDataSource.js.map +7 -0
  264. package/lib/esm/src/pki/data/pkiDataSourceTypes.js +1 -0
  265. package/lib/esm/src/pki/data/pkiDataSourceTypes.js.map +7 -0
  266. package/lib/esm/src/pki/di/pkiModuleFactory.js +2 -0
  267. package/lib/esm/src/pki/di/pkiModuleFactory.js.map +7 -0
  268. package/lib/esm/src/pki/di/pkiTypes.js +2 -0
  269. package/lib/esm/src/pki/di/pkiTypes.js.map +7 -0
  270. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js +2 -0
  271. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js.map +7 -0
  272. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js +2 -0
  273. package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +7 -0
  274. package/lib/esm/src/pki/domain/PkiCertificateLoader.js +1 -0
  275. package/lib/esm/src/pki/domain/PkiCertificateLoader.js.map +7 -0
  276. package/lib/esm/src/pki/model/KeyId.js +2 -0
  277. package/lib/esm/src/pki/model/KeyId.js.map +7 -0
  278. package/lib/esm/src/pki/model/KeyUsage.js +2 -0
  279. package/lib/esm/src/pki/model/KeyUsage.js.map +7 -0
  280. package/lib/esm/src/pki/model/PkiCertificate.js +1 -0
  281. package/lib/esm/src/pki/model/PkiCertificate.js.map +7 -0
  282. package/lib/esm/src/pki/model/PkiCertificateInfo.js +1 -0
  283. package/lib/esm/src/pki/model/PkiCertificateInfo.js.map +7 -0
  284. package/lib/esm/src/shared/domain/ContextLoader.js +1 -0
  285. package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -0
  286. package/lib/esm/src/shared/model/ClearSignContext.js +2 -0
  287. package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -0
  288. package/lib/esm/src/shared/model/GenericPath.js +2 -0
  289. package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
  290. package/lib/esm/src/shared/model/SignatureTags.js +2 -0
  291. package/lib/esm/src/shared/model/SignatureTags.js.map +7 -0
  292. package/lib/esm/src/shared/model/TransactionContext.js +1 -0
  293. package/lib/esm/src/shared/model/TransactionContext.js.map +7 -0
  294. package/lib/esm/src/shared/model/TransactionSubset.js +1 -0
  295. package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -0
  296. package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -0
  297. package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -0
  298. package/lib/esm/src/shared/model/TypedDataContext.js +1 -0
  299. package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -0
  300. package/lib/esm/src/shared/utils/HexStringUtils.js +2 -0
  301. package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -0
  302. package/lib/esm/src/shared/utils/HexStringUtils.test.js +2 -0
  303. package/lib/esm/src/shared/utils/HexStringUtils.test.js.map +7 -0
  304. package/lib/esm/src/shared/utils/KeyUsageMapper.js +2 -0
  305. package/lib/esm/src/shared/utils/KeyUsageMapper.js.map +7 -0
  306. package/lib/esm/src/shared/utils/KeyUsageMapper.test.js +2 -0
  307. package/lib/esm/src/shared/utils/KeyUsageMapper.test.js.map +7 -0
  308. package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -0
  309. package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -0
  310. package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
  311. package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  312. package/lib/esm/src/token/data/TokenDataSource.js +1 -0
  313. package/lib/esm/src/token/data/TokenDataSource.js.map +7 -0
  314. package/lib/esm/src/token/data/TokenDto.js +1 -0
  315. package/lib/esm/src/token/data/TokenDto.js.map +7 -0
  316. package/lib/esm/src/token/di/tokenModuleFactory.js +2 -0
  317. package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -0
  318. package/lib/esm/src/token/di/tokenTypes.js +2 -0
  319. package/lib/esm/src/token/di/tokenTypes.js.map +7 -0
  320. package/lib/esm/src/token/domain/TokenContextLoader.js +2 -0
  321. package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -0
  322. package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
  323. package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
  324. package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
  325. package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
  326. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
  327. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  328. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  329. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  330. package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
  331. package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
  332. package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
  333. package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
  334. package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
  335. package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
  336. package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
  337. package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  338. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  339. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  340. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  341. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  342. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  343. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  344. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
  345. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  346. package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
  347. package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  348. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  349. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  350. package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
  351. package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  352. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  353. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  354. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  355. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  356. package/lib/esm/src/typed-data/data/FiltersDto.js +1 -0
  357. package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -0
  358. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -0
  359. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -0
  360. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  361. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  362. package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -0
  363. package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -0
  364. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -0
  365. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -0
  366. package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -0
  367. package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -0
  368. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -0
  369. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -0
  370. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  371. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  372. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -0
  373. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -0
  374. package/lib/esm/src/uniswap/constants/plugin.js +2 -0
  375. package/lib/esm/src/uniswap/constants/plugin.js.map +7 -0
  376. package/lib/esm/src/uniswap/constants/uniswap.js +2 -0
  377. package/lib/esm/src/uniswap/constants/uniswap.js.map +7 -0
  378. package/lib/esm/src/uniswap/constants/weth.js +2 -0
  379. package/lib/esm/src/uniswap/constants/weth.js.map +7 -0
  380. package/lib/esm/src/uniswap/data/AbiDecoderDataSource.js +1 -0
  381. package/lib/esm/src/uniswap/data/AbiDecoderDataSource.js.map +7 -0
  382. package/lib/esm/src/uniswap/data/CommandDecoderDataSource.js +1 -0
  383. package/lib/esm/src/uniswap/data/CommandDecoderDataSource.js.map +7 -0
  384. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.js +2 -0
  385. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.js.map +7 -0
  386. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.test.js +2 -0
  387. package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.test.js.map +7 -0
  388. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.js +2 -0
  389. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.js.map +7 -0
  390. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.test.js +2 -0
  391. package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.test.js.map +7 -0
  392. package/lib/esm/src/uniswap/di/uniswapModuleFactory.js +2 -0
  393. package/lib/esm/src/uniswap/di/uniswapModuleFactory.js.map +7 -0
  394. package/lib/esm/src/uniswap/di/uniswapTypes.js +2 -0
  395. package/lib/esm/src/uniswap/di/uniswapTypes.js.map +7 -0
  396. package/lib/esm/src/uniswap/domain/UniswapContextLoader.js +2 -0
  397. package/lib/esm/src/uniswap/domain/UniswapContextLoader.js.map +7 -0
  398. package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js +2 -0
  399. package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js.map +7 -0
  400. package/lib/types/src/ContextModule.d.ts +3 -2
  401. package/lib/types/src/ContextModule.d.ts.map +1 -1
  402. package/lib/types/src/ContextModuleBuilder.d.ts +9 -11
  403. package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -1
  404. package/lib/types/src/DefaultContextModule.d.ts +9 -11
  405. package/lib/types/src/DefaultContextModule.d.ts.map +1 -1
  406. package/lib/types/src/config/di/configModuleFactory.d.ts +1 -1
  407. package/lib/types/src/config/di/configModuleFactory.d.ts.map +1 -1
  408. package/lib/types/src/config/model/ContextModuleConfig.d.ts +5 -0
  409. package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -1
  410. package/lib/types/src/di.d.ts +1 -1
  411. package/lib/types/src/di.d.ts.map +1 -1
  412. package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
  413. package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -1
  414. package/lib/types/src/external-plugin/model/DappInfos.d.ts +1 -1
  415. package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -1
  416. package/lib/types/src/index.d.ts +7 -1
  417. package/lib/types/src/index.d.ts.map +1 -1
  418. package/lib/types/src/nft/data/NftDataSource.d.ts +1 -1
  419. package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -1
  420. package/lib/types/src/nft/domain/NftContextLoader.d.ts +2 -1
  421. package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -1
  422. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.d.ts +12 -0
  423. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.d.ts.map +1 -0
  424. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.test.d.ts +2 -0
  425. package/lib/types/src/pki/data/HttpPkiCertificateDataSource.test.d.ts.map +1 -0
  426. package/lib/types/src/pki/data/PkiCertificateDataSource.d.ts +7 -0
  427. package/lib/types/src/pki/data/PkiCertificateDataSource.d.ts.map +1 -0
  428. package/lib/types/src/pki/data/pkiDataSourceTypes.d.ts +23 -0
  429. package/lib/types/src/pki/data/pkiDataSourceTypes.d.ts.map +1 -0
  430. package/lib/types/src/pki/di/pkiModuleFactory.d.ts +3 -0
  431. package/lib/types/src/pki/di/pkiModuleFactory.d.ts.map +1 -0
  432. package/lib/types/src/pki/di/pkiTypes.d.ts +5 -0
  433. package/lib/types/src/pki/di/pkiTypes.d.ts.map +1 -0
  434. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts +10 -0
  435. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts.map +1 -0
  436. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.test.d.ts +2 -0
  437. package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.test.d.ts.map +1 -0
  438. package/lib/types/src/pki/domain/PkiCertificateLoader.d.ts +6 -0
  439. package/lib/types/src/pki/domain/PkiCertificateLoader.d.ts.map +1 -0
  440. package/lib/types/src/pki/model/KeyId.d.ts +14 -0
  441. package/lib/types/src/pki/model/KeyId.d.ts.map +1 -0
  442. package/lib/types/src/pki/model/KeyUsage.d.ts +15 -0
  443. package/lib/types/src/pki/model/KeyUsage.d.ts.map +1 -0
  444. package/lib/types/src/pki/model/PkiCertificate.d.ts +5 -0
  445. package/lib/types/src/pki/model/PkiCertificate.d.ts.map +1 -0
  446. package/lib/types/src/pki/model/PkiCertificateInfo.d.ts +7 -0
  447. package/lib/types/src/pki/model/PkiCertificateInfo.d.ts.map +1 -0
  448. package/lib/types/src/shared/domain/ContextLoader.d.ts +3 -2
  449. package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -1
  450. package/lib/types/src/shared/model/ClearSignContext.d.ts +36 -6
  451. package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -1
  452. package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
  453. package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
  454. package/lib/types/src/shared/model/SignatureTags.d.ts +3 -0
  455. package/lib/types/src/shared/model/SignatureTags.d.ts.map +1 -0
  456. package/lib/types/src/shared/model/TransactionContext.d.ts +17 -2
  457. package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -1
  458. package/lib/types/src/shared/utils/HexStringUtils.d.ts +1 -0
  459. package/lib/types/src/shared/utils/HexStringUtils.d.ts.map +1 -1
  460. package/lib/types/src/shared/utils/HexStringUtils.test.d.ts +2 -0
  461. package/lib/types/src/shared/utils/HexStringUtils.test.d.ts.map +1 -0
  462. package/lib/types/src/shared/utils/KeyUsageMapper.d.ts +6 -0
  463. package/lib/types/src/shared/utils/KeyUsageMapper.d.ts.map +1 -0
  464. package/lib/types/src/shared/utils/KeyUsageMapper.test.d.ts +2 -0
  465. package/lib/types/src/shared/utils/KeyUsageMapper.test.d.ts.map +1 -0
  466. package/lib/types/src/token/data/TokenDataSource.d.ts +1 -1
  467. package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -1
  468. package/lib/types/src/token/domain/TokenContextLoader.d.ts +2 -1
  469. package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -1
  470. package/lib/types/src/transaction/data/CalldataDto.d.ts +128 -0
  471. package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
  472. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +23 -0
  473. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
  474. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
  475. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
  476. package/lib/types/src/transaction/data/TransactionDataSource.d.ts +13 -0
  477. package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
  478. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
  479. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
  480. package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
  481. package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
  482. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
  483. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
  484. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
  485. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
  486. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
  487. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
  488. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
  489. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
  490. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
  491. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
  492. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
  493. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
  494. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
  495. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
  496. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
  497. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
  498. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
  499. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
  500. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
  501. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
  502. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +1 -1
  503. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -1
  504. package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
  505. package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -1
  506. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
  507. package/lib/types/src/uniswap/constants/plugin.d.ts +3 -0
  508. package/lib/types/src/uniswap/constants/plugin.d.ts.map +1 -0
  509. package/lib/types/src/uniswap/constants/uniswap.d.ts +21 -0
  510. package/lib/types/src/uniswap/constants/uniswap.d.ts.map +1 -0
  511. package/lib/types/src/uniswap/constants/weth.d.ts +20 -0
  512. package/lib/types/src/uniswap/constants/weth.d.ts.map +1 -0
  513. package/lib/types/src/uniswap/data/AbiDecoderDataSource.d.ts +5 -0
  514. package/lib/types/src/uniswap/data/AbiDecoderDataSource.d.ts.map +1 -0
  515. package/lib/types/src/uniswap/data/CommandDecoderDataSource.d.ts +6 -0
  516. package/lib/types/src/uniswap/data/CommandDecoderDataSource.d.ts.map +1 -0
  517. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.d.ts +14 -0
  518. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.d.ts.map +1 -0
  519. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.test.d.ts +2 -0
  520. package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.test.d.ts.map +1 -0
  521. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.d.ts +5 -0
  522. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.d.ts.map +1 -0
  523. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.test.d.ts +2 -0
  524. package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.test.d.ts.map +1 -0
  525. package/lib/types/src/uniswap/di/uniswapModuleFactory.d.ts +3 -0
  526. package/lib/types/src/uniswap/di/uniswapModuleFactory.d.ts.map +1 -0
  527. package/lib/types/src/uniswap/di/uniswapTypes.d.ts +6 -0
  528. package/lib/types/src/uniswap/di/uniswapTypes.d.ts.map +1 -0
  529. package/lib/types/src/uniswap/domain/UniswapContextLoader.d.ts +105 -0
  530. package/lib/types/src/uniswap/domain/UniswapContextLoader.d.ts.map +1 -0
  531. package/lib/types/src/uniswap/domain/UniswapContextLoader.test.d.ts +2 -0
  532. package/lib/types/src/uniswap/domain/UniswapContextLoader.test.d.ts.map +1 -0
  533. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  534. package/package.json +21 -18
  535. package/lib/types/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  536. package/lib/types/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  537. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  538. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  539. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.test.d.ts +0 -2
  540. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.test.d.ts.map +0 -1
  541. package/lib/types/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  542. package/lib/types/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  543. package/lib/types/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  544. package/lib/types/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  545. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  546. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  547. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.test.d.ts +0 -2
  548. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.test.d.ts.map +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/uniswap/data/DefaultCommandDecoderDataSource.test.ts"],
4
+ "sourcesContent": ["import { type HexaString } from \"@ledgerhq/device-management-kit\";\n\nimport {\n UNISWAP_COMMANDS,\n UniswapSupportedCommand,\n} from \"@/uniswap/constants/uniswap\";\nimport {\n WETH_ADDRESS_BY_CHAIN_ID,\n WETHSupportedChainIds,\n} from \"@/uniswap/constants/weth\";\n\nimport { type AbiDecoderDataSource } from \"./AbiDecoderDataSource\";\nimport { DefaultCommandDecoderDataSource } from \"./DefaultCommandDecoderDataSource\";\nimport { EthersAbiDecoderDataSource } from \"./EthersAbiDecoderDataSource\";\n\ndescribe(\"DefaultCommandDecoderDataSource\", () => {\n const apiDecoderMock: AbiDecoderDataSource = {\n decode: vi.fn(),\n };\n let dataSource: DefaultCommandDecoderDataSource;\n\n describe(\"decode with mocked apiDecoder\", () => {\n beforeEach(() => {\n dataSource = new DefaultCommandDecoderDataSource(apiDecoderMock);\n });\n\n describe.each([\n [UniswapSupportedCommand.V2_SWAP_EXACT_IN],\n [UniswapSupportedCommand.V2_SWAP_EXACT_OUT],\n ])(\"%s\", (command) => {\n it(\"should return the correct command data\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n [\"0x0102030405060708090a0b0c0d0e0f1011121314\"],\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([\"0x0102030405060708090a0b0c0d0e0f1011121314\"]);\n });\n\n it(\"should return the correct command data with multiple addresses\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n [\n \"0x0102030405060708090a0b0c0d0e0f1011121314\",\n \"0x0102030405060708090a0b0c0d0e0f1011121315\",\n ],\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([\n \"0x0102030405060708090a0b0c0d0e0f1011121314\",\n \"0x0102030405060708090a0b0c0d0e0f1011121315\",\n ]);\n });\n\n it(\"should return an empty array if an address is not valid\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n [\"0x0102030405060708090a0b0c0d0e0f1011121314\", \"invalid\"],\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the addresses are not an array\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n \"invalid\",\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the addresses are not an array of hexa strings\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n [\"invalid\"],\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([]);\n });\n });\n describe.each([\n [UniswapSupportedCommand.V3_SWAP_EXACT_IN],\n [UniswapSupportedCommand.V3_SWAP_EXACT_OUT],\n ])(\"%s\", (command) => {\n it(\"should return the correct command data\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n const addresses = [\n \"0102030405060708090a0b0c0d0e0f1011121314\",\n \"0102030405060708090a0b0c0d0e0f1011121315\",\n ];\n const path = addresses.reduce(\n (acc, address) =>\n acc.length === 0 ? `0x${address}` : `${acc}999999${address}`,\n \"\",\n );\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n path,\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([\n \"0x0102030405060708090a0b0c0d0e0f1011121314\",\n \"0x0102030405060708090a0b0c0d0e0f1011121315\",\n ]);\n });\n\n it(\"should return the correct command data with multiple addresses\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n const addresses = [\n \"0102030405060708090a0b0c0d0e0f1011121314\",\n \"0102030405060708090a0b0c0d0e0f1011121315\",\n \"0102030405060708090a0b0c0d0e0f1011121316\",\n \"0102030405060708090a0b0c0d0e0f1011121317\",\n ];\n const path = addresses.reduce(\n (acc, address) =>\n acc.length === 0 ? `0x${address}` : `${acc}999999${address}`,\n \"\",\n );\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n path,\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([\n \"0x0102030405060708090a0b0c0d0e0f1011121314\",\n \"0x0102030405060708090a0b0c0d0e0f1011121315\",\n \"0x0102030405060708090a0b0c0d0e0f1011121316\",\n \"0x0102030405060708090a0b0c0d0e0f1011121317\",\n ]);\n });\n\n it(\"should return an empty array if the path is not valid\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n \"invalid\",\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the path is not a string\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n 123,\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the path is not a hexa string\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n \"invalid\",\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the path is too short\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n\n const addresses = [\n \"0102030405060708090a0b0c0d0e0f1011121314\",\n \"0102030405060708090a0b0c0d0e0f101112131\", // 1 char missing\n ];\n const path = addresses.reduce(\n (acc, address) =>\n acc.length === 0 ? `0x${address}` : `${acc}999999${address}`,\n \"\",\n );\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x\",\n \"0x\",\n \"0x\",\n path,\n false,\n ]);\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([]);\n });\n });\n\n describe.each([\n UniswapSupportedCommand.WRAP_ETH,\n UniswapSupportedCommand.UNWRAP_ETH,\n ])(\"%s\", (command) => {\n it.each([\n WETHSupportedChainIds.ARBITRUM_GOERLI,\n WETHSupportedChainIds.ARBITRUM_ONE,\n WETHSupportedChainIds.AVALANCHE_C_CHAIN,\n WETHSupportedChainIds.BASE,\n WETHSupportedChainIds.BASE_GOERLI,\n WETHSupportedChainIds.BLAST,\n WETHSupportedChainIds.BSC,\n WETHSupportedChainIds.ETHEREUM_GOERLI,\n WETHSupportedChainIds.ETHEREUM_MAINNET,\n WETHSupportedChainIds.ETHEREUM_SEPOLIA,\n WETHSupportedChainIds.OPTIMISM,\n WETHSupportedChainIds.OPTIMISM_GOERLI,\n WETHSupportedChainIds.POLYGON,\n WETHSupportedChainIds.POLYGON_MUMBAI,\n ])(\"should return the correct command data for chainId %s\", (chainId) => {\n // GIVEN\n const input: HexaString = \"0x\";\n\n // WHEN\n const result = dataSource.decode(command, input, chainId);\n\n // THEN\n expect(result).toEqual([\n WETH_ADDRESS_BY_CHAIN_ID[chainId].toLowerCase(),\n ]);\n });\n\n it(\"should return an empty array if the chainId is not supported\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n\n // WHEN\n const result = dataSource.decode(\n UniswapSupportedCommand.WRAP_ETH,\n input,\n 123,\n );\n\n // THEN\n expect(result).toEqual([]);\n });\n });\n\n describe(\"SWEEP\", () => {\n it(\"should return the correct command data\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x0102030405060708090a0b0c0d0e0f1011121314\",\n \"0x\",\n \"0x\",\n \"0x\",\n ]);\n\n // WHEN\n const result = dataSource.decode(\n UniswapSupportedCommand.SWEEP,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\"0x0102030405060708090a0b0c0d0e0f1011121314\"]);\n });\n\n it(\"should return an empty array if the address is not valid\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n \"invalid\",\n \"0x\",\n \"0x\",\n \"0x\",\n ]);\n\n // WHEN\n const result = dataSource.decode(\n UniswapSupportedCommand.SWEEP,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the address is not a hexa string\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n vi.spyOn(apiDecoderMock, \"decode\").mockReturnValueOnce([\n 123,\n \"0x\",\n \"0x\",\n \"0x\",\n ]);\n\n // WHEN\n const result = dataSource.decode(\n UniswapSupportedCommand.SWEEP,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([]);\n });\n });\n\n describe.each([\n UniswapSupportedCommand.PERMIT2_PERMIT,\n UniswapSupportedCommand.PERMIT2_TRANSFER_FROM,\n UniswapSupportedCommand.PERMIT2_PERMIT_BATCH,\n UniswapSupportedCommand.PERMIT2_TRANSFER_FROM_BATCH,\n UniswapSupportedCommand.PAY_PORTION,\n \"invalid\" as UniswapSupportedCommand,\n ])(\"%s\", (command) => {\n it(\"should return an empty array\", () => {\n // GIVEN\n const input: HexaString = \"0x\";\n\n // WHEN\n const result = dataSource.decode(command, input, 1);\n\n // THEN\n expect(result).toEqual([]);\n });\n });\n });\n\n describe(\"decode with real apiDecoder\", () => {\n beforeEach(() => {\n const abiDecoder = new EthersAbiDecoderDataSource();\n dataSource = new DefaultCommandDecoderDataSource(abiDecoder);\n });\n\n describe(\"V3_SWAP_EXACT_IN -> PAY_PORTION -> UNWRAP_ETH\", () => {\n // https://etherscan.io/tx/0xc9821c32c1782d9ab6baf6f9ca4b2565bce11aaf5146a2d303215bda026f5e48\n const commands: HexaString[] = [\"0x00\", \"0x06\", \"0x0c\"];\n const inputs: HexaString[] = [\n \"0x00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000a18f07d736b90be5500000000000000000000000000000000000000000000000000000000b0b8122abd8412900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bb9f599ce614feb2e1bbe58f180f370d05b39344e002710c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000\",\n \"0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000017cc6042605381c158d2adab487434bde79aa61c000000000000000000000000000000000000000000000000000000000000005b\",\n \"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000b0b8122abd84129\",\n ];\n\n it(\"V3_SWAP_EXACT_IN\", () => {\n // GIVEN\n const command = commands[0]!;\n const input = inputs[0]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\n \"0xb9f599ce614feb2e1bbe58f180f370d05b39344e\", // ERC20\n \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\", // WETH\n ]);\n });\n\n it(\"PAY_PORTION\", () => {\n // GIVEN\n const command = commands[1]!;\n const input = inputs[1]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"UNWRAP_ETH\", () => {\n // GIVEN\n const command = commands[2]!;\n const input = inputs[2]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\"]); // WETH\n });\n });\n\n describe(\"WRAP_ETH -> V3_SWAP_EXACT_OUT -> TRANSFERT -> SWEEP -> UNWRAP_ETH\", () => {\n // https://etherscan.io/tx/0xa628c8b3da2ad984aed0354d8ca4b4c3c42941491dc4e0d6a5f423fd65e6c90a\n const commands: HexaString[] = [\"0x0b\", \"0x01\", \"0x05\", \"0x04\", \"0x0c\"];\n const inputs: HexaString[] = [\n \"0x0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000078e6708e70aed0f\",\n \"0x00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000059a16770000000000000000000000000000000000000000000000000078e6708e70aed0f00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f4c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000\",\n \"0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000027213e28d7fda5c57fe9e5dd923818dbccf71c470000000000000000000000000000000000000000000000000000000000393870\",\n \"0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006f939b43d65be049b7533907db08e80ba6969f450000000000000000000000000000000000000000000000000000000059682f00\",\n \"0x0000000000000000000000006f939b43d65be049b7533907db08e80ba6969f450000000000000000000000000000000000000000000000000000000000000000\",\n ];\n\n it(\"WRAP_ETH\", () => {\n // GIVEN\n const command = commands[0]!;\n const input = inputs[0]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\"]); // WETH\n });\n\n it(\"V3_SWAP_EXACT_OUT\", () => {\n // GIVEN\n const command = commands[1]!;\n const input = inputs[1]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\n \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\", // USDC\n \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\", // WETH\n ]);\n });\n\n it(\"TRANSFERT\", () => {\n // GIVEN\n const command = commands[2]!;\n const input = inputs[2]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"SWEEP\", () => {\n // GIVEN\n const command = commands[3]!;\n const input = inputs[3]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\"]); // USDC\n });\n\n it(\"UNWRAP_ETH\", () => {\n // GIVEN\n const command = commands[4]!;\n const input = inputs[4]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\"]); // WETH\n });\n });\n\n describe(\"V2_SWAP_EXACT_IN -> PAY_PORTION -> UNWRAP_ETH\", () => {\n // https://etherscan.io/tx/0x78bc5732213e09d9ead8cabc269b7c426b0301dfe543c37d0a920e25eaa9447f\n const commands: HexaString[] = [\"0x08\", \"0x06\", \"0x0c\"];\n const inputs: HexaString[] = [\n \"0x0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000003ebb8addda849d38caed0000000000000000000000000000000000000000000000000f238e04a7ccbf5100000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000003b991130eae3cca364406d718da22fa1c3e7c256000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n \"0x000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000fee13a103a10d593b9ae06b3e05f2e7e1c0000000000000000000000000000000000000000000000000000000000000019\",\n \"0x00000000000000000000000002573c689ddedddd450e6c947f5bb67de70e80b50000000000000000000000000000000000000000000000000f19dda9c38a50c1\",\n ];\n\n it(\"V2_SWAP_EXACT_IN\", () => {\n // GIVEN\n const command = commands[0]!;\n const input = inputs[0]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\n \"0x3b991130eae3cca364406d718da22fa1c3e7c256\", // ERC20\n \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\", // WETH\n ]);\n });\n\n it(\"PAY_PORTION\", () => {\n // GIVEN\n const command = commands[1]!;\n const input = inputs[1]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"UNWRAP_ETH\", () => {\n // GIVEN\n const command = commands[2]!;\n const input = inputs[2]!;\n\n // WHEN\n const result = dataSource.decode(\n UNISWAP_COMMANDS[command] as UniswapSupportedCommand,\n input,\n 1,\n );\n\n // THEN\n expect(result).toEqual([\"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\"]); // WETH\n });\n });\n });\n});\n"],
5
+ "mappings": "aAEA,IAAAA,EAGO,uCACPC,EAGO,oCAGPC,EAAgD,6CAChDC,EAA2C,wCAE3C,SAAS,kCAAmC,IAAM,CAChD,MAAMC,EAAuC,CAC3C,OAAQ,GAAG,GAAG,CAChB,EACA,IAAIC,EAEJ,SAAS,gCAAiC,IAAM,CAC9C,WAAW,IAAM,CACfA,EAAa,IAAI,kCAAgCD,CAAc,CACjE,CAAC,EAED,SAAS,KAAK,CACZ,CAAC,0BAAwB,gBAAgB,EACzC,CAAC,0BAAwB,iBAAiB,CAC5C,CAAC,EAAE,KAAOE,GAAY,CACpB,GAAG,yCAA0C,IAAM,CAEjD,MAAMC,EAAoB,KAC1B,GAAG,MAAMH,EAAgB,QAAQ,EAAE,oBAAoB,CACrD,KACA,KACA,KACA,CAAC,4CAA4C,EAC7C,EACF,CAAC,EAGD,MAAMI,EAASH,EAAW,OAAOC,EAASC,EAAO,CAAC,EAGlD,OAAOC,CAAM,EAAE,QAAQ,CAAC,4CAA4C,CAAC,CACvE,CAAC,EAED,GAAG,iEAAkE,IAAM,CAEzE,MAAMD,EAAoB,KAC1B,GAAG,MAAMH,EAAgB,QAAQ,EAAE,oBAAoB,CAC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ACF,EAGA,OAAOC,CAAM,EAAE,QAAQ,CAAC,4CAA4C,CAAC,CACvE,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_uniswap", "import_weth", "import_DefaultCommandDecoderDataSource", "import_EthersAbiDecoderDataSource", "apiDecoderMock", "dataSource", "command", "input", "result", "path", "acc", "address", "chainId", "abiDecoder", "commands", "inputs"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var m=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var g=(t,r)=>{for(var e in r)m(t,e,{get:r[e],enumerable:!0})},s=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of a(r))!b.call(t,o)&&o!==e&&m(t,o,{get:()=>r[o],enumerable:!(n=c(r,o))||n.enumerable});return t};var y=t=>s(m({},"__esModule",{value:!0}),t),f=(t,r,e,n)=>{for(var o=n>1?void 0:n?c(r,e):r,d=t.length-1,p;d>=0;d--)(p=t[d])&&(o=(n?p(r,e,o):p(o))||o);return n&&o&&m(r,e,o),o};var C={};g(C,{EthersAbiDecoderDataSource:()=>i});module.exports=y(C);var l=require("ethers"),u=require("inversify");let i=class{decode(r,e){try{return l.AbiCoder.defaultAbiCoder().decode(r,e)}catch{return[]}}};i=f([(0,u.injectable)()],i);0&&(module.exports={EthersAbiDecoderDataSource});
2
+ //# sourceMappingURL=EthersAbiDecoderDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/uniswap/data/EthersAbiDecoderDataSource.ts"],
4
+ "sourcesContent": ["import { AbiCoder } from \"ethers\";\nimport { injectable } from \"inversify\";\n\nimport { type AbiDecoderDataSource } from \"./AbiDecoderDataSource\";\n\n@injectable()\nexport class EthersAbiDecoderDataSource implements AbiDecoderDataSource {\n decode(types: string[], data: string): unknown[] {\n try {\n return AbiCoder.defaultAbiCoder().decode(types, data);\n } catch (_) {\n return [];\n }\n }\n}\n"],
5
+ "mappings": "2iBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,kBACzBC,EAA2B,qBAKpB,IAAMC,EAAN,KAAiE,CACtE,OAAOC,EAAiBC,EAAyB,CAC/C,GAAI,CACF,OAAO,WAAS,gBAAgB,EAAE,OAAOD,EAAOC,CAAI,CACtD,MAAY,CACV,MAAO,CAAC,CACV,CACF,CACF,EARaF,EAANG,EAAA,IADN,cAAW,GACCH",
6
+ "names": ["EthersAbiDecoderDataSource_exports", "__export", "EthersAbiDecoderDataSource", "__toCommonJS", "import_ethers", "import_inversify", "EthersAbiDecoderDataSource", "types", "data", "__decorateClass"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=require("./EthersAbiDecoderDataSource");describe("EthersAbiDecoderDataSource",()=>{let t;beforeEach(()=>{t=new a.EthersAbiDecoderDataSource}),it("should correctly decode valid ABI data",()=>{const c=["uint256","address"],e=t.decode(c,"0x000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000027213e28d7fda5c57fe9e5dd923818dbccf71c47");expect(e[0]).toEqual(10n),expect(e[1]).toEqual("0x27213E28D7fDA5c57Fe9e5dD923818DBCcf71c47")}),it("should return an empty array on decode failure",()=>{const c=["uint256"],e=t.decode(c,"0x1234");expect(e).toEqual([])})});
2
+ //# sourceMappingURL=EthersAbiDecoderDataSource.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/uniswap/data/EthersAbiDecoderDataSource.test.ts"],
4
+ "sourcesContent": ["import { EthersAbiDecoderDataSource } from \"./EthersAbiDecoderDataSource\";\n\ndescribe(\"EthersAbiDecoderDataSource\", () => {\n let decoder: EthersAbiDecoderDataSource;\n\n beforeEach(() => {\n decoder = new EthersAbiDecoderDataSource();\n });\n\n it(\"should correctly decode valid ABI data\", () => {\n const types = [\"uint256\", \"address\"];\n const data =\n \"0x\" +\n \"000000000000000000000000000000000000000000000000000000000000000a\" + // 10 as uint256\n \"00000000000000000000000027213e28d7fda5c57fe9e5dd923818dbccf71c47\"; // Address\n\n const result = decoder.decode(types, data);\n expect(result[0]).toEqual(10n);\n expect(result[1]).toEqual(\"0x27213E28D7fDA5c57Fe9e5dD923818DBCcf71c47\");\n });\n\n it(\"should return an empty array on decode failure\", () => {\n const types = [\"uint256\"];\n const invalidData = \"0x1234\"; // Invalid encoded data\n\n const result = decoder.decode(types, invalidData);\n expect(result).toEqual([]);\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA2C,wCAE3C,SAAS,6BAA8B,IAAM,CAC3C,IAAIC,EAEJ,WAAW,IAAM,CACfA,EAAU,IAAI,4BAChB,CAAC,EAED,GAAG,yCAA0C,IAAM,CACjD,MAAMC,EAAQ,CAAC,UAAW,SAAS,EAM7BC,EAASF,EAAQ,OAAOC,EAJ5B,oIAIuC,EACzC,OAAOC,EAAO,CAAC,CAAC,EAAE,QAAQ,GAAG,EAC7B,OAAOA,EAAO,CAAC,CAAC,EAAE,QAAQ,4CAA4C,CACxE,CAAC,EAED,GAAG,iDAAkD,IAAM,CACzD,MAAMD,EAAQ,CAAC,SAAS,EAGlBC,EAASF,EAAQ,OAAOC,EAFV,QAE4B,EAChD,OAAOC,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,CACH,CAAC",
6
+ "names": ["import_EthersAbiDecoderDataSource", "decoder", "types", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(o,e)=>{for(var r in e)n(o,r,{get:e[r],enumerable:!0})},w=(o,e,r,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of D(e))!s.call(o,t)&&t!==r&&n(o,t,{get:()=>e[t],enumerable:!(m=c(e,t))||m.enumerable});return o};var C=o=>w(n({},"__esModule",{value:!0}),o);var l={};f(l,{uniswapModuleFactory:()=>S});module.exports=C(l);var i=require("inversify"),d=require("../../uniswap/data/DefaultCommandDecoderDataSource"),p=require("../../uniswap/data/EthersAbiDecoderDataSource"),u=require("../../uniswap/domain/UniswapContextLoader"),a=require("./uniswapTypes");const S=()=>new i.ContainerModule((o,e,r,m)=>{o(a.uniswapTypes.AbiDecoderDataSource).to(p.EthersAbiDecoderDataSource),o(a.uniswapTypes.CommandDecoderDataSource).to(d.DefaultCommandDecoderDataSource),o(a.uniswapTypes.UniswapContextLoader).to(u.UniswapContextLoader)});0&&(module.exports={uniswapModuleFactory});
2
+ //# sourceMappingURL=uniswapModuleFactory.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/uniswap/di/uniswapModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { DefaultCommandDecoderDataSource } from \"@/uniswap/data/DefaultCommandDecoderDataSource\";\nimport { EthersAbiDecoderDataSource } from \"@/uniswap/data/EthersAbiDecoderDataSource\";\nimport { UniswapContextLoader } from \"@/uniswap/domain/UniswapContextLoader\";\n\nimport { uniswapTypes } from \"./uniswapTypes\";\n\nexport const uniswapModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(uniswapTypes.AbiDecoderDataSource).to(EthersAbiDecoderDataSource);\n bind(uniswapTypes.CommandDecoderDataSource).to(\n DefaultCommandDecoderDataSource,\n );\n bind(uniswapTypes.UniswapContextLoader).to(UniswapContextLoader);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAgD,0DAChDC,EAA2C,qDAC3CC,EAAqC,iDAErCC,EAA6B,0BAEtB,MAAMN,EAAuB,IAClC,IAAI,kBAAgB,CAACO,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,eAAa,oBAAoB,EAAE,GAAG,4BAA0B,EACrEA,EAAK,eAAa,wBAAwB,EAAE,GAC1C,iCACF,EACAA,EAAK,eAAa,oBAAoB,EAAE,GAAG,sBAAoB,CACjE,CAAC",
6
+ "names": ["uniswapModuleFactory_exports", "__export", "uniswapModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultCommandDecoderDataSource", "import_EthersAbiDecoderDataSource", "import_UniswapContextLoader", "import_uniswapTypes", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var t=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var m=(e,o)=>{for(var r in o)t(e,r,{get:o[r],enumerable:!0})},S=(e,o,r,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of n(o))!D.call(e,a)&&a!==r&&t(e,a,{get:()=>o[a],enumerable:!(c=d(o,a))||c.enumerable});return e};var b=e=>S(t({},"__esModule",{value:!0}),e);var p={};m(p,{uniswapTypes:()=>i});module.exports=b(p);const i={AbiDecoderDataSource:Symbol.for("AbiDecoderDataSource"),CommandDecoderDataSource:Symbol.for("CommandDecoderDataSource"),UniswapContextLoader:Symbol.for("UniswapContextLoader")};0&&(module.exports={uniswapTypes});
2
+ //# sourceMappingURL=uniswapTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/uniswap/di/uniswapTypes.ts"],
4
+ "sourcesContent": ["export const uniswapTypes = {\n AbiDecoderDataSource: Symbol.for(\"AbiDecoderDataSource\"),\n CommandDecoderDataSource: Symbol.for(\"CommandDecoderDataSource\"),\n UniswapContextLoader: Symbol.for(\"UniswapContextLoader\"),\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAe,CAC1B,qBAAsB,OAAO,IAAI,sBAAsB,EACvD,yBAA0B,OAAO,IAAI,0BAA0B,EAC/D,qBAAsB,OAAO,IAAI,sBAAsB,CACzD",
6
+ "names": ["uniswapTypes_exports", "__export", "uniswapTypes", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var l=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var k=(n,e)=>{for(var t in e)l(n,t,{get:e[t],enumerable:!0})},H=(n,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of I(e))!w.call(n,r)&&r!==t&&l(n,r,{get:()=>e[r],enumerable:!(a=D(e,r))||a.enumerable});return n};var b=n=>H(l({},"__esModule",{value:!0}),n),_=(n,e,t,a)=>{for(var r=a>1?void 0:a?D(e,t):e,i=n.length-1,d;i>=0;i--)(d=n[i])&&(r=(a?d(e,t,r):d(r))||r);return a&&r&&l(e,t,r),r},C=(n,e)=>(t,a)=>e(t,a,n);var R={};k(R,{UniswapContextLoader:()=>p});module.exports=b(R);var o=require("@ledgerhq/device-management-kit"),A=require("ethers"),c=require("inversify"),S=require("purify-ts"),g=require("../../shared/model/ClearSignContext"),T=require("../../token/di/tokenTypes"),f=require("../../uniswap/constants/plugin"),s=require("../../uniswap/constants/uniswap"),h=require("../../uniswap/di/uniswapTypes");let p=class{constructor(e,t){this.commandDecoderDataSource=e;this.tokenDataSource=t}async load(e){if(!e.data||!(0,o.isHexaString)(e.data))return[];if(e.data.slice(0,10)!==s.UNISWAP_EXECUTE_SELECTOR)return[];const a=this._buildUniswapPluginCommandData(),r=await this._extractClearSignContexts(e.data,e.chainId);return r.length>0?[a,...r]:[]}_buildUniswapPluginCommandData(){const e=new o.ByteArrayBuilder().add8BitUIntToData(f.UNISWAP_PLUGIN_NAME.length).addAsciiStringToData(f.UNISWAP_PLUGIN_NAME).addBufferToData((0,o.hexaStringToBuffer)(s.UNISWAP_UNIVERSAL_ROUTER_ADDRESS)).addBufferToData((0,o.hexaStringToBuffer)(s.UNISWAP_EXECUTE_SELECTOR)).addBufferToData((0,o.hexaStringToBuffer)(f.UNISWAP_PLUGIN_SIGNATURE)).build();return{type:g.ClearSignContextType.EXTERNAL_PLUGIN,payload:(0,o.bufferToHexaString)(e).slice(2)}}async _extractClearSignContexts(e,t){try{const r=new A.Interface(s.UNISWAP_EXECUTE_ABI).parseTransaction({data:e}),i=r?.args[0],d=r?.args[1];if(!(0,o.isHexaString)(i)||!this._isHexaStringArray(d))return[];const x=this._extractCommands(i).orDefault([]);if(i.length===0||d.length!==x.length)return[];const y=x.reduce((m,u,U)=>{const N=d[U],E=this.commandDecoderDataSource.decode(u,N,t);return m.push([u,E]),m},[]);if(!this._isChainingSwapSupported(y))return[];const P=[...new Set(y.flatMap(([,m])=>m))];return(await Promise.all(P.map(m=>this.tokenDataSource.getTokenInfosPayload({address:m,chainId:t})))).map(m=>m.caseOf({Left:u=>({type:g.ClearSignContextType.ERROR,error:u}),Right:u=>({type:g.ClearSignContextType.TOKEN,payload:u})}))}catch{return[]}}_extractCommands(e){return S.Maybe.fromNullable(e.slice(2).match(/../g)).map(t=>t.map(a=>`0x${a}`)).map(t=>t.map(a=>s.UNISWAP_COMMANDS[a])).chain(t=>t.every(a=>a!==void 0)?S.Maybe.of(t):S.Nothing)}_isChainingSwapSupported(e){let t,a;for(const[r,i]of e){if(!s.UNISWAP_SWAP_COMMANDS.includes(r))continue;const d=r.slice(0,2);if(t&&(t!==i[0]||a!==d))return!1;t=i[i.length-1],a=d}return!0}_isHexaStringArray(e){return Array.isArray(e)&&e.every(t=>typeof t=="string"&&(0,o.isHexaString)(t))}};p=_([(0,c.injectable)(),C(0,(0,c.inject)(h.uniswapTypes.CommandDecoderDataSource)),C(1,(0,c.inject)(T.tokenTypes.TokenDataSource))],p);0&&(module.exports={UniswapContextLoader});
2
+ //# sourceMappingURL=UniswapContextLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/uniswap/domain/UniswapContextLoader.ts"],
4
+ "sourcesContent": ["import {\n bufferToHexaString,\n ByteArrayBuilder,\n HexaString,\n hexaStringToBuffer,\n isHexaString,\n} from \"@ledgerhq/device-management-kit\";\nimport { Interface } from \"ethers\";\nimport { inject, injectable } from \"inversify\";\nimport { Maybe, Nothing } from \"purify-ts\";\n\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport { TransactionContext } from \"@/shared/model/TransactionContext\";\nimport { type TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport {\n UNISWAP_PLUGIN_NAME,\n UNISWAP_PLUGIN_SIGNATURE,\n} from \"@/uniswap/constants/plugin\";\nimport {\n UNISWAP_COMMANDS,\n UNISWAP_EXECUTE_ABI,\n UNISWAP_EXECUTE_SELECTOR,\n UNISWAP_SWAP_COMMANDS,\n UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n UniswapSupportedCommand,\n} from \"@/uniswap/constants/uniswap\";\nimport { type CommandDecoderDataSource } from \"@/uniswap/data/CommandDecoderDataSource\";\nimport { uniswapTypes } from \"@/uniswap/di/uniswapTypes\";\n\n@injectable()\nexport class UniswapContextLoader implements ContextLoader {\n constructor(\n @inject(uniswapTypes.CommandDecoderDataSource)\n private commandDecoderDataSource: CommandDecoderDataSource,\n @inject(tokenTypes.TokenDataSource)\n private tokenDataSource: TokenDataSource,\n ) {}\n\n async load(transaction: TransactionContext): Promise<ClearSignContext[]> {\n if (!transaction.data || !isHexaString(transaction.data)) {\n return [];\n }\n\n const selector = transaction.data.slice(0, 10);\n if (selector !== UNISWAP_EXECUTE_SELECTOR) {\n return [];\n }\n\n const externalPluginContext = this._buildUniswapPluginCommandData();\n const tokenContexts = await this._extractClearSignContexts(\n transaction.data,\n transaction.chainId,\n );\n\n if (tokenContexts.length > 0)\n return [externalPluginContext, ...tokenContexts];\n\n return [];\n }\n\n /**\n * Constructs the external plugin context for Uniswap external plugin command.\n *\n * @private\n * @returns {ClearSignContext} - The generated external plugin context.\n */\n private _buildUniswapPluginCommandData(): ClearSignContext {\n const buffer = new ByteArrayBuilder()\n .add8BitUIntToData(UNISWAP_PLUGIN_NAME.length)\n .addAsciiStringToData(UNISWAP_PLUGIN_NAME)\n .addBufferToData(hexaStringToBuffer(UNISWAP_UNIVERSAL_ROUTER_ADDRESS)!)\n .addBufferToData(hexaStringToBuffer(UNISWAP_EXECUTE_SELECTOR)!)\n .addBufferToData(hexaStringToBuffer(UNISWAP_PLUGIN_SIGNATURE)!)\n .build();\n\n return {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: bufferToHexaString(buffer).slice(2),\n };\n }\n\n /**\n * Extracts and decodes the clear sign contexts from a Uniswap calldata transaction.\n *\n * This function:\n * - Parses the calldata using the Uniswap `execute` function signature.\n * - Extracts and validates the `commands` and `inputs`.\n * - Decodes the commands and ensures they match the number of inputs.\n * - Extracts addresses used in the transaction and verifies if chaining swaps are supported.\n * - Fetches token information for unique addresses.\n * - Returns an array of `ClearSignContext` objects representing either token data or errors.\n *\n * @private\n * @param {HexaString} calldata - The raw calldata of the Uniswap transaction.\n * @param {number} chainId - The blockchain chain ID where the transaction is being executed.\n * @returns {Promise<ClearSignContext[]>} - A promise resolving to an array of clear sign contexts.\n */\n private async _extractClearSignContexts(\n calldata: HexaString,\n chainId: number,\n ): Promise<ClearSignContext[]> {\n try {\n const iface = new Interface(UNISWAP_EXECUTE_ABI);\n\n const tx = iface.parseTransaction({ data: calldata });\n const commands: unknown = tx?.args[0];\n const inputs: unknown = tx?.args[1];\n\n if (!isHexaString(commands) || !this._isHexaStringArray(inputs)) {\n return [];\n }\n\n const decodedCommands = this._extractCommands(commands).orDefault([]);\n if (commands.length === 0 || inputs.length !== decodedCommands.length) {\n // Invalid commands or inputs\n return [];\n }\n\n const addressesByCommand = decodedCommands.reduce(\n (acc, command, index) => {\n const input = inputs[index]!;\n const decoded: HexaString[] = this.commandDecoderDataSource.decode(\n command,\n input,\n chainId,\n );\n\n acc.push([command, decoded]);\n\n return acc;\n },\n [] as [UniswapSupportedCommand, HexaString[]][],\n );\n\n if (!this._isChainingSwapSupported(addressesByCommand)) {\n return [];\n }\n\n const uniqueAddresses = [\n ...new Set(addressesByCommand.flatMap(([, addresses]) => addresses)),\n ];\n\n const tokensPayload = await Promise.all(\n uniqueAddresses.map((address) =>\n this.tokenDataSource.getTokenInfosPayload({ address, chainId }),\n ),\n );\n\n return tokensPayload.map((either) =>\n either.caseOf<ClearSignContext>({\n Left: (error) => ({ type: ClearSignContextType.ERROR, error }),\n Right: (payload) => ({ type: ClearSignContextType.TOKEN, payload }),\n }),\n );\n } catch (_) {\n return [];\n }\n }\n\n /**\n * Extracts Uniswap-supported commands from a hexadecimal string.\n * Each command is represented by one byte (2 hex characters), and this function:\n * - Maps each command to a known Uniswap command.\n * - Returns `Nothing` if any extracted command is unsupported.\n *\n * @private\n * @param {HexaString} hex - A hexadecimal string representing commands.\n * @returns {Maybe<UniswapSupportedCommand[]>} - A `Maybe` containing an array of recognized commands, or `Nothing` if any command is unsupported.\n *\n * @example\n * // Valid command extraction\n * _extractCommands('0x0008');\n * // Returns: Just(['0x00', '0x08'])\n *\n * @example\n * // Contains an unsupported command (0x05 is not supported)\n * _extractCommands('0x0005');\n * // Returns: Nothing\n *\n * @example\n * // Empty or invalid input\n * _extractCommands('0x');\n * // Returns: Nothing\n */\n private _extractCommands(hex: HexaString): Maybe<UniswapSupportedCommand[]> {\n return Maybe.fromNullable(hex.slice(2).match(/../g))\n .map((bytes) => bytes.map((b) => `0x${b}` as HexaString))\n .map((hexBytes) => hexBytes.map((b) => UNISWAP_COMMANDS[b]))\n .chain((commands) =>\n commands.every((command) => command !== undefined)\n ? Maybe.of(commands as UniswapSupportedCommand[])\n : Nothing,\n );\n }\n\n /**\n * Checks if the provided swap commands can be chained together.\n * A valid chain requires that:\n * - The output asset of the previous swap matches the input asset of the next swap.\n * - The pool version remains consistent across swaps.\n *\n * @private\n * @param {Array<[UniswapSupportedCommand, HexaString[]]>} data - An array of tuples containing a swap command and associated addresses.\n * @returns {boolean} - Returns `true` if the swap commands form a valid chain, otherwise `false`.\n *\n * @example\n * // Valid chaining: same output/input asset and pool version\n * _isChainingSwapSupported([\n * ['0x08', ['0xABC', '0xDEF']],\n * ['0x08', ['0xDEF', '0x123']]\n * ]);\n * // Returns: true\n *\n * @example\n * // Invalid chaining: different pool versions\n * _isChainingSwapSupported([\n * ['0x08', ['0xABC', '0xDEF']],\n * ['0x01', ['0xDEF', '0x123']]\n * ]);\n * // Returns: false\n *\n * @example\n * // Invalid chaining: output does not match next input\n * _isChainingSwapSupported([\n * ['0x01A1', ['0xABC', '0xDEF']],\n * ['0x01B2', ['0xXYZ', '0x123']]\n * ]);\n * // Returns: false\n */\n private _isChainingSwapSupported(\n data: [UniswapSupportedCommand, HexaString[]][],\n ): boolean {\n let lastAsset: HexaString | undefined = undefined;\n let lastPoolVersion: string | undefined = undefined;\n\n for (const [command, addresses] of data) {\n if (!UNISWAP_SWAP_COMMANDS.includes(command)) continue; // Ignore non-swap commands\n\n const poolVersion = command.slice(0, 2);\n\n if (\n lastAsset &&\n (lastAsset !== addresses[0] || lastPoolVersion !== poolVersion)\n ) {\n // Invalid chaining, return empty array\n return false;\n }\n\n // update last asset and pool version\n lastAsset = addresses[addresses.length - 1];\n lastPoolVersion = poolVersion;\n }\n\n return true;\n }\n\n /**\n * Checks if a given value is an array of hexadecimal strings.\n *\n * @private\n * @param {unknown} array - The value to check.\n * @returns {array is HexaString[]} - `true` if the value is an array of hexadecimal strings, otherwise `false`.\n */\n private _isHexaStringArray(array: unknown): array is HexaString[] {\n return (\n Array.isArray(array) &&\n array.every((item) => typeof item === \"string\" && isHexaString(item))\n );\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAMO,2CACPC,EAA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,CAAO,EAAG,SAE9C,MAAMiB,EAAcjB,EAAQ,MAAM,EAAG,CAAC,EAEtC,GACEe,IACCA,IAAcV,EAAU,CAAC,GAAKW,IAAoBC,GAGnD,MAAO,GAITF,EAAYV,EAAUA,EAAU,OAAS,CAAC,EAC1CW,EAAkBC,CACpB,CAEA,MAAO,EACT,CASQ,mBAAmBC,EAAuC,CAChE,OACE,MAAM,QAAQA,CAAK,GACnBA,EAAM,MAAOC,GAAS,OAAOA,GAAS,aAAY,gBAAaA,CAAI,CAAC,CAExE,CACF,EA/OalC,EAANmC,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,eAAa,wBAAwB,GAE5CA,EAAA,eAAO,aAAW,eAAe,IAJzBpC",
6
+ "names": ["UniswapContextLoader_exports", "__export", "UniswapContextLoader", "__toCommonJS", "import_device_management_kit", "import_ethers", "import_inversify", "import_purify_ts", "import_ClearSignContext", "import_tokenTypes", "import_plugin", "import_uniswap", "import_uniswapTypes", "UniswapContextLoader", "commandDecoderDataSource", "tokenDataSource", "transaction", "externalPluginContext", "tokenContexts", "buffer", "calldata", "chainId", "tx", "commands", "inputs", "decodedCommands", "addressesByCommand", "acc", "command", "index", "input", "decoded", "uniqueAddresses", "addresses", "address", "either", "error", "payload", "hex", "bytes", "b", "hexBytes", "data", "lastAsset", "lastPoolVersion", "poolVersion", "array", "item", "__decorateClass", "__decorateParam"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var s=require("ethers"),r=require("purify-ts"),f=require("../../shared/model/ClearSignContext"),e=require("../../uniswap/constants/uniswap"),l=require("../../uniswap/data/DefaultCommandDecoderDataSource"),x=require("../../uniswap/data/EthersAbiDecoderDataSource"),p=require("./UniswapContextLoader");describe("UniswapContextLoader",()=>{const t={decode:vi.fn()},o={getTokenInfosPayload:vi.fn()};let c;describe("load",()=>{describe("with tokenDataSourceMock",()=>{beforeEach(()=>{vi.spyOn(o,"getTokenInfosPayload").mockImplementation(({address:a})=>Promise.resolve((0,r.Right)(`payload-${a}`))),c=new p.UniswapContextLoader(new l.DefaultCommandDecoderDataSource(new x.EthersAbiDecoderDataSource),o)}),it("should return the external plugin context and the decoded contexts",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067a4855b000000000000000000000000000000000000000000000000000000000000000300060c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000a18f07d736b90be5500000000000000000000000000000000000000000000000000000000b0b8122abd8412900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bb9f599ce614feb2e1bbe58f180f370d05b39344e002710c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000017cc6042605381c158d2adab487434bde79aa61c000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000b0b8122abd84129c001a053efc49d03b694742500f49aa09df2360bd7e297fa730c745e0d4320b42fc33fa01ca1c85a46c561f624830fffbae2441ba0f2d54eb5b0f17e0e3561d10db0b7ee"},n=await c.load(a);expect(n).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0xb9f599ce614feb2e1bbe58f180f370d05b39344e"},{type:"token",payload:"payload-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}])}),it("should return the external plugin context and the decoded contexts with a permit",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000669b9ec100000000000000000000000000000000000000000000000000000000000000030a010c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000016000000000000000000000000055747be9f9f5beb232ad59fe7af013b81d95fd5e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000066c32b0d0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000ef1c6e67703c7bd7107eed8303fbe6ec2554bf6b00000000000000000000000000000000000000000000000000000000669b9ec100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000410d756f55acf289e9754faf91bba0a704b5c7c0aa4b1dfd551115ccbe4c7f290234e1a14265e1da0bc872a23627d997fe37a689c290d519f7b8c9bdde1b79108e1b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000030ba49cbff5a00000000000000000000000000000000000000000000000089677c957272141800000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc200271055747be9f9f5beb232ad59fe7af013b81d95fd5e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000030ba49cbff5a000c001a0e406d9c91c8b46d959fcd31a28518a77bb248ebb316c5fab7b98335cce922f2aa0462cb970c32a8dbfe71c57b888c43b9ed04fce41d169dbfcc745445587adb771"},n=await c.load(a);expect(n).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"},{type:"token",payload:"payload-0x55747be9f9f5beb232ad59fe7af013b81d95fd5e"}])}),it("should return an empty array if the transaction is not supported",async()=>{const a={};vi.spyOn(t,"decode").mockReturnValue([]);const n=await c.load(a);expect(n).toEqual([])}),it("should return an empty array if a command is not supported",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067a4bef600000000000000000000000000000000000000000000000000000000000000050b0105040c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000078e6708e70aed0f000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000059a16770000000000000000000000000000000000000000000000000078e6708e70aed0f00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f4c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000027213e28d7fda5c57fe9e5dd923818dbccf71c4700000000000000000000000000000000000000000000000000000000003938700000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006f939b43d65be049b7533907db08e80ba6969f450000000000000000000000000000000000000000000000000000000059682f0000000000000000000000000000000000000000000000000000000000000000400000000000000000000000006f939b43d65be049b7533907db08e80ba6969f4500000000000000000000000000000000000000000000000000000000000000000cc080a07c86dd5813ec1f3725c402f8bea6105546d1093c59676023b971f1d83f61bd4ea02a353bf3028cabcbe68c5dc8906752bafe55afc86b6344edb3ffd8a3650332e8"},n=await c.load(a);expect(n).toEqual([])})}),describe("with mocked ethers parseTransaction",()=>{beforeEach(()=>{vi.resetAllMocks(),c=new p.UniswapContextLoader(t,o)}),it("should return an array with contexts if 2 chain swaps are supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(t,"decode").mockReturnValueOnce(["0x01","0x04","0x02"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x02","0x03"]),vi.spyOn(o,"getTokenInfosPayload").mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(t.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x04",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x02",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(4,{address:"0x03",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0x01"},{type:"token",payload:"payload-0x04"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"}])}),it("should return an array with contexts if 1 chain swap with a non swap command",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0b0004",["0x0001","0x0002","0x0003"]]}),vi.spyOn(t,"decode").mockReturnValueOnce(["0x01"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x02","0x03"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x04"]),vi.spyOn(o,"getTokenInfosPayload").mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.WRAP_ETH,"0x0001",66),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x02",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x03",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(4,{address:"0x04",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0x01"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"},{type:"token",payload:"payload-0x04"}])}),it("should return an array with contexts if one token is not found",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(t,"decode").mockReturnValueOnce(["0x01","0x02"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x02","0x03"]),vi.spyOn(o,"getTokenInfosPayload").mockResolvedValueOnce((0,r.Left)("error")),vi.spyOn(o,"getTokenInfosPayload").mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(t.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x02",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x03",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"error",error:"error"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"}])}),it("should return an empty array if the if 2 chain swaps are not supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(t,"decode").mockReturnValueOnce(["0x01","0x02"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x03","0x04"]);const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(t.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])}),it("should return an empty array if no command are returned from parseTransaction",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:[""]});const n=await c.load(a);expect(t.decode).not.toHaveBeenCalled(),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if no inputs are returned from parseTransaction",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x08",[]]});const n=await c.load(a);expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if parseTransaction throws an error",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockImplementation(()=>{throw new Error});const n=await c.load(a);expect(t.decode).not.toHaveBeenCalled(),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if the swap is with multiple pool versions",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x080900",["0x00","0x01","0x02"]]}),vi.spyOn(t,"decode").mockReturnValue(["0x01","0x02"]);const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x00",66),expect(t.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x01",66),expect(t.decode).toHaveBeenNthCalledWith(3,e.UniswapSupportedCommand.V3_SWAP_EXACT_IN,"0x02",66),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])}),it("should return an empty array if the selector is not supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:"0x00000000",chainId:66},n=await c.load(a);expect(t.decode).not.toHaveBeenCalled(),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if the length of the commands and inputs are different",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001"]]});const d=await c.load(a);expect(t.decode).not.toHaveBeenCalled(),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])})})})});
2
+ //# sourceMappingURL=UniswapContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/uniswap/domain/UniswapContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Interface, type TransactionDescription } from \"ethers\";\nimport { Left, Right } from \"purify-ts\";\n\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport { type TransactionContext } from \"@/shared/model/TransactionContext\";\nimport { type HttpTokenDataSource } from \"@/token/data/HttpTokenDataSource\";\nimport {\n UNISWAP_EXECUTE_SELECTOR,\n UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n UniswapSupportedCommand,\n} from \"@/uniswap/constants/uniswap\";\nimport { type CommandDecoderDataSource } from \"@/uniswap/data/CommandDecoderDataSource\";\nimport { DefaultCommandDecoderDataSource } from \"@/uniswap/data/DefaultCommandDecoderDataSource\";\nimport { EthersAbiDecoderDataSource } from \"@/uniswap/data/EthersAbiDecoderDataSource\";\n\nimport { UniswapContextLoader } from \"./UniswapContextLoader\";\n\ndescribe(\"UniswapContextLoader\", () => {\n const commandDecoderMock: CommandDecoderDataSource = {\n decode: vi.fn(),\n };\n const tokenDataSourceMock = {\n getTokenInfosPayload: vi.fn(),\n };\n let loader: UniswapContextLoader;\n\n describe(\"load\", () => {\n describe(\"with tokenDataSourceMock\", () => {\n beforeEach(() => {\n vi.spyOn(\n tokenDataSourceMock,\n \"getTokenInfosPayload\",\n ).mockImplementation(({ address }) =>\n Promise.resolve(Right(`payload-${address}`)),\n );\n loader = new UniswapContextLoader(\n new DefaultCommandDecoderDataSource(new EthersAbiDecoderDataSource()),\n tokenDataSourceMock as unknown as HttpTokenDataSource,\n );\n });\n\n it(\"should return the external plugin context and the decoded contexts\", async () => {\n // GIVEN\n // https://etherscan.io/getRawTx?tx=0xc9821c32c1782d9ab6baf6f9ca4b2565bce11aaf5146a2d303215bda026f5e48\n const transactionContext = {\n chainId: 1,\n data: \"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067a4855b000000000000000000000000000000000000000000000000000000000000000300060c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000a18f07d736b90be5500000000000000000000000000000000000000000000000000000000b0b8122abd8412900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bb9f599ce614feb2e1bbe58f180f370d05b39344e002710c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000017cc6042605381c158d2adab487434bde79aa61c000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000b0b8122abd84129c001a053efc49d03b694742500f49aa09df2360bd7e297fa730c745e0d4320b42fc33fa01ca1c85a46c561f624830fffbae2441ba0f2d54eb5b0f17e0e3561d10db0b7ee\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload:\n \"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935\",\n },\n {\n type: \"token\",\n payload: \"payload-0xb9f599ce614feb2e1bbe58f180f370d05b39344e\",\n }, // ERC20\n {\n type: \"token\",\n payload: \"payload-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n }, // WETH\n ]);\n });\n\n it(\"should return the external plugin context and the decoded contexts with a permit\", async () => {\n // GIVEN\n // https://etherscan.io/getRawTx?tx=0xc4df7ccc0527541d0e80856a8f38deedc48c84825e9355469ba02d873502ce2f\n // PERMIT2_PERMIT, V3_SWAP_EXACT_OUT, UNWRAP_ETH\n const transactionContext = {\n chainId: 1,\n data: \"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000669b9ec100000000000000000000000000000000000000000000000000000000000000030a010c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000016000000000000000000000000055747be9f9f5beb232ad59fe7af013b81d95fd5e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000066c32b0d0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000ef1c6e67703c7bd7107eed8303fbe6ec2554bf6b00000000000000000000000000000000000000000000000000000000669b9ec100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000410d756f55acf289e9754faf91bba0a704b5c7c0aa4b1dfd551115ccbe4c7f290234e1a14265e1da0bc872a23627d997fe37a689c290d519f7b8c9bdde1b79108e1b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000030ba49cbff5a00000000000000000000000000000000000000000000000089677c957272141800000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc200271055747be9f9f5beb232ad59fe7af013b81d95fd5e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000030ba49cbff5a000c001a0e406d9c91c8b46d959fcd31a28518a77bb248ebb316c5fab7b98335cce922f2aa0462cb970c32a8dbfe71c57b888c43b9ed04fce41d169dbfcc745445587adb771\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload:\n \"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935\",\n },\n {\n type: \"token\",\n payload: \"payload-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n }, // WETH\n {\n type: \"token\",\n payload: \"payload-0x55747be9f9f5beb232ad59fe7af013b81d95fd5e\",\n }, // ERC20\n ]);\n });\n\n it(\"should return an empty array if the transaction is not supported\", async () => {\n // GIVEN\n const transactionContext = {} as TransactionContext;\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValue([]);\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if a command is not supported\", async () => {\n // GIVEN\n // https://etherscan.io/getRawTx?tx=0xa628c8b3da2ad984aed0354d8ca4b4c3c42941491dc4e0d6a5f423fd65e6c90a\n // The command 0x05 (TRANSFER) is not supported\n const transactionContext = {\n chainId: 1,\n data: \"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067a4bef600000000000000000000000000000000000000000000000000000000000000050b0105040c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000078e6708e70aed0f000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000059a16770000000000000000000000000000000000000000000000000078e6708e70aed0f00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f4c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000027213e28d7fda5c57fe9e5dd923818dbccf71c4700000000000000000000000000000000000000000000000000000000003938700000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006f939b43d65be049b7533907db08e80ba6969f450000000000000000000000000000000000000000000000000000000059682f0000000000000000000000000000000000000000000000000000000000000000400000000000000000000000006f939b43d65be049b7533907db08e80ba6969f4500000000000000000000000000000000000000000000000000000000000000000cc080a07c86dd5813ec1f3725c402f8bea6105546d1093c59676023b971f1d83f61bd4ea02a353bf3028cabcbe68c5dc8906752bafe55afc86b6344edb3ffd8a3650332e8\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(result).toEqual([]);\n });\n });\n\n describe(\"with mocked ethers parseTransaction\", () => {\n beforeEach(() => {\n vi.resetAllMocks();\n loader = new UniswapContextLoader(\n commandDecoderMock,\n tokenDataSourceMock as unknown as HttpTokenDataSource,\n );\n });\n\n it(\"should return an array with contexts if 2 chain swaps are supported\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n chainId: 0x42,\n } as TransactionContext;\n const commands = `0x0809`; // V2_SWAP_EXACT_IN, V2_SWAP_EXACT_OUT\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockReturnValue({\n args: [commands, [\"0x0001\", \"0x0002\"]],\n } as TransactionDescription);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x01\",\n \"0x04\",\n \"0x02\",\n ]);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x02\",\n \"0x03\",\n ]);\n vi.spyOn(\n tokenDataSourceMock,\n \"getTokenInfosPayload\",\n ).mockImplementation(({ address }) =>\n Promise.resolve(Right(`payload-${address}`)),\n );\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 1,\n UniswapSupportedCommand.V2_SWAP_EXACT_IN,\n \"0x0001\",\n 0x42,\n );\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 2,\n UniswapSupportedCommand.V2_SWAP_EXACT_OUT,\n \"0x0002\",\n 0x42,\n );\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(1, { address: \"0x01\", chainId: 0x42 });\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(2, { address: \"0x04\", chainId: 0x42 });\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(3, { address: \"0x02\", chainId: 0x42 });\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(4, { address: \"0x03\", chainId: 0x42 });\n expect(result).toEqual([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload:\n \"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935\",\n },\n {\n type: \"token\",\n payload: \"payload-0x01\",\n },\n {\n type: \"token\",\n payload: \"payload-0x04\",\n },\n {\n type: \"token\",\n payload: \"payload-0x02\",\n },\n {\n type: \"token\",\n payload: \"payload-0x03\",\n },\n ]);\n });\n\n it(\"should return an array with contexts if 1 chain swap with a non swap command\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n chainId: 0x42,\n } as TransactionContext;\n const commands = `0x0b0004`; // WRAP_ETH, V3_SWAP_EXACT_IN, SWEEP\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockReturnValue({\n args: [commands, [\"0x0001\", \"0x0002\", \"0x0003\"]],\n } as TransactionDescription);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\"0x01\"]);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x02\",\n \"0x03\",\n ]);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\"0x04\"]);\n vi.spyOn(\n tokenDataSourceMock,\n \"getTokenInfosPayload\",\n ).mockImplementation(({ address }) =>\n Promise.resolve(Right(`payload-${address}`)),\n );\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 1,\n UniswapSupportedCommand.WRAP_ETH,\n \"0x0001\",\n 0x42,\n );\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(1, { address: \"0x01\", chainId: 0x42 });\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(2, { address: \"0x02\", chainId: 0x42 });\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(3, { address: \"0x03\", chainId: 0x42 });\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(4, { address: \"0x04\", chainId: 0x42 });\n expect(result).toEqual([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload:\n \"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935\",\n },\n {\n type: \"token\",\n payload: \"payload-0x01\",\n },\n {\n type: \"token\",\n payload: \"payload-0x02\",\n },\n {\n type: \"token\",\n payload: \"payload-0x03\",\n },\n {\n type: \"token\",\n payload: \"payload-0x04\",\n },\n ]);\n });\n\n it(\"should return an array with contexts if one token is not found\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n chainId: 0x42,\n } as TransactionContext;\n const commands = `0x0809`; // V2_SWAP_EXACT_IN, V2_SWAP_EXACT_OUT\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockReturnValue({\n args: [commands, [\"0x0001\", \"0x0002\"]],\n } as TransactionDescription);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x01\",\n \"0x02\",\n ]);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x02\",\n \"0x03\",\n ]);\n vi.spyOn(\n tokenDataSourceMock,\n \"getTokenInfosPayload\",\n ).mockResolvedValueOnce(Left(\"error\"));\n vi.spyOn(\n tokenDataSourceMock,\n \"getTokenInfosPayload\",\n ).mockImplementation(({ address }) =>\n Promise.resolve(Right(`payload-${address}`)),\n );\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 1,\n UniswapSupportedCommand.V2_SWAP_EXACT_IN,\n \"0x0001\",\n 0x42,\n );\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 2,\n UniswapSupportedCommand.V2_SWAP_EXACT_OUT,\n \"0x0002\",\n 0x42,\n );\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(1, { address: \"0x01\", chainId: 0x42 });\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(2, { address: \"0x02\", chainId: 0x42 });\n expect(\n tokenDataSourceMock.getTokenInfosPayload,\n ).toHaveBeenNthCalledWith(3, { address: \"0x03\", chainId: 0x42 });\n expect(result).toEqual([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload:\n \"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935\",\n },\n {\n type: \"error\",\n error: \"error\",\n },\n {\n type: \"token\",\n payload: \"payload-0x02\",\n },\n {\n type: \"token\",\n payload: \"payload-0x03\",\n },\n ]);\n });\n\n it(\"should return an empty array if the if 2 chain swaps are not supported\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n chainId: 0x42,\n } as TransactionContext;\n const commands = `0x0809`; // V2_SWAP_EXACT_IN, V2_SWAP_EXACT_OUT\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockReturnValue({\n args: [commands, [\"0x0001\", \"0x0002\"]],\n } as TransactionDescription);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x01\",\n \"0x02\",\n ]);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValueOnce([\n \"0x03\", // should be 0x02\n \"0x04\",\n ]);\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 1,\n UniswapSupportedCommand.V2_SWAP_EXACT_IN,\n \"0x0001\",\n 0x42,\n );\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 2,\n UniswapSupportedCommand.V2_SWAP_EXACT_OUT,\n \"0x0002\",\n 0x42,\n );\n expect(tokenDataSourceMock.getTokenInfosPayload).not.toHaveBeenCalled();\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if no command are returned from parseTransaction\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n } as TransactionContext;\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockReturnValue({\n args: [\"\"],\n } as TransactionDescription);\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).not.toHaveBeenCalled();\n expect(tokenDataSourceMock.getTokenInfosPayload).not.toHaveBeenCalled();\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if no inputs are returned from parseTransaction\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n } as TransactionContext;\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockReturnValue({\n args: [\"0x08\", []],\n } as TransactionDescription);\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(tokenDataSourceMock.getTokenInfosPayload).not.toHaveBeenCalled();\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if parseTransaction throws an error\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n } as TransactionContext;\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockImplementation(\n () => {\n throw new Error();\n },\n );\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).not.toHaveBeenCalled();\n expect(tokenDataSourceMock.getTokenInfosPayload).not.toHaveBeenCalled();\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the swap is with multiple pool versions\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n chainId: 0x42,\n } as TransactionContext;\n const commands = `0x080900`; // V2_SWAP_EXACT_IN, V2_SWAP_EXACT_OUT, V3_SWAP_EXACT_IN\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockReturnValue({\n args: [commands, [\"0x00\", \"0x01\", \"0x02\"]],\n } as TransactionDescription);\n vi.spyOn(commandDecoderMock, \"decode\").mockReturnValue([\n \"0x01\",\n \"0x02\",\n ]);\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 1,\n UniswapSupportedCommand.V2_SWAP_EXACT_IN,\n \"0x00\",\n 0x42,\n );\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 2,\n UniswapSupportedCommand.V2_SWAP_EXACT_OUT,\n \"0x01\",\n 0x42,\n );\n expect(commandDecoderMock.decode).toHaveBeenNthCalledWith(\n 3,\n UniswapSupportedCommand.V3_SWAP_EXACT_IN,\n \"0x02\",\n 0x42,\n );\n expect(tokenDataSourceMock.getTokenInfosPayload).not.toHaveBeenCalled();\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the selector is not supported\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: \"0x00000000\",\n chainId: 0x42,\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).not.toHaveBeenCalled();\n expect(tokenDataSourceMock.getTokenInfosPayload).not.toHaveBeenCalled();\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the length of the commands and inputs are different\", async () => {\n // GIVEN\n const transactionContext = {\n to: UNISWAP_UNIVERSAL_ROUTER_ADDRESS,\n data: UNISWAP_EXECUTE_SELECTOR,\n chainId: 0x42,\n } as TransactionContext;\n const commands = `0x0809`; // V2_SWAP_EXACT_IN, V2_SWAP_EXACT_OUT\n vi.spyOn(Interface.prototype, \"parseTransaction\").mockReturnValue({\n args: [commands, [\"0x0001\"]],\n } as TransactionDescription);\n\n // WHEN\n const result = await loader.load(transactionContext);\n\n // THEN\n expect(commandDecoderMock.decode).not.toHaveBeenCalled();\n expect(tokenDataSourceMock.getTokenInfosPayload).not.toHaveBeenCalled();\n expect(result).toEqual([]);\n });\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAuD,kBACvDC,EAA4B,qBAE5BC,EAAqC,2CAGrCC,EAIO,uCAEPC,EAAgD,0DAChDC,EAA2C,qDAE3CC,EAAqC,kCAErC,SAAS,uBAAwB,IAAM,CACrC,MAAMC,EAA+C,CACnD,OAAQ,GAAG,GAAG,CAChB,EACMC,EAAsB,CAC1B,qBAAsB,GA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,SAAY,CAE9E,MAAMD,EAAqB,CACzB,GAAI,mCACJ,KAAM,aACN,QAAS,EACX,EAGMC,EAAS,MAAMH,EAAO,KAAKE,CAAkB,EAGnD,OAAOJ,EAAmB,MAAM,EAAE,IAAI,iBAAiB,EACvD,OAAOC,EAAoB,oBAAoB,EAAE,IAAI,iBAAiB,EACtE,OAAOI,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,EAED,GAAG,sFAAuF,SAAY,CAEpG,MAAMD,EAAqB,CACzB,GAAI,mCACJ,KAAM,2BACN,QAAS,EACX,EAEA,GAAG,MAAM,YAAU,UAAW,kBAAkB,EAAE,gBAAgB,CAChE,KAAM,CAFS,SAEE,CAAC,QAAQ,CAAC,CAC7B,CAA2B,EAG3B,MAAMC,EAAS,MAAMH,EAAO,KAAKE,CAAkB,EAGnD,OAAOJ,EAAmB,MAAM,EAAE,IAAI,iBAAiB,EACvD,OAAOC,EAAoB,oBAAoB,EAAE,IAAI,iBAAiB,EACtE,OAAOI,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_ethers", "import_purify_ts", "import_ClearSignContext", "import_uniswap", "import_DefaultCommandDecoderDataSource", "import_EthersAbiDecoderDataSource", "import_UniswapContextLoader", "commandDecoderMock", "tokenDataSourceMock", "loader", "address", "transactionContext", "result"]
7
+ }