@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/pki/domain/PkiCertificateLoader.ts"],
4
+ "sourcesContent": ["import { type PkiCertificate } from \"@/pki/model/PkiCertificate\";\nimport { type PkiCertificateInfo } from \"@/pki/model/PkiCertificateInfo\";\n\nexport interface PkiCertificateLoader {\n loadCertificate(\n certificateInfos: PkiCertificateInfo,\n ): Promise<PkiCertificate | undefined>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["PkiCertificateLoader_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var l=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var s=(e,t)=>{for(var _ in t)l(e,_,{get:t[_],enumerable:!0})},u=(e,t,_,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of m(t))!c.call(e,r)&&r!==_&&l(e,r,{get:()=>t[r],enumerable:!(o=k(t,r))||o.enumerable});return e};var d=e=>u(l({},"__esModule",{value:!0}),e);var g={};s(g,{KeyId:()=>n});module.exports=d(g);var n=(a=>(a.Test="test",a.PersoV2="persov2",a.LedgerRootV3="ledger_root_v3",a.PluginSelectorKey="plugin_selector_key",a.NftMetadataKey="nft_metadata_key",a.PartnerMetadataKey="partner_metadata_key",a.Erc20MetadataKey="erc20_metadata_key",a.DomainMetadataKey="domain_metadata_key",a.CalCalldataKey="cal_calldata_key",a.CalTrustedNameKey="cal_trusted_name_key",a.CalNetwork="cal_network",a))(n||{});0&&(module.exports={KeyId});
2
+ //# sourceMappingURL=KeyId.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/model/KeyId.ts"],
4
+ "sourcesContent": ["export enum KeyId {\n Test = \"test\",\n PersoV2 = \"persov2\",\n LedgerRootV3 = \"ledger_root_v3\",\n PluginSelectorKey = \"plugin_selector_key\",\n NftMetadataKey = \"nft_metadata_key\",\n PartnerMetadataKey = \"partner_metadata_key\",\n Erc20MetadataKey = \"erc20_metadata_key\",\n DomainMetadataKey = \"domain_metadata_key\",\n CalCalldataKey = \"cal_calldata_key\",\n CalTrustedNameKey = \"cal_trusted_name_key\",\n CalNetwork = \"cal_network\",\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAAO,IAAKE,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,aAAe,iBACfA,EAAA,kBAAoB,sBACpBA,EAAA,eAAiB,mBACjBA,EAAA,mBAAqB,uBACrBA,EAAA,iBAAmB,qBACnBA,EAAA,kBAAoB,sBACpBA,EAAA,eAAiB,mBACjBA,EAAA,kBAAoB,uBACpBA,EAAA,WAAa,cAXHA,OAAA",
6
+ "names": ["KeyId_exports", "__export", "KeyId", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var e=Object.prototype.hasOwnProperty;var l=(n,r)=>{for(var a in r)i(n,a,{get:r[a],enumerable:!0})},h=(n,r,a,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of _(r))!e.call(n,o)&&o!==a&&i(n,o,{get:()=>r[o],enumerable:!(c=d(r,o))||c.enumerable});return n};var m=n=>h(i({},"__esModule",{value:!0}),n);var p={};l(p,{KeyUsage:()=>u});module.exports=m(p);var u=(t=>(t.GenuineCheck="genuine_check",t.ExchangePayload="exchange_payload",t.NftMeta="nft_meta",t.TrustedName="trusted_name",t.BackupProvider="backup_provider",t.ProtectOrchestrator="protect_orchestrator",t.PluginMeta="plugin_meta",t.CoinMeta="coin_meta",t.SeedIdAuth="seed_id_auth",t.TxSimulationSigner="tx_simu_signer",t.Calldata="calldata",t.Network="network",t))(u||{});0&&(module.exports={KeyUsage});
2
+ //# sourceMappingURL=KeyUsage.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/model/KeyUsage.ts"],
4
+ "sourcesContent": ["export enum KeyUsage {\n GenuineCheck = \"genuine_check\",\n ExchangePayload = \"exchange_payload\",\n NftMeta = \"nft_meta\",\n TrustedName = \"trusted_name\",\n BackupProvider = \"backup_provider\",\n ProtectOrchestrator = \"protect_orchestrator\",\n PluginMeta = \"plugin_meta\",\n CoinMeta = \"coin_meta\",\n SeedIdAuth = \"seed_id_auth\",\n TxSimulationSigner = \"tx_simu_signer\",\n Calldata = \"calldata\",\n Network = \"network\",\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAO,IAAKE,OACVA,EAAA,aAAe,gBACfA,EAAA,gBAAkB,mBAClBA,EAAA,QAAU,WACVA,EAAA,YAAc,eACdA,EAAA,eAAiB,kBACjBA,EAAA,oBAAsB,uBACtBA,EAAA,WAAa,cACbA,EAAA,SAAW,YACXA,EAAA,WAAa,eACbA,EAAA,mBAAqB,iBACrBA,EAAA,SAAW,WACXA,EAAA,QAAU,UAZAA,OAAA",
6
+ "names": ["KeyUsage_exports", "__export", "KeyUsage", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var m=(r,e,y,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of b(e))!k.call(r,a)&&a!==y&&i(r,a,{get:()=>e[a],enumerable:!(t=p(e,a))||t.enumerable});return r};var n=r=>m(i({},"__esModule",{value:!0}),r);var o={};module.exports=n(o);
2
+ //# sourceMappingURL=PkiCertificate.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/model/PkiCertificate.ts"],
4
+ "sourcesContent": ["export type PkiCertificate = {\n keyUsageNumber: number;\n payload: Uint8Array;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["PkiCertificate_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var o=(t,e,y,g)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s(e))!n.call(t,i)&&i!==y&&r(t,i,{get:()=>e[i],enumerable:!(g=a(e,i))||g.enumerable});return t};var p=t=>o(r({},"__esModule",{value:!0}),t);var d={};module.exports=p(d);
2
+ //# sourceMappingURL=PkiCertificateInfo.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/pki/model/PkiCertificateInfo.ts"],
4
+ "sourcesContent": ["import type { KeyUsage } from \"@/pki/model/KeyUsage\";\n\nexport type PkiCertificateInfo = {\n targetDevice: string;\n keyUsage: KeyUsage;\n keyId?: string | undefined;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["PkiCertificateInfo_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var x=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!C.call(e,o)&&o!==i&&a(e,o,{get:()=>t[o],enumerable:!(n=r(t,o))||n.enumerable});return e};var d=e=>x(a({},"__esModule",{value:!0}),e);var p={};module.exports=d(p);
2
+ //# sourceMappingURL=ContextLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/domain/ContextLoader.ts"],
4
+ "sourcesContent": ["import { type ClearSignContext } from \"@/shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\n\nexport type ContextLoader = {\n load: (transaction: TransactionContext) => Promise<ClearSignContext[]>;\n loadField?: (\n field: TransactionFieldContext,\n ) => Promise<ClearSignContext | null>;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["ContextLoader_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var l=(n,e)=>{for(var i in e)a(n,i,{get:e[i],enumerable:!0})},x=(n,e,i,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!T.call(n,r)&&r!==i&&a(n,r,{get:()=>e[r],enumerable:!(p=o(e,r))||p.enumerable});return n};var c=n=>x(a({},"__esModule",{value:!0}),n);var S={};l(S,{ClearSignContextType:()=>C});module.exports=c(S);var C=(t=>(t.TOKEN="token",t.NFT="nft",t.TRUSTED_NAME="trustedName",t.PLUGIN="plugin",t.EXTERNAL_PLUGIN="externalPlugin",t.TRANSACTION_INFO="transactionInfo",t.ENUM="enum",t.TRANSACTION_FIELD_DESCRIPTION="transactionFieldDescription",t.ERROR="error",t))(C||{});0&&(module.exports={ClearSignContextType});
2
+ //# sourceMappingURL=ClearSignContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/ClearSignContext.ts"],
4
+ "sourcesContent": ["import { type PkiCertificate } from \"@/pki/model/PkiCertificate\";\n\nimport { type GenericPath } from \"./GenericPath\";\n\nexport enum ClearSignContextType {\n TOKEN = \"token\",\n NFT = \"nft\",\n TRUSTED_NAME = \"trustedName\",\n PLUGIN = \"plugin\",\n EXTERNAL_PLUGIN = \"externalPlugin\",\n TRANSACTION_INFO = \"transactionInfo\",\n ENUM = \"enum\",\n TRANSACTION_FIELD_DESCRIPTION = \"transactionFieldDescription\",\n ERROR = \"error\",\n}\n\nexport type ClearSignContextReferenceType =\n | ClearSignContextType.TOKEN\n | ClearSignContextType.NFT\n | ClearSignContextType.ENUM\n | ClearSignContextType.TRUSTED_NAME;\n\nexport type ClearSignContextReference<\n Type extends ClearSignContextReferenceType = ClearSignContextReferenceType,\n> = Type extends ClearSignContextType.ENUM\n ? {\n type: ClearSignContextType.ENUM;\n valuePath: GenericPath;\n id: number; // enum id to reference\n }\n : Type extends ClearSignContextType.TRUSTED_NAME\n ? {\n type: ClearSignContextType.TRUSTED_NAME;\n valuePath: GenericPath;\n types: string[];\n sources: string[];\n }\n :\n | {\n type: Type;\n valuePath: GenericPath;\n value?: never;\n }\n | {\n type: Type;\n valuePath?: never;\n value: string;\n };\n\nexport type ClearSignContextSuccessType = Exclude<\n ClearSignContextType,\n ClearSignContextType.ERROR\n>;\n\n// NOTE: this is a union of all possible success types\n// There is currently two types of success:\n// - ENUM: which is a special case, we need to handle it differently\n// because we don't want to send the whole enum\n// but only the parts that are needed.\n// - id: the enum id to reference\n// - payload: the payload to send with a provideEnum command\n// - name: the name of the enum to be displayed on the device\n// - value: the value of the enum to be retrieved from the transaction\n// - All other types\n// - payload: the payload to send with a provide command\n// - reference: the reference to the value to be retrieved from the transaction\nexport type ClearSignContextSuccess<\n Type extends ClearSignContextSuccessType = ClearSignContextSuccessType,\n> = Type extends ClearSignContextType.ENUM\n ? {\n type: ClearSignContextType.ENUM;\n id: number;\n payload: string;\n value: number;\n certificate?: PkiCertificate;\n }\n : {\n type: Exclude<\n ClearSignContextType,\n ClearSignContextType.ENUM | ClearSignContextType.ERROR\n >;\n payload: string;\n reference?: ClearSignContextReference;\n certificate?: PkiCertificate;\n };\n\nexport type ClearSignContextError = {\n type: ClearSignContextType.ERROR;\n error: Error;\n};\n\nexport type ClearSignContext = ClearSignContextSuccess | ClearSignContextError;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAIO,IAAKE,OACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,aAAe,cACfA,EAAA,OAAS,SACTA,EAAA,gBAAkB,iBAClBA,EAAA,iBAAmB,kBACnBA,EAAA,KAAO,OACPA,EAAA,8BAAgC,8BAChCA,EAAA,MAAQ,QATEA,OAAA",
6
+ "names": ["ClearSignContext_exports", "__export", "ClearSignContextType", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var R=(a,t)=>{for(var A in t)n(a,A,{get:t[A],enumerable:!0})},u=(a,t,A,E)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of m(t))!f.call(a,e)&&e!==A&&n(a,e,{get:()=>t[e],enumerable:!(E=l(t,e))||E.enumerable});return a};var F=a=>u(n({},"__esModule",{value:!0}),a);var y={};R(y,{ContainerPath:()=>p,DataPathElementType:()=>L,DataPathLeafType:()=>o});module.exports=F(y);var p=(E=>(E.FROM="FROM",E.TO="TO",E.VALUE="VALUE",E))(p||{}),L=(r=>(r.TUPLE="TUPLE",r.ARRAY="ARRAY",r.REF="REF",r.LEAF="LEAF",r.SLICE="SLICE",r))(L||{}),o=(e=>(e.STATIC_LEAF="STATIC_LEAF",e.DYNAMIC_LEAF="DYNAMIC_LEAF",e.TUPLE_LEAF="TUPLE_LEAF",e.ARRAY_LEAF="ARRAY_LEAF",e))(o||{});0&&(module.exports={ContainerPath,DataPathElementType,DataPathLeafType});
2
+ //# sourceMappingURL=GenericPath.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/GenericPath.ts"],
4
+ "sourcesContent": ["/**\n * Generic binary paths are a way to to navigate in any kind of structured binary data such as:\n * - transactions\n * - typed messages (EIP-712)\n * - meta transactions (EIP-2771)\n * - user operations (EIP-4337)\n * - ...\n * We follow here the concepts defined in the clear signing standard:\n * https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/specs/erc-7730.md#structured-data\n *\n * - The container is the structure to be signed, for instance a transaction\n * - The structured data is the data we want to navigate in, for instance a transaction calldata\n *\n * A generic path is either a field of the container, or a path in the structured data.\n * Those path will also be handled by the devices:\n * https://github.com/LedgerHQ/generic_parser/blob/master/specs.md#path_element\n */\n\n// A generic path is either a path in the container, or a path in its data.\n// Path in the data is a list of steps to apply\nexport type GenericPath = ContainerPathValues | DataPathElement[];\n\n// Path in the container is only a finite list of known attributes\nexport enum ContainerPath {\n FROM = \"FROM\",\n TO = \"TO\",\n VALUE = \"VALUE\",\n}\nexport type ContainerPathValues = keyof typeof ContainerPath;\n\n/**\n * A path in binary data will be composed of:\n * - any number of steps of which:\n * - Tuple: a set of elements which size if known\n * - Array: an array of elements with dynamic size\n * - Reference: a pointer to dereference\n * - one leaf at the end to indicate the returned element type\n * - static leaf: 1 fixed-size chunk is returned\n * - dynamic leaf: element of variable size is returned\n * - optionally a slice element, only allowed after the leaf, to slice the result\n *\n * An example for a transaction with that ethereum smart contract:\n * function requestWithdrawalsWithPermit(uint256[] _amounts, address _owner, (uint256,uint256,uint8,bytes32,bytes32) _permit)\n * In that case:\n * - _amounts is an array\n * - _permit is a tuple\n * We could have a tuple in an array, or an array in a tuple, in which case we would have several steps in the binary path.\n */\nexport type DataPathElement =\n | DataPathElementTuple\n | DataPathElementArray\n | DataPathElementRef\n | DataPathElementLeaf\n | DataPathElementSlice;\nexport enum DataPathElementType {\n TUPLE = \"TUPLE\",\n ARRAY = \"ARRAY\",\n REF = \"REF\",\n LEAF = \"LEAF\",\n SLICE = \"SLICE\",\n}\nexport type DataPathElementTypeValues = keyof typeof DataPathElementType;\n\n/**\n * Path element to navigate in a tuple.\n * - offset: the item of the tuple to select\n */\nexport interface DataPathElementTuple {\n type: \"TUPLE\";\n offset: number;\n}\n\n/**\n * Path element to navigate in an array of variable size.\n * - itemSize: the length of each item in that array (not the number of items which is variable).\n * - start: the start of the array slice to iterate on. If unset, start from the beginning of that array.\n * - end: the end of the array slice to iterate on (exclusive). If unset, iterate until the end of that array.\n */\nexport interface DataPathElementArray {\n type: \"ARRAY\";\n itemSize: number;\n start?: number;\n end?: number;\n}\n\n// Path element to indicate the current item should be de-referenced (its value contains a pointer).\nexport interface DataPathElementRef {\n type: \"REF\";\n}\n\n/**\n * Path element to represent the leaf of the path, to be returned.\n * It is mandatory, and only allowed at the end of the path.\n * It indicates the type of data to return:\n * - Static leaf: data of static size, typically 1 chunk\n * - Dynamic leaf: data of dynamic size, typically length+data\n * - Tuple leaf: returned data is a tuple (a set of a static number of elements)\n * - Array leaf: returned data is an array (dynamic number of elements)\n */\nexport interface DataPathElementLeaf {\n type: \"LEAF\";\n leafType: DataPathLeafTypeValues;\n}\nexport enum DataPathLeafType {\n STATIC_LEAF = \"STATIC_LEAF\",\n DYNAMIC_LEAF = \"DYNAMIC_LEAF\",\n TUPLE_LEAF = \"TUPLE_LEAF\",\n ARRAY_LEAF = \"ARRAY_LEAF\",\n}\nexport type DataPathLeafTypeValues = keyof typeof DataPathLeafType;\n\n/**\n * Path element to represent a slice.\n * It is optional and only allowed at the end of a path, after the leaf.\n * It means the leaf shall be sliced before being returned.\n */\nexport interface DataPathElementSlice {\n type: \"SLICE\";\n start?: number;\n end?: number;\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,wBAAAC,EAAA,qBAAAC,IAAA,eAAAC,EAAAL,GAuBO,IAAKE,OACVA,EAAA,KAAO,OACPA,EAAA,GAAK,KACLA,EAAA,MAAQ,QAHEA,OAAA,IA+BAC,OACVA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,MAAQ,QALEA,OAAA,IAiDAC,OACVA,EAAA,YAAc,cACdA,EAAA,aAAe,eACfA,EAAA,WAAa,aACbA,EAAA,WAAa,aAJHA,OAAA",
6
+ "names": ["GenericPath_exports", "__export", "ContainerPath", "DataPathElementType", "DataPathLeafType", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var T=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var e=(t,o)=>{for(var G in o)T(t,G,{get:o[G],enumerable:!0})},f=(t,o,G,I)=>{if(o&&typeof o=="object"||typeof o=="function")for(let A of _(o))!c.call(t,A)&&A!==G&&T(t,A,{get:()=>o[A],enumerable:!(I=N(o,A))||I.enumerable});return t};var n=t=>f(T({},"__esModule",{value:!0}),t);var s={};e(s,{INFO_SIGNATURE_TAG:()=>r,SIGNATURE_TAG:()=>p});module.exports=n(s);const p="15",r="81ff";0&&(module.exports={INFO_SIGNATURE_TAG,SIGNATURE_TAG});
2
+ //# sourceMappingURL=SignatureTags.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/SignatureTags.ts"],
4
+ "sourcesContent": ["export const SIGNATURE_TAG = \"15\";\nexport const INFO_SIGNATURE_TAG = \"81ff\";\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,EAAA,kBAAAC,IAAA,eAAAC,EAAAJ,GAAO,MAAMG,EAAgB,KAChBD,EAAqB",
6
+ "names": ["SignatureTags_exports", "__export", "INFO_SIGNATURE_TAG", "SIGNATURE_TAG", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!p.call(t,n)&&n!==o&&i(t,n,{get:()=>e[n],enumerable:!(r=s(e,n))||r.enumerable});return t};var g=t=>d(i({},"__esModule",{value:!0}),t);var c={};module.exports=g(c);
2
+ //# sourceMappingURL=TransactionContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TransactionContext.ts"],
4
+ "sourcesContent": ["import { type DeviceModelId } from \"@ledgerhq/device-management-kit\";\n\nimport { type ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport { type TransactionSubset } from \"@/shared/model/TransactionSubset\";\n\nexport type TransactionFieldContext =\n | {\n type: ClearSignContextType.TOKEN | ClearSignContextType.NFT;\n chainId: number;\n address: string;\n }\n | {\n type: ClearSignContextType.TRUSTED_NAME;\n chainId: number;\n address: string;\n challenge: string;\n types: string[];\n sources: string[];\n };\n\nexport type TransactionContext = TransactionSubset & {\n deviceModelId: DeviceModelId; // needed to fetch the correct certificate\n challenge?: string;\n domain?: string;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TransactionContext_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var c=(n,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of o(t))!b.call(n,a)&&a!==i&&e(n,a,{get:()=>t[a],enumerable:!(r=s(t,a))||r.enumerable});return n};var d=n=>c(e({},"__esModule",{value:!0}),n);var g={};module.exports=d(g);
2
+ //# sourceMappingURL=TransactionSubset.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TransactionSubset.ts"],
4
+ "sourcesContent": ["export type TransactionSubset = {\n chainId: number;\n to?: string;\n data?: string;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TransactionSubset_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},i=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of y(e))!s.call(t,a)&&a!==r&&p(t,a,{get:()=>e[a],enumerable:!(n=o(e,a))||n.enumerable});return t};var T=t=>i(p({},"__esModule",{value:!0}),t);var D={};d(D,{VERIFYING_CONTRACT_TOKEN_INDEX:()=>g});module.exports=T(D);const g=255;0&&(module.exports={VERIFYING_CONTRACT_TOKEN_INDEX});
2
+ //# sourceMappingURL=TypedDataClearSignContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TypedDataClearSignContext.ts"],
4
+ "sourcesContent": ["// The general informations for a typed message\nexport type TypedDataMessageInfo = {\n displayName: string;\n filtersCount: number;\n signature: string;\n};\n\n// Token index and descriptor. Needed for tokens that are referenced by a typed message\nexport type TypedDataTokenIndex = number;\nexport type TypedDataToken = string;\n// Special token index value when the referenced token is the verifying contract\nexport const VERIFYING_CONTRACT_TOKEN_INDEX = 255;\n\n// Typed message filters, to select fields to display, and provide formatting informations\nexport type TypedDataFilterPath = string;\nexport type TypedDataFilter =\n | {\n type: \"datetime\" | \"raw\";\n displayName: string;\n path: TypedDataFilterPath;\n signature: string;\n }\n | {\n type: \"amount\" | \"token\";\n displayName: string;\n tokenIndex: TypedDataTokenIndex;\n path: TypedDataFilterPath;\n signature: string;\n };\n\n// Clear signing context for a typed message\nexport type TypedDataClearSignContextSuccess = {\n type: \"success\";\n messageInfo: TypedDataMessageInfo;\n filters: Record<TypedDataFilterPath, TypedDataFilter>;\n tokens: Record<TypedDataTokenIndex, TypedDataToken>;\n};\nexport type TypedDataClearSignContextError = {\n type: \"error\";\n error: Error;\n};\nexport type TypedDataClearSignContext =\n | TypedDataClearSignContextSuccess\n | TypedDataClearSignContextError;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oCAAAE,IAAA,eAAAC,EAAAH,GAWO,MAAME,EAAiC",
6
+ "names": ["TypedDataClearSignContext_exports", "__export", "VERIFYING_CONTRACT_TOKEN_INDEX", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var d=(a,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of y(e))!s.call(a,t)&&t!==n&&i(a,t,{get:()=>e[t],enumerable:!(r=p(e,t))||r.enumerable});return a};var l=a=>d(i({},"__esModule",{value:!0}),a);var o={};module.exports=l(o);
2
+ //# sourceMappingURL=TypedDataContext.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TypedDataContext.ts"],
4
+ "sourcesContent": ["// The schema of a typed message\nexport type TypedDataSchema = Record<\n string,\n Array<{ name: string; type: string }>\n>;\n\n// The extracted message values, with their path\nexport type TypedDataFieldValues = Array<{ path: string; value: Uint8Array }>;\n\n// Context needed to fetch the clear signing context of a typed message\nexport type TypedDataContext = {\n verifyingContract: string;\n chainId: number;\n version: \"v1\" | \"v2\";\n schema: TypedDataSchema;\n fieldsValues: TypedDataFieldValues;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TypedDataContext_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var g=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var n in t)g(e,n,{get:t[n],enumerable:!0})},a=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of o(t))!s.call(e,r)&&r!==n&&g(e,r,{get:()=>t[r],enumerable:!(i=l(t,r))||i.enumerable});return e};var S=e=>a(g({},"__esModule",{value:!0}),e);var x={};h(x,{HexStringUtils:()=>c});module.exports=S(x);class c{static stringToHex(t){let n="";for(let i=0;i<t.length;i++){const r=t.charCodeAt(i).toString(16);n+=r.padStart(2,"0")}return n}static appendSignatureToPayload(t,n,i){n.length%2!==0&&(n="0"+n);let r=(n.length/2).toString(16);return r.length%2!==0&&(r="0"+r),`${t}${i}${r}${n}`}}0&&(module.exports={HexStringUtils});
2
+ //# sourceMappingURL=HexStringUtils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/HexStringUtils.ts"],
4
+ "sourcesContent": ["export class HexStringUtils {\n static stringToHex(str: string): string {\n let hexString = \"\";\n for (let i = 0; i < str.length; i++) {\n const hex = str.charCodeAt(i).toString(16);\n hexString += hex.padStart(2, \"0\"); // Ensure each hex code is at least 2 characters long\n }\n return hexString;\n }\n\n static appendSignatureToPayload(\n payload: string,\n signature: string,\n tag: string,\n ): string {\n // Ensure correct padding\n if (signature.length % 2 !== 0) {\n signature = \"0\" + signature;\n }\n // TLV encoding as according to trusted name documentation\n let signatureLength = (signature.length / 2).toString(16);\n if (signatureLength.length % 2 !== 0) {\n signatureLength = \"0\" + signatureLength;\n }\n\n return `${payload}${tag}${signatureLength}${signature}`;\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,CAAe,CAC1B,OAAO,YAAYE,EAAqB,CACtC,IAAIC,EAAY,GAChB,QAAS,EAAI,EAAG,EAAID,EAAI,OAAQ,IAAK,CACnC,MAAME,EAAMF,EAAI,WAAW,CAAC,EAAE,SAAS,EAAE,EACzCC,GAAaC,EAAI,SAAS,EAAG,GAAG,CAClC,CACA,OAAOD,CACT,CAEA,OAAO,yBACLE,EACAC,EACAC,EACQ,CAEJD,EAAU,OAAS,IAAM,IAC3BA,EAAY,IAAMA,GAGpB,IAAIE,GAAmBF,EAAU,OAAS,GAAG,SAAS,EAAE,EACxD,OAAIE,EAAgB,OAAS,IAAM,IACjCA,EAAkB,IAAMA,GAGnB,GAAGH,CAAO,GAAGE,CAAG,GAAGC,CAAe,GAAGF,CAAS,EACvD,CACF",
6
+ "names": ["HexStringUtils_exports", "__export", "HexStringUtils", "__toCommonJS", "str", "hexString", "hex", "payload", "signature", "tag", "signatureLength"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../../shared/utils/HexStringUtils");describe("HexStringUtils",()=>{describe("appendSignatureToPayload",()=>{it("should append signature to payload",()=>{const s=e.HexStringUtils.appendSignatureToPayload("01020304","05060708","15");expect(s).toEqual("01020304150405060708")}),it("should append signature to payload with odd length",()=>{const s=e.HexStringUtils.appendSignatureToPayload("01020304","5060708","15");expect(s).toEqual("01020304150405060708")})}),describe("stringToHex",()=>{it("should convert string to hex",()=>{const t=e.HexStringUtils.stringToHex("test");expect(t).toEqual("74657374")}),it("should convert string to hex with odd length",()=>{const t=e.HexStringUtils.stringToHex("test1");expect(t).toEqual("7465737431")})})});
2
+ //# sourceMappingURL=HexStringUtils.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/HexStringUtils.test.ts"],
4
+ "sourcesContent": ["import { HexStringUtils } from \"@/shared/utils/HexStringUtils\";\n\ndescribe(\"HexStringUtils\", () => {\n describe(\"appendSignatureToPayload\", () => {\n it(\"should append signature to payload\", () => {\n // GIVEN\n const payload = \"01020304\";\n const signature = \"05060708\";\n const tag = \"15\";\n // WHEN\n const result = HexStringUtils.appendSignatureToPayload(\n payload,\n signature,\n tag,\n );\n // THEN\n expect(result).toEqual(\"01020304150405060708\");\n });\n\n it(\"should append signature to payload with odd length\", () => {\n // GIVEN\n const payload = \"01020304\";\n const signature = \"5060708\";\n const tag = \"15\";\n // WHEN\n const result = HexStringUtils.appendSignatureToPayload(\n payload,\n signature,\n tag,\n );\n // THEN\n expect(result).toEqual(\"01020304150405060708\");\n });\n });\n\n describe(\"stringToHex\", () => {\n it(\"should convert string to hex\", () => {\n // GIVEN\n const str = \"test\";\n // WHEN\n const result = HexStringUtils.stringToHex(str);\n // THEN\n expect(result).toEqual(\"74657374\");\n });\n\n it(\"should convert string to hex with odd length\", () => {\n // GIVEN\n const str = \"test1\";\n // WHEN\n const result = HexStringUtils.stringToHex(str);\n // THEN\n expect(result).toEqual(\"7465737431\");\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA+B,yCAE/B,SAAS,iBAAkB,IAAM,CAC/B,SAAS,2BAA4B,IAAM,CACzC,GAAG,qCAAsC,IAAM,CAM7C,MAAMC,EAAS,iBAAe,yBAJd,WACE,WACN,IAMZ,EAEA,OAAOA,CAAM,EAAE,QAAQ,sBAAsB,CAC/C,CAAC,EAED,GAAG,qDAAsD,IAAM,CAM7D,MAAMA,EAAS,iBAAe,yBAJd,WACE,UACN,IAMZ,EAEA,OAAOA,CAAM,EAAE,QAAQ,sBAAsB,CAC/C,CAAC,CACH,CAAC,EAED,SAAS,cAAe,IAAM,CAC5B,GAAG,+BAAgC,IAAM,CAIvC,MAAMA,EAAS,iBAAe,YAFlB,MAEiC,EAE7C,OAAOA,CAAM,EAAE,QAAQ,UAAU,CACnC,CAAC,EAED,GAAG,+CAAgD,IAAM,CAIvD,MAAMA,EAAS,iBAAe,YAFlB,OAEiC,EAE7C,OAAOA,CAAM,EAAE,QAAQ,YAAY,CACrC,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_HexStringUtils", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var u=(t,a)=>{for(var s in a)i(t,s,{get:a[s],enumerable:!0})},y=(t,a,s,g)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of o(a))!p.call(t,r)&&r!==s&&i(t,r,{get:()=>a[r],enumerable:!(g=n(a,r))||g.enumerable});return t};var c=t=>y(i({},"__esModule",{value:!0}),t);var U={};u(U,{KeyUsageMapper:()=>m});module.exports=c(U);var e=require("../../pki/model/KeyUsage");class m{static keyUsageMap=new Map([[e.KeyUsage.GenuineCheck,1],[e.KeyUsage.ExchangePayload,2],[e.KeyUsage.NftMeta,3],[e.KeyUsage.TrustedName,4],[e.KeyUsage.BackupProvider,5],[e.KeyUsage.ProtectOrchestrator,6],[e.KeyUsage.PluginMeta,7],[e.KeyUsage.CoinMeta,8],[e.KeyUsage.SeedIdAuth,9],[e.KeyUsage.TxSimulationSigner,10],[e.KeyUsage.Calldata,11],[e.KeyUsage.Network,12]]);static mapKeyUsageForFirmware(a){return this.keyUsageMap.get(a)??-1}}0&&(module.exports={KeyUsageMapper});
2
+ //# sourceMappingURL=KeyUsageMapper.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/KeyUsageMapper.ts"],
4
+ "sourcesContent": ["import { KeyUsage } from \"@/pki/model/KeyUsage\";\n\nexport class KeyUsageMapper {\n private static keyUsageMap = new Map<KeyUsage, number>([\n [KeyUsage.GenuineCheck, 1],\n [KeyUsage.ExchangePayload, 2],\n [KeyUsage.NftMeta, 3],\n [KeyUsage.TrustedName, 4],\n [KeyUsage.BackupProvider, 5],\n [KeyUsage.ProtectOrchestrator, 6],\n [KeyUsage.PluginMeta, 7],\n [KeyUsage.CoinMeta, 8],\n [KeyUsage.SeedIdAuth, 9],\n [KeyUsage.TxSimulationSigner, 10],\n [KeyUsage.Calldata, 11],\n [KeyUsage.Network, 12],\n ]);\n\n static mapKeyUsageForFirmware(keyUsage: KeyUsage): number {\n return this.keyUsageMap.get(keyUsage as KeyUsage) ?? -1;\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,gCAElB,MAAMF,CAAe,CAC1B,OAAe,YAAc,IAAI,IAAsB,CACrD,CAAC,WAAS,aAAc,CAAC,EACzB,CAAC,WAAS,gBAAiB,CAAC,EAC5B,CAAC,WAAS,QAAS,CAAC,EACpB,CAAC,WAAS,YAAa,CAAC,EACxB,CAAC,WAAS,eAAgB,CAAC,EAC3B,CAAC,WAAS,oBAAqB,CAAC,EAChC,CAAC,WAAS,WAAY,CAAC,EACvB,CAAC,WAAS,SAAU,CAAC,EACrB,CAAC,WAAS,WAAY,CAAC,EACvB,CAAC,WAAS,mBAAoB,EAAE,EAChC,CAAC,WAAS,SAAU,EAAE,EACtB,CAAC,WAAS,QAAS,EAAE,CACvB,CAAC,EAED,OAAO,uBAAuBG,EAA4B,CACxD,OAAO,KAAK,YAAY,IAAIA,CAAoB,GAAK,EACvD,CACF",
6
+ "names": ["KeyUsageMapper_exports", "__export", "KeyUsageMapper", "__toCommonJS", "import_KeyUsage", "keyUsage"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("../../pki/model/KeyUsage"),r=require("../../shared/utils/KeyUsageMapper");describe("KeyUsageMapper",()=>{describe("mapKeyUsageForFirmware",()=>{it.each([[e.KeyUsage.GenuineCheck,1],[e.KeyUsage.ExchangePayload,2],[e.KeyUsage.NftMeta,3],[e.KeyUsage.TrustedName,4],[e.KeyUsage.BackupProvider,5],[e.KeyUsage.ProtectOrchestrator,6],[e.KeyUsage.PluginMeta,7],[e.KeyUsage.CoinMeta,8],[e.KeyUsage.SeedIdAuth,9],[e.KeyUsage.TxSimulationSigner,10],[e.KeyUsage.Calldata,11],[e.KeyUsage.Network,12]])("should map key usage %s to %i",(a,t)=>{const o=r.KeyUsageMapper.mapKeyUsageForFirmware(a);expect(o).toEqual(t)}),it("should return -1 when key usage is not found",()=>{const a=r.KeyUsageMapper.mapKeyUsageForFirmware("unknown");expect(a).toEqual(-1)})})});
2
+ //# sourceMappingURL=KeyUsageMapper.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/KeyUsageMapper.test.ts"],
4
+ "sourcesContent": ["import { KeyUsage } from \"@/pki/model/KeyUsage\";\nimport { KeyUsageMapper } from \"@/shared/utils/KeyUsageMapper\";\n\ndescribe(\"KeyUsageMapper\", () => {\n describe(\"mapKeyUsageForFirmware\", () => {\n it.each([\n [KeyUsage.GenuineCheck, 1],\n [KeyUsage.ExchangePayload, 2],\n [KeyUsage.NftMeta, 3],\n [KeyUsage.TrustedName, 4],\n [KeyUsage.BackupProvider, 5],\n [KeyUsage.ProtectOrchestrator, 6],\n [KeyUsage.PluginMeta, 7],\n [KeyUsage.CoinMeta, 8],\n [KeyUsage.SeedIdAuth, 9],\n [KeyUsage.TxSimulationSigner, 10],\n [KeyUsage.Calldata, 11],\n [KeyUsage.Network, 12],\n ])(`should map key usage %s to %i`, (keyUsage, expected) => {\n // WHEN\n const result = KeyUsageMapper.mapKeyUsageForFirmware(keyUsage);\n\n // THEN\n expect(result).toEqual(expected);\n });\n\n it(\"should return -1 when key usage is not found\", () => {\n // WHEN\n const result = KeyUsageMapper.mapKeyUsageForFirmware(\n \"unknown\" as KeyUsage,\n );\n\n // THEN\n expect(result).toEqual(-1);\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAyB,gCACzBC,EAA+B,yCAE/B,SAAS,iBAAkB,IAAM,CAC/B,SAAS,yBAA0B,IAAM,CACvC,GAAG,KAAK,CACN,CAAC,WAAS,aAAc,CAAC,EACzB,CAAC,WAAS,gBAAiB,CAAC,EAC5B,CAAC,WAAS,QAAS,CAAC,EACpB,CAAC,WAAS,YAAa,CAAC,EACxB,CAAC,WAAS,eAAgB,CAAC,EAC3B,CAAC,WAAS,oBAAqB,CAAC,EAChC,CAAC,WAAS,WAAY,CAAC,EACvB,CAAC,WAAS,SAAU,CAAC,EACrB,CAAC,WAAS,WAAY,CAAC,EACvB,CAAC,WAAS,mBAAoB,EAAE,EAChC,CAAC,WAAS,SAAU,EAAE,EACtB,CAAC,WAAS,QAAS,EAAE,CACvB,CAAC,EAAE,gCAAiC,CAACC,EAAUC,IAAa,CAE1D,MAAMC,EAAS,iBAAe,uBAAuBF,CAAQ,EAG7D,OAAOE,CAAM,EAAE,QAAQD,CAAQ,CACjC,CAAC,EAED,GAAG,+CAAgD,IAAM,CAEvD,MAAMC,EAAS,iBAAe,uBAC5B,SACF,EAGA,OAAOA,CAAM,EAAE,QAAQ,EAAE,CAC3B,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_KeyUsage", "import_KeyUsageMapper", "keyUsage", "expected", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var x=Object.create;var s=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var M=(r,t)=>{for(var e in t)s(r,e,{get:t[e],enumerable:!0})},p=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of T(t))!E.call(r,o)&&o!==e&&s(r,o,{get:()=>t[o],enumerable:!(n=m(t,o))||n.enumerable});return r};var g=(r,t,e)=>(e=r!=null?x(y(r)):{},p(t||!r||!r.__esModule?s(e,"default",{value:r,enumerable:!0}):e,r)),P=r=>p(s({},"__esModule",{value:!0}),r),l=(r,t,e,n)=>{for(var o=n>1?void 0:n?m(t,e):t,i=r.length-1,d;i>=0;i--)(d=r[i])&&(o=(n?d(t,e,o):d(o))||o);return n&&o&&s(t,e,o),o},u=(r,t)=>(e,n)=>t(e,n,r);var $={};M($,{HttpTokenDataSource:()=>a});module.exports=P($);var h=g(require("axios")),f=require("inversify"),c=require("purify-ts"),k=require("../../config/di/configTypes"),C=g(require("../../../package.json"));let a=class{constructor(t){this.config=t}async getTokenInfosPayload({chainId:t,address:e}){try{const o=(await h.default.request({method:"GET",url:`${this.config.cal.url}/tokens`,params:{contract_address:e,chain_id:t,output:"descriptor,ticker",ref:`branch:${this.config.cal.branch}`},headers:{"X-Ledger-Client-Version":`context-module/${C.default.version}`}})).data?.[0];if(!o||!o.ticker||!o.descriptor||!o.descriptor.data||!o.descriptor.signatures||typeof o.descriptor.signatures[this.config.cal.mode]!="string")return(0,c.Left)(new Error(`[ContextModule] HttpTokenDataSource: no token metadata for address ${e} on chain ${t}`));const i=o.ticker.length.toString(16).padStart(2,"0");return(0,c.Right)([i,o.descriptor.data,o.descriptor.signatures[this.config.cal.mode]].join(""))}catch{return(0,c.Left)(new Error("[ContextModule] HttpTokenDataSource: Failed to fetch token informations"))}}};a=l([(0,f.injectable)(),u(0,(0,f.inject)(k.configTypes.Config))],a);0&&(module.exports={HttpTokenDataSource});
2
+ //# sourceMappingURL=HttpTokenDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/token/data/HttpTokenDataSource.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport PACKAGE from \"@root/package.json\";\n\nimport { GetTokenInfosParams, TokenDataSource } from \"./TokenDataSource\";\nimport { TokenDto } from \"./TokenDto\";\n\n@injectable()\nexport class HttpTokenDataSource implements TokenDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n public async getTokenInfosPayload({\n chainId,\n address,\n }: GetTokenInfosParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<TokenDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/tokens`,\n params: {\n contract_address: address,\n chain_id: chainId,\n output: \"descriptor,ticker\",\n ref: `branch:${this.config.cal.branch}`,\n },\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n const tokenInfos = response.data?.[0];\n\n if (\n !tokenInfos ||\n !tokenInfos.ticker ||\n !tokenInfos.descriptor ||\n !tokenInfos.descriptor.data ||\n !tokenInfos.descriptor.signatures ||\n typeof tokenInfos.descriptor.signatures[this.config.cal.mode] !==\n \"string\"\n ) {\n return Left(\n new Error(\n `[ContextModule] HttpTokenDataSource: no token metadata for address ${address} on chain ${chainId}`,\n ),\n );\n }\n\n // 1 byte for the length of the ticker\n const tickerLengthBuff = tokenInfos.ticker.length\n .toString(16)\n .padStart(2, \"0\");\n\n return Right(\n [\n tickerLengthBuff,\n tokenInfos.descriptor.data,\n tokenInfos.descriptor.signatures[this.config.cal.mode],\n ].join(\"\"),\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpTokenDataSource: Failed to fetch token informations\",\n ),\n );\n }\n }\n}\n"],
5
+ "mappings": "qtBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,oBAClBC,EAAmC,qBACnCC,EAAoC,qBAEpCC,EAA4B,mCAE5BC,EAAoB,iCAMb,IAAMC,EAAN,KAAqD,CAC1D,YAC+CC,EAC7C,CAD6C,YAAAA,CAC5C,CACH,MAAa,qBAAqB,CAChC,QAAAC,EACA,QAAAC,CACF,EAAwD,CACtD,GAAI,CAcF,MAAMC,GAbW,MAAM,EAAAC,QAAM,QAAoB,CAC/C,OAAQ,MACR,IAAK,GAAG,KAAK,OAAO,IAAI,GAAG,UAC3B,OAAQ,CACN,iBAAkBF,EAClB,SAAUD,EACV,OAAQ,oBACR,IAAK,UAAU,KAAK,OAAO,IAAI,MAAM,EACvC,EACA,QAAS,CACP,0BAA2B,kBAAkB,EAAAI,QAAQ,OAAO,EAC9D,CACF,CAAC,GAC2B,OAAO,CAAC,EAEpC,GACE,CAACF,GACD,CAACA,EAAW,QACZ,CAACA,EAAW,YACZ,CAACA,EAAW,WAAW,MACvB,CAACA,EAAW,WAAW,YACvB,OAAOA,EAAW,WAAW,WAAW,KAAK,OAAO,IAAI,IAAI,GAC1D,SAEF,SAAO,QACL,IAAI,MACF,sEAAsED,CAAO,aAAaD,CAAO,EACnG,CACF,EAIF,MAAMK,EAAmBH,EAAW,OAAO,OACxC,SAAS,EAAE,EACX,SAAS,EAAG,GAAG,EAElB,SAAO,SACL,CACEG,EACAH,EAAW,WAAW,KACtBA,EAAW,WAAW,WAAW,KAAK,OAAO,IAAI,IAAI,CACvD,EAAE,KAAK,EAAE,CACX,CACF,MAAiB,CACf,SAAO,QACL,IAAI,MACF,yEACF,CACF,CACF,CACF,CACF,EA5DaJ,EAANQ,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,cAAY,MAAM,IAFjBT",
6
+ "names": ["HttpTokenDataSource_exports", "__export", "HttpTokenDataSource", "__toCommonJS", "import_axios", "import_inversify", "import_purify_ts", "import_configTypes", "import_package", "HttpTokenDataSource", "config", "chainId", "address", "tokenInfos", "axios", "PACKAGE", "tickerLengthBuff", "__decorateClass", "__decorateParam"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var u=Object.create;var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var h=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k(e))!x.call(t,r)&&r!==o&&d(t,r,{get:()=>e[r],enumerable:!(s=p(e,r))||s.enumerable});return t};var i=(t,e,o)=>(o=t!=null?u(m(t)):{},h(e||!t||!t.__esModule?d(o,"default",{value:t,enumerable:!0}):o,t));var a=i(require("axios")),n=require("purify-ts"),c=require("../../token/data/HttpTokenDataSource"),l=i(require("../../../package.json"));vi.mock("axios");describe("HttpTokenDataSource",()=>{let t;beforeAll(()=>{const e={cal:{url:"https://crypto-assets-service.api.ledger.com/v1",mode:"prod",branch:"main"}};t=new c.HttpTokenDataSource(e),vi.clearAllMocks()}),it("should call axios with the ledger client version header",async()=>{const e=`context-module/${l.default.version}`,o=vi.fn(()=>Promise.resolve({data:[]}));vi.spyOn(a.default,"request").mockImplementation(o),await t.getTokenInfosPayload({address:"0x00",chainId:1}),expect(o).toHaveBeenCalledWith(expect.objectContaining({headers:{"X-Ledger-Client-Version":e}}))}),it("should return a string when axios response is correct",async()=>{const e={ticker:"USDC",descriptor:{data:"55534443000000000800000001",signatures:{prod:"0123"}}};vi.spyOn(a.default,"request").mockResolvedValue({data:[e]});const o=await t.getTokenInfosPayload({address:"0x00",chainId:1});expect(o.extract()).toEqual("04555344430000000008000000010123")}),it("should return an error when data is empty",async()=>{vi.spyOn(a.default,"request").mockResolvedValue({data:void 0});const e=await t.getTokenInfosPayload({address:"0x00",chainId:1});expect(e).toEqual((0,n.Left)(new Error("[ContextModule] HttpTokenDataSource: no token metadata for address 0x00 on chain 1")))}),it("should return undefined when no signature",async()=>{vi.spyOn(a.default,"request").mockResolvedValue({data:[{}]});const e=await t.getTokenInfosPayload({address:"0x00",chainId:1});expect(e).toEqual((0,n.Left)(new Error("[ContextModule] HttpTokenDataSource: no token metadata for address 0x00 on chain 1")))}),it("should return undefined when no ticker",async()=>{const e={ticker:"USDC",descriptor:{data:"55534443000000000800000001",signatures:{test:"0123"}}};vi.spyOn(a.default,"request").mockResolvedValue({data:[e]});const o=await t.getTokenInfosPayload({address:"0x00",chainId:1});expect(o).toEqual((0,n.Left)(new Error("[ContextModule] HttpTokenDataSource: no token metadata for address 0x00 on chain 1")))}),it("should return undefined when no decimals",async()=>{vi.spyOn(a.default,"request").mockResolvedValue({data:[{live_signature:"0x0",ticker:"USDC"}]});const e=await t.getTokenInfosPayload({address:"0x00",chainId:1});expect(e).toEqual((0,n.Left)(new Error("[ContextModule] HttpTokenDataSource: no token metadata for address 0x00 on chain 1")))}),it("should return an error when axios throws an error",async()=>{vi.spyOn(a.default,"request").mockRejectedValue(new Error);const e=await t.getTokenInfosPayload({address:"0x00",chainId:1});expect(e).toEqual((0,n.Left)(new Error("[ContextModule] HttpTokenDataSource: Failed to fetch token informations")))})});
2
+ //# sourceMappingURL=HttpTokenDataSource.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/token/data/HttpTokenDataSource.test.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { Left } from \"purify-ts\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { HttpTokenDataSource } from \"@/token/data/HttpTokenDataSource\";\nimport { type TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { type TokenDto } from \"@/token/data/TokenDto\";\nimport PACKAGE from \"@root/package.json\";\n\nvi.mock(\"axios\");\n\ndescribe(\"HttpTokenDataSource\", () => {\n let datasource: TokenDataSource;\n\n beforeAll(() => {\n const config = {\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n },\n } as ContextModuleConfig;\n datasource = new HttpTokenDataSource(config);\n vi.clearAllMocks();\n });\n\n it(\"should call axios with the ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = vi.fn(() => Promise.resolve({ data: [] }));\n vi.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getTokenInfosPayload({ address: \"0x00\", chainId: 1 });\n\n // THEN\n expect(requestSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n it(\"should return a string when axios response is correct\", async () => {\n // GIVEN\n const tokenDTO: TokenDto = {\n ticker: \"USDC\",\n descriptor: {\n data: \"55534443000000000800000001\",\n signatures: {\n prod: \"0123\",\n },\n },\n };\n vi.spyOn(axios, \"request\").mockResolvedValue({ data: [tokenDTO] });\n\n // WHEN\n const result = await datasource.getTokenInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\"04555344430000000008000000010123\");\n });\n\n it(\"should return an error when data is empty\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockResolvedValue({ data: undefined });\n\n // WHEN\n const result = await datasource.getTokenInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTokenDataSource: no token metadata for address 0x00 on chain 1\",\n ),\n ),\n );\n });\n\n it(\"should return undefined when no signature\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockResolvedValue({ data: [{}] });\n\n // WHEN\n const result = await datasource.getTokenInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTokenDataSource: no token metadata for address 0x00 on chain 1\",\n ),\n ),\n );\n });\n\n it(\"should return undefined when no ticker\", async () => {\n // GIVEN\n const tokenDTO: TokenDto = {\n ticker: \"USDC\",\n descriptor: {\n data: \"55534443000000000800000001\",\n signatures: {\n test: \"0123\",\n },\n },\n };\n vi.spyOn(axios, \"request\").mockResolvedValue({ data: [tokenDTO] });\n\n // WHEN\n const result = await datasource.getTokenInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTokenDataSource: no token metadata for address 0x00 on chain 1\",\n ),\n ),\n );\n });\n\n it(\"should return undefined when no decimals\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockResolvedValue({\n data: [{ live_signature: \"0x0\", ticker: \"USDC\" }],\n });\n\n // WHEN\n const result = await datasource.getTokenInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTokenDataSource: no token metadata for address 0x00 on chain 1\",\n ),\n ),\n );\n });\n\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockRejectedValue(new Error());\n\n // WHEN\n const result = await datasource.getTokenInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTokenDataSource: Failed to fetch token informations\",\n ),\n ),\n );\n });\n});\n"],
5
+ "mappings": "wdAAA,IAAAA,EAAkB,oBAClBC,EAAqB,qBAGrBC,EAAoC,4CAGpCC,EAAoB,iCAEpB,GAAG,KAAK,OAAO,EAEf,SAAS,sBAAuB,IAAM,CACpC,IAAIC,EAEJ,UAAU,IAAM,CACd,MAAMC,EAAS,CACb,IAAK,CACH,IAAK,kDACL,KAAM,OACN,OAAQ,MACV,CACF,EACAD,EAAa,IAAI,sBAAoBC,CAAM,EAC3C,GAAG,cAAc,CACnB,CAAC,EAED,GAAG,0DAA2D,SAAY,CAExE,MAAMC,EAAU,kBAAkB,EAAAC,QAAQ,OAAO,GAC3CC,EAAa,GAAG,GAAG,IAAM,QAAQ,QAAQ,CAAE,KAAM,CAAC,CAAE,CAAC,CAAC,EAC5D,GAAG,MAAM,EAAAC,QAAO,SAAS,EAAE,mBAAmBD,CAAU,EAGxD,MAAMJ,EAAW,qBAAqB,CAAE,QAAS,OAAQ,QAAS,CAAE,CAAC,EAGrE,OAAOI,CAAU,EAAE,qBACjB,OAAO,iBAAiB,CACtB,QAAS,CAAE,0BAA2BF,CAAQ,CAChD,CAAC,CACH,CACF,CAAC,EAED,GAAG,wDAAyD,SAAY,CAEtE,MAAMI,EAAqB,CACzB,OAAQ,OACR,WAAY,CACV,KAAM,6BACN,WAAY,CACV,KAAM,MACR,CACF,CACF,EACA,GAAG,MAAM,EAAAD,QAAO,SAAS,EAAE,kBAAkB,CAAE,KAAM,CAACC,CAAQ,CAAE,CAAC,EAGjE,MAAMC,EAAS,MAAMP,EAAW,qBAAqB,CACnD,QAAS,OACT,QAAS,CACX,CAAC,EAGD,OAAOO,EAAO,QAAQ,CAAC,EAAE,QAAQ,kCAAkC,CACrE,CAAC,EAED,GAAG,4CAA6C,SAAY,CAE1D,GAAG,MAAM,EAAAF,QAAO,SAAS,EAAE,kBAAkB,CAAE,KAAM,MAAU,CAAC,EAGhE,MAAME,EAAS,MAAMP,EAAW,qBAAqB,CACnD,QAAS,OACT,QAAS,CACX,CAAC,EAGD,OAAOO,CAAM,EAAE,WACb,QACE,IAAI,MACF,oFACF,CACF,CACF,CACF,CAAC,EAED,GAAG,4CAA6C,SAAY,CAE1D,GAAG,MAAM,EAAAF,QAAO,SAAS,EAAE,kBAAkB,CAAE,KAAM,CAAC,CAAC,CAAC,CAAE,CAAC,EAG3D,MAAME,EAAS,MAAMP,EAAW,qBAAqB,CACnD,QAAS,OACT,QAAS,CACX,CAAC,EAGD,OAAOO,CAAM,EAAE,WACb,QACE,IAAI,MACF,oFACF,CACF,CACF,CACF,CAAC,EAED,GAAG,yCAA0C,SAAY,CAEvD,MAAMD,EAAqB,CACzB,OAAQ,OACR,WAAY,CACV,KAAM,6BACN,WAAY,CACV,KAAM,MACR,CACF,CACF,EACA,GAAG,MAAM,EAAAD,QAAO,SAAS,EAAE,kBAAkB,CAAE,KAAM,CAACC,CAAQ,CAAE,CAAC,EAGjE,MAAMC,EAAS,MAAMP,EAAW,qBAAqB,CACnD,QAAS,OACT,QAAS,CACX,CAAC,EAGD,OAAOO,CAAM,EAAE,WACb,QACE,IAAI,MACF,oFACF,CACF,CACF,CACF,CAAC,EAED,GAAG,2CAA4C,SAAY,CAEzD,GAAG,MAAM,EAAAF,QAAO,SAAS,EAAE,kBAAkB,CAC3C,KAAM,CAAC,CAAE,eAAgB,MAAO,OAAQ,MAAO,CAAC,CAClD,CAAC,EAGD,MAAME,EAAS,MAAMP,EAAW,qBAAqB,CACnD,QAAS,OACT,QAAS,CACX,CAAC,EAGD,OAAOO,CAAM,EAAE,WACb,QACE,IAAI,MACF,oFACF,CACF,CACF,CACF,CAAC,EAED,GAAG,oDAAqD,SAAY,CAElE,GAAG,MAAM,EAAAF,QAAO,SAAS,EAAE,kBAAkB,IAAI,KAAO,EAGxD,MAAME,EAAS,MAAMP,EAAW,qBAAqB,CACnD,QAAS,OACT,QAAS,CACX,CAAC,EAGD,OAAOO,CAAM,EAAE,WACb,QACE,IAAI,MACF,yEACF,CACF,CACF,CACF,CAAC,CACH,CAAC",
6
+ "names": ["import_axios", "import_purify_ts", "import_HttpTokenDataSource", "import_package", "datasource", "config", "version", "PACKAGE", "requestSpy", "axios", "tokenDTO", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of i(e))!m.call(r,o)&&o!==n&&a(r,o,{get:()=>e[o],enumerable:!(t=s(e,o))||t.enumerable});return r};var f=r=>p(a({},"__esModule",{value:!0}),r);var d={};module.exports=f(d);
2
+ //# sourceMappingURL=TokenDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/token/data/TokenDataSource.ts"],
4
+ "sourcesContent": ["import { type Either } from \"purify-ts\";\n\nexport type GetTokenInfosParams = {\n address: string;\n chainId: number;\n};\n\nexport interface TokenDataSource {\n getTokenInfosPayload(\n params: GetTokenInfosParams,\n ): Promise<Either<Error, string>>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TokenDataSource_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var k=(r,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of p(t))!g.call(r,e)&&e!==o&&n(r,e,{get:()=>t[e],enumerable:!(s=i(t,e))||s.enumerable});return r};var a=r=>k(n({},"__esModule",{value:!0}),r);var T={};module.exports=a(T);
2
+ //# sourceMappingURL=TokenDto.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/token/data/TokenDto.ts"],
4
+ "sourcesContent": ["export type TokenSignatures =\n | {\n prod: string;\n test?: string;\n }\n | {\n prod?: string;\n test: string;\n };\n\nexport type TokenDescriptor = {\n data: string;\n signatures: TokenSignatures;\n};\n\nexport type TokenDto = {\n ticker: string;\n descriptor: TokenDescriptor;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TokenDto_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var c=(o,t)=>{for(var e in t)a(o,e,{get:t[e],enumerable:!0})},f=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!T.call(o,r)&&r!==e&&a(o,r,{get:()=>t[r],enumerable:!(n=k(t,r))||n.enumerable});return o};var s=o=>f(a({},"__esModule",{value:!0}),o);var C={};c(C,{tokenModuleFactory:()=>x});module.exports=s(C);var i=require("inversify"),p=require("../../token/data/HttpTokenDataSource"),m=require("../../token/di/tokenTypes"),d=require("../../token/domain/TokenContextLoader");const x=()=>new i.ContainerModule((o,t,e,n)=>{o(m.tokenTypes.TokenDataSource).to(p.HttpTokenDataSource),o(m.tokenTypes.TokenContextLoader).to(d.TokenContextLoader)});0&&(module.exports={tokenModuleFactory});
2
+ //# sourceMappingURL=tokenModuleFactory.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/token/di/tokenModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTokenDataSource } from \"@/token/data/HttpTokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport { TokenContextLoader } from \"@/token/domain/TokenContextLoader\";\n\nexport const tokenModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(tokenTypes.TokenDataSource).to(HttpTokenDataSource);\n bind(tokenTypes.TokenContextLoader).to(TokenContextLoader);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAoC,4CACpCC,EAA2B,iCAC3BC,EAAmC,6CAE5B,MAAML,EAAqB,IAChC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,aAAW,eAAe,EAAE,GAAG,qBAAmB,EACvDA,EAAK,aAAW,kBAAkB,EAAE,GAAG,oBAAkB,CAC3D,CAAC",
6
+ "names": ["tokenModuleFactory_exports", "__export", "tokenModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTokenDataSource", "import_tokenTypes", "import_TokenContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var r=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var c=(e,o)=>{for(var n in o)r(e,n,{get:o[n],enumerable:!0})},x=(e,o,n,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of T(o))!S.call(e,t)&&t!==n&&r(e,t,{get:()=>o[t],enumerable:!(a=k(o,t))||a.enumerable});return e};var y=e=>x(r({},"__esModule",{value:!0}),e);var d={};c(d,{tokenTypes:()=>b});module.exports=y(d);const b={TokenDataSource:Symbol.for("TokenDataSource"),TokenContextLoader:Symbol.for("TokenContextLoader")};0&&(module.exports={tokenTypes});
2
+ //# sourceMappingURL=tokenTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/token/di/tokenTypes.ts"],
4
+ "sourcesContent": ["export const tokenTypes = {\n TokenDataSource: Symbol.for(\"TokenDataSource\"),\n TokenContextLoader: Symbol.for(\"TokenContextLoader\"),\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAa,CACxB,gBAAiB,OAAO,IAAI,iBAAiB,EAC7C,mBAAoB,OAAO,IAAI,oBAAoB,CACrD",
6
+ "names": ["tokenTypes_exports", "__export", "tokenTypes", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var C=(o,e)=>{for(var t in e)s(o,t,{get:e[t],enumerable:!0})},T=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of f(e))!g.call(o,a)&&a!==t&&s(o,a,{get:()=>e[a],enumerable:!(r=u(e,a))||r.enumerable});return o};var h=o=>T(s({},"__esModule",{value:!0}),o),S=(o,e,t,r)=>{for(var a=r>1?void 0:r?u(e,t):e,c=o.length-1,p;c>=0;c--)(p=o[c])&&(a=(r?p(e,t,a):p(a))||a);return r&&a&&s(e,t,a),a},x=(o,e)=>(t,r)=>e(t,r,o);var I={};C(I,{ERC20_SUPPORTED_SELECTORS:()=>d,TokenContextLoader:()=>i});module.exports=h(I);var m=require("@ledgerhq/device-management-kit"),l=require("inversify"),n=require("../../shared/model/ClearSignContext"),y=require("../../token/di/tokenTypes");var d=(t=>(t.Approve="0x095ea7b3",t.Transfer="0xa9059cbb",t))(d||{});const O=Object.values(d);let i=class{_dataSource;constructor(e){this._dataSource=e}async load(e){if(!e.to||!e.data||e.data==="0x")return[];const t=e.data.slice(0,10);return(0,m.isHexaString)(t)?this.isSelectorSupported(t)?[(await this._dataSource.getTokenInfosPayload({address:e.to,chainId:e.chainId})).caseOf({Left:a=>({type:n.ClearSignContextType.ERROR,error:a}),Right:a=>({type:n.ClearSignContextType.TOKEN,payload:a})})]:[]:[{type:n.ClearSignContextType.ERROR,error:new Error("Invalid selector")}]}async loadField(e){return e.type!==n.ClearSignContextType.TOKEN?null:(await this._dataSource.getTokenInfosPayload({address:e.address,chainId:e.chainId})).caseOf({Left:r=>({type:n.ClearSignContextType.ERROR,error:r}),Right:r=>({type:n.ClearSignContextType.TOKEN,payload:r})})}isSelectorSupported(e){return Object.values(O).includes(e)}};i=S([(0,l.injectable)(),x(0,(0,l.inject)(y.tokenTypes.TokenDataSource))],i);0&&(module.exports={ERC20_SUPPORTED_SELECTORS,TokenContextLoader});
2
+ //# sourceMappingURL=TokenContextLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/token/domain/TokenContextLoader.ts"],
4
+ "sourcesContent": ["import { HexaString, isHexaString } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport {\n TransactionContext,\n TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\n\nexport enum ERC20_SUPPORTED_SELECTORS {\n Approve = \"0x095ea7b3\",\n Transfer = \"0xa9059cbb\",\n}\n\nconst SUPPORTED_SELECTORS: HexaString[] = Object.values(\n ERC20_SUPPORTED_SELECTORS,\n);\n\n@injectable()\nexport class TokenContextLoader implements ContextLoader {\n private _dataSource: TokenDataSource;\n\n constructor(@inject(tokenTypes.TokenDataSource) dataSource: TokenDataSource) {\n this._dataSource = dataSource;\n }\n\n async load(transaction: TransactionContext): Promise<ClearSignContext[]> {\n if (!transaction.to || !transaction.data || transaction.data === \"0x\") {\n return [];\n }\n\n const selector = transaction.data.slice(0, 10);\n\n if (!isHexaString(selector)) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ];\n }\n\n if (!this.isSelectorSupported(selector)) {\n return [];\n }\n\n const payload = await this._dataSource.getTokenInfosPayload({\n address: transaction.to,\n chainId: transaction.chainId,\n });\n\n return [\n payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.TOKEN,\n payload: value,\n }),\n }),\n ];\n }\n\n async loadField(\n field: TransactionFieldContext,\n ): Promise<ClearSignContext | null> {\n if (field.type !== ClearSignContextType.TOKEN) {\n return null;\n }\n const payload = await this._dataSource.getTokenInfosPayload({\n address: field.address,\n chainId: field.chainId,\n });\n return payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.TOKEN,\n payload: value,\n }),\n });\n }\n\n private isSelectorSupported(selector: HexaString) {\n return Object.values(SUPPORTED_SELECTORS).includes(selector);\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,EAAA,uBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAyC,2CACzCC,EAAmC,qBAGnCC,EAGO,2CAMPC,EAA2B,iCAEpB,IAAKC,OACVA,EAAA,QAAU,aACVA,EAAA,SAAW,aAFDA,OAAA,IAKZ,MAAMC,EAAoC,OAAO,OAC/CD,CACF,EAGO,IAAME,EAAN,KAAkD,CAC/C,YAER,YAAgDC,EAA6B,CAC3E,KAAK,YAAcA,CACrB,CAEA,MAAM,KAAKC,EAA8D,CACvE,GAAI,CAACA,EAAY,IAAM,CAACA,EAAY,MAAQA,EAAY,OAAS,KAC/D,MAAO,CAAC,EAGV,MAAMC,EAAWD,EAAY,KAAK,MAAM,EAAG,EAAE,EAE7C,SAAK,gBAAaC,CAAQ,EASrB,KAAK,oBAAoBA,CAAQ,EAS/B,EALS,MAAM,KAAK,YAAY,qBAAqB,CAC1D,QAASD,EAAY,GACrB,QAASA,EAAY,OACvB,CAAC,GAGS,OAAO,CACb,KAAOE,IAA6B,CAClC,KAAM,uBAAqB,MAC3B,MAAAA,CACF,GACA,MAAQC,IAA6B,CACnC,KAAM,uBAAqB,MAC3B,QAASA,CACX,EACF,CAAC,CACH,EAnBS,CAAC,EATD,CACL,CACE,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,kBAAkB,CACrC,CACF,CAwBJ,CAEA,MAAM,UACJC,EACkC,CAClC,OAAIA,EAAM,OAAS,uBAAqB,MAC/B,MAEO,MAAM,KAAK,YAAY,qBAAqB,CAC1D,QAASA,EAAM,QACf,QAASA,EAAM,OACjB,CAAC,GACc,OAAO,CACpB,KAAOF,IAA6B,CAClC,KAAM,uBAAqB,MAC3B,MAAAA,CACF,GACA,MAAQC,IAA6B,CACnC,KAAM,uBAAqB,MAC3B,QAASA,CACX,EACF,CAAC,CACH,CAEQ,oBAAoBF,EAAsB,CAChD,OAAO,OAAO,OAAOJ,CAAmB,EAAE,SAASI,CAAQ,CAC7D,CACF,EAvEaH,EAANO,EAAA,IADN,cAAW,EAIGC,EAAA,eAAO,aAAW,eAAe,IAHnCR",
6
+ "names": ["TokenContextLoader_exports", "__export", "ERC20_SUPPORTED_SELECTORS", "TokenContextLoader", "__toCommonJS", "import_device_management_kit", "import_inversify", "import_ClearSignContext", "import_tokenTypes", "ERC20_SUPPORTED_SELECTORS", "SUPPORTED_SELECTORS", "TokenContextLoader", "dataSource", "transaction", "selector", "error", "value", "field", "__decorateClass", "__decorateParam"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=require("purify-ts"),o=require("../../shared/model/ClearSignContext"),s=require("../../token/domain/TokenContextLoader");describe("TokenContextLoader",()=>{const r={getTokenInfosPayload:vi.fn()},e=new s.TokenContextLoader(r);beforeEach(()=>{vi.restoreAllMocks(),vi.spyOn(r,"getTokenInfosPayload").mockImplementation(({address:t})=>Promise.resolve((0,n.Right)(`payload-${t}`)))}),describe("load function",()=>{it("should return an empty array if transaction dest is undefined",async()=>{const t={to:void 0,data:"0x01"},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if transaction data is undefined",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:void 0},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if transaction data is empty",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x"},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if the selector is not supported",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b20000000000000"},a=await e.load(t);expect(a).toEqual([])}),it("should return an error when transaction data is not a valid hex string",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"notahexstring"},a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("Invalid selector")}])}),it("should return an error when datasource returns an error",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b30000000000",chainId:1};vi.spyOn(r,"getTokenInfosPayload").mockResolvedValue((0,n.Left)(new Error("error")));const a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("error")}])}),it("should return a correct response",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b30000000000",chainId:1},a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.TOKEN,payload:"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7"}])})}),describe("loadField function",()=>{it("should return an error when field type if not supported",async()=>{const t={type:o.ClearSignContextType.NFT,chainId:7,address:"0x1234"},a=await e.loadField(t);expect(a).toEqual(null)}),it("should return a payload",async()=>{const t={type:o.ClearSignContextType.TOKEN,chainId:7,address:"0x1234"};vi.spyOn(r,"getTokenInfosPayload").mockResolvedValue((0,n.Right)("payload"));const a=await e.loadField(t);expect(a).toEqual({type:o.ClearSignContextType.TOKEN,payload:"payload"})}),it("should return an error when unable to fetch the datasource",async()=>{const t={type:o.ClearSignContextType.TOKEN,chainId:7,address:"0x1234"};vi.spyOn(r,"getTokenInfosPayload").mockResolvedValue((0,n.Left)(new Error("error")));const a=await e.loadField(t);expect(a).toEqual({type:o.ClearSignContextType.ERROR,error:new Error("error")})})})});
2
+ //# sourceMappingURL=TokenContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/token/domain/TokenContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\nimport { type TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { TokenContextLoader } from \"@/token/domain/TokenContextLoader\";\n\ndescribe(\"TokenContextLoader\", () => {\n const mockTokenDataSource: TokenDataSource = {\n getTokenInfosPayload: vi.fn(),\n };\n const loader = new TokenContextLoader(mockTokenDataSource);\n\n beforeEach(() => {\n vi.restoreAllMocks();\n vi.spyOn(mockTokenDataSource, \"getTokenInfosPayload\").mockImplementation(\n ({ address }) => Promise.resolve(Right(`payload-${address}`)),\n );\n });\n\n describe(\"load function\", () => {\n it(\"should return an empty array if transaction dest is undefined\", async () => {\n // GIVEN\n const transaction = { to: undefined, data: \"0x01\" } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if transaction data is undefined\", async () => {\n // GIVEN\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: undefined,\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if transaction data is empty\", async () => {\n // GIVEN\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if the selector is not supported\", async () => {\n // GIVEN\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b20000000000000\",\n } as unknown as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an error when transaction data is not a valid hex string\", async () => {\n // GIVEN\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"notahexstring\",\n } as unknown as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ]);\n });\n\n it(\"should return an error when datasource returns an error\", async () => {\n // GIVEN\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b30000000000\",\n chainId: 1,\n } as TransactionContext;\n vi.spyOn(mockTokenDataSource, \"getTokenInfosPayload\").mockResolvedValue(\n Left(new Error(\"error\")),\n );\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n { type: ClearSignContextType.ERROR, error: new Error(\"error\") },\n ]);\n });\n\n it(\"should return a correct response\", async () => {\n // GIVEN\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b30000000000\",\n chainId: 1,\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n },\n ]);\n });\n });\n\n describe(\"loadField function\", () => {\n it(\"should return an error when field type if not supported\", async () => {\n const field: TransactionFieldContext = {\n type: ClearSignContextType.NFT,\n chainId: 7,\n address: \"0x1234\",\n };\n\n const result = await loader.loadField(field);\n\n expect(result).toEqual(null);\n });\n\n it(\"should return a payload\", async () => {\n // GIVEN\n const field: TransactionFieldContext = {\n type: ClearSignContextType.TOKEN,\n chainId: 7,\n address: \"0x1234\",\n };\n\n // WHEN\n vi.spyOn(mockTokenDataSource, \"getTokenInfosPayload\").mockResolvedValue(\n Right(\"payload\"),\n );\n const result = await loader.loadField(field);\n\n // THEN\n expect(result).toEqual({\n type: ClearSignContextType.TOKEN,\n payload: \"payload\",\n });\n });\n\n it(\"should return an error when unable to fetch the datasource\", async () => {\n // GIVEN\n const field: TransactionFieldContext = {\n type: ClearSignContextType.TOKEN,\n chainId: 7,\n address: \"0x1234\",\n };\n\n // WHEN\n vi.spyOn(mockTokenDataSource, \"getTokenInfosPayload\").mockResolvedValue(\n Left(new Error(\"error\")),\n );\n const result = await loader.loadField(field);\n\n // THEN\n expect(result).toEqual({\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n });\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA4B,qBAE5BC,EAAqC,2CAMrCC,EAAmC,6CAEnC,SAAS,qBAAsB,IAAM,CACnC,MAAMC,EAAuC,CAC3C,qBAAsB,GAAG,GAAG,CAC9B,EACMC,EAAS,IAAI,qBAAmBD,CAAmB,EAEzD,WAAW,IAAM,CACf,GAAG,gBAAgB,EACnB,GAAG,MAAMA,EAAqB,sBAAsB,EAAE,mBACpD,CAAC,CAAE,QAAAE,CAAQ,IAAM,QAAQ,WAAQ,SAAM,WAAWA,CAAO,EAAE,CAAC,CAC9D,CACF,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,gEAAiE,SAAY,CAE9E,MAAMC,EAAc,CAAE,GAAI,OAAW,KAAM,MAAO,EAG5CC,EAAS,MAAMH,EAAO,KAAKE,CAAW,EAG5C,OAAOC,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,EAED,GAAG,gEAAiE,SAAY,CAE9E,MAAMD,EAAc,CAClB,GAAI,6CACJ,KAAM,MACR,EAGMC,EAAS,MAAMH,EAAO,KAAKE,CAAW,EAG5C,OAAOC,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,EAED,GAAG,4DAA6D,SAAY,CAE1E,MAAMD,EAAc,CAClB,GAAI,6CACJ,KAAM,IACR,EAGMC,EAAS,MAAMH,EAAO,KAAKE,CAAW,EAG5C,OAAOC,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,EAED,GAAG,gEAAiE,SAAY,CAE9E,MAAMD,EAAc,CAClB,GAAI,6CACJ,KAAM,yBACR,EAGMC,EAAS,MAAMH,EAAO,KAAKE,CAAW,EAG5C,OAAOC,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,EAED,GAAG,yEAA0E,SAAY,CAEvF,MAAMD,EAAc,CAClB,GAAI,6CACJ,KAAM,eACR,EAGMC,EAAS,MAAMH,EAAO,KAAKE,CAAW,EAG5C,OAAOC,CAAM,EAAE,QAAQ,CACrB,CACE,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,kBAAkB,CACrC,CACF,CAAC,CACH,CAAC,EAED,GAAG,0DAA2D,SAAY,CAExE,MAAMD,EAAc,CAClB,GAAI,6CACJ,KAAM,uBACN,QAAS,CACX,EACA,GAAG,MAAMH,EAAqB,sBAAsB,EAAE,qBACpD,QAAK,IAAI,MAAM,OAAO,CAAC,CACzB,EAGA,MAAMI,EAAS,MAAMH,EAAO,KAAKE,CAAW,EAG5C,OAAOC,CAAM,EAAE,QAAQ,CACrB,CAAE,KAAM,uBAAqB,MAAO,MAAO,IAAI,MAAM,OAAO,CAAE,CAChE,CAAC,CACH,CAAC,EAED,GAAG,mCAAoC,SAAY,CAEjD,MAAMD,EAAc,CAClB,GAAI,6CACJ,KAAM,uBACN,QAAS,CACX,EAGMC,EAAS,MAAMH,EAAO,KAAKE,CAAW,EAG5C,OAAOC,CAAM,EAAE,QAAQ,CACrB,CACE,KAAM,uBAAqB,MAC3B,QAAS,oDACX,CACF,CAAC,CACH,CAAC,CACH,CAAC,EAED,SAAS,qBAAsB,IAAM,CACnC,GAAG,0DAA2D,SAAY,CACxE,MAAMC,EAAiC,CACrC,KAAM,uBAAqB,IAC3B,QAAS,EACT,QAAS,QACX,EAEMD,EAAS,MAAMH,EAAO,UAAUI,CAAK,EAE3C,OAAOD,CAAM,EAAE,QAAQ,IAAI,CAC7B,CAAC,EAED,GAAG,0BAA2B,SAAY,CAExC,MAAMC,EAAiC,CACrC,KAAM,uBAAqB,MAC3B,QAAS,EACT,QAAS,QACX,EAGA,GAAG,MAAML,EAAqB,sBAAsB,EAAE,qBACpD,SAAM,SAAS,CACjB,EACA,MAAMI,EAAS,MAAMH,EAAO,UAAUI,CAAK,EAG3C,OAAOD,CAAM,EAAE,QAAQ,CACrB,KAAM,uBAAqB,MAC3B,QAAS,SACX,CAAC,CACH,CAAC,EAED,GAAG,6DAA8D,SAAY,CAE3E,MAAMC,EAAiC,CACrC,KAAM,uBAAqB,MAC3B,QAAS,EACT,QAAS,QACX,EAGA,GAAG,MAAML,EAAqB,sBAAsB,EAAE,qBACpD,QAAK,IAAI,MAAM,OAAO,CAAC,CACzB,EACA,MAAMI,EAAS,MAAMH,EAAO,UAAUI,CAAK,EAG3C,OAAOD,CAAM,EAAE,QAAQ,CACrB,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,OAAO,CAC1B,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_purify_ts", "import_ClearSignContext", "import_TokenContextLoader", "mockTokenDataSource", "loader", "address", "transaction", "result", "field"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var l=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var s=(t,a,p,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of o(a))!n.call(t,e)&&e!==p&&l(t,e,{get:()=>a[e],enumerable:!(r=i(a,e))||r.enumerable});return t};var c=t=>s(l({},"__esModule",{value:!0}),t);var d={};module.exports=c(d);
2
+ //# sourceMappingURL=CalldataDto.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/transaction/data/CalldataDto.ts"],
4
+ "sourcesContent": ["export interface CalldataDto {\n descriptors_calldata: {\n [address: string]: {\n [selector: string]: CalldataDescriptor;\n };\n };\n}\n\nexport type CalldataDescriptor = CalldataDescriptorV1; // For now only V1 descriptors are supported\n\nexport interface CalldataDescriptorV1 {\n type: \"calldata\";\n version: \"v1\";\n transaction_info: CalldataTransactionInfoV1;\n enums: CalldataEnumV1;\n fields: CalldataFieldV1[];\n}\n\nexport type CalldataTransactionDescriptor = {\n data: string;\n signatures: CalldataSignatures;\n};\n\nexport type CalldataSignatures =\n | {\n prod: string;\n test?: string;\n }\n | {\n prod?: string;\n test: string;\n };\n\nexport interface CalldataTransactionInfoV1 {\n descriptor: CalldataTransactionDescriptor;\n}\n\nexport interface CalldataEnumV1 {\n [id: number]: {\n [value: number]: CalldataTransactionDescriptor;\n };\n}\n\nexport interface CalldataFieldV1 {\n descriptor: string;\n param: CalldataDescriptorParam;\n}\n\nexport type CalldataDescriptorParam =\n | CalldataDescriptorParamRawV1\n | CalldataDescriptorParamAmountV1\n | CalldataDescriptorParamTokenAmountV1\n | CalldataDescriptorParamNFTV1\n | CalldataDescriptorParamDatetimeV1\n | CalldataDescriptorParamDurationV1\n | CalldataDescriptorParamUnitV1\n | CalldataDescriptorParamEnumV1\n | CalldataDescriptorParamTrustedNameV1;\n\nexport interface CalldataDescriptorParamRawV1 {\n type: \"RAW\";\n value: CalldataDescriptorValueV1;\n}\n\nexport interface CalldataDescriptorParamAmountV1 {\n type: \"AMOUNT\";\n value: CalldataDescriptorValueV1;\n}\n\nexport interface CalldataDescriptorParamTokenAmountV1 {\n type: \"TOKEN_AMOUNT\";\n value: CalldataDescriptorValueV1;\n token?: CalldataDescriptorValueV1;\n}\n\nexport interface CalldataDescriptorParamNFTV1 {\n type: \"NFT\";\n value: CalldataDescriptorValueV1;\n collection: CalldataDescriptorValueV1;\n}\n\nexport interface CalldataDescriptorParamDatetimeV1 {\n type: \"DATETIME\";\n value: CalldataDescriptorValueV1;\n}\n\nexport interface CalldataDescriptorParamDurationV1 {\n type: \"DURATION\";\n value: CalldataDescriptorValueV1;\n}\n\nexport interface CalldataDescriptorParamUnitV1 {\n type: \"UNIT\";\n value: CalldataDescriptorValueV1;\n}\n\nexport interface CalldataDescriptorParamEnumV1 {\n type: \"ENUM\";\n value: CalldataDescriptorValueV1;\n id: number;\n}\n\nexport interface CalldataDescriptorParamTrustedNameV1 {\n type: \"TRUSTED_NAME\";\n value: CalldataDescriptorValueV1;\n types: string[];\n sources: string[];\n}\n\nexport interface CalldataDescriptorValueBinaryPathV1 {\n type: \"path\";\n binary_path:\n | CalldataDescriptorContainerPathV1\n | CalldataDescriptorPathElementsV1;\n type_family: CalldataDescriptorTypeFamilyV1;\n type_size?: number;\n}\n\nexport interface CalldataDescriptorValueConstantV1 {\n type: \"constant\";\n value: string;\n type_family: CalldataDescriptorTypeFamilyV1;\n type_size?: number;\n}\n\nexport type CalldataDescriptorValueV1 =\n | CalldataDescriptorValueBinaryPathV1\n | CalldataDescriptorValueConstantV1;\n\nexport interface CalldataDescriptorContainerPathV1 {\n type: \"CONTAINER\";\n value: CalldataDescriptorContainerPathTypeV1;\n}\n\nexport interface CalldataDescriptorPathElementsV1 {\n type: \"DATA\";\n elements: CalldataDescriptorPathElementV1[];\n}\n\nexport type CalldataDescriptorPathElementV1 =\n | CalldataDescriptorPathElementTupleV1\n | CalldataDescriptorPathElementArrayV1\n | CalldataDescriptorPathElementRefV1\n | CalldataDescriptorPathElementLeafV1\n | CalldataDescriptorPathElementSliceV1;\n\nexport interface CalldataDescriptorPathElementTupleV1 {\n type: \"TUPLE\";\n offset: number;\n}\n\nexport interface CalldataDescriptorPathElementArrayV1 {\n type: \"ARRAY\";\n start?: number;\n end?: number;\n weight: number;\n}\n\nexport interface CalldataDescriptorPathElementRefV1 {\n type: \"REF\";\n}\n\nexport interface CalldataDescriptorPathElementLeafV1 {\n type: \"LEAF\";\n leaf_type: CalldataDescriptorPathLeafTypeV1;\n}\n\nexport interface CalldataDescriptorPathElementSliceV1 {\n type: \"SLICE\";\n start?: number;\n end?: number;\n}\n\nexport type CalldataDescriptorContainerPathTypeV1 = \"FROM\" | \"TO\" | \"VALUE\";\nexport type CalldataDescriptorPathLeafTypeV1 =\n | \"ARRAY_LEAF\"\n | \"TUPLE_LEAF\"\n | \"STATIC_LEAF\"\n | \"DYNAMIC_LEAF\";\nexport type CalldataDescriptorTypeFamilyV1 =\n | \"UINT\"\n | \"INT\"\n | \"UFIXED\"\n | \"FIXED\"\n | \"ADDRESS\"\n | \"BOOL\"\n | \"BYTES\"\n | \"STRING\";\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["CalldataDto_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var L=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var K=(i,e)=>{for(var t in e)c(i,t,{get:e[t],enumerable:!0})},E=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!w.call(i,o)&&o!==t&&c(i,o,{get:()=>e[o],enumerable:!(r=g(e,o))||r.enumerable});return i};var D=(i,e,t)=>(t=i!=null?L(G(i)):{},E(e||!i||!i.__esModule?c(t,"default",{value:i,enumerable:!0}):t,i)),$=i=>E(c({},"__esModule",{value:!0}),i),V=(i,e,t,r)=>{for(var o=r>1?void 0:r?g(e,t):e,a=i.length-1,n;a>=0;a--)(n=i[a])&&(o=(r?n(e,t,o):n(o))||o);return r&&o&&c(e,t,o),o},C=(i,e)=>(t,r)=>e(t,r,i);var B={};K(B,{HttpTransactionDataSource:()=>y});module.exports=$(B);var A=D(require("axios")),f=require("inversify"),l=require("purify-ts"),b=require("../../config/di/configTypes"),v=require("../../pki/di/pkiTypes"),N=require("../../pki/model/KeyId"),P=require("../../pki/model/KeyUsage"),s=require("../../shared/model/ClearSignContext"),d=require("../../shared/model/SignatureTags"),m=require("../../shared/utils/HexStringUtils"),_=D(require("../../../package.json"));let y=class{constructor(e,t){this.config=e;this._certificateLoader=t}async getTransactionDescriptors({chainId:e,address:t,selector:r,deviceModelId:o}){let a;try{a=(await A.default.request({method:"GET",url:`${this.config.cal.url}/dapps`,params:{output:"descriptors_calldata",chain_id:e,contracts:t,ref:`branch:${this.config.cal.branch}`},headers:{"X-Ledger-Client-Version":`context-module/${_.default.version}`}})).data}catch(n){return(0,l.Left)(new Error(`[ContextModule] HttpTransactionDataSource: Failed to fetch transaction informations: ${n}`))}if(!Array.isArray(a))return(0,l.Left)(new Error("[ContextModule] HttpTransactionDataSource: Response is not an array"));if(a.length===0)return(0,l.Left)(new Error(`[ContextModule] HttpTransactionDataSource: No data for contract ${t} and selector ${r}`));for(const n of a){t=t.toLowerCase(),r=`0x${r.slice(2).toLowerCase()}`;const p=n.descriptors_calldata?.[t]?.[r];if(!p||!this.isCalldataDescriptorV1(p,this.config.cal.mode))continue;const S=p.transaction_info.descriptor.data,M=p.transaction_info.descriptor.signatures[this.config.cal.mode],I={targetDevice:o,keyUsage:P.KeyUsage.Calldata,keyId:N.KeyId.CalCalldataKey},h=await this._certificateLoader.loadCertificate(I),x={type:s.ClearSignContextType.TRANSACTION_INFO,payload:m.HexStringUtils.appendSignatureToPayload(S,M,d.INFO_SIGNATURE_TAG),certificate:h},T=[];for(const[u,O]of Object.entries(p.enums))for(const[F,{data:U,signatures:k}]of Object.entries(O))T.push({type:s.ClearSignContextType.ENUM,id:Number(u),value:Number(F),payload:m.HexStringUtils.appendSignatureToPayload(U,k[this.config.cal.mode],d.INFO_SIGNATURE_TAG),certificate:h});const R=p.fields.map(u=>({type:s.ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION,payload:u.descriptor,reference:this.getReference(u.param)}));return(0,l.Right)([x,...T,...R])}return(0,l.Left)(new Error(`[ContextModule] HttpTransactionDataSource: Invalid response for contract ${t} and selector ${r}`))}getReference(e){if(e.type==="TOKEN_AMOUNT"&&e.token!==void 0&&e.token.type==="path")return{type:s.ClearSignContextType.TOKEN,valuePath:this.toGenericPath(e.token.binary_path)};if(e.type==="TOKEN_AMOUNT"&&e.token!==void 0&&e.token.type==="constant")return{type:s.ClearSignContextType.TOKEN,value:e.token.value};if(e.type==="NFT"&&e.collection.type==="path")return{type:s.ClearSignContextType.NFT,valuePath:this.toGenericPath(e.collection.binary_path)};if(e.type==="NFT"&&e.collection.type==="constant")return{type:s.ClearSignContextType.NFT,value:e.collection.value};if(e.type==="TRUSTED_NAME"&&e.value.type==="path")return{type:s.ClearSignContextType.TRUSTED_NAME,valuePath:this.toGenericPath(e.value.binary_path),types:e.types,sources:e.sources};if(e.type==="ENUM"&&e.value.type==="path")return{type:s.ClearSignContextType.ENUM,valuePath:this.toGenericPath(e.value.binary_path),id:e.id}}toGenericPath(e){return e.type==="CONTAINER"?e.value:e.elements.map(t=>{if(t.type==="ARRAY"){const{weight:r,...o}=t;return{itemSize:r,...o}}else if(t.type==="LEAF"){const{leaf_type:r,...o}=t;return{leafType:r,...o}}return t})}isCalldataDescriptorV1(e,t){return typeof e=="object"&&e.type==="calldata"&&e.version==="v1"&&this.isTransactionInfoV1(e.transaction_info,t)&&this.isEnumV1(e.enums,t)&&Array.isArray(e.fields)&&e.fields.every(r=>this.isFieldV1(r))}isTransactionInfoV1(e,t){return typeof e=="object"&&typeof e.descriptor=="object"&&typeof e.descriptor.data=="string"&&typeof e.descriptor.signatures=="object"&&typeof e.descriptor.signatures[t]=="string"}isEnumV1(e,t){return typeof e=="object"&&Object.entries(e).every(([r,o])=>typeof r=="string"&&typeof o=="object"&&Object.entries(o).every(([a,n])=>typeof a=="string"&&typeof n=="object"&&typeof n.data=="string"&&n.signatures!==void 0&&this.isCalldataSignatures(n.signatures,t)))}isCalldataSignatures(e,t){return typeof e=="object"&&typeof e[t]=="string"}isFieldV1(e){return typeof e=="object"&&typeof e.descriptor=="string"&&typeof e.param=="object"&&typeof e.param.value=="object"&&this.isDescriptorValueV1(e.param.value)&&(e.param.type==="RAW"||e.param.type==="AMOUNT"||e.param.type==="DATETIME"||e.param.type==="DURATION"||e.param.type==="UNIT"||e.param.type==="ENUM"||e.param.type==="NFT"&&this.isDescriptorValueV1(e.param.collection)||e.param.type==="TOKEN_AMOUNT"&&(e.param.token===void 0||this.isDescriptorValueV1(e.param.token))||e.param.type==="TRUSTED_NAME"&&Array.isArray(e.param.types)&&Array.isArray(e.param.sources)&&e.param.types.every(t=>typeof t=="string")&&e.param.sources.every(t=>typeof t=="string"))}isDescriptorValueV1(e){return typeof e=="object"&&typeof e.type_family=="string"&&["UINT","INT","UFIXED","FIXED","ADDRESS","BOOL","BYTES","STRING"].includes(e.type_family)&&(typeof e.type_size>"u"||typeof e.type_size=="number")&&(e.type==="path"&&this.isCalldataDescriptorValueBinaryPathV1(e)||e.type==="constant"&&this.isCalldataDescriptorValueConstantV1(e))}isCalldataDescriptorValueConstantV1(e){return typeof e=="object"&&e.type==="constant"&&typeof e.value=="string"}isCalldataDescriptorValueBinaryPathV1(e){return typeof e=="object"&&(e.type==="path"&&e.binary_path.type==="CONTAINER"&&["FROM","TO","VALUE"].includes(e.binary_path.value)||e.binary_path.type==="DATA"&&Array.isArray(e.binary_path.elements)&&e.binary_path.elements.every(t=>this.isPathElementV1(t)))}isPathElementV1(e){return typeof e=="object"&&(e.type==="REF"||e.type==="TUPLE"&&typeof e.offset=="number"||e.type==="ARRAY"&&typeof e.weight=="number"&&(typeof e.start>"u"||typeof e.start=="number")&&(typeof e.end>"u"||typeof e.end=="number")||e.type==="LEAF"&&typeof e.leaf_type=="string"&&["ARRAY_LEAF","TUPLE_LEAF","STATIC_LEAF","DYNAMIC_LEAF"].includes(e.leaf_type)||e.type==="SLICE"&&(typeof e.start>"u"||typeof e.start=="number")&&(typeof e.end>"u"||typeof e.end=="number"))}};y=V([(0,f.injectable)(),C(0,(0,f.inject)(b.configTypes.Config)),C(1,(0,f.inject)(v.pkiTypes.PkiCertificateLoader))],y);0&&(module.exports={HttpTransactionDataSource});
2
+ //# sourceMappingURL=HttpTransactionDataSource.js.map