@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,133 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- 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;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- import { isHexaString } from "@ledgerhq/device-management-kit";
14
- import { Interface } from "ethers";
15
- import { inject, injectable } from "inversify";
16
- import { EitherAsync, Left, Right } from "purify-ts";
17
- import { externalPluginTypes } from "../../external-plugin/di/externalPluginTypes";
18
- import { ClearSignContextType, } from "../../shared/model/ClearSignContext";
19
- import { tokenTypes } from "../../token/di/tokenTypes";
20
- let ExternalPluginContextLoader = class ExternalPluginContextLoader {
21
- _externalPluginDataSource;
22
- _tokenDataSource;
23
- constructor(externalPluginDataSource, tokenDataSource) {
24
- this._externalPluginDataSource = externalPluginDataSource;
25
- this._tokenDataSource = tokenDataSource;
26
- }
27
- async load(transaction) {
28
- if (!transaction.to || !transaction.data || transaction.data === "0x") {
29
- return [];
30
- }
31
- const selector = transaction.data.slice(0, 10);
32
- if (!isHexaString(selector)) {
33
- return [
34
- {
35
- type: ClearSignContextType.ERROR,
36
- error: new Error("Invalid selector"),
37
- },
38
- ];
39
- }
40
- const eitherDappInfos = await this._externalPluginDataSource.getDappInfos({
41
- address: transaction.to,
42
- chainId: transaction.chainId,
43
- selector,
44
- });
45
- return EitherAsync(async ({ liftEither }) => {
46
- const dappInfos = await liftEither(eitherDappInfos);
47
- // if the dappInfos is null, return an empty array
48
- // this means that the selector is not a known selector
49
- if (!dappInfos) {
50
- return [];
51
- }
52
- const externalPluginContext = {
53
- type: ClearSignContextType.EXTERNAL_PLUGIN,
54
- payload: dappInfos.selectorDetails.serializedData.concat(dappInfos.selectorDetails.signature),
55
- };
56
- const decodedCallData = this.getDecodedCallData(dappInfos.abi, dappInfos.selectorDetails.method, transaction.data);
57
- // if the call data cannot be decoded, return the error
58
- // but also the externalPluginContext because it is still valid
59
- if (decodedCallData.isLeft()) {
60
- return [
61
- {
62
- type: ClearSignContextType.ERROR,
63
- error: decodedCallData.extract(),
64
- },
65
- externalPluginContext,
66
- ];
67
- }
68
- // decodedCallData is a Right so we can extract it safely
69
- const extractedDecodedCallData = decodedCallData.extract();
70
- // get the token payload for each erc20OfInterest
71
- // and return the payload or the error
72
- const promises = dappInfos.selectorDetails.erc20OfInterest.map(async (erc20Path) => this.getTokenPayload(transaction, erc20Path, extractedDecodedCallData));
73
- const tokensPayload = await Promise.all(promises);
74
- // map the payload or the error to a ClearSignContext
75
- const contexts = tokensPayload.map((eitherToken) => eitherToken.caseOf({
76
- Left: (error) => ({ type: ClearSignContextType.ERROR, error }),
77
- Right: (payload) => ({ type: ClearSignContextType.TOKEN, payload }),
78
- }));
79
- return [...contexts, externalPluginContext];
80
- }).caseOf({
81
- // parse all errors into ClearSignContext
82
- Left: (error) => [{ type: ClearSignContextType.ERROR, error }],
83
- Right: (contexts) => contexts,
84
- });
85
- }
86
- getTokenPayload(transaction, erc20Path, decodedCallData) {
87
- const address = this.getAddressFromPath(erc20Path, decodedCallData);
88
- return EitherAsync(({ fromPromise }) => fromPromise(this._tokenDataSource.getTokenInfosPayload({
89
- address,
90
- chainId: transaction.chainId,
91
- })));
92
- }
93
- getDecodedCallData(abi, method, data) {
94
- try {
95
- const contractInterface = new Interface(abi);
96
- return Right(contractInterface.decodeFunctionData(method, data));
97
- }
98
- catch (_error) {
99
- return Left(new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi"));
100
- }
101
- }
102
- getAddressFromPath(path, decodedCallData) {
103
- // ethers.Result is a record string, any
104
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
105
- let value = decodedCallData;
106
- for (const key of path.split(".")) {
107
- // In Solidity, a struct cannot begin with a number
108
- // Additionally, when we use -1, it signifies the last element of the array.
109
- if (key === "-1") {
110
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
111
- value = value[value.length - 1];
112
- }
113
- else {
114
- // This access can throw a RangeError error in case of an invalid key
115
- // but is correctly caught by the liftEither above
116
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
117
- value = value[key];
118
- }
119
- }
120
- if (!isHexaString(value)) {
121
- throw new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address");
122
- }
123
- return value;
124
- }
125
- };
126
- ExternalPluginContextLoader = __decorate([
127
- injectable(),
128
- __param(0, inject(externalPluginTypes.ExternalPluginDataSource)),
129
- __param(1, inject(tokenTypes.TokenDataSource)),
130
- __metadata("design:paramtypes", [Object, Object])
131
- ], ExternalPluginContextLoader);
132
- export { ExternalPluginContextLoader };
133
- //# sourceMappingURL=ExternalPluginContextLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExternalPluginContextLoader.js","sourceRoot":"","sources":["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAU,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAU,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAEL,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;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,IAA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IACf,CAAC;CACF,CAAA;AArKY,2BAA2B;IADvC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,mBAAmB,CAAC,wBAAwB,CAAC,CAAA;IAEpD,WAAA,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;;GAP1B,2BAA2B,CAqKvC"}
@@ -1,6 +0,0 @@
1
- import { SelectorDetails } from "../../external-plugin/model/SelectorDetails";
2
- export type DappInfos = {
3
- selectorDetails: SelectorDetails;
4
- abi: object[];
5
- };
6
- //# sourceMappingURL=DappInfos.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DappInfos.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/model/DappInfos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,MAAM,MAAM,SAAS,GAAG;IAAE,eAAe,EAAE,eAAe,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=DappInfos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DappInfos.js","sourceRoot":"","sources":["../../../../../src/external-plugin/model/DappInfos.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- export type SelectorDetails = {
2
- plugin: string;
3
- signature: string;
4
- serializedData: string;
5
- method: string;
6
- erc20OfInterest: string[];
7
- };
8
- //# sourceMappingURL=SelectorDetails.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectorDetails.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/model/SelectorDetails.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=SelectorDetails.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SelectorDetails.js","sourceRoot":"","sources":["../../../../../src/external-plugin/model/SelectorDetails.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- import { Either } from "purify-ts/Either";
2
- export type GetForwardDomainInfosParams = {
3
- domain: string;
4
- challenge: string;
5
- };
6
- export interface ForwardDomainDataSource {
7
- getDomainNamePayload(params: GetForwardDomainInfosParams): Promise<Either<Error, string>>;
8
- }
9
- //# sourceMappingURL=ForwardDomainDataSource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForwardDomainDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/forward-domain/data/ForwardDomainDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,oBAAoB,CAClB,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACnC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ForwardDomainDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForwardDomainDataSource.js","sourceRoot":"","sources":["../../../../../src/forward-domain/data/ForwardDomainDataSource.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import { Either } from "purify-ts";
2
- import { ForwardDomainDataSource, GetForwardDomainInfosParams } from "../../forward-domain/data/ForwardDomainDataSource";
3
- export declare class HttpForwardDomainDataSource implements ForwardDomainDataSource {
4
- getDomainNamePayload({ domain, challenge, }: GetForwardDomainInfosParams): Promise<Either<Error, string>>;
5
- }
6
- //# sourceMappingURL=HttpForwardDomainDataSource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpForwardDomainDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/forward-domain/data/HttpForwardDomainDataSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,MAAM,WAAW,CAAC;AAEhD,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,+CAA+C,CAAC;AAGvD,qBACa,2BAA4B,YAAW,uBAAuB;IAC5D,oBAAoB,CAAC,EAChC,MAAM,EACN,SAAS,GACV,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAyBhE"}
@@ -1,34 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- 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;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import axios from "axios";
8
- import { injectable } from "inversify";
9
- import { Left, Right } from "purify-ts";
10
- import PACKAGE from "../../../package.json";
11
- let HttpForwardDomainDataSource = class HttpForwardDomainDataSource {
12
- async getDomainNamePayload({ domain, challenge, }) {
13
- try {
14
- const response = await axios.request({
15
- method: "GET",
16
- url: `https://nft.api.live.ledger.com/v1/names/ens/forward/${domain}?challenge=${challenge}`,
17
- headers: {
18
- "X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
19
- },
20
- });
21
- return response.data.payload
22
- ? Right(response.data.payload)
23
- : Left(new Error("[ContextModule] HttpForwardDomainDataSource: error getting domain payload"));
24
- }
25
- catch (_error) {
26
- return Left(new Error("[ContextModule] HttpForwardDomainDataSource: Failed to fetch domain name"));
27
- }
28
- }
29
- };
30
- HttpForwardDomainDataSource = __decorate([
31
- injectable()
32
- ], HttpForwardDomainDataSource);
33
- export { HttpForwardDomainDataSource };
34
- //# sourceMappingURL=HttpForwardDomainDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpForwardDomainDataSource.js","sourceRoot":"","sources":["../../../../../src/forward-domain/data/HttpForwardDomainDataSource.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAU,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAMhD,OAAO,OAAO,MAAM,oBAAoB,CAAC;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,KAAK,CAAC,OAAO,CAAsB;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,wDAAwD,MAAM,cAAc,SAAS,EAAE;gBAC5F,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,OAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO;gBAC1B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9B,CAAC,CAAC,IAAI,CACF,IAAI,KAAK,CACP,2EAA2E,CAC5E,CACF,CAAC;QACR,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CACT,IAAI,KAAK,CACP,0EAA0E,CAC3E,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA7BY,2BAA2B;IADvC,UAAU,EAAE;GACA,2BAA2B,CA6BvC"}
@@ -1,3 +0,0 @@
1
- import { ContainerModule } from "inversify";
2
- export declare const forwardDomainModuleFactory: () => ContainerModule;
3
- //# sourceMappingURL=forwardDomainModuleFactory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forwardDomainModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/forward-domain/di/forwardDomainModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C,eAAO,MAAM,0BAA0B,uBAQnC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { ContainerModule } from "inversify";
2
- import { HttpForwardDomainDataSource } from "../../forward-domain/data/HttpForwardDomainDataSource";
3
- import { forwardDomainTypes } from "../../forward-domain/di/forwardDomainTypes";
4
- import { ForwardDomainContextLoader } from "../../forward-domain/domain/ForwardDomainContextLoader";
5
- export const forwardDomainModuleFactory = () => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
6
- bind(forwardDomainTypes.ForwardDomainDataSource).to(HttpForwardDomainDataSource);
7
- bind(forwardDomainTypes.ForwardDomainContextLoader).to(ForwardDomainContextLoader);
8
- });
9
- //# sourceMappingURL=forwardDomainModuleFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forwardDomainModuleFactory.js","sourceRoot":"","sources":["../../../../../src/forward-domain/di/forwardDomainModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAEhG,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE,CAC7C,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAC,EAAE,CACjD,2BAA2B,CAC5B,CAAC;IACF,IAAI,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC,EAAE,CACpD,0BAA0B,CAC3B,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const forwardDomainTypes: {
2
- ForwardDomainDataSource: symbol;
3
- ForwardDomainContextLoader: symbol;
4
- };
5
- //# sourceMappingURL=forwardDomainTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forwardDomainTypes.d.ts","sourceRoot":"","sources":["../../../../../src/forward-domain/di/forwardDomainTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;CAG9B,CAAC"}
@@ -1,5 +0,0 @@
1
- export const forwardDomainTypes = {
2
- ForwardDomainDataSource: Symbol.for("forwardDomainDataSource"),
3
- ForwardDomainContextLoader: Symbol.for("forwardDomainContextLoader"),
4
- };
5
- //# sourceMappingURL=forwardDomainTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forwardDomainTypes.js","sourceRoot":"","sources":["../../../../../src/forward-domain/di/forwardDomainTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,uBAAuB,EAAE,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC;IAC9D,0BAA0B,EAAE,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC;CACrE,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { ForwardDomainDataSource } from "../../forward-domain/data/ForwardDomainDataSource";
2
- import { ContextLoader } from "../../shared/domain/ContextLoader";
3
- import { ClearSignContext } from "../../shared/model/ClearSignContext";
4
- import { TransactionContext } from "../../shared/model/TransactionContext";
5
- export declare class ForwardDomainContextLoader implements ContextLoader {
6
- private _dataSource;
7
- constructor(dataSource: ForwardDomainDataSource);
8
- load(transactionContext: TransactionContext): Promise<ClearSignContext[]>;
9
- private isDomainValid;
10
- }
11
- //# sourceMappingURL=ForwardDomainContextLoader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForwardDomainContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/forward-domain/domain/ForwardDomainContextLoader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,qBACa,0BAA2B,YAAW,aAAa;IAC9D,OAAO,CAAC,WAAW,CAA0B;gBAI3C,UAAU,EAAE,uBAAuB;IAK/B,IAAI,CACR,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAqC9B,OAAO,CAAC,aAAa;CAQtB"}
@@ -1,63 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- 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;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- import { inject, injectable } from "inversify";
14
- import { forwardDomainTypes } from "../../forward-domain/di/forwardDomainTypes";
15
- import { ClearSignContextType, } from "../../shared/model/ClearSignContext";
16
- let ForwardDomainContextLoader = class ForwardDomainContextLoader {
17
- _dataSource;
18
- constructor(dataSource) {
19
- this._dataSource = dataSource;
20
- }
21
- async load(transactionContext) {
22
- const { domain, challenge } = transactionContext;
23
- if (!domain) {
24
- return [];
25
- }
26
- if (!this.isDomainValid(domain)) {
27
- return [
28
- {
29
- type: ClearSignContextType.ERROR,
30
- error: new Error("[ContextModule] ForwardDomainLoader: invalid domain"),
31
- },
32
- ];
33
- }
34
- const payload = await this._dataSource.getDomainNamePayload({
35
- domain: domain,
36
- challenge: challenge,
37
- });
38
- return [
39
- payload.caseOf({
40
- Left: (error) => ({
41
- type: ClearSignContextType.ERROR,
42
- error: error,
43
- }),
44
- Right: (value) => ({
45
- type: ClearSignContextType.DOMAIN_NAME,
46
- payload: value,
47
- }),
48
- }),
49
- ];
50
- }
51
- isDomainValid(domain) {
52
- const lengthIsValid = domain.length > 0 && Number(domain.length) < 30;
53
- const containsOnlyValidChars = new RegExp("^[a-zA-Z0-9\\-\\_\\.]+$").test(domain);
54
- return lengthIsValid && containsOnlyValidChars;
55
- }
56
- };
57
- ForwardDomainContextLoader = __decorate([
58
- injectable(),
59
- __param(0, inject(forwardDomainTypes.ForwardDomainDataSource)),
60
- __metadata("design:paramtypes", [Object])
61
- ], ForwardDomainContextLoader);
62
- export { ForwardDomainContextLoader };
63
- //# sourceMappingURL=ForwardDomainContextLoader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForwardDomainContextLoader.js","sourceRoot":"","sources":["../../../../../src/forward-domain/domain/ForwardDomainContextLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EAEL,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AAIlC,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAC7B,WAAW,CAA0B;IAE7C,YAEE,UAAmC;QAEnC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,C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CAAA;;GAJ1C,0BAA0B,CAyDtC"}
@@ -1,14 +0,0 @@
1
- export * from "./config/model/ContextModuleConfig";
2
- export * from "./ContextModule";
3
- export * from "./ContextModuleBuilder";
4
- export * from "./DefaultContextModule";
5
- export * from "./external-plugin/domain/ExternalPluginContextLoader";
6
- export * from "./forward-domain/domain/ForwardDomainContextLoader";
7
- export * from "./nft/domain/NftContextLoader";
8
- export * from "./shared/model/ClearSignContext";
9
- export * from "./shared/model/TransactionContext";
10
- export * from "./shared/model/TransactionSubset";
11
- export * from "./shared/model/TypedDataClearSignContext";
12
- export * from "./shared/model/TypedDataContext";
13
- export * from "./token/domain/TokenContextLoader";
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}
@@ -1,14 +0,0 @@
1
- export * from "./config/model/ContextModuleConfig";
2
- export * from "./ContextModule";
3
- export * from "./ContextModuleBuilder";
4
- export * from "./DefaultContextModule";
5
- export * from "./external-plugin/domain/ExternalPluginContextLoader";
6
- export * from "./forward-domain/domain/ForwardDomainContextLoader";
7
- export * from "./nft/domain/NftContextLoader";
8
- export * from "./shared/model/ClearSignContext";
9
- export * from "./shared/model/TransactionContext";
10
- export * from "./shared/model/TransactionSubset";
11
- export * from "./shared/model/TypedDataClearSignContext";
12
- export * from "./shared/model/TypedDataContext";
13
- export * from "./token/domain/TokenContextLoader";
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Either } from "purify-ts";
2
- import { GetNftInformationsParams, GetSetPluginPayloadParams, NftDataSource } from "../../nft/data/NftDataSource";
3
- export declare class HttpNftDataSource implements NftDataSource {
4
- getSetPluginPayload({ chainId, address, selector, }: GetSetPluginPayloadParams): Promise<Either<Error, string>>;
5
- getNftInfosPayload({ chainId, address, }: GetNftInformationsParams): Promise<Either<Error, string>>;
6
- }
7
- //# sourceMappingURL=HttpNftDataSource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpNftDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/nft/data/HttpNftDataSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,MAAM,WAAW,CAAC;AAEhD,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,aAAa,EACd,MAAM,0BAA0B,CAAC;AAGlC,qBACa,iBAAkB,YAAW,aAAa;IACxC,mBAAmB,CAAC,EAC/B,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IA0BhD,kBAAkB,CAAC,EAC9B,OAAO,EACP,OAAO,GACR,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAqB7D"}
@@ -1,51 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- 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;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import axios from "axios";
8
- import { injectable } from "inversify";
9
- import { Left, Right } from "purify-ts";
10
- import PACKAGE from "../../../package.json";
11
- let HttpNftDataSource = class HttpNftDataSource {
12
- async getSetPluginPayload({ chainId, address, selector, }) {
13
- try {
14
- const response = await axios.request({
15
- method: "GET",
16
- url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}/plugin-selector/${selector}`,
17
- headers: {
18
- "X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
19
- },
20
- });
21
- return response.data.payload
22
- ? Right(response.data.payload)
23
- : Left(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"));
24
- }
25
- catch (_error) {
26
- return Left(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"));
27
- }
28
- }
29
- async getNftInfosPayload({ chainId, address, }) {
30
- try {
31
- const response = await axios.request({
32
- method: "GET",
33
- url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}`,
34
- headers: {
35
- "X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
36
- },
37
- });
38
- return response.data.payload
39
- ? Right(response.data.payload)
40
- : Left(new Error("[ContextModule] HttpNftDataSource: no nft metadata"));
41
- }
42
- catch (_error) {
43
- return Left(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"));
44
- }
45
- }
46
- };
47
- HttpNftDataSource = __decorate([
48
- injectable()
49
- ], HttpNftDataSource);
50
- export { HttpNftDataSource };
51
- //# sourceMappingURL=HttpNftDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HttpNftDataSource.js","sourceRoot":"","sources":["../../../../../src/nft/data/HttpNftDataSource.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAU,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAOhD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAGlC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IACrB,KAAK,CAAC,mBAAmB,CAAC,EAC/B,OAAO,EACP,OAAO,EACP,QAAQ,GACkB;QAC1B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAsB;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,+CAA+C,OAAO,cAAc,OAAO,oBAAoB,QAAQ,EAAE;gBAC9G,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,OAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO;gBAC1B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9B,CAAC,CAAC,IAAI,CACF,IAAI,KAAK,CACP,8DAA8D,CAC/D,CACF,CAAC;QACR,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CACT,IAAI,KAAK,CACP,uEAAuE,CACxE,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,EAC9B,OAAO,EACP,OAAO,GACkB;QACzB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAsB;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,+CAA+C,OAAO,cAAc,OAAO,EAAE;gBAClF,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,OAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO;gBAC1B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9B,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CACT,IAAI,KAAK,CACP,qEAAqE,CACtE,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAvDY,iBAAiB;IAD7B,UAAU,EAAE;GACA,iBAAiB,CAuD7B"}
@@ -1,15 +0,0 @@
1
- import { Either } from "purify-ts";
2
- export type GetSetPluginPayloadParams = {
3
- chainId: number;
4
- address: string;
5
- selector: string;
6
- };
7
- export type GetNftInformationsParams = {
8
- chainId: number;
9
- address: string;
10
- };
11
- export interface NftDataSource {
12
- getNftInfosPayload(params: GetNftInformationsParams): Promise<Either<Error, string>>;
13
- getSetPluginPayload(params: GetSetPluginPayloadParams): Promise<Either<Error, string>>;
14
- }
15
- //# sourceMappingURL=NftDataSource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NftDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/nft/data/NftDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,kBAAkB,CAChB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAClC,mBAAmB,CACjB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACnC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=NftDataSource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NftDataSource.js","sourceRoot":"","sources":["../../../../../src/nft/data/NftDataSource.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import { ContainerModule } from "inversify";
2
- export declare const nftModuleFactory: () => ContainerModule;
3
- //# sourceMappingURL=nftModuleFactory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nftModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/nft/di/nftModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C,eAAO,MAAM,gBAAgB,uBAIzB,CAAC"}
@@ -1,9 +0,0 @@
1
- import { ContainerModule } from "inversify";
2
- import { HttpNftDataSource } from "../../nft/data/HttpNftDataSource";
3
- import { nftTypes } from "../../nft/di/nftTypes";
4
- import { NftContextLoader } from "../../nft/domain/NftContextLoader";
5
- export const nftModuleFactory = () => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
6
- bind(nftTypes.NftDataSource).to(HttpNftDataSource);
7
- bind(nftTypes.NftContextLoader).to(NftContextLoader);
8
- });
9
- //# sourceMappingURL=nftModuleFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nftModuleFactory.js","sourceRoot":"","sources":["../../../../../src/nft/di/nftModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const nftTypes: {
2
- NftDataSource: symbol;
3
- NftContextLoader: symbol;
4
- };
5
- //# sourceMappingURL=nftTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nftTypes.d.ts","sourceRoot":"","sources":["../../../../../src/nft/di/nftTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;CAGpB,CAAC"}
@@ -1,5 +0,0 @@
1
- export const nftTypes = {
2
- NftDataSource: Symbol.for("nftDataSource"),
3
- NftContextLoader: Symbol.for("nftContextLoader"),
4
- };
5
- //# sourceMappingURL=nftTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nftTypes.js","sourceRoot":"","sources":["../../../../../src/nft/di/nftTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;IAC1C,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC;CACjD,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { NftDataSource } from "../../nft/data/NftDataSource";
2
- import { ContextLoader } from "../../shared/domain/ContextLoader";
3
- import { ClearSignContext } from "../../shared/model/ClearSignContext";
4
- import { TransactionContext } from "../../shared/model/TransactionContext";
5
- export declare class NftContextLoader implements ContextLoader {
6
- private _dataSource;
7
- constructor(dataSource: NftDataSource);
8
- load(transaction: TransactionContext): Promise<ClearSignContext[]>;
9
- private isSelectorSupported;
10
- }
11
- //# sourceMappingURL=NftContextLoader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NftContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextLoader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAqBvE,qBACa,gBAAiB,YAAW,aAAa;IACpD,OAAO,CAAC,WAAW,CAAgB;gBAES,UAAU,EAAE,aAAa;IAI/D,IAAI,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA2ExE,OAAO,CAAC,mBAAmB;CAG5B"}