@ledgerhq/context-module 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (571) hide show
  1. package/README.md +4 -6
  2. package/lib/cjs/index.js +2 -20
  3. package/lib/cjs/index.js.map +7 -1
  4. package/lib/cjs/package.json +53 -59
  5. package/lib/cjs/src/ContextModule.js +2 -3
  6. package/lib/cjs/src/ContextModule.js.map +7 -1
  7. package/lib/cjs/src/ContextModuleBuilder.js +2 -87
  8. package/lib/cjs/src/ContextModuleBuilder.js.map +7 -1
  9. package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
  10. package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
  11. package/lib/cjs/src/DefaultContextModule.js +2 -21
  12. package/lib/cjs/src/DefaultContextModule.js.map +7 -1
  13. package/lib/cjs/src/DefaultContextModule.test.js +2 -0
  14. package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
  15. package/lib/cjs/src/config/di/configModuleFactory.js +2 -10
  16. package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -1
  17. package/lib/cjs/src/config/di/configTypes.js +2 -7
  18. package/lib/cjs/src/config/di/configTypes.js.map +7 -1
  19. package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -3
  20. package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -1
  21. package/lib/cjs/src/di.js +2 -17
  22. package/lib/cjs/src/di.js.map +7 -1
  23. package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -3
  24. package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -1
  25. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -3
  26. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
  27. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -83
  28. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
  29. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  30. package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  31. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -13
  32. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
  33. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -8
  34. package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -1
  35. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -136
  36. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
  37. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  38. package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  39. package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -3
  40. package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -1
  41. package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -3
  42. package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -1
  43. package/lib/cjs/src/index.js +2 -30
  44. package/lib/cjs/src/index.js.map +7 -1
  45. package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -57
  46. package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -1
  47. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
  48. package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  49. package/lib/cjs/src/nft/data/NftDataSource.js +2 -3
  50. package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -1
  51. package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -13
  52. package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -1
  53. package/lib/cjs/src/nft/di/nftTypes.js +2 -8
  54. package/lib/cjs/src/nft/di/nftTypes.js.map +7 -1
  55. package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -111
  56. package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -1
  57. package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
  58. package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
  59. package/lib/cjs/src/shared/domain/ContextLoader.js +2 -3
  60. package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -1
  61. package/lib/cjs/src/shared/model/ClearSignContext.js +2 -13
  62. package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -1
  63. package/lib/cjs/src/shared/model/GenericPath.js +2 -0
  64. package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
  65. package/lib/cjs/src/shared/model/TransactionContext.js +2 -3
  66. package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -1
  67. package/lib/cjs/src/shared/model/TransactionSubset.js +2 -3
  68. package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -1
  69. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -6
  70. package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -1
  71. package/lib/cjs/src/shared/model/TypedDataContext.js +2 -3
  72. package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -1
  73. package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -15
  74. package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -1
  75. package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -83
  76. package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -1
  77. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
  78. package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  79. package/lib/cjs/src/token/data/TokenDataSource.js +2 -3
  80. package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -1
  81. package/lib/cjs/src/token/data/TokenDto.js +2 -3
  82. package/lib/cjs/src/token/data/TokenDto.js.map +7 -1
  83. package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -13
  84. package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -1
  85. package/lib/cjs/src/token/di/tokenTypes.js +2 -8
  86. package/lib/cjs/src/token/di/tokenTypes.js.map +7 -1
  87. package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -74
  88. package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -1
  89. package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
  90. package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
  91. package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
  92. package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
  93. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
  94. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  95. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  96. package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  97. package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
  98. package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
  99. package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
  100. package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
  101. package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
  102. package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
  103. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
  104. package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  105. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  106. package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  107. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  108. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  109. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  110. package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  111. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
  112. package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  113. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
  114. package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  115. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  116. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  117. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
  118. package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  119. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  120. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  121. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  122. package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  123. package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -3
  124. package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -1
  125. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -163
  126. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
  127. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  128. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  129. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -3
  130. package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -1
  131. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -13
  132. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
  133. package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -8
  134. package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -1
  135. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -127
  136. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
  137. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  138. package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  139. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -3
  140. package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
  141. package/lib/esm/index.js +2 -4
  142. package/lib/esm/index.js.map +7 -1
  143. package/lib/esm/package.json +53 -59
  144. package/lib/esm/src/ContextModule.js +1 -2
  145. package/lib/esm/src/ContextModule.js.map +7 -1
  146. package/lib/esm/src/ContextModuleBuilder.js +2 -83
  147. package/lib/esm/src/ContextModuleBuilder.js.map +7 -1
  148. package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
  149. package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
  150. package/lib/esm/src/DefaultContextModule.js +2 -17
  151. package/lib/esm/src/DefaultContextModule.js.map +7 -1
  152. package/lib/esm/src/DefaultContextModule.test.js +2 -0
  153. package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
  154. package/lib/esm/src/config/di/configModuleFactory.js +2 -6
  155. package/lib/esm/src/config/di/configModuleFactory.js.map +7 -1
  156. package/lib/esm/src/config/di/configTypes.js +2 -4
  157. package/lib/esm/src/config/di/configTypes.js.map +7 -1
  158. package/lib/esm/src/config/model/ContextModuleConfig.js +1 -2
  159. package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -1
  160. package/lib/esm/src/di.js +2 -13
  161. package/lib/esm/src/di.js.map +7 -1
  162. package/lib/esm/src/external-plugin/data/DAppDto.js +1 -2
  163. package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -1
  164. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -2
  165. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
  166. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -77
  167. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
  168. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
  169. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
  170. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -9
  171. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
  172. package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -5
  173. package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -1
  174. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -133
  175. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
  176. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
  177. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
  178. package/lib/esm/src/external-plugin/model/DappInfos.js +1 -2
  179. package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -1
  180. package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -2
  181. package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -1
  182. package/lib/esm/src/index.js +2 -14
  183. package/lib/esm/src/index.js.map +7 -1
  184. package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -51
  185. package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -1
  186. package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
  187. package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
  188. package/lib/esm/src/nft/data/NftDataSource.js +1 -2
  189. package/lib/esm/src/nft/data/NftDataSource.js.map +7 -1
  190. package/lib/esm/src/nft/di/nftModuleFactory.js +2 -9
  191. package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -1
  192. package/lib/esm/src/nft/di/nftTypes.js +2 -5
  193. package/lib/esm/src/nft/di/nftTypes.js.map +7 -1
  194. package/lib/esm/src/nft/domain/NftContextLoader.js +2 -108
  195. package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -1
  196. package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
  197. package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
  198. package/lib/esm/src/shared/domain/ContextLoader.js +1 -2
  199. package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -1
  200. package/lib/esm/src/shared/model/ClearSignContext.js +2 -10
  201. package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -1
  202. package/lib/esm/src/shared/model/GenericPath.js +2 -0
  203. package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
  204. package/lib/esm/src/shared/model/TransactionContext.js +1 -2
  205. package/lib/esm/src/shared/model/TransactionContext.js.map +7 -1
  206. package/lib/esm/src/shared/model/TransactionSubset.js +1 -2
  207. package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -1
  208. package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -3
  209. package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -1
  210. package/lib/esm/src/shared/model/TypedDataContext.js +1 -2
  211. package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -1
  212. package/lib/esm/src/shared/utils/HexStringUtils.js +2 -11
  213. package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -1
  214. package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -77
  215. package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -1
  216. package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
  217. package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
  218. package/lib/esm/src/token/data/TokenDataSource.js +1 -2
  219. package/lib/esm/src/token/data/TokenDataSource.js.map +7 -1
  220. package/lib/esm/src/token/data/TokenDto.js +1 -2
  221. package/lib/esm/src/token/data/TokenDto.js.map +7 -1
  222. package/lib/esm/src/token/di/tokenModuleFactory.js +2 -9
  223. package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -1
  224. package/lib/esm/src/token/di/tokenTypes.js +2 -5
  225. package/lib/esm/src/token/di/tokenTypes.js.map +7 -1
  226. package/lib/esm/src/token/domain/TokenContextLoader.js +2 -71
  227. package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -1
  228. package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
  229. package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
  230. package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
  231. package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
  232. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
  233. package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
  234. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
  235. package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
  236. package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
  237. package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
  238. package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
  239. package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
  240. package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
  241. package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
  242. package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
  243. package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
  244. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
  245. package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
  246. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
  247. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
  248. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
  249. package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
  250. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
  251. package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
  252. package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
  253. package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
  254. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
  255. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
  256. package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
  257. package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
  258. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
  259. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
  260. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
  261. package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
  262. package/lib/esm/src/typed-data/data/FiltersDto.js +1 -2
  263. package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -1
  264. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -157
  265. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
  266. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
  267. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
  268. package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -2
  269. package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -1
  270. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -9
  271. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
  272. package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -5
  273. package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -1
  274. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -124
  275. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
  276. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
  277. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
  278. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -2
  279. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
  280. package/lib/{cjs → types}/src/ContextModule.d.ts +3 -2
  281. package/lib/types/src/ContextModule.d.ts.map +1 -0
  282. package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +9 -11
  283. package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -0
  284. package/lib/types/src/ContextModuleBuilder.test.d.ts +2 -0
  285. package/lib/types/src/ContextModuleBuilder.test.d.ts.map +1 -0
  286. package/lib/types/src/DefaultContextModule.d.ts +18 -0
  287. package/lib/types/src/DefaultContextModule.d.ts.map +1 -0
  288. package/lib/types/src/DefaultContextModule.test.d.ts +2 -0
  289. package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
  290. package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +1 -1
  291. package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts.map +1 -1
  292. package/lib/types/src/config/model/ContextModuleConfig.d.ts +16 -0
  293. package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -0
  294. package/lib/{cjs → types}/src/di.d.ts +1 -1
  295. package/lib/types/src/di.d.ts.map +1 -0
  296. package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
  297. package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -0
  298. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts +2 -0
  299. package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts.map +1 -0
  300. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts +2 -0
  301. package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts.map +1 -0
  302. package/lib/types/src/external-plugin/model/DappInfos.d.ts +6 -0
  303. package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -0
  304. package/lib/{cjs → types}/src/index.d.ts +3 -1
  305. package/lib/types/src/index.d.ts.map +1 -0
  306. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts +2 -0
  307. package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts.map +1 -0
  308. package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts +1 -1
  309. package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -0
  310. package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts +2 -1
  311. package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -0
  312. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts +2 -0
  313. package/lib/types/src/nft/domain/NftContextLoader.test.d.ts.map +1 -0
  314. package/lib/types/src/shared/domain/ContextLoader.d.ts +7 -0
  315. package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -0
  316. package/lib/types/src/shared/model/ClearSignContext.d.ts +40 -0
  317. package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -0
  318. package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
  319. package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
  320. package/lib/types/src/shared/model/TransactionContext.d.ts +19 -0
  321. package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -0
  322. package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
  323. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
  324. package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
  325. package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +1 -1
  326. package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -0
  327. package/lib/types/src/token/data/TokenDto.d.ts +16 -0
  328. package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
  329. package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +2 -1
  330. package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -0
  331. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
  332. package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
  333. package/lib/types/src/transaction/data/CalldataDto.d.ts +117 -0
  334. package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
  335. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +19 -0
  336. package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
  337. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
  338. package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
  339. package/lib/types/src/transaction/data/TransactionDataSource.d.ts +12 -0
  340. package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
  341. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
  342. package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
  343. package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
  344. package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
  345. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
  346. package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
  347. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
  348. package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
  349. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
  350. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
  351. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
  352. package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
  353. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
  354. package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
  355. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
  356. package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
  357. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
  358. package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
  359. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
  360. package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
  361. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
  362. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
  363. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
  364. package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
  365. package/lib/{cjs → types}/src/typed-data/data/FiltersDto.d.ts +3 -0
  366. package/lib/types/src/typed-data/data/FiltersDto.d.ts.map +1 -0
  367. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -0
  368. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +3 -0
  369. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -0
  370. package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
  371. package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -0
  372. package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
  373. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
  374. package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
  375. package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
  376. package/package.json +21 -27
  377. package/lib/cjs/src/ContextModule.d.ts.map +0 -1
  378. package/lib/cjs/src/ContextModuleBuilder.d.ts.map +0 -1
  379. package/lib/cjs/src/DefaultContextModule.d.ts +0 -20
  380. package/lib/cjs/src/DefaultContextModule.d.ts.map +0 -1
  381. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts +0 -9
  382. package/lib/cjs/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  383. package/lib/cjs/src/di.d.ts.map +0 -1
  384. package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  385. package/lib/cjs/src/external-plugin/model/DappInfos.d.ts +0 -6
  386. package/lib/cjs/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  387. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  388. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  389. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js +0 -3
  390. package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  391. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  392. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  393. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -40
  394. package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  395. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  396. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  397. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js +0 -13
  398. package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  399. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  400. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  401. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js +0 -8
  402. package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  403. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  404. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  405. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -66
  406. package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  407. package/lib/cjs/src/index.d.ts.map +0 -1
  408. package/lib/cjs/src/nft/data/NftDataSource.d.ts.map +0 -1
  409. package/lib/cjs/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  410. package/lib/cjs/src/shared/domain/ContextLoader.d.ts +0 -6
  411. package/lib/cjs/src/shared/domain/ContextLoader.d.ts.map +0 -1
  412. package/lib/cjs/src/shared/model/ClearSignContext.d.ts +0 -21
  413. package/lib/cjs/src/shared/model/ClearSignContext.d.ts.map +0 -1
  414. package/lib/cjs/src/shared/model/TransactionContext.d.ts +0 -6
  415. package/lib/cjs/src/shared/model/TransactionContext.d.ts.map +0 -1
  416. package/lib/cjs/src/token/data/TokenDataSource.d.ts.map +0 -1
  417. package/lib/cjs/src/token/data/TokenDto.d.ts +0 -6
  418. package/lib/cjs/src/token/data/TokenDto.d.ts.map +0 -1
  419. package/lib/cjs/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  420. package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  421. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  422. package/lib/cjs/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  423. package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  424. package/lib/esm/index.d.ts +0 -3
  425. package/lib/esm/index.d.ts.map +0 -1
  426. package/lib/esm/src/ContextModule.d.ts +0 -9
  427. package/lib/esm/src/ContextModule.d.ts.map +0 -1
  428. package/lib/esm/src/ContextModuleBuilder.d.ts +0 -45
  429. package/lib/esm/src/ContextModuleBuilder.d.ts.map +0 -1
  430. package/lib/esm/src/DefaultContextModule.d.ts +0 -20
  431. package/lib/esm/src/DefaultContextModule.d.ts.map +0 -1
  432. package/lib/esm/src/config/di/configModuleFactory.d.ts +0 -4
  433. package/lib/esm/src/config/di/configModuleFactory.d.ts.map +0 -1
  434. package/lib/esm/src/config/di/configTypes.d.ts +0 -4
  435. package/lib/esm/src/config/di/configTypes.d.ts.map +0 -1
  436. package/lib/esm/src/config/model/ContextModuleConfig.d.ts +0 -9
  437. package/lib/esm/src/config/model/ContextModuleConfig.d.ts.map +0 -1
  438. package/lib/esm/src/di.d.ts +0 -8
  439. package/lib/esm/src/di.d.ts.map +0 -1
  440. package/lib/esm/src/external-plugin/data/DAppDto.d.ts +0 -38
  441. package/lib/esm/src/external-plugin/data/DAppDto.d.ts.map +0 -1
  442. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -12
  443. package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
  444. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -10
  445. package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -1
  446. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -3
  447. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -1
  448. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts +0 -5
  449. package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -1
  450. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -15
  451. package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -1
  452. package/lib/esm/src/external-plugin/model/DappInfos.d.ts +0 -6
  453. package/lib/esm/src/external-plugin/model/DappInfos.d.ts.map +0 -1
  454. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts +0 -8
  455. package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts.map +0 -1
  456. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
  457. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
  458. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js +0 -2
  459. package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
  460. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
  461. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
  462. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -34
  463. package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
  464. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
  465. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
  466. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js +0 -9
  467. package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
  468. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
  469. package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
  470. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js +0 -5
  471. package/lib/esm/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
  472. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
  473. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
  474. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -63
  475. package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
  476. package/lib/esm/src/index.d.ts +0 -14
  477. package/lib/esm/src/index.d.ts.map +0 -1
  478. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts +0 -7
  479. package/lib/esm/src/nft/data/HttpNftDataSource.d.ts.map +0 -1
  480. package/lib/esm/src/nft/data/NftDataSource.d.ts +0 -15
  481. package/lib/esm/src/nft/data/NftDataSource.d.ts.map +0 -1
  482. package/lib/esm/src/nft/di/nftModuleFactory.d.ts +0 -3
  483. package/lib/esm/src/nft/di/nftModuleFactory.d.ts.map +0 -1
  484. package/lib/esm/src/nft/di/nftTypes.d.ts +0 -5
  485. package/lib/esm/src/nft/di/nftTypes.d.ts.map +0 -1
  486. package/lib/esm/src/nft/domain/NftContextLoader.d.ts +0 -11
  487. package/lib/esm/src/nft/domain/NftContextLoader.d.ts.map +0 -1
  488. package/lib/esm/src/shared/domain/ContextLoader.d.ts +0 -6
  489. package/lib/esm/src/shared/domain/ContextLoader.d.ts.map +0 -1
  490. package/lib/esm/src/shared/model/ClearSignContext.d.ts +0 -21
  491. package/lib/esm/src/shared/model/ClearSignContext.d.ts.map +0 -1
  492. package/lib/esm/src/shared/model/TransactionContext.d.ts +0 -6
  493. package/lib/esm/src/shared/model/TransactionContext.d.ts.map +0 -1
  494. package/lib/esm/src/shared/model/TransactionSubset.d.ts +0 -6
  495. package/lib/esm/src/shared/model/TransactionSubset.d.ts.map +0 -1
  496. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts +0 -33
  497. package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -1
  498. package/lib/esm/src/shared/model/TypedDataContext.d.ts +0 -16
  499. package/lib/esm/src/shared/model/TypedDataContext.d.ts.map +0 -1
  500. package/lib/esm/src/shared/utils/HexStringUtils.d.ts +0 -4
  501. package/lib/esm/src/shared/utils/HexStringUtils.d.ts.map +0 -1
  502. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts +0 -9
  503. package/lib/esm/src/token/data/HttpTokenDataSource.d.ts.map +0 -1
  504. package/lib/esm/src/token/data/TokenDataSource.d.ts +0 -9
  505. package/lib/esm/src/token/data/TokenDataSource.d.ts.map +0 -1
  506. package/lib/esm/src/token/data/TokenDto.d.ts +0 -6
  507. package/lib/esm/src/token/data/TokenDto.d.ts.map +0 -1
  508. package/lib/esm/src/token/di/tokenModuleFactory.d.ts +0 -3
  509. package/lib/esm/src/token/di/tokenModuleFactory.d.ts.map +0 -1
  510. package/lib/esm/src/token/di/tokenTypes.d.ts +0 -5
  511. package/lib/esm/src/token/di/tokenTypes.d.ts.map +0 -1
  512. package/lib/esm/src/token/domain/TokenContextLoader.d.ts +0 -15
  513. package/lib/esm/src/token/domain/TokenContextLoader.d.ts.map +0 -1
  514. package/lib/esm/src/typed-data/data/FiltersDto.d.ts +0 -55
  515. package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
  516. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -14
  517. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
  518. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts +0 -17
  519. package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
  520. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts +0 -3
  521. package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -1
  522. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts +0 -5
  523. package/lib/esm/src/typed-data/di/typedDataTypes.d.ts.map +0 -1
  524. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -13
  525. package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -1
  526. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -6
  527. package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -1
  528. package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
  529. /package/lib/{cjs → types}/index.d.ts +0 -0
  530. /package/lib/{cjs → types}/index.d.ts.map +0 -0
  531. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts +0 -0
  532. /package/lib/{cjs → types}/src/config/di/configTypes.d.ts.map +0 -0
  533. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts +0 -0
  534. /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts.map +0 -0
  535. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -0
  536. /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -0
  537. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -0
  538. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -0
  539. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts +0 -0
  540. /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -0
  541. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -0
  542. /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -0
  543. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts +0 -0
  544. /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts.map +0 -0
  545. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts +0 -0
  546. /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts.map +0 -0
  547. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts +0 -0
  548. /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts.map +0 -0
  549. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts +0 -0
  550. /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts.map +0 -0
  551. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
  552. /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
  553. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
  554. /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
  555. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
  556. /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
  557. /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts +0 -0
  558. /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +0 -0
  559. /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
  560. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts +0 -0
  561. /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts.map +0 -0
  562. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts +0 -0
  563. /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts.map +0 -0
  564. /package/lib/{cjs → types}/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -0
  565. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts +0 -0
  566. /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -0
  567. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts +0 -0
  568. /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts.map +0 -0
  569. /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -0
  570. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
  571. /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAAmD;AACnD,kDAAgC;AAChC,yDAAuC;AACvC,yDAAuC;AACvC,uFAAqE;AACrE,qFAAmE;AACnE,gEAA8C;AAC9C,kEAAgD;AAChD,oEAAkD;AAClD,mEAAiD;AACjD,2EAAyD;AACzD,kEAAgD;AAChD,oEAAkD"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/index.ts"],
