@ledgerhq/context-module 0.0.0-develop-20241011001048 → 0.0.0-signer-eth-20250122093657

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 (572) hide show
  1. package/LICENSE.MD +202 -0
  2. package/README.md +4 -6
  3. package/lib/cjs/index.js +2 -20
  4. package/lib/cjs/index.js.map +7 -1
  5. package/lib/cjs/package.json +54 -59
  6. package/lib/cjs/src/ContextModule.js +2 -3
  7. package/lib/cjs/src/ContextModule.js.map +7 -1
  8. package/lib/cjs/src/ContextModuleBuilder.js +2 -87
  9. package/lib/cjs/src/ContextModuleBuilder.js.map +7 -1
  10. package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
  11. package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
  12. package/lib/cjs/src/DefaultContextModule.js +2 -21
  13. package/lib/cjs/src/DefaultContextModule.js.map +7 -1
  14. package/lib/cjs/src/DefaultContextModule.test.js +2 -0
  15. package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
  16. package/lib/cjs/src/config/di/configModuleFactory.js +2 -10
  17. package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -1
  18. package/lib/cjs/src/config/di/configTypes.js +2 -7
  19. package/lib/cjs/src/config/di/configTypes.js.map +7 -1
  20. package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -3
  21. package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -1
  22. package/lib/cjs/src/di.js +2 -17
  23. package/lib/cjs/src/di.js.map +7 -1
  24. package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -3
  25. package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -1
  26. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -3
  27. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
  28. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -83
  29. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
  30. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  31. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  32. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -13
  33. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
  34. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -8
  35. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -1
  36. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -136
  37. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
  38. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  39. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  40. package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -3
  41. package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -1
  42. package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -3
  43. package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -1
  44. package/lib/cjs/src/index.js +2 -30
  45. package/lib/cjs/src/index.js.map +7 -1
  46. package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -57
  47. package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -1
  48. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
  49. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  50. package/lib/cjs/src/nft/data/NftDataSource.js +2 -3
  51. package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -1
  52. package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -13
  53. package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -1
  54. package/lib/cjs/src/nft/di/nftTypes.js +2 -8
  55. package/lib/cjs/src/nft/di/nftTypes.js.map +7 -1
  56. package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -111
  57. package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -1
  58. package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
  59. package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
  60. package/lib/cjs/src/shared/domain/ContextLoader.js +2 -3
  61. package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -1
  62. package/lib/cjs/src/shared/model/ClearSignContext.js +2 -13
  63. package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -1
  64. package/lib/cjs/src/shared/model/GenericPath.js +2 -0
  65. package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
  66. package/lib/cjs/src/shared/model/TransactionContext.js +2 -3
  67. package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -1
  68. package/lib/cjs/src/shared/model/TransactionSubset.js +2 -3
  69. package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -1
  70. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -6
  71. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -1
  72. package/lib/cjs/src/shared/model/TypedDataContext.js +2 -3
  73. package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -1
  74. package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -15
  75. package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -1
  76. package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -83
  77. package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -1
  78. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
  79. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  80. package/lib/cjs/src/token/data/TokenDataSource.js +2 -3
  81. package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -1
  82. package/lib/cjs/src/token/data/TokenDto.js +2 -3
  83. package/lib/cjs/src/token/data/TokenDto.js.map +7 -1
  84. package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -13
  85. package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -1
  86. package/lib/cjs/src/token/di/tokenTypes.js +2 -8
  87. package/lib/cjs/src/token/di/tokenTypes.js.map +7 -1
  88. package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -74
  89. package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -1
  90. package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
  91. package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
  92. package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
  93. package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
  94. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
  95. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  96. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  97. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  98. package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
  99. package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
  100. package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
  101. package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
  102. package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
  103. package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
  104. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
  105. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  106. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  107. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  108. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  109. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  110. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  111. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  112. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
  113. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  114. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
  115. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  116. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  117. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  118. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
  119. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  120. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  121. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  122. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  123. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  124. package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -3
  125. package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -1
  126. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -163
  127. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
  128. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  129. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  130. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -3
  131. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -1
  132. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -13
  133. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
  134. package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -8
  135. package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -1
  136. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -127
  137. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
  138. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  139. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  140. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -3
  141. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
  142. package/lib/esm/index.js +2 -4
  143. package/lib/esm/index.js.map +7 -1
  144. package/lib/esm/package.json +54 -59
  145. package/lib/esm/src/ContextModule.js +1 -2
  146. package/lib/esm/src/ContextModule.js.map +7 -1
  147. package/lib/esm/src/ContextModuleBuilder.js +2 -83
  148. package/lib/esm/src/ContextModuleBuilder.js.map +7 -1
  149. package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
  150. package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
  151. package/lib/esm/src/DefaultContextModule.js +2 -17
  152. package/lib/esm/src/DefaultContextModule.js.map +7 -1
  153. package/lib/esm/src/DefaultContextModule.test.js +2 -0
  154. package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
  155. package/lib/esm/src/config/di/configModuleFactory.js +2 -6
  156. package/lib/esm/src/config/di/configModuleFactory.js.map +7 -1
  157. package/lib/esm/src/config/di/configTypes.js +2 -4
  158. package/lib/esm/src/config/di/configTypes.js.map +7 -1
  159. package/lib/esm/src/config/model/ContextModuleConfig.js +1 -2
  160. package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -1
  161. package/lib/esm/src/di.js +2 -13
  162. package/lib/esm/src/di.js.map +7 -1
  163. package/lib/esm/src/external-plugin/data/DAppDto.js +1 -2
  164. package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -1
  165. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -2
  166. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
  167. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -77
  168. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
  169. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  170. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  171. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -9
  172. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
  173. package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -5
  174. package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -1
  175. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -133
  176. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
  177. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  178. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  179. package/lib/esm/src/external-plugin/model/DappInfos.js +1 -2
  180. package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -1
  181. package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -2
  182. package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -1
  183. package/lib/esm/src/index.js +2 -14
  184. package/lib/esm/src/index.js.map +7 -1
  185. package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -51
  186. package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -1
  187. package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
  188. package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  189. package/lib/esm/src/nft/data/NftDataSource.js +1 -2
  190. package/lib/esm/src/nft/data/NftDataSource.js.map +7 -1
  191. package/lib/esm/src/nft/di/nftModuleFactory.js +2 -9
  192. package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -1
  193. package/lib/esm/src/nft/di/nftTypes.js +2 -5
  194. package/lib/esm/src/nft/di/nftTypes.js.map +7 -1
  195. package/lib/esm/src/nft/domain/NftContextLoader.js +2 -108
  196. package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -1
  197. package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
  198. package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
  199. package/lib/esm/src/shared/domain/ContextLoader.js +1 -2
  200. package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -1
  201. package/lib/esm/src/shared/model/ClearSignContext.js +2 -10
  202. package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -1
  203. package/lib/esm/src/shared/model/GenericPath.js +2 -0
  204. package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
  205. package/lib/esm/src/shared/model/TransactionContext.js +1 -2
  206. package/lib/esm/src/shared/model/TransactionContext.js.map +7 -1
  207. package/lib/esm/src/shared/model/TransactionSubset.js +1 -2
  208. package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -1
  209. package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -3
  210. package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -1
  211. package/lib/esm/src/shared/model/TypedDataContext.js +1 -2
  212. package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -1
  213. package/lib/esm/src/shared/utils/HexStringUtils.js +2 -11
  214. package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -1
  215. package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -77
  216. package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -1
  217. package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
  218. package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  219. package/lib/esm/src/token/data/TokenDataSource.js +1 -2
  220. package/lib/esm/src/token/data/TokenDataSource.js.map +7 -1
  221. package/lib/esm/src/token/data/TokenDto.js +1 -2
  222. package/lib/esm/src/token/data/TokenDto.js.map +7 -1
  223. package/lib/esm/src/token/di/tokenModuleFactory.js +2 -9
  224. package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -1
  225. package/lib/esm/src/token/di/tokenTypes.js +2 -5
  226. package/lib/esm/src/token/di/tokenTypes.js.map +7 -1
  227. package/lib/esm/src/token/domain/TokenContextLoader.js +2 -71
  228. package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -1
  229. package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
  230. package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
  231. package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
  232. package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
  233. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
  234. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  235. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  236. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  237. package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
  238. package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
  239. package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
  240. package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
  241. package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
  242. package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
  243. package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
  244. package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  245. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  246. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  247. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  248. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  249. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  250. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  251. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
  252. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  253. package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
  254. package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  255. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  256. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  257. package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
  258. package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  259. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  260. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  261. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  262. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  263. package/lib/esm/src/typed-data/data/FiltersDto.js +1 -2
  264. package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -1
  265. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -157
  266. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
  267. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  268. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  269. package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -2
  270. package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -1
  271. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -9
  272. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
  273. package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -5
  274. package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -1
  275. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -124
  276. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
  277. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  278. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  279. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -2
  280. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
  281. package/lib/{cjs → types}/src/ContextModule.d.ts +3 -2
  282. package/lib/types/src/ContextModule.d.ts.map +1 -0
  283. package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +9 -11
  284. package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -0
  285. package/lib/types/src/ContextModuleBuilder.test.d.ts +2 -0
  286. package/lib/types/src/ContextModuleBuilder.test.d.ts.map +1 -0
  287. package/lib/types/src/DefaultContextModule.d.ts +18 -0
  288. package/lib/types/src/DefaultContextModule.d.ts.map +1 -0
  289. package/lib/types/src/DefaultContextModule.test.d.ts +2 -0
  290. package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
  291. package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +1 -1
  292. package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts.map +1 -1
  293. package/lib/types/src/config/model/ContextModuleConfig.d.ts +16 -0
  294. package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -0
  295. package/lib/{cjs → types}/src/di.d.ts +1 -1
  296. package/lib/types/src/di.d.ts.map +1 -0
  297. package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
  298. package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -0
  299. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts +2 -0
  300. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts.map +1 -0
  301. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts +2 -0
  302. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts.map +1 -0
  303. package/lib/types/src/external-plugin/model/DappInfos.d.ts +6 -0
  304. package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -0
  305. package/lib/{cjs → types}/src/index.d.ts +3 -1
  306. package/lib/types/src/index.d.ts.map +1 -0
  307. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts +2 -0
  308. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts.map +1 -0
  309. package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts +1 -1
  310. package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -0
  311. package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts +2 -1
  312. package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -0
  313. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts +2 -0
  314. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts.map +1 -0
  315. package/lib/types/src/shared/domain/ContextLoader.d.ts +7 -0
  316. package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -0
  317. package/lib/types/src/shared/model/ClearSignContext.d.ts +48 -0
  318. package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -0
  319. package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
  320. package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
  321. package/lib/types/src/shared/model/TransactionContext.d.ts +19 -0
  322. package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -0
  323. package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
  324. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
  325. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
  326. package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +1 -1
  327. package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -0
  328. package/lib/types/src/token/data/TokenDto.d.ts +16 -0
  329. package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
  330. package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +2 -1
  331. package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -0
  332. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
  333. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
  334. package/lib/types/src/transaction/data/CalldataDto.d.ts +128 -0
  335. package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
  336. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +22 -0
  337. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
  338. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
  339. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
  340. package/lib/types/src/transaction/data/TransactionDataSource.d.ts +12 -0
  341. package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
  342. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
  343. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
  344. package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
  345. package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
  346. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
  347. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
  348. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
  349. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
  350. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
  351. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
  352. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
  353. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
  354. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
  355. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
  356. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
  357. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
  358. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
  359. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
  360. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
  361. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
  362. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
  363. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
  364. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
  365. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
  366. package/lib/{cjs → types}/src/typed-data/data/FiltersDto.d.ts +3 -0
  367. package/lib/types/src/typed-data/data/FiltersDto.d.ts.map +1 -0
  368. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -0
  369. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +3 -0
  370. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -0
  371. package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
  372. package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -0
  373. package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
  374. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
  375. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
  376. package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
  377. package/package.json +22 -27
  378. package/lib/cjs/src/ContextModule.d.ts.map +0 -1
  379. package/lib/cjs/src/ContextModuleBuilder.d.ts.map +0 -1
  380. package/lib/cjs/src/DefaultContextModule.d.ts +0 -20
  381. package/lib/cjs/src/DefaultContextModule.d.ts.map +0 -1
  382. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts +0 -9
  383. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  384. package/lib/cjs/src/di.d.ts.map +0 -1
  385. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  386. package/lib/cjs/src/external-plugin/model/DappInfos.d.ts +0 -6
  387. package/lib/cjs/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  388. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  389. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  390. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js +0 -3
  391. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  392. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  393. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  394. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -40
  395. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  396. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  397. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  398. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js +0 -13
  399. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  400. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  401. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  402. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js +0 -8
  403. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  404. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  405. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  406. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -66
  407. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  408. package/lib/cjs/src/index.d.ts.map +0 -1
  409. package/lib/cjs/src/nft/data/NftDataSource.d.ts.map +0 -1
  410. package/lib/cjs/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  411. package/lib/cjs/src/shared/domain/ContextLoader.d.ts +0 -6
  412. package/lib/cjs/src/shared/domain/ContextLoader.d.ts.map +0 -1
  413. package/lib/cjs/src/shared/model/ClearSignContext.d.ts +0 -21
  414. package/lib/cjs/src/shared/model/ClearSignContext.d.ts.map +0 -1
  415. package/lib/cjs/src/shared/model/TransactionContext.d.ts +0 -6
  416. package/lib/cjs/src/shared/model/TransactionContext.d.ts.map +0 -1
  417. package/lib/cjs/src/token/data/TokenDataSource.d.ts.map +0 -1
  418. package/lib/cjs/src/token/data/TokenDto.d.ts +0 -6
  419. package/lib/cjs/src/token/data/TokenDto.d.ts.map +0 -1
  420. package/lib/cjs/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  421. package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  422. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  423. package/lib/cjs/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  424. package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  425. package/lib/esm/index.d.ts +0 -3
  426. package/lib/esm/index.d.ts.map +0 -1
  427. package/lib/esm/src/ContextModule.d.ts +0 -9
  428. package/lib/esm/src/ContextModule.d.ts.map +0 -1
  429. package/lib/esm/src/ContextModuleBuilder.d.ts +0 -45
  430. package/lib/esm/src/ContextModuleBuilder.d.ts.map +0 -1
  431. package/lib/esm/src/DefaultContextModule.d.ts +0 -20
  432. package/lib/esm/src/DefaultContextModule.d.ts.map +0 -1
  433. package/lib/esm/src/config/di/configModuleFactory.d.ts +0 -4
  434. package/lib/esm/src/config/di/configModuleFactory.d.ts.map +0 -1
  435. package/lib/esm/src/config/di/configTypes.d.ts +0 -4
  436. package/lib/esm/src/config/di/configTypes.d.ts.map +0 -1
  437. package/lib/esm/src/config/model/ContextModuleConfig.d.ts +0 -9
  438. package/lib/esm/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  439. package/lib/esm/src/di.d.ts +0 -8
  440. package/lib/esm/src/di.d.ts.map +0 -1
  441. package/lib/esm/src/external-plugin/data/DAppDto.d.ts +0 -38
  442. package/lib/esm/src/external-plugin/data/DAppDto.d.ts.map +0 -1
  443. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -12
  444. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  445. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -10
  446. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -1
  447. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -3
  448. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -1
  449. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts +0 -5
  450. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -1
  451. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -15
  452. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -1
  453. package/lib/esm/src/external-plugin/model/DappInfos.d.ts +0 -6
  454. package/lib/esm/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  455. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts +0 -8
  456. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts.map +0 -1
  457. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  458. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  459. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js +0 -2
  460. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  461. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  462. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  463. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -34
  464. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  465. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  466. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  467. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js +0 -9
  468. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  469. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  470. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  471. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js +0 -5
  472. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  473. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  474. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  475. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -63
  476. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  477. package/lib/esm/src/index.d.ts +0 -14
  478. package/lib/esm/src/index.d.ts.map +0 -1
  479. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts +0 -7
  480. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts.map +0 -1
  481. package/lib/esm/src/nft/data/NftDataSource.d.ts +0 -15
  482. package/lib/esm/src/nft/data/NftDataSource.d.ts.map +0 -1
  483. package/lib/esm/src/nft/di/nftModuleFactory.d.ts +0 -3
  484. package/lib/esm/src/nft/di/nftModuleFactory.d.ts.map +0 -1
  485. package/lib/esm/src/nft/di/nftTypes.d.ts +0 -5
  486. package/lib/esm/src/nft/di/nftTypes.d.ts.map +0 -1
  487. package/lib/esm/src/nft/domain/NftContextLoader.d.ts +0 -11
  488. package/lib/esm/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  489. package/lib/esm/src/shared/domain/ContextLoader.d.ts +0 -6
  490. package/lib/esm/src/shared/domain/ContextLoader.d.ts.map +0 -1
  491. package/lib/esm/src/shared/model/ClearSignContext.d.ts +0 -21
  492. package/lib/esm/src/shared/model/ClearSignContext.d.ts.map +0 -1
  493. package/lib/esm/src/shared/model/TransactionContext.d.ts +0 -6
  494. package/lib/esm/src/shared/model/TransactionContext.d.ts.map +0 -1
  495. package/lib/esm/src/shared/model/TransactionSubset.d.ts +0 -6
  496. package/lib/esm/src/shared/model/TransactionSubset.d.ts.map +0 -1
  497. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts +0 -33
  498. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -1
  499. package/lib/esm/src/shared/model/TypedDataContext.d.ts +0 -16
  500. package/lib/esm/src/shared/model/TypedDataContext.d.ts.map +0 -1
  501. package/lib/esm/src/shared/utils/HexStringUtils.d.ts +0 -4
  502. package/lib/esm/src/shared/utils/HexStringUtils.d.ts.map +0 -1
  503. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts +0 -9
  504. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts.map +0 -1
  505. package/lib/esm/src/token/data/TokenDataSource.d.ts +0 -9
  506. package/lib/esm/src/token/data/TokenDataSource.d.ts.map +0 -1
  507. package/lib/esm/src/token/data/TokenDto.d.ts +0 -6
  508. package/lib/esm/src/token/data/TokenDto.d.ts.map +0 -1
  509. package/lib/esm/src/token/di/tokenModuleFactory.d.ts +0 -3
  510. package/lib/esm/src/token/di/tokenModuleFactory.d.ts.map +0 -1
  511. package/lib/esm/src/token/di/tokenTypes.d.ts +0 -5
  512. package/lib/esm/src/token/di/tokenTypes.d.ts.map +0 -1
  513. package/lib/esm/src/token/domain/TokenContextLoader.d.ts +0 -15
  514. package/lib/esm/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  515. package/lib/esm/src/typed-data/data/FiltersDto.d.ts +0 -55
  516. package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  517. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -14
  518. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  519. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts +0 -17
  520. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  521. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts +0 -3
  522. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -1
  523. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts +0 -5
  524. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts.map +0 -1
  525. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -13
  526. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -1
  527. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -6
  528. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -1
  529. package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
  530. /package/lib/{cjs → types}/index.d.ts +0 -0
  531. /package/lib/{cjs → types}/index.d.ts.map +0 -0
  532. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts +0 -0
  533. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts.map +0 -0
  534. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts +0 -0
  535. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts.map +0 -0
  536. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -0
  537. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -0
  538. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -0
  539. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -0
  540. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts +0 -0
  541. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -0
  542. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -0
  543. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -0
  544. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts +0 -0
  545. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts.map +0 -0
  546. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts +0 -0
  547. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts.map +0 -0
  548. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts +0 -0
  549. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts.map +0 -0
  550. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts +0 -0
  551. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts.map +0 -0
  552. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
  553. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
  554. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
  555. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
  556. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
  557. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
  558. /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts +0 -0
  559. /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +0 -0
  560. /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
  561. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts +0 -0
  562. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts.map +0 -0
  563. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts +0 -0
  564. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts.map +0 -0
  565. /package/lib/{cjs → types}/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -0
  566. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts +0 -0
  567. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -0
  568. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts +0 -0
  569. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts.map +0 -0
  570. /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -0
  571. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
  572. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
