@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":"DefaultTypedDataContextLoader.js","sourceRoot":"","sources":["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS/C,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIzD,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAG9B;IAEA;IAJV,YAEU,UAA+B,EAE/B,eAAgC;QAFhC,eAAU,GAAV,UAAU,CAAqB;QAE/B,oBAAe,GAAf,eAAe,CAAiB;IACvC,CAAC;IAEJ,KAAK,CAAC,IAAI,CAAC,SAA2B;QACpC,kDAAkD;QAClD,MAAM,IAAI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CAAC,OAAO,EAAE,EAAE;oBAC1B,YAAY,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC;gBACrC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO;YACL,IAAI,EAAE,SAAS;YACf,WAAW;YACX,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;SACrB,CAAC;IACJ,CAAC;IAEO,0BAA0B,CAAC,OAAmB;QACpD,2EAA2E;QAC3E,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CACvC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CACnC;aACE,IAAI,CAAC,EAAE,CAAC;aACR,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC;IACzB,CAAC;CACF,CAAA;AApHY,6BAA6B;IADzC,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAA;IAE1C,WAAA,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;;GAJ1B,6BAA6B,CAoHzC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.ts"],
4
+ "sourcesContent": ["import type { HexaString } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport type {\n TypedDataClearSignContext,\n TypedDataFilter,\n TypedDataFilterPath,\n TypedDataToken,\n TypedDataTokenIndex,\n} from \"@/shared/model/TypedDataClearSignContext\";\nimport { VERIFYING_CONTRACT_TOKEN_INDEX } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport type { TypedDataDataSource } from \"@/typed-data/data/TypedDataDataSource\";\nimport { typedDataTypes } from \"@/typed-data/di/typedDataTypes\";\nimport type { TypedDataContextLoader } from \"@/typed-data/domain/TypedDataContextLoader\";\n\n@injectable()\nexport class DefaultTypedDataContextLoader implements TypedDataContextLoader {\n constructor(\n @inject(typedDataTypes.TypedDataDataSource)\n private dataSource: TypedDataDataSource,\n @inject(tokenTypes.TokenDataSource)\n private tokenDataSource: TokenDataSource,\n ) {}\n\n async load(typedData: TypedDataContext): Promise<TypedDataClearSignContext> {\n // Get the typed data filters from the data source\n const data = await this.dataSource.getTypedDataFilters({\n address: typedData.verifyingContract,\n chainId: typedData.chainId,\n version: typedData.version,\n schema: typedData.schema,\n });\n\n // If there was an error getting the typed data filters, return an error immediately\n if (data.isLeft()) {\n return {\n type: \"error\",\n error: data.extract(),\n };\n }\n\n // Else, extract the message info and filters\n const { messageInfo, filters } = data.unsafeCoerce();\n\n // Loop through the typed data filters to extract informations\n const mappedFilters: Record<TypedDataFilterPath, TypedDataFilter> = {};\n const mappedTokens: Record<TypedDataTokenIndex, TypedDataToken> = {};\n for (const filter of filters) {\n // Add the filter to the clear signing context\n mappedFilters[filter.path] = filter;\n if (filter.type !== \"token\" && filter.type !== \"amount\") {\n continue; // no token reference\n }\n\n // If the filter references a token, retrieve its descriptor from the tokens data source\n const tokenIndex = filter.tokenIndex;\n if (mappedTokens[tokenIndex] !== undefined) {\n continue; // Already fetched for a previous filter\n }\n\n // If the filter is a token, get token address from typed message values, and fetch descriptor\n if (filter.type === \"token\") {\n const values = typedData.fieldsValues.filter(\n (entry) => entry.path === filter.path,\n );\n if (values.length === 0) {\n // No value matching the referenced token. It may be located in an empty array.\n continue;\n }\n const value = values[0]!;\n const address = this.convertAddressToHexaString(value.value);\n\n // Arrays with different tokens are not supported since there is only 1 tokenIndex per filter.\n // Only fetch tokens if all values are the same.\n if (\n values.every(\n (entry) => this.convertAddressToHexaString(entry.value) === address,\n )\n ) {\n // Fetch descriptor\n const chainId = typedData.chainId;\n const payload = await this.tokenDataSource.getTokenInfosPayload({\n address,\n chainId,\n });\n payload.ifRight((p) => {\n mappedTokens[tokenIndex] = p;\n });\n }\n }\n\n // If the filter is an amount with a reference to the verifyingContract, fetch verifyingContract descriptor.\n // This is because descriptors data-sources should be compatible with Ledger devices specifications:\n // https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#amount-join-value\n else if (\n filter.type === \"amount\" &&\n tokenIndex === VERIFYING_CONTRACT_TOKEN_INDEX\n ) {\n const address = typedData.verifyingContract;\n const chainId = typedData.chainId;\n const payload = await this.tokenDataSource.getTokenInfosPayload({\n address,\n chainId,\n });\n payload.ifRight((p) => {\n mappedTokens[tokenIndex] = p;\n });\n }\n }\n\n return {\n type: \"success\",\n messageInfo,\n filters: mappedFilters,\n tokens: mappedTokens,\n };\n }\n\n private convertAddressToHexaString(address: Uint8Array): HexaString {\n // Address size is 20 bytes so 40 characters, padded with zeros on the left\n return `0x${Array.from(address, (byte) =>\n byte.toString(16).padStart(2, \"0\"),\n )\n .join(\"\")\n .padStart(40, \"0\")}`;\n }\n}\n"],
5
+ "mappings": "iOACA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YASnC,OAAS,kCAAAC,MAAsC,2CAG/C,OAAS,cAAAC,MAAkB,wBAE3B,OAAS,kBAAAC,MAAsB,iCAIxB,IAAMC,EAAN,KAAsE,CAC3E,YAEUC,EAEAC,EACR,CAHQ,gBAAAD,EAEA,qBAAAC,CACP,CAEH,MAAM,KAAKC,EAAiE,CAE1E,MAAMC,EAAO,MAAM,KAAK,WAAW,oBAAoB,CACrD,QAASD,EAAU,kBACnB,QAASA,EAAU,QACnB,QAASA,EAAU,QACnB,OAAQA,EAAU,MACpB,CAAC,EAGD,GAAIC,EAAK,OAAO,EACd,MAAO,CACL,KAAM,QACN,MAAOA,EAAK,QAAQ,CACtB,EAIF,KAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAAK,aAAa,EAG7CG,EAA8D,CAAC,EAC/DC,EAA4D,CAAC,EACnE,UAA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ING_CONTRACT_TOKEN_INDEX", "tokenTypes", "typedDataTypes", "DefaultTypedDataContextLoader", "dataSource", "tokenDataSource", "typedData", "data", "messageInfo", "filters", "mappedFilters", "mappedTokens", "filter", "tokenIndex", "values", "entry", "value", "address", "chainId", "p", "VERIFYING_CONTRACT_TOKEN_INDEX", "byte", "__decorateClass", "injectable", "__decorateParam", "inject", "typedDataTypes", "tokenTypes"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{Left as b,Right as s}from"purify-ts";import{DefaultTypedDataContextLoader as o}from"../../typed-data/domain/DefaultTypedDataContextLoader";describe("TokenContextLoader",()=>{const f={getTokenInfosPayload:jest.fn()},t={getTypedDataFilters:jest.fn()},d=new o(t,f),c={PermitSingle:[{name:"details",type:"PermitDetails"},{name:"spender",type:"address"},{name:"sigDeadline",type:"uint256"}],PermitDetails:[{type:"address[]",name:"token"},{name:"amount",type:"uint160"},{name:"expiration",type:"uint48"},{name:"nonce",type:"uint48"}],EIP712Domain:[{name:"name",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]},n=[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,25])},{path:"details.amount",value:Uint8Array.from([18])},{path:"spender",value:Uint8Array.from([18])},{path:"details.expiration",value:Uint8Array.from([18])}];beforeEach(()=>{jest.clearAllMocks(),jest.spyOn(f,"getTokenInfosPayload").mockImplementation(({address:a})=>Promise.resolve(s(`payload-${a}`)))}),describe("load function",()=>{it("success with referenced token",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:4,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"},{type:"amount",displayName:"Amount allowance",path:"details.amount",tokenIndex:0,signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3"},{type:"raw",displayName:"Approve to spender",path:"spender",signature:"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb"},{type:"datetime",displayName:"Approval expire",path:"details.expiration",signature:"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b"}]})));const e=await d.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:4,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{0:"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619"},filters:{"details.amount":{displayName:"Amount allowance",path:"details.amount",signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3",tokenIndex:0,type:"amount"},"details.expiration":{displayName:"Approval expire",path:"details.expiration",signature:"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b",type:"datetime"},"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"},spender:{displayName:"Approve to spender",path:"spender",signature:"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb",type:"raw"}}})}),it("success with referenced token verifying contract",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"},{type:"amount",displayName:"Amount allowance",path:"details.amount",tokenIndex:255,signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3"}]})));const e=await d.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{0:"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",255:"payload-0x000000000022d473030f116ddee9f6b43ac78ba3"},filters:{"details.amount":{displayName:"Amount allowance",path:"details.amount",signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3",tokenIndex:255,type:"amount"},"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"}}})}),it("should return an error if filters are unavailable",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(b(new Error("error"))));const e=await d.load(a);expect(e).toEqual({type:"error",error:new Error("error")})}),it("success with unavailable tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]}))),jest.spyOn(f,"getTokenInfosPayload").mockImplementation(()=>Promise.resolve(b(new Error("token error"))));const e=await d.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{},filters:{"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"}}})}),it("success with several identic tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,25])},...n]};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]}))),jest.spyOn(f,"getTokenInfosPayload").mockImplementation(()=>Promise.resolve(b(new Error("token error"))));const e=await d.load(a);expect(f.getTokenInfosPayload).toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",chainId:1}),expect(e.type).toEqual("success")}),it("success with several different tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,255])},...n]};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]})));const e=await d.load(a);expect(f.getTokenInfosPayload).not.toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f6ff",chainId:1}),expect(f.getTokenInfosPayload).not.toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",chainId:1}),expect(e.type).toEqual("success")}),it("should ignore the token if value is not found",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.badtoken",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]})));const e=await d.load(a);expect(e.type).toEqual("success"),e.type==="success"&&(expect(e.filters["details.badtoken"]?.displayName).toEqual("Amount allowance"),expect(e.tokens).toEqual({}))})})});
2
+ //# sourceMappingURL=DefaultTypedDataContextLoader.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.test.ts"],
4
+ "sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport type { TypedDataDataSource } from \"@/typed-data/data/TypedDataDataSource\";\nimport { DefaultTypedDataContextLoader } from \"@/typed-data/domain/DefaultTypedDataContextLoader\";\n\ndescribe(\"TokenContextLoader\", () => {\n const mockTokenDataSource: TokenDataSource = {\n getTokenInfosPayload: jest.fn(),\n };\n const mockTypedDataDataSource: TypedDataDataSource = {\n getTypedDataFilters: jest.fn(),\n };\n const loader = new DefaultTypedDataContextLoader(\n mockTypedDataDataSource,\n mockTokenDataSource,\n );\n\n const TEST_TYPES = {\n PermitSingle: [\n {\n name: \"details\",\n type: \"PermitDetails\",\n },\n {\n name: \"spender\",\n type: \"address\",\n },\n {\n name: \"sigDeadline\",\n type: \"uint256\",\n },\n ],\n PermitDetails: [\n {\n type: \"address[]\",\n name: \"token\",\n },\n {\n name: \"amount\",\n type: \"uint160\",\n },\n {\n name: \"expiration\",\n type: \"uint48\",\n },\n {\n name: \"nonce\",\n type: \"uint48\",\n },\n ],\n EIP712Domain: [\n {\n name: \"name\",\n type: \"string\",\n },\n {\n name: \"chainId\",\n type: \"uint256\",\n },\n {\n name: \"verifyingContract\",\n type: \"address\",\n },\n ],\n };\n const TEST_VALUES = [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac, 0x25,\n 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0x19,\n ]),\n },\n {\n path: \"details.amount\",\n value: Uint8Array.from([0x12]),\n },\n {\n path: \"spender\",\n value: Uint8Array.from([0x12]),\n },\n {\n path: \"details.expiration\",\n value: Uint8Array.from([0x12]),\n },\n ];\n\n beforeEach(() => {\n jest.clearAllMocks();\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(({ address }) =>\n Promise.resolve(Right(`payload-${address}`)),\n );\n });\n\n describe(\"load function\", () => {\n it(\"success with referenced token\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 4,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n {\n type: \"amount\",\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n tokenIndex: 0,\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n },\n {\n type: \"raw\",\n displayName: \"Approve to spender\",\n path: \"spender\",\n signature:\n \"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb\",\n },\n {\n type: \"datetime\",\n displayName: \"Approval expire\",\n path: \"details.expiration\",\n signature:\n \"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 4,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {\n 0: \"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n },\n filters: {\n \"details.amount\": {\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n tokenIndex: 0,\n type: \"amount\",\n },\n \"details.expiration\": {\n displayName: \"Approval expire\",\n path: \"details.expiration\",\n signature:\n \"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b\",\n type: \"datetime\",\n },\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n spender: {\n displayName: \"Approve to spender\",\n path: \"spender\",\n signature:\n \"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb\",\n type: \"raw\",\n },\n },\n });\n });\n\n it(\"success with referenced token verifying contract\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n {\n type: \"amount\",\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n tokenIndex: 255,\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {\n 0: \"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n 255: \"payload-0x000000000022d473030f116ddee9f6b43ac78ba3\",\n },\n filters: {\n \"details.amount\": {\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n tokenIndex: 255,\n type: \"amount\",\n },\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n },\n });\n });\n\n it(\"should return an error if filters are unavailable\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() => Promise.resolve(Left(new Error(\"error\"))));\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"error\",\n error: new Error(\"error\"),\n });\n });\n\n it(\"success with unavailable tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(() =>\n Promise.resolve(Left(new Error(\"token error\"))),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {},\n filters: {\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n },\n });\n });\n\n it(\"success with several identic tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac,\n 0x25, 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0x19,\n ]),\n },\n ...TEST_VALUES,\n ],\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(() =>\n Promise.resolve(Left(new Error(\"token error\"))),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(mockTokenDataSource.getTokenInfosPayload).toHaveBeenCalledWith({\n address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n chainId: 1,\n });\n expect(result.type).toEqual(\"success\");\n });\n\n it(\"success with several different tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac,\n 0x25, 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0xff,\n ]),\n },\n ...TEST_VALUES,\n ],\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(mockTokenDataSource.getTokenInfosPayload).not.toHaveBeenCalledWith(\n { address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f6ff\", chainId: 1 },\n );\n expect(mockTokenDataSource.getTokenInfosPayload).not.toHaveBeenCalledWith(\n { address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\", chainId: 1 },\n );\n expect(result.type).toEqual(\"success\");\n });\n\n it(\"should ignore the token if value is not found\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.badtoken\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result.type).toEqual(\"success\");\n if (result.type === \"success\") {\n expect(result.filters[\"details.badtoken\"]?.[\"displayName\"]).toEqual(\n \"Amount allowance\",\n );\n expect(result.tokens).toEqual({});\n }\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAK5B,OAAS,iCAAAC,MAAqC,oDAE9C,SAAS,qBAAsB,IAAM,CACnC,MAAMC,EAAuC,CAC3C,qBAAsB,KAAK,GAAG,CAChC,EACMC,EAA+C,CACnD,oBAAqB,KAAK,GAAG,CAC/B,EACMC,EAAS,IAAIH,EACjBE,EACAD,CACF,EAEMG,EAAa,CACjB,aAAc,CACZ,CACE,KAAM,UACN,KAAM,eACR,EACA,CACE,KAAM,UACN,KAAM,SACR,EACA,CACE,KAAM,cACN,KAAM,SACR,CACF,EACA,cAAe,CACb,CACE,KAAM,YACN,KAAM,OACR,EACA,CACE,KAAM,SACN,KAAM,SACR,EACA,CACE,KAAM,aACN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BACb,KAAM,mBACN,WAAY,EACZ,UACE,8IACJ,CACF,CACF,CAAC,CACH,CACF,EAEF,MAAMS,EAAS,MAAML,EAAO,KAAKI,CAAG,EAGpC,OAAON,EAAoB,oBAAoB,EAAE,IAAI,qBACnD,CAAE,QAAS,6CAA8C,QAAS,CAAE,CACtE,EACA,OAAOA,EAAoB,oBAAoB,EAAE,IAAI,qBACnD,CAAE,QAAS,6CAA8C,QAAS,CAAE,CACtE,EACA,OAAOO,EAAO,IAAI,EAAE,QAAQ,SAAS,CACvC,CAAC,EAED,GAAG,gDAAiD,SAAY,CAE9D,MAAMD,EAAM,CACV,kBAAmB,6CACnB,QAAS,EACT,QAAS,KACT,OAAQH,EACR,aAAcC,CAChB,EACA,KACG,MAAMH,EAAyB,qBAAqB,EACpD,mBAAmB,IAClB,QAAQ,QACNH,EAAM,CACJ,YAAa,CACX,YAAa,UACb,aAAc,EACd,UACE,gJACJ,EACA,QAAS,CACP,CACE,KAAM,QACN,YAAa,mBACb,KAAM,mBACN,WAAY,EACZ,UACE,8IACJ,CACF,CACF,CAAC,CACH,CACF,EAGF,MAAMS,EAAS,MAAML,EAAO,KAAKI,CAAG,EAGpC,OAAOC,EAAO,IAAI,EAAE,QAAQ,SAAS,EACjCA,EAAO,OAAS,YAClB,OAAOA,EAAO,QAAQ,kBAAkB,GAAI,WAAc,EAAE,QAC1D,kBACF,EACA,OAAOA,EAAO,MAAM,EAAE,QAAQ,CAAC,CAAC,EAEpC,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["Left", "Right", "DefaultTypedDataContextLoader", "mockTokenDataSource", "mockTypedDataDataSource", "loader", "TEST_TYPES", "TEST_VALUES", "address", "ctx", "result"]
7
+ }
@@ -1,2 +1 @@
1
- export {};
2
- //# sourceMappingURL=TypedDataContextLoader.js.map
1
+ //# sourceMappingURL=TypedDataContextLoader.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"TypedDataContextLoader.js","sourceRoot":"","sources":["../../../../../src/typed-data/domain/TypedDataContextLoader.ts"],"names":[],"mappings":""}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,8 +1,9 @@
1
- import { ClearSignContext } from "./shared/model/ClearSignContext";
2
- import { TransactionContext } from "./shared/model/TransactionContext";
1
+ import { type ClearSignContext } from "./shared/model/ClearSignContext";
2
+ import { type TransactionContext, type TransactionFieldContext } from "./shared/model/TransactionContext";
3
3
  import { type TypedDataClearSignContext } from "./shared/model/TypedDataClearSignContext";
