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

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 (413) hide show
  1. package/LICENSE.MD +202 -0
  2. package/lib/cjs/index.js +1126 -19
  3. package/lib/cjs/index.js.map +7 -1
  4. package/lib/esm/index.js +37618 -4
  5. package/lib/esm/index.js.map +7 -1
  6. package/lib/types/src/ContextModuleBuilder.test.d.ts +2 -0
  7. package/lib/types/src/ContextModuleBuilder.test.d.ts.map +1 -0
  8. package/lib/types/src/DefaultContextModule.test.d.ts +2 -0
  9. package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
  10. package/lib/types/src/config/model/ContextModuleConfig.d.ts +11 -0
  11. package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -0
  12. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts +2 -0
  13. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts.map +1 -0
  14. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts +2 -0
  15. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts.map +1 -0
  16. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.test.d.ts +2 -0
  17. package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.test.d.ts.map +1 -0
  18. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.test.d.ts +2 -0
  19. package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.test.d.ts.map +1 -0
  20. package/lib/{cjs → types}/src/index.d.ts +1 -0
  21. package/lib/{cjs → types}/src/index.d.ts.map +1 -1
  22. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts +2 -0
  23. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts.map +1 -0
  24. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts +2 -0
  25. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts.map +1 -0
  26. package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
  27. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
  28. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
  29. package/lib/types/src/token/data/TokenDto.d.ts +16 -0
  30. package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
  31. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
  32. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
  33. package/lib/{esm → types}/src/typed-data/data/FiltersDto.d.ts +3 -0
  34. package/lib/types/src/typed-data/data/FiltersDto.d.ts.map +1 -0
  35. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -0
  36. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +3 -0
  37. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -0
  38. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
  39. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
  40. package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
  41. package/package.json +14 -22
  42. package/lib/cjs/package.json +0 -63
  43. package/lib/cjs/src/ContextModule.js +0 -3
  44. package/lib/cjs/src/ContextModule.js.map +0 -1
  45. package/lib/cjs/src/ContextModuleBuilder.js +0 -87
  46. package/lib/cjs/src/ContextModuleBuilder.js.map +0 -1
  47. package/lib/cjs/src/DefaultContextModule.js +0 -21
  48. package/lib/cjs/src/DefaultContextModule.js.map +0 -1
  49. package/lib/cjs/src/config/di/configModuleFactory.js +0 -10
  50. package/lib/cjs/src/config/di/configModuleFactory.js.map +0 -1
  51. package/lib/cjs/src/config/di/configTypes.js +0 -7
  52. package/lib/cjs/src/config/di/configTypes.js.map +0 -1
  53. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts +0 -9
  54. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  55. package/lib/cjs/src/config/model/ContextModuleConfig.js +0 -3
  56. package/lib/cjs/src/config/model/ContextModuleConfig.js.map +0 -1
  57. package/lib/cjs/src/di.js +0 -17
  58. package/lib/cjs/src/di.js.map +0 -1
  59. package/lib/cjs/src/external-plugin/data/DAppDto.js +0 -3
  60. package/lib/cjs/src/external-plugin/data/DAppDto.js.map +0 -1
  61. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +0 -3
  62. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +0 -1
  63. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +0 -83
  64. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +0 -1
  65. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +0 -13
  66. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +0 -1
  67. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +0 -8
  68. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +0 -1
  69. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +0 -136
  70. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +0 -1
  71. package/lib/cjs/src/external-plugin/model/DappInfos.js +0 -3
  72. package/lib/cjs/src/external-plugin/model/DappInfos.js.map +0 -1
  73. package/lib/cjs/src/external-plugin/model/SelectorDetails.js +0 -3
  74. package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +0 -1
  75. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js +0 -3
  76. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  77. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -40
  78. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  79. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js +0 -13
  80. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  81. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js +0 -8
  82. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  83. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -66
  84. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  85. package/lib/cjs/src/index.js +0 -30
  86. package/lib/cjs/src/index.js.map +0 -1
  87. package/lib/cjs/src/nft/data/HttpNftDataSource.js +0 -57
  88. package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +0 -1
  89. package/lib/cjs/src/nft/data/NftDataSource.js +0 -3
  90. package/lib/cjs/src/nft/data/NftDataSource.js.map +0 -1
  91. package/lib/cjs/src/nft/di/nftModuleFactory.js +0 -13
  92. package/lib/cjs/src/nft/di/nftModuleFactory.js.map +0 -1
  93. package/lib/cjs/src/nft/di/nftTypes.js +0 -8
  94. package/lib/cjs/src/nft/di/nftTypes.js.map +0 -1
  95. package/lib/cjs/src/nft/domain/NftContextLoader.js +0 -111
  96. package/lib/cjs/src/nft/domain/NftContextLoader.js.map +0 -1
  97. package/lib/cjs/src/shared/domain/ContextLoader.js +0 -3
  98. package/lib/cjs/src/shared/domain/ContextLoader.js.map +0 -1
  99. package/lib/cjs/src/shared/model/ClearSignContext.js +0 -13
  100. package/lib/cjs/src/shared/model/ClearSignContext.js.map +0 -1
  101. package/lib/cjs/src/shared/model/TransactionContext.js +0 -3
  102. package/lib/cjs/src/shared/model/TransactionContext.js.map +0 -1
  103. package/lib/cjs/src/shared/model/TransactionSubset.js +0 -3
  104. package/lib/cjs/src/shared/model/TransactionSubset.js.map +0 -1
  105. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +0 -6
  106. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +0 -1
  107. package/lib/cjs/src/shared/model/TypedDataContext.js +0 -3
  108. package/lib/cjs/src/shared/model/TypedDataContext.js.map +0 -1
  109. package/lib/cjs/src/shared/utils/HexStringUtils.js +0 -15
  110. package/lib/cjs/src/shared/utils/HexStringUtils.js.map +0 -1
  111. package/lib/cjs/src/token/data/HttpTokenDataSource.js +0 -83
  112. package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +0 -1
  113. package/lib/cjs/src/token/data/TokenDataSource.js +0 -3
  114. package/lib/cjs/src/token/data/TokenDataSource.js.map +0 -1
  115. package/lib/cjs/src/token/data/TokenDto.d.ts +0 -6
  116. package/lib/cjs/src/token/data/TokenDto.d.ts.map +0 -1
  117. package/lib/cjs/src/token/data/TokenDto.js +0 -3
  118. package/lib/cjs/src/token/data/TokenDto.js.map +0 -1
  119. package/lib/cjs/src/token/di/tokenModuleFactory.js +0 -13
  120. package/lib/cjs/src/token/di/tokenModuleFactory.js.map +0 -1
  121. package/lib/cjs/src/token/di/tokenTypes.js +0 -8
  122. package/lib/cjs/src/token/di/tokenTypes.js.map +0 -1
  123. package/lib/cjs/src/token/domain/TokenContextLoader.js +0 -74
  124. package/lib/cjs/src/token/domain/TokenContextLoader.js.map +0 -1
  125. package/lib/cjs/src/typed-data/data/FiltersDto.d.ts +0 -55
  126. package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  127. package/lib/cjs/src/typed-data/data/FiltersDto.js +0 -3
  128. package/lib/cjs/src/typed-data/data/FiltersDto.js.map +0 -1
  129. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  130. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +0 -163
  131. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +0 -1
  132. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +0 -3
  133. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +0 -1
  134. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +0 -13
  135. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +0 -1
  136. package/lib/cjs/src/typed-data/di/typedDataTypes.js +0 -8
  137. package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +0 -1
  138. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +0 -127
  139. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +0 -1
  140. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +0 -3
  141. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +0 -1
  142. package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  143. package/lib/esm/index.d.ts +0 -3
  144. package/lib/esm/index.d.ts.map +0 -1
  145. package/lib/esm/package.json +0 -63
  146. package/lib/esm/src/ContextModule.d.ts +0 -9
  147. package/lib/esm/src/ContextModule.d.ts.map +0 -1
  148. package/lib/esm/src/ContextModule.js +0 -2
  149. package/lib/esm/src/ContextModule.js.map +0 -1
  150. package/lib/esm/src/ContextModuleBuilder.d.ts +0 -45
  151. package/lib/esm/src/ContextModuleBuilder.d.ts.map +0 -1
  152. package/lib/esm/src/ContextModuleBuilder.js +0 -83
  153. package/lib/esm/src/ContextModuleBuilder.js.map +0 -1
  154. package/lib/esm/src/DefaultContextModule.d.ts +0 -20
  155. package/lib/esm/src/DefaultContextModule.d.ts.map +0 -1
  156. package/lib/esm/src/DefaultContextModule.js +0 -17
  157. package/lib/esm/src/DefaultContextModule.js.map +0 -1
  158. package/lib/esm/src/config/di/configModuleFactory.d.ts +0 -4
  159. package/lib/esm/src/config/di/configModuleFactory.d.ts.map +0 -1
  160. package/lib/esm/src/config/di/configModuleFactory.js +0 -6
  161. package/lib/esm/src/config/di/configModuleFactory.js.map +0 -1
  162. package/lib/esm/src/config/di/configTypes.d.ts +0 -4
  163. package/lib/esm/src/config/di/configTypes.d.ts.map +0 -1
  164. package/lib/esm/src/config/di/configTypes.js +0 -4
  165. package/lib/esm/src/config/di/configTypes.js.map +0 -1
  166. package/lib/esm/src/config/model/ContextModuleConfig.d.ts +0 -9
  167. package/lib/esm/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  168. package/lib/esm/src/config/model/ContextModuleConfig.js +0 -2
  169. package/lib/esm/src/config/model/ContextModuleConfig.js.map +0 -1
  170. package/lib/esm/src/di.d.ts +0 -8
  171. package/lib/esm/src/di.d.ts.map +0 -1
  172. package/lib/esm/src/di.js +0 -13
  173. package/lib/esm/src/di.js.map +0 -1
  174. package/lib/esm/src/external-plugin/data/DAppDto.d.ts +0 -38
  175. package/lib/esm/src/external-plugin/data/DAppDto.d.ts.map +0 -1
  176. package/lib/esm/src/external-plugin/data/DAppDto.js +0 -2
  177. package/lib/esm/src/external-plugin/data/DAppDto.js.map +0 -1
  178. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -12
  179. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  180. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +0 -2
  181. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +0 -1
  182. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -10
  183. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -1
  184. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +0 -77
  185. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +0 -1
  186. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -3
  187. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -1
  188. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +0 -9
  189. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +0 -1
  190. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts +0 -5
  191. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -1
  192. package/lib/esm/src/external-plugin/di/externalPluginTypes.js +0 -5
  193. package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +0 -1
  194. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -15
  195. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -1
  196. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +0 -133
  197. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +0 -1
  198. package/lib/esm/src/external-plugin/model/DappInfos.d.ts +0 -6
  199. package/lib/esm/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  200. package/lib/esm/src/external-plugin/model/DappInfos.js +0 -2
  201. package/lib/esm/src/external-plugin/model/DappInfos.js.map +0 -1
  202. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts +0 -8
  203. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts.map +0 -1
  204. package/lib/esm/src/external-plugin/model/SelectorDetails.js +0 -2
  205. package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +0 -1
  206. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  207. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  208. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js +0 -2
  209. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  210. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  211. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  212. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -34
  213. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  214. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  215. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  216. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js +0 -9
  217. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  218. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  219. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  220. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js +0 -5
  221. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  222. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  223. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  224. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -63
  225. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  226. package/lib/esm/src/index.d.ts +0 -14
  227. package/lib/esm/src/index.d.ts.map +0 -1
  228. package/lib/esm/src/index.js +0 -14
  229. package/lib/esm/src/index.js.map +0 -1
  230. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts +0 -7
  231. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts.map +0 -1
  232. package/lib/esm/src/nft/data/HttpNftDataSource.js +0 -51
  233. package/lib/esm/src/nft/data/HttpNftDataSource.js.map +0 -1
  234. package/lib/esm/src/nft/data/NftDataSource.d.ts +0 -15
  235. package/lib/esm/src/nft/data/NftDataSource.d.ts.map +0 -1
  236. package/lib/esm/src/nft/data/NftDataSource.js +0 -2
  237. package/lib/esm/src/nft/data/NftDataSource.js.map +0 -1
  238. package/lib/esm/src/nft/di/nftModuleFactory.d.ts +0 -3
  239. package/lib/esm/src/nft/di/nftModuleFactory.d.ts.map +0 -1
  240. package/lib/esm/src/nft/di/nftModuleFactory.js +0 -9
  241. package/lib/esm/src/nft/di/nftModuleFactory.js.map +0 -1
  242. package/lib/esm/src/nft/di/nftTypes.d.ts +0 -5
  243. package/lib/esm/src/nft/di/nftTypes.d.ts.map +0 -1
  244. package/lib/esm/src/nft/di/nftTypes.js +0 -5
  245. package/lib/esm/src/nft/di/nftTypes.js.map +0 -1
  246. package/lib/esm/src/nft/domain/NftContextLoader.d.ts +0 -11
  247. package/lib/esm/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  248. package/lib/esm/src/nft/domain/NftContextLoader.js +0 -108
  249. package/lib/esm/src/nft/domain/NftContextLoader.js.map +0 -1
  250. package/lib/esm/src/shared/domain/ContextLoader.d.ts +0 -6
  251. package/lib/esm/src/shared/domain/ContextLoader.d.ts.map +0 -1
  252. package/lib/esm/src/shared/domain/ContextLoader.js +0 -2
  253. package/lib/esm/src/shared/domain/ContextLoader.js.map +0 -1
  254. package/lib/esm/src/shared/model/ClearSignContext.d.ts +0 -21
  255. package/lib/esm/src/shared/model/ClearSignContext.d.ts.map +0 -1
  256. package/lib/esm/src/shared/model/ClearSignContext.js +0 -10
  257. package/lib/esm/src/shared/model/ClearSignContext.js.map +0 -1
  258. package/lib/esm/src/shared/model/TransactionContext.d.ts +0 -6
  259. package/lib/esm/src/shared/model/TransactionContext.d.ts.map +0 -1
  260. package/lib/esm/src/shared/model/TransactionContext.js +0 -2
  261. package/lib/esm/src/shared/model/TransactionContext.js.map +0 -1
  262. package/lib/esm/src/shared/model/TransactionSubset.d.ts +0 -6
  263. package/lib/esm/src/shared/model/TransactionSubset.d.ts.map +0 -1
  264. package/lib/esm/src/shared/model/TransactionSubset.js +0 -2
  265. package/lib/esm/src/shared/model/TransactionSubset.js.map +0 -1
  266. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts +0 -33
  267. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -1
  268. package/lib/esm/src/shared/model/TypedDataClearSignContext.js +0 -3
  269. package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +0 -1
  270. package/lib/esm/src/shared/model/TypedDataContext.d.ts +0 -16
  271. package/lib/esm/src/shared/model/TypedDataContext.d.ts.map +0 -1
  272. package/lib/esm/src/shared/model/TypedDataContext.js +0 -2
  273. package/lib/esm/src/shared/model/TypedDataContext.js.map +0 -1
  274. package/lib/esm/src/shared/utils/HexStringUtils.d.ts +0 -4
  275. package/lib/esm/src/shared/utils/HexStringUtils.d.ts.map +0 -1
  276. package/lib/esm/src/shared/utils/HexStringUtils.js +0 -11
  277. package/lib/esm/src/shared/utils/HexStringUtils.js.map +0 -1
  278. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts +0 -9
  279. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts.map +0 -1
  280. package/lib/esm/src/token/data/HttpTokenDataSource.js +0 -77
  281. package/lib/esm/src/token/data/HttpTokenDataSource.js.map +0 -1
  282. package/lib/esm/src/token/data/TokenDataSource.d.ts +0 -9
  283. package/lib/esm/src/token/data/TokenDataSource.d.ts.map +0 -1
  284. package/lib/esm/src/token/data/TokenDataSource.js +0 -2
  285. package/lib/esm/src/token/data/TokenDataSource.js.map +0 -1
  286. package/lib/esm/src/token/data/TokenDto.d.ts +0 -6
  287. package/lib/esm/src/token/data/TokenDto.d.ts.map +0 -1
  288. package/lib/esm/src/token/data/TokenDto.js +0 -2
  289. package/lib/esm/src/token/data/TokenDto.js.map +0 -1
  290. package/lib/esm/src/token/di/tokenModuleFactory.d.ts +0 -3
  291. package/lib/esm/src/token/di/tokenModuleFactory.d.ts.map +0 -1
  292. package/lib/esm/src/token/di/tokenModuleFactory.js +0 -9
  293. package/lib/esm/src/token/di/tokenModuleFactory.js.map +0 -1
  294. package/lib/esm/src/token/di/tokenTypes.d.ts +0 -5
  295. package/lib/esm/src/token/di/tokenTypes.d.ts.map +0 -1
  296. package/lib/esm/src/token/di/tokenTypes.js +0 -5
  297. package/lib/esm/src/token/di/tokenTypes.js.map +0 -1
  298. package/lib/esm/src/token/domain/TokenContextLoader.d.ts +0 -15
  299. package/lib/esm/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  300. package/lib/esm/src/token/domain/TokenContextLoader.js +0 -71
  301. package/lib/esm/src/token/domain/TokenContextLoader.js.map +0 -1
  302. package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  303. package/lib/esm/src/typed-data/data/FiltersDto.js +0 -2
  304. package/lib/esm/src/typed-data/data/FiltersDto.js.map +0 -1
  305. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -14
  306. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  307. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +0 -157
  308. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +0 -1
  309. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts +0 -17
  310. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  311. package/lib/esm/src/typed-data/data/TypedDataDataSource.js +0 -2
  312. package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +0 -1
  313. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts +0 -3
  314. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -1
  315. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +0 -9
  316. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +0 -1
  317. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts +0 -5
  318. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts.map +0 -1
  319. package/lib/esm/src/typed-data/di/typedDataTypes.js +0 -5
  320. package/lib/esm/src/typed-data/di/typedDataTypes.js.map +0 -1
  321. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -13
  322. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -1
  323. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +0 -124
  324. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +0 -1
  325. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -6
  326. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -1
  327. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +0 -2
  328. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +0 -1
  329. package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
  330. /package/lib/{cjs → types}/index.d.ts +0 -0
  331. /package/lib/{cjs → types}/index.d.ts.map +0 -0
  332. /package/lib/{cjs → types}/src/ContextModule.d.ts +0 -0
  333. /package/lib/{cjs → types}/src/ContextModule.d.ts.map +0 -0
  334. /package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +0 -0
  335. /package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts.map +0 -0
  336. /package/lib/{cjs → types}/src/DefaultContextModule.d.ts +0 -0
  337. /package/lib/{cjs → types}/src/DefaultContextModule.d.ts.map +0 -0
  338. /package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +0 -0
  339. /package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts.map +0 -0
  340. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts +0 -0
  341. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts.map +0 -0
  342. /package/lib/{cjs → types}/src/di.d.ts +0 -0
  343. /package/lib/{cjs → types}/src/di.d.ts.map +0 -0
  344. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts +0 -0
  345. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts.map +0 -0
  346. /package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -0
  347. /package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -0
  348. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -0
  349. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -0
  350. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -0
  351. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -0
  352. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts +0 -0
  353. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -0
  354. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -0
  355. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -0
  356. /package/lib/{cjs → types}/src/external-plugin/model/DappInfos.d.ts +0 -0
  357. /package/lib/{cjs → types}/src/external-plugin/model/DappInfos.d.ts.map +0 -0
  358. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts +0 -0
  359. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts.map +0 -0
  360. /package/lib/{cjs → types}/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -0
  361. /package/lib/{cjs → types}/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -0
  362. /package/lib/{cjs → types}/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -0
  363. /package/lib/{cjs → types}/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -0
  364. /package/lib/{cjs → types}/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -0
  365. /package/lib/{cjs → types}/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -0
  366. /package/lib/{cjs → types}/src/forward-domain/di/forwardDomainTypes.d.ts +0 -0
  367. /package/lib/{cjs → types}/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -0
  368. /package/lib/{cjs → types}/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -0
  369. /package/lib/{cjs → types}/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -0
  370. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts +0 -0
  371. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts.map +0 -0
  372. /package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts +0 -0
  373. /package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts.map +0 -0
  374. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts +0 -0
  375. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts.map +0 -0
  376. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts +0 -0
  377. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts.map +0 -0
  378. /package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts +0 -0
  379. /package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts.map +0 -0
  380. /package/lib/{cjs → types}/src/shared/domain/ContextLoader.d.ts +0 -0
  381. /package/lib/{cjs → types}/src/shared/domain/ContextLoader.d.ts.map +0 -0
  382. /package/lib/{cjs → types}/src/shared/model/ClearSignContext.d.ts +0 -0
  383. /package/lib/{cjs → types}/src/shared/model/ClearSignContext.d.ts.map +0 -0
  384. /package/lib/{cjs → types}/src/shared/model/TransactionContext.d.ts +0 -0
  385. /package/lib/{cjs → types}/src/shared/model/TransactionContext.d.ts.map +0 -0
  386. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
  387. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
  388. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
  389. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
  390. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
  391. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
  392. /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts +0 -0
  393. /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +0 -0
  394. /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
  395. /package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +0 -0
  396. /package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts.map +0 -0
  397. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts +0 -0
  398. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts.map +0 -0
  399. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts +0 -0
  400. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts.map +0 -0
  401. /package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +0 -0
  402. /package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts.map +0 -0
  403. /package/lib/{cjs → types}/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -0
  404. /package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts +0 -0
  405. /package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -0
  406. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts +0 -0
  407. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -0
  408. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts +0 -0
  409. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts.map +0 -0
  410. /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -0
  411. /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -0
  412. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
  413. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
