@ledgerhq/context-module 1.0.0 → 1.1.0

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 (571) hide show
  1. package/README.md +4 -6
  2. package/lib/cjs/index.js +2 -20
  3. package/lib/cjs/index.js.map +7 -1
  4. package/lib/cjs/package.json +53 -59
  5. package/lib/cjs/src/ContextModule.js +2 -3
  6. package/lib/cjs/src/ContextModule.js.map +7 -1
  7. package/lib/cjs/src/ContextModuleBuilder.js +2 -87
  8. package/lib/cjs/src/ContextModuleBuilder.js.map +7 -1
  9. package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
  10. package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
  11. package/lib/cjs/src/DefaultContextModule.js +2 -21
  12. package/lib/cjs/src/DefaultContextModule.js.map +7 -1
  13. package/lib/cjs/src/DefaultContextModule.test.js +2 -0
  14. package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
  15. package/lib/cjs/src/config/di/configModuleFactory.js +2 -10
  16. package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -1
  17. package/lib/cjs/src/config/di/configTypes.js +2 -7
  18. package/lib/cjs/src/config/di/configTypes.js.map +7 -1
  19. package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -3
  20. package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -1
  21. package/lib/cjs/src/di.js +2 -17
  22. package/lib/cjs/src/di.js.map +7 -1
  23. package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -3
  24. package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -1
  25. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -3
  26. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
  27. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -83
  28. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
  29. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  30. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  31. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -13
  32. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
  33. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -8
  34. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -1
  35. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -136
  36. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
  37. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  38. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  39. package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -3
  40. package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -1
  41. package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -3
  42. package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -1
  43. package/lib/cjs/src/index.js +2 -30
  44. package/lib/cjs/src/index.js.map +7 -1
  45. package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -57
  46. package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -1
  47. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
  48. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  49. package/lib/cjs/src/nft/data/NftDataSource.js +2 -3
  50. package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -1
  51. package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -13
  52. package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -1
  53. package/lib/cjs/src/nft/di/nftTypes.js +2 -8
  54. package/lib/cjs/src/nft/di/nftTypes.js.map +7 -1
  55. package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -111
  56. package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -1
  57. package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
  58. package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
  59. package/lib/cjs/src/shared/domain/ContextLoader.js +2 -3
  60. package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -1
  61. package/lib/cjs/src/shared/model/ClearSignContext.js +2 -13
  62. package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -1
  63. package/lib/cjs/src/shared/model/GenericPath.js +2 -0
  64. package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
  65. package/lib/cjs/src/shared/model/TransactionContext.js +2 -3
  66. package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -1
  67. package/lib/cjs/src/shared/model/TransactionSubset.js +2 -3
  68. package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -1
  69. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -6
  70. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -1
  71. package/lib/cjs/src/shared/model/TypedDataContext.js +2 -3
  72. package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -1
  73. package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -15
  74. package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -1
  75. package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -83
  76. package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -1
  77. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
  78. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  79. package/lib/cjs/src/token/data/TokenDataSource.js +2 -3
  80. package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -1
  81. package/lib/cjs/src/token/data/TokenDto.js +2 -3
  82. package/lib/cjs/src/token/data/TokenDto.js.map +7 -1
  83. package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -13
  84. package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -1
  85. package/lib/cjs/src/token/di/tokenTypes.js +2 -8
  86. package/lib/cjs/src/token/di/tokenTypes.js.map +7 -1
  87. package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -74
  88. package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -1
  89. package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
  90. package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
  91. package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
  92. package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
  93. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
  94. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  95. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  96. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  97. package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
  98. package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
  99. package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
  100. package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
  101. package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
  102. package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
  103. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
  104. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  105. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  106. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  107. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  108. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  109. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  110. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  111. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
  112. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  113. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
  114. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  115. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  116. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  117. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
  118. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  119. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  120. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  121. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  122. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  123. package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -3
  124. package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -1
  125. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -163
  126. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
  127. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  128. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  129. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -3
  130. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -1
  131. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -13
  132. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
  133. package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -8
  134. package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -1
  135. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -127
  136. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
  137. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  138. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  139. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -3
  140. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
  141. package/lib/esm/index.js +2 -4
  142. package/lib/esm/index.js.map +7 -1
  143. package/lib/esm/package.json +53 -59
  144. package/lib/esm/src/ContextModule.js +1 -2
  145. package/lib/esm/src/ContextModule.js.map +7 -1
  146. package/lib/esm/src/ContextModuleBuilder.js +2 -83
  147. package/lib/esm/src/ContextModuleBuilder.js.map +7 -1
  148. package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
  149. package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
  150. package/lib/esm/src/DefaultContextModule.js +2 -17
  151. package/lib/esm/src/DefaultContextModule.js.map +7 -1
  152. package/lib/esm/src/DefaultContextModule.test.js +2 -0
  153. package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
  154. package/lib/esm/src/config/di/configModuleFactory.js +2 -6
  155. package/lib/esm/src/config/di/configModuleFactory.js.map +7 -1
  156. package/lib/esm/src/config/di/configTypes.js +2 -4
  157. package/lib/esm/src/config/di/configTypes.js.map +7 -1
  158. package/lib/esm/src/config/model/ContextModuleConfig.js +1 -2
  159. package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -1
  160. package/lib/esm/src/di.js +2 -13
  161. package/lib/esm/src/di.js.map +7 -1
  162. package/lib/esm/src/external-plugin/data/DAppDto.js +1 -2
  163. package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -1
  164. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -2
  165. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
  166. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -77
  167. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
  168. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  169. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  170. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -9
  171. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
  172. package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -5
  173. package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -1
  174. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -133
  175. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
  176. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  177. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  178. package/lib/esm/src/external-plugin/model/DappInfos.js +1 -2
  179. package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -1
  180. package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -2
  181. package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -1
  182. package/lib/esm/src/index.js +2 -14
  183. package/lib/esm/src/index.js.map +7 -1
  184. package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -51
  185. package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -1
  186. package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
  187. package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  188. package/lib/esm/src/nft/data/NftDataSource.js +1 -2
  189. package/lib/esm/src/nft/data/NftDataSource.js.map +7 -1
  190. package/lib/esm/src/nft/di/nftModuleFactory.js +2 -9
  191. package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -1
  192. package/lib/esm/src/nft/di/nftTypes.js +2 -5
  193. package/lib/esm/src/nft/di/nftTypes.js.map +7 -1
  194. package/lib/esm/src/nft/domain/NftContextLoader.js +2 -108
  195. package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -1
  196. package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
  197. package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
  198. package/lib/esm/src/shared/domain/ContextLoader.js +1 -2
  199. package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -1
  200. package/lib/esm/src/shared/model/ClearSignContext.js +2 -10
  201. package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -1
  202. package/lib/esm/src/shared/model/GenericPath.js +2 -0
  203. package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
  204. package/lib/esm/src/shared/model/TransactionContext.js +1 -2
  205. package/lib/esm/src/shared/model/TransactionContext.js.map +7 -1
  206. package/lib/esm/src/shared/model/TransactionSubset.js +1 -2
  207. package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -1
  208. package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -3
  209. package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -1
  210. package/lib/esm/src/shared/model/TypedDataContext.js +1 -2
  211. package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -1
  212. package/lib/esm/src/shared/utils/HexStringUtils.js +2 -11
  213. package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -1
  214. package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -77
  215. package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -1
  216. package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
  217. package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  218. package/lib/esm/src/token/data/TokenDataSource.js +1 -2
  219. package/lib/esm/src/token/data/TokenDataSource.js.map +7 -1
  220. package/lib/esm/src/token/data/TokenDto.js +1 -2
  221. package/lib/esm/src/token/data/TokenDto.js.map +7 -1
  222. package/lib/esm/src/token/di/tokenModuleFactory.js +2 -9
  223. package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -1
  224. package/lib/esm/src/token/di/tokenTypes.js +2 -5
  225. package/lib/esm/src/token/di/tokenTypes.js.map +7 -1
  226. package/lib/esm/src/token/domain/TokenContextLoader.js +2 -71
  227. package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -1
  228. package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
  229. package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
  230. package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
  231. package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
  232. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
  233. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  234. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  235. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  236. package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
  237. package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
  238. package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
  239. package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
  240. package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
  241. package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
  242. package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
  243. package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  244. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  245. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  246. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  247. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  248. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  249. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  250. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
  251. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  252. package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
  253. package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  254. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  255. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  256. package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
  257. package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  258. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  259. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  260. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  261. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  262. package/lib/esm/src/typed-data/data/FiltersDto.js +1 -2
  263. package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -1
  264. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -157
  265. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
  266. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  267. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  268. package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -2
  269. package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -1
  270. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -9
  271. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
  272. package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -5
  273. package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -1
  274. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -124
  275. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
  276. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  277. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  278. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -2
  279. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
  280. package/lib/{cjs → types}/src/ContextModule.d.ts +3 -2
  281. package/lib/types/src/ContextModule.d.ts.map +1 -0
  282. package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +9 -11
  283. package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -0
  284. package/lib/types/src/ContextModuleBuilder.test.d.ts +2 -0
  285. package/lib/types/src/ContextModuleBuilder.test.d.ts.map +1 -0
  286. package/lib/types/src/DefaultContextModule.d.ts +18 -0
  287. package/lib/types/src/DefaultContextModule.d.ts.map +1 -0
  288. package/lib/types/src/DefaultContextModule.test.d.ts +2 -0
  289. package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
  290. package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +1 -1
  291. package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts.map +1 -1
  292. package/lib/types/src/config/model/ContextModuleConfig.d.ts +16 -0
  293. package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -0
  294. package/lib/{cjs → types}/src/di.d.ts +1 -1
  295. package/lib/types/src/di.d.ts.map +1 -0
  296. package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
  297. package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -0
  298. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts +2 -0
  299. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts.map +1 -0
  300. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts +2 -0
  301. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts.map +1 -0
  302. package/lib/types/src/external-plugin/model/DappInfos.d.ts +6 -0
  303. package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -0
  304. package/lib/{cjs → types}/src/index.d.ts +3 -1
  305. package/lib/types/src/index.d.ts.map +1 -0
  306. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts +2 -0
  307. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts.map +1 -0
  308. package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts +1 -1
  309. package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -0
  310. package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts +2 -1
  311. package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -0
  312. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts +2 -0
  313. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts.map +1 -0
  314. package/lib/types/src/shared/domain/ContextLoader.d.ts +7 -0
  315. package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -0
  316. package/lib/types/src/shared/model/ClearSignContext.d.ts +40 -0
  317. package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -0
  318. package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
  319. package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
  320. package/lib/types/src/shared/model/TransactionContext.d.ts +19 -0
  321. package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -0
  322. package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
  323. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
  324. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
  325. package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +1 -1
  326. package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -0
  327. package/lib/types/src/token/data/TokenDto.d.ts +16 -0
  328. package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
  329. package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +2 -1
  330. package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -0
  331. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
  332. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
  333. package/lib/types/src/transaction/data/CalldataDto.d.ts +117 -0
  334. package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
  335. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +19 -0
  336. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
  337. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
  338. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
  339. package/lib/types/src/transaction/data/TransactionDataSource.d.ts +12 -0
  340. package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
  341. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
  342. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
  343. package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
  344. package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
  345. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
  346. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
  347. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
  348. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
  349. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
  350. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
  351. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
  352. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
  353. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
  354. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
  355. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
  356. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
  357. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
  358. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
  359. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
  360. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
  361. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
  362. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
  363. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
  364. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
  365. package/lib/{cjs → types}/src/typed-data/data/FiltersDto.d.ts +3 -0
  366. package/lib/types/src/typed-data/data/FiltersDto.d.ts.map +1 -0
  367. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -0
  368. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +3 -0
  369. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -0
  370. package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
  371. package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -0
  372. package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
  373. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
  374. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
  375. package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
  376. package/package.json +21 -27
  377. package/lib/cjs/src/ContextModule.d.ts.map +0 -1
  378. package/lib/cjs/src/ContextModuleBuilder.d.ts.map +0 -1
  379. package/lib/cjs/src/DefaultContextModule.d.ts +0 -20
  380. package/lib/cjs/src/DefaultContextModule.d.ts.map +0 -1
  381. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts +0 -9
  382. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  383. package/lib/cjs/src/di.d.ts.map +0 -1
  384. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  385. package/lib/cjs/src/external-plugin/model/DappInfos.d.ts +0 -6
  386. package/lib/cjs/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  387. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  388. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  389. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js +0 -3
  390. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  391. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  392. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  393. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -40
  394. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  395. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  396. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  397. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js +0 -13
  398. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  399. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  400. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  401. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js +0 -8
  402. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  403. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  404. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  405. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -66
  406. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  407. package/lib/cjs/src/index.d.ts.map +0 -1
  408. package/lib/cjs/src/nft/data/NftDataSource.d.ts.map +0 -1
  409. package/lib/cjs/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  410. package/lib/cjs/src/shared/domain/ContextLoader.d.ts +0 -6
  411. package/lib/cjs/src/shared/domain/ContextLoader.d.ts.map +0 -1
  412. package/lib/cjs/src/shared/model/ClearSignContext.d.ts +0 -21
  413. package/lib/cjs/src/shared/model/ClearSignContext.d.ts.map +0 -1
  414. package/lib/cjs/src/shared/model/TransactionContext.d.ts +0 -6
  415. package/lib/cjs/src/shared/model/TransactionContext.d.ts.map +0 -1
  416. package/lib/cjs/src/token/data/TokenDataSource.d.ts.map +0 -1
  417. package/lib/cjs/src/token/data/TokenDto.d.ts +0 -6
  418. package/lib/cjs/src/token/data/TokenDto.d.ts.map +0 -1
  419. package/lib/cjs/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  420. package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  421. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  422. package/lib/cjs/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  423. package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  424. package/lib/esm/index.d.ts +0 -3
  425. package/lib/esm/index.d.ts.map +0 -1
  426. package/lib/esm/src/ContextModule.d.ts +0 -9
  427. package/lib/esm/src/ContextModule.d.ts.map +0 -1
  428. package/lib/esm/src/ContextModuleBuilder.d.ts +0 -45
  429. package/lib/esm/src/ContextModuleBuilder.d.ts.map +0 -1
  430. package/lib/esm/src/DefaultContextModule.d.ts +0 -20
  431. package/lib/esm/src/DefaultContextModule.d.ts.map +0 -1
  432. package/lib/esm/src/config/di/configModuleFactory.d.ts +0 -4
  433. package/lib/esm/src/config/di/configModuleFactory.d.ts.map +0 -1
  434. package/lib/esm/src/config/di/configTypes.d.ts +0 -4
  435. package/lib/esm/src/config/di/configTypes.d.ts.map +0 -1
  436. package/lib/esm/src/config/model/ContextModuleConfig.d.ts +0 -9
  437. package/lib/esm/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  438. package/lib/esm/src/di.d.ts +0 -8
  439. package/lib/esm/src/di.d.ts.map +0 -1
  440. package/lib/esm/src/external-plugin/data/DAppDto.d.ts +0 -38
  441. package/lib/esm/src/external-plugin/data/DAppDto.d.ts.map +0 -1
  442. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -12
  443. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  444. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -10
  445. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -1
  446. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -3
  447. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -1
  448. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts +0 -5
  449. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -1
  450. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -15
  451. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -1
  452. package/lib/esm/src/external-plugin/model/DappInfos.d.ts +0 -6
  453. package/lib/esm/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  454. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts +0 -8
  455. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts.map +0 -1
  456. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  457. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  458. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js +0 -2
  459. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  460. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  461. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  462. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -34
  463. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  464. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  465. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  466. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js +0 -9
  467. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  468. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  469. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  470. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js +0 -5
  471. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  472. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  473. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  474. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -63
  475. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  476. package/lib/esm/src/index.d.ts +0 -14
  477. package/lib/esm/src/index.d.ts.map +0 -1
  478. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts +0 -7
  479. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts.map +0 -1
  480. package/lib/esm/src/nft/data/NftDataSource.d.ts +0 -15
  481. package/lib/esm/src/nft/data/NftDataSource.d.ts.map +0 -1
  482. package/lib/esm/src/nft/di/nftModuleFactory.d.ts +0 -3
  483. package/lib/esm/src/nft/di/nftModuleFactory.d.ts.map +0 -1
  484. package/lib/esm/src/nft/di/nftTypes.d.ts +0 -5
  485. package/lib/esm/src/nft/di/nftTypes.d.ts.map +0 -1
  486. package/lib/esm/src/nft/domain/NftContextLoader.d.ts +0 -11
  487. package/lib/esm/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  488. package/lib/esm/src/shared/domain/ContextLoader.d.ts +0 -6
  489. package/lib/esm/src/shared/domain/ContextLoader.d.ts.map +0 -1
  490. package/lib/esm/src/shared/model/ClearSignContext.d.ts +0 -21
  491. package/lib/esm/src/shared/model/ClearSignContext.d.ts.map +0 -1
  492. package/lib/esm/src/shared/model/TransactionContext.d.ts +0 -6
  493. package/lib/esm/src/shared/model/TransactionContext.d.ts.map +0 -1
  494. package/lib/esm/src/shared/model/TransactionSubset.d.ts +0 -6
  495. package/lib/esm/src/shared/model/TransactionSubset.d.ts.map +0 -1
  496. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts +0 -33
  497. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -1
  498. package/lib/esm/src/shared/model/TypedDataContext.d.ts +0 -16
  499. package/lib/esm/src/shared/model/TypedDataContext.d.ts.map +0 -1
  500. package/lib/esm/src/shared/utils/HexStringUtils.d.ts +0 -4
  501. package/lib/esm/src/shared/utils/HexStringUtils.d.ts.map +0 -1
  502. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts +0 -9
  503. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts.map +0 -1
  504. package/lib/esm/src/token/data/TokenDataSource.d.ts +0 -9
  505. package/lib/esm/src/token/data/TokenDataSource.d.ts.map +0 -1
  506. package/lib/esm/src/token/data/TokenDto.d.ts +0 -6
  507. package/lib/esm/src/token/data/TokenDto.d.ts.map +0 -1
  508. package/lib/esm/src/token/di/tokenModuleFactory.d.ts +0 -3
  509. package/lib/esm/src/token/di/tokenModuleFactory.d.ts.map +0 -1
  510. package/lib/esm/src/token/di/tokenTypes.d.ts +0 -5
  511. package/lib/esm/src/token/di/tokenTypes.d.ts.map +0 -1
  512. package/lib/esm/src/token/domain/TokenContextLoader.d.ts +0 -15
  513. package/lib/esm/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  514. package/lib/esm/src/typed-data/data/FiltersDto.d.ts +0 -55
  515. package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  516. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -14
  517. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  518. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts +0 -17
  519. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  520. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts +0 -3
  521. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -1
  522. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts +0 -5
  523. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts.map +0 -1
  524. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -13
  525. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -1
  526. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -6
  527. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -1
  528. package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
  529. /package/lib/{cjs → types}/index.d.ts +0 -0
  530. /package/lib/{cjs → types}/index.d.ts.map +0 -0
  531. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts +0 -0
  532. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts.map +0 -0
  533. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts +0 -0
  534. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts.map +0 -0
  535. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -0
  536. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -0
  537. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -0
  538. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -0
  539. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts +0 -0
  540. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -0
  541. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -0
  542. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -0
  543. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts +0 -0
  544. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts.map +0 -0
  545. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts +0 -0
  546. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts.map +0 -0
  547. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts +0 -0
  548. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts.map +0 -0
  549. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts +0 -0
  550. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts.map +0 -0
  551. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
  552. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
  553. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
  554. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
  555. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
  556. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
  557. /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts +0 -0
  558. /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +0 -0
  559. /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
  560. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts +0 -0
  561. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts.map +0 -0
  562. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts +0 -0
  563. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts.map +0 -0
  564. /package/lib/{cjs → types}/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -0
  565. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts +0 -0
  566. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -0
  567. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts +0 -0
  568. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts.map +0 -0
  569. /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -0
  570. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
  571. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/transaction/data/TransactionDataSource.ts"],