4
4
  import { type TypedDataContext } from "./shared/model/TypedDataContext";
5
5
  export interface ContextModule {
6
+ getContext(field: TransactionFieldContext): Promise<ClearSignContext>;
6
7
  getContexts(transaction: TransactionContext): Promise<ClearSignContext[]>;
7
8
  getTypedDataFilters(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
8
9
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextModule.d.ts","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtE,WAAW,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC1E,mBAAmB,CACjB,SAAS,EAAE,gBAAgB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACvC"}
@@ -1,20 +1,17 @@
1
- import { ContextModuleConfig } from "./config/model/ContextModuleConfig";
2
- import { ContextLoader } from "./shared/domain/ContextLoader";
1
+ import { type ContextModuleCalConfig, type ContextModuleConfig } from "./config/model/ContextModuleConfig";
2
+ import { type ContextLoader } from "./shared/domain/ContextLoader";
3
3
  import { type TypedDataContextLoader } from "./typed-data/domain/TypedDataContextLoader";
4
- import { ContextModule } from "./ContextModule";
4
+ import { type ContextModule } from "./ContextModule";
5
5
  export declare const DEFAULT_CONFIG: ContextModuleConfig;
6
6
  export declare class ContextModuleBuilder {
7
7
  private config;
8
- private customLoaders;
9
- private defaultLoaders;
10
- private customTypedDataLoader?;
11
8
  constructor();
12
9
  /**
13
10
  * Remove default loaders from the list of loaders
14
11
  *
15
12
  * @returns this
16
13
  */
17
- withoutDefaultLoaders(): this;
14
+ removeDefaultLoaders(): this;
18
15
  /**
19
16
  * Add a custom loader to the list of loaders
20
17
  *
@@ -25,16 +22,17 @@ export declare class ContextModuleBuilder {
25
22
  /**
26
23
  * Replace the default loader for typed data clear signing contexts
27
24
  *
25
+ * @param loader loader to use for typed data clear signing contexts
28
26
  * @returns this
29
27
  */
30
- withTypedDataLoader(loader: TypedDataContextLoader): this;
28
+ addTypedDataLoader(loader: TypedDataContextLoader): this;
31
29
  /**
32
- * Set the configuration for the context module
30
+ * Add a custom CAL configuration
33
31
  *
34
- * @param config configuration for the context module
32
+ * @param calConfig
35
33
  * @returns this
36
34
  */
37
- withConfig(config: Partial<ContextModuleConfig>): this;
35
+ addCalConfig(calConfig: ContextModuleCalConfig): this;
38
36
  /**
39
37
  * Build the context module
40
38
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextModuleBuilder.d.ts","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACzB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKrD,eAAO,MAAM,cAAc,EAAE,mBAS5B,CAAC;AAEF,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAuC;;IAIrD;;;;OAIG;IACH,oBAAoB;IAKpB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa;IAK/B;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,sBAAsB;IAKjD;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,sBAAsB;IAK9C;;;;OAIG;IACH,KAAK,IAAI,aAAa;CAGvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ContextModuleBuilder.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextModuleBuilder.test.d.ts","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { TypedDataClearSignContext } from "./shared/model/TypedDataClearSignContext";
2
+ import type { TypedDataContext } from "./shared/model/TypedDataContext";
3
+ import { type ContextModuleConfig } from "./config/model/ContextModuleConfig";
4
+ import { type ClearSignContext } from "./shared/model/ClearSignContext";
5
+ import { type TransactionContext, type TransactionFieldContext } from "./shared/model/TransactionContext";
6
+ import { type ContextModule } from "./ContextModule";
7
+ export declare class DefaultContextModule implements ContextModule {
8
+ private _container;
9
+ private _loaders;
10
+ private _typedDataLoader;
11
+ constructor(args: ContextModuleConfig);
12
+ private _getDefaultLoaders;
13
+ private _getDefaultTypedDataLoader;
14
+ getContexts(transaction: TransactionContext): Promise<ClearSignContext[]>;
15
+ getContext(field: TransactionFieldContext): Promise<ClearSignContext>;
16
+ getTypedDataFilters(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
17
+ }
18
+ //# sourceMappingURL=DefaultContextModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultContextModule.d.ts","sourceRoot":"","sources":["../../../src/DefaultContextModule.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAIxE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAM9E,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAO3C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,qBAAa,oBAAqB,YAAW,aAAa;IACxD,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,gBAAgB,CAAyB;gBAErC,IAAI,EAAE,mBAAmB;IAQrC,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,0BAA0B;IAMrB,WAAW,CACtB,WAAW,EAAE,kBAAkB,GAC9B,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAMjB,UAAU,CACrB,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,gBAAgB,CAAC;IAaf,mBAAmB,CAC9B,SAAS,EAAE,gBAAgB,GAC1B,OAAO,CAAC,yBAAyB,CAAC;CAGtC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DefaultContextModule.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefaultContextModule.test.d.ts","sourceRoot":"","sources":["../../../src/DefaultContextModule.test.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
1
  import { ContainerModule } from "inversify";
2
- import { ContextModuleConfig } from "../../config/model/ContextModuleConfig";
2
+ import { type ContextModuleConfig } from "../../config/model/ContextModuleConfig";
3
3
  export declare const configModuleFactory: (config: ContextModuleConfig) => ContainerModule;
4
4
  //# sourceMappingURL=configModuleFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/config/di/configModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAIzE,eAAO,MAAM,mBAAmB,WAAY,mBAAmB,oBAG3D,CAAC"}
1
+ {"version":3,"file":"configModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/config/di/configModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,eAAO,MAAM,mBAAmB,WAAY,mBAAmB,oBAG3D,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type ContextLoader } from "../../shared/domain/ContextLoader";
2
+ import { type TypedDataContextLoader } from "../../typed-data/domain/TypedDataContextLoader";
3
+ export type ContextModuleCalMode = "prod" | "test";
4
+ export type ContextModuleCalBranch = "next" | "main" | "demo";
5
+ export type ContextModuleCalConfig = {
6
+ url: string;
7
+ mode: ContextModuleCalMode;
8
+ branch: ContextModuleCalBranch;
9
+ };
10
+ export type ContextModuleConfig = {
11
+ cal: ContextModuleCalConfig;
12
+ defaultLoaders: boolean;
13
+ customLoaders: ContextLoader[];
14
+ customTypedDataLoader?: TypedDataContextLoader;
15
+ };
16
+ //# sourceMappingURL=ContextModuleConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextModuleConfig.d.ts","sourceRoot":"","sources":["../../../../../src/config/model/ContextModuleConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEzF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,oBAAoB,CAAC;IAC3B,MAAM,EAAE,sBAAsB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,sBAAsB,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,qBAAqB,CAAC,EAAE,sBAAsB,CAAC;CAChD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Container } from "inversify";
2
- import { ContextModuleConfig } from "./config/model/ContextModuleConfig";
2
+ import { type ContextModuleConfig } from "./config/model/ContextModuleConfig";
3
3
  type MakeContainerArgs = {
4
4
  config: ContextModuleConfig;
5
5
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../../src/di.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAQ9E,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,aAAa,eAAgB,iBAAiB,cAc1D,CAAC"}
@@ -1,6 +1,6 @@
1
- import { HexaString } from "@ledgerhq/device-management-kit";
2
- import { Either } from "purify-ts";
3
- import { DappInfos } from "../../external-plugin/model/DappInfos";
1
+ import { type HexaString } from "@ledgerhq/device-management-kit";
2
+ import { type Either } from "purify-ts";
3
+ import { type DappInfos } from "../../external-plugin/model/DappInfos";
4
4
  export type GetDappInfos = {
5
5
  address: string;
6
6
  selector: HexaString;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalPluginDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/data/ExternalPluginDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,YAAY,CACV,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;CAClD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HttpExternalPluginDataSource.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpExternalPluginDataSource.test.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ExternalPluginContextLoader.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalPluginContextLoader.test.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { type SelectorDetails } from "../../external-plugin/model/SelectorDetails";
2
+ export type DappInfos = {
3
+ selectorDetails: SelectorDetails;
4
+ abi: object[];
5
+ };
6
+ //# sourceMappingURL=DappInfos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DappInfos.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/model/DappInfos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG;IAAE,eAAe,EAAE,eAAe,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC"}
@@ -3,12 +3,14 @@ export * from "./ContextModule";
3
3
  export * from "./ContextModuleBuilder";
4
4
  export * from "./DefaultContextModule";
5
5
  export * from "./external-plugin/domain/ExternalPluginContextLoader";
6
- export * from "./forward-domain/domain/ForwardDomainContextLoader";
7
6
  export * from "./nft/domain/NftContextLoader";
7
+ export * from "./shared/domain/ContextLoader";
8
8
  export * from "./shared/model/ClearSignContext";
9
+ export * from "./shared/model/GenericPath";
9
10
  export * from "./shared/model/TransactionContext";
10
11
  export * from "./shared/model/TransactionSubset";
11
12
  export * from "./shared/model/TypedDataClearSignContext";
12
13
  export * from "./shared/model/TypedDataContext";
13
14
  export * from "./token/domain/TokenContextLoader";
15
+ export * from "./trusted-name/domain/TrustedNameContextLoader";
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sDAAsD,CAAC;AACrE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gDAAgD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HttpNftDataSource.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpNftDataSource.test.d.ts","sourceRoot":"","sources":["../../../../../src/nft/data/HttpNftDataSource.test.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { Either } from "purify-ts";
1
+ import { type Either } from "purify-ts";
2
2
  export type GetSetPluginPayloadParams = {
3
3
  chainId: number;
4
4
  address: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NftDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/nft/data/NftDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,kBAAkB,CAChB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAClC,mBAAmB,CACjB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACnC"}
@@ -1,11 +1,12 @@
1
1
  import type { NftDataSource } from "../../nft/data/NftDataSource";
2
2
  import { ContextLoader } from "../../shared/domain/ContextLoader";
3
3
  import { ClearSignContext } from "../../shared/model/ClearSignContext";
4
- import { TransactionContext } from "../../shared/model/TransactionContext";
4
+ import { TransactionContext, TransactionFieldContext } from "../../shared/model/TransactionContext";
5
5
  export declare class NftContextLoader implements ContextLoader {
6
6
  private _dataSource;
7
7
  constructor(dataSource: NftDataSource);
8
8
  load(transaction: TransactionContext): Promise<ClearSignContext[]>;
9
+ loadField(field: TransactionFieldContext): Promise<ClearSignContext | null>;
9
10
  private isSelectorSupported;
10
11
  }
11
12
  //# sourceMappingURL=NftContextLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NftContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextLoader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,mCAAmC,CAAC;AAqB3C,qBACa,gBAAiB,YAAW,aAAa;IACpD,OAAO,CAAC,WAAW,CAAgB;gBAES,UAAU,EAAE,aAAa;IAI/D,IAAI,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA2ElE,SAAS,CACb,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAoBnC,OAAO,CAAC,mBAAmB;CAG5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=NftContextLoader.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NftContextLoader.test.d.ts","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextLoader.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { type ClearSignContext } from "../../shared/model/ClearSignContext";
2
+ import { type TransactionContext, type TransactionFieldContext } from "../../shared/model/TransactionContext";
3
+ export type ContextLoader = {
4
+ load: (transaction: TransactionContext) => Promise<ClearSignContext[]>;
5
+ loadField?: (field: TransactionFieldContext) => Promise<ClearSignContext | null>;
6
+ };
7
+ //# sourceMappingURL=ContextLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/shared/domain/ContextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,CAAC,WAAW,EAAE,kBAAkB,KAAK,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACvE,SAAS,CAAC,EAAE,CACV,KAAK,EAAE,uBAAuB,KAC3B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;CACvC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { type GenericPath } from "./GenericPath";
2
+ export declare enum ClearSignContextType {
3
+ TOKEN = "token",
4
+ NFT = "nft",
5
+ TRUSTED_NAME = "trustedName",
6
+ PLUGIN = "plugin",
7
+ EXTERNAL_PLUGIN = "externalPlugin",
8
+ TRANSACTION_INFO = "transactionInfo",
9
+ ENUM = "enum",
10
+ TRANSACTION_FIELD_DESCRIPTION = "transactionFieldDescription",
11
+ ERROR = "error"
12
+ }
13
+ export type ClearSignContextReference = {
14
+ type: ClearSignContextType.TOKEN | ClearSignContextType.NFT;
15
+ valuePath: GenericPath;
16
+ } | {
17
+ type: ClearSignContextType.TRUSTED_NAME;
18
+ valuePath: GenericPath;
19
+ types: string[];
20
+ sources: string[];
21
+ };
22
+ export type ClearSignContextSuccess = {
23
+ type: Exclude<ClearSignContextType, ClearSignContextType.ERROR>;
24
+ /**
25
+ * Hexadecimal string representation of the payload.
26
+ */
27
+ payload: string;
28
+ /**
29
+ * Optional reference to another asset descriptor.
30
+ * ie: a 'transactionFieldDescription' descriptor can reference a token or
31
+ * a trusted name.
32
+ */
33
+ reference?: ClearSignContextReference;
34
+ };
35
+ export type ClearSignContextError = {
36
+ type: ClearSignContextType.ERROR;
37
+ error: Error;
38
+ };
39
+ export type ClearSignContext = ClearSignContextSuccess | ClearSignContextError;
40
+ //# sourceMappingURL=ClearSignContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClearSignContext.d.ts","sourceRoot":"","sources":["../../../../../src/shared/model/ClearSignContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,oBAAY,oBAAoB;IAC9B,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,YAAY,gBAAgB;IAC5B,MAAM,WAAW;IACjB,eAAe,mBAAmB;IAClC,gBAAgB,oBAAoB;IACpC,IAAI,SAAS;IACb,6BAA6B,gCAAgC;IAC7D,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,yBAAyB,GACjC;IACE,IAAI,EAAE,oBAAoB,CAAC,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC;IAC5D,SAAS,EAAE,WAAW,CAAC;CACxB,GACD;IACE,IAAI,EAAE,oBAAoB,CAAC,YAAY,CAAC;IACxC,SAAS,EAAE,WAAW,CAAC;IACvB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEN,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,OAAO,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAChE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Generic binary paths are a way to to navigate in any kind of structured binary data such as:
3
+ * - transactions
4
+ * - typed messages (EIP-712)
5
+ * - meta transactions (EIP-2771)
6
+ * - user operations (EIP-4337)
7
+ * - ...
8
+ * We follow here the concepts defined in the clear signing standard:
9
+ * https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/specs/erc-7730.md#structured-data
10
+ *
11
+ * - The container is the structure to be signed, for instance a transaction
12
+ * - The structured data is the data we want to navigate in, for instance a transaction calldata
13
+ *
14
+ * A generic path is either a field of the container, or a path in the structured data.
15
+ * Those path will also be handled by the devices:
16
+ * https://github.com/LedgerHQ/generic_parser/blob/master/specs.md#path_element
17
+ */
18
+ export type GenericPath = ContainerPathValues | DataPathElement[];
19
+ export declare enum ContainerPath {
20
+ FROM = "FROM",
21
+ TO = "TO",
22
+ VALUE = "VALUE"
23
+ }
24
+ export type ContainerPathValues = keyof typeof ContainerPath;
25
+ /**
26
+ * A path in binary data will be composed of:
27
+ * - any number of steps of which:
28
+ * - Tuple: a set of elements which size if known
29
+ * - Array: an array of elements with dynamic size
30
+ * - Reference: a pointer to dereference
31
+ * - one leaf at the end to indicate the returned element type
32
+ * - static leaf: 1 fixed-size chunk is returned
33
+ * - dynamic leaf: element of variable size is returned
34
+ * - optionally a slice element, only allowed after the leaf, to slice the result
35
+ *
36
+ * An example for a transaction with that ethereum smart contract:
37
+ * function requestWithdrawalsWithPermit(uint256[] _amounts, address _owner, (uint256,uint256,uint8,bytes32,bytes32) _permit)
38
+ * In that case:
39
+ * - _amounts is an array
40
+ * - _permit is a tuple
41
+ * 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.
42
+ */
43
+ export type DataPathElement = DataPathElementTuple | DataPathElementArray | DataPathElementRef | DataPathElementLeaf | DataPathElementSlice;
44
+ export declare enum DataPathElementType {
45
+ TUPLE = "TUPLE",
46
+ ARRAY = "ARRAY",
47
+ REF = "REF",
48
+ LEAF = "LEAF",
49
+ SLICE = "SLICE"
50
+ }
51
+ export type DataPathElementTypeValues = keyof typeof DataPathElementType;
52
+ /**
53
+ * Path element to navigate in a tuple.
54
+ * - offset: the item of the tuple to select
55
+ */
56
+ export interface DataPathElementTuple {
57
+ type: "TUPLE";
58
+ offset: number;
59
+ }
60
+ /**
61
+ * Path element to navigate in an array of variable size.
62
+ * - itemSize: the length of each item in that array (not the number of items which is variable).
63
+ * - start: the start of the array slice to iterate on. If unset, start from the beginning of that array.
64
+ * - length: the length of the array slice to iterate on. If unset, iterate until the end of that array.
65
+ */
66
+ export interface DataPathElementArray {
67
+ type: "ARRAY";
68
+ itemSize: number;
69
+ start?: number;
70
+ length?: number;
71
+ }
72
+ export interface DataPathElementRef {
73
+ type: "REF";
74
+ }
75
+ /**
76
+ * Path element to represent the leaf of the path, to be returned.
77
+ * It is mandatory, and only allowed at the end of the path.
78
+ * It indicates the type of data to return:
79
+ * - Static leaf: data of static size, typically 1 chunk
80
+ * - Dynamic leaf: data of dynamic size, typically length+data
81
+ * - Tuple leaf: returned data is a tuple (a set of a static number of elements)
82
+ * - Array leaf: returned data is an array (dynamic number of elements)
83
+ */
84
+ export interface DataPathElementLeaf {
85
+ type: "LEAF";
86
+ leafType: DataPathLeafTypeValues;
87
+ }
88
+ export declare enum DataPathLeafType {
89
+ STATIC_LEAF = "STATIC_LEAF",
90
+ DYNAMIC_LEAF = "DYNAMIC_LEAF",
91
+ TUPLE_LEAF = "TUPLE_LEAF",
92
+ ARRAY_LEAF = "ARRAY_LEAF"
93
+ }
94
+ export type DataPathLeafTypeValues = keyof typeof DataPathLeafType;
95
+ /**
96
+ * Path element to represent a slice.
97
+ * It is optional and only allowed at the end of a path, after the leaf.
98
+ * It means the leaf shall be sliced before being returned.
99
+ */
100
+ export interface DataPathElementSlice {
101
+ type: "SLICE";
102
+ start?: number;
103
+ end?: number;
104
+ }
105
+ //# sourceMappingURL=GenericPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericPath.d.ts","sourceRoot":"","sources":["../../../../../src/shared/model/GenericPath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,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
@@ -0,0 +1,19 @@
1
+ import { type ClearSignContextType } from "../../shared/model/ClearSignContext";
2
+ import { type TransactionSubset } from "../../shared/model/TransactionSubset";
3
+ export type TransactionFieldContext = {
4
+ type: ClearSignContextType.TOKEN | ClearSignContextType.NFT;
5
+ chainId: number;
6
+ address: string;
7
+ } | {
8
+ type: ClearSignContextType.TRUSTED_NAME;
9
+ chainId: number;
10
+ address: string;
11
+ challenge: string;
12
+ types: string[];
13
+ sources: string[];
14
+ };
15
+ export type TransactionContext = TransactionSubset & {
16
+ challenge: string;
17
+ domain?: string;
18
+ };
19
+ //# sourceMappingURL=TransactionContext.d.ts.map