@@ -1,63 +0,0 @@
1
- {
2
- "name": "@ledgerhq/context-module",
3
- "version": "0.1.0",
4
- "license": "MIT",
5
- "exports": {
6
- ".": {
7
- "import": "./lib/esm/index.js",
8
- "require": "./lib/cjs/index.js",
9
- "default": "./index.ts",
10
- "types": "./lib/esm/index.d.ts"
11
- },
12
- "./*.js": {
13
- "import": "./lib/esm/*.js",
14
- "require": "./lib/cjs/*.js",
15
- "default": "./*.js",
16
- "types": "./lib/esm/*.d.ts"
17
- },
18
- "./*": {
19
- "import": "./lib/esm/*",
20
- "require": "./lib/cjs/*",
21
- "default": "./*",
22
- "types": "./lib/esm/*"
23
- }
24
- },
25
- "files": [
26
- "./lib"
27
- ],
28
- "scripts": {
29
- "build": "rimraf lib && zx scripts/build.mjs",
30
- "dev": "concurrently \"pnpm dev:esm\" \"pnpm dev:cjs\"",
31
- "dev:esm": "concurrently \"tsc --watch -p tsconfig.esm.json\" \"tsc-alias --watch -p tsconfig.esm.json\"",
32
- "dev:cjs": "concurrently \"tsc --watch -p tsconfig.cjs.json\" \"tsc-alias --watch -p tsconfig.cjs.json\"",
33
- "lint": "eslint",
34
- "lint:fix": "pnpm lint --fix",
35
- "postpack": "find . -name '*.tgz' -exec cp {} ../../../dist/ \\; ",
36
- "prettier": "prettier . --check",
37
- "prettier:fix": "prettier . --write",
38
- "test": "jest",
39
- "test:watch": "pnpm test -- --watch",
40
- "test:coverage": "pnpm test -- --coverage",
41
- "typecheck": "tsc --noEmit"
42
- },
43
- "devDependencies": {
44
- "@ledgerhq/device-management-kit": "workspace:*",
45
- "@ledgerhq/eslint-config-dsdk": "workspace:*",
46
- "@ledgerhq/jest-config-dsdk": "workspace:*",
47
- "@ledgerhq/prettier-config-dsdk": "workspace:*",
48
- "@ledgerhq/tsconfig-dsdk": "workspace:*",
49
- "@types/crypto-js": "^4.2.2",
50
- "ts-node": "^10.9.2"
51
- },
52
- "dependencies": {
53
- "axios": "^1.7.7",
54
- "crypto-js": "^4.2.0",
55
- "ethers": "^6.13.2",
56
- "inversify": "^6.0.2",
57
- "purify-ts": "^2.1.0",
58
- "reflect-metadata": "^0.2.2"
59
- },
60
- "peerDependencies": {
61
- "@ledgerhq/device-management-kit": "workspace:*"
62
- }
63
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ContextModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextModule.js","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":""}
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContextModuleBuilder = exports.DEFAULT_CONFIG = void 0;
4
- const externalPluginTypes_1 = require("./external-plugin/di/externalPluginTypes");
5
- const forwardDomainTypes_1 = require("./forward-domain/di/forwardDomainTypes");
6
- const nftTypes_1 = require("./nft/di/nftTypes");
7
- const tokenTypes_1 = require("./token/di/tokenTypes");
8
- const typedDataTypes_1 = require("./typed-data/di/typedDataTypes");
9
- const DefaultContextModule_1 = require("./DefaultContextModule");
10
- const di_1 = require("./di");
11
- const DEFAULT_CAL_URL = "https://crypto-assets-service.api.ledger.com/v1";
12
- exports.DEFAULT_CONFIG = {
13
- cal: {
14
- url: DEFAULT_CAL_URL,
15
- mode: "prod",
16
- branch: "main",
17
- },
18
- };
19
- class ContextModuleBuilder {
20
- config = {};
21
- customLoaders = [];
22
- defaultLoaders = [];
23
- customTypedDataLoader;
24
- constructor() { }
25
- /**
26
- * Remove default loaders from the list of loaders
27
- *
28
- * @returns this
29
- */
30
- withoutDefaultLoaders() {
31
- this.defaultLoaders = [];
32
- return this;
33
- }
34
- /**
35
- * Add a custom loader to the list of loaders
36
- *
37
- * @param loader loader to add to the list of loaders
38
- * @returns this
39
- */
40
- addLoader(loader) {
41
- this.customLoaders.push(loader);
42
- return this;
43
- }
44
- /**
45
- * Replace the default loader for typed data clear signing contexts
46
- *
47
- * @returns this
48
- */
49
- withTypedDataLoader(loader) {
50
- this.customTypedDataLoader = loader;
51
- return this;
52
- }
53
- /**
54
- * Set the configuration for the context module
55
- *
56
- * @param config configuration for the context module
57
- * @returns this
58
- */
59
- withConfig(config) {
60
- this.config = config;
61
- return this;
62
- }
63
- /**
64
- * Build the context module
65
- *
66
- * @returns the context module
67
- */
68
- build() {
69
- const container = (0, di_1.makeContainer)({
70
- config: { ...exports.DEFAULT_CONFIG, ...this.config },
71
- });
72
- this.defaultLoaders = [
73
- container.get(externalPluginTypes_1.externalPluginTypes.ExternalPluginContextLoader),
74
- container.get(forwardDomainTypes_1.forwardDomainTypes.ForwardDomainContextLoader),
75
- container.get(nftTypes_1.nftTypes.NftContextLoader),
76
- container.get(tokenTypes_1.tokenTypes.TokenContextLoader),
77
- ];
78
- const defaultTypedDataLoader = container.get(typedDataTypes_1.typedDataTypes.TypedDataContextLoader);
79
- const loaders = [...this.defaultLoaders, ...this.customLoaders];
80
- return new DefaultContextModule_1.DefaultContextModule({
81
- loaders,
82
- typedDataLoader: this.customTypedDataLoader ?? defaultTypedDataLoader,
83
- });
84
- }
85
- }
86
- exports.ContextModuleBuilder = ContextModuleBuilder;
87
- //# sourceMappingURL=ContextModuleBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextModuleBuilder.js","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.ts"],"names":[],"mappings":";;;AAAA,kFAA+E;AAC/E,+EAA4E;AAC5E,gDAA6C;AAC7C,sDAAmD;AACnD,mEAAgE;AAUhE,iEAA8D;AAC9D,6BAAqC;AAErC,MAAM,eAAe,GAAG,iDAAiD,CAAC;AAE7D,QAAA,cAAc,GAAwB;IACjD,GAAG,EAAE;QACH,GAAG,EAAE,eAAe;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;KACf;CACF,CAAC;AAEF,MAAa,oBAAoB;IACvB,MAAM,GAAiC,EAAE,CAAC;IAC1C,aAAa,GAAoB,EAAE,CAAC;IACpC,cAAc,GAAoB,EAAE,CAAC;IACrC,qBAAqB,CAA0B;IAEvD,gBAAe,CAAC;IAEhB;;;;OAIG;IACH,qBAAqB;QACnB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,MAAqB;QAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAAC,MAA8B;QAChD,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,UAAU,CAAC,MAAoC;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,MAAM,SAAS,GAAG,IAAA,kBAAa,EAAC;YAC9B,MAAM,EAAE,EAAE,GAAG,sBAAc,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE;SAC9C,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,GAAG;YACpB,SAAS,CAAC,GAAG,CACX,yCAAmB,CAAC,2BAA2B,CAChD;YACD,SAAS,CAAC,GAAG,CACX,uCAAkB,CAAC,0BAA0B,CAC9C;YACD,SAAS,CAAC,GAAG,CAAmB,mBAAQ,CAAC,gBAAgB,CAAC;YAC1D,SAAS,CAAC,GAAG,CAAqB,uBAAU,CAAC,kBAAkB,CAAC;SACjE,CAAC;QACF,MAAM,sBAAsB,GAAG,SAAS,CAAC,GAAG,CAC1C,+BAAc,CAAC,sBAAsB,CACtC,CAAC;QAEF,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;QAChE,OAAO,IAAI,2CAAoB,CAAC;YAC9B,OAAO;YACP,eAAe,EAAE,IAAI,CAAC,qBAAqB,IAAI,sBAAsB;SACtE,CAAC,CAAC;IACL,CAAC;CACF;AAhFD,oDAgFC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultContextModule = void 0;
4
- class DefaultContextModule {
5
- _loaders;
6
- _typedDataLoader;
7
- constructor(args) {
8
- this._loaders = args.loaders;
9
- this._typedDataLoader = args.typedDataLoader;
10
- }
11
- async getContexts(transaction) {
12
- const promises = this._loaders.map((fetcher) => fetcher.load(transaction));
13
- const responses = await Promise.all(promises);
14
- return responses.flat();
15
- }
16
- async getTypedDataFilters(typedData) {
17
- return this._typedDataLoader.load(typedData);
18
- }
19
- }
20
- exports.DefaultContextModule = DefaultContextModule;
21
- //# sourceMappingURL=DefaultContextModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DefaultContextModule.js","sourceRoot":"","sources":["../../../src/DefaultContextModule.ts"],"names":[],"mappings":";;;AAcA,MAAa,oBAAoB;IACvB,QAAQ,CAAkB;IAC1B,gBAAgB,CAAyB;IAEjD,YAAY,IAAyC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,eAAe,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,WAAW,CACtB,WAA+B;QAE/B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC3E,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9C,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,SAA2B;QAE3B,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF;AAtBD,oDAsBC"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.configModuleFactory = void 0;
4
- const inversify_1 = require("inversify");
5
- const configTypes_1 = require("./configTypes");
6
- const configModuleFactory = (config) => new inversify_1.ContainerModule((bind, _unbind, _isBound, _rebind) => {
7
- bind(configTypes_1.configTypes.Config).toConstantValue(config);
8
- });
9
- exports.configModuleFactory = configModuleFactory;
10
- //# sourceMappingURL=configModuleFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configModuleFactory.js","sourceRoot":"","sources":["../../../../../src/config/di/configModuleFactory.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAI5C,+CAA4C;AAErC,MAAM,mBAAmB,GAAG,CAAC,MAA2B,EAAE,EAAE,CACjE,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAsB,yBAAW,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC;AAHQ,QAAA,mBAAmB,uBAG3B"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.configTypes = void 0;
4
- exports.configTypes = {
5
- Config: Symbol.for("config"),
6
- };
7
- //# sourceMappingURL=configTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configTypes.js","sourceRoot":"","sources":["../../../../../src/config/di/configTypes.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;CAC7B,CAAC"}
@@ -1,9 +0,0 @@
1
- export type ContextModuleCalConfig = {
2
- url: string;
3
- mode: "prod" | "test";
4
- branch: "next" | "main" | "demo";
5
- };
6
- export type ContextModuleConfig = {
7
- cal: ContextModuleCalConfig;
8
- };
9
- //# sourceMappingURL=ContextModuleConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextModuleConfig.d.ts","sourceRoot":"","sources":["../../../../../src/config/model/ContextModuleConfig.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,sBAAsB,CAAC;CAC7B,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ContextModuleConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextModuleConfig.js","sourceRoot":"","sources":["../../../../../src/config/model/ContextModuleConfig.ts"],"names":[],"mappings":""}
package/lib/cjs/src/di.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeContainer = void 0;
4
- const inversify_1 = require("inversify");
5
- const configModuleFactory_1 = require("./config/di/configModuleFactory");
6
- const externalPluginModuleFactory_1 = require("./external-plugin/di/externalPluginModuleFactory");
7
- const forwardDomainModuleFactory_1 = require("./forward-domain/di/forwardDomainModuleFactory");
8
- const nftModuleFactory_1 = require("./nft/di/nftModuleFactory");
9
- const tokenModuleFactory_1 = require("./token/di/tokenModuleFactory");
10
- const typedDataModuleFactory_1 = require("./typed-data/di/typedDataModuleFactory");
11
- const makeContainer = ({ config }) => {
12
- const container = new inversify_1.Container();
13
- container.load((0, configModuleFactory_1.configModuleFactory)(config), (0, externalPluginModuleFactory_1.externalPluginModuleFactory)(), (0, forwardDomainModuleFactory_1.forwardDomainModuleFactory)(), (0, nftModuleFactory_1.nftModuleFactory)(), (0, tokenModuleFactory_1.tokenModuleFactory)(), (0, typedDataModuleFactory_1.typedDataModuleFactory)());
14
- return container;
15
- };
16
- exports.makeContainer = makeContainer;
17
- //# sourceMappingURL=di.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"di.js","sourceRoot":"","sources":["../../../src/di.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,yEAAsE;AAEtE,kGAA+F;AAC/F,+FAA4F;AAC5F,gEAA6D;AAC7D,sEAAmE;AACnE,mFAAgF;AAMzE,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAqB,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;IAElC,SAAS,CAAC,IAAI,CACZ,IAAA,yCAAmB,EAAC,MAAM,CAAC,EAC3B,IAAA,yDAA2B,GAAE,EAC7B,IAAA,uDAA0B,GAAE,EAC5B,IAAA,mCAAgB,GAAE,EAClB,IAAA,uCAAkB,GAAE,EACpB,IAAA,+CAAsB,GAAE,CACzB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=DAppDto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DAppDto.js","sourceRoot":"","sources":["../../../../../src/external-plugin/data/DAppDto.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ExternalPluginDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExternalPluginDataSource.js","sourceRoot":"","sources":["../../../../../src/external-plugin/data/ExternalPluginDataSource.ts"],"names":[],"mappings":""}
@@ -1,83 +0,0 @@
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.HttpExternalPluginDataSource = void 0;
19
- const axios_1 = __importDefault(require("axios"));
20
- const inversify_1 = require("inversify");
21
- const purify_ts_1 = require("purify-ts");
22
- const configTypes_1 = require("../../config/di/configTypes");
23
- const package_json_1 = __importDefault(require("../../../package.json"));
24
- let HttpExternalPluginDataSource = class HttpExternalPluginDataSource {
25
- config;
26
- constructor(config) {
27
- this.config = config;
28
- }
29
- async getDappInfos({ chainId, address, selector, }) {
30
- try {
31
- const dappInfos = await axios_1.default.request({
32
- method: "GET",
33
- url: `${this.config.cal.url}/dapps`,
34
- params: {
35
- output: "b2c,b2c_signatures,abis",
36
- chain_id: chainId,
37
- contracts: address,
38
- },
39
- headers: {
40
- "X-Ledger-Client-Version": `context-module/${package_json_1.default.version}`,
41
- },
42
- });
43
- if (!dappInfos.data[0]) {
44
- return (0, purify_ts_1.Right)(undefined);
45
- }
46
- // Normalize the address and selector
47
- address = address.toLowerCase();
48
- selector = `0x${selector.slice(2).toLowerCase()}`;
49
- const { erc20OfInterest, method, plugin } = dappInfos.data[0].b2c?.contracts?.find((c) => c.address === address)
50
- ?.selectors?.[selector] || {};
51
- const { signature, serialized_data: serializedData } = dappInfos.data[0].b2c_signatures?.[address]?.[selector] || {};
52
- if (!erc20OfInterest ||
53
- !method ||
54
- !plugin ||
55
- !signature ||
56
- !serializedData) {
57
- return (0, purify_ts_1.Right)(undefined);
58
- }
59
- const abi = dappInfos.data[0].abis?.[address];
60
- if (!abi) {
61
- return (0, purify_ts_1.Right)(undefined);
62
- }
63
- const selectorDetails = {
64
- method,
65
- plugin,
66
- erc20OfInterest,
67
- signature,
68
- serializedData,
69
- };
70
- return (0, purify_ts_1.Right)({ selectorDetails, abi });
71
- }
72
- catch (_error) {
73
- return (0, purify_ts_1.Left)(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"));
74
- }
75
- }
76
- };
77
- exports.HttpExternalPluginDataSource = HttpExternalPluginDataSource;
78
- exports.HttpExternalPluginDataSource = HttpExternalPluginDataSource = __decorate([
79
- (0, inversify_1.injectable)(),
80
- __param(0, (0, inversify_1.inject)(configTypes_1.configTypes.Config)),
81
- __metadata("design:paramtypes", [Object])
82
- ], HttpExternalPluginDataSource);
83
- //# sourceMappingURL=HttpExternalPluginDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpExternalPluginDataSource.js","sourceRoot":"","sources":["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,yCAA+C;AAC/C,yCAAgD;AAEhD,yDAAsD;AAStD,sEAAyC;AAGlC,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAEQ;IAD/C,YAC+C,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;IACvE,CAAC;IAEJ,KAAK,CAAC,YAAY,CAAC,EACjB,OAAO,EACP,OAAO,EACP,QAAQ,GACK;QACb,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,eAAK,CAAC,OAAO,CAAY;gBAC/C,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ;gBACnC,MAAM,EAAE;oBACN,MAAM,EAAE,yBAAyB;oBACjC,QAAQ,EAAE,OAAO;oBACjB,SAAS,EAAE,OAAO;iBACnB;gBACD,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,sBAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvB,OAAO,IAAA,iBAAK,EAAC,SAAS,CAAC,CAAC;YAC1B,CAAC;YAED,qCAAqC;YACrC,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;YAChC,QAAQ,GAAG,KAAK,QAAQ,CAAC,KAAK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U,GAAE;IAGR,WAAA,IAAA,kBAAM,EAAC,yBAAW,CAAC,MAAM,CAAC,CAAA;;GAFlB,4BAA4B,CAuExC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.externalPluginModuleFactory = void 0;
4
- const inversify_1 = require("inversify");
5
- const HttpExternalPluginDataSource_1 = require("../../external-plugin/data/HttpExternalPluginDataSource");
6
- const externalPluginTypes_1 = require("../../external-plugin/di/externalPluginTypes");
7
- const ExternalPluginContextLoader_1 = require("../../external-plugin/domain/ExternalPluginContextLoader");
8
- const externalPluginModuleFactory = () => new inversify_1.ContainerModule((bind, _unbind, _isBound, _rebind) => {
9
- bind(externalPluginTypes_1.externalPluginTypes.ExternalPluginDataSource).to(HttpExternalPluginDataSource_1.HttpExternalPluginDataSource);
10
- bind(externalPluginTypes_1.externalPluginTypes.ExternalPluginContextLoader).to(ExternalPluginContextLoader_1.ExternalPluginContextLoader);
11
- });
12
- exports.externalPluginModuleFactory = externalPluginModuleFactory;
13
- //# sourceMappingURL=externalPluginModuleFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"externalPluginModuleFactory.js","sourceRoot":"","sources":["../../../../../src/external-plugin/di/externalPluginModuleFactory.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAE5C,sGAAmG;AACnG,kFAA+E;AAC/E,sGAAmG;AAE5F,MAAM,2BAA2B,GAAG,GAAG,EAAE,CAC9C,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAC,yCAAmB,CAAC,wBAAwB,CAAC,CAAC,EAAE,CACnD,2DAA4B,CAC7B,CAAC;IACF,IAAI,CAAC,yCAAmB,CAAC,2BAA2B,CAAC,CAAC,EAAE,CACtD,yDAA2B,CAC5B,CAAC;AACJ,CAAC,CAAC,CAAC;AARQ,QAAA,2BAA2B,+BAQnC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.externalPluginTypes = void 0;
4
- exports.externalPluginTypes = {
5
- ExternalPluginDataSource: Symbol.for("externalPluginDataSource"),
6
- ExternalPluginContextLoader: Symbol.for("externalPluginContextLoader"),
7
- };
8
- //# sourceMappingURL=externalPluginTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"externalPluginTypes.js","sourceRoot":"","sources":["../../../../../src/external-plugin/di/externalPluginTypes.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,wBAAwB,EAAE,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAChE,2BAA2B,EAAE,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC;CACvE,CAAC"}
@@ -1,136 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ExternalPluginContextLoader = void 0;
16
- const device_management_kit_1 = require("@ledgerhq/device-management-kit");
17
- const ethers_1 = require("ethers");
18
- const inversify_1 = require("inversify");
19
- const purify_ts_1 = require("purify-ts");
20
- const externalPluginTypes_1 = require("../../external-plugin/di/externalPluginTypes");
21
- const ClearSignContext_1 = require("../../shared/model/ClearSignContext");
22
- const tokenTypes_1 = require("../../token/di/tokenTypes");
23
- let ExternalPluginContextLoader = class ExternalPluginContextLoader {
24
- _externalPluginDataSource;
25
- _tokenDataSource;
26
- constructor(externalPluginDataSource, tokenDataSource) {
27
- this._externalPluginDataSource = externalPluginDataSource;
28
- this._tokenDataSource = tokenDataSource;
29
- }
30
- async load(transaction) {
31
- if (!transaction.to || !transaction.data || transaction.data === "0x") {
32
- return [];
33
- }
34
- const selector = transaction.data.slice(0, 10);
35
- if (!(0, device_management_kit_1.isHexaString)(selector)) {
36
- return [
37
- {
38
- type: ClearSignContext_1.ClearSignContextType.ERROR,
39
- error: new Error("Invalid selector"),
40
- },
41
- ];
42
- }
43
- const eitherDappInfos = await this._externalPluginDataSource.getDappInfos({
44
- address: transaction.to,
45
- chainId: transaction.chainId,
46
- selector,
47
- });
48
- return (0, purify_ts_1.EitherAsync)(async ({ liftEither }) => {
49
- const dappInfos = await liftEither(eitherDappInfos);
50
- // if the dappInfos is null, return an empty array
51
- // this means that the selector is not a known selector
52
- if (!dappInfos) {
53
- return [];
54
- }
55
- const externalPluginContext = {
56
- type: ClearSignContext_1.ClearSignContextType.EXTERNAL_PLUGIN,
57
- payload: dappInfos.selectorDetails.serializedData.concat(dappInfos.selectorDetails.signature),
58
- };
59
- const decodedCallData = this.getDecodedCallData(dappInfos.abi, dappInfos.selectorDetails.method, transaction.data);
60
- // if the call data cannot be decoded, return the error
61
- // but also the externalPluginContext because it is still valid
62
- if (decodedCallData.isLeft()) {
63
- return [
64
- {
65
- type: ClearSignContext_1.ClearSignContextType.ERROR,
66
- error: decodedCallData.extract(),
67
- },
68
- externalPluginContext,
69
- ];
70
- }
71
- // decodedCallData is a Right so we can extract it safely
72
- const extractedDecodedCallData = decodedCallData.extract();
73
- // get the token payload for each erc20OfInterest
74
- // and return the payload or the error
75
- const promises = dappInfos.selectorDetails.erc20OfInterest.map(async (erc20Path) => this.getTokenPayload(transaction, erc20Path, extractedDecodedCallData));
76
- const tokensPayload = await Promise.all(promises);
77
- // map the payload or the error to a ClearSignContext
78
- const contexts = tokensPayload.map((eitherToken) => eitherToken.caseOf({
79
- Left: (error) => ({ type: ClearSignContext_1.ClearSignContextType.ERROR, error }),
80
- Right: (payload) => ({ type: ClearSignContext_1.ClearSignContextType.TOKEN, payload }),
81
- }));
82
- return [...contexts, externalPluginContext];
83
- }).caseOf({
84
- // parse all errors into ClearSignContext
85
- Left: (error) => [{ type: ClearSignContext_1.ClearSignContextType.ERROR, error }],
86
- Right: (contexts) => contexts,
87
- });
88
- }
89
- getTokenPayload(transaction, erc20Path, decodedCallData) {
90
- const address = this.getAddressFromPath(erc20Path, decodedCallData);
91
- return (0, purify_ts_1.EitherAsync)(({ fromPromise }) => fromPromise(this._tokenDataSource.getTokenInfosPayload({
92
- address,
93
- chainId: transaction.chainId,
94
- })));
95
- }
96
- getDecodedCallData(abi, method, data) {
97
- try {
98
- const contractInterface = new ethers_1.Interface(abi);
99
- return (0, purify_ts_1.Right)(contractInterface.decodeFunctionData(method, data));
100
- }
101
- catch (_error) {
102
- return (0, purify_ts_1.Left)(new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi"));
103
- }
104
- }
105
- getAddressFromPath(path, decodedCallData) {
106
- // ethers.Result is a record string, any
107
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
- let value = decodedCallData;
109
- for (const key of path.split(".")) {
110
- // In Solidity, a struct cannot begin with a number
111
- // Additionally, when we use -1, it signifies the last element of the array.
112
- if (key === "-1") {
113
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
114
- value = value[value.length - 1];
115
- }
116
- else {
117
- // This access can throw a RangeError error in case of an invalid key
118
- // but is correctly caught by the liftEither above
119
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
120
- value = value[key];
121
- }
122
- }
123
- if (!(0, device_management_kit_1.isHexaString)(value)) {
124
- throw new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address");
125
- }
126
- return value;
127
- }
128
- };
129
- exports.ExternalPluginContextLoader = ExternalPluginContextLoader;
130
- exports.ExternalPluginContextLoader = ExternalPluginContextLoader = __decorate([
131
- (0, inversify_1.injectable)(),
132
- __param(0, (0, inversify_1.inject)(externalPluginTypes_1.externalPluginTypes.ExternalPluginDataSource)),
133
- __param(1, (0, inversify_1.inject)(tokenTypes_1.tokenTypes.TokenDataSource)),
134
- __metadata("design:paramtypes", [Object, Object])
135
- ], ExternalPluginContextLoader);
136
- //# sourceMappingURL=ExternalPluginContextLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExternalPluginContextLoader.js","sourceRoot":"","sources":["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2EAA2E;AAC3E,mCAA2C;AAC3C,yCAA+C;AAC/C,yCAA6D;AAG7D,kFAA+E;AAE/E,sEAGyC;AAGzC,sDAAmD;AAG5C,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAC9B,yBAAyB,CAA2B;IACpD,gBAAgB,CAAkB;IAE1C,YAEE,wBAAkD,EACd,eAAgC;QAEpE,IAAI,CAAC,yBAAyB,GAAG,wBAAwB,CAAC;QAC1D,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAA+B;QACxC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtE,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAA,oCAAY,EAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,OAAO;gBACL;oBACE,IAAI,EAAE,u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KvC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=DappInfos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DappInfos.js","sourceRoot":"","sources":["../../../../../src/external-plugin/model/DappInfos.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=SelectorDetails.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectorDetails.js","sourceRoot":"","sources":["../../../../../src/external-plugin/model/SelectorDetails.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ForwardDomainDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForwardDomainDataSource.js","sourceRoot":"","sources":["../../../../../src/forward-domain/data/ForwardDomainDataSource.ts"],"names":[],"mappings":""}
@@ -1,40 +0,0 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.HttpForwardDomainDataSource = void 0;
13
- const axios_1 = __importDefault(require("axios"));
14
- const inversify_1 = require("inversify");
15
- const purify_ts_1 = require("purify-ts");
16
- const package_json_1 = __importDefault(require("../../../package.json"));
17
- let HttpForwardDomainDataSource = class HttpForwardDomainDataSource {
18
- async getDomainNamePayload({ domain, challenge, }) {
19
- try {
20
- const response = await axios_1.default.request({
21
- method: "GET",
22
- url: `https://nft.api.live.ledger.com/v1/names/ens/forward/${domain}?challenge=${challenge}`,
23
- headers: {
24
- "X-Ledger-Client-Version": `context-module/${package_json_1.default.version}`,
25
- },
26
- });
27
- return response.data.payload
28
- ? (0, purify_ts_1.Right)(response.data.payload)
29
- : (0, purify_ts_1.Left)(new Error("[ContextModule] HttpForwardDomainDataSource: error getting domain payload"));
30
- }
31
- catch (_error) {
32
- return (0, purify_ts_1.Left)(new Error("[ContextModule] HttpForwardDomainDataSource: Failed to fetch domain name"));
33
- }
34
- }
35
- };
36
- exports.HttpForwardDomainDataSource = HttpForwardDomainDataSource;
37
- exports.HttpForwardDomainDataSource = HttpForwardDomainDataSource = __decorate([
38
- (0, inversify_1.injectable)()
39
- ], HttpForwardDomainDataSource);
40
- //# sourceMappingURL=HttpForwardDomainDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpForwardDomainDataSource.js","sourceRoot":"","sources":["../../../../../src/forward-domain/data/HttpForwardDomainDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA0B;AAC1B,yCAAuC;AACvC,yCAAgD;AAMhD,sEAAyC;AAGlC,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAC/B,KAAK,CAAC,oBAAoB,CAAC,EAChC,MAAM,EACN,SAAS,GACmB;QAC5B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,OAAO,CAAsB;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,wDAAwD,MAAM,cAAc,SAAS,EAAE;gBAC5F,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,sBAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO;gBAC1B,CAAC,CAAC,IAAA,iBAAK,EAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9B,CAAC,CAAC,IAAA,gBAAI,EACF,IAAI,KAAK,CACP,2EAA2E,CAC5E,CACF,CAAC;QACR,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAA,gBAAI,EACT,IAAI,KAAK,CACP,0EAA0E,CAC3E,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA7BY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CA6BvC"}