4
+ "sourcesContent": ["import { type HexaString } from \"@ledgerhq/device-management-kit\";\nimport { type Either } from \"purify-ts\";\n\nimport { type ClearSignContextSuccess } from \"@/shared/model/ClearSignContext\";\n\nexport type GetTransactionDescriptorsParams = {\n address: string;\n chainId: number;\n selector: HexaString;\n};\n\nexport interface TransactionDataSource {\n getTransactionDescriptors(\n params: GetTransactionDescriptorsParams,\n ): Promise<Either<Error, ClearSignContextSuccess[]>>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TransactionDataSource_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var T=(o,t)=>{for(var r in t)e(o,r,{get:t[r],enumerable:!0})},f=(o,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of d(t))!u.call(o,n)&&n!==r&&e(o,n,{get:()=>t[n],enumerable:!(a=p(t,n))||a.enumerable});return o};var x=o=>f(e({},"__esModule",{value:!0}),o);var _={};T(_,{transactionModuleFactory:()=>C});module.exports=x(_);var c=require("inversify"),s=require("../../transaction/data/HttpTransactionDataSource"),i=require("../../transaction/di/transactionTypes"),m=require("../../transaction/domain/TransactionContextLoader");const C=()=>new c.ContainerModule((o,t,r,a)=>{o(i.transactionTypes.TransactionDataSource).to(s.HttpTransactionDataSource),o(i.transactionTypes.TransactionContextLoader).to(m.TransactionContextLoader)});0&&(module.exports={transactionModuleFactory});
2
+ //# sourceMappingURL=transactionModuleFactory.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/transaction/di/transactionModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTransactionDataSource } from \"@/transaction/data/HttpTransactionDataSource\";\nimport { transactionTypes } from \"@/transaction/di/transactionTypes\";\nimport { TransactionContextLoader } from \"@/transaction/domain/TransactionContextLoader\";\n\nexport const transactionModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(transactionTypes.TransactionDataSource).to(HttpTransactionDataSource);\n bind(transactionTypes.TransactionContextLoader).to(\n TransactionContextLoader,\n );\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA0C,wDAC1CC,EAAiC,6CACjCC,EAAyC,yDAElC,MAAML,EAA2B,IACtC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,2BAAyB,EACzEA,EAAK,mBAAiB,wBAAwB,EAAE,GAC9C,0BACF,CACF,CAAC",
6
+ "names": ["transactionModuleFactory_exports", "__export", "transactionModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTransactionDataSource", "import_transactionTypes", "import_TransactionContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var r=Object.defineProperty;var e=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var T=(a,o)=>{for(var n in o)r(a,n,{get:o[n],enumerable:!0})},S=(a,o,n,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of s(o))!i.call(a,t)&&t!==n&&r(a,t,{get:()=>o[t],enumerable:!(c=e(o,t))||c.enumerable});return a};var x=a=>S(r({},"__esModule",{value:!0}),a);var b={};T(b,{transactionTypes:()=>y});module.exports=x(b);const y={TransactionDataSource:Symbol.for("TransactionDataSource"),TransactionContextLoader:Symbol.for("TransactionContextLoader")};0&&(module.exports={transactionTypes});
2
+ //# sourceMappingURL=transactionTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/transaction/di/transactionTypes.ts"],
4
+ "sourcesContent": ["export const transactionTypes = {\n TransactionDataSource: Symbol.for(\"TransactionDataSource\"),\n TransactionContextLoader: Symbol.for(\"TransactionContextLoader\"),\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAmB,CAC9B,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,yBAA0B,OAAO,IAAI,0BAA0B,CACjE",
6
+ "names": ["transactionTypes_exports", "__export", "transactionTypes", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var a in t)n(e,a,{get:t[a],enumerable:!0})},D=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of d(t))!x.call(e,r)&&r!==a&&n(e,r,{get:()=>t[r],enumerable:!(o=l(t,r))||o.enumerable});return e};var R=e=>D(n({},"__esModule",{value:!0}),e),u=(e,t,a,o)=>{for(var r=o>1?void 0:o?l(t,a):t,s=e.length-1,m;s>=0;s--)(m=e[s])&&(r=(o?m(t,a,r):m(r))||r);return o&&r&&n(t,a,r),r},S=(e,t)=>(a,o)=>t(a,o,e);var y={};g(y,{TransactionContextLoader:()=>i});module.exports=R(y);var f=require("@ledgerhq/device-management-kit"),c=require("inversify"),p=require("../../shared/model/ClearSignContext"),C=require("../../transaction/di/transactionTypes");let i=class{constructor(t){this.transactionDataSource=t}async load(t){if(!t.to||!t.data||t.data==="0x")return[];const a=t.data.slice(0,10);return(0,f.isHexaString)(a)?(await this.transactionDataSource.getTransactionDescriptors({address:t.to,chainId:t.chainId,selector:a})).caseOf({Left:r=>[{type:p.ClearSignContextType.ERROR,error:r}],Right:r=>r}):[{type:p.ClearSignContextType.ERROR,error:new Error("Invalid selector")}]}};i=u([(0,c.injectable)(),S(0,(0,c.inject)(C.transactionTypes.TransactionDataSource))],i);0&&(module.exports={TransactionContextLoader});
2
+ //# sourceMappingURL=TransactionContextLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/transaction/domain/TransactionContextLoader.ts"],
4
+ "sourcesContent": ["import { isHexaString } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport { TransactionContext } from \"@/shared/model/TransactionContext\";\nimport type { TransactionDataSource } from \"@/transaction/data/TransactionDataSource\";\nimport { transactionTypes } from \"@/transaction/di/transactionTypes\";\n\n@injectable()\nexport class TransactionContextLoader implements ContextLoader {\n constructor(\n @inject(transactionTypes.TransactionDataSource)\n private transactionDataSource: TransactionDataSource,\n ) {}\n\n async load(transaction: TransactionContext): Promise<ClearSignContext[]> {\n if (!transaction.to || !transaction.data || transaction.data === \"0x\") {\n return [];\n }\n\n const selector = transaction.data.slice(0, 10);\n\n if (!isHexaString(selector)) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ];\n }\n\n const result = await this.transactionDataSource.getTransactionDescriptors({\n address: transaction.to,\n chainId: transaction.chainId,\n selector,\n });\n\n return result.caseOf({\n Left: (error): ClearSignContext[] => [\n {\n type: ClearSignContextType.ERROR,\n error,\n },\n ],\n Right: (contexts): ClearSignContext[] => contexts,\n });\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA6B,2CAC7BC,EAAmC,qBAGnCC,EAGO,2CAGPC,EAAiC,6CAG1B,IAAMC,EAAN,KAAwD,CAC7D,YAEUC,EACR,CADQ,2BAAAA,CACP,CAEH,MAAM,KAAKC,EAA8D,CACvE,GAAI,CAACA,EAAY,IAAM,CAACA,EAAY,MAAQA,EAAY,OAAS,KAC/D,MAAO,CAAC,EAGV,MAAMC,EAAWD,EAAY,KAAK,MAAM,EAAG,EAAE,EAE7C,SAAK,gBAAaC,CAAQ,GASX,MAAM,KAAK,sBAAsB,0BAA0B,CACxE,QAASD,EAAY,GACrB,QAASA,EAAY,QACrB,SAAAC,CACF,CAAC,GAEa,OAAO,CACnB,KAAOC,GAA8B,CACnC,CACE,KAAM,uBAAqB,MAC3B,MAAAA,CACF,CACF,EACA,MAAQC,GAAiCA,CAC3C,CAAC,EAtBQ,CACL,CACE,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,kBAAkB,CACrC,CACF,CAkBJ,CACF,EAtCaL,EAANM,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,mBAAiB,qBAAqB,IAFrCP",
6
+ "names": ["TransactionContextLoader_exports", "__export", "TransactionContextLoader", "__toCommonJS", "import_device_management_kit", "import_inversify", "import_ClearSignContext", "import_transactionTypes", "TransactionContextLoader", "transactionDataSource", "transaction", "selector", "error", "contexts", "__decorateClass", "__decorateParam"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var r=require("purify-ts"),o=require("../../shared/model/ClearSignContext"),s=require("../../transaction/domain/TransactionContextLoader");describe("TransactionContextLoader",()=>{const n=jest.fn(),c={getTransactionDescriptors:n},e=new s.TransactionContextLoader(c);beforeEach(()=>{jest.clearAllMocks()}),it("should return an empty array if no destination address is provided",async()=>{const t={},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if data is undefined",async()=>{const t={to:"0x0"},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if no data provided",async()=>{const t={to:"0x0",data:"0x"},a=await e.load(t);expect(a).toEqual([])}),it("should return an error if selector is invalid",async()=>{const t={to:"0x7",chainId:3,data:"0xzf68b302000000000000000000000000000000000000000000000000000000000002"},a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("Invalid selector")}])}),it("should return an error if data source fails",async()=>{n.mockResolvedValue((0,r.Left)(new Error("data source error")));const t={to:"0x7",chainId:3,data:"0xaf68b302000000000000000000000000000000000000000000000000000000000002"},a=await e.load(t);expect(n).toHaveBeenCalledWith({address:"0x7",chainId:3,selector:"0xaf68b302"}),expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("data source error")}])}),it("should return the contexts on success",async()=>{n.mockResolvedValue((0,r.Right)([{type:o.ClearSignContextType.TRANSACTION_INFO,payload:"1234567890"},{type:o.ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION,payload:"deadbeef"}]));const t={to:"0x7",chainId:3,data:"0xaf68b302000000000000000000000000000000000000000000000000000000000002"},a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.TRANSACTION_INFO,payload:"1234567890"},{type:o.ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION,payload:"deadbeef"}])})});
2
+ //# sourceMappingURL=TransactionContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/transaction/domain/TransactionContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport type { TransactionContext } from \"@/shared/model/TransactionContext\";\nimport type { TransactionDataSource } from \"@/transaction/data/TransactionDataSource\";\nimport { TransactionContextLoader } from \"@/transaction/domain/TransactionContextLoader\";\n\ndescribe(\"TransactionContextLoader\", () => {\n const getTransactionDescriptorsMock = jest.fn();\n const mockTransactionDataSource: TransactionDataSource = {\n getTransactionDescriptors: getTransactionDescriptorsMock,\n };\n const loader = new TransactionContextLoader(mockTransactionDataSource);\n\n beforeEach(() => {\n jest.clearAllMocks();\n });\n\n it(\"should return an empty array if no destination address is provided\", async () => {\n // GIVEN\n const transaction = {} as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if data is undefined\", async () => {\n // GIVEN\n const transaction = { to: \"0x0\" } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if no data provided\", async () => {\n // GIVEN\n const transaction = { to: \"0x0\", data: \"0x\" } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an error if selector is invalid\", async () => {\n // GIVEN\n const transaction = {\n to: \"0x7\",\n chainId: 3,\n data: \"0xzf68b302000000000000000000000000000000000000000000000000000000000002\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ]);\n });\n\n it(\"should return an error if data source fails\", async () => {\n // GIVEN\n getTransactionDescriptorsMock.mockResolvedValue(\n Left(new Error(\"data source error\")),\n );\n const transaction = {\n to: \"0x7\",\n chainId: 3,\n data: \"0xaf68b302000000000000000000000000000000000000000000000000000000000002\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(getTransactionDescriptorsMock).toHaveBeenCalledWith({\n address: \"0x7\",\n chainId: 3,\n selector: \"0xaf68b302\",\n });\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"data source error\"),\n },\n ]);\n });\n\n it(\"should return the contexts on success\", async () => {\n // GIVEN\n getTransactionDescriptorsMock.mockResolvedValue(\n Right([\n {\n type: ClearSignContextType.TRANSACTION_INFO,\n payload: \"1234567890\",\n },\n {\n type: ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION,\n payload: \"deadbeef\",\n },\n ]),\n );\n const transaction = {\n to: \"0x7\",\n chainId: 3,\n data: \"0xaf68b302000000000000000000000000000000000000000000000000000000000002\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.TRANSACTION_INFO,\n payload: \"1234567890\",\n },\n {\n type: ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION,\n payload: \"deadbeef\",\n },\n ]);\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA4B,qBAE5BC,EAAqC,2CAGrCC,EAAyC,yDAEzC,SAAS,2BAA4B,IAAM,CACzC,MAAMC,EAAgC,KAAK,GAAG,EACxCC,EAAmD,CACvD,0BAA2BD,CAC7B,EACME,EAAS,IAAI,2BAAyBD,CAAyB,EAErE,WAAW,IAAM,CACf,KAAK,cAAc,CACrB,CAAC,EAED,GAAG,qEAAsE,SAAY,CAEnF,MAAME,EAAc,CAAC,EAGfC,EAAS,MAAMF,EAAO,KAAKC,CAAW,EAG5C,OAAOC,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,EAED,GAAG,oDAAqD,SAAY,C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AAQ,CACrB,CACE,KAAM,uBAAqB,iBAC3B,QAAS,YACX,EACA,CACE,KAAM,uBAAqB,8BAC3B,QAAS,UACX,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_purify_ts", "import_ClearSignContext", "import_TransactionContextLoader", "getTransactionDescriptorsMock", "mockTransactionDataSource", "loader", "transaction", "result"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var C=Object.create;var m=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var P=(r,e)=>{for(var t in e)m(r,t,{get:e[t],enumerable:!0})},h=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of E(e))!v.call(r,o)&&o!==t&&m(r,o,{get:()=>e[o],enumerable:!(n=f(e,o))||n.enumerable});return r};var y=(r,e,t)=>(t=r!=null?C(x(r)):{},h(e||!r||!r.__esModule?m(t,"default",{value:r,enumerable:!0}):t,r)),w=r=>h(m({},"__esModule",{value:!0}),r),D=(r,e,t,n)=>{for(var o=n>1?void 0:n?f(e,t):e,i=r.length-1,s;i>=0;i--)(s=r[i])&&(o=(n?s(e,t,o):s(o))||o);return n&&o&&m(e,t,o),o},N=(r,e)=>(t,n)=>e(t,n,r);var G={};P(G,{HttpTrustedNameDataSource:()=>d});module.exports=w(G);var u=y(require("axios")),c=require("inversify"),a=require("purify-ts"),T=require("../../config/di/configTypes"),g=y(require("../../../package.json"));let d=class{constructor(e){this.config=e}async getDomainNamePayload({domain:e,challenge:t}){try{const i=await u.default.request({method:"GET",url:`https://nft.api.live.ledger.com/v2/names/ethereum/1/forward/${e}?types=eoa&sources=ens&challenge=${t}`,headers:{"X-Ledger-Client-Version":`context-module/${g.default.version}`}});return i.data.signedDescriptor?.data?(0,a.Right)(i.data.signedDescriptor.data):(0,a.Left)(new Error("[ContextModule] HttpTrustedNameDataSource: error getting domain payload"))}catch{return(0,a.Left)(new Error("[ContextModule] HttpTrustedNameDataSource: Failed to fetch domain name"))}}async getTrustedNamePayload({address:e,challenge:t,sources:n,types:o}){try{n=n.filter(p=>p==="ens"||p==="crypto_assets_list");const s=(await u.default.request({method:"GET",url:`https://nft.api.live.ledger.com/v2/names/ethereum/1/reverse/${e}?types=${o.join(",")}&sources=${n.join(",")}&challenge=${t}`,headers:{"X-Ledger-Client-Version":`context-module/${g.default.version}`}})).data;if(!s?.signedDescriptor?.data)return(0,a.Left)(new Error(`[ContextModule] HttpTrustedNameDataSource: no trusted name metadata for address ${e}`));const l=s.signedDescriptor.data;if(!s.signedDescriptor.signatures||typeof s.signedDescriptor.signatures[this.config.cal.mode]!="string")return(0,a.Right)(l);const $=s.signedDescriptor.signatures[this.config.cal.mode];return(0,a.Right)(this.formatTrustedName(l,$))}catch{return(0,a.Left)(new Error("[ContextModule] HttpTrustedNameDataSource: Failed to fetch trusted name"))}}formatTrustedName(e,t){t.length%2!==0&&(t="0"+t);const n="15",o=(t.length/2).toString(16);return`${e}${n}${o}${t}`}};d=D([(0,c.injectable)(),N(0,(0,c.inject)(T.configTypes.Config))],d);0&&(module.exports={HttpTrustedNameDataSource});
2
+ //# sourceMappingURL=HttpTrustedNameDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/trusted-name/data/HttpTrustedNameDataSource.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport {\n GetDomainNameInfosParams,\n GetTrustedNameInfosParams,\n TrustedNameDataSource,\n} from \"@/trusted-name/data/TrustedNameDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\nimport { TrustedNameDto } from \"./TrustedNameDto\";\n\n@injectable()\nexport class HttpTrustedNameDataSource implements TrustedNameDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n public async getDomainNamePayload({\n domain,\n challenge,\n }: GetDomainNameInfosParams): Promise<Either<Error, string>> {\n try {\n const type = \"eoa\"; // Externally owned account\n const source = \"ens\"; // Ethereum name service\n const response = await axios.request<TrustedNameDto>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v2/names/ethereum/1/forward/${domain}?types=${type}&sources=${source}&challenge=${challenge}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.signedDescriptor?.data\n ? Right(response.data.signedDescriptor.data)\n : Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: error getting domain payload\",\n ),\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: Failed to fetch domain name\",\n ),\n );\n }\n }\n\n public async getTrustedNamePayload({\n address,\n challenge,\n sources,\n types,\n }: GetTrustedNameInfosParams): Promise<Either<Error, string>> {\n try {\n // TODO remove that filtering once https://ledgerhq.atlassian.net/browse/BACK-8075 is done\n // For now we have to filter or trusted names won't work with the generic parser, because transaction\n // fields descriptors can contain unsupported sources.\n sources = sources.filter(\n (source) => source === \"ens\" || source === \"crypto_assets_list\",\n );\n const response = await axios.request<TrustedNameDto>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v2/names/ethereum/1/reverse/${address}?types=${types.join(\",\")}&sources=${sources.join(\",\")}&challenge=${challenge}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n const trustedName = response.data;\n if (!trustedName?.signedDescriptor?.data) {\n return Left(\n new Error(\n `[ContextModule] HttpTrustedNameDataSource: no trusted name metadata for address ${address}`,\n ),\n );\n }\n const payload = trustedName.signedDescriptor.data;\n\n if (\n !trustedName.signedDescriptor.signatures ||\n typeof trustedName.signedDescriptor.signatures[this.config.cal.mode] !==\n \"string\"\n ) {\n // If we have no separated signature but a valid descriptor, it may mean the descriptor was\n // signed on-the-fly for dynamic sources such as ens\n return Right(payload);\n }\n\n const signature =\n trustedName.signedDescriptor.signatures[this.config.cal.mode]!;\n return Right(this.formatTrustedName(payload, signature));\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: Failed to fetch trusted name\",\n ),\n );\n }\n }\n\n private formatTrustedName(payload: string, signature: string): string {\n // Ensure correct padding\n if (signature.length % 2 !== 0) {\n signature = \"0\" + signature;\n }\n // TLV encoding as according to trusted name documentation\n const signatureTag = \"15\";\n const signatureLength = (signature.length / 2).toString(16);\n return `${payload}${signatureTag}${signatureLength}${signature}`;\n }\n}\n"],
5
+ "mappings": "qtBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,oBAClBC,EAAmC,qBACnCC,EAAoC,qBAEpCC,EAA4B,mCAO5BC,EAAoB,iCAKb,IAAMC,EAAN,KAAiE,CACtE,YAC+CC,EAC7C,CAD6C,YAAAA,CAC5C,CAEH,MAAa,qBAAqB,CAChC,OAAAC,EACA,UAAAC,CACF,EAA6D,CAC3D,GAAI,CAGF,MAAMC,EAAW,MAAM,EAAAC,QAAM,QAAwB,CACnD,OAAQ,MACR,IAAK,+DAA+DH,CAAM,oCAA8CC,CAAS,GACjI,QAAS,CACP,0BAA2B,kBAAkB,EAAAG,QAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,kBAAkB,QACnC,SAAMA,EAAS,KAAK,iBAAiB,IAAI,KACzC,QACE,IAAI,MACF,yEACF,CACF,CACN,MAAiB,CACf,SAAO,QACL,IAAI,MACF,wEACF,CACF,CACF,CACF,CAEA,MAAa,sBAAsB,CACjC,QAAAG,EACA,UAAAJ,EACA,QAAAK,EACA,MAAAC,CACF,EAA8D,CAC5D,GAAI,CAIFD,EAAUA,EAAQ,OACfE,GAAWA,IAAW,OAASA,IAAW,oBAC7C,EAQA,MAAMC,GAPW,MAAM,EAAAN,QAAM,QAAwB,CACnD,OAAQ,MACR,IAAK,+DAA+DE,CAAO,UAAUE,EAAM,KAAK,GAAG,CAAC,YAAYD,EAAQ,KAAK,GAAG,CAAC,cAAcL,CAAS,GACxJ,QAAS,CACP,0BAA2B,kBAAkB,EAAAG,QAAQ,OAAO,EAC9D,CACF,CAAC,GAC4B,KAC7B,GAAI,CAACK,GAAa,kBAAkB,KAClC,SAAO,QACL,IAAI,MACF,mFAAmFJ,CAAO,EAC5F,CACF,EAEF,MAAMK,EAAUD,EAAY,iBAAiB,KAE7C,GACE,CAACA,EAAY,iBAAiB,YAC9B,OAAOA,EAAY,iBAAiB,WAAW,KAAK,OAAO,IAAI,IAAI,GACjE,SAIF,SAAO,SAAMC,CAAO,EAGtB,MAAMC,EACJF,EAAY,iBAAiB,WAAW,KAAK,OAAO,IAAI,IAAI,EAC9D,SAAO,SAAM,KAAK,kBAAkBC,EAASC,CAAS,CAAC,CACzD,MAAiB,CACf,SAAO,QACL,IAAI,MACF,yEACF,CACF,CACF,CACF,CAEQ,kBAAkBD,EAAiBC,EAA2B,CAEhEA,EAAU,OAAS,IAAM,IAC3BA,EAAY,IAAMA,GAGpB,MAAMC,EAAe,KACfC,GAAmBF,EAAU,OAAS,GAAG,SAAS,EAAE,EAC1D,MAAO,GAAGD,CAAO,GAAGE,CAAY,GAAGC,CAAe,GAAGF,CAAS,EAChE,CACF,EAlGab,EAANgB,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,cAAY,MAAM,IAFjBjB",
6
+ "names": ["HttpTrustedNameDataSource_exports", "__export", "HttpTrustedNameDataSource", "__toCommonJS", "import_axios", "import_inversify", "import_purify_ts", "import_configTypes", "import_package", "HttpTrustedNameDataSource", "config", "domain", "challenge", "response", "axios", "PACKAGE", "address", "sources", "types", "source", "trustedName", "payload", "signature", "signatureTag", "signatureLength", "__decorateClass", "__decorateParam"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var u=Object.create;var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var g=(t,e,a,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of m(e))!y.call(t,r)&&r!==a&&d(t,r,{get:()=>e[r],enumerable:!(l=p(e,r))||l.enumerable});return t};var c=(t,e,a)=>(a=t!=null?u(h(t)):{},g(e||!t||!t.__esModule?d(a,"default",{value:t,enumerable:!0}):a,t));var o=c(require("axios")),s=require("purify-ts"),i=require("../../trusted-name/data/HttpTrustedNameDataSource"),n=c(require("../../../package.json"));jest.mock("axios");describe("HttpTrustedNameDataSource",()=>{let t;beforeAll(()=>{const e={cal:{url:"https://crypto-assets-service.api.ledger.com/v1",mode:"prod",branch:"main"}};t=new i.HttpTrustedNameDataSource(e),jest.clearAllMocks()}),describe("getDomainNamePayload",()=>{it("should call axios with the ledger client version header",async()=>{const e=`context-module/${n.default.version}`,a=jest.fn(()=>Promise.resolve({data:[]}));jest.spyOn(o.default,"request").mockImplementation(a),await t.getDomainNamePayload({challenge:"",domain:"hello.eth"}),expect(a).toHaveBeenCalledWith(expect.objectContaining({headers:{"X-Ledger-Client-Version":e}}))}),it("should throw an error when axios throws an error",async()=>{jest.spyOn(o.default,"request").mockRejectedValue(new Error);const e=await t.getDomainNamePayload({challenge:"",domain:"hello.eth"});expect(e).toEqual((0,s.Left)(new Error("[ContextModule] HttpTrustedNameDataSource: Failed to fetch domain name")))}),it("should return an error when no payload is returned",async()=>{const e={data:{test:""}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getDomainNamePayload({challenge:"",domain:"hello.eth"});expect(a).toEqual((0,s.Left)(new Error("[ContextModule] HttpTrustedNameDataSource: error getting domain payload")))}),it("should return a payload",async()=>{const e={data:{signedDescriptor:{data:"payload"}}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getDomainNamePayload({challenge:"challenge",domain:"hello.eth"});expect(a).toEqual((0,s.Right)("payload"))})}),describe("getTrustedNamePayload",()=>{it("should call axios with the ledger client version header",async()=>{const e=`context-module/${n.default.version}`,a=jest.fn(()=>Promise.resolve({data:[]}));jest.spyOn(o.default,"request").mockImplementation(a),await t.getTrustedNamePayload({address:"0x1234",challenge:"",sources:["ens"],types:["eoa"]}),expect(a).toHaveBeenCalledWith(expect.objectContaining({headers:{"X-Ledger-Client-Version":e}}))}),it("should throw an error when axios throws an error",async()=>{jest.spyOn(o.default,"request").mockRejectedValue(new Error);const e=await t.getTrustedNamePayload({address:"0x1234",challenge:"",sources:["ens"],types:["eoa"]});expect(e).toEqual((0,s.Left)(new Error("[ContextModule] HttpTrustedNameDataSource: Failed to fetch trusted name")))}),it("should return an error when no payload is returned",async()=>{const e={data:{test:""}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getTrustedNamePayload({address:"0x1234",challenge:"",sources:["ens"],types:["eoa"]});expect(a).toEqual((0,s.Left)(new Error("[ContextModule] HttpTrustedNameDataSource: no trusted name metadata for address 0x1234")))}),it("should return a payload",async()=>{const e={data:{signedDescriptor:{data:"payload"}}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getTrustedNamePayload({address:"0x1234",challenge:"",sources:["ens"],types:["eoa"]});expect(a).toEqual((0,s.Right)("payload"))}),it("should return a payload with a signature",async()=>{const e={data:{signedDescriptor:{data:"payload",signatures:{prod:"12345"}}}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getTrustedNamePayload({address:"0x1234",challenge:"",sources:["ens"],types:["eoa"]});expect(a).toEqual((0,s.Right)("payload153012345"))})})});
2
+ //# sourceMappingURL=HttpTrustedNameDataSource.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/trusted-name/data/HttpTrustedNameDataSource.test.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { Left, Right } from \"purify-ts\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { HttpTrustedNameDataSource } from \"@/trusted-name/data/HttpTrustedNameDataSource\";\nimport { type TrustedNameDataSource } from \"@/trusted-name/data/TrustedNameDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\njest.mock(\"axios\");\n\ndescribe(\"HttpTrustedNameDataSource\", () => {\n let datasource: TrustedNameDataSource;\n\n beforeAll(() => {\n const config = {\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n },\n } as ContextModuleConfig;\n datasource = new HttpTrustedNameDataSource(config);\n jest.clearAllMocks();\n });\n\n describe(\"getDomainNamePayload\", () => {\n it(\"should call axios with the ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = jest.fn(() => Promise.resolve({ data: [] }));\n jest.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getDomainNamePayload({\n challenge: \"\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n it(\"should throw an error when axios throws an error\", async () => {\n // GIVEN\n jest.spyOn(axios, \"request\").mockRejectedValue(new Error());\n\n // WHEN\n const result = await datasource.getDomainNamePayload({\n challenge: \"\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: Failed to fetch domain name\",\n ),\n ),\n );\n });\n\n it(\"should return an error when no payload is returned\", async () => {\n // GIVEN\n const response = { data: { test: \"\" } };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDomainNamePayload({\n challenge: \"\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: error getting domain payload\",\n ),\n ),\n );\n });\n\n it(\"should return a payload\", async () => {\n // GIVEN\n const response = { data: { signedDescriptor: { data: \"payload\" } } };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDomainNamePayload({\n challenge: \"challenge\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(result).toEqual(Right(\"payload\"));\n });\n });\n\n describe(\"getTrustedNamePayload\", () => {\n it(\"should call axios with the ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = jest.fn(() => Promise.resolve({ data: [] }));\n jest.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getTrustedNamePayload({\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(requestSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n it(\"should throw an error when axios throws an error\", async () => {\n // GIVEN\n jest.spyOn(axios, \"request\").mockRejectedValue(new Error());\n\n // WHEN\n const result = await datasource.getTrustedNamePayload({\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: Failed to fetch trusted name\",\n ),\n ),\n );\n });\n\n it(\"should return an error when no payload is returned\", async () => {\n // GIVEN\n const response = { data: { test: \"\" } };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getTrustedNamePayload({\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: no trusted name metadata for address 0x1234\",\n ),\n ),\n );\n });\n\n it(\"should return a payload\", async () => {\n // GIVEN\n const response = {\n data: {\n signedDescriptor: { data: \"payload\" },\n },\n };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getTrustedNamePayload({\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(result).toEqual(Right(\"payload\"));\n });\n\n it(\"should return a payload with a signature\", async () => {\n // GIVEN\n const response = {\n data: {\n signedDescriptor: { data: \"payload\", signatures: { prod: \"12345\" } },\n },\n };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getTrustedNamePayload({\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(result).toEqual(Right(\"payload153012345\"));\n });\n });\n});\n"],
5
+ "mappings": "wdAAA,IAAAA,EAAkB,oBAClBC,EAA4B,qBAG5BC,EAA0C,yDAE1CC,EAAoB,iCAEpB,KAAK,KAAK,OAAO,EAEjB,SAAS,4BAA6B,IAAM,CAC1C,IAAIC,EAEJ,UAAU,IAAM,CACd,MAAMC,EAAS,CACb,IAAK,CACH,IAAK,kDACL,KAAM,OACN,OAAQ,MACV,CACF,EACAD,EAAa,IAAI,4BAA0BC,CAAM,EACjD,KAAK,cAAc,CACrB,CAAC,EAED,SAAS,uBAAwB,IAAM,CACrC,GAAG,0DAA2D,SAAY,CAExE,MAAMC,EAAU,kBAAkB,EAAAC,QAAQ,OAAO,GAC3CC,EAAa,KAAK,GAAG,IAAM,QAAQ,QAAQ,CAAE,KAAM,CAAC,CAAE,CAAC,CAAC,EAC9D,KAAK,MAAM,EAAAC,QAAO,SAAS,EAAE,mBAAmBD,CAAU,EAG1D,MAAMJ,EAAW,qBAAqB,CACpC,UAAW,GACX,OAAQ,WACV,CAAC,EAGD,OAAOI,CAAU,EAAE,qBACjB,OAAO,iBAAiB,CACtB,QAAS,CAAE,0BAA2BF,CAAQ,CAChD,CAAC,CACH,CACF,CAAC,EAED,GAAG,mDAAoD,SAAY,CAEjE,KAAK,MAAM,EAAAG,QAAO,SAAS,EAAE,kBAAkB,IAAI,KAAO,EAG1D,MAAMC,EAAS,MAAMN,EAAW,qB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,CAAM,EAAE,WAAQ,SAAM,kBAAkB,CAAC,CAClD,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_axios", "import_purify_ts", "import_HttpTrustedNameDataSource", "import_package", "datasource", "config", "version", "PACKAGE", "requestSpy", "axios", "result", "response"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var s=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var g=(r,e,m,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of i(e))!n.call(r,a)&&a!==m&&s(r,a,{get:()=>e[a],enumerable:!(t=o(e,a))||t.enumerable});return r};var p=r=>g(s({},"__esModule",{value:!0}),r);var d={};module.exports=p(d);
2
+ //# sourceMappingURL=TrustedNameDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/trusted-name/data/TrustedNameDataSource.ts"],
4
+ "sourcesContent": ["import { type Either } from \"purify-ts/Either\";\n\nexport type GetDomainNameInfosParams = {\n domain: string;\n challenge: string;\n};\n\nexport type GetTrustedNameInfosParams = {\n address: string;\n challenge: string;\n types: string[];\n sources: string[];\n};\n\nexport interface TrustedNameDataSource {\n getDomainNamePayload(\n params: GetDomainNameInfosParams,\n ): Promise<Either<Error, string>>;\n\n getTrustedNamePayload(\n params: GetTrustedNameInfosParams,\n ): Promise<Either<Error, string>>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TrustedNameDataSource_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var n=(e,t,p,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of d(t))!g.call(e,r)&&r!==p&&i(e,r,{get:()=>t[r],enumerable:!(s=a(t,r))||s.enumerable});return e};var o=e=>n(i({},"__esModule",{value:!0}),e);var u={};module.exports=o(u);
2
+ //# sourceMappingURL=TrustedNameDto.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/trusted-name/data/TrustedNameDto.ts"],
4
+ "sourcesContent": ["export type TrustedNameSignatures =\n | {\n prod: string;\n test?: string;\n }\n | {\n prod?: string;\n test: string;\n };\n\nexport type TrustedNameDescriptor = {\n data: string;\n signatures?: TrustedNameSignatures;\n};\n\nexport type TrustedNameDto = {\n signedDescriptor: TrustedNameDescriptor;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TrustedNameDto_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var m=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var o in e)m(t,o,{get:e[o],enumerable:!0})},c=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(t,r)&&r!==o&&m(t,r,{get:()=>e[r],enumerable:!(a=i(e,r))||a.enumerable});return t};var f=t=>c(m({},"__esModule",{value:!0}),t);var C={};T(C,{trustedNameModuleFactory:()=>x});module.exports=f(C);var u=require("inversify"),n=require("../../trusted-name/data/HttpTrustedNameDataSource"),d=require("../../trusted-name/di/trustedNameTypes"),s=require("../../trusted-name/domain/TrustedNameContextLoader");const x=()=>new u.ContainerModule((t,e,o,a)=>{t(d.trustedNameTypes.TrustedNameDataSource).to(n.HttpTrustedNameDataSource),t(d.trustedNameTypes.TrustedNameContextLoader).to(s.TrustedNameContextLoader)});0&&(module.exports={trustedNameModuleFactory});
2
+ //# sourceMappingURL=trustedNameModuleFactory.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/trusted-name/di/trustedNameModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTrustedNameDataSource } from \"@/trusted-name/data/HttpTrustedNameDataSource\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\nimport { TrustedNameContextLoader } from \"@/trusted-name/domain/TrustedNameContextLoader\";\n\nexport const trustedNameModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(trustedNameTypes.TrustedNameDataSource).to(HttpTrustedNameDataSource);\n bind(trustedNameTypes.TrustedNameContextLoader).to(\n TrustedNameContextLoader,\n );\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA0C,yDAC1CC,EAAiC,8CACjCC,EAAyC,0DAElC,MAAML,EAA2B,IACtC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,2BAAyB,EACzEA,EAAK,mBAAiB,wBAAwB,EAAE,GAC9C,0BACF,CACF,CAAC",
6
+ "names": ["trustedNameModuleFactory_exports", "__export", "trustedNameModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTrustedNameDataSource", "import_trustedNameTypes", "import_TrustedNameContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var N=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},T=(t,e,r,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of s(e))!u.call(t,o)&&o!==r&&a(t,o,{get:()=>e[o],enumerable:!(d=m(e,o))||d.enumerable});return t};var S=t=>T(a({},"__esModule",{value:!0}),t);var n={};N(n,{trustedNameTypes:()=>c});module.exports=S(n);const c={TrustedNameDataSource:Symbol.for("TrustedNameDataSource"),TrustedNameContextLoader:Symbol.for("TrustedNameContextLoader")};0&&(module.exports={trustedNameTypes});
2
+ //# sourceMappingURL=trustedNameTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/trusted-name/di/trustedNameTypes.ts"],
4
+ "sourcesContent": ["export const trustedNameTypes = {\n TrustedNameDataSource: Symbol.for(\"TrustedNameDataSource\"),\n TrustedNameContextLoader: Symbol.for(\"TrustedNameContextLoader\"),\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAmB,CAC9B,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,yBAA0B,OAAO,IAAI,0BAA0B,CACjE",
6
+ "names": ["trustedNameTypes_exports", "__export", "trustedNameTypes", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var S=(o,t)=>{for(var e in t)l(o,e,{get:t[e],enumerable:!0})},T=(o,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of g(t))!C.call(o,r)&&r!==e&&l(o,r,{get:()=>t[r],enumerable:!(a=m(t,r))||a.enumerable});return o};var R=o=>T(l({},"__esModule",{value:!0}),o),p=(o,t,e,a)=>{for(var r=a>1?void 0:a?m(t,e):t,n=o.length-1,d;n>=0;n--)(d=o[n])&&(r=(a?d(t,e,r):d(r))||r);return a&&r&&l(t,e,r),r},u=(o,t)=>(e,a)=>t(e,a,o);var h={};S(h,{TrustedNameContextLoader:()=>s});module.exports=R(h);var c=require("inversify"),i=require("../../shared/model/ClearSignContext"),y=require("../../trusted-name/di/trustedNameTypes");let s=class{_dataSource;constructor(t){this._dataSource=t}async load(t){const{domain:e,challenge:a}=t;return e?this.isDomainValid(e)?[(await this._dataSource.getDomainNamePayload({domain:e,challenge:a})).caseOf({Left:n=>({type:i.ClearSignContextType.ERROR,error:n}),Right:n=>({type:i.ClearSignContextType.TRUSTED_NAME,payload:n})})]:[{type:i.ClearSignContextType.ERROR,error:new Error("[ContextModule] TrustedNameLoader: invalid domain")}]:[]}async loadField(t){return t.type!==i.ClearSignContextType.TRUSTED_NAME?null:(await this._dataSource.getTrustedNamePayload({address:t.address,challenge:t.challenge,types:t.types,sources:t.sources})).caseOf({Left:a=>({type:i.ClearSignContextType.ERROR,error:a}),Right:a=>({type:i.ClearSignContextType.TRUSTED_NAME,payload:a})})}isDomainValid(t){const e=t.length>0&&Number(t.length)<30,a=new RegExp("^[a-zA-Z0-9\\-\\_\\.]+$").test(t);return e&&a}};s=p([(0,c.injectable)(),u(0,(0,c.inject)(y.trustedNameTypes.TrustedNameDataSource))],s);0&&(module.exports={TrustedNameContextLoader});
2
+ //# sourceMappingURL=TrustedNameContextLoader.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/trusted-name/domain/TrustedNameContextLoader.ts"],
4
+ "sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport {\n TransactionContext,\n TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\nimport type { TrustedNameDataSource } from \"@/trusted-name/data/TrustedNameDataSource\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\n\n@injectable()\nexport class TrustedNameContextLoader implements ContextLoader {\n private _dataSource: TrustedNameDataSource;\n\n constructor(\n @inject(trustedNameTypes.TrustedNameDataSource)\n dataSource: TrustedNameDataSource,\n ) {\n this._dataSource = dataSource;\n }\n\n async load(\n transactionContext: TransactionContext,\n ): Promise<ClearSignContext[]> {\n const { domain, challenge } = transactionContext;\n\n if (!domain) {\n return [];\n }\n\n if (!this.isDomainValid(domain)) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"[ContextModule] TrustedNameLoader: invalid domain\"),\n },\n ];\n }\n\n const payload = await this._dataSource.getDomainNamePayload({\n domain: domain,\n challenge: challenge,\n });\n\n return [\n payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error: error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.TRUSTED_NAME,\n payload: value,\n }),\n }),\n ];\n }\n\n async loadField(\n field: TransactionFieldContext,\n ): Promise<ClearSignContext | null> {\n if (field.type !== ClearSignContextType.TRUSTED_NAME) {\n return null;\n }\n const payload = await this._dataSource.getTrustedNamePayload({\n address: field.address,\n challenge: field.challenge,\n types: field.types,\n sources: field.sources,\n });\n return payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.TRUSTED_NAME,\n payload: value,\n }),\n });\n }\n\n private isDomainValid(domain: string) {\n const lengthIsValid = domain.length > 0 && Number(domain.length) < 30;\n const containsOnlyValidChars = new RegExp(\"^[a-zA-Z0-9\\\\-\\\\_\\\\.]+$\").test(\n domain,\n );\n\n return lengthIsValid && containsOnlyValidChars;\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,qBAGnCC,EAGO,2CAMPC,EAAiC,8CAG1B,IAAMC,EAAN,KAAwD,CACrD,YAER,YAEEC,EACA,CACA,KAAK,YAAcA,CACrB,CAEA,MAAM,KACJC,EAC6B,CAC7B,KAAM,CAAE,OAAAC,EAAQ,UAAAC,CAAU,EAAIF,EAE9B,OAAKC,EAIA,KAAK,cAAcA,CAAM,EAcvB,EALS,MAAM,KAAK,YAAY,qBAAqB,CAC1D,OAAQA,EACR,UAAWC,CACb,CAAC,GAGS,OAAO,CACb,KAAOC,IAA6B,CAClC,KAAM,uBAAqB,MAC3B,MAAOA,CACT,GACA,MAAQC,IAA6B,CACnC,KAAM,uBAAqB,aAC3B,QAASA,CACX,EACF,CAAC,CACH,EAxBS,CACL,CACE,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,mDAAmD,CACtE,CACF,EATO,CAAC,CA6BZ,CAEA,MAAM,UACJC,EACkC,CAClC,OAAIA,EAAM,OAAS,uBAAqB,aAC/B,MAEO,MAAM,KAAK,YAAY,sBAAsB,CAC3D,QAASA,EAAM,QACf,UAAWA,EAAM,UACjB,MAAOA,EAAM,MACb,QAASA,EAAM,OACjB,CAAC,GACc,OAAO,CACpB,KAAOF,IAA6B,CAClC,KAAM,uBAAqB,MAC3B,MAAAA,CACF,GACA,MAAQC,IAA6B,CACnC,KAAM,uBAAqB,aAC3B,QAASA,CACX,EACF,CAAC,CACH,CAEQ,cAAcH,EAAgB,CACpC,MAAMK,EAAgBL,EAAO,OAAS,GAAK,OAAOA,EAAO,MAAM,EAAI,GAC7DM,EAAyB,IAAI,OAAO,yBAAyB,EAAE,KACnEN,CACF,EAEA,OAAOK,GAAiBC,CAC1B,CACF,EA/EaT,EAANU,EAAA,IADN,cAAW,EAKPC,EAAA,eAAO,mBAAiB,qBAAqB,IAJrCX",
6
+ "names": ["TrustedNameContextLoader_exports", "__export", "TrustedNameContextLoader", "__toCommonJS", "import_inversify", "import_ClearSignContext", "import_trustedNameTypes", "TrustedNameContextLoader", "dataSource", "transactionContext", "domain", "challenge", "error", "value", "field", "lengthIsValid", "containsOnlyValidChars", "__decorateClass", "__decorateParam"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var l=require("purify-ts"),o=require("../../shared/model/ClearSignContext"),n=require("../../trusted-name/domain/TrustedNameContextLoader");describe("TrustedNameContextLoader",()=>{const t={getDomainNamePayload:jest.fn(),getTrustedNamePayload:jest.fn()};beforeEach(()=>{jest.restoreAllMocks(),jest.spyOn(t,"getDomainNamePayload").mockResolvedValue((0,l.Right)("payload"))}),describe("load function",()=>{it("should return an empty array when no domain or registry",()=>{const e={},r=new n.TrustedNameContextLoader(t),a=()=>r.load(e);expect(a()).resolves.toEqual([])}),it("should return an error when domain > max length",async()=>{const e={domain:"maxlength-maxlength-maxlength-maxlength-maxlength-maxlength"},a=await new n.TrustedNameContextLoader(t).load(e);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("[ContextModule] TrustedNameLoader: invalid domain")}])}),it("should return an error when domain is not valid",async()=>{const e={domain:"hello\u{1F44B}"},a=await new n.TrustedNameContextLoader(t).load(e);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("[ContextModule] TrustedNameLoader: invalid domain")}])}),it("should return a payload",async()=>{const e={domain:"hello.eth",challenge:"challenge"},a=await new n.TrustedNameContextLoader(t).load(e);expect(a).toEqual([{type:o.ClearSignContextType.TRUSTED_NAME,payload:"payload"}])}),it("should return an error when unable to fetch the datasource",async()=>{const e={domain:"hello.eth",challenge:"challenge"};jest.spyOn(t,"getDomainNamePayload").mockResolvedValue((0,l.Left)(new Error("error")));const a=await new n.TrustedNameContextLoader(t).load(e);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("error")}])})}),describe("loadField function",()=>{it("should return an error when field type if not supported",async()=>{const e={type:o.ClearSignContextType.TOKEN,chainId:7,address:"0x1234"},a=await new n.TrustedNameContextLoader(t).loadField(e);expect(a).toEqual(null)}),it("should return a payload",async()=>{const e={type:o.ClearSignContextType.TRUSTED_NAME,chainId:7,address:"0x1234",challenge:"17",sources:["ens"],types:["eoa"]};jest.spyOn(t,"getTrustedNamePayload").mockResolvedValue((0,l.Right)("payload"));const a=await new n.TrustedNameContextLoader(t).loadField(e);expect(a).toEqual({type:o.ClearSignContextType.TRUSTED_NAME,payload:"payload"})}),it("should return an error when unable to fetch the datasource",async()=>{const e={type:o.ClearSignContextType.TRUSTED_NAME,chainId:7,address:"0x1234",challenge:"17",sources:["ens"],types:["eoa"]};jest.spyOn(t,"getTrustedNamePayload").mockResolvedValue((0,l.Left)(new Error("error")));const a=await new n.TrustedNameContextLoader(t).loadField(e);expect(a).toEqual({type:o.ClearSignContextType.ERROR,error:new Error("error")})})})});
2
+ //# sourceMappingURL=TrustedNameContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/trusted-name/domain/TrustedNameContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\nimport { type TrustedNameDataSource } from \"@/trusted-name/data/TrustedNameDataSource\";\nimport { TrustedNameContextLoader } from \"@/trusted-name/domain/TrustedNameContextLoader\";\n\ndescribe(\"TrustedNameContextLoader\", () => {\n const mockTrustedNameDataSource: TrustedNameDataSource = {\n getDomainNamePayload: jest.fn(),\n getTrustedNamePayload: jest.fn(),\n };\n\n beforeEach(() => {\n jest.restoreAllMocks();\n jest\n .spyOn(mockTrustedNameDataSource, \"getDomainNamePayload\")\n .mockResolvedValue(Right(\"payload\"));\n });\n\n describe(\"load function\", () => {\n it(\"should return an empty array when no domain or registry\", () => {\n const transaction = {} as TransactionContext;\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const promise = () => loader.load(transaction);\n\n expect(promise()).resolves.toEqual([]);\n });\n\n it(\"should return an error when domain > max length\", async () => {\n const transaction = {\n domain: \"maxlength-maxlength-maxlength-maxlength-maxlength-maxlength\",\n } as TransactionContext;\n\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"[ContextModule] TrustedNameLoader: invalid domain\"),\n },\n ]);\n });\n\n it(\"should return an error when domain is not valid\", async () => {\n const transaction = {\n domain: \"hello\uD83D\uDC4B\",\n } as TransactionContext;\n\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"[ContextModule] TrustedNameLoader: invalid domain\"),\n },\n ]);\n });\n\n it(\"should return a payload\", async () => {\n const transaction = {\n domain: \"hello.eth\",\n challenge: \"challenge\",\n } as TransactionContext;\n\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.TRUSTED_NAME,\n payload: \"payload\",\n },\n ]);\n });\n\n it(\"should return an error when unable to fetch the datasource\", async () => {\n // GIVEN\n const transaction = {\n domain: \"hello.eth\",\n challenge: \"challenge\",\n } as TransactionContext;\n\n // WHEN\n jest\n .spyOn(mockTrustedNameDataSource, \"getDomainNamePayload\")\n .mockResolvedValue(Left(new Error(\"error\")));\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n { type: ClearSignContextType.ERROR, error: new Error(\"error\") },\n ]);\n });\n });\n\n describe(\"loadField function\", () => {\n it(\"should return an error when field type if not supported\", async () => {\n const field: TransactionFieldContext = {\n type: ClearSignContextType.TOKEN,\n chainId: 7,\n address: \"0x1234\",\n };\n\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.loadField(field);\n\n expect(result).toEqual(null);\n });\n\n it(\"should return a payload\", async () => {\n // GIVEN\n const field: TransactionFieldContext = {\n type: ClearSignContextType.TRUSTED_NAME,\n chainId: 7,\n address: \"0x1234\",\n challenge: \"17\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n };\n\n // WHEN\n jest\n .spyOn(mockTrustedNameDataSource, \"getTrustedNamePayload\")\n .mockResolvedValue(Right(\"payload\"));\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.loadField(field);\n\n // THEN\n expect(result).toEqual({\n type: ClearSignContextType.TRUSTED_NAME,\n payload: \"payload\",\n });\n });\n\n it(\"should return an error when unable to fetch the datasource\", async () => {\n // GIVEN\n const field: TransactionFieldContext = {\n type: ClearSignContextType.TRUSTED_NAME,\n chainId: 7,\n address: \"0x1234\",\n challenge: \"17\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n };\n\n // WHEN\n jest\n .spyOn(mockTrustedNameDataSource, \"getTrustedNamePayload\")\n .mockResolvedValue(Left(new Error(\"error\")));\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.loadField(field);\n\n // THEN\n expect(result).toEqual({\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n });\n });\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAA4B,qBAE5BC,EAAqC,2CAMrCC,EAAyC,0DAEzC,SAAS,2BAA4B,IAAM,CACzC,MAAMC,EAAmD,CACvD,qBAAsB,KAAK,GAAG,EAC9B,sBAAuB,KAAK,GAAG,CACjC,EAEA,WAAW,IAAM,CACf,KAAK,gBAAgB,EACrB,KACG,MAAMA,EAA2B,sBAAsB,EACvD,qBAAkB,SAAM,SAAS,CAAC,CACvC,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,0DAA2D,IAAM,CAClE,MAAMC,EAAc,CAAC,EACfC,EAAS,IAAI,2BAAyBF,CAAyB,EAC/DG,EAAU,IAAMD,EAAO,KAAKD,CAAW,EAE7C,OAAOE,EAAQ,CAAC,EAAE,SAAS,QAAQ,CAAC,CAAC,CACvC,CAAC,EAED,GAAG,kDAAmD,SAAY,CAChE,MAAMF,EAAc,CAClB,OAAQ,6DACV,EAGMG,EAAS,MADA,IAAI,2BAAyBJ,CAAyB,EACzC,KAAKC,CAAW,EAE5C,OAAOG,CAAM,EAAE,QAAQ,CACrB,CACE,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,mDAAmD,CACtE,CACF,CAAC,CACH,CAAC,EAED,GAAG,kDAAmD,SAAY,CAChE,MAAMH,EAAc,CAClB,OAAQ,gBACV,EAGMG,EAAS,MADA,IAAI,2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AAyBJ,CAAyB,EACzC,UAAUK,CAAK,EAG3C,OAAOD,CAAM,EAAE,QAAQ,CACrB,KAAM,uBAAqB,aAC3B,QAAS,SACX,CAAC,CACH,CAAC,EAED,GAAG,6DAA8D,SAAY,CAE3E,MAAMC,EAAiC,CACrC,KAAM,uBAAqB,aAC3B,QAAS,EACT,QAAS,SACT,UAAW,KACX,QAAS,CAAC,KAAK,EACf,MAAO,CAAC,KAAK,CACf,EAGA,KACG,MAAML,EAA2B,uBAAuB,EACxD,qBAAkB,QAAK,IAAI,MAAM,OAAO,CAAC,CAAC,EAE7C,MAAMI,EAAS,MADA,IAAI,2BAAyBJ,CAAyB,EACzC,UAAUK,CAAK,EAG3C,OAAOD,CAAM,EAAE,QAAQ,CACrB,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,OAAO,CAC1B,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["import_purify_ts", "import_ClearSignContext", "import_TrustedNameContextLoader", "mockTrustedNameDataSource", "transaction", "loader", "promise", "result", "field"]
7
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FiltersDto.js.map
1
+ "use strict";var i=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of p(t))!a.call(e,n)&&n!==s&&i(e,n,{get:()=>t[n],enumerable:!(r=o(t,n))||r.enumerable});return e};var d=e=>c(i({},"__esModule",{value:!0}),e);var u={};module.exports=d(u);
2
+ //# sourceMappingURL=FiltersDto.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"FiltersDto.js","sourceRoot":"","sources":["../../../../../src/typed-data/data/FiltersDto.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/typed-data/data/FiltersDto.ts"],
4
+ "sourcesContent": ["export type InstructionSignatures =\n | {\n prod: string;\n test?: string;\n }\n | {\n prod?: string;\n test: string;\n };\n\nexport type InstructionFieldV1 = {\n display_name: string;\n field_mappers_count?: never;\n field_path: string;\n signatures: InstructionSignatures;\n type: \"field\" | \"message\";\n format?: never;\n};\n\nexport type InstructionFieldV2 = {\n display_name: string;\n field_mappers_count?: never;\n field_path: string;\n descriptor: string;\n signatures: InstructionSignatures;\n format: \"raw\" | \"datetime\";\n coin_ref?: never;\n type: \"field\" | \"message\";\n};\n\nexport type InstructionFieldV2WithCoinRef = {\n display_name: string;\n field_mappers_count?: never;\n format: \"token\" | \"amount\";\n field_path: string;\n coin_ref: number;\n descriptor: string;\n signatures: InstructionSignatures;\n type: \"field\";\n};\n\nexport type InstructionContractInfo = {\n display_name: string;\n field_mappers_count: number;\n field_path?: never;\n descriptor: string;\n signatures: InstructionSignatures;\n type: \"message\";\n};\n\nexport type InstructionField =\n | InstructionFieldV1\n | InstructionFieldV2\n | InstructionFieldV2WithCoinRef\n | InstructionContractInfo;\n\nexport type FiltersDto = {\n descriptors_eip712: {\n [contractAddress: string]: {\n [schemaHash: string]: {\n schema: Record<string, { name: string; type: string }[]>;\n instructions: InstructionField[];\n };\n };\n };\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["FiltersDto_exports", "__toCommonJS"]
7
+ }
@@ -1,163 +1,2 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var __importDefault = (this && this.__importDefault) || function (mod) {
15
- return (mod && mod.__esModule) ? mod : { "default": mod };
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.HttpTypedDataDataSource = void 0;
19
- const axios_1 = __importDefault(require("axios"));
20
- const sha224_1 = __importDefault(require("crypto-js/sha224"));
21
- const inversify_1 = require("inversify");
22
- const purify_ts_1 = require("purify-ts");
23
- const configTypes_1 = require("../../config/di/configTypes");
24
- const package_json_1 = __importDefault(require("../../../package.json"));
25
- let HttpTypedDataDataSource = class HttpTypedDataDataSource {
26
- config;
27
- constructor(config) {
28
- this.config = config;
29
- }
30
- async getTypedDataFilters({ chainId, address, schema, version, }) {
31
- let messageInfo = undefined;
32
- try {
33
- const response = await axios_1.default.request({
34
- method: "GET",
35
- url: `${this.config.cal.url}/dapps`,
36
- params: {
37
- contracts: address,
38
- chain_id: chainId,
39
- output: "descriptors_eip712",
40
- descriptors_eip712_version: version,
41
- descriptors_eip712: "<set>",
42
- ref: `branch:${this.config.cal.branch}`,
43
- },
44
- headers: {
45
- "X-Ledger-Client-Version": `context-module/${package_json_1.default.version}`,
46
- },
47
- });
48
- // Try to get the filters JSON descriptor, from address and schema hash
49
- const schemaHash = (0, sha224_1.default)(JSON.stringify(this.sortTypes(schema)).replace(" ", "")).toString();
50
- address = address.toLowerCase();
51
- const filtersJson = response.data?.[0]?.descriptors_eip712?.[address]?.[schemaHash];
52
- if (!filtersJson) {
53
- return (0, purify_ts_1.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${address} on chain ${chainId} for schema ${schemaHash}`));
54
- }
55
- // Parse the message type, if available
56
- if (!filtersJson.schema || !Array.isArray(filtersJson.instructions)) {
57
- return (0, purify_ts_1.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`));
58
- }
59
- // Parse all the filters
60
- const filters = [];
61
- for (const field of filtersJson.instructions) {
62
- if (this.isInstructionContractInfo(field)) {
63
- messageInfo = {
64
- displayName: field.display_name,
65
- signature: field.signatures[this.config.cal.mode],
66
- filtersCount: field.field_mappers_count,
67
- };
68
- }
69
- else if (version === "v1" && this.isInstructionFieldV1(field)) {
70
- filters.push({
71
- type: "raw",
72
- displayName: field.display_name,
73
- path: field.field_path,
74
- signature: field.signatures[this.config.cal.mode],
75
- });
76
- }
77
- else if (this.isInstructionFieldV2(field)) {
78
- filters.push({
79
- type: field.format,
80
- displayName: field.display_name,
81
- path: field.field_path,
82
- signature: field.signatures[this.config.cal.mode],
83
- });
84
- }
85
- else if (this.isInstructionFieldV2WithCoinRef(field)) {
86
- filters.push({
87
- type: field.format,
88
- displayName: field.display_name,
89
- path: field.field_path,
90
- signature: field.signatures[this.config.cal.mode],
91
- tokenIndex: field.coin_ref,
92
- });
93
- }
94
- else {
95
- return (0, purify_ts_1.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${address} on chain ${chainId} for schema ${schemaHash}`));
96
- }
97
- }
98
- if (!messageInfo) {
99
- return (0, purify_ts_1.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`));
100
- }
101
- return (0, purify_ts_1.Right)({ messageInfo, filters });
102
- }
103
- catch (_error) {
104
- return (0, purify_ts_1.Left)(new Error("[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations"));
105
- }
106
- }
107
- isInstructionFieldV1(data) {
108
- // NOTE: Currently the backend return the same structure for V1 and V2,
109
- // so we can't distinguish them here, but we can still check the required fields
110
- return (typeof data === "object" &&
111
- typeof data.display_name === "string" &&
112
- typeof data.field_path === "string" &&
113
- typeof data.signatures === "object" &&
114
- typeof data.signatures.prod === "string" &&
115
- typeof data.signatures.test === "string");
116
- }
117
- isInstructionFieldV2(data) {
118
- return (typeof data === "object" &&
119
- typeof data.display_name === "string" &&
120
- typeof data.field_path === "string" &&
121
- typeof data.signatures === "object" &&
122
- typeof data.signatures.prod === "string" &&
123
- typeof data.signatures.test === "string" &&
124
- typeof data.format === "string" &&
125
- ["raw", "datetime"].includes(data.format) &&
126
- data.coin_ref === undefined);
127
- }
128
- isInstructionFieldV2WithCoinRef(data) {
129
- return (typeof data === "object" &&
130
- typeof data.display_name === "string" &&
131
- typeof data.field_path === "string" &&
132
- typeof data.signatures === "object" &&
133
- typeof data.signatures.prod === "string" &&
134
- typeof data.signatures.test === "string" &&
135
- typeof data.format === "string" &&
136
- ["token", "amount"].includes(data.format) &&
137
- typeof data.coin_ref === "number");
138
- }
139
- isInstructionContractInfo(data) {
140
- return (typeof data === "object" &&
141
- typeof data.display_name === "string" &&
142
- typeof data.field_mappers_count === "number" &&
143
- typeof data.signatures === "object" &&
144
- typeof data.signatures.prod === "string" &&
145
- typeof data.signatures.test === "string" &&
146
- data.field_path === undefined);
147
- }
148
- sortTypes(types) {
149
- return Object.fromEntries(Object.entries(types)
150
- .sort(([aKey], [bKey]) => aKey.localeCompare(bKey))
151
- .map(([key, value]) => [
152
- key,
153
- value.map((v) => ({ name: v.name, type: v.type })),
154
- ]));
155
- }
156
- };
157
- exports.HttpTypedDataDataSource = HttpTypedDataDataSource;
158
- exports.HttpTypedDataDataSource = HttpTypedDataDataSource = __decorate([
159
- (0, inversify_1.injectable)(),
160
- __param(0, (0, inversify_1.inject)(configTypes_1.configTypes.Config)),
161
- __metadata("design:paramtypes", [Object])
162
- ], HttpTypedDataDataSource);
163
- //# sourceMappingURL=HttpTypedDataDataSource.js.map
1
+ "use strict";var x=Object.create;var f=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var V=(o,e)=>{for(var t in e)f(o,t,{get:e[t],enumerable:!0})},h=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of T(e))!$.call(o,i)&&i!==t&&f(o,i,{get:()=>e[i],enumerable:!(r=g(e,i))||r.enumerable});return o};var y=(o,e,t)=>(t=o!=null?x(b(o)):{},h(e||!o||!o.__esModule?f(t,"default",{value:o,enumerable:!0}):t,o)),j=o=>h(f({},"__esModule",{value:!0}),o),C=(o,e,t,r)=>{for(var i=r>1?void 0:r?g(e,t):e,a=o.length-1,p;a>=0;a--)(p=o[a])&&(i=(r?p(e,t,i):p(i))||i);return r&&i&&f(e,t,i),i},_=(o,e)=>(t,r)=>e(t,r,o);var E={};V(E,{HttpTypedDataDataSource:()=>c});module.exports=j(E);var F=y(require("axios")),M=y(require("crypto-js/sha224")),m=require("inversify"),s=require("purify-ts"),D=require("../../config/di/configTypes"),I=y(require("../../../package.json"));let c=class{constructor(e){this.config=e}async getTypedDataFilters({chainId:e,address:t,schema:r,version:i}){let a;try{const p=await F.default.request({method:"GET",url:`${this.config.cal.url}/dapps`,params:{contracts:t,chain_id:e,output:"descriptors_eip712",descriptors_eip712_version:i,descriptors_eip712:"<set>",ref:`branch:${this.config.cal.branch}`},headers:{"X-Ledger-Client-Version":`context-module/${I.default.version}`}}),l=(0,M.default)(JSON.stringify(this.sortTypes(r)).replace(" ","")).toString();t=t.toLowerCase();const d=p.data?.[0]?.descriptors_eip712?.[t]?.[l];if(!d)return(0,s.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${t} on chain ${e} for schema ${l}`));if(!d.schema||!Array.isArray(d.instructions))return(0,s.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${t} on chain ${e} for schema ${l}`));const u=[];for(const n of d.instructions)if(this.isInstructionContractInfo(n,this.config.cal.mode))a={displayName:n.display_name,signature:n.signatures[this.config.cal.mode],filtersCount:n.field_mappers_count};else if(i==="v1"&&this.isInstructionFieldV1(n,this.config.cal.mode))u.push({type:"raw",displayName:n.display_name,path:n.field_path,signature:n.signatures[this.config.cal.mode]});else if(this.isInstructionFieldV2(n,this.config.cal.mode))u.push({type:n.format,displayName:n.display_name,path:n.field_path,signature:n.signatures[this.config.cal.mode]});else if(this.isInstructionFieldV2WithCoinRef(n,this.config.cal.mode))u.push({type:n.format,displayName:n.display_name,path:n.field_path,signature:n.signatures[this.config.cal.mode],tokenIndex:n.coin_ref});else return(0,s.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${t} on chain ${e} for schema ${l}`));return a?(0,s.Right)({messageInfo:a,filters:u}):(0,s.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${t} on chain ${e} for schema ${l}`))}catch{return(0,s.Left)(new Error("[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations"))}}isInstructionFieldV1(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"}isInstructionFieldV2(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"&&typeof e.format=="string"&&["raw","datetime"].includes(e.format)&&e.coin_ref===void 0}isInstructionFieldV2WithCoinRef(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"&&typeof e.format=="string"&&["token","amount"].includes(e.format)&&typeof e.coin_ref=="number"}isInstructionContractInfo(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_mappers_count=="number"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"&&e.field_path===void 0}sortTypes(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>[t,r.map(i=>({name:i.name,type:i.type}))]))}};c=C([(0,m.injectable)(),_(0,(0,m.inject)(D.configTypes.Config))],c);0&&(module.exports={HttpTypedDataDataSource});
2
+ //# sourceMappingURL=HttpTypedDataDataSource.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"HttpTypedDataDataSource.js","sourceRoot":"","sources":["../../../../../src/typed-data/data/HttpTypedDataDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,8DAAsC;AACtC,yCAA+C;AAC/C,yCAAgD;AAEhD,yDAAsD;AAOtD,sEAAyC;AAiBlC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAEa;IAD/C,YAC+C,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;IACvE,CAAC;IAEG,KAAK,CAAC,mBAAmB,CAAC,EAC/B,OAAO,EACP,OAAO,EACP,MAAM,EACN,OAAO,GACmB;QAG1B,IAAI,WAAW,GAAqC,SAAS,CAAC;QAE9D,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,OAAO,CAAe;gBACjD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ;gBACnC,MAAM,EAAE;oBACN,SAAS,EAAE,OAAO;oBAClB,QAAQ,EAAE,OAAO;oBACjB,MAAM,EAAE,oBAAoB;oBAC5B,0BAA0B,EAAE,OAAO;oBACnC,kBAAkB,EAAE,OAAO;oBAC3B,GAAG,EAAE,UAAU,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE;iBACxC;gBACD,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,sBAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,uEAAuE;YACvE,MAAM,UAAU,GAAG,IAAA,gBAAM,EACvB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CACxD,CAAC,QAAQ,EAAE,CAAC;YACb,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YAChC,MAAM,WAAW,GACf,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.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport SHA224 from \"crypto-js/sha224\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type {\n ContextModuleCalMode,\n ContextModuleConfig,\n} from \"@/config/model/ContextModuleConfig\";\nimport type {\n TypedDataFilter,\n TypedDataMessageInfo,\n} from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataSchema } from \"@/shared/model/TypedDataContext\";\nimport PACKAGE from \"@root/package.json\";\n\nimport type {\n FiltersDto,\n InstructionContractInfo,\n InstructionField,\n InstructionFieldV1,\n InstructionFieldV2,\n InstructionFieldV2WithCoinRef,\n} from \"./FiltersDto\";\nimport {\n GetTypedDataFiltersParams,\n GetTypedDataFiltersResult,\n TypedDataDataSource,\n} from \"./TypedDataDataSource\";\n\n@injectable()\nexport class HttpTypedDataDataSource implements TypedDataDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n public async getTypedDataFilters({\n chainId,\n address,\n schema,\n version,\n }: GetTypedDataFiltersParams): Promise<\n Either<Error, GetTypedDataFiltersResult>\n > {\n let messageInfo: TypedDataMessageInfo | undefined = undefined;\n\n try {\n const response = await axios.request<FiltersDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/dapps`,\n params: {\n contracts: address,\n chain_id: chainId,\n output: \"descriptors_eip712\",\n descriptors_eip712_version: version,\n descriptors_eip712: \"<set>\",\n ref: `branch:${this.config.cal.branch}`,\n },\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n // Try to get the filters JSON descriptor, from address and schema hash\n const schemaHash = SHA224(\n JSON.stringify(this.sortTypes(schema)).replace(\" \", \"\"),\n ).toString();\n address = address.toLowerCase();\n const filtersJson =\n response.data?.[0]?.descriptors_eip712?.[address]?.[schemaHash];\n if (!filtersJson) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n // Parse the message type, if available\n if (!filtersJson.schema || !Array.isArray(filtersJson.instructions)) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n // Parse all the filters\n const filters: TypedDataFilter[] = [];\n for (const field of filtersJson.instructions) {\n if (this.isInstructionContractInfo(field, this.config.cal.mode)) {\n messageInfo = {\n displayName: field.display_name,\n signature: field.signatures[this.config.cal.mode],\n filtersCount: field.field_mappers_count,\n };\n } else if (\n version === \"v1\" &&\n this.isInstructionFieldV1(field, this.config.cal.mode)\n ) {\n filters.push({\n type: \"raw\",\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n });\n } else if (this.isInstructionFieldV2(field, this.config.cal.mode)) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n });\n } else if (\n this.isInstructionFieldV2WithCoinRef(field, this.config.cal.mode)\n ) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n tokenIndex: field.coin_ref,\n });\n } else {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n }\n\n if (!messageInfo) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n return Right({ messageInfo, filters });\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations\",\n ),\n );\n }\n }\n\n private isInstructionFieldV1(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV1 & {\n signatures: { [key in ContextModuleCalMode]: string };\n } {\n // NOTE: Currently the backend return the same structure for V1 and V2,\n // so we can't distinguish them here, but we can still check the required fields\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\"\n );\n }\n\n private isInstructionFieldV2(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2 & {\n signatures: { [key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\"raw\", \"datetime\"].includes(data.format) &&\n data.coin_ref === undefined\n );\n }\n\n private isInstructionFieldV2WithCoinRef(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2WithCoinRef & {\n signatures: { [key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\"token\", \"amount\"].includes(data.format) &&\n typeof data.coin_ref === \"number\"\n );\n }\n\n private isInstructionContractInfo(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionContractInfo & {\n signatures: { [key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_mappers_count === \"number\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n data.field_path === undefined\n );\n }\n\n private sortTypes(types: TypedDataSchema): TypedDataSchema {\n return Object.fromEntries(\n Object.entries(types)\n .sort(([aKey], [bKey]) => aKey.localeCompare(bKey))\n .map(([key, value]) => [\n key,\n value.map((v) => ({ name: v.name, type: v.type })),\n ]),\n );\n }\n}\n"],
5
+ "mappings": "qtBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA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e,UAC3B,OAAOA,EAAK,WAAWC,CAAI,GAAM,UACjC,OAAOD,EAAK,QAAW,UACvB,CAAC,MAAO,UAAU,EAAE,SAASA,EAAK,MAAM,GACxCA,EAAK,WAAa,MAEtB,CAEQ,gCACNA,EACAC,EAGA,CACA,OACE,OAAOD,GAAS,UAChB,OAAOA,EAAK,cAAiB,UAC7B,OAAOA,EAAK,YAAe,UAC3B,OAAOA,EAAK,YAAe,UAC3B,OAAOA,EAAK,WAAWC,CAAI,GAAM,UACjC,OAAOD,EAAK,QAAW,UACvB,CAAC,QAAS,QAAQ,EAAE,SAASA,EAAK,MAAM,GACxC,OAAOA,EAAK,UAAa,QAE7B,CAEQ,0BACNA,EACAC,EAGA,CACA,OACE,OAAOD,GAAS,UAChB,OAAOA,EAAK,cAAiB,UAC7B,OAAOA,EAAK,qBAAwB,UACpC,OAAOA,EAAK,YAAe,UAC3B,OAAOA,EAAK,WAAWC,CAAI,GAAM,UACjCD,EAAK,aAAe,MAExB,CAEQ,UAAUE,EAAyC,CACzD,OAAO,OAAO,YACZ,OAAO,QAAQA,CAAK,EACjB,KAAK,CAAC,CAACC,CAAI,EAAG,CAACC,CAAI,IAAMD,EAAK,cAAcC,CAAI,CAAC,EACjD,IAAI,CAAC,CAACC,EAAKC,CAAK,IAAM,CACrBD,EACAC,EAAM,IAAKC,IAAO,CAAE,KAAMA,EAAE,KAAM,KAAMA,EAAE,IAAK,EAAE,CACnD,CAAC,CACL,CACF,CACF,EAtMatB,EAANuB,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,cAAY,MAAM,IAFjBxB",
6
+ "names": ["HttpTypedDataDataSource_exports", "__export", "HttpTypedDataDataSource", "__toCommonJS", "import_axios", "import_sha224", "import_inversify", "import_purify_ts", "import_configTypes", "import_package", "HttpTypedDataDataSource", "config", "chainId", "address", "schema", "version", "messageInfo", "response", "axios", "PACKAGE", "schemaHash", "SHA224", "filtersJson", "filters", "field", "data", "mode", "types", "aKey", "bKey", "key", "value", "v", "__decorateClass", "__decorateParam"]
7
+ }