4
+ "sourcesContent": ["export * from \"./config/model/ContextModuleConfig\";\nexport * from \"./ContextModule\";\nexport * from \"./ContextModuleBuilder\";\nexport * from \"./DefaultContextModule\";\nexport * from \"./external-plugin/domain/ExternalPluginContextLoader\";\nexport * from \"./nft/domain/NftContextLoader\";\nexport * from \"./shared/domain/ContextLoader\";\nexport * from \"./shared/model/ClearSignContext\";\nexport * from \"./shared/model/GenericPath\";\nexport * from \"./shared/model/TransactionContext\";\nexport * from \"./shared/model/TransactionSubset\";\nexport * from \"./shared/model/TypedDataClearSignContext\";\nexport * from \"./shared/model/TypedDataContext\";\nexport * from \"./token/domain/TokenContextLoader\";\nexport * from \"./trusted-name/domain/TrustedNameContextLoader\";\n"],
5
+ "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,8CAAd,gBACAE,EAAAF,EAAc,2BADd,gBAEAE,EAAAF,EAAc,kCAFd,gBAGAE,EAAAF,EAAc,kCAHd,gBAIAE,EAAAF,EAAc,gEAJd,gBAKAE,EAAAF,EAAc,yCALd,gBAMAE,EAAAF,EAAc,yCANd,gBAOAE,EAAAF,EAAc,2CAPd,gBAQAE,EAAAF,EAAc,sCARd,gBASAE,EAAAF,EAAc,6CATd,gBAUAE,EAAAF,EAAc,4CAVd,gBAWAE,EAAAF,EAAc,oDAXd,gBAYAE,EAAAF,EAAc,2CAZd,gBAaAE,EAAAF,EAAc,6CAbd,gBAcAE,EAAAF,EAAc,0DAdd",
6
+ "names": ["src_exports", "__toCommonJS", "__reExport"]
7
+ }
@@ -1,57 +1,2 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.HttpNftDataSource = 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 HttpNftDataSource = class HttpNftDataSource {
18
- async getSetPluginPayload({ chainId, address, selector, }) {
19
- try {
20
- const response = await axios_1.default.request({
21
- method: "GET",
22
- url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}/plugin-selector/${selector}`,
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] HttpNftDataSource: unexpected empty response"));
30
- }
31
- catch (_error) {
32
- return (0, purify_ts_1.Left)(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"));
33
- }
34
- }
35
- async getNftInfosPayload({ chainId, address, }) {
36
- try {
37
- const response = await axios_1.default.request({
38
- method: "GET",
39
- url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}`,
40
- headers: {
41
- "X-Ledger-Client-Version": `context-module/${package_json_1.default.version}`,
42
- },
43
- });
44
- return response.data.payload
45
- ? (0, purify_ts_1.Right)(response.data.payload)
46
- : (0, purify_ts_1.Left)(new Error("[ContextModule] HttpNftDataSource: no nft metadata"));
47
- }
48
- catch (_error) {
49
- return (0, purify_ts_1.Left)(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"));
50
- }
51
- }
52
- };
53
- exports.HttpNftDataSource = HttpNftDataSource;
54
- exports.HttpNftDataSource = HttpNftDataSource = __decorate([
55
- (0, inversify_1.injectable)()
56
- ], HttpNftDataSource);
57
- //# sourceMappingURL=HttpNftDataSource.js.map
1
+ "use strict";var y=Object.create;var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},u=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of P(t))!x.call(e,r)&&r!==o&&i(e,r,{get:()=>t[r],enumerable:!(a=c(t,r))||a.enumerable});return e};var f=(e,t,o)=>(o=e!=null?y(E(e)):{},u(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),G=e=>u(i({},"__esModule",{value:!0}),e),g=(e,t,o,a)=>{for(var r=a>1?void 0:a?c(t,o):t,l=e.length-1,d;l>=0;l--)(d=e[l])&&(r=(a?d(t,o,r):d(r))||r);return a&&r&&i(t,o,r),r};var $={};C($,{HttpNftDataSource:()=>s});module.exports=G($);var m=f(require("axios")),h=require("inversify"),n=require("purify-ts"),p=f(require("../../../package.json"));let s=class{async getSetPluginPayload({chainId:t,address:o,selector:a}){try{const r=await m.default.request({method:"GET",url:`https://nft.api.live.ledger.com/v1/ethereum/${t}/contracts/${o}/plugin-selector/${a}`,headers:{"X-Ledger-Client-Version":`context-module/${p.default.version}`}});return r.data.payload?(0,n.Right)(r.data.payload):(0,n.Left)(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"))}catch{return(0,n.Left)(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"))}}async getNftInfosPayload({chainId:t,address:o}){try{const a=await m.default.request({method:"GET",url:`https://nft.api.live.ledger.com/v1/ethereum/${t}/contracts/${o}`,headers:{"X-Ledger-Client-Version":`context-module/${p.default.version}`}});return a.data.payload?(0,n.Right)(a.data.payload):(0,n.Left)(new Error("[ContextModule] HttpNftDataSource: no nft metadata"))}catch{return(0,n.Left)(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"))}}};s=g([(0,h.injectable)()],s);0&&(module.exports={HttpNftDataSource});
2
+ //# sourceMappingURL=HttpNftDataSource.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"HttpNftDataSource.js","sourceRoot":"","sources":["../../../../../src/nft/data/HttpNftDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA0B;AAC1B,yCAAuC;AACvC,yCAAgD;AAOhD,sEAAyC;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,eAAK,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,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,8DAA8D,CAC/D,CACF,CAAC;QACR,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAA,gBAAI,EACT,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,eAAK,CAAC,OAAO,CAAsB;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,+CAA+C,OAAO,cAAc,OAAO,EAAE;gBAClF,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,EAAC,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC,CAAC;QAC5E,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAA,gBAAI,EACT,IAAI,KAAK,CACP,qEAAqE,CACtE,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAvDY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;GACA,iBAAiB,CAuD7B"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/data/HttpNftDataSource.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport {\n GetNftInformationsParams,\n GetSetPluginPayloadParams,\n NftDataSource,\n} from \"@/nft/data/NftDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpNftDataSource implements NftDataSource {\n public async getSetPluginPayload({\n chainId,\n address,\n selector,\n }: GetSetPluginPayloadParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<{ payload: string }>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}/plugin-selector/${selector}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.payload\n ? Right(response.data.payload)\n : Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: unexpected empty response\",\n ),\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload\",\n ),\n );\n }\n }\n\n public async getNftInfosPayload({\n chainId,\n address,\n }: GetNftInformationsParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<{ payload: string }>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.payload\n ? Right(response.data.payload)\n : Left(new Error(\"[ContextModule] HttpNftDataSource: no nft metadata\"));\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch nft informations\",\n ),\n );\n }\n }\n}\n"],
5
+ "mappings": "4rBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,oBAClBC,EAA2B,qBAC3BC,EAAoC,qBAOpCC,EAAoB,iCAGb,IAAMC,EAAN,KAAiD,CACtD,MAAa,oBAAoB,CAC/B,QAAAC,EACA,QAAAC,EACA,SAAAC,CACF,EAA8D,CAC5D,GAAI,CACF,MAAMC,EAAW,MAAM,EAAAC,QAAM,QAA6B,CACxD,OAAQ,MACR,IAAK,+CAA+CJ,CAAO,cAAcC,CAAO,oBAAoBC,CAAQ,GAC5G,QAAS,CACP,0BAA2B,kBAAkB,EAAAG,QAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,WACjB,SAAMA,EAAS,KAAK,OAAO,KAC3B,QACE,IAAI,MACF,8DACF,CACF,CACN,MAAiB,CACf,SAAO,QACL,IAAI,MACF,uEACF,CACF,CACF,CACF,CAEA,MAAa,mBAAmB,CAC9B,QAAAH,EACA,QAAAC,CACF,EAA6D,CAC3D,GAAI,CACF,MAAME,EAAW,MAAM,EAAAC,QAAM,QAA6B,CACxD,OAAQ,MACR,IAAK,+CAA+CJ,CAAO,cAAcC,CAAO,GAChF,QAAS,CACP,0BAA2B,kBAAkB,EAAAI,QAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,WACjB,SAAMA,EAAS,KAAK,OAAO,KAC3B,QAAK,IAAI,MAAM,oDAAoD,CAAC,CAC1E,MAAiB,CACf,SAAO,QACL,IAAI,MACF,qEACF,CACF,CACF,CACF,CACF,EAvDaJ,EAANO,EAAA,IADN,cAAW,GACCP",
6
+ "names": ["HttpNftDataSource_exports", "__export", "HttpNftDataSource", "__toCommonJS", "import_axios", "import_inversify", "import_purify_ts", "import_package", "HttpNftDataSource", "chainId", "address", "selector", "response", "axios", "PACKAGE", "__decorateClass"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.create;var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!y.call(t,r)&&r!==a&&n(t,r,{get:()=>e[r],enumerable:!(s=u(e,r))||s.enumerable});return t};var l=(t,e,a)=>(a=t!=null?i(x(t)):{},h(e||!t||!t.__esModule?n(a,"default",{value:t,enumerable:!0}):a,t));var o=l(require("axios")),d=l(require("../../../package.json")),c=require("./HttpNftDataSource");jest.mock("axios");describe("HttpNftDataSource",()=>{let t;beforeAll(()=>{t=new c.HttpNftDataSource,jest.clearAllMocks()}),it("should call axios with the ledger client version header",async()=>{const e=`context-module/${d.default.version}`,a=jest.fn(()=>Promise.resolve({data:[]}));jest.spyOn(o.default,"request").mockImplementation(a),await t.getNftInfosPayload({address:"0x00",chainId:1}),await t.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"}),expect(a).toHaveBeenNthCalledWith(1,expect.objectContaining({headers:{"X-Ledger-Client-Version":e}})),expect(a).toHaveBeenNthCalledWith(2,expect.objectContaining({headers:{"X-Ledger-Client-Version":e}}))}),describe("getNftInfosPayload",()=>{it("should return an error when axios throws an error",async()=>{jest.spyOn(o.default,"request").mockRejectedValue(new Error("error"));const e=await t.getNftInfosPayload({address:"0x00",chainId:1});expect(e.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"))}),it("should return an error when the response is empty",async()=>{const e={data:{}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getNftInfosPayload({address:"0x00",chainId:1});expect(a.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: no nft metadata"))}),it("should return the payload",async()=>{const e={data:{payload:"payload"}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getNftInfosPayload({address:"0x00",chainId:1});expect(a.extract()).toEqual("payload")})}),describe("getSetPluginPayload",()=>{it("should return an error when axios throws an error",async()=>{jest.spyOn(o.default,"request").mockRejectedValue(new Error("error"));const e=await t.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(e.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"))}),it("should return an error when the response is empty",async()=>{const e={data:{}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(a.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"))}),it("should return the payload",async()=>{const e={data:{payload:"payload"}};jest.spyOn(o.default,"request").mockResolvedValue(e);const a=await t.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(a.extract()).toEqual("payload")})})});
2
+ //# sourceMappingURL=HttpNftDataSource.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/data/HttpNftDataSource.test.ts"],
4
+ "sourcesContent": ["import axios from \"axios\";\n\nimport PACKAGE from \"@root/package.json\";\n\nimport { HttpNftDataSource } from \"./HttpNftDataSource\";\nimport { type NftDataSource } from \"./NftDataSource\";\n\njest.mock(\"axios\");\n\ndescribe(\"HttpNftDataSource\", () => {\n let datasource: NftDataSource;\n\n beforeAll(() => {\n datasource = new HttpNftDataSource();\n jest.clearAllMocks();\n });\n\n it(\"should call axios with the ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = jest.fn(() => Promise.resolve({ data: [] }));\n jest.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getNftInfosPayload({ address: \"0x00\", chainId: 1 });\n await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenNthCalledWith(\n 1,\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n expect(requestSpy).toHaveBeenNthCalledWith(\n 2,\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n describe(\"getNftInfosPayload\", () => {\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n jest.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch nft informations\",\n ),\n );\n });\n\n it(\"should return an error when the response is empty\", async () => {\n // GIVEN\n const response = { data: {} };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\"[ContextModule] HttpNftDataSource: no nft metadata\"),\n );\n });\n\n it(\"should return the payload\", async () => {\n // GIVEN\n const response = { data: { payload: \"payload\" } };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\"payload\");\n });\n });\n\n describe(\"getSetPluginPayload\", () => {\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n jest.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload\",\n ),\n );\n });\n\n it(\"should return an error when the response is empty\", async () => {\n // GIVEN\n const response = { data: {} };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: unexpected empty response\",\n ),\n );\n });\n\n it(\"should return the payload\", async () => {\n // GIVEN\n const response = { data: { payload: \"payload\" } };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\"payload\");\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["import_axios", "import_package", "import_HttpNftDataSource", "datasource", "version", "PACKAGE", "requestSpy", "axios", "result", "response"]
7
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=NftDataSource.js.map
1
+ "use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var P=(t,r,o,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of n(r))!m.call(t,a)&&a!==o&&s(t,a,{get:()=>r[a],enumerable:!(e=i(r,a))||e.enumerable});return t};var d=t=>P(s({},"__esModule",{value:!0}),t);var g={};module.exports=d(g);
2
+ //# sourceMappingURL=NftDataSource.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"NftDataSource.js","sourceRoot":"","sources":["../../../../../src/nft/data/NftDataSource.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/data/NftDataSource.ts"],
4
+ "sourcesContent": ["import { type Either } from \"purify-ts\";\n\nexport type GetSetPluginPayloadParams = {\n chainId: number;\n address: string;\n selector: string;\n};\n\nexport type GetNftInformationsParams = {\n chainId: number;\n address: string;\n};\n\nexport interface NftDataSource {\n getNftInfosPayload(\n params: GetNftInformationsParams,\n ): Promise<Either<Error, string>>;\n getSetPluginPayload(\n params: GetSetPluginPayloadParams,\n ): Promise<Either<Error, string>>;\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["NftDataSource_exports", "__toCommonJS"]
7
+ }
@@ -1,13 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nftModuleFactory = void 0;
4
- const inversify_1 = require("inversify");
5
- const HttpNftDataSource_1 = require("../../nft/data/HttpNftDataSource");
6
- const nftTypes_1 = require("../../nft/di/nftTypes");
7
- const NftContextLoader_1 = require("../../nft/domain/NftContextLoader");
8
- const nftModuleFactory = () => new inversify_1.ContainerModule((bind, _unbind, _isBound, _rebind) => {
9
- bind(nftTypes_1.nftTypes.NftDataSource).to(HttpNftDataSource_1.HttpNftDataSource);
10
- bind(nftTypes_1.nftTypes.NftContextLoader).to(NftContextLoader_1.NftContextLoader);
11
- });
12
- exports.nftModuleFactory = nftModuleFactory;
13
- //# sourceMappingURL=nftModuleFactory.js.map
1
+ "use strict";var f=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var N=(t,o)=>{for(var r in o)f(t,r,{get:o[r],enumerable:!0})},s=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of u(o))!c.call(t,e)&&e!==r&&f(t,e,{get:()=>o[e],enumerable:!(n=d(o,e))||n.enumerable});return t};var x=t=>s(f({},"__esModule",{value:!0}),t);var _={};N(_,{nftModuleFactory:()=>C});module.exports=x(_);var m=require("inversify"),i=require("../../nft/data/HttpNftDataSource"),a=require("../../nft/di/nftTypes"),p=require("../../nft/domain/NftContextLoader");const C=()=>new m.ContainerModule((t,o,r,n)=>{t(a.nftTypes.NftDataSource).to(i.HttpNftDataSource),t(a.nftTypes.NftContextLoader).to(p.NftContextLoader)});0&&(module.exports={nftModuleFactory});
2
+ //# sourceMappingURL=nftModuleFactory.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"nftModuleFactory.js","sourceRoot":"","sources":["../../../../../src/nft/di/nftModuleFactory.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAE5C,oEAAiE;AACjE,gDAA6C;AAC7C,oEAAiE;AAE1D,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAC,mBAAQ,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,qCAAiB,CAAC,CAAC;IACnD,IAAI,CAAC,mBAAQ,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,mCAAgB,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC;AAJQ,QAAA,gBAAgB,oBAIxB"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/di/nftModuleFactory.ts"],
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpNftDataSource } from \"@/nft/data/HttpNftDataSource\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { NftContextLoader } from \"@/nft/domain/NftContextLoader\";\n\nexport const nftModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(nftTypes.NftDataSource).to(HttpNftDataSource);\n bind(nftTypes.NftContextLoader).to(NftContextLoader);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAkC,wCAClCC,EAAyB,6BACzBC,EAAiC,yCAE1B,MAAML,EAAmB,IAC9B,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,WAAS,aAAa,EAAE,GAAG,mBAAiB,EACjDA,EAAK,WAAS,gBAAgB,EAAE,GAAG,kBAAgB,CACrD,CAAC",
6
+ "names": ["nftModuleFactory_exports", "__export", "nftModuleFactory", "__toCommonJS", "import_inversify", "import_HttpNftDataSource", "import_nftTypes", "import_NftContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
7
+ }
@@ -1,8 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nftTypes = void 0;
4
- exports.nftTypes = {
5
- NftDataSource: Symbol.for("nftDataSource"),
6
- NftContextLoader: Symbol.for("nftContextLoader"),
7
- };
8
- //# sourceMappingURL=nftTypes.js.map
1
+ "use strict";var r=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var x=(o,t)=>{for(var f in t)r(o,f,{get:t[f],enumerable:!0})},y=(o,t,f,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of S(t))!c.call(o,e)&&e!==f&&r(o,e,{get:()=>t[e],enumerable:!(a=n(t,e))||a.enumerable});return o};var b=o=>y(r({},"__esModule",{value:!0}),o);var l={};x(l,{nftTypes:()=>d});module.exports=b(l);const d={NftDataSource:Symbol.for("nftDataSource"),NftContextLoader:Symbol.for("nftContextLoader")};0&&(module.exports={nftTypes});
2
+ //# sourceMappingURL=nftTypes.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"nftTypes.js","sourceRoot":"","sources":["../../../../../src/nft/di/nftTypes.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;IAC1C,gBAAgB,EAAE,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC;CACjD,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/di/nftTypes.ts"],
4
+ "sourcesContent": ["export const nftTypes = {\n NftDataSource: Symbol.for(\"nftDataSource\"),\n NftContextLoader: Symbol.for(\"nftContextLoader\"),\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAW,CACtB,cAAe,OAAO,IAAI,eAAe,EACzC,iBAAkB,OAAO,IAAI,kBAAkB,CACjD",
6
+ "names": ["nftTypes_exports", "__export", "nftTypes", "__toCommonJS"]
7
+ }
@@ -1,111 +1,2 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.NftContextLoader = void 0;
16
- const device_management_kit_1 = require("@ledgerhq/device-management-kit");
17
- const inversify_1 = require("inversify");
18
- const nftTypes_1 = require("../../nft/di/nftTypes");
19
- const ClearSignContext_1 = require("../../shared/model/ClearSignContext");
20
- var ERC721_SUPPORTED_SELECTOR;
21
- (function (ERC721_SUPPORTED_SELECTOR) {
22
- ERC721_SUPPORTED_SELECTOR["Approve"] = "0x095ea7b3";
23
- ERC721_SUPPORTED_SELECTOR["SetApprovalForAll"] = "0xa22cb465";
24
- ERC721_SUPPORTED_SELECTOR["TransferFrom"] = "0x23b872dd";
25
- ERC721_SUPPORTED_SELECTOR["SafeTransferFrom"] = "0x42842e0e";
26
- ERC721_SUPPORTED_SELECTOR["SafeTransferFromWithData"] = "0xb88d4fde";
27
- })(ERC721_SUPPORTED_SELECTOR || (ERC721_SUPPORTED_SELECTOR = {}));
28
- var ERC1155_SUPPORTED_SELECTOR;
29
- (function (ERC1155_SUPPORTED_SELECTOR) {
30
- ERC1155_SUPPORTED_SELECTOR["SetApprovalForAll"] = "0xa22cb465";
31
- ERC1155_SUPPORTED_SELECTOR["SafeTransferFrom"] = "0xf242432a";
32
- ERC1155_SUPPORTED_SELECTOR["SafeBatchTransferFrom"] = "0x2eb2c2d6";
33
- })(ERC1155_SUPPORTED_SELECTOR || (ERC1155_SUPPORTED_SELECTOR = {}));
34
- const SUPPORTED_SELECTORS = [
35
- ...Object.values(ERC721_SUPPORTED_SELECTOR),
36
- ...Object.values(ERC1155_SUPPORTED_SELECTOR),
37
- ];
38
- let NftContextLoader = class NftContextLoader {
39
- _dataSource;
40
- constructor(dataSource) {
41
- this._dataSource = dataSource;
42
- }
43
- async load(transaction) {
44
- const responses = [];
45
- if (!transaction.to || !transaction.data || transaction.data === "0x") {
46
- return [];
47
- }
48
- const selector = transaction.data.slice(0, 10);
49
- if (!(0, device_management_kit_1.isHexaString)(selector)) {
50
- return [
51
- {
52
- type: ClearSignContext_1.ClearSignContextType.ERROR,
53
- error: new Error("Invalid selector"),
54
- },
55
- ];
56
- }
57
- if (!this.isSelectorSupported(selector)) {
58
- return [];
59
- }
60
- // EXAMPLE:
61
- // https://nft.api.live.ledger.com/v1/ethereum/1/contracts/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/plugin-selector/0x095ea7b3
62
- const getPluginPayloadResponse = await this._dataSource.getSetPluginPayload({
63
- chainId: transaction.chainId,
64
- address: transaction.to,
65
- selector,
66
- });
67
- const pluginPayload = getPluginPayloadResponse.caseOf({
68
- Left: (error) => ({
69
- type: ClearSignContext_1.ClearSignContextType.ERROR,
70
- error,
71
- }),
72
- Right: (value) => ({
73
- type: ClearSignContext_1.ClearSignContextType.PLUGIN,
74
- payload: value,
75
- }),
76
- });
77
- if (pluginPayload.type === ClearSignContext_1.ClearSignContextType.ERROR) {
78
- return [pluginPayload];
79
- }
80
- responses.push(pluginPayload);
81
- const getNftInfosPayloadResponse = await this._dataSource.getNftInfosPayload({
82
- chainId: transaction.chainId,
83
- address: transaction.to,
84
- });
85
- const nftInfosPayload = getNftInfosPayloadResponse.caseOf({
86
- Left: (error) => ({
87
- type: ClearSignContext_1.ClearSignContextType.ERROR,
88
- error,
89
- }),
90
- Right: (value) => ({
91
- type: ClearSignContext_1.ClearSignContextType.NFT,
92
- payload: value,
93
- }),
94
- });
95
- if (nftInfosPayload.type === ClearSignContext_1.ClearSignContextType.ERROR) {
96
- return [nftInfosPayload];
97
- }
98
- responses.push(nftInfosPayload);
99
- return responses;
100
- }
101
- isSelectorSupported(selector) {
102
- return Object.values(SUPPORTED_SELECTORS).includes(selector);
103
- }
104
- };
105
- exports.NftContextLoader = NftContextLoader;
106
- exports.NftContextLoader = NftContextLoader = __decorate([
107
- (0, inversify_1.injectable)(),
108
- __param(0, (0, inversify_1.inject)(nftTypes_1.nftTypes.NftDataSource)),
109
- __metadata("design:paramtypes", [Object])
110
- ], NftContextLoader);
111
- //# sourceMappingURL=NftContextLoader.js.map
1
+ "use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var b=(o,e)=>{for(var a in e)p(o,a,{get:e[a],enumerable:!0})},C=(o,e,a,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of F(e))!I.call(o,r)&&r!==a&&p(o,r,{get:()=>e[r],enumerable:!(t=u(e,r))||t.enumerable});return o};var N=o=>C(p({},"__esModule",{value:!0}),o),g=(o,e,a,t)=>{for(var r=t>1?void 0:t?u(e,a):e,n=o.length-1,d;n>=0;n--)(d=o[n])&&(r=(t?d(e,a,r):d(r))||r);return t&&r&&p(e,a,r),r},y=(o,e)=>(a,t)=>e(a,t,o);var j={};b(j,{NftContextLoader:()=>l});module.exports=N(j);var x=require("@ledgerhq/device-management-kit"),c=require("inversify"),m=require("../../nft/di/nftTypes"),s=require("../../shared/model/ClearSignContext");var S=(n=>(n.Approve="0x095ea7b3",n.SetApprovalForAll="0xa22cb465",n.TransferFrom="0x23b872dd",n.SafeTransferFrom="0x42842e0e",n.SafeTransferFromWithData="0xb88d4fde",n))(S||{}),h=(t=>(t.SetApprovalForAll="0xa22cb465",t.SafeTransferFrom="0xf242432a",t.SafeBatchTransferFrom="0x2eb2c2d6",t))(h||{});const v=[...Object.values(S),...Object.values(h)];let l=class{_dataSource;constructor(e){this._dataSource=e}async load(e){const a=[];if(!e.to||!e.data||e.data==="0x")return[];const t=e.data.slice(0,10);if(!(0,x.isHexaString)(t))return[{type:s.ClearSignContextType.ERROR,error:new Error("Invalid selector")}];if(!this.isSelectorSupported(t))return[];const n=(await this._dataSource.getSetPluginPayload({chainId:e.chainId,address:e.to,selector:t})).caseOf({Left:i=>({type:s.ClearSignContextType.ERROR,error:i}),Right:i=>({type:s.ClearSignContextType.PLUGIN,payload:i})});if(n.type===s.ClearSignContextType.ERROR)return[n];a.push(n);const f=(await this._dataSource.getNftInfosPayload({chainId:e.chainId,address:e.to})).caseOf({Left:i=>({type:s.ClearSignContextType.ERROR,error:i}),Right:i=>({type:s.ClearSignContextType.NFT,payload:i})});return f.type===s.ClearSignContextType.ERROR?[f]:(a.push(f),a)}async loadField(e){return e.type!==s.ClearSignContextType.NFT?null:(await this._dataSource.getNftInfosPayload({address:e.address,chainId:e.chainId})).caseOf({Left:t=>({type:s.ClearSignContextType.ERROR,error:t}),Right:t=>({type:s.ClearSignContextType.NFT,payload:t})})}isSelectorSupported(e){return Object.values(v).includes(e)}};l=g([(0,c.injectable)(),y(0,(0,c.inject)(m.nftTypes.NftDataSource))],l);0&&(module.exports={NftContextLoader});
2
+ //# sourceMappingURL=NftContextLoader.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"NftContextLoader.js","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextLoader.ts"],"names":[],"mappings":"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"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/domain/NftContextLoader.ts"],
4
+ "sourcesContent": ["import { HexaString, isHexaString } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport type { NftDataSource } from \"@/nft/data/NftDataSource\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport {\n TransactionContext,\n TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\n\nenum ERC721_SUPPORTED_SELECTOR {\n Approve = \"0x095ea7b3\",\n SetApprovalForAll = \"0xa22cb465\",\n TransferFrom = \"0x23b872dd\",\n SafeTransferFrom = \"0x42842e0e\",\n SafeTransferFromWithData = \"0xb88d4fde\",\n}\n\nenum ERC1155_SUPPORTED_SELECTOR {\n SetApprovalForAll = \"0xa22cb465\",\n SafeTransferFrom = \"0xf242432a\",\n SafeBatchTransferFrom = \"0x2eb2c2d6\",\n}\n\nconst SUPPORTED_SELECTORS: HexaString[] = [\n ...Object.values(ERC721_SUPPORTED_SELECTOR),\n ...Object.values(ERC1155_SUPPORTED_SELECTOR),\n];\n\n@injectable()\nexport class NftContextLoader implements ContextLoader {\n private _dataSource: NftDataSource;\n\n constructor(@inject(nftTypes.NftDataSource) dataSource: NftDataSource) {\n this._dataSource = dataSource;\n }\n\n async load(transaction: TransactionContext): Promise<ClearSignContext[]> {\n const responses: ClearSignContext[] = [];\n\n if (!transaction.to || !transaction.data || transaction.data === \"0x\") {\n return [];\n }\n\n const selector = transaction.data.slice(0, 10);\n\n if (!isHexaString(selector)) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ];\n }\n\n if (!this.isSelectorSupported(selector)) {\n return [];\n }\n\n // EXAMPLE:\n // https://nft.api.live.ledger.com/v1/ethereum/1/contracts/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/plugin-selector/0x095ea7b3\n const getPluginPayloadResponse = await this._dataSource.getSetPluginPayload(\n {\n chainId: transaction.chainId,\n address: transaction.to,\n selector,\n },\n );\n\n const pluginPayload = getPluginPayloadResponse.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.PLUGIN,\n payload: value,\n }),\n });\n\n if (pluginPayload.type === ClearSignContextType.ERROR) {\n return [pluginPayload];\n }\n\n responses.push(pluginPayload);\n\n const getNftInfosPayloadResponse =\n await this._dataSource.getNftInfosPayload({\n chainId: transaction.chainId,\n address: transaction.to,\n });\n\n const nftInfosPayload = getNftInfosPayloadResponse.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.NFT,\n payload: value,\n }),\n });\n\n if (nftInfosPayload.type === ClearSignContextType.ERROR) {\n return [nftInfosPayload];\n }\n\n responses.push(nftInfosPayload);\n\n return responses;\n }\n\n async loadField(\n field: TransactionFieldContext,\n ): Promise<ClearSignContext | null> {\n if (field.type !== ClearSignContextType.NFT) {\n return null;\n }\n const payload = await this._dataSource.getNftInfosPayload({\n address: field.address,\n chainId: field.chainId,\n });\n return payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.NFT,\n payload: value,\n }),\n });\n }\n\n private isSelectorSupported(selector: HexaString) {\n return Object.values(SUPPORTED_SELECTORS).includes(selector);\n }\n}\n"],
5
+ "mappings": "okBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyC,2CACzCC,EAAmC,qBAGnCC,EAAyB,6BAEzBC,EAGO,2CAMP,IAAKC,OACHA,EAAA,QAAU,aACVA,EAAA,kBAAoB,aACpBA,EAAA,aAAe,aACfA,EAAA,iBAAmB,aACnBA,EAAA,yBAA2B,aALxBA,OAAA,IAQAC,OACHA,EAAA,kBAAoB,aACpBA,EAAA,iBAAmB,aACnBA,EAAA,sBAAwB,aAHrBA,OAAA,IAML,MAAMC,EAAoC,CACxC,GAAG,OAAO,OAAOF,CAAyB,EAC1C,GAAG,OAAO,OAAOC,CAA0B,CAC7C,EAGO,IAAME,EAAN,KAAgD,CAC7C,YAER,YAA4CC,EAA2B,CACrE,KAAK,YAAcA,CACrB,CAEA,MAAM,KAAKC,EAA8D,CACvE,MAAMC,EAAgC,CAAC,EAEvC,GAAI,CAACD,EAAY,IAAM,CAACA,EAAY,MAAQA,EAAY,OAAS,KAC/D,MAAO,CAAC,EAGV,MAAME,EAAWF,EAAY,KAAK,MAAM,EAAG,EAAE,EAE7C,GAAI,IAAC,gBAAaE,CAAQ,EACxB,MAAO,CACL,CACE,KAAM,uBAAqB,MAC3B,MAAO,IAAI,MAAM,kBAAkB,CACrC,CACF,EAGF,GAAI,CAAC,KAAK,oBAAoBA,CAAQ,EACpC,MAAO,CAAC,EAaV,MAAMC,GAR2B,MAAM,KAAK,YAAY,oBACtD,CACE,QAASH,EAAY,QACrB,QAASA,EAAY,GACrB,SAAAE,CACF,CACF,GAE+C,OAAO,CACpD,KAAOE,IAA6B,CAClC,KAAM,uBAAqB,MAC3B,MAAAA,CACF,GACA,MAAQC,IAA6B,CACnC,KAAM,uBAAqB,OAC3B,QAASA,CACX,EACF,CAAC,EAED,GAAIF,EAAc,OAAS,uBAAqB,MAC9C,MAAO,CAACA,CAAa,EAGvBF,EAAU,KAAKE,CAAa,EAQ5B,MAAMG,GALJ,MAAM,KAAK,YAAY,mBAAmB,CACxC,QAASN,EAAY,QACrB,QAASA,EAAY,EACvB,CAAC,GAEgD,OAAO,CACxD,KAAOI,IAA6B,CAClC,KAAM,uBAAqB,MAC3B,MAAAA,CACF,GACA,MAAQC,IAA6B,CACnC,KAAM,uBAAqB,IAC3B,QAASA,CACX,EACF,CAAC,EAED,OAAIC,EAAgB,OAAS,uBAAqB,MACzC,CAACA,CAAe,GAGzBL,EAAU,KAAKK,CAAe,EAEvBL,EACT,CAEA,MAAM,UACJM,EACkC,CAClC,OAAIA,EAAM,OAAS,uBAAqB,IAC/B,MAEO,MAAM,KAAK,YAAY,mBAAmB,CACxD,QAASA,EAAM,QACf,QAASA,EAAM,OACjB,CAAC,GACc,OAAO,CACpB,KAAOH,IAA6B,CAClC,KAAM,uBAAqB,MAC3B,MAAAA,CACF,GACA,MAAQC,IAA6B,CACnC,KAAM,uBAAqB,IAC3B,QAASA,CACX,EACF,CAAC,CACH,CAEQ,oBAAoBH,EAAsB,CAChD,OAAO,OAAO,OAAOL,CAAmB,EAAE,SAASK,CAAQ,CAC7D,CACF,EA3GaJ,EAANU,EAAA,IADN,cAAW,EAIGC,EAAA,eAAO,WAAS,aAAa,IAH/BX",
6
+ "names": ["NftContextLoader_exports", "__export", "NftContextLoader", "__toCommonJS", "import_device_management_kit", "import_inversify", "import_nftTypes", "import_ClearSignContext", "ERC721_SUPPORTED_SELECTOR", "ERC1155_SUPPORTED_SELECTOR", "SUPPORTED_SELECTORS", "NftContextLoader", "dataSource", "transaction", "responses", "selector", "pluginPayload", "error", "value", "nftInfosPayload", "field", "__decorateClass", "__decorateParam"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=require("purify-ts"),d=require("../../nft/domain/NftContextLoader"),o=require("../../shared/model/ClearSignContext");describe("NftContextLoader",()=>{const r=jest.fn(),s=jest.fn();let c,e;beforeEach(()=>{jest.restoreAllMocks(),c={getNftInfosPayload:r,getSetPluginPayload:s},e=new d.NftContextLoader(c)}),describe("load function",()=>{it("should return an empty array if no dest",async()=>{const t={to:void 0,data:"0x01"},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if undefined data",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:void 0},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if empty data",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x"},a=await e.load(t);expect(a).toEqual([])}),it("should return an empty array if selector not supported",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b20000000000000"},a=await e.load(t);expect(a).toEqual([])}),it("should return an error when transaction data is not a valid hex string",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"notahexstring"},a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("Invalid selector")}])}),it("should return an error when datasource get plugin payload return a Left",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b30000000000000"};s.mockResolvedValueOnce((0,n.Left)(new Error("error")));const a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("error")}])}),it("should return an error when datasource get nft infos payload return a Left",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b30000000000000"};s.mockResolvedValueOnce((0,n.Right)("payload1")),r.mockResolvedValueOnce((0,n.Left)(new Error("error")));const a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.ERROR,error:new Error("error")}])}),it("should return a response",async()=>{const t={to:"0xdAC17F958D2ee523a2206206994597C13D831ec7",data:"0x095ea7b30000000000000"};s.mockResolvedValueOnce((0,n.Right)("payload1")),r.mockResolvedValueOnce((0,n.Right)("payload2"));const a=await e.load(t);expect(a).toEqual([{type:o.ClearSignContextType.PLUGIN,payload:"payload1"},{type:o.ClearSignContextType.NFT,payload:"payload2"}])})}),describe("loadField function",()=>{it("should return an error when field type if not supported",async()=>{const t={type:o.ClearSignContextType.TOKEN,chainId:7,address:"0x1234"},a=await e.loadField(t);expect(a).toEqual(null)}),it("should return a payload",async()=>{const t={type:o.ClearSignContextType.NFT,chainId:7,address:"0x1234"};r.mockResolvedValueOnce((0,n.Right)("payload"));const a=await e.loadField(t);expect(a).toEqual({type:o.ClearSignContextType.NFT,payload:"payload"})}),it("should return an error when unable to fetch the datasource",async()=>{const t={type:o.ClearSignContextType.NFT,chainId:7,address:"0x1234"};r.mockResolvedValueOnce((0,n.Left)(new Error("error")));const a=await e.loadField(t);expect(a).toEqual({type:o.ClearSignContextType.ERROR,error:new Error("error")})})})});
2
+ //# sourceMappingURL=NftContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/nft/domain/NftContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { type NftDataSource } from \"@/nft/data/NftDataSource\";\nimport { NftContextLoader } from \"@/nft/domain/NftContextLoader\";\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\n\ndescribe(\"NftContextLoader\", () => {\n const spyGetNftInfosPayload = jest.fn();\n const spyGetPluginPayload = jest.fn();\n let mockDataSource: NftDataSource;\n let loader: NftContextLoader;\n\n beforeEach(() => {\n jest.restoreAllMocks();\n mockDataSource = {\n getNftInfosPayload: spyGetNftInfosPayload,\n getSetPluginPayload: spyGetPluginPayload,\n };\n loader = new NftContextLoader(mockDataSource);\n });\n\n describe(\"load function\", () => {\n it(\"should return an empty array if no dest\", async () => {\n const transaction = { to: undefined, data: \"0x01\" } as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if undefined data\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: undefined,\n } as unknown as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if empty data\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x\",\n } as unknown as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if selector not supported\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b20000000000000\",\n } as unknown as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([]);\n });\n\n it(\"should return an error when transaction data is not a valid hex string\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"notahexstring\",\n } as TransactionContext;\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ]);\n });\n\n it(\"should return an error when datasource get plugin payload return a Left\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b30000000000000\",\n } as TransactionContext;\n spyGetPluginPayload.mockResolvedValueOnce(Left(new Error(\"error\")));\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n ]);\n });\n\n it(\"should return an error when datasource get nft infos payload return a Left\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b30000000000000\",\n } as TransactionContext;\n spyGetPluginPayload.mockResolvedValueOnce(Right(\"payload1\"));\n spyGetNftInfosPayload.mockResolvedValueOnce(Left(new Error(\"error\")));\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n ]);\n });\n\n it(\"should return a response\", async () => {\n const transaction = {\n to: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n data: \"0x095ea7b30000000000000\",\n } as TransactionContext;\n spyGetPluginPayload.mockResolvedValueOnce(Right(\"payload1\"));\n spyGetNftInfosPayload.mockResolvedValueOnce(Right(\"payload2\"));\n\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.PLUGIN,\n payload: \"payload1\",\n },\n {\n type: ClearSignContextType.NFT,\n payload: \"payload2\",\n },\n ]);\n });\n });\n\n describe(\"loadField function\", () => {\n it(\"should return an error when field type if not supported\", async () => {\n const field: TransactionFieldContext = {\n type: ClearSignContextType.TOKEN,\n chainId: 7,\n address: \"0x1234\",\n };\n\n const result = await loader.loadField(field);\n\n expect(result).toEqual(null);\n });\n\n it(\"should return a payload\", async () => {\n // GIVEN\n const field: TransactionFieldContext = {\n type: ClearSignContextType.NFT,\n chainId: 7,\n address: \"0x1234\",\n };\n\n // WHEN\n spyGetNftInfosPayload.mockResolvedValueOnce(Right(\"payload\"));\n const result = await loader.loadField(field);\n\n // THEN\n expect(result).toEqual({\n type: ClearSignContextType.NFT,\n payload: \"payload\",\n });\n });\n\n it(\"should return an error when unable to fetch the datasource\", async () => {\n // GIVEN\n const field: TransactionFieldContext = {\n type: ClearSignContextType.NFT,\n chainId: 7,\n address: \"0x1234\",\n };\n\n // WHEN\n spyGetNftInfosPayload.mockResolvedValueOnce(Left(new Error(\"error\")));\n const result = await loader.loadField(field);\n\n // THEN\n expect(result).toEqual({\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n });\n });\n });\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["import_purify_ts", "import_NftContextLoader", "import_ClearSignContext", "spyGetNftInfosPayload", "spyGetPluginPayload", "mockDataSource", "loader", "transaction", "result", "field"]
7
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ContextLoader.js.map
1
+ "use strict";var a=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var x=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!C.call(e,o)&&o!==i&&a(e,o,{get:()=>t[o],enumerable:!(n=r(t,o))||n.enumerable});return e};var d=e=>x(a({},"__esModule",{value:!0}),e);var p={};module.exports=d(p);
2
+ //# sourceMappingURL=ContextLoader.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"ContextLoader.js","sourceRoot":"","sources":["../../../../../src/shared/domain/ContextLoader.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/domain/ContextLoader.ts"],
4
+ "sourcesContent": ["import { type ClearSignContext } from \"@/shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"@/shared/model/TransactionContext\";\n\nexport type ContextLoader = {\n load: (transaction: TransactionContext) => Promise<ClearSignContext[]>;\n loadField?: (\n field: TransactionFieldContext,\n ) => Promise<ClearSignContext | null>;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["ContextLoader_exports", "__toCommonJS"]
7
+ }
@@ -1,13 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClearSignContextType = void 0;
4
- var ClearSignContextType;
5
- (function (ClearSignContextType) {
6
- ClearSignContextType["TOKEN"] = "token";
7
- ClearSignContextType["NFT"] = "nft";
8
- ClearSignContextType["DOMAIN_NAME"] = "domainName";
9
- ClearSignContextType["PLUGIN"] = "plugin";
10
- ClearSignContextType["EXTERNAL_PLUGIN"] = "externalPlugin";
11
- ClearSignContextType["ERROR"] = "error";
12
- })(ClearSignContextType || (exports.ClearSignContextType = ClearSignContextType = {}));
13
- //# sourceMappingURL=ClearSignContext.js.map
1
+ "use strict";var a=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var o in e)a(t,o,{get:e[o],enumerable:!0})},s=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of R(e))!p.call(t,n)&&n!==o&&a(t,n,{get:()=>e[n],enumerable:!(i=N(e,n))||i.enumerable});return t};var l=t=>s(a({},"__esModule",{value:!0}),t);var u={};c(u,{ClearSignContextType:()=>E});module.exports=l(u);var E=(r=>(r.TOKEN="token",r.NFT="nft",r.TRUSTED_NAME="trustedName",r.PLUGIN="plugin",r.EXTERNAL_PLUGIN="externalPlugin",r.TRANSACTION_INFO="transactionInfo",r.ENUM="enum",r.TRANSACTION_FIELD_DESCRIPTION="transactionFieldDescription",r.ERROR="error",r))(E||{});0&&(module.exports={ClearSignContextType});
2
+ //# sourceMappingURL=ClearSignContext.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"ClearSignContext.js","sourceRoot":"","sources":["../../../../../src/shared/model/ClearSignContext.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,uCAAe,CAAA;IACf,mCAAW,CAAA;IACX,kDAA0B,CAAA;IAC1B,yCAAiB,CAAA;IACjB,0DAAkC,CAAA;IAClC,uCAAe,CAAA;AACjB,CAAC,EAPW,oBAAoB,oCAApB,oBAAoB,QAO/B"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/ClearSignContext.ts"],
4
+ "sourcesContent": ["import { type GenericPath } from \"./GenericPath\";\n\nexport enum ClearSignContextType {\n TOKEN = \"token\",\n NFT = \"nft\",\n TRUSTED_NAME = \"trustedName\",\n PLUGIN = \"plugin\",\n EXTERNAL_PLUGIN = \"externalPlugin\",\n TRANSACTION_INFO = \"transactionInfo\",\n ENUM = \"enum\",\n TRANSACTION_FIELD_DESCRIPTION = \"transactionFieldDescription\",\n ERROR = \"error\",\n}\n\nexport type ClearSignContextReference =\n | {\n type: ClearSignContextType.TOKEN | ClearSignContextType.NFT;\n valuePath: GenericPath;\n }\n | {\n type: ClearSignContextType.TRUSTED_NAME;\n valuePath: GenericPath;\n types: string[];\n sources: string[];\n };\n\nexport type ClearSignContextSuccess = {\n type: Exclude<ClearSignContextType, ClearSignContextType.ERROR>;\n /**\n * Hexadecimal string representation of the payload.\n */\n payload: string;\n /**\n * Optional reference to another asset descriptor.\n * ie: a 'transactionFieldDescription' descriptor can reference a token or\n * a trusted name.\n */\n reference?: ClearSignContextReference;\n};\n\nexport type ClearSignContextError = {\n type: ClearSignContextType.ERROR;\n error: Error;\n};\n\nexport type ClearSignContext = ClearSignContextSuccess | ClearSignContextError;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAEO,IAAKE,OACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,aAAe,cACfA,EAAA,OAAS,SACTA,EAAA,gBAAkB,iBAClBA,EAAA,iBAAmB,kBACnBA,EAAA,KAAO,OACPA,EAAA,8BAAgC,8BAChCA,EAAA,MAAQ,QATEA,OAAA",
6
+ "names": ["ClearSignContext_exports", "__export", "ClearSignContextType", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var R=(a,t)=>{for(var A in t)n(a,A,{get:t[A],enumerable:!0})},u=(a,t,A,E)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of m(t))!f.call(a,e)&&e!==A&&n(a,e,{get:()=>t[e],enumerable:!(E=o(t,e))||E.enumerable});return a};var F=a=>u(n({},"__esModule",{value:!0}),a);var y={};R(y,{ContainerPath:()=>p,DataPathElementType:()=>L,DataPathLeafType:()=>l});module.exports=F(y);var p=(E=>(E.FROM="FROM",E.TO="TO",E.VALUE="VALUE",E))(p||{}),L=(r=>(r.TUPLE="TUPLE",r.ARRAY="ARRAY",r.REF="REF",r.LEAF="LEAF",r.SLICE="SLICE",r))(L||{}),l=(e=>(e.STATIC_LEAF="STATIC_LEAF",e.DYNAMIC_LEAF="DYNAMIC_LEAF",e.TUPLE_LEAF="TUPLE_LEAF",e.ARRAY_LEAF="ARRAY_LEAF",e))(l||{});0&&(module.exports={ContainerPath,DataPathElementType,DataPathLeafType});
2
+ //# sourceMappingURL=GenericPath.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/GenericPath.ts"],
4
+ "sourcesContent": ["/**\n * Generic binary paths are a way to to navigate in any kind of structured binary data such as:\n * - transactions\n * - typed messages (EIP-712)\n * - meta transactions (EIP-2771)\n * - user operations (EIP-4337)\n * - ...\n * We follow here the concepts defined in the clear signing standard:\n * https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/specs/erc-7730.md#structured-data\n *\n * - The container is the structure to be signed, for instance a transaction\n * - The structured data is the data we want to navigate in, for instance a transaction calldata\n *\n * A generic path is either a field of the container, or a path in the structured data.\n * Those path will also be handled by the devices:\n * https://github.com/LedgerHQ/generic_parser/blob/master/specs.md#path_element\n */\n\n// A generic path is either a path in the container, or a path in its data.\n// Path in the data is a list of steps to apply\nexport type GenericPath = ContainerPathValues | DataPathElement[];\n\n// Path in the container is only a finite list of known attributes\nexport enum ContainerPath {\n FROM = \"FROM\",\n TO = \"TO\",\n VALUE = \"VALUE\",\n}\nexport type ContainerPathValues = keyof typeof ContainerPath;\n\n/**\n * A path in binary data will be composed of:\n * - any number of steps of which:\n * - Tuple: a set of elements which size if known\n * - Array: an array of elements with dynamic size\n * - Reference: a pointer to dereference\n * - one leaf at the end to indicate the returned element type\n * - static leaf: 1 fixed-size chunk is returned\n * - dynamic leaf: element of variable size is returned\n * - optionally a slice element, only allowed after the leaf, to slice the result\n *\n * An example for a transaction with that ethereum smart contract:\n * function requestWithdrawalsWithPermit(uint256[] _amounts, address _owner, (uint256,uint256,uint8,bytes32,bytes32) _permit)\n * In that case:\n * - _amounts is an array\n * - _permit is a tuple\n * We could have a tuple in an array, or an array in a tuple, in which case we would have several steps in the binary path.\n */\nexport type DataPathElement =\n | DataPathElementTuple\n | DataPathElementArray\n | DataPathElementRef\n | DataPathElementLeaf\n | DataPathElementSlice;\nexport enum DataPathElementType {\n TUPLE = \"TUPLE\",\n ARRAY = \"ARRAY\",\n REF = \"REF\",\n LEAF = \"LEAF\",\n SLICE = \"SLICE\",\n}\nexport type DataPathElementTypeValues = keyof typeof DataPathElementType;\n\n/**\n * Path element to navigate in a tuple.\n * - offset: the item of the tuple to select\n */\nexport interface DataPathElementTuple {\n type: \"TUPLE\";\n offset: number;\n}\n\n/**\n * Path element to navigate in an array of variable size.\n * - itemSize: the length of each item in that array (not the number of items which is variable).\n * - start: the start of the array slice to iterate on. If unset, start from the beginning of that array.\n * - length: the length of the array slice to iterate on. If unset, iterate until the end of that array.\n */\nexport interface DataPathElementArray {\n type: \"ARRAY\";\n itemSize: number;\n start?: number;\n length?: number;\n}\n\n// Path element to indicate the current item should be de-referenced (its value contains a pointer).\nexport interface DataPathElementRef {\n type: \"REF\";\n}\n\n/**\n * Path element to represent the leaf of the path, to be returned.\n * It is mandatory, and only allowed at the end of the path.\n * It indicates the type of data to return:\n * - Static leaf: data of static size, typically 1 chunk\n * - Dynamic leaf: data of dynamic size, typically length+data\n * - Tuple leaf: returned data is a tuple (a set of a static number of elements)\n * - Array leaf: returned data is an array (dynamic number of elements)\n */\nexport interface DataPathElementLeaf {\n type: \"LEAF\";\n leafType: DataPathLeafTypeValues;\n}\nexport enum DataPathLeafType {\n STATIC_LEAF = \"STATIC_LEAF\",\n DYNAMIC_LEAF = \"DYNAMIC_LEAF\",\n TUPLE_LEAF = \"TUPLE_LEAF\",\n ARRAY_LEAF = \"ARRAY_LEAF\",\n}\nexport type DataPathLeafTypeValues = keyof typeof DataPathLeafType;\n\n/**\n * Path element to represent a slice.\n * It is optional and only allowed at the end of a path, after the leaf.\n * It means the leaf shall be sliced before being returned.\n */\nexport interface DataPathElementSlice {\n type: \"SLICE\";\n start?: number;\n end?: number;\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,wBAAAC,EAAA,qBAAAC,IAAA,eAAAC,EAAAL,GAuBO,IAAKE,OACVA,EAAA,KAAO,OACPA,EAAA,GAAK,KACLA,EAAA,MAAQ,QAHEA,OAAA,IA+BAC,OACVA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,MAAQ,QALEA,OAAA,IAiDAC,OACVA,EAAA,YAAc,cACdA,EAAA,aAAe,eACfA,EAAA,WAAa,aACbA,EAAA,WAAa,aAJHA,OAAA",
6
+ "names": ["GenericPath_exports", "__export", "ContainerPath", "DataPathElementType", "DataPathLeafType", "__toCommonJS"]
7
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=TransactionContext.js.map
1
+ "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var g=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of o(t))!p.call(e,n)&&n!==s&&i(e,n,{get:()=>t[n],enumerable:!(r=a(t,n))||r.enumerable});return e};var T=e=>g(i({},"__esModule",{value:!0}),e);var y={};module.exports=T(y);
2
+ //# sourceMappingURL=TransactionContext.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"TransactionContext.js","sourceRoot":"","sources":["../../../../../src/shared/model/TransactionContext.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TransactionContext.ts"],
4
+ "sourcesContent": ["import { type ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport { type TransactionSubset } from \"@/shared/model/TransactionSubset\";\n\nexport type TransactionFieldContext =\n | {\n type: ClearSignContextType.TOKEN | ClearSignContextType.NFT;\n chainId: number;\n address: string;\n }\n | {\n type: ClearSignContextType.TRUSTED_NAME;\n chainId: number;\n address: string;\n challenge: string;\n types: string[];\n sources: string[];\n };\n\nexport type TransactionContext = TransactionSubset & {\n challenge: string;\n domain?: string;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TransactionContext_exports", "__toCommonJS"]
7
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=TransactionSubset.js.map
1
+ "use strict";var e=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var c=(n,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of o(t))!b.call(n,a)&&a!==i&&e(n,a,{get:()=>t[a],enumerable:!(r=s(t,a))||r.enumerable});return n};var d=n=>c(e({},"__esModule",{value:!0}),n);var g={};module.exports=d(g);
2
+ //# sourceMappingURL=TransactionSubset.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"TransactionSubset.js","sourceRoot":"","sources":["../../../../../src/shared/model/TransactionSubset.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TransactionSubset.ts"],
4
+ "sourcesContent": ["export type TransactionSubset = {\n chainId: number;\n to?: string;\n data?: string;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TransactionSubset_exports", "__toCommonJS"]
7
+ }
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VERIFYING_CONTRACT_TOKEN_INDEX = void 0;
4
- // Special token index value when the referenced token is the verifying contract
5
- exports.VERIFYING_CONTRACT_TOKEN_INDEX = 255;
6
- //# sourceMappingURL=TypedDataClearSignContext.js.map
1
+ "use strict";var p=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},i=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of y(e))!s.call(t,a)&&a!==r&&p(t,a,{get:()=>e[a],enumerable:!(n=o(e,a))||n.enumerable});return t};var T=t=>i(p({},"__esModule",{value:!0}),t);var D={};d(D,{VERIFYING_CONTRACT_TOKEN_INDEX:()=>g});module.exports=T(D);const g=255;0&&(module.exports={VERIFYING_CONTRACT_TOKEN_INDEX});
2
+ //# sourceMappingURL=TypedDataClearSignContext.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"TypedDataClearSignContext.js","sourceRoot":"","sources":["../../../../../src/shared/model/TypedDataClearSignContext.ts"],"names":[],"mappings":";;;AAUA,gFAAgF;AACnE,QAAA,8BAA8B,GAAG,GAAG,CAAC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TypedDataClearSignContext.ts"],
4
+ "sourcesContent": ["// The general informations for a typed message\nexport type TypedDataMessageInfo = {\n displayName: string;\n filtersCount: number;\n signature: string;\n};\n\n// Token index and descriptor. Needed for tokens that are referenced by a typed message\nexport type TypedDataTokenIndex = number;\nexport type TypedDataToken = string;\n// Special token index value when the referenced token is the verifying contract\nexport const VERIFYING_CONTRACT_TOKEN_INDEX = 255;\n\n// Typed message filters, to select fields to display, and provide formatting informations\nexport type TypedDataFilterPath = string;\nexport type TypedDataFilter =\n | {\n type: \"datetime\" | \"raw\";\n displayName: string;\n path: TypedDataFilterPath;\n signature: string;\n }\n | {\n type: \"amount\" | \"token\";\n displayName: string;\n tokenIndex: TypedDataTokenIndex;\n path: TypedDataFilterPath;\n signature: string;\n };\n\n// Clear signing context for a typed message\nexport type TypedDataClearSignContextSuccess = {\n type: \"success\";\n messageInfo: TypedDataMessageInfo;\n filters: Record<TypedDataFilterPath, TypedDataFilter>;\n tokens: Record<TypedDataTokenIndex, TypedDataToken>;\n};\nexport type TypedDataClearSignContextError = {\n type: \"error\";\n error: Error;\n};\nexport type TypedDataClearSignContext =\n | TypedDataClearSignContextSuccess\n | TypedDataClearSignContextError;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oCAAAE,IAAA,eAAAC,EAAAH,GAWO,MAAME,EAAiC",
6
+ "names": ["TypedDataClearSignContext_exports", "__export", "VERIFYING_CONTRACT_TOKEN_INDEX", "__toCommonJS"]
7
+ }
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=TypedDataContext.js.map
1
+ "use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var d=(a,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of y(e))!s.call(a,t)&&t!==n&&i(a,t,{get:()=>e[t],enumerable:!(r=p(e,t))||r.enumerable});return a};var l=a=>d(i({},"__esModule",{value:!0}),a);var o={};module.exports=l(o);
2
+ //# sourceMappingURL=TypedDataContext.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"TypedDataContext.js","sourceRoot":"","sources":["../../../../../src/shared/model/TypedDataContext.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/model/TypedDataContext.ts"],
4
+ "sourcesContent": ["// The schema of a typed message\nexport type TypedDataSchema = Record<\n string,\n Array<{ name: string; type: string }>\n>;\n\n// The extracted message values, with their path\nexport type TypedDataFieldValues = Array<{ path: string; value: Uint8Array }>;\n\n// Context needed to fetch the clear signing context of a typed message\nexport type TypedDataContext = {\n verifyingContract: string;\n chainId: number;\n version: \"v1\" | \"v2\";\n schema: TypedDataSchema;\n fieldsValues: TypedDataFieldValues;\n};\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["TypedDataContext_exports", "__toCommonJS"]
7
+ }
@@ -1,15 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HexStringUtils = void 0;
4
- class HexStringUtils {
5
- static stringToHex(str) {
6
- let hexString = "";
7
- for (let i = 0; i < str.length; i++) {
8
- const hex = str.charCodeAt(i).toString(16);
9
- hexString += hex.padStart(2, "0"); // Ensure each hex code is at least 2 characters long
10
- }
11
- return hexString;
12
- }
13
- }
14
- exports.HexStringUtils = HexStringUtils;
15
- //# sourceMappingURL=HexStringUtils.js.map
1
+ "use strict";var g=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(r,t)=>{for(var e in t)g(r,e,{get:t[e],enumerable:!0})},x=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of o(t))!a.call(r,i)&&i!==e&&g(r,i,{get:()=>t[i],enumerable:!(n=s(t,i))||n.enumerable});return r};var c=r=>x(g({},"__esModule",{value:!0}),r);var S={};l(S,{HexStringUtils:()=>h});module.exports=c(S);class h{static stringToHex(t){let e="";for(let n=0;n<t.length;n++){const i=t.charCodeAt(n).toString(16);e+=i.padStart(2,"0")}return e}}0&&(module.exports={HexStringUtils});
2
+ //# sourceMappingURL=HexStringUtils.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"HexStringUtils.js","sourceRoot":"","sources":["../../../../../src/shared/utils/HexStringUtils.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IACzB,MAAM,CAAC,WAAW,CAAC,GAAW;QAC5B,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC3C,SAAS,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,qDAAqD;QAC1F,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AATD,wCASC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/shared/utils/HexStringUtils.ts"],
4
+ "sourcesContent": ["export class HexStringUtils {\n static stringToHex(str: string): string {\n let hexString = \"\";\n for (let i = 0; i < str.length; i++) {\n const hex = str.charCodeAt(i).toString(16);\n hexString += hex.padStart(2, \"0\"); // Ensure each hex code is at least 2 characters long\n }\n return hexString;\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,CAAe,CAC1B,OAAO,YAAYE,EAAqB,CACtC,IAAIC,EAAY,GAChB,QAASC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,IAAK,CACnC,MAAMC,EAAMH,EAAI,WAAWE,CAAC,EAAE,SAAS,EAAE,EACzCD,GAAaE,EAAI,SAAS,EAAG,GAAG,CAClC,CACA,OAAOF,CACT,CACF",
6
+ "names": ["HexStringUtils_exports", "__export", "HexStringUtils", "__toCommonJS", "str", "hexString", "i", "hex"]
7
+ }