@@ -0,0 +1,2 @@
1
+ "use strict";var t=require("purify-ts"),b=require("../../typed-data/domain/DefaultTypedDataContextLoader");describe("TokenContextLoader",()=>{const d={getTokenInfosPayload:jest.fn()},f={getTypedDataFilters:jest.fn()},c=new b.DefaultTypedDataContextLoader(f,d),n={PermitSingle:[{name:"details",type:"PermitDetails"},{name:"spender",type:"address"},{name:"sigDeadline",type:"uint256"}],PermitDetails:[{type:"address[]",name:"token"},{name:"amount",type:"uint160"},{name:"expiration",type:"uint48"},{name:"nonce",type:"uint48"}],EIP712Domain:[{name:"name",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]},s=[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,25])},{path:"details.amount",value:Uint8Array.from([18])},{path:"spender",value:Uint8Array.from([18])},{path:"details.expiration",value:Uint8Array.from([18])}];beforeEach(()=>{jest.clearAllMocks(),jest.spyOn(d,"getTokenInfosPayload").mockImplementation(({address:a})=>Promise.resolve((0,t.Right)(`payload-${a}`)))}),describe("load function",()=>{it("success with referenced token",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:4,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"},{type:"amount",displayName:"Amount allowance",path:"details.amount",tokenIndex:0,signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3"},{type:"raw",displayName:"Approve to spender",path:"spender",signature:"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb"},{type:"datetime",displayName:"Approval expire",path:"details.expiration",signature:"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b"}]})));const e=await c.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:4,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{0:"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619"},filters:{"details.amount":{displayName:"Amount allowance",path:"details.amount",signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3",tokenIndex:0,type:"amount"},"details.expiration":{displayName:"Approval expire",path:"details.expiration",signature:"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b",type:"datetime"},"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"},spender:{displayName:"Approve to spender",path:"spender",signature:"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb",type:"raw"}}})}),it("success with referenced token verifying contract",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"},{type:"amount",displayName:"Amount allowance",path:"details.amount",tokenIndex:255,signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3"}]})));const e=await c.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{0:"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",255:"payload-0x000000000022d473030f116ddee9f6b43ac78ba3"},filters:{"details.amount":{displayName:"Amount allowance",path:"details.amount",signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3",tokenIndex:255,type:"amount"},"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"}}})}),it("should return an error if filters are unavailable",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Left)(new Error("error"))));const e=await c.load(a);expect(e).toEqual({type:"error",error:new Error("error")})}),it("success with unavailable tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]}))),jest.spyOn(d,"getTokenInfosPayload").mockImplementation(()=>Promise.resolve((0,t.Left)(new Error("token error"))));const e=await c.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{},filters:{"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"}}})}),it("success with several identic tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,25])},...s]};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]}))),jest.spyOn(d,"getTokenInfosPayload").mockImplementation(()=>Promise.resolve((0,t.Left)(new Error("token error"))));const e=await c.load(a);expect(d.getTokenInfosPayload).toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",chainId:1}),expect(e.type).toEqual("success")}),it("success with several different tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,255])},...s]};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]})));const e=await c.load(a);expect(d.getTokenInfosPayload).not.toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f6ff",chainId:1}),expect(d.getTokenInfosPayload).not.toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",chainId:1}),expect(e.type).toEqual("success")}),it("should ignore the token if value is not found",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.badtoken",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]})));const e=await c.load(a);expect(e.type).toEqual("success"),e.type==="success"&&(expect(e.filters["details.badtoken"]?.displayName).toEqual("Amount allowance"),expect(e.tokens).toEqual({}))})})});
2
+ //# sourceMappingURL=DefaultTypedDataContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport type { TypedDataDataSource } from \"@/typed-data/data/TypedDataDataSource\";\nimport { DefaultTypedDataContextLoader } from \"@/typed-data/domain/DefaultTypedDataContextLoader\";\n\ndescribe(\"TokenContextLoader\", () => {\n const mockTokenDataSource: TokenDataSource = {\n getTokenInfosPayload: jest.fn(),\n };\n const mockTypedDataDataSource: TypedDataDataSource = {\n getTypedDataFilters: jest.fn(),\n };\n const loader = new DefaultTypedDataContextLoader(\n mockTypedDataDataSource,\n mockTokenDataSource,\n );\n\n const TEST_TYPES = {\n PermitSingle: [\n {\n name: \"details\",\n type: \"PermitDetails\",\n },\n {\n name: \"spender\",\n type: \"address\",\n },\n {\n name: \"sigDeadline\",\n type: \"uint256\",\n },\n ],\n PermitDetails: [\n {\n type: \"address[]\",\n name: \"token\",\n },\n {\n name: \"amount\",\n type: \"uint160\",\n },\n {\n name: \"expiration\",\n type: \"uint48\",\n },\n {\n name: \"nonce\",\n type: \"uint48\",\n },\n ],\n EIP712Domain: [\n {\n name: \"name\",\n type: \"string\",\n },\n {\n name: \"chainId\",\n type: \"uint256\",\n },\n {\n name: \"verifyingContract\",\n type: \"address\",\n },\n ],\n };\n const TEST_VALUES = [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac, 0x25,\n 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0x19,\n ]),\n },\n {\n path: \"details.amount\",\n value: Uint8Array.from([0x12]),\n },\n {\n path: \"spender\",\n value: Uint8Array.from([0x12]),\n },\n {\n path: \"details.expiration\",\n value: Uint8Array.from([0x12]),\n },\n ];\n\n beforeEach(() => {\n jest.clearAllMocks();\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(({ address }) =>\n Promise.resolve(Right(`payload-${address}`)),\n );\n });\n\n describe(\"load function\", () => {\n it(\"success with referenced token\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 4,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n {\n type: \"amount\",\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n tokenIndex: 0,\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n },\n {\n type: \"raw\",\n displayName: \"Approve to spender\",\n path: \"spender\",\n signature:\n \"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb\",\n },\n {\n type: \"datetime\",\n displayName: \"Approval expire\",\n path: \"details.expiration\",\n signature:\n \"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 4,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {\n 0: \"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n },\n filters: {\n \"details.amount\": {\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n tokenIndex: 0,\n type: \"amount\",\n },\n \"details.expiration\": {\n displayName: \"Approval expire\",\n path: \"details.expiration\",\n signature:\n \"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b\",\n type: \"datetime\",\n },\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n spender: {\n displayName: \"Approve to spender\",\n path: \"spender\",\n signature:\n \"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb\",\n type: \"raw\",\n },\n },\n });\n });\n\n it(\"success with referenced token verifying contract\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n {\n type: \"amount\",\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n tokenIndex: 255,\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {\n 0: \"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n 255: \"payload-0x000000000022d473030f116ddee9f6b43ac78ba3\",\n },\n filters: {\n \"details.amount\": {\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n tokenIndex: 255,\n type: \"amount\",\n },\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n },\n });\n });\n\n it(\"should return an error if filters are unavailable\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() => Promise.resolve(Left(new Error(\"error\"))));\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"error\",\n error: new Error(\"error\"),\n });\n });\n\n it(\"success with unavailable tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(() =>\n Promise.resolve(Left(new Error(\"token error\"))),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {},\n filters: {\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n },\n });\n });\n\n it(\"success with several identic tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac,\n 0x25, 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0x19,\n ]),\n },\n ...TEST_VALUES,\n ],\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(() =>\n Promise.resolve(Left(new Error(\"token error\"))),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(mockTokenDataSource.getTokenInfosPayload).toHaveBeenCalledWith({\n address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n chainId: 1,\n });\n expect(result.type).toEqual(\"success\");\n });\n\n it(\"success with several different tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac,\n 0x25, 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0xff,\n ]),\n },\n ...TEST_VALUES,\n ],\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(mockTokenDataSource.getTokenInfosPayload).not.toHaveBeenCalledWith(\n { address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f6ff\", chainId: 1 },\n );\n expect(mockTokenDataSource.getTokenInfosPayload).not.toHaveBeenCalledWith(\n { address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\", chainId: 1 },\n );\n expect(result.type).toEqual(\"success\");\n });\n\n it(\"should ignore the token if value is not found\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.badtoken\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result.type).toEqual(\"success\");\n if (result.type === \"success\") {\n expect(result.filters[\"details.badtoken\"]?.[\"displayName\"]).toEqual(\n \"Amount allowance\",\n );\n expect(result.t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CA,EAAO,OAAS,YAClB,OAAOA,EAAO,QAAQ,kBAAkB,GAAI,WAAc,EAAE,QAC1D,kBACF,EACA,OAAOA,EAAO,MAAM,EAAE,QAAQ,CAAC,CAAC,EAEpC,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_purify_ts", "import_DefaultTypedDataContextLoader", "mockTokenDataSource", "mockTypedDataDataSource", "loader", "TEST_TYPES", "TEST_VALUES", "address", "ctx", "result"]
7
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=TypedDataContextLoader.js.map
1
+ "use strict";var d=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var C=(t,e,p,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of n(e))!y.call(t,a)&&a!==p&&d(t,a,{get:()=>e[a],enumerable:!(o=r(e,a))||o.enumerable});return t};var x=t=>C(d({},"__esModule",{value:!0}),t);var D={};module.exports=x(D);
2
+ //# sourceMappingURL=TypedDataContextLoader.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"TypedDataContextLoader.js","sourceRoot":"","sources":["../../../../../src/typed-data/domain/TypedDataContextLoader.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/typed-data/domain/TypedDataContextLoader.ts"],
4
+ "sourcesContent": ["import type { TypedDataClearSignContext } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\n\nexport interface TypedDataContextLoader {\n load(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TypedDataContextLoader_exports", "__toCommonJS"]
7
+ }
package/lib/esm/index.js CHANGED
@@ -1,4 +1,2 @@
1
- // inversify requirement
2
- import "reflect-metadata";
3
- export * from "./src/index";
4
- //# sourceMappingURL=index.js.map
1
+ import"reflect-metadata";export*from"./src/index";
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,kBAAkB,CAAC;AAE1B,cAAc,aAAa,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../index.ts"],
4
+ "sourcesContent": ["// inversify requirement\nimport \"reflect-metadata\";\n\nexport * from \"./src/index\";\n"],
5
+ "mappings": "AACA,MAAO,mBAEP,WAAc",
6
+ "names": []
7
+ }
@@ -1,63 +1,58 @@
1
1
  {
2
- "name": "@ledgerhq/context-module",
3
- "version": "0.1.0",
4
- "license": "MIT",
5
- "exports": {
6
- ".": {
7
- "import": "./lib/esm/index.js",
8
- "require": "./lib/cjs/index.js",
9
- "default": "./index.ts",
10
- "types": "./lib/esm/index.d.ts"
11
- },
12
- "./*.js": {
13
- "import": "./lib/esm/*.js",
14
- "require": "./lib/cjs/*.js",
15
- "default": "./*.js",
16
- "types": "./lib/esm/*.d.ts"
17
- },
18
- "./*": {
19
- "import": "./lib/esm/*",
20
- "require": "./lib/cjs/*",
21
- "default": "./*",
22
- "types": "./lib/esm/*"
23
- }
2
+ "name": "@ledgerhq/context-module",
3
+ "version": "1.1.0",
4
+ "private": false,
5
+ "license": "Apache-2.0",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./lib/types/index.d.ts",
9
+ "import": "./lib/esm/index.js",
10
+ "require": "./lib/cjs/index.js"
24
11
  },
25
- "files": [
26
- "./lib"
27
- ],
28
- "scripts": {
29
- "build": "rimraf lib && zx scripts/build.mjs",
30
- "dev": "concurrently \"pnpm dev:esm\" \"pnpm dev:cjs\"",
31
- "dev:esm": "concurrently \"tsc --watch -p tsconfig.esm.json\" \"tsc-alias --watch -p tsconfig.esm.json\"",
32
- "dev:cjs": "concurrently \"tsc --watch -p tsconfig.cjs.json\" \"tsc-alias --watch -p tsconfig.cjs.json\"",
33
- "lint": "eslint",
34
- "lint:fix": "pnpm lint --fix",
35
- "postpack": "find . -name '*.tgz' -exec cp {} ../../../dist/ \\; ",
36
- "prettier": "prettier . --check",
37
- "prettier:fix": "prettier . --write",
38
- "test": "jest",
39
- "test:watch": "pnpm test -- --watch",
40
- "test:coverage": "pnpm test -- --coverage",
41
- "typecheck": "tsc --noEmit"
42
- },
43
- "devDependencies": {
44
- "@ledgerhq/device-management-kit": "workspace:*",
45
- "@ledgerhq/eslint-config-dsdk": "workspace:*",
46
- "@ledgerhq/jest-config-dsdk": "workspace:*",
47
- "@ledgerhq/prettier-config-dsdk": "workspace:*",
48
- "@ledgerhq/tsconfig-dsdk": "workspace:*",
49
- "@types/crypto-js": "^4.2.2",
50
- "ts-node": "^10.9.2"
51
- },
52
- "dependencies": {
53
- "axios": "^1.7.7",
54
- "crypto-js": "^4.2.0",
55
- "ethers": "^6.13.2",
56
- "inversify": "^6.0.2",
57
- "purify-ts": "^2.1.0",
58
- "reflect-metadata": "^0.2.2"
59
- },
60
- "peerDependencies": {
61
- "@ledgerhq/device-management-kit": "workspace:*"
12
+ "./*": {
13
+ "types": "./lib/types/*",
14
+ "import": "./lib/esm/*",
15
+ "require": "./lib/cjs/*"
62
16
  }
17
+ },
18
+ "files": [
19
+ "./lib"
20
+ ],
21
+ "scripts": {
22
+ "prebuild": "rimraf lib",
23
+ "build": "pnpm lmdk-build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
24
+ "dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
25
+ "watch:builds": "pnpm lmdk-watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
26
+ "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\"",
27
+ "lint": "eslint",
28
+ "lint:fix": "pnpm lint --fix",
29
+ "postpack": "find . -name '*.tgz' -exec cp {} ../../../dist/ \\; ",
30
+ "prettier": "prettier . --check",
31
+ "prettier:fix": "prettier . --write",
32
+ "test": "jest",
33
+ "test:watch": "pnpm test -- --watch",
34
+ "test:coverage": "pnpm test -- --coverage",
35
+ "typecheck": "tsc --noEmit"
36
+ },
37
+ "devDependencies": {
38
+ "@ledgerhq/device-management-kit": "workspace:*",
39
+ "@ledgerhq/esbuild-tools": "workspace:*",
40
+ "@ledgerhq/eslint-config-dsdk": "workspace:*",
41
+ "@ledgerhq/jest-config-dsdk": "workspace:*",
42
+ "@ledgerhq/prettier-config-dsdk": "workspace:*",
43
+ "@ledgerhq/tsconfig-dsdk": "workspace:*",
44
+ "@types/crypto-js": "^4.2.2",
45
+ "ts-node": "^10.9.2"
46
+ },
47
+ "dependencies": {
48
+ "axios": "^1.7.9",
49
+ "crypto-js": "^4.2.0",
50
+ "ethers": "6.13.4",
51
+ "inversify": "^6.2.1",
52
+ "purify-ts": "^2.1.0",
53
+ "reflect-metadata": "^0.2.2"
54
+ },
55
+ "peerDependencies": {
56
+ "@ledgerhq/device-management-kit": "workspace:*"
57
+ }
63
58
  }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=ContextModule.js.map
