@ledgerhq/device-signer-kit-ethereum 0.0.0-hid-candidate-3-20250528083456 → 0.0.0-intent-queue-1-20251112094350

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 (724) hide show
  1. package/README.md +112 -1
  2. package/lib/cjs/api/SignerEth.js +1 -1
  3. package/lib/cjs/api/SignerEth.js.map +1 -1
  4. package/lib/cjs/api/SignerEthBuilder.test.js +1 -1
  5. package/lib/cjs/api/SignerEthBuilder.test.js.map +2 -2
  6. package/lib/cjs/api/app-binder/SignDelegationAuthorizationTypes.js +2 -0
  7. package/lib/cjs/api/app-binder/SignDelegationAuthorizationTypes.js.map +7 -0
  8. package/lib/cjs/api/app-binder/SignTransactionDeviceActionTypes.js +1 -1
  9. package/lib/cjs/api/app-binder/SignTransactionDeviceActionTypes.js.map +2 -2
  10. package/lib/cjs/api/app-binder/SignTypedDataDeviceActionTypes.js +1 -1
  11. package/lib/cjs/api/app-binder/SignTypedDataDeviceActionTypes.js.map +2 -2
  12. package/lib/cjs/api/app-binder/VerifySafeAddressDeviceActionTypes.js +2 -0
  13. package/lib/cjs/api/app-binder/VerifySafeAddressDeviceActionTypes.js.map +7 -0
  14. package/lib/cjs/api/index.js +1 -1
  15. package/lib/cjs/api/index.js.map +3 -3
  16. package/lib/cjs/api/model/ClearSigningType.js +2 -0
  17. package/lib/cjs/api/model/ClearSigningType.js.map +7 -0
  18. package/lib/cjs/api/model/SafeAddressOptions.js +2 -0
  19. package/lib/cjs/api/model/SafeAddressOptions.js.map +7 -0
  20. package/lib/cjs/internal/DefaultSignerEth.js +1 -1
  21. package/lib/cjs/internal/DefaultSignerEth.js.map +3 -3
  22. package/lib/cjs/internal/DefaultSignerEth.test.js +1 -1
  23. package/lib/cjs/internal/DefaultSignerEth.test.js.map +3 -3
  24. package/lib/cjs/internal/app-binder/EthAppBinder.js +1 -1
  25. package/lib/cjs/internal/app-binder/EthAppBinder.js.map +3 -3
  26. package/lib/cjs/internal/app-binder/EthAppBinder.test.js +1 -1
  27. package/lib/cjs/internal/app-binder/EthAppBinder.test.js.map +3 -3
  28. package/lib/cjs/internal/app-binder/command/GetAddressCommand.js +1 -1
  29. package/lib/cjs/internal/app-binder/command/GetAddressCommand.js.map +2 -2
  30. package/lib/cjs/internal/app-binder/command/GetAddressCommand.test.js +1 -1
  31. package/lib/cjs/internal/app-binder/command/GetAddressCommand.test.js.map +2 -2
  32. package/lib/cjs/internal/app-binder/command/GetAppConfigurationCommand.js +1 -1
  33. package/lib/cjs/internal/app-binder/command/GetAppConfigurationCommand.js.map +2 -2
  34. package/lib/cjs/internal/app-binder/command/GetAppConfigurationCommand.test.js +1 -1
  35. package/lib/cjs/internal/app-binder/command/GetAppConfigurationCommand.test.js.map +2 -2
  36. package/lib/cjs/internal/app-binder/command/GetChallengeCommand.js +1 -1
  37. package/lib/cjs/internal/app-binder/command/GetChallengeCommand.js.map +2 -2
  38. package/lib/cjs/internal/app-binder/command/GetChallengeCommand.test.js +1 -1
  39. package/lib/cjs/internal/app-binder/command/GetChallengeCommand.test.js.map +2 -2
  40. package/lib/cjs/internal/app-binder/command/ProvideEnumCommand.js +1 -1
  41. package/lib/cjs/internal/app-binder/command/ProvideEnumCommand.js.map +2 -2
  42. package/lib/cjs/internal/app-binder/command/ProvideEnumCommand.test.js +1 -1
  43. package/lib/cjs/internal/app-binder/command/ProvideEnumCommand.test.js.map +3 -3
  44. package/lib/cjs/internal/app-binder/command/ProvideNFTInformationCommand.js +1 -1
  45. package/lib/cjs/internal/app-binder/command/ProvideNFTInformationCommand.js.map +2 -2
  46. package/lib/cjs/internal/app-binder/command/ProvideNFTInformationCommand.test.js +1 -1
  47. package/lib/cjs/internal/app-binder/command/ProvideNFTInformationCommand.test.js.map +3 -3
  48. package/lib/cjs/internal/app-binder/command/ProvideNetworkConfigurationCommand.js +2 -0
  49. package/lib/cjs/internal/app-binder/command/ProvideNetworkConfigurationCommand.js.map +7 -0
  50. package/lib/cjs/internal/app-binder/command/ProvideNetworkConfigurationCommand.test.js +2 -0
  51. package/lib/cjs/internal/app-binder/command/ProvideNetworkConfigurationCommand.test.js.map +7 -0
  52. package/lib/cjs/internal/app-binder/command/ProvideProxyInfoCommand.js +2 -0
  53. package/lib/cjs/internal/app-binder/command/ProvideProxyInfoCommand.js.map +7 -0
  54. package/lib/cjs/internal/app-binder/command/ProvideProxyInfoCommand.test.js +2 -0
  55. package/lib/cjs/internal/app-binder/command/ProvideProxyInfoCommand.test.js.map +7 -0
  56. package/lib/cjs/internal/app-binder/command/ProvideSafeAccountCommand.js +2 -0
  57. package/lib/cjs/internal/app-binder/command/ProvideSafeAccountCommand.js.map +7 -0
  58. package/lib/cjs/internal/app-binder/command/ProvideSafeAccountCommand.test.js +2 -0
  59. package/lib/cjs/internal/app-binder/command/ProvideSafeAccountCommand.test.js.map +7 -0
  60. package/lib/cjs/internal/app-binder/command/ProvideTokenInformationCommand.js +1 -1
  61. package/lib/cjs/internal/app-binder/command/ProvideTokenInformationCommand.js.map +2 -2
  62. package/lib/cjs/internal/app-binder/command/ProvideTokenInformationCommand.test.js +1 -1
  63. package/lib/cjs/internal/app-binder/command/ProvideTokenInformationCommand.test.js.map +2 -2
  64. package/lib/cjs/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.js +1 -1
  65. package/lib/cjs/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.js.map +2 -2
  66. package/lib/cjs/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.test.js +1 -1
  67. package/lib/cjs/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.test.js.map +3 -3
  68. package/lib/cjs/internal/app-binder/command/ProvideTransactionInformationCommand.js +1 -1
  69. package/lib/cjs/internal/app-binder/command/ProvideTransactionInformationCommand.js.map +2 -2
  70. package/lib/cjs/internal/app-binder/command/ProvideTransactionInformationCommand.test.js +1 -1
  71. package/lib/cjs/internal/app-binder/command/ProvideTransactionInformationCommand.test.js.map +3 -3
  72. package/lib/cjs/internal/app-binder/command/ProvideTrustedNameCommand.js +1 -1
  73. package/lib/cjs/internal/app-binder/command/ProvideTrustedNameCommand.js.map +2 -2
  74. package/lib/cjs/internal/app-binder/command/ProvideTrustedNameCommand.test.js +1 -1
  75. package/lib/cjs/internal/app-binder/command/ProvideTrustedNameCommand.test.js.map +3 -3
  76. package/lib/cjs/internal/app-binder/command/ProvideWeb3CheckCommand.js +1 -1
  77. package/lib/cjs/internal/app-binder/command/ProvideWeb3CheckCommand.js.map +2 -2
  78. package/lib/cjs/internal/app-binder/command/ProvideWeb3CheckCommand.test.js +1 -1
  79. package/lib/cjs/internal/app-binder/command/ProvideWeb3CheckCommand.test.js.map +3 -3
  80. package/lib/cjs/internal/app-binder/command/SendEIP712FilteringCommand.js +1 -1
  81. package/lib/cjs/internal/app-binder/command/SendEIP712FilteringCommand.js.map +3 -3
  82. package/lib/cjs/internal/app-binder/command/SendEIP712FilteringCommand.test.js +1 -1
  83. package/lib/cjs/internal/app-binder/command/SendEIP712FilteringCommand.test.js.map +3 -3
  84. package/lib/cjs/internal/app-binder/command/SendEIP712StructDefinitionCommand.js +1 -1
  85. package/lib/cjs/internal/app-binder/command/SendEIP712StructDefinitionCommand.js.map +2 -2
  86. package/lib/cjs/internal/app-binder/command/SendEIP712StructDefinitionCommand.test.js +1 -1
  87. package/lib/cjs/internal/app-binder/command/SendEIP712StructDefinitionCommand.test.js.map +3 -3
  88. package/lib/cjs/internal/app-binder/command/SendEIP712StructImplemCommand.js +1 -1
  89. package/lib/cjs/internal/app-binder/command/SendEIP712StructImplemCommand.js.map +2 -2
  90. package/lib/cjs/internal/app-binder/command/SendEIP712StructImplemCommand.test.js +1 -1
  91. package/lib/cjs/internal/app-binder/command/SendEIP712StructImplemCommand.test.js.map +3 -3
  92. package/lib/cjs/internal/app-binder/command/SetExternalPluginCommand.js +1 -1
  93. package/lib/cjs/internal/app-binder/command/SetExternalPluginCommand.js.map +2 -2
  94. package/lib/cjs/internal/app-binder/command/SetExternalPluginCommand.test.js +2 -2
  95. package/lib/cjs/internal/app-binder/command/SetExternalPluginCommand.test.js.map +3 -3
  96. package/lib/cjs/internal/app-binder/command/SetPluginCommand.js +1 -1
  97. package/lib/cjs/internal/app-binder/command/SetPluginCommand.js.map +2 -2
  98. package/lib/cjs/internal/app-binder/command/SetPluginCommand.test.js +2 -2
  99. package/lib/cjs/internal/app-binder/command/SetPluginCommand.test.js.map +3 -3
  100. package/lib/cjs/internal/app-binder/command/SignAuthorizationDelegationCommand.js +2 -0
  101. package/lib/cjs/internal/app-binder/command/SignAuthorizationDelegationCommand.js.map +7 -0
  102. package/lib/cjs/internal/app-binder/command/SignAuthorizationDelegationCommand.test.js +2 -0
  103. package/lib/cjs/internal/app-binder/command/SignAuthorizationDelegationCommand.test.js.map +7 -0
  104. package/lib/cjs/internal/app-binder/command/SignEIP712Command.js +1 -1
  105. package/lib/cjs/internal/app-binder/command/SignEIP712Command.js.map +3 -3
  106. package/lib/cjs/internal/app-binder/command/SignEIP712Command.test.js +1 -1
  107. package/lib/cjs/internal/app-binder/command/SignEIP712Command.test.js.map +2 -2
  108. package/lib/cjs/internal/app-binder/command/SignPersonalMessageCommand.js +1 -1
  109. package/lib/cjs/internal/app-binder/command/SignPersonalMessageCommand.js.map +2 -2
  110. package/lib/cjs/internal/app-binder/command/SignPersonalMessageCommand.test.js +1 -1
  111. package/lib/cjs/internal/app-binder/command/SignPersonalMessageCommand.test.js.map +3 -3
  112. package/lib/cjs/internal/app-binder/command/SignTransactionCommand.js +1 -1
  113. package/lib/cjs/internal/app-binder/command/SignTransactionCommand.js.map +2 -2
  114. package/lib/cjs/internal/app-binder/command/SignTransactionCommand.test.js +1 -1
  115. package/lib/cjs/internal/app-binder/command/SignTransactionCommand.test.js.map +3 -3
  116. package/lib/cjs/internal/app-binder/command/StartTransactionCommand.js +1 -1
  117. package/lib/cjs/internal/app-binder/command/StartTransactionCommand.js.map +2 -2
  118. package/lib/cjs/internal/app-binder/command/StartTransactionCommand.test.js +1 -1
  119. package/lib/cjs/internal/app-binder/command/StartTransactionCommand.test.js.map +3 -3
  120. package/lib/cjs/internal/app-binder/command/StoreTransactionCommand.js +1 -1
  121. package/lib/cjs/internal/app-binder/command/StoreTransactionCommand.js.map +2 -2
  122. package/lib/cjs/internal/app-binder/command/StoreTransactionCommand.test.js +1 -1
  123. package/lib/cjs/internal/app-binder/command/StoreTransactionCommand.test.js.map +3 -3
  124. package/lib/cjs/internal/app-binder/command/Web3CheckOptInCommand.js +1 -1
  125. package/lib/cjs/internal/app-binder/command/Web3CheckOptInCommand.js.map +2 -2
  126. package/lib/cjs/internal/app-binder/command/Web3CheckOptInCommand.test.js +1 -1
  127. package/lib/cjs/internal/app-binder/command/Web3CheckOptInCommand.test.js.map +3 -3
  128. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js +1 -1
  129. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js.map +3 -3
  130. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js +1 -1
  131. package/lib/cjs/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js.map +3 -3
  132. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js +1 -1
  133. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js.map +3 -3
  134. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js +1 -1
  135. package/lib/cjs/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js.map +3 -3
  136. package/lib/cjs/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.js +2 -0
  137. package/lib/cjs/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.js.map +7 -0
  138. package/lib/cjs/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.test.js +2 -0
  139. package/lib/cjs/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.test.js.map +7 -0
  140. package/lib/cjs/internal/app-binder/device-action/__test-utils__/makeInternalApi.js +1 -1
  141. package/lib/cjs/internal/app-binder/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  142. package/lib/cjs/internal/app-binder/device-action/__test-utils__/testDeviceActionUntilStep.js +2 -0
  143. package/lib/cjs/internal/app-binder/device-action/__test-utils__/testDeviceActionUntilStep.js.map +7 -0
  144. package/lib/cjs/internal/app-binder/task/BuildBaseContexts.js +2 -0
  145. package/lib/cjs/internal/app-binder/task/BuildBaseContexts.js.map +7 -0
  146. package/lib/cjs/internal/app-binder/task/BuildBaseContexts.test.js +2 -0
  147. package/lib/cjs/internal/app-binder/task/BuildBaseContexts.test.js.map +7 -0
  148. package/lib/cjs/internal/app-binder/task/BuildEIP712ContextTask.js +1 -1
  149. package/lib/cjs/internal/app-binder/task/BuildEIP712ContextTask.js.map +3 -3
  150. package/lib/cjs/internal/app-binder/task/BuildEIP712ContextTask.test.js +1 -1
  151. package/lib/cjs/internal/app-binder/task/BuildEIP712ContextTask.test.js.map +3 -3
  152. package/lib/cjs/internal/app-binder/task/BuildFullContextsTask.js +2 -0
  153. package/lib/cjs/internal/app-binder/task/BuildFullContextsTask.js.map +7 -0
  154. package/lib/cjs/internal/app-binder/task/BuildFullContextsTask.test.js +2 -0
  155. package/lib/cjs/internal/app-binder/task/BuildFullContextsTask.test.js.map +7 -0
  156. package/lib/cjs/internal/app-binder/task/BuildSafeAddressContextTask.js +2 -0
  157. package/lib/cjs/internal/app-binder/task/BuildSafeAddressContextTask.js.map +7 -0
  158. package/lib/cjs/internal/app-binder/task/BuildSafeAddressContextTask.test.js +2 -0
  159. package/lib/cjs/internal/app-binder/task/BuildSafeAddressContextTask.test.js.map +7 -0
  160. package/lib/cjs/internal/app-binder/task/BuildSubcontextsTask.js +2 -0
  161. package/lib/cjs/internal/app-binder/task/BuildSubcontextsTask.js.map +7 -0
  162. package/lib/cjs/internal/app-binder/task/BuildSubcontextsTask.test.js +2 -0
  163. package/lib/cjs/internal/app-binder/task/BuildSubcontextsTask.test.js.map +7 -0
  164. package/lib/cjs/internal/app-binder/task/ParseNestedTransactionTask.js +2 -0
  165. package/lib/cjs/internal/app-binder/task/ParseNestedTransactionTask.js.map +7 -0
  166. package/lib/cjs/internal/app-binder/task/ParseNestedTransactionTask.test.js +2 -0
  167. package/lib/cjs/internal/app-binder/task/ParseNestedTransactionTask.test.js.map +7 -0
  168. package/lib/cjs/internal/app-binder/task/ParseTransactionTask.js +2 -0
  169. package/lib/cjs/internal/app-binder/task/ParseTransactionTask.js.map +7 -0
  170. package/lib/cjs/internal/app-binder/task/ParseTransactionTask.test.js +2 -0
  171. package/lib/cjs/internal/app-binder/task/ParseTransactionTask.test.js.map +7 -0
  172. package/lib/cjs/internal/app-binder/task/ProvideContextTask.js +2 -0
  173. package/lib/cjs/internal/app-binder/task/ProvideContextTask.js.map +7 -0
  174. package/lib/cjs/internal/app-binder/task/ProvideContextTask.test.js +2 -0
  175. package/lib/cjs/internal/app-binder/task/ProvideContextTask.test.js.map +7 -0
  176. package/lib/cjs/internal/app-binder/task/ProvideEIP712ContextTask.js +1 -1
  177. package/lib/cjs/internal/app-binder/task/ProvideEIP712ContextTask.js.map +3 -3
  178. package/lib/cjs/internal/app-binder/task/ProvideEIP712ContextTask.test.js +1 -1
  179. package/lib/cjs/internal/app-binder/task/ProvideEIP712ContextTask.test.js.map +3 -3
  180. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextsTask.js +2 -0
  181. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextsTask.js.map +7 -0
  182. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextsTask.test.js +2 -0
  183. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextsTask.test.js.map +7 -0
  184. package/lib/cjs/internal/app-binder/task/SendPayloadInChunksTask.js +1 -1
  185. package/lib/cjs/internal/app-binder/task/SendPayloadInChunksTask.js.map +3 -3
  186. package/lib/cjs/internal/app-binder/task/SendPayloadInChunksTask.test.js +1 -1
  187. package/lib/cjs/internal/app-binder/task/SendPayloadInChunksTask.test.js.map +3 -3
  188. package/lib/cjs/internal/app-binder/task/SendSignAuthorizationDelegationTask.js +2 -0
  189. package/lib/cjs/internal/app-binder/task/SendSignAuthorizationDelegationTask.js.map +7 -0
  190. package/lib/cjs/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.js +2 -0
  191. package/lib/cjs/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.js.map +7 -0
  192. package/lib/cjs/internal/app-binder/task/SendSignTransactionTask.js +1 -1
  193. package/lib/cjs/internal/app-binder/task/SendSignTransactionTask.js.map +3 -3
  194. package/lib/cjs/internal/app-binder/task/SendSignTransactionTask.test.js +1 -1
  195. package/lib/cjs/internal/app-binder/task/SendSignTransactionTask.test.js.map +3 -3
  196. package/lib/cjs/internal/di.js +1 -1
  197. package/lib/cjs/internal/di.js.map +3 -3
  198. package/lib/cjs/internal/eip7702/di/eip7702Module.js +2 -0
  199. package/lib/cjs/internal/eip7702/di/eip7702Module.js.map +7 -0
  200. package/lib/cjs/internal/eip7702/di/eip7702Module.test.js +2 -0
  201. package/lib/cjs/internal/eip7702/di/eip7702Module.test.js.map +7 -0
  202. package/lib/cjs/internal/eip7702/di/eip7702Types.js +2 -0
  203. package/lib/cjs/internal/eip7702/di/eip7702Types.js.map +7 -0
  204. package/lib/cjs/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.js +2 -0
  205. package/lib/cjs/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.js.map +7 -0
  206. package/lib/cjs/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.js +2 -0
  207. package/lib/cjs/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.js.map +7 -0
  208. package/lib/cjs/internal/safe/di/safeModule.js +2 -0
  209. package/lib/cjs/internal/safe/di/safeModule.js.map +7 -0
  210. package/lib/cjs/internal/safe/di/safeModule.test.js +2 -0
  211. package/lib/cjs/internal/safe/di/safeModule.test.js.map +7 -0
  212. package/lib/cjs/internal/safe/di/safeTypes.js +2 -0
  213. package/lib/cjs/internal/safe/di/safeTypes.js.map +7 -0
  214. package/lib/cjs/internal/safe/use-case/VerifySafeAddressUseCase.js +2 -0
  215. package/lib/cjs/internal/safe/use-case/VerifySafeAddressUseCase.js.map +7 -0
  216. package/lib/cjs/internal/safe/use-case/VerifySafeAddressUseCase.test.js +2 -0
  217. package/lib/cjs/internal/safe/use-case/VerifySafeAddressUseCase.test.js.map +7 -0
  218. package/lib/cjs/internal/shared/utils/ApplicationChecker.js +1 -1
  219. package/lib/cjs/internal/shared/utils/ApplicationChecker.js.map +3 -3
  220. package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js +1 -1
  221. package/lib/cjs/internal/shared/utils/ApplicationChecker.test.js.map +2 -2
  222. package/lib/cjs/internal/transaction/di/transactionModule.js +1 -1
  223. package/lib/cjs/internal/transaction/di/transactionModule.js.map +3 -3
  224. package/lib/cjs/internal/transaction/di/transactionModule.test.js +1 -1
  225. package/lib/cjs/internal/transaction/di/transactionModule.test.js.map +2 -2
  226. package/lib/cjs/internal/transaction/service/mapper/EthersTransactionMapperService.js +2 -0
  227. package/lib/cjs/internal/transaction/service/mapper/EthersTransactionMapperService.js.map +7 -0
  228. package/lib/cjs/internal/transaction/service/mapper/EthersTransactionMapperService.test.js +2 -0
  229. package/lib/cjs/internal/transaction/service/mapper/EthersTransactionMapperService.test.js.map +7 -0
  230. package/lib/cjs/internal/transaction/service/mapper/TransactionMapperService.js +1 -1
  231. package/lib/cjs/internal/transaction/service/mapper/TransactionMapperService.js.map +3 -3
  232. package/lib/cjs/internal/transaction/service/parser/TransactionParserService.js +1 -1
  233. package/lib/cjs/internal/transaction/service/parser/TransactionParserService.js.map +3 -3
  234. package/lib/cjs/internal/transaction/service/parser/TransactionParserService.test.js +1 -1
  235. package/lib/cjs/internal/transaction/service/parser/TransactionParserService.test.js.map +3 -3
  236. package/lib/cjs/package.json +1 -1
  237. package/lib/esm/api/SignerEthBuilder.test.js +1 -1
  238. package/lib/esm/api/SignerEthBuilder.test.js.map +2 -2
  239. package/lib/esm/api/app-binder/SignDelegationAuthorizationTypes.js +1 -0
  240. package/lib/esm/api/app-binder/SignTransactionDeviceActionTypes.js +1 -1
  241. package/lib/esm/api/app-binder/SignTransactionDeviceActionTypes.js.map +2 -2
  242. package/lib/esm/api/app-binder/SignTypedDataDeviceActionTypes.js +1 -1
  243. package/lib/esm/api/app-binder/SignTypedDataDeviceActionTypes.js.map +2 -2
  244. package/lib/esm/api/app-binder/VerifySafeAddressDeviceActionTypes.js +2 -0
  245. package/lib/esm/api/app-binder/VerifySafeAddressDeviceActionTypes.js.map +7 -0
  246. package/lib/esm/api/index.js +1 -1
  247. package/lib/esm/api/index.js.map +2 -2
  248. package/lib/esm/api/model/ClearSigningType.js +2 -0
  249. package/lib/esm/api/model/ClearSigningType.js.map +7 -0
  250. package/lib/esm/api/model/SafeAddressOptions.js +1 -0
  251. package/lib/esm/api/model/SafeAddressOptions.js.map +7 -0
  252. package/lib/esm/internal/DefaultSignerEth.js +1 -1
  253. package/lib/esm/internal/DefaultSignerEth.js.map +3 -3
  254. package/lib/esm/internal/DefaultSignerEth.test.js +1 -1
  255. package/lib/esm/internal/DefaultSignerEth.test.js.map +3 -3
  256. package/lib/esm/internal/app-binder/EthAppBinder.js +1 -1
  257. package/lib/esm/internal/app-binder/EthAppBinder.js.map +3 -3
  258. package/lib/esm/internal/app-binder/EthAppBinder.test.js +1 -1
  259. package/lib/esm/internal/app-binder/EthAppBinder.test.js.map +3 -3
  260. package/lib/esm/internal/app-binder/command/GetAddressCommand.js +1 -1
  261. package/lib/esm/internal/app-binder/command/GetAddressCommand.js.map +2 -2
  262. package/lib/esm/internal/app-binder/command/GetAddressCommand.test.js +1 -1
  263. package/lib/esm/internal/app-binder/command/GetAddressCommand.test.js.map +2 -2
  264. package/lib/esm/internal/app-binder/command/GetAppConfigurationCommand.js +1 -1
  265. package/lib/esm/internal/app-binder/command/GetAppConfigurationCommand.js.map +2 -2
  266. package/lib/esm/internal/app-binder/command/GetAppConfigurationCommand.test.js +1 -1
  267. package/lib/esm/internal/app-binder/command/GetAppConfigurationCommand.test.js.map +2 -2
  268. package/lib/esm/internal/app-binder/command/GetChallengeCommand.js +1 -1
  269. package/lib/esm/internal/app-binder/command/GetChallengeCommand.js.map +2 -2
  270. package/lib/esm/internal/app-binder/command/GetChallengeCommand.test.js +1 -1
  271. package/lib/esm/internal/app-binder/command/GetChallengeCommand.test.js.map +2 -2
  272. package/lib/esm/internal/app-binder/command/ProvideEnumCommand.js +1 -1
  273. package/lib/esm/internal/app-binder/command/ProvideEnumCommand.js.map +2 -2
  274. package/lib/esm/internal/app-binder/command/ProvideEnumCommand.test.js +1 -1
  275. package/lib/esm/internal/app-binder/command/ProvideEnumCommand.test.js.map +3 -3
  276. package/lib/esm/internal/app-binder/command/ProvideNFTInformationCommand.js +1 -1
  277. package/lib/esm/internal/app-binder/command/ProvideNFTInformationCommand.js.map +2 -2
  278. package/lib/esm/internal/app-binder/command/ProvideNFTInformationCommand.test.js +1 -1
  279. package/lib/esm/internal/app-binder/command/ProvideNFTInformationCommand.test.js.map +3 -3
  280. package/lib/esm/internal/app-binder/command/ProvideNetworkConfigurationCommand.js +2 -0
  281. package/lib/esm/internal/app-binder/command/ProvideNetworkConfigurationCommand.js.map +7 -0
  282. package/lib/esm/internal/app-binder/command/ProvideNetworkConfigurationCommand.test.js +2 -0
  283. package/lib/esm/internal/app-binder/command/ProvideNetworkConfigurationCommand.test.js.map +7 -0
  284. package/lib/esm/internal/app-binder/command/ProvideProxyInfoCommand.js +2 -0
  285. package/lib/esm/internal/app-binder/command/ProvideProxyInfoCommand.js.map +7 -0
  286. package/lib/esm/internal/app-binder/command/ProvideProxyInfoCommand.test.js +2 -0
  287. package/lib/esm/internal/app-binder/command/ProvideProxyInfoCommand.test.js.map +7 -0
  288. package/lib/esm/internal/app-binder/command/ProvideSafeAccountCommand.js +2 -0
  289. package/lib/esm/internal/app-binder/command/ProvideSafeAccountCommand.js.map +7 -0
  290. package/lib/esm/internal/app-binder/command/ProvideSafeAccountCommand.test.js +2 -0
  291. package/lib/esm/internal/app-binder/command/ProvideSafeAccountCommand.test.js.map +7 -0
  292. package/lib/esm/internal/app-binder/command/ProvideTokenInformationCommand.js +1 -1
  293. package/lib/esm/internal/app-binder/command/ProvideTokenInformationCommand.js.map +2 -2
  294. package/lib/esm/internal/app-binder/command/ProvideTokenInformationCommand.test.js +1 -1
  295. package/lib/esm/internal/app-binder/command/ProvideTokenInformationCommand.test.js.map +2 -2
  296. package/lib/esm/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.js +1 -1
  297. package/lib/esm/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.js.map +2 -2
  298. package/lib/esm/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.test.js +1 -1
  299. package/lib/esm/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.test.js.map +3 -3
  300. package/lib/esm/internal/app-binder/command/ProvideTransactionInformationCommand.js +1 -1
  301. package/lib/esm/internal/app-binder/command/ProvideTransactionInformationCommand.js.map +2 -2
  302. package/lib/esm/internal/app-binder/command/ProvideTransactionInformationCommand.test.js +1 -1
  303. package/lib/esm/internal/app-binder/command/ProvideTransactionInformationCommand.test.js.map +3 -3
  304. package/lib/esm/internal/app-binder/command/ProvideTrustedNameCommand.js +1 -1
  305. package/lib/esm/internal/app-binder/command/ProvideTrustedNameCommand.js.map +2 -2
  306. package/lib/esm/internal/app-binder/command/ProvideTrustedNameCommand.test.js +1 -1
  307. package/lib/esm/internal/app-binder/command/ProvideTrustedNameCommand.test.js.map +3 -3
  308. package/lib/esm/internal/app-binder/command/ProvideWeb3CheckCommand.js +1 -1
  309. package/lib/esm/internal/app-binder/command/ProvideWeb3CheckCommand.js.map +2 -2
  310. package/lib/esm/internal/app-binder/command/ProvideWeb3CheckCommand.test.js +1 -1
  311. package/lib/esm/internal/app-binder/command/ProvideWeb3CheckCommand.test.js.map +3 -3
  312. package/lib/esm/internal/app-binder/command/SendEIP712FilteringCommand.js +1 -1
  313. package/lib/esm/internal/app-binder/command/SendEIP712FilteringCommand.js.map +3 -3
  314. package/lib/esm/internal/app-binder/command/SendEIP712FilteringCommand.test.js +1 -1
  315. package/lib/esm/internal/app-binder/command/SendEIP712FilteringCommand.test.js.map +3 -3
  316. package/lib/esm/internal/app-binder/command/SendEIP712StructDefinitionCommand.js +1 -1
  317. package/lib/esm/internal/app-binder/command/SendEIP712StructDefinitionCommand.js.map +2 -2
  318. package/lib/esm/internal/app-binder/command/SendEIP712StructDefinitionCommand.test.js +1 -1
  319. package/lib/esm/internal/app-binder/command/SendEIP712StructDefinitionCommand.test.js.map +3 -3
  320. package/lib/esm/internal/app-binder/command/SendEIP712StructImplemCommand.js +1 -1
  321. package/lib/esm/internal/app-binder/command/SendEIP712StructImplemCommand.js.map +2 -2
  322. package/lib/esm/internal/app-binder/command/SendEIP712StructImplemCommand.test.js +1 -1
  323. package/lib/esm/internal/app-binder/command/SendEIP712StructImplemCommand.test.js.map +3 -3
  324. package/lib/esm/internal/app-binder/command/SetExternalPluginCommand.js +1 -1
  325. package/lib/esm/internal/app-binder/command/SetExternalPluginCommand.js.map +2 -2
  326. package/lib/esm/internal/app-binder/command/SetExternalPluginCommand.test.js +2 -2
  327. package/lib/esm/internal/app-binder/command/SetExternalPluginCommand.test.js.map +3 -3
  328. package/lib/esm/internal/app-binder/command/SetPluginCommand.js +1 -1
  329. package/lib/esm/internal/app-binder/command/SetPluginCommand.js.map +2 -2
  330. package/lib/esm/internal/app-binder/command/SetPluginCommand.test.js +2 -2
  331. package/lib/esm/internal/app-binder/command/SetPluginCommand.test.js.map +3 -3
  332. package/lib/esm/internal/app-binder/command/SignAuthorizationDelegationCommand.js +2 -0
  333. package/lib/esm/internal/app-binder/command/SignAuthorizationDelegationCommand.js.map +7 -0
  334. package/lib/esm/internal/app-binder/command/SignAuthorizationDelegationCommand.test.js +2 -0
  335. package/lib/esm/internal/app-binder/command/SignAuthorizationDelegationCommand.test.js.map +7 -0
  336. package/lib/esm/internal/app-binder/command/SignEIP712Command.js +1 -1
  337. package/lib/esm/internal/app-binder/command/SignEIP712Command.js.map +2 -2
  338. package/lib/esm/internal/app-binder/command/SignEIP712Command.test.js +1 -1
  339. package/lib/esm/internal/app-binder/command/SignEIP712Command.test.js.map +2 -2
  340. package/lib/esm/internal/app-binder/command/SignPersonalMessageCommand.js +1 -1
  341. package/lib/esm/internal/app-binder/command/SignPersonalMessageCommand.js.map +2 -2
  342. package/lib/esm/internal/app-binder/command/SignPersonalMessageCommand.test.js +1 -1
  343. package/lib/esm/internal/app-binder/command/SignPersonalMessageCommand.test.js.map +3 -3
  344. package/lib/esm/internal/app-binder/command/SignTransactionCommand.js +1 -1
  345. package/lib/esm/internal/app-binder/command/SignTransactionCommand.js.map +2 -2
  346. package/lib/esm/internal/app-binder/command/SignTransactionCommand.test.js +1 -1
  347. package/lib/esm/internal/app-binder/command/SignTransactionCommand.test.js.map +3 -3
  348. package/lib/esm/internal/app-binder/command/StartTransactionCommand.js +1 -1
  349. package/lib/esm/internal/app-binder/command/StartTransactionCommand.js.map +2 -2
  350. package/lib/esm/internal/app-binder/command/StartTransactionCommand.test.js +1 -1
  351. package/lib/esm/internal/app-binder/command/StartTransactionCommand.test.js.map +3 -3
  352. package/lib/esm/internal/app-binder/command/StoreTransactionCommand.js +1 -1
  353. package/lib/esm/internal/app-binder/command/StoreTransactionCommand.js.map +2 -2
  354. package/lib/esm/internal/app-binder/command/StoreTransactionCommand.test.js +1 -1
  355. package/lib/esm/internal/app-binder/command/StoreTransactionCommand.test.js.map +3 -3
  356. package/lib/esm/internal/app-binder/command/Web3CheckOptInCommand.js +1 -1
  357. package/lib/esm/internal/app-binder/command/Web3CheckOptInCommand.js.map +2 -2
  358. package/lib/esm/internal/app-binder/command/Web3CheckOptInCommand.test.js +1 -1
  359. package/lib/esm/internal/app-binder/command/Web3CheckOptInCommand.test.js.map +3 -3
  360. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js +1 -1
  361. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.js.map +3 -3
  362. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js +1 -1
  363. package/lib/esm/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.test.js.map +3 -3
  364. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js +1 -1
  365. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.js.map +3 -3
  366. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js +1 -1
  367. package/lib/esm/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.test.js.map +3 -3
  368. package/lib/esm/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.js +2 -0
  369. package/lib/esm/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.js.map +7 -0
  370. package/lib/esm/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.test.js +2 -0
  371. package/lib/esm/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.test.js.map +7 -0
  372. package/lib/esm/internal/app-binder/device-action/__test-utils__/makeInternalApi.js +1 -1
  373. package/lib/esm/internal/app-binder/device-action/__test-utils__/makeInternalApi.js.map +3 -3
  374. package/lib/esm/internal/app-binder/device-action/__test-utils__/testDeviceActionUntilStep.js +2 -0
  375. package/lib/esm/internal/app-binder/device-action/__test-utils__/testDeviceActionUntilStep.js.map +7 -0
  376. package/lib/esm/internal/app-binder/task/BuildBaseContexts.js +2 -0
  377. package/lib/esm/internal/app-binder/task/BuildBaseContexts.js.map +7 -0
  378. package/lib/esm/internal/app-binder/task/BuildBaseContexts.test.js +2 -0
  379. package/lib/esm/internal/app-binder/task/BuildBaseContexts.test.js.map +7 -0
  380. package/lib/esm/internal/app-binder/task/BuildEIP712ContextTask.js +1 -1
  381. package/lib/esm/internal/app-binder/task/BuildEIP712ContextTask.js.map +3 -3
  382. package/lib/esm/internal/app-binder/task/BuildEIP712ContextTask.test.js +1 -1
  383. package/lib/esm/internal/app-binder/task/BuildEIP712ContextTask.test.js.map +3 -3
  384. package/lib/esm/internal/app-binder/task/BuildFullContextsTask.js +2 -0
  385. package/lib/esm/internal/app-binder/task/BuildFullContextsTask.js.map +7 -0
  386. package/lib/esm/internal/app-binder/task/BuildFullContextsTask.test.js +2 -0
  387. package/lib/esm/internal/app-binder/task/BuildFullContextsTask.test.js.map +7 -0
  388. package/lib/esm/internal/app-binder/task/BuildSafeAddressContextTask.js +2 -0
  389. package/lib/esm/internal/app-binder/task/BuildSafeAddressContextTask.js.map +7 -0
  390. package/lib/esm/internal/app-binder/task/BuildSafeAddressContextTask.test.js +2 -0
  391. package/lib/esm/internal/app-binder/task/BuildSafeAddressContextTask.test.js.map +7 -0
  392. package/lib/esm/internal/app-binder/task/BuildSubcontextsTask.js +2 -0
  393. package/lib/esm/internal/app-binder/task/BuildSubcontextsTask.js.map +7 -0
  394. package/lib/esm/internal/app-binder/task/BuildSubcontextsTask.test.js +2 -0
  395. package/lib/esm/internal/app-binder/task/BuildSubcontextsTask.test.js.map +7 -0
  396. package/lib/esm/internal/app-binder/task/ParseNestedTransactionTask.js +2 -0
  397. package/lib/esm/internal/app-binder/task/ParseNestedTransactionTask.js.map +7 -0
  398. package/lib/esm/internal/app-binder/task/ParseNestedTransactionTask.test.js +2 -0
  399. package/lib/esm/internal/app-binder/task/ParseNestedTransactionTask.test.js.map +7 -0
  400. package/lib/esm/internal/app-binder/task/ParseTransactionTask.js +2 -0
  401. package/lib/esm/internal/app-binder/task/ParseTransactionTask.js.map +7 -0
  402. package/lib/esm/internal/app-binder/task/ParseTransactionTask.test.js +2 -0
  403. package/lib/esm/internal/app-binder/task/ParseTransactionTask.test.js.map +7 -0
  404. package/lib/esm/internal/app-binder/task/ProvideContextTask.js +2 -0
  405. package/lib/esm/internal/app-binder/task/ProvideContextTask.js.map +7 -0
  406. package/lib/esm/internal/app-binder/task/ProvideContextTask.test.js +2 -0
  407. package/lib/esm/internal/app-binder/task/ProvideContextTask.test.js.map +7 -0
  408. package/lib/esm/internal/app-binder/task/ProvideEIP712ContextTask.js +1 -1
  409. package/lib/esm/internal/app-binder/task/ProvideEIP712ContextTask.js.map +3 -3
  410. package/lib/esm/internal/app-binder/task/ProvideEIP712ContextTask.test.js +1 -1
  411. package/lib/esm/internal/app-binder/task/ProvideEIP712ContextTask.test.js.map +3 -3
  412. package/lib/esm/internal/app-binder/task/ProvideTransactionContextsTask.js +2 -0
  413. package/lib/esm/internal/app-binder/task/ProvideTransactionContextsTask.js.map +7 -0
  414. package/lib/esm/internal/app-binder/task/ProvideTransactionContextsTask.test.js +2 -0
  415. package/lib/esm/internal/app-binder/task/ProvideTransactionContextsTask.test.js.map +7 -0
  416. package/lib/esm/internal/app-binder/task/SendPayloadInChunksTask.js +1 -1
  417. package/lib/esm/internal/app-binder/task/SendPayloadInChunksTask.js.map +3 -3
  418. package/lib/esm/internal/app-binder/task/SendPayloadInChunksTask.test.js +1 -1
  419. package/lib/esm/internal/app-binder/task/SendPayloadInChunksTask.test.js.map +3 -3
  420. package/lib/esm/internal/app-binder/task/SendSignAuthorizationDelegationTask.js +2 -0
  421. package/lib/esm/internal/app-binder/task/SendSignAuthorizationDelegationTask.js.map +7 -0
  422. package/lib/esm/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.js +2 -0
  423. package/lib/esm/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.js.map +7 -0
  424. package/lib/esm/internal/app-binder/task/SendSignTransactionTask.js +1 -1
  425. package/lib/esm/internal/app-binder/task/SendSignTransactionTask.js.map +3 -3
  426. package/lib/esm/internal/app-binder/task/SendSignTransactionTask.test.js +1 -1
  427. package/lib/esm/internal/app-binder/task/SendSignTransactionTask.test.js.map +3 -3
  428. package/lib/esm/internal/di.js +1 -1
  429. package/lib/esm/internal/di.js.map +3 -3
  430. package/lib/esm/internal/eip7702/di/eip7702Module.js +2 -0
  431. package/lib/esm/internal/eip7702/di/eip7702Module.js.map +7 -0
  432. package/lib/esm/internal/eip7702/di/eip7702Module.test.js +2 -0
  433. package/lib/esm/internal/eip7702/di/eip7702Module.test.js.map +7 -0
  434. package/lib/esm/internal/eip7702/di/eip7702Types.js +2 -0
  435. package/lib/esm/internal/eip7702/di/eip7702Types.js.map +7 -0
  436. package/lib/esm/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.js +2 -0
  437. package/lib/esm/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.js.map +7 -0
  438. package/lib/esm/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.js +2 -0
  439. package/lib/esm/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.js.map +7 -0
  440. package/lib/esm/internal/safe/di/safeModule.js +2 -0
  441. package/lib/esm/internal/safe/di/safeModule.js.map +7 -0
  442. package/lib/esm/internal/safe/di/safeModule.test.js +2 -0
  443. package/lib/esm/internal/safe/di/safeModule.test.js.map +7 -0
  444. package/lib/esm/internal/safe/di/safeTypes.js +2 -0
  445. package/lib/esm/internal/safe/di/safeTypes.js.map +7 -0
  446. package/lib/esm/internal/safe/use-case/VerifySafeAddressUseCase.js +2 -0
  447. package/lib/esm/internal/safe/use-case/VerifySafeAddressUseCase.js.map +7 -0
  448. package/lib/esm/internal/safe/use-case/VerifySafeAddressUseCase.test.js +2 -0
  449. package/lib/esm/internal/safe/use-case/VerifySafeAddressUseCase.test.js.map +7 -0
  450. package/lib/esm/internal/shared/utils/ApplicationChecker.js +1 -1
  451. package/lib/esm/internal/shared/utils/ApplicationChecker.js.map +3 -3
  452. package/lib/esm/internal/shared/utils/ApplicationChecker.test.js +1 -1
  453. package/lib/esm/internal/shared/utils/ApplicationChecker.test.js.map +2 -2
  454. package/lib/esm/internal/transaction/di/transactionModule.js +1 -1
  455. package/lib/esm/internal/transaction/di/transactionModule.js.map +3 -3
  456. package/lib/esm/internal/transaction/di/transactionModule.test.js +1 -1
  457. package/lib/esm/internal/transaction/di/transactionModule.test.js.map +2 -2
  458. package/lib/esm/internal/transaction/service/mapper/EthersTransactionMapperService.js +2 -0
  459. package/lib/esm/internal/transaction/service/mapper/EthersTransactionMapperService.js.map +7 -0
  460. package/lib/esm/internal/transaction/service/mapper/EthersTransactionMapperService.test.js +2 -0
  461. package/lib/esm/internal/transaction/service/mapper/EthersTransactionMapperService.test.js.map +7 -0
  462. package/lib/esm/internal/transaction/service/mapper/TransactionMapperService.js +0 -1
  463. package/lib/esm/internal/transaction/service/mapper/TransactionMapperService.js.map +4 -4
  464. package/lib/esm/internal/transaction/service/parser/TransactionParserService.js +1 -1
  465. package/lib/esm/internal/transaction/service/parser/TransactionParserService.js.map +3 -3
  466. package/lib/esm/internal/transaction/service/parser/TransactionParserService.test.js +1 -1
  467. package/lib/esm/internal/transaction/service/parser/TransactionParserService.test.js.map +3 -3
  468. package/lib/esm/package.json +1 -1
  469. package/lib/types/api/SignerEth.d.ts +7 -2
  470. package/lib/types/api/SignerEth.d.ts.map +1 -1
  471. package/lib/types/api/app-binder/SignDelegationAuthorizationTypes.d.ts +19 -0
  472. package/lib/types/api/app-binder/SignDelegationAuthorizationTypes.d.ts.map +1 -0
  473. package/lib/types/api/app-binder/SignTransactionDeviceActionTypes.d.ts +12 -11
  474. package/lib/types/api/app-binder/SignTransactionDeviceActionTypes.d.ts.map +1 -1
  475. package/lib/types/api/app-binder/SignTypedDataDeviceActionTypes.d.ts +6 -0
  476. package/lib/types/api/app-binder/SignTypedDataDeviceActionTypes.d.ts.map +1 -1
  477. package/lib/types/api/app-binder/VerifySafeAddressDeviceActionTypes.d.ts +30 -0
  478. package/lib/types/api/app-binder/VerifySafeAddressDeviceActionTypes.d.ts.map +1 -0
  479. package/lib/types/api/index.d.ts +5 -4
  480. package/lib/types/api/index.d.ts.map +1 -1
  481. package/lib/types/api/model/ClearSigningType.d.ts +5 -0
  482. package/lib/types/api/model/ClearSigningType.d.ts.map +1 -0
  483. package/lib/types/api/model/SafeAddressOptions.d.ts +5 -0
  484. package/lib/types/api/model/SafeAddressOptions.d.ts.map +1 -0
  485. package/lib/types/internal/DefaultSignerEth.d.ts +5 -0
  486. package/lib/types/internal/DefaultSignerEth.d.ts.map +1 -1
  487. package/lib/types/internal/app-binder/EthAppBinder.d.ts +14 -1
  488. package/lib/types/internal/app-binder/EthAppBinder.d.ts.map +1 -1
  489. package/lib/types/internal/app-binder/command/GetAddressCommand.d.ts +1 -0
  490. package/lib/types/internal/app-binder/command/GetAddressCommand.d.ts.map +1 -1
  491. package/lib/types/internal/app-binder/command/GetAppConfigurationCommand.d.ts +1 -0
  492. package/lib/types/internal/app-binder/command/GetAppConfigurationCommand.d.ts.map +1 -1
  493. package/lib/types/internal/app-binder/command/GetChallengeCommand.d.ts +1 -0
  494. package/lib/types/internal/app-binder/command/GetChallengeCommand.d.ts.map +1 -1
  495. package/lib/types/internal/app-binder/command/ProvideEnumCommand.d.ts +1 -0
  496. package/lib/types/internal/app-binder/command/ProvideEnumCommand.d.ts.map +1 -1
  497. package/lib/types/internal/app-binder/command/ProvideNFTInformationCommand.d.ts +1 -0
  498. package/lib/types/internal/app-binder/command/ProvideNFTInformationCommand.d.ts.map +1 -1
  499. package/lib/types/internal/app-binder/command/ProvideNetworkConfigurationCommand.d.ts +29 -0
  500. package/lib/types/internal/app-binder/command/ProvideNetworkConfigurationCommand.d.ts.map +1 -0
  501. package/lib/types/internal/app-binder/command/ProvideNetworkConfigurationCommand.test.d.ts +2 -0
  502. package/lib/types/internal/app-binder/command/ProvideNetworkConfigurationCommand.test.d.ts.map +1 -0
  503. package/lib/types/internal/app-binder/command/ProvideProxyInfoCommand.d.ts +21 -0
  504. package/lib/types/internal/app-binder/command/ProvideProxyInfoCommand.d.ts.map +1 -0
  505. package/lib/types/internal/app-binder/command/ProvideProxyInfoCommand.test.d.ts +2 -0
  506. package/lib/types/internal/app-binder/command/ProvideProxyInfoCommand.test.d.ts.map +1 -0
  507. package/lib/types/internal/app-binder/command/ProvideSafeAccountCommand.d.ts +35 -0
  508. package/lib/types/internal/app-binder/command/ProvideSafeAccountCommand.d.ts.map +1 -0
  509. package/lib/types/internal/app-binder/command/ProvideSafeAccountCommand.test.d.ts +2 -0
  510. package/lib/types/internal/app-binder/command/ProvideSafeAccountCommand.test.d.ts.map +1 -0
  511. package/lib/types/internal/app-binder/command/ProvideTokenInformationCommand.d.ts +1 -0
  512. package/lib/types/internal/app-binder/command/ProvideTokenInformationCommand.d.ts.map +1 -1
  513. package/lib/types/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.d.ts +1 -0
  514. package/lib/types/internal/app-binder/command/ProvideTransactionFieldDescriptionCommand.d.ts.map +1 -1
  515. package/lib/types/internal/app-binder/command/ProvideTransactionInformationCommand.d.ts +1 -0
  516. package/lib/types/internal/app-binder/command/ProvideTransactionInformationCommand.d.ts.map +1 -1
  517. package/lib/types/internal/app-binder/command/ProvideTrustedNameCommand.d.ts +1 -0
  518. package/lib/types/internal/app-binder/command/ProvideTrustedNameCommand.d.ts.map +1 -1
  519. package/lib/types/internal/app-binder/command/ProvideWeb3CheckCommand.d.ts +1 -0
  520. package/lib/types/internal/app-binder/command/ProvideWeb3CheckCommand.d.ts.map +1 -1
  521. package/lib/types/internal/app-binder/command/SendEIP712FilteringCommand.d.ts +30 -1
  522. package/lib/types/internal/app-binder/command/SendEIP712FilteringCommand.d.ts.map +1 -1
  523. package/lib/types/internal/app-binder/command/SendEIP712StructDefinitionCommand.d.ts +1 -0
  524. package/lib/types/internal/app-binder/command/SendEIP712StructDefinitionCommand.d.ts.map +1 -1
  525. package/lib/types/internal/app-binder/command/SendEIP712StructImplemCommand.d.ts +1 -0
  526. package/lib/types/internal/app-binder/command/SendEIP712StructImplemCommand.d.ts.map +1 -1
  527. package/lib/types/internal/app-binder/command/SetExternalPluginCommand.d.ts +1 -0
  528. package/lib/types/internal/app-binder/command/SetExternalPluginCommand.d.ts.map +1 -1
  529. package/lib/types/internal/app-binder/command/SetPluginCommand.d.ts +1 -0
  530. package/lib/types/internal/app-binder/command/SetPluginCommand.d.ts.map +1 -1
  531. package/lib/types/internal/app-binder/command/SignAuthorizationDelegationCommand.d.ts +30 -0
  532. package/lib/types/internal/app-binder/command/SignAuthorizationDelegationCommand.d.ts.map +1 -0
  533. package/lib/types/internal/app-binder/command/SignAuthorizationDelegationCommand.test.d.ts +2 -0
  534. package/lib/types/internal/app-binder/command/SignAuthorizationDelegationCommand.test.d.ts.map +1 -0
  535. package/lib/types/internal/app-binder/command/SignEIP712Command.d.ts +1 -0
  536. package/lib/types/internal/app-binder/command/SignEIP712Command.d.ts.map +1 -1
  537. package/lib/types/internal/app-binder/command/SignPersonalMessageCommand.d.ts +1 -0
  538. package/lib/types/internal/app-binder/command/SignPersonalMessageCommand.d.ts.map +1 -1
  539. package/lib/types/internal/app-binder/command/SignTransactionCommand.d.ts +1 -0
  540. package/lib/types/internal/app-binder/command/SignTransactionCommand.d.ts.map +1 -1
  541. package/lib/types/internal/app-binder/command/StartTransactionCommand.d.ts +1 -0
  542. package/lib/types/internal/app-binder/command/StartTransactionCommand.d.ts.map +1 -1
  543. package/lib/types/internal/app-binder/command/StoreTransactionCommand.d.ts +1 -0
  544. package/lib/types/internal/app-binder/command/StoreTransactionCommand.d.ts.map +1 -1
  545. package/lib/types/internal/app-binder/command/Web3CheckOptInCommand.d.ts +1 -0
  546. package/lib/types/internal/app-binder/command/Web3CheckOptInCommand.d.ts.map +1 -1
  547. package/lib/types/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.d.ts +19 -36
  548. package/lib/types/internal/app-binder/device-action/SignTransaction/SignTransactionDeviceAction.d.ts.map +1 -1
  549. package/lib/types/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.d.ts +9 -0
  550. package/lib/types/internal/app-binder/device-action/SignTypedData/SignTypedDataDeviceAction.d.ts.map +1 -1
  551. package/lib/types/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.d.ts +20 -0
  552. package/lib/types/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.d.ts.map +1 -0
  553. package/lib/types/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.test.d.ts +2 -0
  554. package/lib/types/internal/app-binder/device-action/VerifySafeAddress/VerifySafeAddress.test.d.ts.map +1 -0
  555. package/lib/types/internal/app-binder/device-action/__test-utils__/makeInternalApi.d.ts.map +1 -1
  556. package/lib/types/internal/app-binder/device-action/__test-utils__/testDeviceActionUntilStep.d.ts +6 -0
  557. package/lib/types/internal/app-binder/device-action/__test-utils__/testDeviceActionUntilStep.d.ts.map +1 -0
  558. package/lib/types/internal/app-binder/task/BuildBaseContexts.d.ts +47 -0
  559. package/lib/types/internal/app-binder/task/BuildBaseContexts.d.ts.map +1 -0
  560. package/lib/types/internal/app-binder/task/BuildBaseContexts.test.d.ts +2 -0
  561. package/lib/types/internal/app-binder/task/BuildBaseContexts.test.d.ts.map +1 -0
  562. package/lib/types/internal/app-binder/task/BuildEIP712ContextTask.d.ts +10 -3
  563. package/lib/types/internal/app-binder/task/BuildEIP712ContextTask.d.ts.map +1 -1
  564. package/lib/types/internal/app-binder/task/BuildFullContextsTask.d.ts +39 -0
  565. package/lib/types/internal/app-binder/task/BuildFullContextsTask.d.ts.map +1 -0
  566. package/lib/types/internal/app-binder/task/BuildFullContextsTask.test.d.ts +2 -0
  567. package/lib/types/internal/app-binder/task/BuildFullContextsTask.test.d.ts.map +1 -0
  568. package/lib/types/internal/app-binder/task/BuildSafeAddressContextTask.d.ts +19 -0
  569. package/lib/types/internal/app-binder/task/BuildSafeAddressContextTask.d.ts.map +1 -0
  570. package/lib/types/internal/app-binder/task/BuildSafeAddressContextTask.test.d.ts +2 -0
  571. package/lib/types/internal/app-binder/task/BuildSafeAddressContextTask.test.d.ts.map +1 -0
  572. package/lib/types/internal/app-binder/task/BuildSubcontextsTask.d.ts +28 -0
  573. package/lib/types/internal/app-binder/task/BuildSubcontextsTask.d.ts.map +1 -0
  574. package/lib/types/internal/app-binder/task/BuildSubcontextsTask.test.d.ts +2 -0
  575. package/lib/types/internal/app-binder/task/BuildSubcontextsTask.test.d.ts.map +1 -0
  576. package/lib/types/internal/app-binder/task/ParseNestedTransactionTask.d.ts +21 -0
  577. package/lib/types/internal/app-binder/task/ParseNestedTransactionTask.d.ts.map +1 -0
  578. package/lib/types/internal/app-binder/task/ParseNestedTransactionTask.test.d.ts +2 -0
  579. package/lib/types/internal/app-binder/task/ParseNestedTransactionTask.test.d.ts.map +1 -0
  580. package/lib/types/internal/app-binder/task/ParseTransactionTask.d.ts +17 -0
  581. package/lib/types/internal/app-binder/task/ParseTransactionTask.d.ts.map +1 -0
  582. package/lib/types/internal/app-binder/task/ParseTransactionTask.test.d.ts +2 -0
  583. package/lib/types/internal/app-binder/task/ParseTransactionTask.test.d.ts.map +1 -0
  584. package/lib/types/internal/app-binder/task/ProvideContextTask.d.ts +22 -0
  585. package/lib/types/internal/app-binder/task/ProvideContextTask.d.ts.map +1 -0
  586. package/lib/types/internal/app-binder/task/ProvideContextTask.test.d.ts +2 -0
  587. package/lib/types/internal/app-binder/task/ProvideContextTask.test.d.ts.map +1 -0
  588. package/lib/types/internal/app-binder/task/ProvideEIP712ContextTask.d.ts +16 -5
  589. package/lib/types/internal/app-binder/task/ProvideEIP712ContextTask.d.ts.map +1 -1
  590. package/lib/types/internal/app-binder/task/ProvideTransactionContextsTask.d.ts +36 -0
  591. package/lib/types/internal/app-binder/task/ProvideTransactionContextsTask.d.ts.map +1 -0
  592. package/lib/types/internal/app-binder/task/ProvideTransactionContextsTask.test.d.ts +2 -0
  593. package/lib/types/internal/app-binder/task/ProvideTransactionContextsTask.test.d.ts.map +1 -0
  594. package/lib/types/internal/app-binder/task/SendPayloadInChunksTask.d.ts +2 -2
  595. package/lib/types/internal/app-binder/task/SendPayloadInChunksTask.d.ts.map +1 -1
  596. package/lib/types/internal/app-binder/task/SendSignAuthorizationDelegationTask.d.ts +18 -0
  597. package/lib/types/internal/app-binder/task/SendSignAuthorizationDelegationTask.d.ts.map +1 -0
  598. package/lib/types/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.d.ts +2 -0
  599. package/lib/types/internal/app-binder/task/SendSignAuthorizationDelegationTask.test.d.ts.map +1 -0
  600. package/lib/types/internal/app-binder/task/SendSignTransactionTask.d.ts +2 -1
  601. package/lib/types/internal/app-binder/task/SendSignTransactionTask.d.ts.map +1 -1
  602. package/lib/types/internal/di.d.ts.map +1 -1
  603. package/lib/types/internal/eip7702/di/eip7702Module.d.ts +3 -0
  604. package/lib/types/internal/eip7702/di/eip7702Module.d.ts.map +1 -0
  605. package/lib/types/internal/eip7702/di/eip7702Module.test.d.ts +2 -0
  606. package/lib/types/internal/eip7702/di/eip7702Module.test.d.ts.map +1 -0
  607. package/lib/types/internal/eip7702/di/eip7702Types.d.ts +4 -0
  608. package/lib/types/internal/eip7702/di/eip7702Types.d.ts.map +1 -0
  609. package/lib/types/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.d.ts +8 -0
  610. package/lib/types/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.d.ts.map +1 -0
  611. package/lib/types/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.d.ts +2 -0
  612. package/lib/types/internal/eip7702/use-case/SignDelegationAuthorizationUseCase.test.d.ts.map +1 -0
  613. package/lib/types/internal/safe/di/safeModule.d.ts +3 -0
  614. package/lib/types/internal/safe/di/safeModule.d.ts.map +1 -0
  615. package/lib/types/internal/safe/di/safeModule.test.d.ts +2 -0
  616. package/lib/types/internal/safe/di/safeModule.test.d.ts.map +1 -0
  617. package/lib/types/internal/safe/di/safeTypes.d.ts +4 -0
  618. package/lib/types/internal/safe/di/safeTypes.d.ts.map +1 -0
  619. package/lib/types/internal/safe/use-case/VerifySafeAddressUseCase.d.ts +9 -0
  620. package/lib/types/internal/safe/use-case/VerifySafeAddressUseCase.d.ts.map +1 -0
  621. package/lib/types/internal/safe/use-case/VerifySafeAddressUseCase.test.d.ts +2 -0
  622. package/lib/types/internal/safe/use-case/VerifySafeAddressUseCase.test.d.ts.map +1 -0
  623. package/lib/types/internal/shared/utils/ApplicationChecker.d.ts.map +1 -1
  624. package/lib/types/internal/transaction/di/transactionModule.d.ts.map +1 -1
  625. package/lib/types/internal/transaction/service/mapper/EthersTransactionMapperService.d.ts +8 -0
  626. package/lib/types/internal/transaction/service/mapper/EthersTransactionMapperService.d.ts.map +1 -0
  627. package/lib/types/internal/transaction/service/mapper/EthersTransactionMapperService.test.d.ts +2 -0
  628. package/lib/types/internal/transaction/service/mapper/EthersTransactionMapperService.test.d.ts.map +1 -0
  629. package/lib/types/internal/transaction/service/mapper/TransactionMapperService.d.ts +4 -7
  630. package/lib/types/internal/transaction/service/mapper/TransactionMapperService.d.ts.map +1 -1
  631. package/lib/types/internal/transaction/service/parser/TransactionParserService.d.ts +2 -2
  632. package/lib/types/internal/transaction/service/parser/TransactionParserService.d.ts.map +1 -1
  633. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  634. package/package.json +9 -9
  635. package/lib/cjs/internal/app-binder/constant/plugins.js +0 -2
  636. package/lib/cjs/internal/app-binder/constant/plugins.js.map +0 -7
  637. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.js +0 -2
  638. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.js.map +0 -7
  639. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.test.js +0 -2
  640. package/lib/cjs/internal/app-binder/task/BuildTransactionContextTask.test.js.map +0 -7
  641. package/lib/cjs/internal/app-binder/task/GetWeb3CheckTask.js +0 -2
  642. package/lib/cjs/internal/app-binder/task/GetWeb3CheckTask.js.map +0 -7
  643. package/lib/cjs/internal/app-binder/task/GetWeb3CheckTask.test.js +0 -2
  644. package/lib/cjs/internal/app-binder/task/GetWeb3CheckTask.test.js.map +0 -7
  645. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.js +0 -2
  646. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.js.map +0 -7
  647. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.test.js +0 -2
  648. package/lib/cjs/internal/app-binder/task/ProvideTransactionContextTask.test.js.map +0 -7
  649. package/lib/cjs/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.js +0 -2
  650. package/lib/cjs/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.js.map +0 -7
  651. package/lib/cjs/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.test.js +0 -2
  652. package/lib/cjs/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.test.js.map +0 -7
  653. package/lib/cjs/internal/app-binder/task/ProvideTransactionGenericContextTask.js +0 -2
  654. package/lib/cjs/internal/app-binder/task/ProvideTransactionGenericContextTask.js.map +0 -7
  655. package/lib/cjs/internal/app-binder/task/ProvideTransactionGenericContextTask.test.js +0 -2
  656. package/lib/cjs/internal/app-binder/task/ProvideTransactionGenericContextTask.test.js.map +0 -7
  657. package/lib/cjs/internal/transaction/service/mapper/EthersRawTransactionMapper.js +0 -2
  658. package/lib/cjs/internal/transaction/service/mapper/EthersRawTransactionMapper.js.map +0 -7
  659. package/lib/cjs/internal/transaction/service/mapper/EthersRawTransactionMapper.test.js +0 -2
  660. package/lib/cjs/internal/transaction/service/mapper/EthersRawTransactionMapper.test.js.map +0 -7
  661. package/lib/cjs/internal/transaction/service/mapper/TransactionMapper.js +0 -2
  662. package/lib/cjs/internal/transaction/service/mapper/TransactionMapper.js.map +0 -7
  663. package/lib/cjs/internal/transaction/service/mapper/TransactionMapperService.test.js +0 -2
  664. package/lib/cjs/internal/transaction/service/mapper/TransactionMapperService.test.js.map +0 -7
  665. package/lib/esm/internal/app-binder/constant/plugins.js +0 -2
  666. package/lib/esm/internal/app-binder/constant/plugins.js.map +0 -7
  667. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.js +0 -2
  668. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.js.map +0 -7
  669. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.test.js +0 -2
  670. package/lib/esm/internal/app-binder/task/BuildTransactionContextTask.test.js.map +0 -7
  671. package/lib/esm/internal/app-binder/task/GetWeb3CheckTask.js +0 -2
  672. package/lib/esm/internal/app-binder/task/GetWeb3CheckTask.js.map +0 -7
  673. package/lib/esm/internal/app-binder/task/GetWeb3CheckTask.test.js +0 -2
  674. package/lib/esm/internal/app-binder/task/GetWeb3CheckTask.test.js.map +0 -7
  675. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.js +0 -2
  676. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.js.map +0 -7
  677. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.test.js +0 -2
  678. package/lib/esm/internal/app-binder/task/ProvideTransactionContextTask.test.js.map +0 -7
  679. package/lib/esm/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.js +0 -2
  680. package/lib/esm/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.js.map +0 -7
  681. package/lib/esm/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.test.js +0 -2
  682. package/lib/esm/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.test.js.map +0 -7
  683. package/lib/esm/internal/app-binder/task/ProvideTransactionGenericContextTask.js +0 -2
  684. package/lib/esm/internal/app-binder/task/ProvideTransactionGenericContextTask.js.map +0 -7
  685. package/lib/esm/internal/app-binder/task/ProvideTransactionGenericContextTask.test.js +0 -2
  686. package/lib/esm/internal/app-binder/task/ProvideTransactionGenericContextTask.test.js.map +0 -7
  687. package/lib/esm/internal/transaction/service/mapper/EthersRawTransactionMapper.js +0 -2
  688. package/lib/esm/internal/transaction/service/mapper/EthersRawTransactionMapper.js.map +0 -7
  689. package/lib/esm/internal/transaction/service/mapper/EthersRawTransactionMapper.test.js +0 -2
  690. package/lib/esm/internal/transaction/service/mapper/EthersRawTransactionMapper.test.js.map +0 -7
  691. package/lib/esm/internal/transaction/service/mapper/TransactionMapper.js +0 -1
  692. package/lib/esm/internal/transaction/service/mapper/TransactionMapperService.test.js +0 -2
  693. package/lib/esm/internal/transaction/service/mapper/TransactionMapperService.test.js.map +0 -7
  694. package/lib/types/internal/app-binder/constant/plugins.d.ts +0 -2
  695. package/lib/types/internal/app-binder/constant/plugins.d.ts.map +0 -1
  696. package/lib/types/internal/app-binder/task/BuildTransactionContextTask.d.ts +0 -32
  697. package/lib/types/internal/app-binder/task/BuildTransactionContextTask.d.ts.map +0 -1
  698. package/lib/types/internal/app-binder/task/BuildTransactionContextTask.test.d.ts +0 -2
  699. package/lib/types/internal/app-binder/task/BuildTransactionContextTask.test.d.ts.map +0 -1
  700. package/lib/types/internal/app-binder/task/GetWeb3CheckTask.d.ts +0 -30
  701. package/lib/types/internal/app-binder/task/GetWeb3CheckTask.d.ts.map +0 -1
  702. package/lib/types/internal/app-binder/task/GetWeb3CheckTask.test.d.ts +0 -2
  703. package/lib/types/internal/app-binder/task/GetWeb3CheckTask.test.d.ts.map +0 -1
  704. package/lib/types/internal/app-binder/task/ProvideTransactionContextTask.d.ts +0 -38
  705. package/lib/types/internal/app-binder/task/ProvideTransactionContextTask.d.ts.map +0 -1
  706. package/lib/types/internal/app-binder/task/ProvideTransactionContextTask.test.d.ts +0 -2
  707. package/lib/types/internal/app-binder/task/ProvideTransactionContextTask.test.d.ts.map +0 -1
  708. package/lib/types/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.d.ts +0 -80
  709. package/lib/types/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.d.ts.map +0 -1
  710. package/lib/types/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.test.d.ts +0 -2
  711. package/lib/types/internal/app-binder/task/ProvideTransactionFieldDescriptionTask.test.d.ts.map +0 -1
  712. package/lib/types/internal/app-binder/task/ProvideTransactionGenericContextTask.d.ts +0 -28
  713. package/lib/types/internal/app-binder/task/ProvideTransactionGenericContextTask.d.ts.map +0 -1
  714. package/lib/types/internal/app-binder/task/ProvideTransactionGenericContextTask.test.d.ts +0 -2
  715. package/lib/types/internal/app-binder/task/ProvideTransactionGenericContextTask.test.d.ts.map +0 -1
  716. package/lib/types/internal/transaction/service/mapper/EthersRawTransactionMapper.d.ts +0 -7
  717. package/lib/types/internal/transaction/service/mapper/EthersRawTransactionMapper.d.ts.map +0 -1
  718. package/lib/types/internal/transaction/service/mapper/EthersRawTransactionMapper.test.d.ts +0 -2
  719. package/lib/types/internal/transaction/service/mapper/EthersRawTransactionMapper.test.d.ts.map +0 -1
  720. package/lib/types/internal/transaction/service/mapper/TransactionMapper.d.ts +0 -6
  721. package/lib/types/internal/transaction/service/mapper/TransactionMapper.d.ts.map +0 -1
  722. package/lib/types/internal/transaction/service/mapper/TransactionMapperService.test.d.ts +0 -2
  723. package/lib/types/internal/transaction/service/mapper/TransactionMapperService.test.d.ts.map +0 -1
  724. /package/lib/esm/{internal/transaction/service/mapper/TransactionMapper.js.map → api/app-binder/SignDelegationAuthorizationTypes.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/ProvideWeb3CheckCommand.ts"],
4
- "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"@internal/app-binder/command/utils/ethAppErrors\";\n\nexport type ProvideWeb3CheckCommandArgs = {\n readonly payload: Uint8Array;\n readonly isFirstChunk: boolean;\n};\n\n/**\n * The command that provides a chunk of the trusted name to the device.\n */\nexport class ProvideWeb3CheckCommand\n implements Command<void, ProvideWeb3CheckCommandArgs, EthErrorCodes>\n{\n private readonly errorHelper = new CommandErrorHelper<void, EthErrorCodes>(\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n );\n\n constructor(private readonly args: ProvideWeb3CheckCommandArgs) {}\n\n getApdu(): Apdu {\n const apduBuilderArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x32,\n p1: 0x00,\n p2: this.args.isFirstChunk ? 0x01 : 0x00,\n };\n\n return new ApduBuilder(apduBuilderArgs)\n .addBufferToData(this.args.payload)\n .build();\n }\n\n parseResponse(response: ApduResponse): CommandResult<void, EthErrorCodes> {\n return Maybe.fromNullable(this.errorHelper.getError(response)).orDefault(\n CommandResultFactory({ data: undefined }),\n );\n }\n}\n"],
5
- "mappings": "AAAA,OAEE,eAAAA,EAKA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,SAAAC,MAAa,YAEtB,OACE,kBAAAC,EACA,6BAAAC,MAEK,kDAUA,MAAMC,CAEb,CAME,YAA6BC,EAAmC,CAAnC,UAAAA,CAAoC,CALhD,YAAc,IAAIL,EACjCE,EACAC,CACF,EAIA,SAAgB,CACd,MAAMG,EAAmC,CACvC,IAAK,IACL,IAAK,GACL,GAAI,EACJ,GAAI,KAAK,KAAK,aAAe,EAAO,CACtC,EAEA,OAAO,IAAIR,EAAYQ,CAAe,EACnC,gBAAgB,KAAK,KAAK,OAAO,EACjC,MAAM,CACX,CAEA,cAAcC,EAA4D,CACxE,OAAON,EAAM,aAAa,KAAK,YAAY,SAASM,CAAQ,CAAC,EAAE,UAC7DR,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CACF",
4
+ "sourcesContent": ["import {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"@internal/app-binder/command/utils/ethAppErrors\";\n\nexport type ProvideWeb3CheckCommandArgs = {\n readonly payload: Uint8Array;\n readonly isFirstChunk: boolean;\n};\n\n/**\n * The command that provides a chunk of the trusted name to the device.\n */\nexport class ProvideWeb3CheckCommand\n implements Command<void, ProvideWeb3CheckCommandArgs, EthErrorCodes>\n{\n readonly name = \"provideWeb3Check\";\n private readonly errorHelper = new CommandErrorHelper<void, EthErrorCodes>(\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n );\n\n constructor(private readonly args: ProvideWeb3CheckCommandArgs) {}\n\n getApdu(): Apdu {\n const apduBuilderArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x32,\n p1: 0x00,\n p2: this.args.isFirstChunk ? 0x01 : 0x00,\n };\n\n return new ApduBuilder(apduBuilderArgs)\n .addBufferToData(this.args.payload)\n .build();\n }\n\n parseResponse(response: ApduResponse): CommandResult<void, EthErrorCodes> {\n return Maybe.fromNullable(this.errorHelper.getError(response)).orDefault(\n CommandResultFactory({ data: undefined }),\n );\n }\n}\n"],
5
+ "mappings": "AAAA,OAEE,eAAAA,EAKA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,SAAAC,MAAa,YAEtB,OACE,kBAAAC,EACA,6BAAAC,MAEK,kDAUA,MAAMC,CAEb,CAOE,YAA6BC,EAAmC,CAAnC,UAAAA,CAAoC,CANxD,KAAO,mBACC,YAAc,IAAIL,EACjCE,EACAC,CACF,EAIA,SAAgB,CACd,MAAMG,EAAmC,CACvC,IAAK,IACL,IAAK,GACL,GAAI,EACJ,GAAI,KAAK,KAAK,aAAe,EAAO,CACtC,EAEA,OAAO,IAAIR,EAAYQ,CAAe,EACnC,gBAAgB,KAAK,KAAK,OAAO,EACjC,MAAM,CACX,CAEA,cAAcC,EAA4D,CACxE,OAAON,EAAM,aAAa,KAAK,YAAY,SAASM,CAAQ,CAAC,EAAE,UAC7DR,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CACF",
6
6
  "names": ["ApduBuilder", "CommandResultFactory", "CommandErrorHelper", "Maybe", "ETH_APP_ERRORS", "EthAppCommandErrorFactory", "ProvideWeb3CheckCommand", "args", "apduBuilderArgs", "response"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{hexaStringToBuffer as s,isSuccessCommandResult as o}from"@ledgerhq/device-management-kit";import{ProvideWeb3CheckCommand as a}from"../../app-binder/command/ProvideWeb3CheckCommand";describe("ProvideWeb3CheckCommand",()=>{describe("getApdu",()=>{it("should return the raw APDU",()=>{const r={payload:s("0x010203"),isFirstChunk:!0},e=new a(r).getApdu();expect(e.getRawApdu()).toStrictEqual(Uint8Array.from([224,50,0,1,3,1,2,3]))}),it("should return the raw APDU for next chunk",()=>{const r={payload:s("0x010203"),isFirstChunk:!1},e=new a(r).getApdu();expect(e.getRawApdu()).toStrictEqual(Uint8Array.from([224,50,0,0,3,1,2,3]))})}),describe("parseResponse",()=>{it("should return undefined",()=>{const r={payload:s("0x010203"),isFirstChunk:!0},t={statusCode:Uint8Array.from([144,0]),data:new Uint8Array([])},e=new a(r).parseResponse(t);o(e)?expect(e.data).toBeUndefined():assert.fail("Expected a success")}),it("should return an error if the device is locked",()=>{const r={payload:s("0x010203"),isFirstChunk:!0},t={statusCode:Uint8Array.from([85,21]),data:new Uint8Array},e=new a(r).parseResponse(t);o(e)?assert.fail("Expected an error"):expect(e.error).toEqual(expect.objectContaining({errorCode:"5515",message:"Device is locked."}))}),it("should return an error if data is invalid",()=>{const r={payload:s("0x010203"),isFirstChunk:!0},t={statusCode:Uint8Array.from([106,128]),data:new Uint8Array},e=new a(r).parseResponse(t);o(e)?assert.fail("Expected an error"):expect(e.error).toEqual(expect.objectContaining({errorCode:"6a80",message:"Invalid data"}))})})});
1
+ import{hexaStringToBuffer as a,isSuccessCommandResult as o}from"@ledgerhq/device-management-kit";import{ProvideWeb3CheckCommand as s}from"../../app-binder/command/ProvideWeb3CheckCommand";describe("ProvideWeb3CheckCommand",()=>{describe("name",()=>{it("should be 'provideWeb3Check'",()=>{const r=new s({payload:new Uint8Array,isFirstChunk:!0});expect(r.name).toBe("provideWeb3Check")})}),describe("getApdu",()=>{it("should return the raw APDU",()=>{const r={payload:a("0x010203"),isFirstChunk:!0},e=new s(r).getApdu();expect(e.getRawApdu()).toStrictEqual(Uint8Array.from([224,50,0,1,3,1,2,3]))}),it("should return the raw APDU for next chunk",()=>{const r={payload:a("0x010203"),isFirstChunk:!1},e=new s(r).getApdu();expect(e.getRawApdu()).toStrictEqual(Uint8Array.from([224,50,0,0,3,1,2,3]))})}),describe("parseResponse",()=>{it("should return undefined",()=>{const r={payload:a("0x010203"),isFirstChunk:!0},t={statusCode:Uint8Array.from([144,0]),data:new Uint8Array([])},e=new s(r).parseResponse(t);o(e)?expect(e.data).toBeUndefined():assert.fail("Expected a success")}),it("should return an error if the device is locked",()=>{const r={payload:a("0x010203"),isFirstChunk:!0},t={statusCode:Uint8Array.from([85,21]),data:new Uint8Array},e=new s(r).parseResponse(t);o(e)?assert.fail("Expected an error"):expect(e.error).toEqual(expect.objectContaining({errorCode:"5515",message:"Device is locked."}))}),it("should return an error if data is invalid",()=>{const r={payload:a("0x010203"),isFirstChunk:!0},t={statusCode:Uint8Array.from([106,128]),data:new Uint8Array},e=new s(r).parseResponse(t);o(e)?assert.fail("Expected an error"):expect(e.error).toEqual(expect.objectContaining({errorCode:"6a80",message:"Invalid data"}))})})});
2
2
  //# sourceMappingURL=ProvideWeb3CheckCommand.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/ProvideWeb3CheckCommand.test.ts"],
4
- "sourcesContent": ["import {\n hexaStringToBuffer,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { ProvideWeb3CheckCommand } from \"@internal/app-binder/command/ProvideWeb3CheckCommand\";\n\ndescribe(\"ProvideWeb3CheckCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should return the raw APDU\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: true,\n };\n const command = new ProvideWeb3CheckCommand(args);\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n Uint8Array.from([0xe0, 0x32, 0x00, 0x01, 0x03, 0x01, 0x02, 0x03]),\n );\n });\n\n it(\"should return the raw APDU for next chunk\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: false,\n };\n const command = new ProvideWeb3CheckCommand(args);\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n Uint8Array.from([0xe0, 0x32, 0x00, 0x00, 0x03, 0x01, 0x02, 0x03]),\n );\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should return undefined\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: true,\n };\n const response = {\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: new Uint8Array([]),\n };\n\n // WHEN\n const result = new ProvideWeb3CheckCommand(args).parseResponse(response);\n\n // THEN\n if (isSuccessCommandResult(result)) {\n expect(result.data).toBeUndefined();\n } else {\n assert.fail(\"Expected a success\");\n }\n });\n\n it(\"should return an error if the device is locked\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: true,\n };\n const response = {\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: new Uint8Array(),\n };\n\n // WHEN\n const result = new ProvideWeb3CheckCommand(args).parseResponse(response);\n\n // THEN\n if (isSuccessCommandResult(result)) {\n assert.fail(\"Expected an error\");\n } else {\n expect(result.error).toEqual(\n expect.objectContaining({\n errorCode: \"5515\",\n message: \"Device is locked.\",\n }),\n );\n }\n });\n\n it(\"should return an error if data is invalid\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: true,\n };\n const response = {\n statusCode: Uint8Array.from([0x6a, 0x80]),\n data: new Uint8Array(),\n };\n\n // WHEN\n const result = new ProvideWeb3CheckCommand(args).parseResponse(response);\n\n // THEN\n if (isSuccessCommandResult(result)) {\n assert.fail(\"Expected an error\");\n } else {\n expect(result.error).toEqual(\n expect.objectContaining({\n errorCode: \"6a80\",\n message: \"Invalid data\",\n }),\n );\n }\n });\n });\n});\n"],
5
- "mappings": "AAAA,OACE,sBAAAA,EACA,0BAAAC,MACK,kCAEP,OAAS,2BAAAC,MAA+B,uDAExC,SAAS,0BAA2B,IAAM,CACxC,SAAS,UAAW,IAAM,CACxB,GAAG,6BAA8B,IAAM,CAErC,MAAMC,EAAO,CACX,QAASH,EAAmB,UAAU,EACtC,aAAc,EAChB,EAIMI,EAHU,IAAIF,EAAwBC,CAAI,EAG3B,QAAQ,EAG7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cACxB,WAAW,KAAK,CAAC,IAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,CAAI,CAAC,CAClE,CACF,CAAC,EAED,GAAG,4CAA6C,IAAM,CAEpD,MAAMD,EAAO,CACX,QAASH,EAAmB,UAAU,EACtC,aAAc,EAChB,EAIMI,EAHU,IAAIF,EAAwBC,CAAI,EAG3B,QAAQ,EAG7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cACxB,WAAW,KAAK,CAAC,IAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,CAAI,CAAC,CAClE,CACF,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,0BAA2B,IAAM,CAElC,MAAMD,EAAO,CACX,QAASH,EAAmB,UAAU,EACtC,aAAc,EAChB,EACMK,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,EAGMC,EAAS,IAAIJ,EAAwBC,CAAI,EAAE,cAAcE,CAAQ,EAGnEJ,EAAuBK,CAAM,EAC/B,OAAOA,EAAO,IAAI,EAAE,cAAc,EAElC,OAAO,KAAK,oBAAoB,CAEpC,CAAC,EAED,GAAG,iDAAkD,IAAM,CAEzD,MAAMH,EAAO,CACX,QAASH,EAAmB,UAAU,EACtC,aAAc,EAChB,EACMK,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,GAAM,EAAI,CAAC,EACxC,KAAM,IAAI,UACZ,EAGMC,EAAS,IAAIJ,EAAwBC,CAAI,EAAE,cAAcE,CAAQ,EAGnEJ,EAAuBK,CAAM,EAC/B,OAAO,KAAK,mBAAmB,EAE/B,OAAOA,EAAO,KAAK,EAAE,QACnB,OAAO,iBAAiB,CACtB,UAAW,OACX,QAAS,mBACX,CAAC,CACH,CAEJ,CAAC,EAED,GAAG,4CAA6C,IAAM,CAEpD,MAAMH,EAAO,CACX,QAASH,EAAmB,UAAU,EACtC,aAAc,EAChB,EACMK,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,IAAI,UACZ,EAGMC,EAAS,IAAIJ,EAAwBC,CAAI,EAAE,cAAcE,CAAQ,EAGnEJ,EAAuBK,CAAM,EAC/B,OAAO,KAAK,mBAAmB,EAE/B,OAAOA,EAAO,KAAK,EAAE,QACnB,OAAO,iBAAiB,CACtB,UAAW,OACX,QAAS,cACX,CAAC,CACH,CAEJ,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["hexaStringToBuffer", "isSuccessCommandResult", "ProvideWeb3CheckCommand", "args", "apdu", "response", "result"]
4
+ "sourcesContent": ["import {\n hexaStringToBuffer,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { ProvideWeb3CheckCommand } from \"@internal/app-binder/command/ProvideWeb3CheckCommand\";\n\ndescribe(\"ProvideWeb3CheckCommand\", () => {\n describe(\"name\", () => {\n it(\"should be 'provideWeb3Check'\", () => {\n const command = new ProvideWeb3CheckCommand({\n payload: new Uint8Array(),\n isFirstChunk: true,\n });\n expect(command.name).toBe(\"provideWeb3Check\");\n });\n });\n\n describe(\"getApdu\", () => {\n it(\"should return the raw APDU\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: true,\n };\n const command = new ProvideWeb3CheckCommand(args);\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n Uint8Array.from([0xe0, 0x32, 0x00, 0x01, 0x03, 0x01, 0x02, 0x03]),\n );\n });\n\n it(\"should return the raw APDU for next chunk\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: false,\n };\n const command = new ProvideWeb3CheckCommand(args);\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n Uint8Array.from([0xe0, 0x32, 0x00, 0x00, 0x03, 0x01, 0x02, 0x03]),\n );\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should return undefined\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: true,\n };\n const response = {\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: new Uint8Array([]),\n };\n\n // WHEN\n const result = new ProvideWeb3CheckCommand(args).parseResponse(response);\n\n // THEN\n if (isSuccessCommandResult(result)) {\n expect(result.data).toBeUndefined();\n } else {\n assert.fail(\"Expected a success\");\n }\n });\n\n it(\"should return an error if the device is locked\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: true,\n };\n const response = {\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: new Uint8Array(),\n };\n\n // WHEN\n const result = new ProvideWeb3CheckCommand(args).parseResponse(response);\n\n // THEN\n if (isSuccessCommandResult(result)) {\n assert.fail(\"Expected an error\");\n } else {\n expect(result.error).toEqual(\n expect.objectContaining({\n errorCode: \"5515\",\n message: \"Device is locked.\",\n }),\n );\n }\n });\n\n it(\"should return an error if data is invalid\", () => {\n // GIVEN\n const args = {\n payload: hexaStringToBuffer(\"0x010203\")!,\n isFirstChunk: true,\n };\n const response = {\n statusCode: Uint8Array.from([0x6a, 0x80]),\n data: new Uint8Array(),\n };\n\n // WHEN\n const result = new ProvideWeb3CheckCommand(args).parseResponse(response);\n\n // THEN\n if (isSuccessCommandResult(result)) {\n assert.fail(\"Expected an error\");\n } else {\n expect(result.error).toEqual(\n expect.objectContaining({\n errorCode: \"6a80\",\n message: \"Invalid data\",\n }),\n );\n }\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OACE,sBAAAA,EACA,0BAAAC,MACK,kCAEP,OAAS,2BAAAC,MAA+B,uDAExC,SAAS,0BAA2B,IAAM,CACxC,SAAS,OAAQ,IAAM,CACrB,GAAG,+BAAgC,IAAM,CACvC,MAAMC,EAAU,IAAID,EAAwB,CAC1C,QAAS,IAAI,WACb,aAAc,EAChB,CAAC,EACD,OAAOC,EAAQ,IAAI,EAAE,KAAK,kBAAkB,CAC9C,CAAC,CACH,CAAC,EAED,SAAS,UAAW,IAAM,CACxB,GAAG,6BAA8B,IAAM,CAErC,MAAMC,EAAO,CACX,QAASJ,EAAmB,UAAU,EACtC,aAAc,EAChB,EAIMK,EAHU,IAAIH,EAAwBE,CAAI,EAG3B,QAAQ,EAG7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cACxB,WAAW,KAAK,CAAC,IAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,CAAI,CAAC,CAClE,CACF,CAAC,EAED,GAAG,4CAA6C,IAAM,CAEpD,MAAMD,EAAO,CACX,QAASJ,EAAmB,UAAU,EACtC,aAAc,EAChB,EAIMK,EAHU,IAAIH,EAAwBE,CAAI,EAG3B,QAAQ,EAG7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cACxB,WAAW,KAAK,CAAC,IAAM,GAAM,EAAM,EAAM,EAAM,EAAM,EAAM,CAAI,CAAC,CAClE,CACF,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,0BAA2B,IAAM,CAElC,MAAMD,EAAO,CACX,QAASJ,EAAmB,UAAU,EACtC,aAAc,EAChB,EACMM,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,IAAI,WAAW,CAAC,CAAC,CACzB,EAGMC,EAAS,IAAIL,EAAwBE,CAAI,EAAE,cAAcE,CAAQ,EAGnEL,EAAuBM,CAAM,EAC/B,OAAOA,EAAO,IAAI,EAAE,cAAc,EAElC,OAAO,KAAK,oBAAoB,CAEpC,CAAC,EAED,GAAG,iDAAkD,IAAM,CAEzD,MAAMH,EAAO,CACX,QAASJ,EAAmB,UAAU,EACtC,aAAc,EAChB,EACMM,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,GAAM,EAAI,CAAC,EACxC,KAAM,IAAI,UACZ,EAGMC,EAAS,IAAIL,EAAwBE,CAAI,EAAE,cAAcE,CAAQ,EAGnEL,EAAuBM,CAAM,EAC/B,OAAO,KAAK,mBAAmB,EAE/B,OAAOA,EAAO,KAAK,EAAE,QACnB,OAAO,iBAAiB,CACtB,UAAW,OACX,QAAS,mBACX,CAAC,CACH,CAEJ,CAAC,EAED,GAAG,4CAA6C,IAAM,CAEpD,MAAMH,EAAO,CACX,QAASJ,EAAmB,UAAU,EACtC,aAAc,EAChB,EACMM,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,IAAM,GAAI,CAAC,EACxC,KAAM,IAAI,UACZ,EAGMC,EAAS,IAAIL,EAAwBE,CAAI,EAAE,cAAcE,CAAQ,EAGnEL,EAAuBM,CAAM,EAC/B,OAAO,KAAK,mBAAmB,EAE/B,OAAOA,EAAO,KAAK,EAAE,QACnB,OAAO,iBAAiB,CACtB,UAAW,OACX,QAAS,cACX,CAAC,CACH,CAEJ,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["hexaStringToBuffer", "isSuccessCommandResult", "ProvideWeb3CheckCommand", "command", "args", "apdu", "response", "result"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ApduBuilder as i,CommandResultFactory as a}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as s}from"@ledgerhq/signer-utils";import{Maybe as n}from"purify-ts";import{ETH_APP_ERRORS as o,EthAppCommandErrorFactory as d}from"./utils/ethAppErrors";var p=(e=>(e.Activation="activation",e.DiscardedPath="discarded_path",e.MessageInfo="message_info",e.Datetime="datetime",e.Raw="raw",e.Amount="amount",e.Token="token",e.TrustedName="trusted-name",e))(p||{});const m={activation:0,discarded_path:1,message_info:15,"trusted-name":251,datetime:252,token:253,amount:254,raw:255};class E{constructor(t){this.args=t}errorHelper=new s(o,d);getApdu(){const t={cla:224,ins:30,p1:"discarded"in this.args&&this.args.discarded?1:0,p2:m[this.args.type]},r=new i(t);switch(this.args.type){case"message_info":r.encodeInLVFromAscii(this.args.displayName).add8BitUIntToData(this.args.filtersCount).encodeInLVFromHexa(this.args.signature);break;case"discarded_path":r.encodeInLVFromAscii(this.args.path);break;case"datetime":case"raw":r.encodeInLVFromAscii(this.args.displayName).encodeInLVFromHexa(this.args.signature);break;case"trusted-name":r.encodeInLVFromAscii(this.args.displayName).addHexaStringToData(this.args.typesAndSourcesPayload).encodeInLVFromHexa(this.args.signature);break;case"token":case"amount":this.args.type==="amount"&&r.encodeInLVFromAscii(this.args.displayName),r.add8BitUIntToData(this.args.tokenIndex).encodeInLVFromHexa(this.args.signature);break}return r.build()}parseResponse(t){return n.fromNullable(this.errorHelper.getError(t)).orDefault(a({data:void 0}))}}export{p as Eip712FilterType,E as SendEIP712FilteringCommand};
1
+ import{ApduBuilder as r,CommandResultFactory as l}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as d}from"@ledgerhq/signer-utils";import{Maybe as n}from"purify-ts";import{ETH_APP_ERRORS as s,EthAppCommandErrorFactory as o}from"./utils/ethAppErrors";var p=(a=>(a.Activation="activation",a.DiscardedPath="discarded_path",a.MessageInfo="message_info",a.Datetime="datetime",a.Raw="raw",a.Amount="amount",a.Token="token",a.TrustedName="trusted-name",a.CalldataInfo="calldata-info",a.CalldataValue="calldata-value",a.CalldataCallee="calldata-callee",a.CalldataChainId="calldata-chain-id",a.CalldataSelector="calldata-selector",a.CalldataAmount="calldata-amount",a.CalldataSpender="calldata-spender",a))(p||{}),g=(t=>(t[t.None=0]="None",t[t.Present=1]="Present",t[t.VerifyingContract=2]="VerifyingContract",t))(g||{});const c={activation:0,discarded_path:1,message_info:15,"calldata-spender":244,"calldata-amount":245,"calldata-selector":246,"calldata-chain-id":247,"calldata-callee":248,"calldata-value":249,"calldata-info":250,"trusted-name":251,datetime:252,token:253,amount:254,raw:255};class E{constructor(i){this.args=i}name="sendEIP712Filtering";errorHelper=new d(s,o);getApdu(){const i={cla:224,ins:30,p1:"discarded"in this.args&&this.args.discarded?1:0,p2:c[this.args.type]},e=new r(i);switch(this.args.type){case"message_info":e.encodeInLVFromAscii(this.args.displayName).add8BitUIntToData(this.args.filtersCount).encodeInLVFromHexa(this.args.signature);break;case"discarded_path":e.encodeInLVFromAscii(this.args.path);break;case"datetime":case"raw":e.encodeInLVFromAscii(this.args.displayName).encodeInLVFromHexa(this.args.signature);break;case"trusted-name":e.encodeInLVFromAscii(this.args.displayName).addHexaStringToData(this.args.typesAndSourcesPayload).encodeInLVFromHexa(this.args.signature);break;case"token":case"amount":this.args.type==="amount"&&e.encodeInLVFromAscii(this.args.displayName),e.add8BitUIntToData(this.args.tokenIndex).encodeInLVFromHexa(this.args.signature);break;case"calldata-info":e.add8BitUIntToData(this.args.calldataIndex).add8BitUIntToData(this.args.valueFlag?1:0).add8BitUIntToData(this.args.calleeFlag).add8BitUIntToData(this.args.chainIdFlag?1:0).add8BitUIntToData(this.args.selectorFlag?1:0).add8BitUIntToData(this.args.amountFlag?1:0).add8BitUIntToData(this.args.spenderFlag).encodeInLVFromHexa(this.args.signature);break;case"calldata-value":case"calldata-callee":case"calldata-chain-id":case"calldata-selector":case"calldata-amount":case"calldata-spender":e.add8BitUIntToData(this.args.calldataIndex).encodeInLVFromHexa(this.args.signature);break}return e.build()}parseResponse(i){return n.fromNullable(this.errorHelper.getError(i)).orDefault(l({data:void 0}))}}export{g as CalldataParamPresence,p as Eip712FilterType,E as SendEIP712FilteringCommand};
2
2
  //# sourceMappingURL=SendEIP712FilteringCommand.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SendEIP712FilteringCommand.ts"],
4
- "sourcesContent": ["// https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#eip712-filtering\nimport {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"./utils/ethAppErrors\";\n\nexport enum Eip712FilterType {\n Activation = \"activation\",\n DiscardedPath = \"discarded_path\",\n MessageInfo = \"message_info\",\n Datetime = \"datetime\",\n Raw = \"raw\",\n Amount = \"amount\",\n Token = \"token\",\n TrustedName = \"trusted-name\",\n}\n\nexport type SendEIP712FilteringCommandArgs =\n | { type: Eip712FilterType.Activation }\n | { type: Eip712FilterType.DiscardedPath; path: string }\n | {\n type: Eip712FilterType.MessageInfo;\n displayName: string;\n filtersCount: number;\n signature: string;\n }\n | {\n type: Eip712FilterType.Datetime;\n discarded: boolean;\n displayName: string;\n signature: string;\n }\n | {\n type: Eip712FilterType.TrustedName;\n discarded: boolean;\n displayName: string;\n typesAndSourcesPayload: string;\n signature: string;\n }\n | {\n type: Eip712FilterType.Token;\n discarded: boolean;\n tokenIndex: number;\n signature: string;\n }\n | {\n type: Eip712FilterType.Raw;\n discarded: boolean;\n displayName: string;\n signature: string;\n }\n | {\n type: Eip712FilterType.Amount;\n discarded: boolean;\n displayName: string;\n tokenIndex: number;\n signature: string;\n };\n\nconst FILTER_TO_P2: Record<Eip712FilterType, number> = {\n [Eip712FilterType.Activation]: 0x00,\n [Eip712FilterType.DiscardedPath]: 0x01,\n [Eip712FilterType.MessageInfo]: 0x0f,\n [Eip712FilterType.TrustedName]: 0xfb,\n [Eip712FilterType.Datetime]: 0xfc,\n [Eip712FilterType.Token]: 0xfd,\n [Eip712FilterType.Amount]: 0xfe,\n [Eip712FilterType.Raw]: 0xff,\n};\n\nexport class SendEIP712FilteringCommand\n implements Command<void, SendEIP712FilteringCommandArgs, EthErrorCodes>\n{\n private readonly errorHelper = new CommandErrorHelper<void, EthErrorCodes>(\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n );\n\n constructor(private readonly args: SendEIP712FilteringCommandArgs) {}\n\n getApdu(): Apdu {\n const filteringArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x1e,\n p1: \"discarded\" in this.args && this.args.discarded ? 0x01 : 0x00,\n p2: FILTER_TO_P2[this.args.type],\n };\n const builder = new ApduBuilder(filteringArgs);\n\n switch (this.args.type) {\n case Eip712FilterType.MessageInfo:\n builder\n .encodeInLVFromAscii(this.args.displayName)\n .add8BitUIntToData(this.args.filtersCount)\n .encodeInLVFromHexa(this.args.signature);\n break;\n case Eip712FilterType.DiscardedPath:\n builder.encodeInLVFromAscii(this.args.path);\n break;\n case Eip712FilterType.Datetime:\n case Eip712FilterType.Raw:\n builder\n .encodeInLVFromAscii(this.args.displayName)\n .encodeInLVFromHexa(this.args.signature);\n break;\n case Eip712FilterType.TrustedName:\n builder\n .encodeInLVFromAscii(this.args.displayName)\n .addHexaStringToData(this.args.typesAndSourcesPayload)\n .encodeInLVFromHexa(this.args.signature);\n break;\n case Eip712FilterType.Token:\n case Eip712FilterType.Amount:\n if (this.args.type === Eip712FilterType.Amount) {\n builder.encodeInLVFromAscii(this.args.displayName);\n }\n builder\n .add8BitUIntToData(this.args.tokenIndex)\n .encodeInLVFromHexa(this.args.signature);\n break;\n }\n return builder.build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<void, EthErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefault(CommandResultFactory({ data: undefined }));\n }\n}\n"],
5
- "mappings": "AACA,OAEE,eAAAA,EAKA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,SAAAC,MAAa,YAEtB,OACE,kBAAAC,EACA,6BAAAC,MAEK,uBAEA,IAAKC,OACVA,EAAA,WAAa,aACbA,EAAA,cAAgB,iBAChBA,EAAA,YAAc,eACdA,EAAA,SAAW,WACXA,EAAA,IAAM,MACNA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,YAAc,eARJA,OAAA,IAqDZ,MAAMC,EAAiD,CACpD,WAA8B,EAC9B,eAAiC,EACjC,aAA+B,GAC/B,eAA+B,IAC/B,SAA4B,IAC5B,MAAyB,IACzB,OAA0B,IAC1B,IAAuB,GAC1B,EAEO,MAAMC,CAEb,CAME,YAA6BC,EAAsC,CAAtC,UAAAA,CAAuC,CALnD,YAAc,IAAIP,EACjCE,EACAC,CACF,EAIA,SAAgB,CACd,MAAMK,EAAiC,CACrC,IAAK,IACL,IAAK,GACL,GAAI,cAAe,KAAK,MAAQ,KAAK,KAAK,UAAY,EAAO,EAC7D,GAAIH,EAAa,KAAK,KAAK,IAAI,CACjC,EACMI,EAAU,IAAIX,EAAYU,CAAa,EAE7C,OAAQ,KAAK,KAAK,KAAM,CACtB,IAAK,eACHC,EACG,oBAAoB,KAAK,KAAK,WAAW,EACzC,kBAAkB,KAAK,KAAK,YAAY,EACxC,mBAAmB,KAAK,KAAK,SAAS,EACzC,MACF,IAAK,iBACHA,EAAQ,oBAAoB,KAAK,KAAK,IAAI,EAC1C,MACF,IAAK,WACL,IAAK,MACHA,EACG,oBAAoB,KAAK,KAAK,WAAW,EACzC,mBAAmB,KAAK,KAAK,SAAS,EACzC,MACF,IAAK,eACHA,EACG,oBAAoB,KAAK,KAAK,WAAW,EACzC,oBAAoB,KAAK,KAAK,sBAAsB,EACpD,mBAAmB,KAAK,KAAK,SAAS,EACzC,MACF,IAAK,QACL,IAAK,SACC,KAAK,KAAK,OAAS,UACrBA,EAAQ,oBAAoB,KAAK,KAAK,WAAW,EAEnDA,EACG,kBAAkB,KAAK,KAAK,UAAU,EACtC,mBAAmB,KAAK,KAAK,SAAS,EACzC,KACJ,CACA,OAAOA,EAAQ,MAAM,CACvB,CAEA,cACEC,EACoC,CACpC,OAAOT,EAAM,aACX,KAAK,YAAY,SAASS,CAAY,CACxC,EAAE,UAAUX,EAAqB,CAAE,KAAM,MAAU,CAAC,CAAC,CACvD,CACF",
6
- "names": ["ApduBuilder", "CommandResultFactory", "CommandErrorHelper", "Maybe", "ETH_APP_ERRORS", "EthAppCommandErrorFactory", "Eip712FilterType", "FILTER_TO_P2", "SendEIP712FilteringCommand", "args", "filteringArgs", "builder", "apduResponse"]
4
+ "sourcesContent": ["// https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#eip712-filtering\nimport {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"./utils/ethAppErrors\";\n\nexport enum Eip712FilterType {\n Activation = \"activation\",\n DiscardedPath = \"discarded_path\",\n MessageInfo = \"message_info\",\n Datetime = \"datetime\",\n Raw = \"raw\",\n Amount = \"amount\",\n Token = \"token\",\n TrustedName = \"trusted-name\",\n // Calldata filters\n CalldataInfo = \"calldata-info\",\n CalldataValue = \"calldata-value\",\n CalldataCallee = \"calldata-callee\",\n CalldataChainId = \"calldata-chain-id\",\n CalldataSelector = \"calldata-selector\",\n CalldataAmount = \"calldata-amount\",\n CalldataSpender = \"calldata-spender\",\n}\n\nexport enum CalldataParamPresence {\n None = 0x0,\n Present = 0x1,\n VerifyingContract = 0x2,\n}\n\nexport type SendEIP712FilteringCommandArgs =\n | { type: Eip712FilterType.Activation }\n | { type: Eip712FilterType.DiscardedPath; path: string }\n | {\n type: Eip712FilterType.MessageInfo;\n displayName: string;\n filtersCount: number;\n signature: string;\n }\n | {\n type: Eip712FilterType.Datetime;\n discarded: boolean;\n displayName: string;\n signature: string;\n }\n | {\n type: Eip712FilterType.TrustedName;\n discarded: boolean;\n displayName: string;\n typesAndSourcesPayload: string;\n signature: string;\n }\n | {\n type: Eip712FilterType.Token;\n discarded: boolean;\n tokenIndex: number;\n signature: string;\n }\n | {\n type: Eip712FilterType.Raw;\n discarded: boolean;\n displayName: string;\n signature: string;\n }\n | {\n type: Eip712FilterType.Amount;\n discarded: boolean;\n displayName: string;\n tokenIndex: number;\n signature: string;\n }\n | {\n type: Eip712FilterType.CalldataInfo;\n discarded: boolean;\n calldataIndex: number;\n valueFlag: boolean;\n calleeFlag: CalldataParamPresence;\n chainIdFlag: boolean;\n selectorFlag: boolean;\n amountFlag: boolean;\n spenderFlag: CalldataParamPresence;\n signature: string;\n }\n | {\n type:\n | Eip712FilterType.CalldataValue\n | Eip712FilterType.CalldataCallee\n | Eip712FilterType.CalldataChainId\n | Eip712FilterType.CalldataSelector\n | Eip712FilterType.CalldataAmount\n | Eip712FilterType.CalldataSpender;\n discarded: boolean;\n calldataIndex: number;\n signature: string;\n };\n\nconst FILTER_TO_P2: Record<Eip712FilterType, number> = {\n [Eip712FilterType.Activation]: 0x00,\n [Eip712FilterType.DiscardedPath]: 0x01,\n [Eip712FilterType.MessageInfo]: 0x0f,\n [Eip712FilterType.CalldataSpender]: 0xf4,\n [Eip712FilterType.CalldataAmount]: 0xf5,\n [Eip712FilterType.CalldataSelector]: 0xf6,\n [Eip712FilterType.CalldataChainId]: 0xf7,\n [Eip712FilterType.CalldataCallee]: 0xf8,\n [Eip712FilterType.CalldataValue]: 0xf9,\n [Eip712FilterType.CalldataInfo]: 0xfa,\n [Eip712FilterType.TrustedName]: 0xfb,\n [Eip712FilterType.Datetime]: 0xfc,\n [Eip712FilterType.Token]: 0xfd,\n [Eip712FilterType.Amount]: 0xfe,\n [Eip712FilterType.Raw]: 0xff,\n};\n\nexport class SendEIP712FilteringCommand\n implements Command<void, SendEIP712FilteringCommandArgs, EthErrorCodes>\n{\n readonly name = \"sendEIP712Filtering\";\n private readonly errorHelper = new CommandErrorHelper<void, EthErrorCodes>(\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n );\n\n constructor(private readonly args: SendEIP712FilteringCommandArgs) {}\n\n getApdu(): Apdu {\n const filteringArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x1e,\n p1: \"discarded\" in this.args && this.args.discarded ? 0x01 : 0x00,\n p2: FILTER_TO_P2[this.args.type],\n };\n const builder = new ApduBuilder(filteringArgs);\n\n switch (this.args.type) {\n case Eip712FilterType.MessageInfo:\n builder\n .encodeInLVFromAscii(this.args.displayName)\n .add8BitUIntToData(this.args.filtersCount)\n .encodeInLVFromHexa(this.args.signature);\n break;\n case Eip712FilterType.DiscardedPath:\n builder.encodeInLVFromAscii(this.args.path);\n break;\n case Eip712FilterType.Datetime:\n case Eip712FilterType.Raw:\n builder\n .encodeInLVFromAscii(this.args.displayName)\n .encodeInLVFromHexa(this.args.signature);\n break;\n case Eip712FilterType.TrustedName:\n builder\n .encodeInLVFromAscii(this.args.displayName)\n .addHexaStringToData(this.args.typesAndSourcesPayload)\n .encodeInLVFromHexa(this.args.signature);\n break;\n case Eip712FilterType.Token:\n case Eip712FilterType.Amount:\n if (this.args.type === Eip712FilterType.Amount) {\n builder.encodeInLVFromAscii(this.args.displayName);\n }\n builder\n .add8BitUIntToData(this.args.tokenIndex)\n .encodeInLVFromHexa(this.args.signature);\n break;\n case Eip712FilterType.CalldataInfo:\n builder\n .add8BitUIntToData(this.args.calldataIndex)\n .add8BitUIntToData(this.args.valueFlag ? 1 : 0)\n .add8BitUIntToData(this.args.calleeFlag)\n .add8BitUIntToData(this.args.chainIdFlag ? 1 : 0)\n .add8BitUIntToData(this.args.selectorFlag ? 1 : 0)\n .add8BitUIntToData(this.args.amountFlag ? 1 : 0)\n .add8BitUIntToData(this.args.spenderFlag)\n .encodeInLVFromHexa(this.args.signature);\n break;\n case Eip712FilterType.CalldataValue:\n case Eip712FilterType.CalldataCallee:\n case Eip712FilterType.CalldataChainId:\n case Eip712FilterType.CalldataSelector:\n case Eip712FilterType.CalldataAmount:\n case Eip712FilterType.CalldataSpender:\n builder\n .add8BitUIntToData(this.args.calldataIndex)\n .encodeInLVFromHexa(this.args.signature);\n break;\n }\n return builder.build();\n }\n\n parseResponse(\n apduResponse: ApduResponse,\n ): CommandResult<void, EthErrorCodes> {\n return Maybe.fromNullable(\n this.errorHelper.getError(apduResponse),\n ).orDefault(CommandResultFactory({ data: undefined }));\n }\n}\n"],
5
+ "mappings": "AACA,OAEE,eAAAA,EAKA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,SAAAC,MAAa,YAEtB,OACE,kBAAAC,EACA,6BAAAC,MAEK,uBAEA,IAAKC,OACVA,EAAA,WAAa,aACbA,EAAA,cAAgB,iBAChBA,EAAA,YAAc,eACdA,EAAA,SAAW,WACXA,EAAA,IAAM,MACNA,EAAA,OAAS,SACTA,EAAA,MAAQ,QACRA,EAAA,YAAc,eAEdA,EAAA,aAAe,gBACfA,EAAA,cAAgB,iBAChBA,EAAA,eAAiB,kBACjBA,EAAA,gBAAkB,oBAClBA,EAAA,iBAAmB,oBACnBA,EAAA,eAAiB,kBACjBA,EAAA,gBAAkB,mBAhBRA,OAAA,IAmBAC,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,QAAU,GAAV,UACAA,IAAA,kBAAoB,GAApB,oBAHUA,OAAA,IAwEZ,MAAMC,EAAiD,CACpD,WAA8B,EAC9B,eAAiC,EACjC,aAA+B,GAC/B,mBAAmC,IACnC,kBAAkC,IAClC,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KAAK,aAAe,EAAI,CAAC,EAChD,kBAAkB,KAAK,KAAK,WAAa,EAAI,CAAC,EAC9C,kBAAkB,KAAK,KAAK,WAAW,EACvC,mBAAmB,KAAK,KAAK,SAAS,EACzC,MACF,IAAK,iBACL,IAAK,kBACL,IAAK,oBACL,IAAK,oBACL,IAAK,kBACL,IAAK,mBACHA,EACG,kBAAkB,KAAK,KAAK,aAAa,EACzC,mBAAmB,KAAK,KAAK,SAAS,EACzC,KACJ,CACA,OAAOA,EAAQ,MAAM,CACvB,CAEA,cACEC,EACoC,CACpC,OAAOV,EAAM,aACX,KAAK,YAAY,SAASU,CAAY,CACxC,EAAE,UAAUZ,EAAqB,CAAE,KAAM,MAAU,CAAC,CAAC,CACvD,CACF",
6
+ "names": ["ApduBuilder", "CommandResultFactory", "CommandErrorHelper", "Maybe", "ETH_APP_ERRORS", "EthAppCommandErrorFactory", "Eip712FilterType", "CalldataParamPresence", "FILTER_TO_P2", "SendEIP712FilteringCommand", "args", "filteringArgs", "builder", "apduResponse"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{CommandResultFactory as n,isSuccessCommandResult as s}from"@ledgerhq/device-management-kit";import{Eip712FilterType as d,SendEIP712FilteringCommand as c}from"./SendEIP712FilteringCommand";const o=Uint8Array.from([224,30,0,0,0]),f=Uint8Array.from([224,30,0,15,84,11,49,105,110,99,104,32,79,114,100,101,114,6,70,48,68,2,32,41,94,10,235,23,202,9,41,178,169,76,50,77,103,208,181,82,138,186,38,129,119,243,172,41,123,86,49,65,224,0,39,2,32,58,195,96,217,253,12,156,12,18,39,157,30,115,190,165,213,73,161,232,20,31,69,77,136,251,225,232,239,151,14,104,2]),t=Uint8Array.from([224,30,0,255,77,4,70,114,111,109,71,48,69,2,33,0,184,32,228,223,177,160,205,230,220,151,217,163,78,235,177,164,238,240,178,38,38,46,103,136,17,138,179,199,251,121,254,53,2,32,45,66,106,56,139,76,58,128,150,179,248,68,18,167,2,234,83,119,112,230,30,224,114,126,193,183,16,193,218,82,12,68]),r=Uint8Array.from([224,30,0,253,73,1,71,48,69,2,33,0,255,114,120,71,68,84,49,229,113,205,42,13,157,180,42,126,182,46,55,135,123,155,242,14,106,150,88,66,85,52,126,25,2,32,10,110,149,183,248,230,59,47,171,11,239,136,199,71,222,106,56,125,6,53,27,229,189,195,75,44,31,154,234,111,221,40]),i=Uint8Array.from([224,30,0,254,89,15,82,101,99,101,105,118,101,32,109,105,110,105,109,117,109,1,71,48,69,2,33,0,165,157,196,121,168,56,168,19,144,156,20,10,21,230,182,91,197,140,86,51,40,75,249,115,196,54,222,90,89,38,52,226,2,32,30,3,143,199,153,93,147,159,204,213,70,228,200,94,121,60,10,212,81,33,110,54,164,237,252,123,206,91,226,120,8,203]),m=Uint8Array.from([224,30,0,251,86,7,83,112,101,110,100,101,114,1,2,3,1,0,2,71,48,69,2,33,0,232,71,22,110,96,248,81,227,200,209,244,65,57,129,24,152,204,208,211,160,58,237,108,119,248,195,153,56,19,244,121,210,2,32,49,254,107,106,87,75,86,197,16,64,3,207,7,144,13,17,255,175,48,61,192,22,218,76,28,61,24,70,99,218,143,106]),b=Uint8Array.from([224,30,0,252,88,15,65,112,112,114,111,118,97,108,32,101,120,112,105,114,101,71,48,69,2,33,0,232,71,22,110,96,248,81,227,200,209,244,65,57,129,24,152,204,208,211,160,58,237,108,119,248,195,153,56,19,244,121,210,2,32,49,254,107,106,87,75,86,197,16,64,3,207,7,144,13,17,255,175,48,61,192,22,218,76,28,61,24,70,99,218,143,106]),p=Uint8Array.from([224,30,0,1,17,16,116,111,46,91,93,46,119,97,108,108,101,116,115,46,91,93]);describe("SendEIP712FilteringCommand",()=>{describe("getApdu",()=>{it("Activate APDU",()=>{const x={type:d.Activation},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(o)}),it("Discarded path APDU",()=>{const x={type:d.DiscardedPath,path:"to.[].wallets.[]"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(p)}),it("Message info APDU",()=>{const x={type:d.MessageInfo,displayName:"1inch Order",filtersCount:6,signature:"30440220295e0aeb17ca0929b2a94c324d67d0b5528aba268177f3ac297b563141e0002702203ac360d9fd0c9c0c12279d1e73bea5d549a1e8141f454d88fbe1e8ef970e6802"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(f)}),it("Raw APDU",()=>{const x={type:d.Raw,discarded:!1,displayName:"From",signature:"3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(t)}),it("Token APDU",()=>{const x={type:d.Token,discarded:!1,tokenIndex:1,signature:"3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(r)}),it("Amount APDU",()=>{const x={type:d.Amount,discarded:!1,displayName:"Receive minimum",tokenIndex:1,signature:"3045022100a59dc479a838a813909c140a15e6b65bc58c5633284bf973c436de5a592634e202201e038fc7995d939fccd546e4c85e793c0ad451216e36a4edfc7bce5be27808cb"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(i)}),it("Date-time APDU",()=>{const x={type:d.Datetime,discarded:!1,displayName:"Approval expire",signature:"3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(b)}),it("Trusted name APDU",()=>{const x={type:d.TrustedName,discarded:!1,displayName:"Spender",typesAndSourcesPayload:"010203010002",signature:"3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(m)}),it("Discarded filter",()=>{const x={type:d.Raw,discarded:!0,displayName:"From",signature:"3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(Uint8Array.from([...t.slice(0,2),1,...t.slice(3)]))})}),describe("parseResponse",()=>{it("should return an error if the response status code is invalid",()=>{const x={statusCode:Buffer.from([106,128]),data:Buffer.from([])},e=new c({type:d.Activation}).parseResponse(x);expect(s(e)).toBe(!1)}),it("should parse the response",()=>{const x={statusCode:Buffer.from([144,0]),data:Buffer.from([])},a=new c({type:d.Activation});expect(a.parseResponse(x)).toStrictEqual(n({data:void 0}))})})});
1
+ import{CommandResultFactory as o,isSuccessCommandResult as r}from"@ledgerhq/device-management-kit";import{CalldataParamPresence as f,Eip712FilterType as a,SendEIP712FilteringCommand as c}from"./SendEIP712FilteringCommand";const m=Uint8Array.from([224,30,0,0,0]),b=Uint8Array.from([224,30,0,15,84,11,49,105,110,99,104,32,79,114,100,101,114,6,70,48,68,2,32,41,94,10,235,23,202,9,41,178,169,76,50,77,103,208,181,82,138,186,38,129,119,243,172,41,123,86,49,65,224,0,39,2,32,58,195,96,217,253,12,156,12,18,39,157,30,115,190,165,213,73,161,232,20,31,69,77,136,251,225,232,239,151,14,104,2]),t=Uint8Array.from([224,30,0,255,77,4,70,114,111,109,71,48,69,2,33,0,184,32,228,223,177,160,205,230,220,151,217,163,78,235,177,164,238,240,178,38,38,46,103,136,17,138,179,199,251,121,254,53,2,32,45,66,106,56,139,76,58,128,150,179,248,68,18,167,2,234,83,119,112,230,30,224,114,126,193,183,16,193,218,82,12,68]),i=Uint8Array.from([224,30,0,250,79,3,1,1,0,1,0,2,71,48,69,2,33,0,255,114,120,71,68,84,49,229,113,205,42,13,157,180,42,126,182,46,55,135,123,155,242,14,106,150,88,66,85,52,126,25,2,32,10,110,149,183,248,230,59,47,171,11,239,136,199,71,222,106,56,125,6,53,27,229,189,195,75,44,31,154,234,111,221,40]),p=Uint8Array.from([224,30,0,249,73,7,71,48,69,2,33,0,255,114,120,71,68,84,49,229,113,205,42,13,157,180,42,126,182,46,55,135,123,155,242,14,106,150,88,66,85,52,126,25,2,32,10,110,149,183,248,230,59,47,171,11,239,136,199,71,222,106,56,125,6,53,27,229,189,195,75,44,31,154,234,111,221,40]),l=Uint8Array.from([224,30,0,253,73,1,71,48,69,2,33,0,255,114,120,71,68,84,49,229,113,205,42,13,157,180,42,126,182,46,55,135,123,155,242,14,106,150,88,66,85,52,126,25,2,32,10,110,149,183,248,230,59,47,171,11,239,136,199,71,222,106,56,125,6,53,27,229,189,195,75,44,31,154,234,111,221,40]),A=Uint8Array.from([224,30,0,254,89,15,82,101,99,101,105,118,101,32,109,105,110,105,109,117,109,1,71,48,69,2,33,0,165,157,196,121,168,56,168,19,144,156,20,10,21,230,182,91,197,140,86,51,40,75,249,115,196,54,222,90,89,38,52,226,2,32,30,3,143,199,153,93,147,159,204,213,70,228,200,94,121,60,10,212,81,33,110,54,164,237,252,123,206,91,226,120,8,203]),u=Uint8Array.from([224,30,0,251,86,7,83,112,101,110,100,101,114,1,2,3,1,0,2,71,48,69,2,33,0,232,71,22,110,96,248,81,227,200,209,244,65,57,129,24,152,204,208,211,160,58,237,108,119,248,195,153,56,19,244,121,210,2,32,49,254,107,106,87,75,86,197,16,64,3,207,7,144,13,17,255,175,48,61,192,22,218,76,28,61,24,70,99,218,143,106]),g=Uint8Array.from([224,30,0,252,88,15,65,112,112,114,111,118,97,108,32,101,120,112,105,114,101,71,48,69,2,33,0,232,71,22,110,96,248,81,227,200,209,244,65,57,129,24,152,204,208,211,160,58,237,108,119,248,195,153,56,19,244,121,210,2,32,49,254,107,106,87,75,86,197,16,64,3,207,7,144,13,17,255,175,48,61,192,22,218,76,28,61,24,70,99,218,143,106]),y=Uint8Array.from([224,30,0,1,17,16,116,111,46,91,93,46,119,97,108,108,101,116,115,46,91,93]);describe("SendEIP712FilteringCommand",()=>{describe("name",()=>{it("should be 'sendEIP712Filtering'",()=>{const x=new c({type:a.Activation});expect(x.name).toBe("sendEIP712Filtering")})}),describe("getApdu",()=>{it("Activate APDU",()=>{const x={type:a.Activation},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(m)}),it("Discarded path APDU",()=>{const x={type:a.DiscardedPath,path:"to.[].wallets.[]"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(y)}),it("Message info APDU",()=>{const x={type:a.MessageInfo,displayName:"1inch Order",filtersCount:6,signature:"30440220295e0aeb17ca0929b2a94c324d67d0b5528aba268177f3ac297b563141e0002702203ac360d9fd0c9c0c12279d1e73bea5d549a1e8141f454d88fbe1e8ef970e6802"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(b)}),it("Raw APDU",()=>{const x={type:a.Raw,discarded:!1,displayName:"From",signature:"3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(t)}),it("Calldata info APDU",()=>{const x={type:a.CalldataInfo,discarded:!1,calldataIndex:3,valueFlag:!0,calleeFlag:f.Present,chainIdFlag:!1,selectorFlag:!0,amountFlag:!1,spenderFlag:f.VerifyingContract,signature:"3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(i)}),it.each([{name:"spender",type:a.CalldataSpender,cmd:244},{name:"amount",type:a.CalldataAmount,cmd:245},{name:"selector",type:a.CalldataSelector,cmd:246},{name:"chainId",type:a.CalldataChainId,cmd:247},{name:"callee",type:a.CalldataCallee,cmd:248},{name:"value",type:a.CalldataValue,cmd:249}])("Calldata APDU $name",({type:x,cmd:d})=>{const e={type:x,discarded:!1,calldataIndex:7,signature:"3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28"},n=Uint8Array.from(p);n[3]=d;const s=new c(e).getApdu();expect(s.getRawApdu()).toStrictEqual(n)}),it("Token APDU",()=>{const x={type:a.Token,discarded:!1,tokenIndex:1,signature:"3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(l)}),it("Amount APDU",()=>{const x={type:a.Amount,discarded:!1,displayName:"Receive minimum",tokenIndex:1,signature:"3045022100a59dc479a838a813909c140a15e6b65bc58c5633284bf973c436de5a592634e202201e038fc7995d939fccd546e4c85e793c0ad451216e36a4edfc7bce5be27808cb"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(A)}),it("Date-time APDU",()=>{const x={type:a.Datetime,discarded:!1,displayName:"Approval expire",signature:"3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(g)}),it("Trusted name APDU",()=>{const x={type:a.TrustedName,discarded:!1,displayName:"Spender",typesAndSourcesPayload:"010203010002",signature:"3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(u)}),it("Discarded filter",()=>{const x={type:a.Raw,discarded:!0,displayName:"From",signature:"3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44"},e=new c(x).getApdu();expect(e.getRawApdu()).toStrictEqual(Uint8Array.from([...t.slice(0,2),1,...t.slice(3)]))})}),describe("parseResponse",()=>{it("should return an error if the response status code is invalid",()=>{const x={statusCode:Buffer.from([106,128]),data:Buffer.from([])},e=new c({type:a.Activation}).parseResponse(x);expect(r(e)).toBe(!1)}),it("should parse the response",()=>{const x={statusCode:Buffer.from([144,0]),data:Buffer.from([])},d=new c({type:a.Activation});expect(d.parseResponse(x)).toStrictEqual(o({data:void 0}))})})});
2
2
  //# sourceMappingURL=SendEIP712FilteringCommand.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SendEIP712FilteringCommand.test.ts"],
4
- "sourcesContent": ["import {\n type ApduResponse,\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n Eip712FilterType,\n SendEIP712FilteringCommand,\n type SendEIP712FilteringCommandArgs,\n} from \"./SendEIP712FilteringCommand\";\n\nconst ACTIVATE_APDU = Uint8Array.from([0xe0, 0x1e, 0x00, 0x00, 0x00]);\nconst MESSAGE_INFO_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0x0f, 0x54, 0x0b, 0x31, 0x69, 0x6e, 0x63, 0x68, 0x20, 0x4f,\n 0x72, 0x64, 0x65, 0x72, 0x06, 0x46, 0x30, 0x44, 0x02, 0x20, 0x29, 0x5e, 0x0a,\n 0xeb, 0x17, 0xca, 0x09, 0x29, 0xb2, 0xa9, 0x4c, 0x32, 0x4d, 0x67, 0xd0, 0xb5,\n 0x52, 0x8a, 0xba, 0x26, 0x81, 0x77, 0xf3, 0xac, 0x29, 0x7b, 0x56, 0x31, 0x41,\n 0xe0, 0x00, 0x27, 0x02, 0x20, 0x3a, 0xc3, 0x60, 0xd9, 0xfd, 0x0c, 0x9c, 0x0c,\n 0x12, 0x27, 0x9d, 0x1e, 0x73, 0xbe, 0xa5, 0xd5, 0x49, 0xa1, 0xe8, 0x14, 0x1f,\n 0x45, 0x4d, 0x88, 0xfb, 0xe1, 0xe8, 0xef, 0x97, 0x0e, 0x68, 0x02,\n]);\nconst RAW_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xff, 0x4d, 0x04, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x30, 0x45,\n 0x02, 0x21, 0x00, 0xb8, 0x20, 0xe4, 0xdf, 0xb1, 0xa0, 0xcd, 0xe6, 0xdc, 0x97,\n 0xd9, 0xa3, 0x4e, 0xeb, 0xb1, 0xa4, 0xee, 0xf0, 0xb2, 0x26, 0x26, 0x2e, 0x67,\n 0x88, 0x11, 0x8a, 0xb3, 0xc7, 0xfb, 0x79, 0xfe, 0x35, 0x02, 0x20, 0x2d, 0x42,\n 0x6a, 0x38, 0x8b, 0x4c, 0x3a, 0x80, 0x96, 0xb3, 0xf8, 0x44, 0x12, 0xa7, 0x02,\n 0xea, 0x53, 0x77, 0x70, 0xe6, 0x1e, 0xe0, 0x72, 0x7e, 0xc1, 0xb7, 0x10, 0xc1,\n 0xda, 0x52, 0x0c, 0x44,\n]);\nconst TOKEN_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfd, 0x49, 0x01, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0xff,\n 0x72, 0x78, 0x47, 0x44, 0x54, 0x31, 0xe5, 0x71, 0xcd, 0x2a, 0x0d, 0x9d, 0xb4,\n 0x2a, 0x7e, 0xb6, 0x2e, 0x37, 0x87, 0x7b, 0x9b, 0xf2, 0x0e, 0x6a, 0x96, 0x58,\n 0x42, 0x55, 0x34, 0x7e, 0x19, 0x02, 0x20, 0x0a, 0x6e, 0x95, 0xb7, 0xf8, 0xe6,\n 0x3b, 0x2f, 0xab, 0x0b, 0xef, 0x88, 0xc7, 0x47, 0xde, 0x6a, 0x38, 0x7d, 0x06,\n 0x35, 0x1b, 0xe5, 0xbd, 0xc3, 0x4b, 0x2c, 0x1f, 0x9a, 0xea, 0x6f, 0xdd, 0x28,\n]);\nconst AMOUNT_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfe, 0x59, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,\n 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x01, 0x47, 0x30, 0x45, 0x02,\n 0x21, 0x00, 0xa5, 0x9d, 0xc4, 0x79, 0xa8, 0x38, 0xa8, 0x13, 0x90, 0x9c, 0x14,\n 0x0a, 0x15, 0xe6, 0xb6, 0x5b, 0xc5, 0x8c, 0x56, 0x33, 0x28, 0x4b, 0xf9, 0x73,\n 0xc4, 0x36, 0xde, 0x5a, 0x59, 0x26, 0x34, 0xe2, 0x02, 0x20, 0x1e, 0x03, 0x8f,\n 0xc7, 0x99, 0x5d, 0x93, 0x9f, 0xcc, 0xd5, 0x46, 0xe4, 0xc8, 0x5e, 0x79, 0x3c,\n 0x0a, 0xd4, 0x51, 0x21, 0x6e, 0x36, 0xa4, 0xed, 0xfc, 0x7b, 0xce, 0x5b, 0xe2,\n 0x78, 0x08, 0xcb,\n]);\nconst TRUSTED_NAME_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfb, 0x56, 0x07, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72,\n 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0xe8,\n 0x47, 0x16, 0x6e, 0x60, 0xf8, 0x51, 0xe3, 0xc8, 0xd1, 0xf4, 0x41, 0x39, 0x81,\n 0x18, 0x98, 0xcc, 0xd0, 0xd3, 0xa0, 0x3a, 0xed, 0x6c, 0x77, 0xf8, 0xc3, 0x99,\n 0x38, 0x13, 0xf4, 0x79, 0xd2, 0x02, 0x20, 0x31, 0xfe, 0x6b, 0x6a, 0x57, 0x4b,\n 0x56, 0xc5, 0x10, 0x40, 0x03, 0xcf, 0x07, 0x90, 0x0d, 0x11, 0xff, 0xaf, 0x30,\n 0x3d, 0xc0, 0x16, 0xda, 0x4c, 0x1c, 0x3d, 0x18, 0x46, 0x63, 0xda, 0x8f, 0x6a,\n]);\nconst DATE_TIME_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfc, 0x58, 0x0f, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61,\n 0x6c, 0x20, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x47, 0x30, 0x45, 0x02, 0x21,\n 0x00, 0xe8, 0x47, 0x16, 0x6e, 0x60, 0xf8, 0x51, 0xe3, 0xc8, 0xd1, 0xf4, 0x41,\n 0x39, 0x81, 0x18, 0x98, 0xcc, 0xd0, 0xd3, 0xa0, 0x3a, 0xed, 0x6c, 0x77, 0xf8,\n 0xc3, 0x99, 0x38, 0x13, 0xf4, 0x79, 0xd2, 0x02, 0x20, 0x31, 0xfe, 0x6b, 0x6a,\n 0x57, 0x4b, 0x56, 0xc5, 0x10, 0x40, 0x03, 0xcf, 0x07, 0x90, 0x0d, 0x11, 0xff,\n 0xaf, 0x30, 0x3d, 0xc0, 0x16, 0xda, 0x4c, 0x1c, 0x3d, 0x18, 0x46, 0x63, 0xda,\n 0x8f, 0x6a,\n]);\nconst DISCARDED_PATH_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0x01, 0x11, 0x10, 0x74, 0x6f, 0x2e, 0x5b, 0x5d, 0x2e, 0x77,\n 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x2e, 0x5b, 0x5d,\n]);\n\ndescribe(\"SendEIP712FilteringCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"Activate APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Activation,\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(ACTIVATE_APDU);\n });\n\n it(\"Discarded path APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.DiscardedPath,\n path: \"to.[].wallets.[]\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(DISCARDED_PATH_APDU);\n });\n\n it(\"Message info APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.MessageInfo,\n displayName: \"1inch Order\",\n filtersCount: 6,\n signature:\n \"30440220295e0aeb17ca0929b2a94c324d67d0b5528aba268177f3ac297b563141e0002702203ac360d9fd0c9c0c12279d1e73bea5d549a1e8141f454d88fbe1e8ef970e6802\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(MESSAGE_INFO_APDU);\n });\n\n it(\"Raw APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Raw,\n discarded: false,\n displayName: \"From\",\n signature:\n \"3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(RAW_APDU);\n });\n\n it(\"Token APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Token,\n discarded: false,\n tokenIndex: 1,\n signature:\n \"3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(TOKEN_APDU);\n });\n\n it(\"Amount APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Amount,\n discarded: false,\n displayName: \"Receive minimum\",\n tokenIndex: 1,\n signature:\n \"3045022100a59dc479a838a813909c140a15e6b65bc58c5633284bf973c436de5a592634e202201e038fc7995d939fccd546e4c85e793c0ad451216e36a4edfc7bce5be27808cb\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(AMOUNT_APDU);\n });\n\n it(\"Date-time APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Datetime,\n discarded: false,\n displayName: \"Approval expire\",\n signature:\n \"3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(DATE_TIME_APDU);\n });\n\n it(\"Trusted name APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.TrustedName,\n discarded: false,\n displayName: \"Spender\",\n typesAndSourcesPayload: \"010203010002\",\n signature:\n \"3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(TRUSTED_NAME_APDU);\n });\n\n it(\"Discarded filter\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Raw,\n discarded: true,\n displayName: \"From\",\n signature:\n \"3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n Uint8Array.from([...RAW_APDU.slice(0, 2), 0x01, ...RAW_APDU.slice(3)]),\n );\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should return an error if the response status code is invalid\", () => {\n // GIVEN\n const response: ApduResponse = {\n statusCode: Buffer.from([0x6a, 0x80]), // Invalid status code\n data: Buffer.from([]),\n };\n // WHEN\n const command = new SendEIP712FilteringCommand({\n type: Eip712FilterType.Activation,\n });\n // THEN\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBe(false);\n });\n\n it(\"should parse the response\", () => {\n // GIVEN\n const response: ApduResponse = {\n statusCode: Buffer.from([0x90, 0x00]), // Success status code\n data: Buffer.from([]),\n };\n // WHEN\n const command = new SendEIP712FilteringCommand({\n type: Eip712FilterType.Activation,\n });\n // THEN\n expect(command.parseResponse(response)).toStrictEqual(\n CommandResultFactory({ data: undefined }),\n );\n });\n });\n});\n"],
5
- "mappings": "AAAA,OAEE,wBAAAA,EACA,0BAAAC,MACK,kCAEP,OACE,oBAAAC,EACA,8BAAAC,MAEK,+BAEP,MAAMC,EAAgB,WAAW,KAAK,CAAC,IAAM,GAAM,EAAM,EAAM,CAAI,CAAC,EAC9DC,EAAoB,WAAW,KAAK,CACxC,IAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GAAM,IAAM,IAAM,GAAM,IAAM,GAAM,GACxE,IAAM,IAAM,IAAM,IAAM,EAAM,GAAM,GAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GACxE,IAAM,GAAM,IAAM,EAAM,GAAM,IAAM,IAAM,GAAM,GAAM,GAAM,IAAM,IAAM,IACxE,GAAM,IAAM,IAAM,GAAM,IAAM,IAAM,IAAM,IAAM,GAAM,IAAM,GAAM,GA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,CAAI,EAC9B,QAAQ,EAE7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cAAcJ,CAAiB,CAC3D,CAAC,EAED,GAAG,mBAAoB,IAAM,CAE3B,MAAMG,EAAuC,CAC3C,KAAMV,EAAiB,IACvB,UAAW,GACX,YAAa,OACb,UACE,gJACJ,EAGMW,EADU,IAAIV,EAA2BS,CAAI,EAC9B,QAAQ,EAE7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cACxB,WAAW,KAAK,CAAC,GAAGP,EAAS,MAAM,EAAG,CAAC,EAAG,EAAM,GAAGA,EAAS,MAAM,CAAC,CAAC,CAAC,CACvE,CACF,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,gEAAiE,IAAM,CAExE,MAAMQ,EAAyB,CAC7B,WAAY,OAAO,KAAK,CAAC,IAAM,GAAI,CAAC,EACpC,KAAM,OAAO,KAAK,CAAC,CAAC,CACtB,EAMMC,EAJU,IAAIZ,EAA2B,CAC7C,KAAMD,EAAiB,UACzB,CAAC,EAEsB,cAAcY,CAAQ,EAC7C,OAAOb,EAAuBc,CAAM,CAAC,EAAE,KAAK,EAAK,CACnD,CAAC,EAED,GAAG,4BAA6B,IAAM,CAEpC,MAAMD,EAAyB,CAC7B,WAAY,OAAO,KAAK,CAAC,IAAM,CAAI,CAAC,EACpC,KAAM,OAAO,KAAK,CAAC,CAAC,CACtB,EAEME,EAAU,IAAIb,EAA2B,CAC7C,KAAMD,EAAiB,UACzB,CAAC,EAED,OAAOc,EAAQ,cAAcF,CAAQ,CAAC,EAAE,cACtCd,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["CommandResultFactory", "isSuccessCommandResult", "Eip712FilterType", "SendEIP712FilteringCommand", "ACTIVATE_APDU", "MESSAGE_INFO_APDU", "RAW_APDU", "TOKEN_APDU", "AMOUNT_APDU", "TRUSTED_NAME_APDU", "DATE_TIME_APDU", "DISCARDED_PATH_APDU", "args", "apdu", "response", "result", "command"]
4
+ "sourcesContent": ["import {\n type ApduResponse,\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n CalldataParamPresence,\n Eip712FilterType,\n SendEIP712FilteringCommand,\n type SendEIP712FilteringCommandArgs,\n} from \"./SendEIP712FilteringCommand\";\n\nconst ACTIVATE_APDU = Uint8Array.from([0xe0, 0x1e, 0x00, 0x00, 0x00]);\nconst MESSAGE_INFO_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0x0f, 0x54, 0x0b, 0x31, 0x69, 0x6e, 0x63, 0x68, 0x20, 0x4f,\n 0x72, 0x64, 0x65, 0x72, 0x06, 0x46, 0x30, 0x44, 0x02, 0x20, 0x29, 0x5e, 0x0a,\n 0xeb, 0x17, 0xca, 0x09, 0x29, 0xb2, 0xa9, 0x4c, 0x32, 0x4d, 0x67, 0xd0, 0xb5,\n 0x52, 0x8a, 0xba, 0x26, 0x81, 0x77, 0xf3, 0xac, 0x29, 0x7b, 0x56, 0x31, 0x41,\n 0xe0, 0x00, 0x27, 0x02, 0x20, 0x3a, 0xc3, 0x60, 0xd9, 0xfd, 0x0c, 0x9c, 0x0c,\n 0x12, 0x27, 0x9d, 0x1e, 0x73, 0xbe, 0xa5, 0xd5, 0x49, 0xa1, 0xe8, 0x14, 0x1f,\n 0x45, 0x4d, 0x88, 0xfb, 0xe1, 0xe8, 0xef, 0x97, 0x0e, 0x68, 0x02,\n]);\nconst RAW_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xff, 0x4d, 0x04, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x30, 0x45,\n 0x02, 0x21, 0x00, 0xb8, 0x20, 0xe4, 0xdf, 0xb1, 0xa0, 0xcd, 0xe6, 0xdc, 0x97,\n 0xd9, 0xa3, 0x4e, 0xeb, 0xb1, 0xa4, 0xee, 0xf0, 0xb2, 0x26, 0x26, 0x2e, 0x67,\n 0x88, 0x11, 0x8a, 0xb3, 0xc7, 0xfb, 0x79, 0xfe, 0x35, 0x02, 0x20, 0x2d, 0x42,\n 0x6a, 0x38, 0x8b, 0x4c, 0x3a, 0x80, 0x96, 0xb3, 0xf8, 0x44, 0x12, 0xa7, 0x02,\n 0xea, 0x53, 0x77, 0x70, 0xe6, 0x1e, 0xe0, 0x72, 0x7e, 0xc1, 0xb7, 0x10, 0xc1,\n 0xda, 0x52, 0x0c, 0x44,\n]);\nconst CALLDATA_INFO_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfa, 0x4f, 0x03, 0x01, 0x01, 0x00, 0x01, 0x00, 0x02, 0x47,\n 0x30, 0x45, 0x02, 0x21, 0x00, 0xff, 0x72, 0x78, 0x47, 0x44, 0x54, 0x31, 0xe5,\n 0x71, 0xcd, 0x2a, 0x0d, 0x9d, 0xb4, 0x2a, 0x7e, 0xb6, 0x2e, 0x37, 0x87, 0x7b,\n 0x9b, 0xf2, 0x0e, 0x6a, 0x96, 0x58, 0x42, 0x55, 0x34, 0x7e, 0x19, 0x02, 0x20,\n 0x0a, 0x6e, 0x95, 0xb7, 0xf8, 0xe6, 0x3b, 0x2f, 0xab, 0x0b, 0xef, 0x88, 0xc7,\n 0x47, 0xde, 0x6a, 0x38, 0x7d, 0x06, 0x35, 0x1b, 0xe5, 0xbd, 0xc3, 0x4b, 0x2c,\n 0x1f, 0x9a, 0xea, 0x6f, 0xdd, 0x28,\n]);\nconst CALLDATA_VALUE_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xf9, 0x49, 0x07, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0xff,\n 0x72, 0x78, 0x47, 0x44, 0x54, 0x31, 0xe5, 0x71, 0xcd, 0x2a, 0x0d, 0x9d, 0xb4,\n 0x2a, 0x7e, 0xb6, 0x2e, 0x37, 0x87, 0x7b, 0x9b, 0xf2, 0x0e, 0x6a, 0x96, 0x58,\n 0x42, 0x55, 0x34, 0x7e, 0x19, 0x02, 0x20, 0x0a, 0x6e, 0x95, 0xb7, 0xf8, 0xe6,\n 0x3b, 0x2f, 0xab, 0x0b, 0xef, 0x88, 0xc7, 0x47, 0xde, 0x6a, 0x38, 0x7d, 0x06,\n 0x35, 0x1b, 0xe5, 0xbd, 0xc3, 0x4b, 0x2c, 0x1f, 0x9a, 0xea, 0x6f, 0xdd, 0x28,\n]);\nconst TOKEN_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfd, 0x49, 0x01, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0xff,\n 0x72, 0x78, 0x47, 0x44, 0x54, 0x31, 0xe5, 0x71, 0xcd, 0x2a, 0x0d, 0x9d, 0xb4,\n 0x2a, 0x7e, 0xb6, 0x2e, 0x37, 0x87, 0x7b, 0x9b, 0xf2, 0x0e, 0x6a, 0x96, 0x58,\n 0x42, 0x55, 0x34, 0x7e, 0x19, 0x02, 0x20, 0x0a, 0x6e, 0x95, 0xb7, 0xf8, 0xe6,\n 0x3b, 0x2f, 0xab, 0x0b, 0xef, 0x88, 0xc7, 0x47, 0xde, 0x6a, 0x38, 0x7d, 0x06,\n 0x35, 0x1b, 0xe5, 0xbd, 0xc3, 0x4b, 0x2c, 0x1f, 0x9a, 0xea, 0x6f, 0xdd, 0x28,\n]);\nconst AMOUNT_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfe, 0x59, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,\n 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x01, 0x47, 0x30, 0x45, 0x02,\n 0x21, 0x00, 0xa5, 0x9d, 0xc4, 0x79, 0xa8, 0x38, 0xa8, 0x13, 0x90, 0x9c, 0x14,\n 0x0a, 0x15, 0xe6, 0xb6, 0x5b, 0xc5, 0x8c, 0x56, 0x33, 0x28, 0x4b, 0xf9, 0x73,\n 0xc4, 0x36, 0xde, 0x5a, 0x59, 0x26, 0x34, 0xe2, 0x02, 0x20, 0x1e, 0x03, 0x8f,\n 0xc7, 0x99, 0x5d, 0x93, 0x9f, 0xcc, 0xd5, 0x46, 0xe4, 0xc8, 0x5e, 0x79, 0x3c,\n 0x0a, 0xd4, 0x51, 0x21, 0x6e, 0x36, 0xa4, 0xed, 0xfc, 0x7b, 0xce, 0x5b, 0xe2,\n 0x78, 0x08, 0xcb,\n]);\nconst TRUSTED_NAME_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfb, 0x56, 0x07, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x72,\n 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x47, 0x30, 0x45, 0x02, 0x21, 0x00, 0xe8,\n 0x47, 0x16, 0x6e, 0x60, 0xf8, 0x51, 0xe3, 0xc8, 0xd1, 0xf4, 0x41, 0x39, 0x81,\n 0x18, 0x98, 0xcc, 0xd0, 0xd3, 0xa0, 0x3a, 0xed, 0x6c, 0x77, 0xf8, 0xc3, 0x99,\n 0x38, 0x13, 0xf4, 0x79, 0xd2, 0x02, 0x20, 0x31, 0xfe, 0x6b, 0x6a, 0x57, 0x4b,\n 0x56, 0xc5, 0x10, 0x40, 0x03, 0xcf, 0x07, 0x90, 0x0d, 0x11, 0xff, 0xaf, 0x30,\n 0x3d, 0xc0, 0x16, 0xda, 0x4c, 0x1c, 0x3d, 0x18, 0x46, 0x63, 0xda, 0x8f, 0x6a,\n]);\nconst DATE_TIME_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0xfc, 0x58, 0x0f, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61,\n 0x6c, 0x20, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x47, 0x30, 0x45, 0x02, 0x21,\n 0x00, 0xe8, 0x47, 0x16, 0x6e, 0x60, 0xf8, 0x51, 0xe3, 0xc8, 0xd1, 0xf4, 0x41,\n 0x39, 0x81, 0x18, 0x98, 0xcc, 0xd0, 0xd3, 0xa0, 0x3a, 0xed, 0x6c, 0x77, 0xf8,\n 0xc3, 0x99, 0x38, 0x13, 0xf4, 0x79, 0xd2, 0x02, 0x20, 0x31, 0xfe, 0x6b, 0x6a,\n 0x57, 0x4b, 0x56, 0xc5, 0x10, 0x40, 0x03, 0xcf, 0x07, 0x90, 0x0d, 0x11, 0xff,\n 0xaf, 0x30, 0x3d, 0xc0, 0x16, 0xda, 0x4c, 0x1c, 0x3d, 0x18, 0x46, 0x63, 0xda,\n 0x8f, 0x6a,\n]);\nconst DISCARDED_PATH_APDU = Uint8Array.from([\n 0xe0, 0x1e, 0x00, 0x01, 0x11, 0x10, 0x74, 0x6f, 0x2e, 0x5b, 0x5d, 0x2e, 0x77,\n 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x2e, 0x5b, 0x5d,\n]);\n\ndescribe(\"SendEIP712FilteringCommand\", () => {\n describe(\"name\", () => {\n it(\"should be 'sendEIP712Filtering'\", () => {\n const command = new SendEIP712FilteringCommand({\n type: Eip712FilterType.Activation,\n });\n expect(command.name).toBe(\"sendEIP712Filtering\");\n });\n });\n\n describe(\"getApdu\", () => {\n it(\"Activate APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Activation,\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(ACTIVATE_APDU);\n });\n\n it(\"Discarded path APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.DiscardedPath,\n path: \"to.[].wallets.[]\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(DISCARDED_PATH_APDU);\n });\n\n it(\"Message info APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.MessageInfo,\n displayName: \"1inch Order\",\n filtersCount: 6,\n signature:\n \"30440220295e0aeb17ca0929b2a94c324d67d0b5528aba268177f3ac297b563141e0002702203ac360d9fd0c9c0c12279d1e73bea5d549a1e8141f454d88fbe1e8ef970e6802\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(MESSAGE_INFO_APDU);\n });\n\n it(\"Raw APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Raw,\n discarded: false,\n displayName: \"From\",\n signature:\n \"3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(RAW_APDU);\n });\n\n it(\"Calldata info APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.CalldataInfo,\n discarded: false,\n calldataIndex: 3,\n valueFlag: true,\n calleeFlag: CalldataParamPresence.Present,\n chainIdFlag: false,\n selectorFlag: true,\n amountFlag: false,\n spenderFlag: CalldataParamPresence.VerifyingContract,\n signature:\n \"3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(CALLDATA_INFO_APDU);\n });\n\n it.each([\n { name: \"spender\", type: Eip712FilterType.CalldataSpender, cmd: 0xf4 },\n { name: \"amount\", type: Eip712FilterType.CalldataAmount, cmd: 0xf5 },\n { name: \"selector\", type: Eip712FilterType.CalldataSelector, cmd: 0xf6 },\n { name: \"chainId\", type: Eip712FilterType.CalldataChainId, cmd: 0xf7 },\n { name: \"callee\", type: Eip712FilterType.CalldataCallee, cmd: 0xf8 },\n { name: \"value\", type: Eip712FilterType.CalldataValue, cmd: 0xf9 },\n ])(\"Calldata APDU $name\", ({ type, cmd }) => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type,\n discarded: false,\n calldataIndex: 7,\n signature:\n \"3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28\",\n } as SendEIP712FilteringCommandArgs;\n const expectedApdu = Uint8Array.from(CALLDATA_VALUE_APDU);\n expectedApdu[3] = cmd;\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(expectedApdu);\n });\n\n it(\"Token APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Token,\n discarded: false,\n tokenIndex: 1,\n signature:\n \"3045022100ff727847445431e571cd2a0d9db42a7eb62e37877b9bf20e6a96584255347e1902200a6e95b7f8e63b2fab0bef88c747de6a387d06351be5bdc34b2c1f9aea6fdd28\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(TOKEN_APDU);\n });\n\n it(\"Amount APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Amount,\n discarded: false,\n displayName: \"Receive minimum\",\n tokenIndex: 1,\n signature:\n \"3045022100a59dc479a838a813909c140a15e6b65bc58c5633284bf973c436de5a592634e202201e038fc7995d939fccd546e4c85e793c0ad451216e36a4edfc7bce5be27808cb\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(AMOUNT_APDU);\n });\n\n it(\"Date-time APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Datetime,\n discarded: false,\n displayName: \"Approval expire\",\n signature:\n \"3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(DATE_TIME_APDU);\n });\n\n it(\"Trusted name APDU\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.TrustedName,\n discarded: false,\n displayName: \"Spender\",\n typesAndSourcesPayload: \"010203010002\",\n signature:\n \"3045022100e847166e60f851e3c8d1f44139811898ccd0d3a03aed6c77f8c3993813f479d2022031fe6b6a574b56c5104003cf07900d11ffaf303dc016da4c1c3d184663da8f6a\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(TRUSTED_NAME_APDU);\n });\n\n it(\"Discarded filter\", () => {\n // GIVEN\n const args: SendEIP712FilteringCommandArgs = {\n type: Eip712FilterType.Raw,\n discarded: true,\n displayName: \"From\",\n signature:\n \"3045022100b820e4dfb1a0cde6dc97d9a34eebb1a4eef0b226262e6788118ab3c7fb79fe3502202d426a388b4c3a8096b3f84412a702ea537770e61ee0727ec1b710c1da520c44\",\n };\n // WHEN\n const command = new SendEIP712FilteringCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n Uint8Array.from([...RAW_APDU.slice(0, 2), 0x01, ...RAW_APDU.slice(3)]),\n );\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should return an error if the response status code is invalid\", () => {\n // GIVEN\n const response: ApduResponse = {\n statusCode: Buffer.from([0x6a, 0x80]), // Invalid status code\n data: Buffer.from([]),\n };\n // WHEN\n const command = new SendEIP712FilteringCommand({\n type: Eip712FilterType.Activation,\n });\n // THEN\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBe(false);\n });\n\n it(\"should parse the response\", () => {\n // GIVEN\n const response: ApduResponse = {\n statusCode: Buffer.from([0x90, 0x00]), // Success status code\n data: Buffer.from([]),\n };\n // WHEN\n const command = new SendEIP712FilteringCommand({\n type: Eip712FilterType.Activation,\n });\n // THEN\n expect(command.parseResponse(response)).toStrictEqual(\n CommandResultFactory({ data: undefined }),\n );\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAEE,wBAAAA,EACA,0BAAAC,MACK,kCAEP,OACE,yBAAAC,EACA,oBAAAC,EACA,8BAAAC,MAEK,+BAEP,MAAMC,EAAgB,WAAW,KAAK,CAAC,IAAM,GAAM,EAAM,EAAM,CAAI,CAAC,EAC9DC,EAAoB,WAAW,KAAK,CACxC,IAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GAAM,IAAM,IAAM,GAAM,IAAM,GAAM,GACxE,IAAM,IAAM,IAAM,IAAM,EAAM,GAAM,GAAM,GAAM,EAAM,GAAM,GAAM,GAAM,GACxE,IAAM,GAAM,IAAM,EAAM,GAAM,IAAM,IAAM,GAAM,GAAM,GAAM,IAAM,IAAM,IACxE,GAAM,IAAM,IAAM,GAAM,IAAM,IAAM,IAAM,IAAM,GAAM,IAAM,GAAM,GAAM,GACxE,IAAM,EAAM,GAAM,EAAM,GAAM,GAAM,IAAM,GAAM,IAAM,IAAM,GAAM,IAAM,GACxE,GAAM,GAAM,IAAM,GAAM,IAAM,IAAM,IAAM,IAAM,GAAM,IAAM,IAAM,GAAM,GACxE,GAAM,GAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IAAM,GAAM,IAAM,CAC9D,CAAC,EACKC,EAAW,WAAW,KAAK,CAC/B,IAAM,GAAM,EAAM,IAAM,GAAM,EAAM,GAAM,IAAM,IAAM,IAAM,GAAM,GAAM,GACxE,EAAM,GAAM,EAAM,IAAM,GAAM,IAAM,IAAM,IAAM,IAA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,UACzB,CAAC,EAEsB,cAAckB,CAAQ,EAC7C,OAAOpB,EAAuBqB,CAAM,CAAC,EAAE,KAAK,EAAK,CACnD,CAAC,EAED,GAAG,4BAA6B,IAAM,CAEpC,MAAMD,EAAyB,CAC7B,WAAY,OAAO,KAAK,CAAC,IAAM,CAAI,CAAC,EACpC,KAAM,OAAO,KAAK,CAAC,CAAC,CACtB,EAEMN,EAAU,IAAIX,EAA2B,CAC7C,KAAMD,EAAiB,UACzB,CAAC,EAED,OAAOY,EAAQ,cAAcM,CAAQ,CAAC,EAAE,cACtCrB,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["CommandResultFactory", "isSuccessCommandResult", "CalldataParamPresence", "Eip712FilterType", "SendEIP712FilteringCommand", "ACTIVATE_APDU", "MESSAGE_INFO_APDU", "RAW_APDU", "CALLDATA_INFO_APDU", "CALLDATA_VALUE_APDU", "TOKEN_APDU", "AMOUNT_APDU", "TRUSTED_NAME_APDU", "DATE_TIME_APDU", "DISCARDED_PATH_APDU", "command", "args", "apdu", "type", "cmd", "expectedApdu", "response", "result"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ApduBuilder as o,CommandResultFactory as m}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as u}from"@ledgerhq/signer-utils";import{Just as p,Maybe as c,Nothing as a}from"purify-ts";import{ArrayType as i,PrimitiveType as y,StructType as d}from"../../typed-data/model/Types";import{ETH_APP_ERRORS as l,EthAppCommandErrorFactory as g}from"./utils/ethAppErrors";var f=(t=>(t[t.Name=0]="Name",t[t.Field=255]="Field",t))(f||{});class D{constructor(e){this.args=e}errorHelper=new u(l,g);getApdu(){const e={cla:224,ins:26,p1:0,p2:this.args.command};if(this.args.command===0)return new o(e).addAsciiStringToData(this.args.name).build();const t=new o(e),s=this.constructTypeDescByte(this.args.type);if(t.add8BitUIntToData(s),this.getTypeCustomName(this.args.type).ifJust(r=>{t.encodeInLVFromAscii(r)}),this.getTypeSize(this.args.type).ifJust(r=>{t.add8BitUIntToData(r)}),this.args.type instanceof i){t.add8BitUIntToData(this.args.type.levels.length);for(const r of this.args.type.levels)r.caseOf({Just:n=>{t.add8BitUIntToData(1).add8BitUIntToData(n)},Nothing:()=>{t.add8BitUIntToData(0)}})}return t.encodeInLVFromAscii(this.args.name).build()}parseResponse(e){return c.fromNullable(this.errorHelper.getError(e)).orDefault(m({data:void 0}))}constructTypeDescByte(e){const t=e instanceof i?1:0,s=this.getTypeSize(e).isJust()?1:0,r=this.getType(e);return t<<7|s<<6|r}getTypeSize(e){return e instanceof i?this.getTypeSize(e.rootType):e instanceof y?e.size:a}getTypeCustomName(e){return e instanceof i?this.getTypeCustomName(e.rootType):e instanceof d?p(e.typeName):a}getType(e){if(e instanceof i)return this.getType(e.rootType);if(e instanceof d)return 0;switch(e.name){case"int":return 1;case"uint":return 2;case"address":return 3;case"bool":return 4;case"string":return 5;case"bytes":return e.size.isJust()?6:7}}}export{D as SendEIP712StructDefinitionCommand,f as StructDefinitionCommand};
1
+ import{ApduBuilder as o,CommandResultFactory as m}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as u}from"@ledgerhq/signer-utils";import{Just as p,Maybe as c,Nothing as a}from"purify-ts";import{ArrayType as r,PrimitiveType as y,StructType as d}from"../../typed-data/model/Types";import{ETH_APP_ERRORS as l,EthAppCommandErrorFactory as g}from"./utils/ethAppErrors";var f=(t=>(t[t.Name=0]="Name",t[t.Field=255]="Field",t))(f||{});class E{constructor(e){this.args=e}name="sendEIP712StructDefinition";errorHelper=new u(l,g);getApdu(){const e={cla:224,ins:26,p1:0,p2:this.args.command};if(this.args.command===0)return new o(e).addAsciiStringToData(this.args.name).build();const t=new o(e),n=this.constructTypeDescByte(this.args.type);if(t.add8BitUIntToData(n),this.getTypeCustomName(this.args.type).ifJust(i=>{t.encodeInLVFromAscii(i)}),this.getTypeSize(this.args.type).ifJust(i=>{t.add8BitUIntToData(i)}),this.args.type instanceof r){t.add8BitUIntToData(this.args.type.levels.length);for(const i of this.args.type.levels)i.caseOf({Just:s=>{t.add8BitUIntToData(1).add8BitUIntToData(s)},Nothing:()=>{t.add8BitUIntToData(0)}})}return t.encodeInLVFromAscii(this.args.name).build()}parseResponse(e){return c.fromNullable(this.errorHelper.getError(e)).orDefault(m({data:void 0}))}constructTypeDescByte(e){const t=e instanceof r?1:0,n=this.getTypeSize(e).isJust()?1:0,i=this.getType(e);return t<<7|n<<6|i}getTypeSize(e){return e instanceof r?this.getTypeSize(e.rootType):e instanceof y?e.size:a}getTypeCustomName(e){return e instanceof r?this.getTypeCustomName(e.rootType):e instanceof d?p(e.typeName):a}getType(e){if(e instanceof r)return this.getType(e.rootType);if(e instanceof d)return 0;switch(e.name){case"int":return 1;case"uint":return 2;case"address":return 3;case"bool":return 4;case"string":return 5;case"bytes":return e.size.isJust()?6:7}}}export{E as SendEIP712StructDefinitionCommand,f as StructDefinitionCommand};
2
2
  //# sourceMappingURL=SendEIP712StructDefinitionCommand.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SendEIP712StructDefinitionCommand.ts"],
4
- "sourcesContent": ["// https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#eip712-send-struct-definition\nimport {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Just, Maybe, Nothing } from \"purify-ts\";\n\nimport {\n ArrayType,\n type FieldName,\n type FieldType,\n PrimitiveType,\n StructType,\n} from \"@internal/typed-data/model/Types\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"./utils/ethAppErrors\";\n\nexport enum StructDefinitionCommand {\n Name = 0,\n Field = 255,\n}\n\nexport type SendEIP712StructDefinitionCommandArgs =\n | { command: StructDefinitionCommand.Name; name: string }\n | {\n command: StructDefinitionCommand.Field;\n name: FieldName;\n type: FieldType;\n };\n\nenum ArraySize {\n Dynamic,\n Fixed,\n}\n\nenum Type {\n Custom,\n Int,\n Uint,\n Address,\n Bool,\n String,\n FixedSizedBytes,\n DynamicSizedBytes,\n}\n\nexport class SendEIP712StructDefinitionCommand\n implements Command<void, SendEIP712StructDefinitionCommandArgs, EthErrorCodes>\n{\n private readonly errorHelper = new CommandErrorHelper<void, EthErrorCodes>(\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n );\n\n constructor(private args: SendEIP712StructDefinitionCommandArgs) {}\n\n getApdu(): Apdu {\n const SendEIP712StructDefinitionArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x1a,\n p1: 0x00,\n p2: this.args.command,\n };\n\n // Struct name\n if (this.args.command === StructDefinitionCommand.Name) {\n return new ApduBuilder(SendEIP712StructDefinitionArgs)\n .addAsciiStringToData(this.args.name)\n .build();\n }\n\n // Struct field\n const builder = new ApduBuilder(SendEIP712StructDefinitionArgs);\n\n const typeDesc = this.constructTypeDescByte(this.args.type);\n\n // Add type descriptor\n builder.add8BitUIntToData(typeDesc);\n\n // Add struct name if this is a custom type\n this.getTypeCustomName(this.args.type).ifJust((customName) => {\n builder.encodeInLVFromAscii(customName);\n });\n\n // Add type size, if applicable\n this.getTypeSize(this.args.type).ifJust((size) => {\n builder.add8BitUIntToData(size);\n });\n\n // Add array levels, if it is an array\n if (this.args.type instanceof ArrayType) {\n builder.add8BitUIntToData(this.args.type.levels.length);\n for (const level of this.args.type.levels) {\n level.caseOf({\n Just: (l) => {\n builder.add8BitUIntToData(ArraySize.Fixed).add8BitUIntToData(l);\n },\n Nothing: () => {\n builder.add8BitUIntToData(ArraySize.Dynamic);\n },\n });\n }\n }\n\n // Add field name\n return builder.encodeInLVFromAscii(this.args.name).build();\n }\n\n parseResponse(response: ApduResponse): CommandResult<void, EthErrorCodes> {\n return Maybe.fromNullable(this.errorHelper.getError(response)).orDefault(\n CommandResultFactory({ data: undefined }),\n );\n }\n\n private constructTypeDescByte(type: FieldType): number {\n const isArrayBit = type instanceof ArrayType ? 1 : 0;\n const hasTypeSize = this.getTypeSize(type).isJust() ? 1 : 0;\n const typeBits = this.getType(type);\n\n // Combine the bits using bitwise operations\n const combinedBits = (isArrayBit << 7) | (hasTypeSize << 6) | typeBits;\n return combinedBits;\n }\n\n private getTypeSize(type: FieldType): Maybe<number> {\n if (type instanceof ArrayType) {\n return this.getTypeSize(type.rootType);\n }\n return type instanceof PrimitiveType ? type.size : Nothing;\n }\n\n private getTypeCustomName(type: FieldType): Maybe<string> {\n if (type instanceof ArrayType) {\n return this.getTypeCustomName(type.rootType);\n }\n return type instanceof StructType ? Just(type.typeName) : Nothing;\n }\n\n private getType(type: FieldType): Type {\n if (type instanceof ArrayType) {\n return this.getType(type.rootType);\n } else if (type instanceof StructType) {\n return Type.Custom;\n }\n switch (type.name) {\n case \"int\":\n return Type.Int;\n case \"uint\":\n return Type.Uint;\n case \"address\":\n return Type.Address;\n case \"bool\":\n return Type.Bool;\n case \"string\":\n return Type.String;\n case \"bytes\":\n return type.size.isJust()\n ? Type.FixedSizedBytes\n : Type.DynamicSizedBytes;\n }\n }\n}\n"],
5
- "mappings": "AACA,OAEE,eAAAA,EAKA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,QAAAC,EAAM,SAAAC,EAAO,WAAAC,MAAe,YAErC,OACE,aAAAC,EAGA,iBAAAC,EACA,cAAAC,MACK,mCAEP,OACE,kBAAAC,EACA,6BAAAC,MAEK,uBAEA,IAAKC,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,MAAQ,KAAR,QAFUA,OAAA,IA6BL,MAAMC,CAEb,CAME,YAAoBC,EAA6C,CAA7C,UAAAA,CAA8C,CALjD,YAAc,IAAIC,EACjCC,EACAC,CACF,EAIA,SAAgB,CACd,MAAMC,EAAkD,CACtD,IAAK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YAAYM,EAAK,QAAQ,EAEhCA,aAAgBI,EAAgBJ,EAAK,KAAOK,CACrD,CAEQ,kBAAkBL,EAAgC,CACxD,OAAIA,aAAgBN,EACX,KAAK,kBAAkBM,EAAK,QAAQ,EAEtCA,aAAgBM,EAAaC,EAAKP,EAAK,QAAQ,EAAIK,CAC5D,CAEQ,QAAQL,EAAuB,CACrC,GAAIA,aAAgBN,EAClB,OAAO,KAAK,QAAQM,EAAK,QAAQ,EAC5B,GAAIA,aAAgBM,EACzB,MAAO,GAET,OAAQN,EAAK,KAAM,CACjB,IAAK,MACH,MAAO,GACT,IAAK,OACH,MAAO,GACT,IAAK,UACH,MAAO,GACT,IAAK,OACH,MAAO,GACT,IAAK,SACH,MAAO,GACT,IAAK,QACH,OAAOA,EAAK,KAAK,OAAO,EACpB,EACA,CACR,CACF,CACF",
4
+ "sourcesContent": ["// https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#eip712-send-struct-definition\nimport {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Just, Maybe, Nothing } from \"purify-ts\";\n\nimport {\n ArrayType,\n type FieldName,\n type FieldType,\n PrimitiveType,\n StructType,\n} from \"@internal/typed-data/model/Types\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"./utils/ethAppErrors\";\n\nexport enum StructDefinitionCommand {\n Name = 0,\n Field = 255,\n}\n\nexport type SendEIP712StructDefinitionCommandArgs =\n | { command: StructDefinitionCommand.Name; name: string }\n | {\n command: StructDefinitionCommand.Field;\n name: FieldName;\n type: FieldType;\n };\n\nenum ArraySize {\n Dynamic,\n Fixed,\n}\n\nenum Type {\n Custom,\n Int,\n Uint,\n Address,\n Bool,\n String,\n FixedSizedBytes,\n DynamicSizedBytes,\n}\n\nexport class SendEIP712StructDefinitionCommand\n implements Command<void, SendEIP712StructDefinitionCommandArgs, EthErrorCodes>\n{\n readonly name = \"sendEIP712StructDefinition\";\n private readonly errorHelper = new CommandErrorHelper<void, EthErrorCodes>(\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n );\n\n constructor(private args: SendEIP712StructDefinitionCommandArgs) {}\n\n getApdu(): Apdu {\n const SendEIP712StructDefinitionArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x1a,\n p1: 0x00,\n p2: this.args.command,\n };\n\n // Struct name\n if (this.args.command === StructDefinitionCommand.Name) {\n return new ApduBuilder(SendEIP712StructDefinitionArgs)\n .addAsciiStringToData(this.args.name)\n .build();\n }\n\n // Struct field\n const builder = new ApduBuilder(SendEIP712StructDefinitionArgs);\n\n const typeDesc = this.constructTypeDescByte(this.args.type);\n\n // Add type descriptor\n builder.add8BitUIntToData(typeDesc);\n\n // Add struct name if this is a custom type\n this.getTypeCustomName(this.args.type).ifJust((customName) => {\n builder.encodeInLVFromAscii(customName);\n });\n\n // Add type size, if applicable\n this.getTypeSize(this.args.type).ifJust((size) => {\n builder.add8BitUIntToData(size);\n });\n\n // Add array levels, if it is an array\n if (this.args.type instanceof ArrayType) {\n builder.add8BitUIntToData(this.args.type.levels.length);\n for (const level of this.args.type.levels) {\n level.caseOf({\n Just: (l) => {\n builder.add8BitUIntToData(ArraySize.Fixed).add8BitUIntToData(l);\n },\n Nothing: () => {\n builder.add8BitUIntToData(ArraySize.Dynamic);\n },\n });\n }\n }\n\n // Add field name\n return builder.encodeInLVFromAscii(this.args.name).build();\n }\n\n parseResponse(response: ApduResponse): CommandResult<void, EthErrorCodes> {\n return Maybe.fromNullable(this.errorHelper.getError(response)).orDefault(\n CommandResultFactory({ data: undefined }),\n );\n }\n\n private constructTypeDescByte(type: FieldType): number {\n const isArrayBit = type instanceof ArrayType ? 1 : 0;\n const hasTypeSize = this.getTypeSize(type).isJust() ? 1 : 0;\n const typeBits = this.getType(type);\n\n // Combine the bits using bitwise operations\n const combinedBits = (isArrayBit << 7) | (hasTypeSize << 6) | typeBits;\n return combinedBits;\n }\n\n private getTypeSize(type: FieldType): Maybe<number> {\n if (type instanceof ArrayType) {\n return this.getTypeSize(type.rootType);\n }\n return type instanceof PrimitiveType ? type.size : Nothing;\n }\n\n private getTypeCustomName(type: FieldType): Maybe<string> {\n if (type instanceof ArrayType) {\n return this.getTypeCustomName(type.rootType);\n }\n return type instanceof StructType ? Just(type.typeName) : Nothing;\n }\n\n private getType(type: FieldType): Type {\n if (type instanceof ArrayType) {\n return this.getType(type.rootType);\n } else if (type instanceof StructType) {\n return Type.Custom;\n }\n switch (type.name) {\n case \"int\":\n return Type.Int;\n case \"uint\":\n return Type.Uint;\n case \"address\":\n return Type.Address;\n case \"bool\":\n return Type.Bool;\n case \"string\":\n return Type.String;\n case \"bytes\":\n return type.size.isJust()\n ? Type.FixedSizedBytes\n : Type.DynamicSizedBytes;\n }\n }\n}\n"],
5
+ "mappings": "AACA,OAEE,eAAAA,EAKA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,QAAAC,EAAM,SAAAC,EAAO,WAAAC,MAAe,YAErC,OACE,aAAAC,EAGA,iBAAAC,EACA,cAAAC,MACK,mCAEP,OACE,kBAAAC,EACA,6BAAAC,MAEK,uBAEA,IAAKC,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,MAAQ,KAAR,QAFUA,OAAA,IA6BL,MAAMC,CAEb,CAOE,YAAoBC,EAA6C,CAA7C,UAAAA,CAA8C,CANzD,KAAO,6BACC,YAAc,IAAIC,EACjCC,EACAC,CACF,EAIA,SAAgB,CACd,MAAMC,EAAkD,CACtD,IAAK,IACL,IAAK,GACL,GAAI,EACJ,GAAI,KAAK,KAAK,OAChB,EAGA,GAAI,KAAK,KAAK,UAAY,EACxB,OAAO,IAAIC,EAAYD,CAA8B,EAClD,qBAAqB,KAAK,KAAK,IAAI,EACnC,MAAM,EAIX,MA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EAAKP,EAAK,QAAQ,EAAIK,CAC5D,CAEQ,QAAQL,EAAuB,CACrC,GAAIA,aAAgBN,EAClB,OAAO,KAAK,QAAQM,EAAK,QAAQ,EAC5B,GAAIA,aAAgBM,EACzB,MAAO,GAET,OAAQN,EAAK,KAAM,CACjB,IAAK,MACH,MAAO,GACT,IAAK,OACH,MAAO,GACT,IAAK,UACH,MAAO,GACT,IAAK,OACH,MAAO,GACT,IAAK,SACH,MAAO,GACT,IAAK,QACH,OAAOA,EAAK,KAAK,OAAO,EACpB,EACA,CACR,CACF,CACF",
6
6
  "names": ["ApduBuilder", "CommandResultFactory", "CommandErrorHelper", "Just", "Maybe", "Nothing", "ArrayType", "PrimitiveType", "StructType", "ETH_APP_ERRORS", "EthAppCommandErrorFactory", "StructDefinitionCommand", "SendEIP712StructDefinitionCommand", "args", "CommandErrorHelper", "ETH_APP_ERRORS", "EthAppCommandErrorFactory", "SendEIP712StructDefinitionArgs", "ApduBuilder", "builder", "typeDesc", "customName", "size", "ArrayType", "level", "l", "response", "Maybe", "CommandResultFactory", "type", "isArrayBit", "hasTypeSize", "typeBits", "PrimitiveType", "Nothing", "StructType", "Just"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{CommandResultFactory as u,isSuccessCommandResult as p}from"@ledgerhq/device-management-kit";import{Just as a,Nothing as x}from"purify-ts";import{ArrayType as d,PrimitiveType as o,StructType as i}from"../../typed-data/model/Types";import{SendEIP712StructDefinitionCommand as n,StructDefinitionCommand as r}from"./SendEIP712StructDefinitionCommand";const c=Uint8Array.from([224,26,0,0,12,69,73,80,55,49,50,68,111,109,97,105,110]),m=Uint8Array.from([224,26,0,0,5,71,114,111,117,112]),f=Uint8Array.from([224,26,0,255,6,5,4,110,97,109,101]),E=Uint8Array.from([224,26,0,255,9,5,7,118,101,114,115,105,111,110]),A=Uint8Array.from([224,26,0,255,10,66,32,7,99,104,97,105,110,73,100]),y=Uint8Array.from([224,26,0,255,19,3,17,118,101,114,105,102,121,105,110,103,67,111,110,116,114,97,99,116]),l=Uint8Array.from([224,26,0,255,18,128,6,80,101,114,115,111,110,1,0,7,109,101,109,98,101,114,115]),_=Uint8Array.from([224,26,0,255,13,0,6,80,101,114,115,111,110,4,102,114,111,109]),w=Uint8Array.from([224,26,0,255,11,131,1,0,7,119,97,108,108,101,116,115]),I=Uint8Array.from([224,26,0,255,17,7,15,115,116,97,116,105,99,69,120,116,114,97,100,97,116,97]),g=Uint8Array.from([224,26,0,255,20,7,18,114,101,112,108,97,99,101,109,101,110,116,80,97,116,116,101,114,110]),D=Uint8Array.from([224,26,0,255,11,70,4,8,100,97,116,97,84,121,112,101]),S=Uint8Array.from([224,26,0,255,14,133,2,1,3,0,8,100,111,99,117,109,101,110,116]),F=Uint8Array.from([224,26,0,255,14,194,1,4,0,0,0,0,6,100,101,112,116,104,121]);describe("SendEIP712StructDefinitionCommand",()=>{let t;describe("getApdu",()=>{it("should return the apdu for 'EIP712Domain' name definition",()=>{t=new n({command:r.Name,name:"EIP712Domain"});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(c)}),it("should return the apdu for 'Group' name definition",()=>{t=new n({command:r.Name,name:"Group"});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(m)}),it("should return the apdu for 'name' of type 'string'",()=>{t=new n({command:r.Field,name:"name",type:new o("string","string",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(f)}),it("should return the apdu for 'version' of type 'string'",()=>{t=new n({command:r.Field,name:"version",type:new o("string","string",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(E)}),it("should return the apdu for 'chainId' of type 'uint256'",()=>{t=new n({command:r.Field,name:"chainId",type:new o("uint256","uint",a(32))});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(A)}),it("should return the apdu for 'verifyingContract' of type 'address'",()=>{t=new n({command:r.Field,name:"verifyingContract",type:new o("address","address",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(y)}),it("should return the apdu for 'members' of type 'Person[]'",()=>{t=new n({command:r.Field,name:"members",type:new d("Person[]",new i("Person"),"Person",x,[x])});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(l)}),it("should return the apdu for 'from' of type 'Person'",()=>{t=new n({command:r.Field,name:"from",type:new i("Person")});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(_)}),it("should return the apdu for 'wallets' of type 'address[]'",()=>{t=new n({command:r.Field,name:"wallets",type:new d("address[]",new o("address","address",x),"address",x,[x])});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(w)}),it("should return the apdu for 'staticExtradata' of type 'bytes'",()=>{t=new n({command:r.Field,name:"staticExtradata",type:new o("bytes","bytes",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(I)}),it("should return the apdu for 'replacementPattern' of type 'bytes'",()=>{t=new n({command:r.Field,name:"replacementPattern",type:new o("bytes","bytes",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(g)}),it("should return the apdu for 'dataType' of type 'bytes4'",()=>{t=new n({command:r.Field,name:"dataType",type:new o("bytes4","bytes",a(4))});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(D)}),it("should return the apdu for 'document' of type 'string[3][]'",()=>{t=new n({command:r.Field,name:"document",type:new d("string[3][]",new o("string","string",x),"string[3]",x,[a(3),x])});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(S)}),it("should return the apdu for 'depthy' of type 'uint8[][][][]'",()=>{t=new n({command:r.Field,name:"depthy",type:new d("uint8[][][][]",new o("uint8","uint",a(1)),"uint8[][][]",x,[x,x,x,x])});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(F)})}),describe("parseResponse",()=>{it("should parse the response",()=>{const e={statusCode:Uint8Array.from([144,0]),data:new Uint8Array},s=t.parseResponse(e);expect(s).toStrictEqual(u({data:void 0}))}),it("should throw an error if the response is not successful",()=>{const e={statusCode:Uint8Array.from([85,21]),data:new Uint8Array},s=t.parseResponse(e);expect(p(s)).toBe(!1)})})});
1
+ import{CommandResultFactory as u,isSuccessCommandResult as p}from"@ledgerhq/device-management-kit";import{Just as a,Nothing as x}from"purify-ts";import{ArrayType as d,PrimitiveType as o,StructType as i}from"../../typed-data/model/Types";import{SendEIP712StructDefinitionCommand as n,StructDefinitionCommand as r}from"./SendEIP712StructDefinitionCommand";const c=Uint8Array.from([224,26,0,0,12,69,73,80,55,49,50,68,111,109,97,105,110]),m=Uint8Array.from([224,26,0,0,5,71,114,111,117,112]),f=Uint8Array.from([224,26,0,255,6,5,4,110,97,109,101]),E=Uint8Array.from([224,26,0,255,9,5,7,118,101,114,115,105,111,110]),A=Uint8Array.from([224,26,0,255,10,66,32,7,99,104,97,105,110,73,100]),y=Uint8Array.from([224,26,0,255,19,3,17,118,101,114,105,102,121,105,110,103,67,111,110,116,114,97,99,116]),l=Uint8Array.from([224,26,0,255,18,128,6,80,101,114,115,111,110,1,0,7,109,101,109,98,101,114,115]),_=Uint8Array.from([224,26,0,255,13,0,6,80,101,114,115,111,110,4,102,114,111,109]),w=Uint8Array.from([224,26,0,255,11,131,1,0,7,119,97,108,108,101,116,115]),I=Uint8Array.from([224,26,0,255,17,7,15,115,116,97,116,105,99,69,120,116,114,97,100,97,116,97]),g=Uint8Array.from([224,26,0,255,20,7,18,114,101,112,108,97,99,101,109,101,110,116,80,97,116,116,101,114,110]),D=Uint8Array.from([224,26,0,255,11,70,4,8,100,97,116,97,84,121,112,101]),S=Uint8Array.from([224,26,0,255,14,133,2,1,3,0,8,100,111,99,117,109,101,110,116]),h=Uint8Array.from([224,26,0,255,14,194,1,4,0,0,0,0,6,100,101,112,116,104,121]);describe("SendEIP712StructDefinitionCommand",()=>{let t;describe("name",()=>{it("should be 'sendEIP712StructDefinition'",()=>{const e=new n({command:r.Name,name:"test"});expect(e.name).toBe("sendEIP712StructDefinition")})}),describe("getApdu",()=>{it("should return the apdu for 'EIP712Domain' name definition",()=>{t=new n({command:r.Name,name:"EIP712Domain"});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(c)}),it("should return the apdu for 'Group' name definition",()=>{t=new n({command:r.Name,name:"Group"});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(m)}),it("should return the apdu for 'name' of type 'string'",()=>{t=new n({command:r.Field,name:"name",type:new o("string","string",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(f)}),it("should return the apdu for 'version' of type 'string'",()=>{t=new n({command:r.Field,name:"version",type:new o("string","string",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(E)}),it("should return the apdu for 'chainId' of type 'uint256'",()=>{t=new n({command:r.Field,name:"chainId",type:new o("uint256","uint",a(32))});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(A)}),it("should return the apdu for 'verifyingContract' of type 'address'",()=>{t=new n({command:r.Field,name:"verifyingContract",type:new o("address","address",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(y)}),it("should return the apdu for 'members' of type 'Person[]'",()=>{t=new n({command:r.Field,name:"members",type:new d("Person[]",new i("Person"),"Person",x,[x])});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(l)}),it("should return the apdu for 'from' of type 'Person'",()=>{t=new n({command:r.Field,name:"from",type:new i("Person")});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(_)}),it("should return the apdu for 'wallets' of type 'address[]'",()=>{t=new n({command:r.Field,name:"wallets",type:new d("address[]",new o("address","address",x),"address",x,[x])});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(w)}),it("should return the apdu for 'staticExtradata' of type 'bytes'",()=>{t=new n({command:r.Field,name:"staticExtradata",type:new o("bytes","bytes",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(I)}),it("should return the apdu for 'replacementPattern' of type 'bytes'",()=>{t=new n({command:r.Field,name:"replacementPattern",type:new o("bytes","bytes",x)});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(g)}),it("should return the apdu for 'dataType' of type 'bytes4'",()=>{t=new n({command:r.Field,name:"dataType",type:new o("bytes4","bytes",a(4))});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(D)}),it("should return the apdu for 'document' of type 'string[3][]'",()=>{t=new n({command:r.Field,name:"document",type:new d("string[3][]",new o("string","string",x),"string[3]",x,[a(3),x])});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(S)}),it("should return the apdu for 'depthy' of type 'uint8[][][][]'",()=>{t=new n({command:r.Field,name:"depthy",type:new d("uint8[][][][]",new o("uint8","uint",a(1)),"uint8[][][]",x,[x,x,x,x])});const e=t.getApdu();expect(e.getRawApdu()).toStrictEqual(h)})}),describe("parseResponse",()=>{it("should parse the response",()=>{const e={statusCode:Uint8Array.from([144,0]),data:new Uint8Array},s=t.parseResponse(e);expect(s).toStrictEqual(u({data:void 0}))}),it("should throw an error if the response is not successful",()=>{const e={statusCode:Uint8Array.from([85,21]),data:new Uint8Array},s=t.parseResponse(e);expect(p(s)).toBe(!1)})})});
2
2
  //# sourceMappingURL=SendEIP712StructDefinitionCommand.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SendEIP712StructDefinitionCommand.test.ts"],
4
- "sourcesContent": ["import {\n type Command,\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\nimport { Just, Nothing } from \"purify-ts\";\n\nimport {\n ArrayType,\n PrimitiveType,\n StructType,\n} from \"@internal/typed-data/model/Types\";\n\nimport { type EthErrorCodes } from \"./utils/ethAppErrors\";\nimport {\n SendEIP712StructDefinitionCommand,\n type SendEIP712StructDefinitionCommandArgs,\n StructDefinitionCommand,\n} from \"./SendEIP712StructDefinitionCommand\";\n\nconst EIP712_DEF_NAME_EIP712DOMAIN = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0x00, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x31, 0x32, 0x44, 0x6f,\n 0x6d, 0x61, 0x69, 0x6e,\n]);\n\nconst EIP712_DEF_NAME_GROUP = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0x00, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70,\n]);\n\n// name string\nconst EIP712_DEF_FIELD_NAME_STRING = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x06, 0x05, 0x04, 0x6e, 0x61, 0x6d, 0x65,\n]);\n\n// version string\nconst EIP712_DEF_FIELD_VERSION_STRING = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x09, 0x05, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,\n 0x6e,\n]);\n\n// chainId uint256\nconst EIP712_DEF_FIELD_CHAINID_UINT256 = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0a, 0x42, 0x20, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e,\n 0x49, 0x64,\n]);\n\n// verifyingContract address\nconst EIP712_DEF_FIELD_VERIFYINGCONTRACT_ADDRESS = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x13, 0x03, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79,\n 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74,\n]);\n\n// members Person[]\nconst EIP712_DEF_FIELD_MEMBERS_PERSON = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x12, 0x80, 0x06, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e,\n 0x01, 0x00, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73,\n]);\n\n// from Person\nconst EIP712_DEF_FIELD_FROM_PERSON = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0d, 0x00, 0x06, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e,\n 0x04, 0x66, 0x72, 0x6f, 0x6d,\n]);\n\n// wallets address[]\nconst EIP712_DEF_FIELD_WALLETS_ADDRESS = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0b, 0x83, 0x01, 0x00, 0x07, 0x77, 0x61, 0x6c, 0x6c,\n 0x65, 0x74, 0x73,\n]);\n\n// staticExtradata bytes\nconst EIP712_DEF_FIELD_STATICEXTRADATA_BYTES = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x11, 0x07, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63,\n 0x45, 0x78, 0x74, 0x72, 0x61, 0x64, 0x61, 0x74, 0x61,\n]);\n\n// replacementPattern bytes\nconst EIP712_DEF_FIELD_REPLACEMENTPATTERN_BYTES = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x14, 0x07, 0x12, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63,\n 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e,\n]);\n\n// dataType bytes4\nconst EIP712_DEF_FIELD_DATA_TYPE_BYTES4 = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0b, 0x46, 0x04, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54,\n 0x79, 0x70, 0x65,\n]);\n\n// document string[3][]\nconst EIP712_DEF_FIELD_DOCUMENT_STRING = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0e, 0x85, 0x02, 0x01, 0x03, 0x00, 0x08, 0x64, 0x6f,\n 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,\n]);\n\n// depthy uint8[][][][]\nconst EIP712_DEF_FIELD_DEPTHY_UINT8 = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0e, 0xc2, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x06,\n 0x64, 0x65, 0x70, 0x74, 0x68, 0x79,\n]);\n\n// TODO: find examples for bool and int types.\n\ndescribe(\"SendEIP712StructDefinitionCommand\", () => {\n let command: Command<\n void,\n SendEIP712StructDefinitionCommandArgs,\n EthErrorCodes\n >;\n\n describe(\"getApdu\", () => {\n it(\"should return the apdu for 'EIP712Domain' name definition\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Name,\n name: \"EIP712Domain\",\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_NAME_EIP712DOMAIN);\n });\n\n it(\"should return the apdu for 'Group' name definition\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Name,\n name: \"Group\",\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_NAME_GROUP);\n });\n\n it(\"should return the apdu for 'name' of type 'string'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"name\",\n type: new PrimitiveType(\"string\", \"string\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_NAME_STRING);\n });\n\n it(\"should return the apdu for 'version' of type 'string'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"version\",\n type: new PrimitiveType(\"string\", \"string\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_VERSION_STRING);\n });\n\n it(\"should return the apdu for 'chainId' of type 'uint256'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"chainId\",\n type: new PrimitiveType(\"uint256\", \"uint\", Just(32)),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_CHAINID_UINT256);\n });\n\n it(\"should return the apdu for 'verifyingContract' of type 'address'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"verifyingContract\",\n type: new PrimitiveType(\"address\", \"address\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n EIP712_DEF_FIELD_VERIFYINGCONTRACT_ADDRESS,\n );\n });\n\n it(\"should return the apdu for 'members' of type 'Person[]'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"members\",\n type: new ArrayType(\n \"Person[]\",\n new StructType(\"Person\"),\n \"Person\",\n Nothing,\n [Nothing],\n ),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_MEMBERS_PERSON);\n });\n\n it(\"should return the apdu for 'from' of type 'Person'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"from\",\n type: new StructType(\"Person\"),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_FROM_PERSON);\n });\n\n it(\"should return the apdu for 'wallets' of type 'address[]'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"wallets\",\n type: new ArrayType(\n \"address[]\",\n new PrimitiveType(\"address\", \"address\", Nothing),\n \"address\",\n Nothing,\n [Nothing],\n ),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_WALLETS_ADDRESS);\n });\n\n it(\"should return the apdu for 'staticExtradata' of type 'bytes'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"staticExtradata\",\n type: new PrimitiveType(\"bytes\", \"bytes\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n EIP712_DEF_FIELD_STATICEXTRADATA_BYTES,\n );\n });\n\n it(\"should return the apdu for 'replacementPattern' of type 'bytes'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"replacementPattern\",\n type: new PrimitiveType(\"bytes\", \"bytes\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n EIP712_DEF_FIELD_REPLACEMENTPATTERN_BYTES,\n );\n });\n\n it(\"should return the apdu for 'dataType' of type 'bytes4'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"dataType\",\n type: new PrimitiveType(\"bytes4\", \"bytes\", Just(4)),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n EIP712_DEF_FIELD_DATA_TYPE_BYTES4,\n );\n });\n\n it(\"should return the apdu for 'document' of type 'string[3][]'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"document\",\n type: new ArrayType(\n \"string[3][]\",\n new PrimitiveType(\"string\", \"string\", Nothing),\n \"string[3]\",\n Nothing,\n [Just(3), Nothing],\n ),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_DOCUMENT_STRING);\n });\n\n it(\"should return the apdu for 'depthy' of type 'uint8[][][][]'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"depthy\",\n type: new ArrayType(\n \"uint8[][][][]\",\n new PrimitiveType(\"uint8\", \"uint\", Just(1)),\n \"uint8[][][]\",\n Nothing,\n [Nothing, Nothing, Nothing, Nothing],\n ),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_DEPTHY_UINT8);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should parse the response\", () => {\n // GIVEN\n const response = {\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: new Uint8Array(),\n };\n\n // WHEN\n const parsedResponse = command.parseResponse(response);\n\n // THEN\n expect(parsedResponse).toStrictEqual(\n CommandResultFactory({ data: undefined }),\n );\n });\n\n it(\"should throw an error if the response is not successful\", () => {\n // GIVEN\n const response = {\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: new Uint8Array(),\n };\n\n // WHEN\n const result = command.parseResponse(response);\n\n // THEN\n expect(isSuccessCommandResult(result)).toBe(false);\n });\n });\n});\n"],
5
- "mappings": "AAAA,OAEE,wBAAAA,EACA,0BAAAC,MACK,kCACP,OAAS,QAAAC,EAAM,WAAAC,MAAe,YAE9B,OACE,aAAAC,EACA,iBAAAC,EACA,cAAAC,MACK,mCAGP,OACE,qCAAAC,EAEA,2BAAAC,MACK,sCAEP,MAAMC,EAA+B,WAAW,KAAK,CACnD,IAAM,GAAM,EAAM,EAAM,GAAM,GAAM,GAAM,GAAM,GAAM,GAAM,GAAM,GAAM,IACxE,IAAM,GAAM,IAAM,GACpB,CAAC,EAEKC,EAAwB,WAAW,KAAK,CAC5C,IAAM,GAAM,EAAM,EAAM,EAAM,GAAM,IAAM,IAAM,IAAM,GACxD,CAAC,EAGKC,EAA+B,WAAW,KAAK,CACnD,IAAM,GAAM,EAAM,IAAM,EAAM,EAAM,EAAM,IAAM,GAAM,IAAM,GAC9D,CAAC,EAGKC,EAAkC,WAAW,KAAK,CACtD,IAAM,GAAM,EAAM,IAAM,EAAM,EAAM,EAAM,IAAM,IAAM,IAAM,IAAM,IAAM,IACxE,GACF,CAAC,EAGKC,EAAmC,WAAW,KAAK,CACvD,IAAM,GAAM,EAAM,IAAM,GAAM,GAAM,GAAM,EAAM,GAAM,IAAM,GAAM,IAAM,IACxE,GAAM,GACR,CAAC,EAGKC,EAA6C,W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AACA,EAASA,EAASA,EAASA,CAAO,CACrC,CACF,CAAC,EAGD,MAAMqB,EAAOD,EAAQ,QAAQ,EAG7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cAAcF,CAA6B,CACvE,CAAC,CACH,CAAC,EAED,SAAS,gBAAiB,IAAM,CAC9B,GAAG,4BAA6B,IAAM,CAEpC,MAAMG,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,IAAM,CAAI,CAAC,EACxC,KAAM,IAAI,UACZ,EAGMC,EAAiBH,EAAQ,cAAcE,CAAQ,EAGrD,OAAOC,CAAc,EAAE,cACrB1B,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CAAC,EAED,GAAG,0DAA2D,IAAM,CAElE,MAAMyB,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,GAAM,EAAI,CAAC,EACxC,KAAM,IAAI,UACZ,EAGME,EAASJ,EAAQ,cAAcE,CAAQ,EAG7C,OAAOxB,EAAuB0B,CAAM,CAAC,EAAE,KAAK,EAAK,CACnD,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["CommandResultFactory", "isSuccessCommandResult", "Just", "Nothing", "ArrayType", "PrimitiveType", "StructType", "SendEIP712StructDefinitionCommand", "StructDefinitionCommand", "EIP712_DEF_NAME_EIP712DOMAIN", "EIP712_DEF_NAME_GROUP", "EIP712_DEF_FIELD_NAME_STRING", "EIP712_DEF_FIELD_VERSION_STRING", "EIP712_DEF_FIELD_CHAINID_UINT256", "EIP712_DEF_FIELD_VERIFYINGCONTRACT_ADDRESS", "EIP712_DEF_FIELD_MEMBERS_PERSON", "EIP712_DEF_FIELD_FROM_PERSON", "EIP712_DEF_FIELD_WALLETS_ADDRESS", "EIP712_DEF_FIELD_STATICEXTRADATA_BYTES", "EIP712_DEF_FIELD_REPLACEMENTPATTERN_BYTES", "EIP712_DEF_FIELD_DATA_TYPE_BYTES4", "EIP712_DEF_FIELD_DOCUMENT_STRING", "EIP712_DEF_FIELD_DEPTHY_UINT8", "command", "apdu", "response", "parsedResponse", "result"]
4
+ "sourcesContent": ["import {\n type Command,\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\nimport { Just, Nothing } from \"purify-ts\";\n\nimport {\n ArrayType,\n PrimitiveType,\n StructType,\n} from \"@internal/typed-data/model/Types\";\n\nimport { type EthErrorCodes } from \"./utils/ethAppErrors\";\nimport {\n SendEIP712StructDefinitionCommand,\n type SendEIP712StructDefinitionCommandArgs,\n StructDefinitionCommand,\n} from \"./SendEIP712StructDefinitionCommand\";\n\nconst EIP712_DEF_NAME_EIP712DOMAIN = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0x00, 0x0c, 0x45, 0x49, 0x50, 0x37, 0x31, 0x32, 0x44, 0x6f,\n 0x6d, 0x61, 0x69, 0x6e,\n]);\n\nconst EIP712_DEF_NAME_GROUP = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0x00, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70,\n]);\n\n// name string\nconst EIP712_DEF_FIELD_NAME_STRING = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x06, 0x05, 0x04, 0x6e, 0x61, 0x6d, 0x65,\n]);\n\n// version string\nconst EIP712_DEF_FIELD_VERSION_STRING = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x09, 0x05, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,\n 0x6e,\n]);\n\n// chainId uint256\nconst EIP712_DEF_FIELD_CHAINID_UINT256 = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0a, 0x42, 0x20, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e,\n 0x49, 0x64,\n]);\n\n// verifyingContract address\nconst EIP712_DEF_FIELD_VERIFYINGCONTRACT_ADDRESS = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x13, 0x03, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79,\n 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74,\n]);\n\n// members Person[]\nconst EIP712_DEF_FIELD_MEMBERS_PERSON = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x12, 0x80, 0x06, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e,\n 0x01, 0x00, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73,\n]);\n\n// from Person\nconst EIP712_DEF_FIELD_FROM_PERSON = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0d, 0x00, 0x06, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e,\n 0x04, 0x66, 0x72, 0x6f, 0x6d,\n]);\n\n// wallets address[]\nconst EIP712_DEF_FIELD_WALLETS_ADDRESS = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0b, 0x83, 0x01, 0x00, 0x07, 0x77, 0x61, 0x6c, 0x6c,\n 0x65, 0x74, 0x73,\n]);\n\n// staticExtradata bytes\nconst EIP712_DEF_FIELD_STATICEXTRADATA_BYTES = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x11, 0x07, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63,\n 0x45, 0x78, 0x74, 0x72, 0x61, 0x64, 0x61, 0x74, 0x61,\n]);\n\n// replacementPattern bytes\nconst EIP712_DEF_FIELD_REPLACEMENTPATTERN_BYTES = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x14, 0x07, 0x12, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63,\n 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e,\n]);\n\n// dataType bytes4\nconst EIP712_DEF_FIELD_DATA_TYPE_BYTES4 = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0b, 0x46, 0x04, 0x08, 0x64, 0x61, 0x74, 0x61, 0x54,\n 0x79, 0x70, 0x65,\n]);\n\n// document string[3][]\nconst EIP712_DEF_FIELD_DOCUMENT_STRING = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0e, 0x85, 0x02, 0x01, 0x03, 0x00, 0x08, 0x64, 0x6f,\n 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,\n]);\n\n// depthy uint8[][][][]\nconst EIP712_DEF_FIELD_DEPTHY_UINT8 = Uint8Array.from([\n 0xe0, 0x1a, 0x00, 0xff, 0x0e, 0xc2, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x06,\n 0x64, 0x65, 0x70, 0x74, 0x68, 0x79,\n]);\n\n// TODO: find examples for bool and int types.\n\ndescribe(\"SendEIP712StructDefinitionCommand\", () => {\n let command: Command<\n void,\n SendEIP712StructDefinitionCommandArgs,\n EthErrorCodes\n >;\n\n describe(\"name\", () => {\n it(\"should be 'sendEIP712StructDefinition'\", () => {\n const cmd = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Name,\n name: \"test\",\n });\n expect(cmd.name).toBe(\"sendEIP712StructDefinition\");\n });\n });\n\n describe(\"getApdu\", () => {\n it(\"should return the apdu for 'EIP712Domain' name definition\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Name,\n name: \"EIP712Domain\",\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_NAME_EIP712DOMAIN);\n });\n\n it(\"should return the apdu for 'Group' name definition\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Name,\n name: \"Group\",\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_NAME_GROUP);\n });\n\n it(\"should return the apdu for 'name' of type 'string'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"name\",\n type: new PrimitiveType(\"string\", \"string\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_NAME_STRING);\n });\n\n it(\"should return the apdu for 'version' of type 'string'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"version\",\n type: new PrimitiveType(\"string\", \"string\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_VERSION_STRING);\n });\n\n it(\"should return the apdu for 'chainId' of type 'uint256'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"chainId\",\n type: new PrimitiveType(\"uint256\", \"uint\", Just(32)),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_CHAINID_UINT256);\n });\n\n it(\"should return the apdu for 'verifyingContract' of type 'address'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"verifyingContract\",\n type: new PrimitiveType(\"address\", \"address\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n EIP712_DEF_FIELD_VERIFYINGCONTRACT_ADDRESS,\n );\n });\n\n it(\"should return the apdu for 'members' of type 'Person[]'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"members\",\n type: new ArrayType(\n \"Person[]\",\n new StructType(\"Person\"),\n \"Person\",\n Nothing,\n [Nothing],\n ),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_MEMBERS_PERSON);\n });\n\n it(\"should return the apdu for 'from' of type 'Person'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"from\",\n type: new StructType(\"Person\"),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_FROM_PERSON);\n });\n\n it(\"should return the apdu for 'wallets' of type 'address[]'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"wallets\",\n type: new ArrayType(\n \"address[]\",\n new PrimitiveType(\"address\", \"address\", Nothing),\n \"address\",\n Nothing,\n [Nothing],\n ),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_WALLETS_ADDRESS);\n });\n\n it(\"should return the apdu for 'staticExtradata' of type 'bytes'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"staticExtradata\",\n type: new PrimitiveType(\"bytes\", \"bytes\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n EIP712_DEF_FIELD_STATICEXTRADATA_BYTES,\n );\n });\n\n it(\"should return the apdu for 'replacementPattern' of type 'bytes'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"replacementPattern\",\n type: new PrimitiveType(\"bytes\", \"bytes\", Nothing),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n EIP712_DEF_FIELD_REPLACEMENTPATTERN_BYTES,\n );\n });\n\n it(\"should return the apdu for 'dataType' of type 'bytes4'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"dataType\",\n type: new PrimitiveType(\"bytes4\", \"bytes\", Just(4)),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(\n EIP712_DEF_FIELD_DATA_TYPE_BYTES4,\n );\n });\n\n it(\"should return the apdu for 'document' of type 'string[3][]'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"document\",\n type: new ArrayType(\n \"string[3][]\",\n new PrimitiveType(\"string\", \"string\", Nothing),\n \"string[3]\",\n Nothing,\n [Just(3), Nothing],\n ),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_DOCUMENT_STRING);\n });\n\n it(\"should return the apdu for 'depthy' of type 'uint8[][][][]'\", () => {\n // GIVEN\n command = new SendEIP712StructDefinitionCommand({\n command: StructDefinitionCommand.Field,\n name: \"depthy\",\n type: new ArrayType(\n \"uint8[][][][]\",\n new PrimitiveType(\"uint8\", \"uint\", Just(1)),\n \"uint8[][][]\",\n Nothing,\n [Nothing, Nothing, Nothing, Nothing],\n ),\n });\n\n // WHEN\n const apdu = command.getApdu();\n\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(EIP712_DEF_FIELD_DEPTHY_UINT8);\n });\n });\n\n describe(\"parseResponse\", () => {\n it(\"should parse the response\", () => {\n // GIVEN\n const response = {\n statusCode: Uint8Array.from([0x90, 0x00]),\n data: new Uint8Array(),\n };\n\n // WHEN\n const parsedResponse = command.parseResponse(response);\n\n // THEN\n expect(parsedResponse).toStrictEqual(\n CommandResultFactory({ data: undefined }),\n );\n });\n\n it(\"should throw an error if the response is not successful\", () => {\n // GIVEN\n const response = {\n statusCode: Uint8Array.from([0x55, 0x15]),\n data: new Uint8Array(),\n };\n\n // WHEN\n const result = command.parseResponse(response);\n\n // THEN\n expect(isSuccessCommandResult(result)).toBe(false);\n });\n });\n});\n"],
5
+ "mappings": "AAAA,OAEE,wBAAAA,EACA,0BAAAC,MACK,kCACP,OAAS,QAAAC,EAAM,WAAAC,MAA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AAcG,CAAQ,EAGrD,OAAOC,CAAc,EAAE,cACrB3B,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CAAC,EAED,GAAG,0DAA2D,IAAM,CAElE,MAAM0B,EAAW,CACf,WAAY,WAAW,KAAK,CAAC,GAAM,EAAI,CAAC,EACxC,KAAM,IAAI,UACZ,EAGME,EAASL,EAAQ,cAAcG,CAAQ,EAG7C,OAAOzB,EAAuB2B,CAAM,CAAC,EAAE,KAAK,EAAK,CACnD,CAAC,CACH,CAAC,CACH,CAAC",
6
+ "names": ["CommandResultFactory", "isSuccessCommandResult", "Just", "Nothing", "ArrayType", "PrimitiveType", "StructType", "SendEIP712StructDefinitionCommand", "StructDefinitionCommand", "EIP712_DEF_NAME_EIP712DOMAIN", "EIP712_DEF_NAME_GROUP", "EIP712_DEF_FIELD_NAME_STRING", "EIP712_DEF_FIELD_VERSION_STRING", "EIP712_DEF_FIELD_CHAINID_UINT256", "EIP712_DEF_FIELD_VERIFYINGCONTRACT_ADDRESS", "EIP712_DEF_FIELD_MEMBERS_PERSON", "EIP712_DEF_FIELD_FROM_PERSON", "EIP712_DEF_FIELD_WALLETS_ADDRESS", "EIP712_DEF_FIELD_STATICEXTRADATA_BYTES", "EIP712_DEF_FIELD_REPLACEMENTPATTERN_BYTES", "EIP712_DEF_FIELD_DATA_TYPE_BYTES4", "EIP712_DEF_FIELD_DOCUMENT_STRING", "EIP712_DEF_FIELD_DEPTHY_UINT8", "command", "cmd", "apdu", "response", "parsedResponse", "result"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ApduBuilder as t,CommandResultFactory as a}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as o}from"@ledgerhq/signer-utils";import{Maybe as s}from"purify-ts";import{ETH_APP_ERRORS as d,EthAppCommandErrorFactory as p}from"./utils/ethAppErrors";var m=(e=>(e[e.ROOT=0]="ROOT",e[e.ARRAY=15]="ARRAY",e[e.FIELD=255]="FIELD",e))(m||{});class E{constructor(r){this.args=r}errorHelper=new o(d,p);getApdu(){const r={cla:224,ins:28,p1:this.args.type!=255||this.args.value.isLastChunk?0:1,p2:this.args.type};switch(this.args.type){case 0:return new t(r).addAsciiStringToData(this.args.value).build();case 15:return new t(r).add8BitUIntToData(this.args.value).build();case 255:return new t(r).addBufferToData(this.args.value.data).build()}}parseResponse(r){return s.fromNullable(this.errorHelper.getError(r)).orDefault(a({data:void 0}))}}export{E as SendEIP712StructImplemCommand,m as StructImplemType};
1
+ import{ApduBuilder as t,CommandResultFactory as a}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as o}from"@ledgerhq/signer-utils";import{Maybe as d}from"purify-ts";import{ETH_APP_ERRORS as s,EthAppCommandErrorFactory as p}from"./utils/ethAppErrors";var m=(r=>(r[r.ROOT=0]="ROOT",r[r.ARRAY=15]="ARRAY",r[r.FIELD=255]="FIELD",r))(m||{});class E{constructor(e){this.args=e}name="sendEIP712StructImplem";errorHelper=new o(s,p);getApdu(){const e={cla:224,ins:28,p1:this.args.type!=255||this.args.value.isLastChunk?0:1,p2:this.args.type};switch(this.args.type){case 0:return new t(e).addAsciiStringToData(this.args.value).build();case 15:return new t(e).add8BitUIntToData(this.args.value).build();case 255:return new t(e).addBufferToData(this.args.value.data).build()}}parseResponse(e){return d.fromNullable(this.errorHelper.getError(e)).orDefault(a({data:void 0}))}}export{E as SendEIP712StructImplemCommand,m as StructImplemType};
2
2
  //# sourceMappingURL=SendEIP712StructImplemCommand.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SendEIP712StructImplemCommand.ts"],
4
- "sourcesContent": ["// https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#eip712-send-struct-implementation\nimport {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"./utils/ethAppErrors\";\n\nexport enum StructImplemType {\n ROOT = 0x00,\n ARRAY = 0x0f,\n FIELD = 0xff,\n}\n\nexport type SendEIP712StructImplemCommandArgs =\n | {\n type: StructImplemType.ROOT;\n value: string;\n }\n | {\n type: StructImplemType.ARRAY;\n value: number;\n }\n | {\n type: StructImplemType.FIELD;\n value: {\n /**\n * The chunk of the data that is ready to send, that is to say, prefixed by its length in two bytes.\n * Eg. 01020304 => [0x00, 0x04, 0x01, 0x02, 0x03, 0x04] where [0x00, 0x04] are the length of the data.\n */\n data: Uint8Array;\n isLastChunk: boolean;\n };\n };\n\nexport class SendEIP712StructImplemCommand\n implements Command<void, SendEIP712StructImplemCommandArgs, EthErrorCodes>\n{\n private readonly errorHelper = new CommandErrorHelper<void, EthErrorCodes>(\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n );\n constructor(private readonly args: SendEIP712StructImplemCommandArgs) {}\n\n getApdu(): Apdu {\n const apduBuilderArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x1c,\n p1:\n this.args.type != StructImplemType.FIELD || this.args.value.isLastChunk\n ? 0x00\n : 0x01,\n p2: this.args.type,\n };\n switch (this.args.type) {\n case StructImplemType.ROOT:\n return new ApduBuilder(apduBuilderArgs)\n .addAsciiStringToData(this.args.value)\n .build();\n case StructImplemType.ARRAY:\n return new ApduBuilder(apduBuilderArgs)\n .add8BitUIntToData(this.args.value)\n .build();\n case StructImplemType.FIELD:\n return new ApduBuilder(apduBuilderArgs)\n .addBufferToData(this.args.value.data)\n .build();\n }\n }\n\n parseResponse(response: ApduResponse): CommandResult<void, EthErrorCodes> {\n return Maybe.fromNullable(this.errorHelper.getError(response)).orDefault(\n CommandResultFactory({ data: undefined }),\n );\n }\n}\n"],
5
- "mappings": "AACA,OAEE,eAAAA,EAKA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,SAAAC,MAAa,YAEtB,OACE,kBAAAC,EACA,6BAAAC,MAEK,uBAEA,IAAKC,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,MAAQ,IAAR,QACAA,IAAA,MAAQ,KAAR,QAHUA,OAAA,IA2BL,MAAMC,CAEb,CAKE,YAA6BC,EAAyC,CAAzC,UAAAA,CAA0C,CAJtD,YAAc,IAAIN,EACjCE,EACAC,CACF,EAGA,SAAgB,CACd,MAAMI,EAAmC,CACvC,IAAK,IACL,IAAK,GACL,GACE,KAAK,KAAK,MAAQ,KAA0B,KAAK,KAAK,MAAM,YACxD,EACA,EACN,GAAI,KAAK,KAAK,IAChB,EACA,OAAQ,KAAK,KAAK,KAAM,CACtB,IAAK,GACH,OAAO,IAAIT,EAAYS,CAAe,EACnC,qBAAqB,KAAK,KAAK,KAAK,EACpC,MAAM,EACX,IAAK,IACH,OAAO,IAAIT,EAAYS,CAAe,EACnC,kBAAkB,KAAK,KAAK,KAAK,EACjC,MAAM,EACX,IAAK,KACH,OAAO,IAAIT,EAAYS,CAAe,EACnC,gBAAgB,KAAK,KAAK,MAAM,IAAI,EACpC,MAAM,CACb,CACF,CAEA,cAAcC,EAA4D,CACxE,OAAOP,EAAM,aAAa,KAAK,YAAY,SAASO,CAAQ,CAAC,EAAE,UAC7DT,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CACF",
4
+ "sourcesContent": ["// https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#eip712-send-struct-implementation\nimport {\n type Apdu,\n ApduBuilder,\n type ApduBuilderArgs,\n type ApduResponse,\n type Command,\n type CommandResult,\n CommandResultFactory,\n} from \"@ledgerhq/device-management-kit\";\nimport { CommandErrorHelper } from \"@ledgerhq/signer-utils\";\nimport { Maybe } from \"purify-ts\";\n\nimport {\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n type EthErrorCodes,\n} from \"./utils/ethAppErrors\";\n\nexport enum StructImplemType {\n ROOT = 0x00,\n ARRAY = 0x0f,\n FIELD = 0xff,\n}\n\nexport type SendEIP712StructImplemCommandArgs =\n | {\n type: StructImplemType.ROOT;\n value: string;\n }\n | {\n type: StructImplemType.ARRAY;\n value: number;\n }\n | {\n type: StructImplemType.FIELD;\n value: {\n /**\n * The chunk of the data that is ready to send, that is to say, prefixed by its length in two bytes.\n * Eg. 01020304 => [0x00, 0x04, 0x01, 0x02, 0x03, 0x04] where [0x00, 0x04] are the length of the data.\n */\n data: Uint8Array;\n isLastChunk: boolean;\n };\n };\n\nexport class SendEIP712StructImplemCommand\n implements Command<void, SendEIP712StructImplemCommandArgs, EthErrorCodes>\n{\n readonly name = \"sendEIP712StructImplem\";\n private readonly errorHelper = new CommandErrorHelper<void, EthErrorCodes>(\n ETH_APP_ERRORS,\n EthAppCommandErrorFactory,\n );\n constructor(private readonly args: SendEIP712StructImplemCommandArgs) {}\n\n getApdu(): Apdu {\n const apduBuilderArgs: ApduBuilderArgs = {\n cla: 0xe0,\n ins: 0x1c,\n p1:\n this.args.type != StructImplemType.FIELD || this.args.value.isLastChunk\n ? 0x00\n : 0x01,\n p2: this.args.type,\n };\n switch (this.args.type) {\n case StructImplemType.ROOT:\n return new ApduBuilder(apduBuilderArgs)\n .addAsciiStringToData(this.args.value)\n .build();\n case StructImplemType.ARRAY:\n return new ApduBuilder(apduBuilderArgs)\n .add8BitUIntToData(this.args.value)\n .build();\n case StructImplemType.FIELD:\n return new ApduBuilder(apduBuilderArgs)\n .addBufferToData(this.args.value.data)\n .build();\n }\n }\n\n parseResponse(response: ApduResponse): CommandResult<void, EthErrorCodes> {\n return Maybe.fromNullable(this.errorHelper.getError(response)).orDefault(\n CommandResultFactory({ data: undefined }),\n );\n }\n}\n"],
5
+ "mappings": "AACA,OAEE,eAAAA,EAKA,wBAAAC,MACK,kCACP,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,SAAAC,MAAa,YAEtB,OACE,kBAAAC,EACA,6BAAAC,MAEK,uBAEA,IAAKC,OACVA,IAAA,KAAO,GAAP,OACAA,IAAA,MAAQ,IAAR,QACAA,IAAA,MAAQ,KAAR,QAHUA,OAAA,IA2BL,MAAMC,CAEb,CAME,YAA6BC,EAAyC,CAAzC,UAAAA,CAA0C,CAL9D,KAAO,yBACC,YAAc,IAAIN,EACjCE,EACAC,CACF,EAGA,SAAgB,CACd,MAAMI,EAAmC,CACvC,IAAK,IACL,IAAK,GACL,GACE,KAAK,KAAK,MAAQ,KAA0B,KAAK,KAAK,MAAM,YACxD,EACA,EACN,GAAI,KAAK,KAAK,IAChB,EACA,OAAQ,KAAK,KAAK,KAAM,CACtB,IAAK,GACH,OAAO,IAAIT,EAAYS,CAAe,EACnC,qBAAqB,KAAK,KAAK,KAAK,EACpC,MAAM,EACX,IAAK,IACH,OAAO,IAAIT,EAAYS,CAAe,EACnC,kBAAkB,KAAK,KAAK,KAAK,EACjC,MAAM,EACX,IAAK,KACH,OAAO,IAAIT,EAAYS,CAAe,EACnC,gBAAgB,KAAK,KAAK,MAAM,IAAI,EACpC,MAAM,CACb,CACF,CAEA,cAAcC,EAA4D,CACxE,OAAOP,EAAM,aAAa,KAAK,YAAY,SAASO,CAAQ,CAAC,EAAE,UAC7DT,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CACF",
6
6
  "names": ["ApduBuilder", "CommandResultFactory", "CommandErrorHelper", "Maybe", "ETH_APP_ERRORS", "EthAppCommandErrorFactory", "StructImplemType", "SendEIP712StructImplemCommand", "args", "apduBuilderArgs", "response"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{CommandResultFactory as s,isSuccessCommandResult as c}from"@ledgerhq/device-management-kit";import{SendEIP712StructImplemCommand as n,StructImplemType as o}from"./SendEIP712StructImplemCommand";const a=Uint8Array.from([224,28,0,0,6,108,101,100,103,101,114]),m=Uint8Array.from([224,28,0,15,1,19]),d=Uint8Array.from([224,28,0,255,6,0,4,1,2,3,4]),u=Uint8Array.from([224,28,1,255,5,5,6,7,8,9]);describe("SendEIP712StructImplemCommand",()=>{describe("getApdu",()=>{it("should return the correct APDU for ROOT",()=>{const e={type:o.ROOT,value:"ledger"},t=new n(e).getApdu();expect(t.getRawApdu()).toStrictEqual(a)}),it("should return the correct APDU for ARRAY",()=>{const e={type:o.ARRAY,value:19},t=new n(e).getApdu();expect(t.getRawApdu()).toStrictEqual(m)}),it("should return the correct APDU for FIELD when receiving last chunk",()=>{const e={type:o.FIELD,value:{data:Uint8Array.from([0,4,1,2,3,4]),isLastChunk:!0}},t=new n(e).getApdu();expect(t.getRawApdu()).toStrictEqual(d)}),it("should return the correct APDU for FIELD when receiving other chunk",()=>{const e={type:o.FIELD,value:{data:Uint8Array.from([5,6,7,8,9]),isLastChunk:!1}},t=new n(e).getApdu();expect(t.getRawApdu()).toStrictEqual(u)})}),describe("parseResponse",()=>{it("should return an error if the response status code is not success",()=>{const e={data:new Uint8Array,statusCode:new Uint8Array([106,128])},t=new n({type:o.ROOT,value:"ledger"}).parseResponse(e);expect(c(t)).toBe(!1)}),it("should not return an error if the response status code is success",()=>{const e={data:new Uint8Array,statusCode:new Uint8Array([144,0])},r=new n({type:o.ROOT,value:"ledger"});expect(r.parseResponse(e)).toStrictEqual(s({data:void 0}))})})});
1
+ import{CommandResultFactory as s,isSuccessCommandResult as c}from"@ledgerhq/device-management-kit";import{SendEIP712StructImplemCommand as r,StructImplemType as n}from"./SendEIP712StructImplemCommand";const a=Uint8Array.from([224,28,0,0,6,108,101,100,103,101,114]),m=Uint8Array.from([224,28,0,15,1,19]),d=Uint8Array.from([224,28,0,255,6,0,4,1,2,3,4]),u=Uint8Array.from([224,28,1,255,5,5,6,7,8,9]);describe("SendEIP712StructImplemCommand",()=>{describe("name",()=>{it("should be 'sendEIP712StructImplem'",()=>{const e=new r({type:n.ROOT,value:"test"});expect(e.name).toBe("sendEIP712StructImplem")})}),describe("getApdu",()=>{it("should return the correct APDU for ROOT",()=>{const e={type:n.ROOT,value:"ledger"},t=new r(e).getApdu();expect(t.getRawApdu()).toStrictEqual(a)}),it("should return the correct APDU for ARRAY",()=>{const e={type:n.ARRAY,value:19},t=new r(e).getApdu();expect(t.getRawApdu()).toStrictEqual(m)}),it("should return the correct APDU for FIELD when receiving last chunk",()=>{const e={type:n.FIELD,value:{data:Uint8Array.from([0,4,1,2,3,4]),isLastChunk:!0}},t=new r(e).getApdu();expect(t.getRawApdu()).toStrictEqual(d)}),it("should return the correct APDU for FIELD when receiving other chunk",()=>{const e={type:n.FIELD,value:{data:Uint8Array.from([5,6,7,8,9]),isLastChunk:!1}},t=new r(e).getApdu();expect(t.getRawApdu()).toStrictEqual(u)})}),describe("parseResponse",()=>{it("should return an error if the response status code is not success",()=>{const e={data:new Uint8Array,statusCode:new Uint8Array([106,128])},t=new r({type:n.ROOT,value:"ledger"}).parseResponse(e);expect(c(t)).toBe(!1)}),it("should not return an error if the response status code is success",()=>{const e={data:new Uint8Array,statusCode:new Uint8Array([144,0])},o=new r({type:n.ROOT,value:"ledger"});expect(o.parseResponse(e)).toStrictEqual(s({data:void 0}))})})});
2
2
  //# sourceMappingURL=SendEIP712StructImplemCommand.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/command/SendEIP712StructImplemCommand.test.ts"],
4
- "sourcesContent": ["import {\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n SendEIP712StructImplemCommand,\n type SendEIP712StructImplemCommandArgs,\n StructImplemType,\n} from \"./SendEIP712StructImplemCommand\";\n\nconst ROOT_APDU = Uint8Array.from([\n 0xe0, 0x1c, 0x00, 0x00, 0x06, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72,\n]);\n\nconst ARRAY_APDU = Uint8Array.from([0xe0, 0x1c, 0x00, 0x0f, 0x01, 0x13]);\n\nconst FIELD_LAST_CHUNK_APDU = Uint8Array.from([\n 0xe0, 0x1c, 0x00, 0xff, 0x06, 0x00, 0x04, 0x01, 0x02, 0x03, 0x04,\n]);\n\nconst FIELD_OTHER_CHUNK_APDU = Uint8Array.from([\n 0xe0, 0x1c, 0x01, 0xff, 0x05, 0x05, 0x06, 0x07, 0x08, 0x09,\n]);\n\ndescribe(\"SendEIP712StructImplemCommand\", () => {\n describe(\"getApdu\", () => {\n it(\"should return the correct APDU for ROOT\", () => {\n // GIVEN\n const args: SendEIP712StructImplemCommandArgs = {\n type: StructImplemType.ROOT,\n value: \"ledger\",\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(ROOT_APDU);\n });\n it(\"should return the correct APDU for ARRAY\", () => {\n // GIVEN\n const args: SendEIP712StructImplemCommandArgs = {\n type: StructImplemType.ARRAY,\n value: 19,\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(ARRAY_APDU);\n });\n it(\"should return the correct APDU for FIELD when receiving last chunk\", () => {\n // GIVEN\n const args: SendEIP712StructImplemCommandArgs = {\n type: StructImplemType.FIELD,\n value: {\n data: Uint8Array.from([0x00, 0x04, 0x01, 0x02, 0x03, 0x04]),\n isLastChunk: true,\n },\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(FIELD_LAST_CHUNK_APDU);\n });\n it(\"should return the correct APDU for FIELD when receiving other chunk\", () => {\n // GIVEN\n const args: SendEIP712StructImplemCommandArgs = {\n type: StructImplemType.FIELD,\n value: {\n data: Uint8Array.from([0x05, 0x06, 0x07, 0x08, 0x09]),\n isLastChunk: false,\n },\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(FIELD_OTHER_CHUNK_APDU);\n });\n });\n describe(\"parseResponse\", () => {\n it(\"should return an error if the response status code is not success\", () => {\n // GIVEN\n const response = {\n data: new Uint8Array(),\n statusCode: new Uint8Array([0x6a, 0x80]),\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand({\n type: StructImplemType.ROOT,\n value: \"ledger\",\n });\n // THEN\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBe(false);\n });\n it(\"should not return an error if the response status code is success\", () => {\n // GIVEN\n const response = {\n data: new Uint8Array(),\n statusCode: new Uint8Array([0x90, 0x00]),\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand({\n type: StructImplemType.ROOT,\n value: \"ledger\",\n });\n // THEN\n expect(command.parseResponse(response)).toStrictEqual(\n CommandResultFactory({ data: undefined }),\n );\n });\n });\n});\n"],
5
- "mappings": "AAAA,OACE,wBAAAA,EACA,0BAAAC,MACK,kCAEP,OACE,iCAAAC,EAEA,oBAAAC,MACK,kCAEP,MAAMC,EAAY,WAAW,KAAK,CAChC,IAAM,GAAM,EAAM,EAAM,EAAM,IAAM,IAAM,IAAM,IAAM,IAAM,GAC9D,CAAC,EAEKC,EAAa,WAAW,KAAK,CAAC,IAAM,GAAM,EAAM,GAAM,EAAM,EAAI,CAAC,EAEjEC,EAAwB,WAAW,KAAK,CAC5C,IAAM,GAAM,EAAM,IAAM,EAAM,EAAM,EAAM,EAAM,EAAM,EAAM,CAC9D,CAAC,EAEKC,EAAyB,WAAW,KAAK,CAC7C,IAAM,GAAM,EAAM,IAAM,EAAM,EAAM,EAAM,EAAM,EAAM,CACxD,CAAC,EAED,SAAS,gCAAiC,IAAM,CAC9C,SAAS,UAAW,IAAM,CACxB,GAAG,0CAA2C,IAAM,CAElD,MAAMC,EAA0C,CAC9C,KAAML,EAAiB,KACvB,MAAO,QACT,EAGMM,EADU,IAAIP,EAA8BM,CAAI,EACjC,QAAQ,EAE7B,OAAOC,EAAK,WAAW,CAAC,EAAE,cAAcL,CAAS,CACnD,CAAC,EACD,GAAG,2CAA4C,IAAM,CAEnD,MAAMI,E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,cAAcF,CAAQ,CAAC,EAAE,cACtCV,EAAqB,CAAE,KAAM,MAAU,CAAC,CAC1C,CACF,CAAC,CACH,CAAC,CACH,CAAC",
6
- "names": ["CommandResultFactory", "isSuccessCommandResult", "SendEIP712StructImplemCommand", "StructImplemType", "ROOT_APDU", "ARRAY_APDU", "FIELD_LAST_CHUNK_APDU", "FIELD_OTHER_CHUNK_APDU", "args", "apdu", "response", "result", "command"]
4
+ "sourcesContent": ["import {\n CommandResultFactory,\n isSuccessCommandResult,\n} from \"@ledgerhq/device-management-kit\";\n\nimport {\n SendEIP712StructImplemCommand,\n type SendEIP712StructImplemCommandArgs,\n StructImplemType,\n} from \"./SendEIP712StructImplemCommand\";\n\nconst ROOT_APDU = Uint8Array.from([\n 0xe0, 0x1c, 0x00, 0x00, 0x06, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72,\n]);\n\nconst ARRAY_APDU = Uint8Array.from([0xe0, 0x1c, 0x00, 0x0f, 0x01, 0x13]);\n\nconst FIELD_LAST_CHUNK_APDU = Uint8Array.from([\n 0xe0, 0x1c, 0x00, 0xff, 0x06, 0x00, 0x04, 0x01, 0x02, 0x03, 0x04,\n]);\n\nconst FIELD_OTHER_CHUNK_APDU = Uint8Array.from([\n 0xe0, 0x1c, 0x01, 0xff, 0x05, 0x05, 0x06, 0x07, 0x08, 0x09,\n]);\n\ndescribe(\"SendEIP712StructImplemCommand\", () => {\n describe(\"name\", () => {\n it(\"should be 'sendEIP712StructImplem'\", () => {\n const command = new SendEIP712StructImplemCommand({\n type: StructImplemType.ROOT,\n value: \"test\",\n });\n expect(command.name).toBe(\"sendEIP712StructImplem\");\n });\n });\n\n describe(\"getApdu\", () => {\n it(\"should return the correct APDU for ROOT\", () => {\n // GIVEN\n const args: SendEIP712StructImplemCommandArgs = {\n type: StructImplemType.ROOT,\n value: \"ledger\",\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(ROOT_APDU);\n });\n it(\"should return the correct APDU for ARRAY\", () => {\n // GIVEN\n const args: SendEIP712StructImplemCommandArgs = {\n type: StructImplemType.ARRAY,\n value: 19,\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(ARRAY_APDU);\n });\n it(\"should return the correct APDU for FIELD when receiving last chunk\", () => {\n // GIVEN\n const args: SendEIP712StructImplemCommandArgs = {\n type: StructImplemType.FIELD,\n value: {\n data: Uint8Array.from([0x00, 0x04, 0x01, 0x02, 0x03, 0x04]),\n isLastChunk: true,\n },\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(FIELD_LAST_CHUNK_APDU);\n });\n it(\"should return the correct APDU for FIELD when receiving other chunk\", () => {\n // GIVEN\n const args: SendEIP712StructImplemCommandArgs = {\n type: StructImplemType.FIELD,\n value: {\n data: Uint8Array.from([0x05, 0x06, 0x07, 0x08, 0x09]),\n isLastChunk: false,\n },\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand(args);\n const apdu = command.getApdu();\n // THEN\n expect(apdu.getRawApdu()).toStrictEqual(FIELD_OTHER_CHUNK_APDU);\n });\n });\n describe(\"parseResponse\", () => {\n it(\"should return an error if the response status code is not success\", () => {\n // GIVEN\n const response = {\n data: new Uint8Array(),\n statusCode: new Uint8Array([0x6a, 0x80]),\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand({\n type: StructImplemType.ROOT,\n value: \"ledger\",\n });\n // THEN\n const result = command.parseResponse(response);\n expect(isSuccessCommandResult(result)).toBe(false);\n });\n it(\"should not return an error if the response status code is success\", () => {\n // GIVEN\n const response = {\n data: new Uint8Array(),\n statusCode: new Uint8Array([0x90, 0x00]),\n };\n // WHEN\n const command = new SendEIP712StructImplemCommand({\n type: StructImplemType.ROOT,\n value: \"ledger\",\n });\n // THEN\n expect(command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APDU", "FIELD_LAST_CHUNK_APDU", "FIELD_OTHER_CHUNK_APDU", "command", "args", "apdu", "response", "result"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ApduBuilder as e,CommandResultFactory as t}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as o}from"@ledgerhq/signer-utils";import{Maybe as a}from"purify-ts";import{ETH_APP_ERRORS as d,EthAppCommandErrorFactory as n}from"./utils/ethAppErrors";class u{constructor(r){this.args=r}errorHelper=new o(d,n);getApdu(){const r={cla:224,ins:18,p1:0,p2:0};return new e(r).addHexaStringToData(this.args.payload).addHexaStringToData(this.args.signature??"").build()}parseResponse(r){return a.fromNullable(this.errorHelper.getError(r)).orDefault(t({data:void 0}))}}export{u as SetExternalPluginCommand};
1
+ import{ApduBuilder as e,CommandResultFactory as t}from"@ledgerhq/device-management-kit";import{CommandErrorHelper as o}from"@ledgerhq/signer-utils";import{Maybe as a}from"purify-ts";import{ETH_APP_ERRORS as n,EthAppCommandErrorFactory as d}from"./utils/ethAppErrors";class u{constructor(r){this.args=r}name="setExternalPlugin";errorHelper=new o(n,d);getApdu(){const r={cla:224,ins:18,p1:0,p2:0};return new e(r).addHexaStringToData(this.args.payload).addHexaStringToData(this.args.signature??"").build()}parseResponse(r){return a.fromNullable(this.errorHelper.getError(r)).orDefault(t({data:void 0}))}}export{u as SetExternalPluginCommand};
2
2
  //# sourceMappingURL=SetExternalPluginCommand.js.map