1
+ //# sourceMappingURL=ContextModule.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"ContextModule.js","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,83 +1,2 @@
1
- import { externalPluginTypes } from "./external-plugin/di/externalPluginTypes";
2
- import { forwardDomainTypes } from "./forward-domain/di/forwardDomainTypes";
3
- import { nftTypes } from "./nft/di/nftTypes";
4
- import { tokenTypes } from "./token/di/tokenTypes";
5
- import { typedDataTypes } from "./typed-data/di/typedDataTypes";
6
- import { DefaultContextModule } from "./DefaultContextModule";
7
- import { makeContainer } from "./di";
8
- const DEFAULT_CAL_URL = "https://crypto-assets-service.api.ledger.com/v1";
9
- export const DEFAULT_CONFIG = {
10
- cal: {
11
- url: DEFAULT_CAL_URL,
12
- mode: "prod",
13
- branch: "main",
14
- },
15
- };
16
- export class ContextModuleBuilder {
17
- config = {};
18
- customLoaders = [];
19
- defaultLoaders = [];
20
- customTypedDataLoader;
21
- constructor() { }
22
- /**
23
- * Remove default loaders from the list of loaders
24
- *
25
- * @returns this
26
- */
27
- withoutDefaultLoaders() {
28
- this.defaultLoaders = [];
29
- return this;
30
- }
31
- /**
32
- * Add a custom loader to the list of loaders
33
- *
34
- * @param loader loader to add to the list of loaders
35
- * @returns this
36
- */
37
- addLoader(loader) {
38
- this.customLoaders.push(loader);
39
- return this;
40
- }
41
- /**
42
- * Replace the default loader for typed data clear signing contexts
43
- *
44
- * @returns this
45
- */
46
- withTypedDataLoader(loader) {
47
- this.customTypedDataLoader = loader;
48
- return this;
49
- }
50
- /**
51
- * Set the configuration for the context module
52
- *
53
- * @param config configuration for the context module
54
- * @returns this
55
- */
56
- withConfig(config) {
57
- this.config = config;
58
- return this;
59
- }
60
- /**
61
- * Build the context module
62
- *
63
- * @returns the context module
64
- */
65
- build() {
66
- const container = makeContainer({
67
- config: { ...DEFAULT_CONFIG, ...this.config },
68
- });
69
- this.defaultLoaders = [
70
- container.get(externalPluginTypes.ExternalPluginContextLoader),
71
- container.get(forwardDomainTypes.ForwardDomainContextLoader),
72
- container.get(nftTypes.NftContextLoader),
73
- container.get(tokenTypes.TokenContextLoader),
74
- ];
75
- const defaultTypedDataLoader = container.get(typedDataTypes.TypedDataContextLoader);
76
- const loaders = [...this.defaultLoaders, ...this.customLoaders];
77
- return new DefaultContextModule({
78
- loaders,
79
- typedDataLoader: this.customTypedDataLoader ?? defaultTypedDataLoader,
80
- });
81
- }
82
- }
83
- //# sourceMappingURL=ContextModuleBuilder.js.map
1
+ import{DefaultContextModule as e}from"./DefaultContextModule";const r="https://crypto-assets-service.api.ledger.com/v1",o={cal:{url:r,mode:"prod",branch:"main"},defaultLoaders:!0,customLoaders:[],customTypedDataLoader:void 0};class n{config=o;constructor(){}removeDefaultLoaders(){return this.config.defaultLoaders=!1,this}addLoader(t){return this.config.customLoaders.push(t),this}addTypedDataLoader(t){return this.config.customTypedDataLoader=t,this}addCalConfig(t){return this.config.cal={...o.cal,...t},this}build(){return new e(this.config)}}export{n as ContextModuleBuilder,o as DEFAULT_CONFIG};
2
+ //# sourceMappingURL=ContextModuleBuilder.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"ContextModuleBuilder.js","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAUhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAErC,MAAM,eAAe,GAAG,iDAAiD,CAAC;AAE1E,MAAM,CAAC,MAAM,cAAc,GAAwB;IACjD,GAAG,EAAE;QACH,GAAG,EAAE,eAAe;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;KACf;CACF,CAAC;AAEF,MAAM,OAAO,oBAAoB;IACvB,MAAM,GAAiC,EAAE,CAAC;IAC1C,aAAa,GAAoB,EAAE,CAAC;IACpC,cAAc,GAAoB,EAAE,CAAC;IACrC,qBAAqB,CAA0B;IAEvD,gBAAe,CAAC;IAEhB;;;;OAIG;IACH,qBAAqB;QACnB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,MAAqB;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAAC,MAA8B;QAChD,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,MAAoC;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,MAAM,SAAS,GAAG,aAAa,CAAC;YAC9B,MAAM,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE;SAC9C,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,GAAG;YACpB,SAAS,CAAC,GAAG,CACX,mBAAmB,CAAC,2BAA2B,CAChD;YACD,SAAS,CAAC,GAAG,CACX,kBAAkB,CAAC,0BAA0B,CAC9C;YACD,SAAS,CAAC,GAAG,CAAmB,QAAQ,CAAC,gBAAgB,CAAC;YAC1D,SAAS,CAAC,GAAG,CAAqB,UAAU,CAAC,kBAAkB,CAAC;SACjE,CAAC;QACF,MAAM,sBAAsB,GAAG,SAAS,CAAC,GAAG,CAC1C,cAAc,CAAC,sBAAsB,CACtC,CAAC;QAEF,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;QAChE,OAAO,IAAI,oBAAoB,CAAC;YAC9B,OAAO;YACP,eAAe,EAAE,IAAI,CAAC,qBAAqB,IAAI,sBAAsB;SACtE,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ContextModuleBuilder.ts"],
4
+ "sourcesContent": ["import {\n type ContextModuleCalConfig,\n type ContextModuleConfig,\n} from \"./config/model/ContextModuleConfig\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport { type TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\nconst DEFAULT_CAL_URL = \"https://crypto-assets-service.api.ledger.com/v1\";\n\nexport const DEFAULT_CONFIG: ContextModuleConfig = {\n cal: {\n url: DEFAULT_CAL_URL,\n mode: \"prod\",\n branch: \"main\",\n },\n defaultLoaders: true,\n customLoaders: [],\n customTypedDataLoader: undefined,\n};\n\nexport class ContextModuleBuilder {\n private config: ContextModuleConfig = DEFAULT_CONFIG;\n\n constructor() {}\n\n /**\n * Remove default loaders from the list of loaders\n *\n * @returns this\n */\n removeDefaultLoaders() {\n this.config.defaultLoaders = false;\n return this;\n }\n\n /**\n * Add a custom loader to the list of loaders\n *\n * @param loader loader to add to the list of loaders\n * @returns this\n */\n addLoader(loader: ContextLoader) {\n this.config.customLoaders.push(loader);\n return this;\n }\n\n /**\n * Replace the default loader for typed data clear signing contexts\n *\n * @param loader loader to use for typed data clear signing contexts\n * @returns this\n */\n addTypedDataLoader(loader: TypedDataContextLoader) {\n this.config.customTypedDataLoader = loader;\n return this;\n }\n\n /**\n * Add a custom CAL configuration\n *\n * @param calConfig\n * @returns this\n */\n addCalConfig(calConfig: ContextModuleCalConfig) {\n this.config.cal = { ...DEFAULT_CONFIG.cal, ...calConfig };\n return this;\n }\n\n /**\n * Build the context module\n *\n * @returns the context module\n */\n build(): ContextModule {\n return new DefaultContextModule(this.config);\n }\n}\n"],
5
+ "mappings": "AAOA,OAAS,wBAAAA,MAA4B,yBAErC,MAAMC,EAAkB,kDAEXC,EAAsC,CACjD,IAAK,CACH,IAAKD,EACL,KAAM,OACN,OAAQ,MACV,EACA,eAAgB,GAChB,cAAe,CAAC,EAChB,sBAAuB,MACzB,EAEO,MAAME,CAAqB,CACxB,OAA8BD,EAEtC,aAAc,CAAC,CAOf,sBAAuB,CACrB,YAAK,OAAO,eAAiB,GACtB,IACT,CAQA,UAAUE,EAAuB,CAC/B,YAAK,OAAO,cAAc,KAAKA,CAAM,EAC9B,IACT,CAQA,mBAAmBA,EAAgC,CACjD,YAAK,OAAO,sBAAwBA,EAC7B,IACT,CAQA,aAAaC,EAAmC,CAC9C,YAAK,OAAO,IAAM,CAAE,GAAGH,EAAe,IAAK,GAAGG,CAAU,EACjD,IACT,CAOA,OAAuB,CACrB,OAAO,IAAIL,EAAqB,KAAK,MAAM,CAC7C,CACF",
6
+ "names": ["DefaultContextModule", "DEFAULT_CAL_URL", "DEFAULT_CONFIG", "ContextModuleBuilder", "loader", "calConfig"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{ContextModuleBuilder as o}from"./ContextModuleBuilder";import{DefaultContextModule as d}from"./DefaultContextModule";describe("ContextModuleBuilder",()=>{const u={url:"https://crypto-assets-service.api.ledger.com/v1",mode:"prod",branch:"main"};it("should return a default context module",()=>{const e=new o().build();expect(e).toBeInstanceOf(d)}),it("should return a custom context module",()=>{const t=new o,e={load:jest.fn()},n=t.removeDefaultLoaders().addLoader(e).build();expect(n).toBeInstanceOf(d)}),it("should return a custom context module with a custom typed data loader",()=>{const t=new o,e={load:jest.fn()},n=t.removeDefaultLoaders().addTypedDataLoader(e).build();expect(n).toBeInstanceOf(d)}),it("should return a custom context module with a custom config",()=>{const e=new o().addCalConfig(u).build();expect(e).toBeInstanceOf(d)})});
2
+ //# sourceMappingURL=ContextModuleBuilder.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ContextModuleBuilder.test.ts"],
4
+ "sourcesContent": ["import { type ContextModuleCalConfig } from \"./config/model/ContextModuleConfig\";\nimport { ContextModuleBuilder } from \"./ContextModuleBuilder\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\ndescribe(\"ContextModuleBuilder\", () => {\n const defaultCalConfig: ContextModuleCalConfig = {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n };\n it(\"should return a default context module\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n\n const res = contextModuleBuilder.build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n const customLoader = { load: jest.fn() };\n\n const res = contextModuleBuilder\n .removeDefaultLoaders()\n .addLoader(customLoader)\n .build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module with a custom typed data loader\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n const customLoader = { load: jest.fn() };\n\n const res = contextModuleBuilder\n .removeDefaultLoaders()\n .addTypedDataLoader(customLoader)\n .build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module with a custom config\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n\n const res = contextModuleBuilder.addCalConfig(defaultCalConfig).build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n});\n"],
5
+ "mappings": "AACA,OAAS,wBAAAA,MAA4B,yBACrC,OAAS,wBAAAC,MAA4B,yBAErC,SAAS,uBAAwB,IAAM,CACrC,MAAMC,EAA2C,CAC/C,IAAK,kDACL,KAAM,OACN,OAAQ,MACV,EACA,GAAG,yCAA0C,IAAM,CAGjD,MAAMC,EAFuB,IAAIH,EAAqB,EAErB,MAAM,EAEvC,OAAOG,CAAG,EAAE,eAAeF,CAAoB,CACjD,CAAC,EAED,GAAG,wCAAyC,IAAM,CAChD,MAAMG,EAAuB,IAAIJ,EAC3BK,EAAe,CAAE,KAAM,KAAK,GAAG,CAAE,EAEjCF,EAAMC,EACT,qBAAqB,EACrB,UAAUC,CAAY,EACtB,MAAM,EAET,OAAOF,CAAG,EAAE,eAAeF,CAAoB,CACjD,CAAC,EAED,GAAG,wEAAyE,IAAM,CAChF,MAAMG,EAAuB,IAAIJ,EAC3BK,EAAe,CAAE,KAAM,KAAK,GAAG,CAAE,EAEjCF,EAAMC,EACT,qBAAqB,EACrB,mBAAmBC,CAAY,EAC/B,MAAM,EAET,OAAOF,CAAG,EAAE,eAAeF,CAAoB,CACjD,CAAC,EAED,GAAG,6DAA8D,IAAM,CAGrE,MAAME,EAFuB,IAAIH,EAAqB,EAErB,aAAaE,CAAgB,EAAE,MAAM,EAEtE,OAAOC,CAAG,EAAE,eAAeF,CAAoB,CACjD,CAAC,CACH,CAAC",
6
+ "names": ["ContextModuleBuilder", "DefaultContextModule", "defaultCalConfig", "res", "contextModuleBuilder", "customLoader"]
7
+ }
@@ -1,17 +1,2 @@
1
- export class DefaultContextModule {
2
- _loaders;
3
- _typedDataLoader;
4
- constructor(args) {
5
- this._loaders = args.loaders;
6
- this._typedDataLoader = args.typedDataLoader;
7
- }
8
- async getContexts(transaction) {
9
- const promises = this._loaders.map((fetcher) => fetcher.load(transaction));
10
- const responses = await Promise.all(promises);
11
- return responses.flat();
12
- }
13
- async getTypedDataFilters(typedData) {
14
- return this._typedDataLoader.load(typedData);
15
- }
16
- }
17
- //# sourceMappingURL=DefaultContextModule.js.map
1
+ import{transactionTypes as r}from"./transaction/di/transactionTypes";import{trustedNameTypes as n}from"./trusted-name/di/trustedNameTypes";import{externalPluginTypes as i}from"./external-plugin/di/externalPluginTypes";import{nftTypes as p}from"./nft/di/nftTypes";import{ClearSignContextType as d}from"./shared/model/ClearSignContext";import{tokenTypes as s}from"./token/di/tokenTypes";import{typedDataTypes as m}from"./typed-data/di/typedDataTypes";import{makeContainer as C}from"./di";class g{_container;_loaders;_typedDataLoader;constructor(t){this._container=C({config:t}),this._loaders=t.defaultLoaders?this._getDefaultLoaders():[],this._loaders.push(...t.customLoaders),this._typedDataLoader=t.customTypedDataLoader??this._getDefaultTypedDataLoader()}_getDefaultLoaders(){return[this._container.get(i.ExternalPluginContextLoader),this._container.get(n.TrustedNameContextLoader),this._container.get(p.NftContextLoader),this._container.get(s.TokenContextLoader),this._container.get(r.TransactionContextLoader)]}_getDefaultTypedDataLoader(){return this._container.get(m.TypedDataContextLoader)}async getContexts(t){const o=this._loaders.map(e=>e.load(t));return(await Promise.all(o)).flat()}async getContext(t){const o=this._loaders.filter(e=>e.loadField).map(e=>e.loadField(t));return(await Promise.all(o)).find(e=>e!==null)||{type:d.ERROR,error:new Error(`Field type not supported: ${t.type}`)}}async getTypedDataFilters(t){return this._typedDataLoader.load(t)}}export{g as DefaultContextModule};
2
+ //# sourceMappingURL=DefaultContextModule.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"DefaultContextModule.js","sourceRoot":"","sources":["../../../src/DefaultContextModule.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,oBAAoB;IACvB,QAAQ,CAAkB;IAC1B,gBAAgB,CAAyB;IAEjD,YAAY,IAAyC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,eAAe,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,WAAW,CACtB,WAA+B;QAE/B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC3E,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9C,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,SAA2B;QAE3B,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/DefaultContextModule.ts"],
4
+ "sourcesContent": ["import { type Container } from \"inversify\";\n\nimport type { TypedDataClearSignContext } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport { transactionTypes } from \"@/transaction/di/transactionTypes\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\n\nimport { type ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport { externalPluginTypes } from \"./external-plugin/di/externalPluginTypes\";\nimport { type ExternalPluginContextLoader } from \"./external-plugin/domain/ExternalPluginContextLoader\";\nimport { nftTypes } from \"./nft/di/nftTypes\";\nimport { type NftContextLoader } from \"./nft/domain/NftContextLoader\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport {\n type ClearSignContext,\n ClearSignContextType,\n} from \"./shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"./shared/model/TransactionContext\";\nimport { tokenTypes } from \"./token/di/tokenTypes\";\nimport { type TokenContextLoader } from \"./token/domain/TokenContextLoader\";\nimport { type TransactionContextLoader } from \"./transaction/domain/TransactionContextLoader\";\nimport { type TrustedNameContextLoader } from \"./trusted-name/domain/TrustedNameContextLoader\";\nimport { typedDataTypes } from \"./typed-data/di/typedDataTypes\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { makeContainer } from \"./di\";\n\nexport class DefaultContextModule implements ContextModule {\n private _container: Container;\n private _loaders: ContextLoader[];\n private _typedDataLoader: TypedDataContextLoader;\n\n constructor(args: ContextModuleConfig) {\n this._container = makeContainer({ config: args });\n this._loaders = args.defaultLoaders ? this._getDefaultLoaders() : [];\n this._loaders.push(...args.customLoaders);\n this._typedDataLoader =\n args.customTypedDataLoader ?? this._getDefaultTypedDataLoader();\n }\n\n private _getDefaultLoaders(): ContextLoader[] {\n return [\n this._container.get<ExternalPluginContextLoader>(\n externalPluginTypes.ExternalPluginContextLoader,\n ),\n this._container.get<TrustedNameContextLoader>(\n trustedNameTypes.TrustedNameContextLoader,\n ),\n this._container.get<NftContextLoader>(nftTypes.NftContextLoader),\n this._container.get<TokenContextLoader>(tokenTypes.TokenContextLoader),\n this._container.get<TransactionContextLoader>(\n transactionTypes.TransactionContextLoader,\n ),\n ];\n }\n\n private _getDefaultTypedDataLoader(): TypedDataContextLoader {\n return this._container.get<TypedDataContextLoader>(\n typedDataTypes.TypedDataContextLoader,\n );\n }\n\n public async getContexts(\n transaction: TransactionContext,\n ): Promise<ClearSignContext[]> {\n const promises = this._loaders.map((fetcher) => fetcher.load(transaction));\n const responses = await Promise.all(promises);\n return responses.flat();\n }\n\n public async getContext(\n field: TransactionFieldContext,\n ): Promise<ClearSignContext> {\n const promises = this._loaders\n .filter((fetcher) => fetcher.loadField)\n .map((fetcher) => fetcher.loadField!(field));\n const responses = await Promise.all(promises);\n return (\n responses.find((resp) => resp !== null) || {\n type: ClearSignContextType.ERROR,\n error: new Error(`Field type not supported: ${field.type}`),\n }\n );\n }\n\n public async getTypedDataFilters(\n typedData: TypedDataContext,\n ): Promise<TypedDataClearSignContext> {\n return this._typedDataLoader.load(typedData);\n }\n}\n"],
5
+ "mappings": "AAIA,OAAS,oBAAAA,MAAwB,oCACjC,OAAS,oBAAAC,MAAwB,qCAGjC,OAAS,uBAAAC,MAA2B,2CAEpC,OAAS,YAAAC,MAAgB,oBAGzB,OAEE,wBAAAC,MACK,kCAKP,OAAS,cAAAC,MAAkB,wBAI3B,OAAS,kBAAAC,MAAsB,iCAG/B,OAAS,iBAAAC,MAAqB,OAEvB,MAAMC,CAA8C,CACjD,WACA,SACA,iBAER,YAAYC,EAA2B,CACrC,KAAK,WAAaF,EAAc,CAAE,OAAQE,CAAK,CAAC,EAChD,KAAK,SAAWA,EAAK,eAAiB,KAAK,mBAAmB,EAAI,CAAC,EACnE,KAAK,SAAS,KAAK,GAAGA,EAAK,aAAa,EACxC,KAAK,iBACHA,EAAK,uBAAyB,KAAK,2BAA2B,CAClE,CAEQ,oBAAsC,CAC5C,MAAO,CACL,KAAK,WAAW,IACdP,EAAoB,2BACtB,EACA,KAAK,WAAW,IACdD,EAAiB,wBACnB,EACA,KAAK,WAAW,IAAsBE,EAAS,gBAAgB,EAC/D,KAAK,WAAW,IAAwBE,EAAW,kBAAkB,EACrE,KAAK,WAAW,IACdL,EAAiB,wBACnB,CACF,CACF,CAEQ,4BAAqD,CAC3D,OAAO,KAAK,WAAW,IACrBM,EAAe,sBACjB,CACF,CAEA,MAAa,YACXI,EAC6B,CAC7B,MAAMC,EAAW,KAAK,SAAS,IAAKC,GAAYA,EAAQ,KAAKF,CAAW,CAAC,EAEzE,OADkB,MAAM,QAAQ,IAAIC,CAAQ,GAC3B,KAAK,CACxB,CAEA,MAAa,WACXE,EAC2B,CAC3B,MAAMF,EAAW,KAAK,SACnB,OAAQC,GAAYA,EAAQ,SAAS,EACrC,IAAKA,GAAYA,EAAQ,UAAWC,CAAK,CAAC,EAE7C,OADkB,MAAM,QAAQ,IAAIF,CAAQ,GAEhC,KAAMG,GAASA,IAAS,IAAI,GAAK,CACzC,KAAMV,EAAqB,MAC3B,MAAO,IAAI,MAAM,6BAA6BS,EAAM,IAAI,EAAE,CAC5D,CAEJ,CAEA,MAAa,oBACXE,EACoC,CACpC,OAAO,KAAK,iBAAiB,KAAKA,CAAS,CAC7C,CACF",
6
+ "names": ["transactionTypes", "trustedNameTypes", "externalPluginTypes", "nftTypes", "ClearSignContextType", "tokenTypes", "typedDataTypes", "makeContainer", "DefaultContextModule", "args", "transaction", "promises", "fetcher", "field", "resp", "typedData"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{DefaultContextModule as a}from"./DefaultContextModule";const l=()=>({load:jest.fn(),loadField:jest.fn()});describe("DefaultContextModule",()=>{const s={load:jest.fn()},o={customLoaders:[],defaultLoaders:!1,customTypedDataLoader:s,cal:{url:"https://crypto-assets-service.api.ledger.com/v1",mode:"prod",branch:"main"}};beforeEach(()=>{jest.restoreAllMocks()}),it("should initialize the context module with all the default loaders",async()=>{const t=await new a(o).getContexts({});expect(t).toEqual([])}),it("should return an empty array when no loaders",async()=>{const t=await new a(o).getContexts({});expect(t).toEqual([])}),it("should call all fetch method from metadata fetcher",async()=>{const e=l();await new a({...o,customLoaders:[e,e]}).getContexts({}),expect(e.load).toHaveBeenCalledTimes(2)}),it("should return an array of context response",async()=>{const e=l(),t=[[{type:"provideERC20Info",payload:"payload1"}],[{type:"provideERC20Info",payload:"payload2"},{type:"plugin",payload:"payload3"}]];jest.spyOn(e,"load").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new a({...o,customLoaders:[e,e]}).getContexts({});expect(e.load).toHaveBeenCalledTimes(2),expect(n).toEqual(t.flat())}),it("should call the typed data loader",async()=>{await new a({...o,customTypedDataLoader:s}).getTypedDataFilters({}),expect(s.load).toHaveBeenCalledTimes(1)}),it("should return a single context",async()=>{const e=l(),t=[null,{type:"token",payload:"payload"}];jest.spyOn(e,"loadField").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new a({...o,customLoaders:[e,{load:jest.fn()},e]}).getContext({type:"token"});expect(e.loadField).toHaveBeenCalledTimes(2),expect(n).toEqual({type:"token",payload:"payload"})}),it("context field not supported",async()=>{const e=l(),t=[null,null];jest.spyOn(e,"loadField").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new a({...o,customLoaders:[e,{load:jest.fn()},e]}).getContext({type:"token"});expect(e.loadField).toHaveBeenCalledTimes(2),expect(n).toEqual({type:"error",error:new Error("Field type not supported: token")})}),it("getField not implemented",async()=>{const t=await new a({...o,customLoaders:[{load:jest.fn()}]}).getContext({type:"token"});expect(t).toEqual({type:"error",error:new Error("Field type not supported: token")})})});
2
+ //# sourceMappingURL=DefaultContextModule.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/DefaultContextModule.test.ts"],
4
+ "sourcesContent": ["import { type ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"./shared/model/TransactionContext\";\nimport { type TypedDataContext } from \"./shared/model/TypedDataContext\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\nconst contextLoaderStubBuilder = () => {\n return { load: jest.fn(), loadField: jest.fn() };\n};\n\ndescribe(\"DefaultContextModule\", () => {\n const typedDataLoader: TypedDataContextLoader = { load: jest.fn() };\n const defaultContextModuleConfig: ContextModuleConfig = {\n customLoaders: [],\n defaultLoaders: false,\n customTypedDataLoader: typedDataLoader,\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n },\n };\n\n beforeEach(() => {\n jest.restoreAllMocks();\n });\n\n it(\"should initialize the context module with all the default loaders\", async () => {\n const contextModule = new DefaultContextModule(defaultContextModuleConfig);\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(res).toEqual([]);\n });\n\n it(\"should return an empty array when no loaders\", async () => {\n const contextModule = new DefaultContextModule(defaultContextModuleConfig);\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(res).toEqual([]);\n });\n\n it(\"should call all fetch method from metadata fetcher\", async () => {\n const loader = contextLoaderStubBuilder();\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, loader],\n });\n\n await contextModule.getContexts({} as TransactionContext);\n\n expect(loader.load).toHaveBeenCalledTimes(2);\n });\n\n it(\"should return an array of context response\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [\n [{ type: \"provideERC20Info\", payload: \"payload1\" }],\n [\n { type: \"provideERC20Info\", payload: \"payload2\" },\n { type: \"plugin\", payload: \"payload3\" },\n ],\n ];\n jest\n .spyOn(loader, \"load\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, loader],\n });\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(loader.load).toHaveBeenCalledTimes(2);\n expect(res).toEqual(responses.flat());\n });\n\n it(\"should call the typed data loader\", async () => {\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customTypedDataLoader: typedDataLoader,\n });\n\n await contextModule.getTypedDataFilters({} as TypedDataContext);\n\n expect(typedDataLoader.load).toHaveBeenCalledTimes(1);\n });\n\n it(\"should return a single context\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [null, { type: \"token\", payload: \"payload\" }];\n jest\n .spyOn(loader, \"loadField\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, { load: jest.fn() }, loader],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(loader.loadField).toHaveBeenCalledTimes(2);\n expect(res).toEqual({ type: \"token\", payload: \"payload\" });\n });\n\n it(\"context field not supported\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [null, null];\n jest\n .spyOn(loader, \"loadField\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, { load: jest.fn() }, loader],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(loader.loadField).toHaveBeenCalledTimes(2);\n expect(res).toEqual({\n type: \"error\",\n error: new Error(\"Field type not supported: token\"),\n });\n });\n\n it(\"getField not implemented\", async () => {\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [{ load: jest.fn() }],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(res).toEqual({\n type: \"error\",\n error: new Error(\"Field type not supported: token\"),\n });\n });\n});\n"],
5
+ "mappings": "AAOA,OAAS,wBAAAA,MAA4B,yBAErC,MAAMC,EAA2B,KACxB,CAAE,KAAM,KAAK,GAAG,EAAG,UAAW,KAAK,GAAG,CAAE,GAGjD,SAAS,uBAAwB,IAAM,CACrC,MAAMC,EAA0C,CAAE,KAA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,CAAC,EAED,GAAG,2BAA4B,SAAY,CAMzC,MAAMA,EAAM,MALU,IAAIJ,EAAqB,CAC7C,GAAGG,EACH,cAAe,CAAC,CAAE,KAAM,KAAK,GAAG,CAAE,CAAC,CACrC,CAAC,EAE+B,WAAW,CACzC,KAAM,OACR,CAA4B,EAE5B,OAAOC,CAAG,EAAE,QAAQ,CAClB,KAAM,QACN,MAAO,IAAI,MAAM,iCAAiC,CACpD,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["DefaultContextModule", "contextLoaderStubBuilder", "typedDataLoader", "defaultContextModuleConfig", "res", "loader", "responses"]
7
+ }
@@ -1,6 +1,2 @@
1
- import { ContainerModule } from "inversify";
2
- import { configTypes } from "./configTypes";
3
- export const configModuleFactory = (config) => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
4
- bind(configTypes.Config).toConstantValue(config);
5
- });
6
- //# sourceMappingURL=configModuleFactory.js.map
1
+ import{ContainerModule as t}from"inversify";import{configTypes as e}from"./configTypes";const u=o=>new t((n,i,r,f)=>{n(e.Config).toConstantValue(o)});export{u as configModuleFactory};
2
+ //# sourceMappingURL=configModuleFactory.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"configModuleFactory.js","sourceRoot":"","sources":["../../../../../src/config/di/configModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAI5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAA2B,EAAE,EAAE,CACjE,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAsB,WAAW,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/config/di/configModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\n\nimport { configTypes } from \"./configTypes\";\n\nexport const configModuleFactory = (config: ContextModuleConfig) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind<ContextModuleConfig>(configTypes.Config).toConstantValue(config);\n });\n"],
5
+ "mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAIhC,OAAS,eAAAC,MAAmB,gBAErB,MAAMC,EAAuBC,GAClC,IAAIH,EAAgB,CAACI,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAA0BH,EAAY,MAAM,EAAE,gBAAgBE,CAAM,CACtE,CAAC",
6
+ "names": ["ContainerModule", "configTypes", "configModuleFactory", "config", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -1,4 +1,2 @@
1
- export const configTypes = {
2
- Config: Symbol.for("config"),
3
- };
4
- //# sourceMappingURL=configTypes.js.map
1
+ const o={Config:Symbol.for("config")};export{o as configTypes};
2
+ //# sourceMappingURL=configTypes.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"configTypes.js","sourceRoot":"","sources":["../../../../../src/config/di/configTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;CAC7B,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/config/di/configTypes.ts"],
4
+ "sourcesContent": ["export const configTypes = {\n Config: Symbol.for(\"config\"),\n};\n"],
5
+ "mappings": "AAAO,MAAMA,EAAc,CACzB,OAAQ,OAAO,IAAI,QAAQ,CAC7B",
6
+ "names": ["configTypes"]
7
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=ContextModuleConfig.js.map
1
+ //# sourceMappingURL=ContextModuleConfig.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"ContextModuleConfig.js","sourceRoot":"","sources":["../../../../../src/config/model/ContextModuleConfig.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/lib/esm/src/di.js CHANGED
@@ -1,13 +1,2 @@
1
- import { Container } from "inversify";
2
- import { configModuleFactory } from "./config/di/configModuleFactory";
3
- import { externalPluginModuleFactory } from "./external-plugin/di/externalPluginModuleFactory";
4
- import { forwardDomainModuleFactory } from "./forward-domain/di/forwardDomainModuleFactory";
5
- import { nftModuleFactory } from "./nft/di/nftModuleFactory";
6
- import { tokenModuleFactory } from "./token/di/tokenModuleFactory";
7
- import { typedDataModuleFactory } from "./typed-data/di/typedDataModuleFactory";
8
- export const makeContainer = ({ config }) => {
9
- const container = new Container();
10
- container.load(configModuleFactory(config), externalPluginModuleFactory(), forwardDomainModuleFactory(), nftModuleFactory(), tokenModuleFactory(), typedDataModuleFactory());
11
- return container;
12
- };
13
- //# sourceMappingURL=di.js.map
1
+ import{Container as r}from"inversify";import{configModuleFactory as e}from"./config/di/configModuleFactory";import{externalPluginModuleFactory as n}from"./external-plugin/di/externalPluginModuleFactory";import{nftModuleFactory as a}from"./nft/di/nftModuleFactory";import{tokenModuleFactory as i}from"./token/di/tokenModuleFactory";import{transactionModuleFactory as m}from"./transaction/di/transactionModuleFactory";import{trustedNameModuleFactory as f}from"./trusted-name/di/trustedNameModuleFactory";import{typedDataModuleFactory as c}from"./typed-data/di/typedDataModuleFactory";const F=({config:t})=>{const o=new r;return o.load(e(t),n(),a(),i(),m(),f(),c()),o};export{F as makeContainer};
2
+ //# sourceMappingURL=di.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"di.js","sourceRoot":"","sources":["../../../src/di.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAMhF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAqB,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;IAElC,SAAS,CAAC,IAAI,CACZ,mBAAmB,CAAC,MAAM,CAAC,EAC3B,2BAA2B,EAAE,EAC7B,0BAA0B,EAAE,EAC5B,gBAAgB,EAAE,EAClB,kBAAkB,EAAE,EACpB,sBAAsB,EAAE,CACzB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/di.ts"],
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { transactionModuleFactory } from \"@/transaction/di/transactionModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container.load(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n nftModuleFactory(),\n tokenModuleFactory(),\n transactionModuleFactory(),\n trustedNameModuleFactory(),\n typedDataModuleFactory(),\n );\n\n return container;\n};\n"],
5
+ "mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,uBAAAC,MAA2B,kCAEpC,OAAS,+BAAAC,MAAmC,mDAC5C,OAAS,oBAAAC,MAAwB,4BACjC,OAAS,sBAAAC,MAA0B,gCACnC,OAAS,4BAAAC,MAAgC,4CACzC,OAAS,4BAAAC,MAAgC,6CACzC,OAAS,0BAAAC,MAA8B,yCAMhC,MAAMC,EAAgB,CAAC,CAAE,OAAAC,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAIV,EAEtB,OAAAU,EAAU,KACRT,EAAoBQ,CAAM,EAC1BP,EAA4B,EAC5BC,EAAiB,EACjBC,EAAmB,EACnBC,EAAyB,EACzBC,EAAyB,EACzBC,EAAuB,CACzB,EAEOG,CACT",
6
+ "names": ["Container", "configModuleFactory", "externalPluginModuleFactory", "nftModuleFactory", "tokenModuleFactory", "transactionModuleFactory", "trustedNameModuleFactory", "typedDataModuleFactory", "makeContainer", "config", "container"]
7
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=DAppDto.js.map
1
+ //# sourceMappingURL=DAppDto.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"DAppDto.js","sourceRoot":"","sources":["../../../../../src/external-plugin/data/DAppDto.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=ExternalPluginDataSource.js.map
1
+ //# sourceMappingURL=ExternalPluginDataSource.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"ExternalPluginDataSource.js","sourceRoot":"","sources":["../../../../../src/external-plugin/data/ExternalPluginDataSource.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }