@ledgerhq/device-contacts-kit 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/README.md +14 -2
  2. package/lib/cjs/api/index.js +1 -1
  3. package/lib/cjs/api/index.js.map +2 -2
  4. package/lib/cjs/api/model/ContactsVersionRequirements.js +1 -1
  5. package/lib/cjs/api/model/ContactsVersionRequirements.js.map +3 -3
  6. package/lib/cjs/api/model/EditExternalAddressIdentifier.js.map +1 -1
  7. package/lib/cjs/api/model/EditExternalAddressScope.js.map +1 -1
  8. package/lib/cjs/api/model/ProvideContact.js.map +1 -1
  9. package/lib/cjs/api/model/RegisterExternalAddress.js.map +1 -1
  10. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.js +1 -1
  11. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.js.map +3 -3
  12. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.js +1 -1
  13. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.js.map +3 -3
  14. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.js +1 -1
  15. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.js.map +3 -3
  16. package/lib/cjs/internal/app-binder/model/contactsConstants.js +1 -1
  17. package/lib/cjs/internal/app-binder/model/contactsConstants.js.map +2 -2
  18. package/lib/cjs/internal/app-binder/model/contactsValidation.js +1 -1
  19. package/lib/cjs/internal/app-binder/model/contactsValidation.js.map +3 -3
  20. package/lib/cjs/internal/app-binder/services/provideContact.js +1 -1
  21. package/lib/cjs/internal/app-binder/services/provideContact.js.map +3 -3
  22. package/lib/cjs/package.json +3 -3
  23. package/lib/esm/api/index.js +1 -1
  24. package/lib/esm/api/index.js.map +3 -3
  25. package/lib/esm/api/model/ContactsVersionRequirements.js +1 -1
  26. package/lib/esm/api/model/ContactsVersionRequirements.js.map +3 -3
  27. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.js +1 -1
  28. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.js.map +3 -3
  29. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.js +1 -1
  30. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.js.map +3 -3
  31. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.js +1 -1
  32. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.js.map +3 -3
  33. package/lib/esm/internal/app-binder/model/contactsConstants.js +1 -1
  34. package/lib/esm/internal/app-binder/model/contactsConstants.js.map +2 -2
  35. package/lib/esm/internal/app-binder/model/contactsValidation.js +1 -1
  36. package/lib/esm/internal/app-binder/model/contactsValidation.js.map +3 -3
  37. package/lib/esm/internal/app-binder/services/provideContact.js +1 -1
  38. package/lib/esm/internal/app-binder/services/provideContact.js.map +3 -3
  39. package/lib/esm/package.json +3 -3
  40. package/lib/types/api/index.d.ts +1 -1
  41. package/lib/types/api/index.d.ts.map +1 -1
  42. package/lib/types/api/model/ContactsVersionRequirements.d.ts +4 -3
  43. package/lib/types/api/model/ContactsVersionRequirements.d.ts.map +1 -1
  44. package/lib/types/api/model/EditExternalAddressIdentifier.d.ts +2 -2
  45. package/lib/types/api/model/EditExternalAddressIdentifier.d.ts.map +1 -1
  46. package/lib/types/api/model/EditExternalAddressScope.d.ts +2 -2
  47. package/lib/types/api/model/EditExternalAddressScope.d.ts.map +1 -1
  48. package/lib/types/api/model/ProvideContact.d.ts +1 -1
  49. package/lib/types/api/model/ProvideContact.d.ts.map +1 -1
  50. package/lib/types/api/model/RegisterExternalAddress.d.ts +2 -2
  51. package/lib/types/api/model/RegisterExternalAddress.d.ts.map +1 -1
  52. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.d.ts.map +1 -1
  53. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.d.ts.map +1 -1
  54. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.d.ts.map +1 -1
  55. package/lib/types/internal/app-binder/model/contactsConstants.d.ts +2 -2
  56. package/lib/types/internal/app-binder/model/contactsConstants.d.ts.map +1 -1
  57. package/lib/types/internal/app-binder/model/contactsValidation.d.ts +23 -0
  58. package/lib/types/internal/app-binder/model/contactsValidation.d.ts.map +1 -1
  59. package/lib/types/internal/app-binder/services/provideContact.d.ts.map +1 -1
  60. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  61. package/package.json +7 -7
  62. package/lib/cjs/api/ContactsManagerBuilder.test.js +0 -2
  63. package/lib/cjs/api/ContactsManagerBuilder.test.js.map +0 -7
  64. package/lib/cjs/api/model/ContactsVersionRequirements.test.js +0 -2
  65. package/lib/cjs/api/model/ContactsVersionRequirements.test.js.map +0 -7
  66. package/lib/cjs/internal/DefaultContactsManager.test.js +0 -2
  67. package/lib/cjs/internal/DefaultContactsManager.test.js.map +0 -7
  68. package/lib/cjs/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.js +0 -2
  69. package/lib/cjs/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.js.map +0 -7
  70. package/lib/cjs/internal/app-binder/command/EditExternalAddressScopeCommand.test.js +0 -2
  71. package/lib/cjs/internal/app-binder/command/EditExternalAddressScopeCommand.test.js.map +0 -7
  72. package/lib/cjs/internal/app-binder/command/ProvideContactCommand.test.js +0 -2
  73. package/lib/cjs/internal/app-binder/command/ProvideContactCommand.test.js.map +0 -7
  74. package/lib/cjs/internal/app-binder/command/RegisterIdentityCommand.test.js +0 -2
  75. package/lib/cjs/internal/app-binder/command/RegisterIdentityCommand.test.js.map +0 -7
  76. package/lib/cjs/internal/app-binder/command/RenameContactCommand.test.js +0 -2
  77. package/lib/cjs/internal/app-binder/command/RenameContactCommand.test.js.map +0 -7
  78. package/lib/cjs/internal/app-binder/contactsVersionGuards.test.js +0 -2
  79. package/lib/cjs/internal/app-binder/contactsVersionGuards.test.js.map +0 -7
  80. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.js +0 -2
  81. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.js.map +0 -7
  82. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.js +0 -2
  83. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.js.map +0 -7
  84. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.js +0 -2
  85. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.js.map +0 -7
  86. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.js +0 -2
  87. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.js.map +0 -7
  88. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.js +0 -2
  89. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.js.map +0 -7
  90. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.js +0 -2
  91. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.js.map +0 -7
  92. package/lib/cjs/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js +0 -2
  93. package/lib/cjs/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js.map +0 -7
  94. package/lib/cjs/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.js +0 -2
  95. package/lib/cjs/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.js.map +0 -7
  96. package/lib/cjs/internal/app-binder/device-action/__test-utils__/makeInternalApi.js +0 -2
  97. package/lib/cjs/internal/app-binder/device-action/__test-utils__/makeInternalApi.js.map +0 -7
  98. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.js +0 -2
  99. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.js.map +0 -7
  100. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.js +0 -2
  101. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.js.map +0 -7
  102. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.js +0 -2
  103. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.js.map +0 -7
  104. package/lib/cjs/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.js +0 -2
  105. package/lib/cjs/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.js.map +0 -7
  106. package/lib/cjs/internal/app-binder/model/contactsValidation.test.js +0 -2
  107. package/lib/cjs/internal/app-binder/model/contactsValidation.test.js.map +0 -7
  108. package/lib/cjs/internal/app-binder/services/contactsTlvSerializer.test.js +0 -2
  109. package/lib/cjs/internal/app-binder/services/contactsTlvSerializer.test.js.map +0 -7
  110. package/lib/cjs/internal/app-binder/services/provideContact.test.js +0 -2
  111. package/lib/cjs/internal/app-binder/services/provideContact.test.js.map +0 -7
  112. package/lib/cjs/internal/app-binder/services/sendFramedContactsPayload.test.js +0 -2
  113. package/lib/cjs/internal/app-binder/services/sendFramedContactsPayload.test.js.map +0 -7
  114. package/lib/cjs/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.js +0 -2
  115. package/lib/cjs/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.js.map +0 -7
  116. package/lib/cjs/internal/app-binder/task/SendEditExternalAddressScopeTask.test.js +0 -2
  117. package/lib/cjs/internal/app-binder/task/SendEditExternalAddressScopeTask.test.js.map +0 -7
  118. package/lib/cjs/internal/app-binder/task/SendRegisterIdentityTask.test.js +0 -2
  119. package/lib/cjs/internal/app-binder/task/SendRegisterIdentityTask.test.js.map +0 -7
  120. package/lib/cjs/internal/app-binder/task/SendRenameContactTask.test.js +0 -2
  121. package/lib/cjs/internal/app-binder/task/SendRenameContactTask.test.js.map +0 -7
  122. package/lib/cjs/internal/di.test.js +0 -2
  123. package/lib/cjs/internal/di.test.js.map +0 -7
  124. package/lib/cjs/internal/use-cases/EditExternalAddressIdentifierUseCase.test.js +0 -2
  125. package/lib/cjs/internal/use-cases/EditExternalAddressIdentifierUseCase.test.js.map +0 -7
  126. package/lib/cjs/internal/use-cases/EditExternalAddressScopeUseCase.test.js +0 -2
  127. package/lib/cjs/internal/use-cases/EditExternalAddressScopeUseCase.test.js.map +0 -7
  128. package/lib/cjs/internal/use-cases/RegisterExternalAddressUseCase.test.js +0 -2
  129. package/lib/cjs/internal/use-cases/RegisterExternalAddressUseCase.test.js.map +0 -7
  130. package/lib/cjs/internal/use-cases/RenameContactUseCase.test.js +0 -2
  131. package/lib/cjs/internal/use-cases/RenameContactUseCase.test.js.map +0 -7
  132. package/lib/esm/api/ContactsManagerBuilder.test.js +0 -2
  133. package/lib/esm/api/ContactsManagerBuilder.test.js.map +0 -7
  134. package/lib/esm/api/model/ContactsVersionRequirements.test.js +0 -2
  135. package/lib/esm/api/model/ContactsVersionRequirements.test.js.map +0 -7
  136. package/lib/esm/internal/DefaultContactsManager.test.js +0 -2
  137. package/lib/esm/internal/DefaultContactsManager.test.js.map +0 -7
  138. package/lib/esm/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.js +0 -2
  139. package/lib/esm/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.js.map +0 -7
  140. package/lib/esm/internal/app-binder/command/EditExternalAddressScopeCommand.test.js +0 -2
  141. package/lib/esm/internal/app-binder/command/EditExternalAddressScopeCommand.test.js.map +0 -7
  142. package/lib/esm/internal/app-binder/command/ProvideContactCommand.test.js +0 -2
  143. package/lib/esm/internal/app-binder/command/ProvideContactCommand.test.js.map +0 -7
  144. package/lib/esm/internal/app-binder/command/RegisterIdentityCommand.test.js +0 -2
  145. package/lib/esm/internal/app-binder/command/RegisterIdentityCommand.test.js.map +0 -7
  146. package/lib/esm/internal/app-binder/command/RenameContactCommand.test.js +0 -2
  147. package/lib/esm/internal/app-binder/command/RenameContactCommand.test.js.map +0 -7
  148. package/lib/esm/internal/app-binder/contactsVersionGuards.test.js +0 -2
  149. package/lib/esm/internal/app-binder/contactsVersionGuards.test.js.map +0 -7
  150. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.js +0 -2
  151. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.js.map +0 -7
  152. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.js +0 -2
  153. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.js.map +0 -7
  154. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.js +0 -2
  155. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.js.map +0 -7
  156. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.js +0 -2
  157. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.js.map +0 -7
  158. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.js +0 -2
  159. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.js.map +0 -7
  160. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.js +0 -2
  161. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.js.map +0 -7
  162. package/lib/esm/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js +0 -2
  163. package/lib/esm/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js.map +0 -7
  164. package/lib/esm/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.js +0 -2
  165. package/lib/esm/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.js.map +0 -7
  166. package/lib/esm/internal/app-binder/device-action/__test-utils__/makeInternalApi.js +0 -2
  167. package/lib/esm/internal/app-binder/device-action/__test-utils__/makeInternalApi.js.map +0 -7
  168. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.js +0 -2
  169. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.js.map +0 -7
  170. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.js +0 -2
  171. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.js.map +0 -7
  172. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.js +0 -2
  173. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.js.map +0 -7
  174. package/lib/esm/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.js +0 -2
  175. package/lib/esm/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.js.map +0 -7
  176. package/lib/esm/internal/app-binder/model/contactsValidation.test.js +0 -2
  177. package/lib/esm/internal/app-binder/model/contactsValidation.test.js.map +0 -7
  178. package/lib/esm/internal/app-binder/services/contactsTlvSerializer.test.js +0 -2
  179. package/lib/esm/internal/app-binder/services/contactsTlvSerializer.test.js.map +0 -7
  180. package/lib/esm/internal/app-binder/services/provideContact.test.js +0 -2
  181. package/lib/esm/internal/app-binder/services/provideContact.test.js.map +0 -7
  182. package/lib/esm/internal/app-binder/services/sendFramedContactsPayload.test.js +0 -2
  183. package/lib/esm/internal/app-binder/services/sendFramedContactsPayload.test.js.map +0 -7
  184. package/lib/esm/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.js +0 -2
  185. package/lib/esm/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.js.map +0 -7
  186. package/lib/esm/internal/app-binder/task/SendEditExternalAddressScopeTask.test.js +0 -2
  187. package/lib/esm/internal/app-binder/task/SendEditExternalAddressScopeTask.test.js.map +0 -7
  188. package/lib/esm/internal/app-binder/task/SendRegisterIdentityTask.test.js +0 -2
  189. package/lib/esm/internal/app-binder/task/SendRegisterIdentityTask.test.js.map +0 -7
  190. package/lib/esm/internal/app-binder/task/SendRenameContactTask.test.js +0 -2
  191. package/lib/esm/internal/app-binder/task/SendRenameContactTask.test.js.map +0 -7
  192. package/lib/esm/internal/di.test.js +0 -2
  193. package/lib/esm/internal/di.test.js.map +0 -7
  194. package/lib/esm/internal/use-cases/EditExternalAddressIdentifierUseCase.test.js +0 -2
  195. package/lib/esm/internal/use-cases/EditExternalAddressIdentifierUseCase.test.js.map +0 -7
  196. package/lib/esm/internal/use-cases/EditExternalAddressScopeUseCase.test.js +0 -2
  197. package/lib/esm/internal/use-cases/EditExternalAddressScopeUseCase.test.js.map +0 -7
  198. package/lib/esm/internal/use-cases/RegisterExternalAddressUseCase.test.js +0 -2
  199. package/lib/esm/internal/use-cases/RegisterExternalAddressUseCase.test.js.map +0 -7
  200. package/lib/esm/internal/use-cases/RenameContactUseCase.test.js +0 -2
  201. package/lib/esm/internal/use-cases/RenameContactUseCase.test.js.map +0 -7
  202. package/lib/types/api/ContactsManagerBuilder.test.d.ts +0 -2
  203. package/lib/types/api/ContactsManagerBuilder.test.d.ts.map +0 -1
  204. package/lib/types/api/model/ContactsVersionRequirements.test.d.ts +0 -2
  205. package/lib/types/api/model/ContactsVersionRequirements.test.d.ts.map +0 -1
  206. package/lib/types/internal/DefaultContactsManager.test.d.ts +0 -2
  207. package/lib/types/internal/DefaultContactsManager.test.d.ts.map +0 -1
  208. package/lib/types/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.d.ts +0 -2
  209. package/lib/types/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.d.ts.map +0 -1
  210. package/lib/types/internal/app-binder/command/EditExternalAddressScopeCommand.test.d.ts +0 -2
  211. package/lib/types/internal/app-binder/command/EditExternalAddressScopeCommand.test.d.ts.map +0 -1
  212. package/lib/types/internal/app-binder/command/ProvideContactCommand.test.d.ts +0 -2
  213. package/lib/types/internal/app-binder/command/ProvideContactCommand.test.d.ts.map +0 -1
  214. package/lib/types/internal/app-binder/command/RegisterIdentityCommand.test.d.ts +0 -2
  215. package/lib/types/internal/app-binder/command/RegisterIdentityCommand.test.d.ts.map +0 -1
  216. package/lib/types/internal/app-binder/command/RenameContactCommand.test.d.ts +0 -2
  217. package/lib/types/internal/app-binder/command/RenameContactCommand.test.d.ts.map +0 -1
  218. package/lib/types/internal/app-binder/contactsVersionGuards.test.d.ts +0 -2
  219. package/lib/types/internal/app-binder/contactsVersionGuards.test.d.ts.map +0 -1
  220. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.d.ts +0 -2
  221. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.d.ts.map +0 -1
  222. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.d.ts +0 -2
  223. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.d.ts.map +0 -1
  224. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.d.ts +0 -2
  225. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.d.ts.map +0 -1
  226. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.d.ts +0 -2
  227. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.d.ts.map +0 -1
  228. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.d.ts +0 -2
  229. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.d.ts.map +0 -1
  230. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.d.ts +0 -2
  231. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.d.ts.map +0 -1
  232. package/lib/types/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.d.ts +0 -2
  233. package/lib/types/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.d.ts.map +0 -1
  234. package/lib/types/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.d.ts +0 -2
  235. package/lib/types/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.d.ts.map +0 -1
  236. package/lib/types/internal/app-binder/device-action/__test-utils__/makeInternalApi.d.ts +0 -4
  237. package/lib/types/internal/app-binder/device-action/__test-utils__/makeInternalApi.d.ts.map +0 -1
  238. package/lib/types/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.d.ts +0 -12
  239. package/lib/types/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.d.ts.map +0 -1
  240. package/lib/types/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.d.ts +0 -2
  241. package/lib/types/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.d.ts.map +0 -1
  242. package/lib/types/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.d.ts +0 -17
  243. package/lib/types/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.d.ts.map +0 -1
  244. package/lib/types/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.d.ts +0 -15
  245. package/lib/types/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.d.ts.map +0 -1
  246. package/lib/types/internal/app-binder/model/contactsValidation.test.d.ts +0 -2
  247. package/lib/types/internal/app-binder/model/contactsValidation.test.d.ts.map +0 -1
  248. package/lib/types/internal/app-binder/services/contactsTlvSerializer.test.d.ts +0 -2
  249. package/lib/types/internal/app-binder/services/contactsTlvSerializer.test.d.ts.map +0 -1
  250. package/lib/types/internal/app-binder/services/provideContact.test.d.ts +0 -2
  251. package/lib/types/internal/app-binder/services/provideContact.test.d.ts.map +0 -1
  252. package/lib/types/internal/app-binder/services/sendFramedContactsPayload.test.d.ts +0 -2
  253. package/lib/types/internal/app-binder/services/sendFramedContactsPayload.test.d.ts.map +0 -1
  254. package/lib/types/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.d.ts +0 -2
  255. package/lib/types/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.d.ts.map +0 -1
  256. package/lib/types/internal/app-binder/task/SendEditExternalAddressScopeTask.test.d.ts +0 -2
  257. package/lib/types/internal/app-binder/task/SendEditExternalAddressScopeTask.test.d.ts.map +0 -1
  258. package/lib/types/internal/app-binder/task/SendRegisterIdentityTask.test.d.ts +0 -2
  259. package/lib/types/internal/app-binder/task/SendRegisterIdentityTask.test.d.ts.map +0 -1
  260. package/lib/types/internal/app-binder/task/SendRenameContactTask.test.d.ts +0 -2
  261. package/lib/types/internal/app-binder/task/SendRenameContactTask.test.d.ts.map +0 -1
  262. package/lib/types/internal/di.test.d.ts +0 -2
  263. package/lib/types/internal/di.test.d.ts.map +0 -1
  264. package/lib/types/internal/use-cases/EditExternalAddressIdentifierUseCase.test.d.ts +0 -2
  265. package/lib/types/internal/use-cases/EditExternalAddressIdentifierUseCase.test.d.ts.map +0 -1
  266. package/lib/types/internal/use-cases/EditExternalAddressScopeUseCase.test.d.ts +0 -2
  267. package/lib/types/internal/use-cases/EditExternalAddressScopeUseCase.test.d.ts.map +0 -1
  268. package/lib/types/internal/use-cases/RegisterExternalAddressUseCase.test.d.ts +0 -2
  269. package/lib/types/internal/use-cases/RegisterExternalAddressUseCase.test.d.ts.map +0 -1
  270. package/lib/types/internal/use-cases/RenameContactUseCase.test.d.ts +0 -2
  271. package/lib/types/internal/use-cases/RenameContactUseCase.test.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- import{ContactsManagerBuilder as r}from"./ContactsManagerBuilder";import{CONTACTS_VERSION_REQUIREMENTS as n,ETHEREUM_APP_NAME as p,isVersionAtLeast as o,resolveContactsVersionRequirements as s}from"./model/ContactsVersionRequirements";import{buildProvideContactPayload as i,sendProvideContactPayload as A}from"../internal/app-binder/services/provideContact";export{n as CONTACTS_VERSION_REQUIREMENTS,r as ContactsManagerBuilder,p as ETHEREUM_APP_NAME,i as buildProvideContactPayload,o as isVersionAtLeast,s as resolveContactsVersionRequirements,A as sendProvideContactPayload};
1
+ import{ContactsManagerBuilder as r}from"./ContactsManagerBuilder";import{CONTACTS_VERSION_REQUIREMENTS as n,ETHEREUM_APP_NAME as p,isVersionAtLeast as o,resolveContactsVersionRequirements as s,SOLANA_APP_NAME as a,TRON_APP_NAME as i}from"./model/ContactsVersionRequirements";import{buildProvideContactPayload as E,sendProvideContactPayload as y}from"../internal/app-binder/services/provideContact";export{n as CONTACTS_VERSION_REQUIREMENTS,r as ContactsManagerBuilder,p as ETHEREUM_APP_NAME,a as SOLANA_APP_NAME,i as TRON_APP_NAME,E as buildProvideContactPayload,o as isVersionAtLeast,s as resolveContactsVersionRequirements,y as sendProvideContactPayload};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/index.ts"],
4
- "sourcesContent": ["export {\n type EditExternalAddressIdentifierDAError,\n type EditExternalAddressIdentifierDAInput,\n type EditExternalAddressIdentifierDAIntermediateValue,\n type EditExternalAddressIdentifierDAOutput,\n type EditExternalAddressIdentifierDARequiredInteraction,\n type EditExternalAddressIdentifierDAReturnType,\n type EditExternalAddressIdentifierDAState,\n} from \"@api/app-binder/EditExternalAddressIdentifierDeviceActionTypes\";\nexport {\n type EditExternalAddressScopeDAError,\n type EditExternalAddressScopeDAInput,\n type EditExternalAddressScopeDAIntermediateValue,\n type EditExternalAddressScopeDAOutput,\n type EditExternalAddressScopeDARequiredInteraction,\n type EditExternalAddressScopeDAReturnType,\n type EditExternalAddressScopeDAState,\n} from \"@api/app-binder/EditExternalAddressScopeDeviceActionTypes\";\nexport {\n type RegisterExternalAddressDAError,\n type RegisterExternalAddressDAInput,\n type RegisterExternalAddressDAIntermediateValue,\n type RegisterExternalAddressDAOutput,\n type RegisterExternalAddressDARequiredInteraction,\n type RegisterExternalAddressDAReturnType,\n type RegisterExternalAddressDAState,\n} from \"@api/app-binder/RegisterExternalAddressDeviceActionTypes\";\nexport {\n type RenameContactDAError,\n type RenameContactDAInput,\n type RenameContactDAIntermediateValue,\n type RenameContactDAOutput,\n type RenameContactDARequiredInteraction,\n type RenameContactDAReturnType,\n type RenameContactDAState,\n} from \"@api/app-binder/RenameContactDeviceActionTypes\";\nexport { type ContactsManager } from \"@api/ContactsManager\";\nexport { ContactsManagerBuilder } from \"@api/ContactsManagerBuilder\";\nexport {\n CONTACTS_VERSION_REQUIREMENTS,\n type ContactsModelRequirement,\n type ContactsModelSupport,\n type ContactsModelUnsupported,\n type ContactsVersionRequirements,\n ETHEREUM_APP_NAME,\n isVersionAtLeast,\n resolveContactsVersionRequirements,\n} from \"@api/model/ContactsVersionRequirements\";\nexport {\n type EditExternalAddressIdentifierInput,\n type EditExternalAddressIdentifierOutput,\n} from \"@api/model/EditExternalAddressIdentifier\";\nexport {\n type EditExternalAddressScopeInput,\n type EditExternalAddressScopeOutput,\n} from \"@api/model/EditExternalAddressScope\";\nexport { type ProvideContactInput } from \"@api/model/ProvideContact\";\nexport {\n type ExistingContactGroup,\n type RegisterExternalAddressInput,\n type RegisterExternalAddressMode,\n type RegisterExternalAddressOutput,\n} from \"@api/model/RegisterExternalAddress\";\nexport {\n type RenameContactInput,\n type RenameContactOutput,\n} from \"@api/model/RenameContact\";\nexport { type ContactsErrorCodes } from \"@internal/app-binder/model/contactsErrors\";\nexport {\n buildProvideContactPayload,\n sendProvideContactPayload,\n type SendProvideContactPayloadArgs,\n} from \"@internal/app-binder/services/provideContact\";\n"],
5
- "mappings": "AAqCA,OAAS,0BAAAA,MAA8B,8BACvC,OACE,iCAAAC,EAKA,qBAAAC,EACA,oBAAAC,EACA,sCAAAC,MACK,yCAqBP,OACE,8BAAAC,EACA,6BAAAC,MAEK",
6
- "names": ["ContactsManagerBuilder", "CONTACTS_VERSION_REQUIREMENTS", "ETHEREUM_APP_NAME", "isVersionAtLeast", "resolveContactsVersionRequirements", "buildProvideContactPayload", "sendProvideContactPayload"]
4
+ "sourcesContent": ["export {\n type EditExternalAddressIdentifierDAError,\n type EditExternalAddressIdentifierDAInput,\n type EditExternalAddressIdentifierDAIntermediateValue,\n type EditExternalAddressIdentifierDAOutput,\n type EditExternalAddressIdentifierDARequiredInteraction,\n type EditExternalAddressIdentifierDAReturnType,\n type EditExternalAddressIdentifierDAState,\n} from \"@api/app-binder/EditExternalAddressIdentifierDeviceActionTypes\";\nexport {\n type EditExternalAddressScopeDAError,\n type EditExternalAddressScopeDAInput,\n type EditExternalAddressScopeDAIntermediateValue,\n type EditExternalAddressScopeDAOutput,\n type EditExternalAddressScopeDARequiredInteraction,\n type EditExternalAddressScopeDAReturnType,\n type EditExternalAddressScopeDAState,\n} from \"@api/app-binder/EditExternalAddressScopeDeviceActionTypes\";\nexport {\n type RegisterExternalAddressDAError,\n type RegisterExternalAddressDAInput,\n type RegisterExternalAddressDAIntermediateValue,\n type RegisterExternalAddressDAOutput,\n type RegisterExternalAddressDARequiredInteraction,\n type RegisterExternalAddressDAReturnType,\n type RegisterExternalAddressDAState,\n} from \"@api/app-binder/RegisterExternalAddressDeviceActionTypes\";\nexport {\n type RenameContactDAError,\n type RenameContactDAInput,\n type RenameContactDAIntermediateValue,\n type RenameContactDAOutput,\n type RenameContactDARequiredInteraction,\n type RenameContactDAReturnType,\n type RenameContactDAState,\n} from \"@api/app-binder/RenameContactDeviceActionTypes\";\nexport { type ContactsManager } from \"@api/ContactsManager\";\nexport { ContactsManagerBuilder } from \"@api/ContactsManagerBuilder\";\nexport {\n CONTACTS_VERSION_REQUIREMENTS,\n type ContactsModelRequirement,\n type ContactsModelSupport,\n type ContactsModelUnsupported,\n type ContactsVersionRequirements,\n ETHEREUM_APP_NAME,\n isVersionAtLeast,\n resolveContactsVersionRequirements,\n SOLANA_APP_NAME,\n TRON_APP_NAME,\n} from \"@api/model/ContactsVersionRequirements\";\nexport {\n type EditExternalAddressIdentifierInput,\n type EditExternalAddressIdentifierOutput,\n} from \"@api/model/EditExternalAddressIdentifier\";\nexport {\n type EditExternalAddressScopeInput,\n type EditExternalAddressScopeOutput,\n} from \"@api/model/EditExternalAddressScope\";\nexport { type ProvideContactInput } from \"@api/model/ProvideContact\";\nexport {\n type ExistingContactGroup,\n type RegisterExternalAddressInput,\n type RegisterExternalAddressMode,\n type RegisterExternalAddressOutput,\n} from \"@api/model/RegisterExternalAddress\";\nexport {\n type RenameContactInput,\n type RenameContactOutput,\n} from \"@api/model/RenameContact\";\nexport { type ContactsErrorCodes } from \"@internal/app-binder/model/contactsErrors\";\nexport {\n buildProvideContactPayload,\n sendProvideContactPayload,\n type SendProvideContactPayloadArgs,\n} from \"@internal/app-binder/services/provideContact\";\n"],
5
+ "mappings": "AAqCA,OAAS,0BAAAA,MAA8B,8BACvC,OACE,iCAAAC,EAKA,qBAAAC,EACA,oBAAAC,EACA,sCAAAC,EACA,mBAAAC,EACA,iBAAAC,MACK,yCAqBP,OACE,8BAAAC,EACA,6BAAAC,MAEK",
6
+ "names": ["ContactsManagerBuilder", "CONTACTS_VERSION_REQUIREMENTS", "ETHEREUM_APP_NAME", "isVersionAtLeast", "resolveContactsVersionRequirements", "SOLANA_APP_NAME", "TRON_APP_NAME", "buildProvideContactPayload", "sendProvideContactPayload"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{DeviceModelId as r}from"@ledgerhq/device-management-kit";import{coerce as a,gte as N,lt as E,valid as p}from"semver";const s="Ethereum",R={supported:!1},u="1.11.0",c="1.7.0",d="1.2.0",l="2.8.0",_="1.7.0",i="1.23.0",A=`${u}-rc3`,m=`${c}-rc3`,V=`${d}-rc3`,M=`${l}-rc3`,P=`${_}-rc3`,O={[r.NANO_S]:R,[r.NANO_SP]:{supported:!0,minOsVersion:_,minAppVersion:{[s]:i},renameDerivationPathRequiredBelowOsVersion:P},[r.NANO_X]:{supported:!0,minOsVersion:l,minAppVersion:{[s]:i},renameDerivationPathRequiredBelowOsVersion:M},[r.STAX]:{supported:!0,minOsVersion:u,minAppVersion:{[s]:i},renameDerivationPathRequiredBelowOsVersion:A},[r.FLEX]:{supported:!0,minOsVersion:c,minAppVersion:{[s]:i},renameDerivationPathRequiredBelowOsVersion:m},[r.APEX]:{supported:!0,minOsVersion:d,minAppVersion:{[s]:i},renameDerivationPathRequiredBelowOsVersion:V}};function C(o){return O[o]}function I(o,t){const e=p(a(o)),n=p(a(t));return e===null||n===null?!1:N(e,n)}function S(o,t){const e=p(o),n=p(t);return e===null||n===null?!1:E(e,n)}function q(o,t){const e=O[o];if(!e.supported)return!1;const n=e.renameDerivationPathRequiredBelowOsVersion;return n===void 0?!1:S(t,n)}export{O as CONTACTS_VERSION_REQUIREMENTS,s as ETHEREUM_APP_NAME,I as isVersionAtLeast,S as isVersionBelow,q as renameRequiresDerivationPath,C as resolveContactsVersionRequirements};
1
+ import{DeviceModelId as t}from"@ledgerhq/device-management-kit";import{coerce as p,gte as d,lt as O,valid as i}from"semver";const A="Ethereum",E="Tron",R="Solana",P={supported:!1},a="1.11.0",_="1.7.0",c="1.2.0",u="2.8.0",l="1.7.0",V="1.23.0",m="0.8.0",M="10.0.0",s={[A]:V,[E]:m,[R]:M},S=`${a}-rc3`,I=`${_}-rc3`,T=`${c}-rc3`,f=`${u}-rc3`,C=`${l}-rc3`,N={[t.NANO_S]:P,[t.NANO_SP]:{supported:!0,minOsVersion:l,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:C},[t.NANO_X]:{supported:!0,minOsVersion:u,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:f},[t.STAX]:{supported:!0,minOsVersion:a,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:S},[t.FLEX]:{supported:!0,minOsVersion:_,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:I},[t.APEX]:{supported:!0,minOsVersion:c,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:T}};function F(n){return N[n]}function U(n,r){const e=i(p(n)),o=i(p(r));return e===null||o===null?!1:d(e,o)}function q(n,r){const e=i(n),o=i(r);return e===null||o===null?!1:O(e,o)}function x(n,r){const e=N[n];if(!e.supported)return!1;const o=e.renameDerivationPathRequiredBelowOsVersion;return o===void 0?!1:q(r,o)}export{N as CONTACTS_VERSION_REQUIREMENTS,A as ETHEREUM_APP_NAME,R as SOLANA_APP_NAME,E as TRON_APP_NAME,U as isVersionAtLeast,q as isVersionBelow,x as renameRequiresDerivationPath,F as resolveContactsVersionRequirements};
2
2
  //# sourceMappingURL=ContactsVersionRequirements.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/model/ContactsVersionRequirements.ts"],
4
- "sourcesContent": ["import { DeviceModelId } from \"@ledgerhq/device-management-kit\";\nimport { coerce, gte, lt, valid } from \"semver\";\n\n/**\n * Version requirements for a device model on which Contacts (Address Book)\n * operations are supported.\n *\n * Contacts has two independent version axes:\n * - `minOsVersion` gates OS-owned operations (e.g. renaming a contact from the\n * device dashboard), which are served by the device OS.\n * - `minAppVersion` gates app-owned operations (registering / editing external\n * addresses and Ledger accounts), which are served by the embedded app. It is\n * keyed by app name because the required version differs per app; v1 ships\n * Ethereum only.\n */\nexport type ContactsModelSupport = {\n readonly supported: true;\n readonly minOsVersion: string;\n readonly minAppVersion: Readonly<Record<string, string>>;\n /**\n * TEMPORARY (DSDK-1481) \u2014 the first OS build for this model that no longer\n * wants the `DERIVATION_PATH` (tag 0x69) on EDIT CONTACT NAME. Rename is\n * served by the OS, and OS builds *below* this version still require the path\n * (omitting it yields 0x686A), while this build and later reject it\n * (0x6A80). So the path is sent only when the device OS is below this\n * cutoff. Absent means the model never wanted the path (send nothing \u2014 the\n * GA end-state). Delete this field, its constants, and\n * {@link renameRequiresDerivationPath} once no in-the-field OS predates the\n * cutoff.\n */\n readonly renameDerivationPathRequiredBelowOsVersion?: string;\n};\n\n/** Marks a device model on which Contacts is not supported at all. */\nexport type ContactsModelUnsupported = {\n readonly supported: false;\n};\n\nexport type ContactsModelRequirement =\n | ContactsModelSupport\n | ContactsModelUnsupported;\n\n/**\n * The full, static Contacts version-requirement table, keyed by device model.\n * Serializable plain data with no runtime dependencies, so hosts (e.g. Ledger\n * Wallet) can import and consume it directly when composing their own\n * app-readiness checks, without duplicating the values.\n */\nexport type ContactsVersionRequirements = Readonly<\n Record<DeviceModelId, ContactsModelRequirement>\n>;\n\n/** The name of the Ethereum embedded app (the only app supported in v1). */\nexport const ETHEREUM_APP_NAME = \"Ethereum\";\n\nconst UNSUPPORTED: ContactsModelUnsupported = { supported: false };\n\nconst MIN_OS_VERSION_STAX = \"1.11.0\";\nconst MIN_OS_VERSION_FLEX = \"1.7.0\";\nconst MIN_OS_VERSION_APEX = \"1.2.0\";\nconst MIN_OS_VERSION_NANO_X = \"2.8.0\";\nconst MIN_OS_VERSION_NANO_SP = \"1.7.0\";\n\nconst MIN_ETHEREUM_APP_VERSION = \"1.23.0\";\n\n// TEMPORARY (DSDK-1481) \u2014 per-model cutoff below which the OS still requires the\n// EDIT CONTACT NAME derivation path. Each model's Address-Book-introducing OS\n// release shipped an rc2 that mandates the path (0x686A without it) and an rc3\n// that drops it (0x6A80 with it), so the cutoff is that release's `-rc3`. Only\n// Flex is hardware-confirmed (rc2 on a real device); the others follow the same\n// rc2/rc3 split per firmware \u2014 revise here if firmware says a model differs.\nconst RENAME_PATH_CUTOFF_STAX = `${MIN_OS_VERSION_STAX}-rc3`;\nconst RENAME_PATH_CUTOFF_FLEX = `${MIN_OS_VERSION_FLEX}-rc3`;\nconst RENAME_PATH_CUTOFF_APEX = `${MIN_OS_VERSION_APEX}-rc3`;\nconst RENAME_PATH_CUTOFF_NANO_X = `${MIN_OS_VERSION_NANO_X}-rc3`;\nconst RENAME_PATH_CUTOFF_NANO_SP = `${MIN_OS_VERSION_NANO_SP}-rc3`;\n\n/**\n * Contacts APDUs are supported on the touchscreen device models (Stax, Flex,\n * Apex) and on Nano X / Nano SP. Nano S does not support Contacts at all.\n */\nexport const CONTACTS_VERSION_REQUIREMENTS: ContactsVersionRequirements = {\n [DeviceModelId.NANO_S]: UNSUPPORTED,\n [DeviceModelId.NANO_SP]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_NANO_SP,\n minAppVersion: { [ETHEREUM_APP_NAME]: MIN_ETHEREUM_APP_VERSION },\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_NANO_SP,\n },\n [DeviceModelId.NANO_X]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_NANO_X,\n minAppVersion: { [ETHEREUM_APP_NAME]: MIN_ETHEREUM_APP_VERSION },\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_NANO_X,\n },\n [DeviceModelId.STAX]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_STAX,\n minAppVersion: { [ETHEREUM_APP_NAME]: MIN_ETHEREUM_APP_VERSION },\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_STAX,\n },\n [DeviceModelId.FLEX]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_FLEX,\n minAppVersion: { [ETHEREUM_APP_NAME]: MIN_ETHEREUM_APP_VERSION },\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_FLEX,\n },\n [DeviceModelId.APEX]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_APEX,\n minAppVersion: { [ETHEREUM_APP_NAME]: MIN_ETHEREUM_APP_VERSION },\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_APEX,\n },\n};\n\n/**\n * Resolve the Contacts version requirements for a device model \u2014 i.e. the\n * minimum supported OS and app versions, or that the model is unsupported.\n */\nexport function resolveContactsVersionRequirements(\n deviceModelId: DeviceModelId,\n): ContactsModelRequirement {\n return CONTACTS_VERSION_REQUIREMENTS[deviceModelId];\n}\n\n/**\n * Whether `actual` is greater than or equal to `minimum`, comparing as semver.\n * Tolerant of non-strict version strings and prerelease/build tags (coerces\n * both sides, which drops them) so a release candidate such as `1.7.0-rc2`\n * counts as meeting a `1.7.0` minimum. Returns `false` (i.e. requirement not\n * met) when either version cannot be parsed, so an unknown version never\n * passes a check.\n */\nexport function isVersionAtLeast(actual: string, minimum: string): boolean {\n const a = valid(coerce(actual));\n const b = valid(coerce(minimum));\n if (a === null || b === null) return false;\n return gte(a, b);\n}\n\n/**\n * Whether `actual` is strictly less than `boundary`, comparing as semver with\n * prerelease precedence preserved \u2014 unlike {@link isVersionAtLeast}, neither\n * side is coerced, so `1.7.0-rc2` sorts *below* `1.7.0-rc3` (and both below the\n * `1.7.0` release). Used to tell release candidates apart for the DSDK-1481\n * derivation-path cutoff, which `isVersionAtLeast` cannot do (it drops the\n * `-rcN` tag). Requires strict semver on both sides; returns `false` when\n * either cannot be parsed, so an unknown version is treated as *not* below the\n * boundary (i.e. the newer/GA payload shape).\n */\nexport function isVersionBelow(actual: string, boundary: string): boolean {\n const a = valid(actual);\n const b = valid(boundary);\n if (a === null || b === null) return false;\n return lt(a, b);\n}\n\n/**\n * TEMPORARY (DSDK-1481) \u2014 whether the EDIT CONTACT NAME (rename) payload must\n * carry the `DERIVATION_PATH` (tag 0x69) for a device on `osVersion`. True only\n * when the model is supported, declares a\n * {@link ContactsModelSupport.renameDerivationPathRequiredBelowOsVersion}\n * cutoff, and the fresh device OS version is strictly below that cutoff\n * (prerelease-aware). Callers pass the OS version read freshly from the device\n * (not the session state, which may be stale/absent on the dashboard path).\n */\nexport function renameRequiresDerivationPath(\n deviceModelId: DeviceModelId,\n osVersion: string,\n): boolean {\n const requirement = CONTACTS_VERSION_REQUIREMENTS[deviceModelId];\n if (!requirement.supported) return false;\n const cutoff = requirement.renameDerivationPathRequiredBelowOsVersion;\n if (cutoff === undefined) return false;\n return isVersionBelow(osVersion, cutoff);\n}\n"],
5
- "mappings": "AAAA,OAAS,iBAAAA,MAAqB,kCAC9B,OAAS,UAAAC,EAAQ,OAAAC,EAAK,MAAAC,EAAI,SAAAC,MAAa,SAoDhC,MAAMC,EAAoB,WAE3BC,EAAwC,CAAE,UAAW,EAAM,EAE3DC,EAAsB,SACtBC,EAAsB,QACtBC,EAAsB,QACtBC,EAAwB,QACxBC,EAAyB,QAEzBC,EAA2B,SAQ3BC,EAA0B,GAAGN,CAAmB,OAChDO,EAA0B,GAAGN,CAAmB,OAChDO,EAA0B,GAAGN,CAAmB,OAChDO,EAA4B,GAAGN,CAAqB,OACpDO,EAA6B,GAAGN,CAAsB,OAM/CO,EAA6D,CACxE,CAAClB,EAAc,MAAM,EAAGM,EACxB,CAACN,EAAc,OAAO,EAAG,CACvB,UAAW,GACX,aAAcW,EACd,cAAe,CAAE,CAACN,CAAiB,EAAGO,CAAyB,EAC/D,2CAA4CK,CAC9C,EACA,CAACjB,EAAc,MAAM,EAAG,CACtB,UAAW,GACX,aAAcU,EACd,cAAe,CAAE,CAACL,CAAiB,EAAGO,CAAyB,EAC/D,2CAA4CI,CAC9C,EACA,CAAChB,EAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcO,EACd,cAAe,CAAE,CAACF,CAAiB,EAAGO,CAAyB,EAC/D,2CAA4CC,CAC9C,EACA,CAACb,EAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcQ,EACd,cAAe,CAAE,CAACH,CAAiB,EAAGO,CAAyB,EAC/D,2CAA4CE,CAC9C,EACA,CAACd,EAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcS,EACd,cAAe,CAAE,CAACJ,CAAiB,EAAGO,CAAyB,EAC/D,2CAA4CG,CAC9C,CACF,EAMO,SAASI,EACdC,EAC0B,CAC1B,OAAOF,EAA8BE,CAAa,CACpD,CAUO,SAASC,EAAiBC,EAAgBC,EAA0B,CACzE,MAAMC,EAAIpB,EAAMH,EAAOqB,CAAM,CAAC,EACxBG,EAAIrB,EAAMH,EAAOsB,CAAO,CAAC,EAC/B,OAAIC,IAAM,MAAQC,IAAM,KAAa,GAC9BvB,EAAIsB,EAAGC,CAAC,CACjB,CAYO,SAASC,EAAeJ,EAAgBK,EAA2B,CACxE,MAAMH,EAAIpB,EAAMkB,CAAM,EAChBG,EAAIrB,EAAMuB,CAAQ,EACxB,OAAIH,IAAM,MAAQC,IAAM,KAAa,GAC9BtB,EAAGqB,EAAGC,CAAC,CAChB,CAWO,SAASG,EACdR,EACAS,EACS,CACT,MAAMC,EAAcZ,EAA8BE,CAAa,EAC/D,GAAI,CAACU,EAAY,UAAW,MAAO,GACnC,MAAMC,EAASD,EAAY,2CAC3B,OAAIC,IAAW,OAAkB,GAC1BL,EAAeG,EAAWE,CAAM,CACzC",
6
- "names": ["DeviceModelId", "coerce", "gte", "lt", "valid", "ETHEREUM_APP_NAME", "UNSUPPORTED", "MIN_OS_VERSION_STAX", "MIN_OS_VERSION_FLEX", "MIN_OS_VERSION_APEX", "MIN_OS_VERSION_NANO_X", "MIN_OS_VERSION_NANO_SP", "MIN_ETHEREUM_APP_VERSION", "RENAME_PATH_CUTOFF_STAX", "RENAME_PATH_CUTOFF_FLEX", "RENAME_PATH_CUTOFF_APEX", "RENAME_PATH_CUTOFF_NANO_X", "RENAME_PATH_CUTOFF_NANO_SP", "CONTACTS_VERSION_REQUIREMENTS", "resolveContactsVersionRequirements", "deviceModelId", "isVersionAtLeast", "actual", "minimum", "a", "b", "isVersionBelow", "boundary", "renameRequiresDerivationPath", "osVersion", "requirement", "cutoff"]
4
+ "sourcesContent": ["import { DeviceModelId } from \"@ledgerhq/device-management-kit\";\nimport { coerce, gte, lt, valid } from \"semver\";\n\n/**\n * Version requirements for a device model on which Contacts (Address Book)\n * operations are supported.\n *\n * Contacts has two independent version axes:\n * - `minOsVersion` gates OS-owned operations (e.g. renaming a contact from the\n * device dashboard), which are served by the device OS.\n * - `minAppVersion` gates app-owned operations (registering / editing external\n * addresses and Ledger accounts), which are served by the embedded app. It is\n * keyed by app name because the required version differs per app.\n */\nexport type ContactsModelSupport = {\n readonly supported: true;\n readonly minOsVersion: string;\n readonly minAppVersion: Readonly<Record<string, string>>;\n /**\n * TEMPORARY (DSDK-1481) \u2014 the first OS build for this model that no longer\n * wants the `DERIVATION_PATH` (tag 0x69) on EDIT CONTACT NAME. Rename is\n * served by the OS, and OS builds *below* this version still require the path\n * (omitting it yields 0x686A), while this build and later reject it\n * (0x6A80). So the path is sent only when the device OS is below this\n * cutoff. Absent means the model never wanted the path (send nothing \u2014 the\n * GA end-state). Delete this field, its constants, and\n * {@link renameRequiresDerivationPath} once no in-the-field OS predates the\n * cutoff.\n */\n readonly renameDerivationPathRequiredBelowOsVersion?: string;\n};\n\n/** Marks a device model on which Contacts is not supported at all. */\nexport type ContactsModelUnsupported = {\n readonly supported: false;\n};\n\nexport type ContactsModelRequirement =\n | ContactsModelSupport\n | ContactsModelUnsupported;\n\n/**\n * The full, static Contacts version-requirement table, keyed by device model.\n * Serializable plain data with no runtime dependencies, so hosts (e.g. Ledger\n * Wallet) can import and consume it directly when composing their own\n * app-readiness checks, without duplicating the values.\n */\nexport type ContactsVersionRequirements = Readonly<\n Record<DeviceModelId, ContactsModelRequirement>\n>;\n\n/** Names of embedded apps supporting Contacts. */\nexport const ETHEREUM_APP_NAME = \"Ethereum\";\nexport const TRON_APP_NAME = \"Tron\";\nexport const SOLANA_APP_NAME = \"Solana\";\n\nconst UNSUPPORTED: ContactsModelUnsupported = { supported: false };\n\nconst MIN_OS_VERSION_STAX = \"1.11.0\";\nconst MIN_OS_VERSION_FLEX = \"1.7.0\";\nconst MIN_OS_VERSION_APEX = \"1.2.0\";\nconst MIN_OS_VERSION_NANO_X = \"2.8.0\";\nconst MIN_OS_VERSION_NANO_SP = \"1.7.0\";\n\nconst MIN_ETHEREUM_APP_VERSION = \"1.23.0\";\nconst MIN_TRON_APP_VERSION = \"0.8.0\";\n// TEMPORARY (DSDK-1571) \u2014 the Solana app does not support Contacts yet and its\n// implementation is not scheduled, so this unreleased version keeps every\n// existing build out. Pin it to the first Contacts-enabled release once the\n// Solana app team names it.\nconst MIN_SOLANA_APP_VERSION = \"10.0.0\";\n\nconst MIN_APP_VERSION = {\n [ETHEREUM_APP_NAME]: MIN_ETHEREUM_APP_VERSION,\n [TRON_APP_NAME]: MIN_TRON_APP_VERSION,\n [SOLANA_APP_NAME]: MIN_SOLANA_APP_VERSION,\n};\n\n// TEMPORARY (DSDK-1481) \u2014 per-model cutoff below which the OS still requires the\n// EDIT CONTACT NAME derivation path. Each model's Address-Book-introducing OS\n// release shipped an rc2 that mandates the path (0x686A without it) and an rc3\n// that drops it (0x6A80 with it), so the cutoff is that release's `-rc3`. Only\n// Flex is hardware-confirmed (rc2 on a real device); the others follow the same\n// rc2/rc3 split per firmware \u2014 revise here if firmware says a model differs.\nconst RENAME_PATH_CUTOFF_STAX = `${MIN_OS_VERSION_STAX}-rc3`;\nconst RENAME_PATH_CUTOFF_FLEX = `${MIN_OS_VERSION_FLEX}-rc3`;\nconst RENAME_PATH_CUTOFF_APEX = `${MIN_OS_VERSION_APEX}-rc3`;\nconst RENAME_PATH_CUTOFF_NANO_X = `${MIN_OS_VERSION_NANO_X}-rc3`;\nconst RENAME_PATH_CUTOFF_NANO_SP = `${MIN_OS_VERSION_NANO_SP}-rc3`;\n\n/**\n * Contacts APDUs are supported on the touchscreen device models (Stax, Flex,\n * Apex) and on Nano X / Nano SP. Nano S does not support Contacts at all.\n */\nexport const CONTACTS_VERSION_REQUIREMENTS: ContactsVersionRequirements = {\n [DeviceModelId.NANO_S]: UNSUPPORTED,\n [DeviceModelId.NANO_SP]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_NANO_SP,\n minAppVersion: MIN_APP_VERSION,\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_NANO_SP,\n },\n [DeviceModelId.NANO_X]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_NANO_X,\n minAppVersion: MIN_APP_VERSION,\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_NANO_X,\n },\n [DeviceModelId.STAX]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_STAX,\n minAppVersion: MIN_APP_VERSION,\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_STAX,\n },\n [DeviceModelId.FLEX]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_FLEX,\n minAppVersion: MIN_APP_VERSION,\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_FLEX,\n },\n [DeviceModelId.APEX]: {\n supported: true,\n minOsVersion: MIN_OS_VERSION_APEX,\n minAppVersion: MIN_APP_VERSION,\n renameDerivationPathRequiredBelowOsVersion: RENAME_PATH_CUTOFF_APEX,\n },\n};\n\n/**\n * Resolve the Contacts version requirements for a device model \u2014 i.e. the\n * minimum supported OS and app versions, or that the model is unsupported.\n */\nexport function resolveContactsVersionRequirements(\n deviceModelId: DeviceModelId,\n): ContactsModelRequirement {\n return CONTACTS_VERSION_REQUIREMENTS[deviceModelId];\n}\n\n/**\n * Whether `actual` is greater than or equal to `minimum`, comparing as semver.\n * Tolerant of non-strict version strings and prerelease/build tags (coerces\n * both sides, which drops them) so a release candidate such as `1.7.0-rc2`\n * counts as meeting a `1.7.0` minimum. Returns `false` (i.e. requirement not\n * met) when either version cannot be parsed, so an unknown version never\n * passes a check.\n */\nexport function isVersionAtLeast(actual: string, minimum: string): boolean {\n const a = valid(coerce(actual));\n const b = valid(coerce(minimum));\n if (a === null || b === null) return false;\n return gte(a, b);\n}\n\n/**\n * Whether `actual` is strictly less than `boundary`, comparing as semver with\n * prerelease precedence preserved \u2014 unlike {@link isVersionAtLeast}, neither\n * side is coerced, so `1.7.0-rc2` sorts *below* `1.7.0-rc3` (and both below the\n * `1.7.0` release). Used to tell release candidates apart for the DSDK-1481\n * derivation-path cutoff, which `isVersionAtLeast` cannot do (it drops the\n * `-rcN` tag). Requires strict semver on both sides; returns `false` when\n * either cannot be parsed, so an unknown version is treated as *not* below the\n * boundary (i.e. the newer/GA payload shape).\n */\nexport function isVersionBelow(actual: string, boundary: string): boolean {\n const a = valid(actual);\n const b = valid(boundary);\n if (a === null || b === null) return false;\n return lt(a, b);\n}\n\n/**\n * TEMPORARY (DSDK-1481) \u2014 whether the EDIT CONTACT NAME (rename) payload must\n * carry the `DERIVATION_PATH` (tag 0x69) for a device on `osVersion`. True only\n * when the model is supported, declares a\n * {@link ContactsModelSupport.renameDerivationPathRequiredBelowOsVersion}\n * cutoff, and the fresh device OS version is strictly below that cutoff\n * (prerelease-aware). Callers pass the OS version read freshly from the device\n * (not the session state, which may be stale/absent on the dashboard path).\n */\nexport function renameRequiresDerivationPath(\n deviceModelId: DeviceModelId,\n osVersion: string,\n): boolean {\n const requirement = CONTACTS_VERSION_REQUIREMENTS[deviceModelId];\n if (!requirement.supported) return false;\n const cutoff = requirement.renameDerivationPathRequiredBelowOsVersion;\n if (cutoff === undefined) return false;\n return isVersionBelow(osVersion, cutoff);\n}\n"],
5
+ "mappings": "AAAA,OAAS,iBAAAA,MAAqB,kCAC9B,OAAS,UAAAC,EAAQ,OAAAC,EAAK,MAAAC,EAAI,SAAAC,MAAa,SAmDhC,MAAMC,EAAoB,WACpBC,EAAgB,OAChBC,EAAkB,SAEzBC,EAAwC,CAAE,UAAW,EAAM,EAE3DC,EAAsB,SACtBC,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AM,KAAa,GAC9B3B,EAAG0B,EAAGC,CAAC,CAChB,CAWO,SAASG,EACdR,EACAS,EACS,CACT,MAAMC,EAAcZ,EAA8BE,CAAa,EAC/D,GAAI,CAACU,EAAY,UAAW,MAAO,GACnC,MAAMC,EAASD,EAAY,2CAC3B,OAAIC,IAAW,OAAkB,GAC1BL,EAAeG,EAAWE,CAAM,CACzC",
6
+ "names": ["DeviceModelId", "coerce", "gte", "lt", "valid", "ETHEREUM_APP_NAME", "TRON_APP_NAME", "SOLANA_APP_NAME", "UNSUPPORTED", "MIN_OS_VERSION_STAX", "MIN_OS_VERSION_FLEX", "MIN_OS_VERSION_APEX", "MIN_OS_VERSION_NANO_X", "MIN_OS_VERSION_NANO_SP", "MIN_ETHEREUM_APP_VERSION", "MIN_TRON_APP_VERSION", "MIN_SOLANA_APP_VERSION", "MIN_APP_VERSION", "RENAME_PATH_CUTOFF_STAX", "RENAME_PATH_CUTOFF_FLEX", "RENAME_PATH_CUTOFF_APEX", "RENAME_PATH_CUTOFF_NANO_X", "RENAME_PATH_CUTOFF_NANO_SP", "CONTACTS_VERSION_REQUIREMENTS", "resolveContactsVersionRequirements", "deviceModelId", "isVersionAtLeast", "actual", "minimum", "a", "b", "isVersionBelow", "boundary", "renameRequiresDerivationPath", "osVersion", "requirement", "cutoff"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{BLOCKCHAIN_FAMILY_BY_NAME as a}from"../../../app-binder/model/contactsConstants";import{CONTACT_NAME_BUFFER_LENGTH as f,ContactsValidationError as i,ETH_ADDRESS_BYTES as n,GROUP_HANDLE_SIZE as l,HMAC_PROOF_LENGTH as o,SCOPE_BUFFER_LENGTH as c,validateByteLength as r,validateChainId as s,validatePrintableLabel as d}from"../../../app-binder/model/contactsValidation";const h=o;function I(e){try{d(e.contactName,{field:"contactName",bufferLength:f}),d(e.scope,{field:"scope",bufferLength:c});const t=e.blockchainFamily.toLowerCase();if(!(t in a))throw new i(`Unsupported blockchain family: ${e.blockchainFamily}`);if(t==="ethereum"){if(r(e.previousIdentifier,{field:"previousIdentifier",expectedBytes:n}),r(e.newIdentifier,{field:"newIdentifier",expectedBytes:n}),e.chainId===void 0)throw new i("chainId is required for the Ethereum blockchain family.")}else{if(e.previousIdentifier.length===0)throw new i("previousIdentifier must not be empty.");if(e.newIdentifier.length===0)throw new i("newIdentifier must not be empty.")}return e.chainId!==void 0&&s(e.chainId),r(e.groupHandle,{field:"groupHandle",expectedBytes:l}),r(e.hmacProof,{field:"hmacProof",expectedBytes:o}),r(e.hmacRest,{field:"hmacRest",expectedBytes:h}),null}catch(t){if(t instanceof i)return t;throw t}}export{I as validateEditExternalAddressIdentifierInput};
1
+ import{CONTACT_NAME_BUFFER_LENGTH as d,ContactsValidationError as n,GROUP_HANDLE_SIZE as l,HMAC_PROOF_LENGTH as a,SCOPE_BUFFER_LENGTH as o,validateByteLength as i,validateFamilyIdentifiers as f,validatePrintableLabel as r}from"../../../app-binder/model/contactsValidation";const c=a;function E(e){try{return r(e.contactName,{field:"contactName",bufferLength:d}),r(e.scope,{field:"scope",bufferLength:o}),f({blockchainFamily:e.blockchainFamily,identifiers:[{field:"previousIdentifier",value:e.previousIdentifier},{field:"newIdentifier",value:e.newIdentifier}],chainId:e.chainId}),i(e.groupHandle,{field:"groupHandle",expectedBytes:l}),i(e.hmacProof,{field:"hmacProof",expectedBytes:a}),i(e.hmacRest,{field:"hmacRest",expectedBytes:c}),null}catch(t){if(t instanceof n)return t;throw t}}export{E as validateEditExternalAddressIdentifierInput};
2
2
  //# sourceMappingURL=validateEditExternalAddressIdentifierInput.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.ts"],
4
- "sourcesContent": ["import { type EditExternalAddressIdentifierInput } from \"@api/model/EditExternalAddressIdentifier\";\nimport { BLOCKCHAIN_FAMILY_BY_NAME } from \"@internal/app-binder/model/contactsConstants\";\nimport {\n CONTACT_NAME_BUFFER_LENGTH,\n ContactsValidationError,\n ETH_ADDRESS_BYTES,\n GROUP_HANDLE_SIZE,\n HMAC_PROOF_LENGTH,\n SCOPE_BUFFER_LENGTH,\n validateByteLength,\n validateChainId,\n validatePrintableLabel,\n} from \"@internal/app-binder/model/contactsValidation\";\n\n// The address-level proof (`hmac_rest`) shares the 32-byte HMAC width.\nconst HMAC_REST_LENGTH = HMAC_PROOF_LENGTH;\n\n/**\n * Validate the caller input for Edit External Address Identifier. Returns the\n * first `ContactsValidationError`, or `null` when valid. Non-throwing so the\n * device action can surface it as a typed terminal error state.\n */\nexport function validateEditExternalAddressIdentifierInput(\n input: EditExternalAddressIdentifierInput,\n): ContactsValidationError | null {\n try {\n validatePrintableLabel(input.contactName, {\n field: \"contactName\",\n bufferLength: CONTACT_NAME_BUFFER_LENGTH,\n });\n validatePrintableLabel(input.scope, {\n field: \"scope\",\n bufferLength: SCOPE_BUFFER_LENGTH,\n });\n\n const family = input.blockchainFamily.toLowerCase();\n if (!(family in BLOCKCHAIN_FAMILY_BY_NAME)) {\n throw new ContactsValidationError(\n `Unsupported blockchain family: ${input.blockchainFamily}`,\n );\n }\n if (family === \"ethereum\") {\n validateByteLength(input.previousIdentifier, {\n field: \"previousIdentifier\",\n expectedBytes: ETH_ADDRESS_BYTES,\n });\n validateByteLength(input.newIdentifier, {\n field: \"newIdentifier\",\n expectedBytes: ETH_ADDRESS_BYTES,\n });\n // CHAIN_ID is mandatory for the Ethereum family (multiple networks share\n // the same address format).\n if (input.chainId === undefined) {\n throw new ContactsValidationError(\n \"chainId is required for the Ethereum blockchain family.\",\n );\n }\n } else {\n if (input.previousIdentifier.length === 0) {\n throw new ContactsValidationError(\n \"previousIdentifier must not be empty.\",\n );\n }\n if (input.newIdentifier.length === 0) {\n throw new ContactsValidationError(\"newIdentifier must not be empty.\");\n }\n }\n\n if (input.chainId !== undefined) {\n validateChainId(input.chainId);\n }\n\n validateByteLength(input.groupHandle, {\n field: \"groupHandle\",\n expectedBytes: GROUP_HANDLE_SIZE,\n });\n validateByteLength(input.hmacProof, {\n field: \"hmacProof\",\n expectedBytes: HMAC_PROOF_LENGTH,\n });\n validateByteLength(input.hmacRest, {\n field: \"hmacRest\",\n expectedBytes: HMAC_REST_LENGTH,\n });\n\n return null;\n } catch (error) {\n if (error instanceof ContactsValidationError) {\n return error;\n }\n throw error;\n }\n}\n"],
5
- "mappings": "AACA,OAAS,6BAAAA,MAAiC,+CAC1C,OACE,8BAAAC,EACA,2BAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,uBAAAC,EACA,sBAAAC,EACA,mBAAAC,EACA,0BAAAC,MACK,gDAGP,MAAMC,EAAmBL,EAOlB,SAASM,EACdC,EACgC,CAChC,GAAI,CACFH,EAAuBG,EAAM,YAAa,CACxC,MAAO,cACP,aAAcX,CAChB,CAAC,EACDQ,EAAuBG,EAAM,MAAO,CAClC,MAAO,QACP,aAAcN,CAChB,CAAC,EAED,MAAMO,EAASD,EAAM,iBAAiB,YAAY,EAClD,GAAI,EAAEC,KAAUb,GACd,MAAM,IAAIE,EACR,kCAAkCU,EAAM,gBAAgB,EAC1D,EAEF,GAAIC,IAAW,YAWb,GAVAN,EAAmBK,EAAM,mBAAoB,CAC3C,MAAO,qBACP,cAAeT,CACjB,CAAC,EACDI,EAAmBK,EAAM,cAAe,CACtC,MAAO,gBACP,cAAeT,CACjB,CAAC,EAGGS,EAAM,UAAY,OACpB,MAAM,IAAIV,EACR,yDACF,MAEG,CACL,GAAIU,EAAM,mBAAmB,SAAW,EACtC,MAAM,IAAIV,EACR,uCACF,EAEF,GAAIU,EAAM,cAAc,SAAW,EACjC,MAAM,IAAIV,EAAwB,kCAAkC,CAExE,CAEA,OAAIU,EAAM,UAAY,QACpBJ,EAAgBI,EAAM,OAAO,EAG/BL,EAAmBK,EAAM,YAAa,CACpC,MAAO,cACP,cAAeR,CACjB,CAAC,EACDG,EAAmBK,EAAM,UAAW,CAClC,MAAO,YACP,cAAeP,CACjB,CAAC,EACDE,EAAmBK,EAAM,SAAU,CACjC,MAAO,WACP,cAAeF,CACjB,CAAC,EAEM,IACT,OAASI,EAAO,CACd,GAAIA,aAAiBZ,EACnB,OAAOY,EAET,MAAMA,CACR,CACF",
6
- "names": ["BLOCKCHAIN_FAMILY_BY_NAME", "CONTACT_NAME_BUFFER_LENGTH", "ContactsValidationError", "ETH_ADDRESS_BYTES", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "SCOPE_BUFFER_LENGTH", "validateByteLength", "validateChainId", "validatePrintableLabel", "HMAC_REST_LENGTH", "validateEditExternalAddressIdentifierInput", "input", "family", "error"]
4
+ "sourcesContent": ["import { type EditExternalAddressIdentifierInput } from \"@api/model/EditExternalAddressIdentifier\";\nimport {\n CONTACT_NAME_BUFFER_LENGTH,\n ContactsValidationError,\n GROUP_HANDLE_SIZE,\n HMAC_PROOF_LENGTH,\n SCOPE_BUFFER_LENGTH,\n validateByteLength,\n validateFamilyIdentifiers,\n validatePrintableLabel,\n} from \"@internal/app-binder/model/contactsValidation\";\n\n// The address-level proof (`hmac_rest`) shares the 32-byte HMAC width.\nconst HMAC_REST_LENGTH = HMAC_PROOF_LENGTH;\n\n/**\n * Validate the caller input for Edit External Address Identifier. Returns the\n * first `ContactsValidationError`, or `null` when valid. Non-throwing so the\n * device action can surface it as a typed terminal error state.\n */\nexport function validateEditExternalAddressIdentifierInput(\n input: EditExternalAddressIdentifierInput,\n): ContactsValidationError | null {\n try {\n validatePrintableLabel(input.contactName, {\n field: \"contactName\",\n bufferLength: CONTACT_NAME_BUFFER_LENGTH,\n });\n validatePrintableLabel(input.scope, {\n field: \"scope\",\n bufferLength: SCOPE_BUFFER_LENGTH,\n });\n\n validateFamilyIdentifiers({\n blockchainFamily: input.blockchainFamily,\n identifiers: [\n { field: \"previousIdentifier\", value: input.previousIdentifier },\n { field: \"newIdentifier\", value: input.newIdentifier },\n ],\n chainId: input.chainId,\n });\n\n validateByteLength(input.groupHandle, {\n field: \"groupHandle\",\n expectedBytes: GROUP_HANDLE_SIZE,\n });\n validateByteLength(input.hmacProof, {\n field: \"hmacProof\",\n expectedBytes: HMAC_PROOF_LENGTH,\n });\n validateByteLength(input.hmacRest, {\n field: \"hmacRest\",\n expectedBytes: HMAC_REST_LENGTH,\n });\n\n return null;\n } catch (error) {\n if (error instanceof ContactsValidationError) {\n return error;\n }\n throw error;\n }\n}\n"],
5
+ "mappings": "AACA,OACE,8BAAAA,EACA,2BAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,uBAAAC,EACA,sBAAAC,EACA,6BAAAC,EACA,0BAAAC,MACK,gDAGP,MAAMC,EAAmBL,EAOlB,SAASM,EACdC,EACgC,CAChC,GAAI,CACF,OAAAH,EAAuBG,EAAM,YAAa,CACxC,MAAO,cACP,aAAcV,CAChB,CAAC,EACDO,EAAuBG,EAAM,MAAO,CAClC,MAAO,QACP,aAAcN,CAChB,CAAC,EAEDE,EAA0B,CACxB,iBAAkBI,EAAM,iBACxB,YAAa,CACX,CAAE,MAAO,qBAAsB,MAAOA,EAAM,kBAAmB,EAC/D,CAAE,MAAO,gBAAiB,MAAOA,EAAM,aAAc,CACvD,EACA,QAASA,EAAM,OACjB,CAAC,EAEDL,EAAmBK,EAAM,YAAa,CACpC,MAAO,cACP,cAAeR,CACjB,CAAC,EACDG,EAAmBK,EAAM,UAAW,CAClC,MAAO,YACP,cAAeP,CACjB,CAAC,EACDE,EAAmBK,EAAM,SAAU,CACjC,MAAO,WACP,cAAeF,CACjB,CAAC,EAEM,IACT,OAASG,EAAO,CACd,GAAIA,aAAiBV,EACnB,OAAOU,EAET,MAAMA,CACR,CACF",
6
+ "names": ["CONTACT_NAME_BUFFER_LENGTH", "ContactsValidationError", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "SCOPE_BUFFER_LENGTH", "validateByteLength", "validateFamilyIdentifiers", "validatePrintableLabel", "HMAC_REST_LENGTH", "validateEditExternalAddressIdentifierInput", "input", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{BLOCKCHAIN_FAMILY_BY_NAME as n}from"../../../app-binder/model/contactsConstants";import{CONTACT_NAME_BUFFER_LENGTH as c,ContactsValidationError as r,ETH_ADDRESS_BYTES as f,GROUP_HANDLE_SIZE as l,HMAC_PROOF_LENGTH as d,SCOPE_BUFFER_LENGTH as a,validateByteLength as i,validateChainId as h,validatePrintableLabel as o}from"../../../app-binder/model/contactsValidation";const s=d;function _(e){try{o(e.contactName,{field:"contactName",bufferLength:c}),o(e.previousScope,{field:"previousScope",bufferLength:a}),o(e.newScope,{field:"newScope",bufferLength:a});const t=e.blockchainFamily.toLowerCase();if(!(t in n))throw new r(`Unsupported blockchain family: ${e.blockchainFamily}`);if(t==="ethereum"){if(i(e.identifier,{field:"identifier",expectedBytes:f}),e.chainId===void 0)throw new r("chainId is required for the Ethereum blockchain family.")}else if(e.identifier.length===0)throw new r("identifier must not be empty.");return e.chainId!==void 0&&h(e.chainId),i(e.groupHandle,{field:"groupHandle",expectedBytes:l}),i(e.hmacProof,{field:"hmacProof",expectedBytes:d}),i(e.hmacRest,{field:"hmacRest",expectedBytes:s}),null}catch(t){if(t instanceof r)return t;throw t}}export{_ as validateEditExternalAddressScopeInput};
1
+ import{CONTACT_NAME_BUFFER_LENGTH as d,ContactsValidationError as c,GROUP_HANDLE_SIZE as l,HMAC_PROOF_LENGTH as o,SCOPE_BUFFER_LENGTH as i,validateByteLength as r,validateFamilyIdentifiers as n,validatePrintableLabel as a}from"../../../app-binder/model/contactsValidation";const f=o;function E(e){try{return a(e.contactName,{field:"contactName",bufferLength:d}),a(e.previousScope,{field:"previousScope",bufferLength:i}),a(e.newScope,{field:"newScope",bufferLength:i}),n({blockchainFamily:e.blockchainFamily,identifiers:[{field:"identifier",value:e.identifier}],chainId:e.chainId}),r(e.groupHandle,{field:"groupHandle",expectedBytes:l}),r(e.hmacProof,{field:"hmacProof",expectedBytes:o}),r(e.hmacRest,{field:"hmacRest",expectedBytes:f}),null}catch(t){if(t instanceof c)return t;throw t}}export{E as validateEditExternalAddressScopeInput};
2
2
  //# sourceMappingURL=validateEditExternalAddressScopeInput.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.ts"],
4
- "sourcesContent": ["import { type EditExternalAddressScopeInput } from \"@api/model/EditExternalAddressScope\";\nimport { BLOCKCHAIN_FAMILY_BY_NAME } from \"@internal/app-binder/model/contactsConstants\";\nimport {\n CONTACT_NAME_BUFFER_LENGTH,\n ContactsValidationError,\n ETH_ADDRESS_BYTES,\n GROUP_HANDLE_SIZE,\n HMAC_PROOF_LENGTH,\n SCOPE_BUFFER_LENGTH,\n validateByteLength,\n validateChainId,\n validatePrintableLabel,\n} from \"@internal/app-binder/model/contactsValidation\";\n\n// The address-level proof (`hmac_rest`) shares the 32-byte HMAC width.\nconst HMAC_REST_LENGTH = HMAC_PROOF_LENGTH;\n\n/**\n * Validate the caller input for Edit External Address Scope. Returns the first\n * `ContactsValidationError`, or `null` when valid. Non-throwing so the device\n * action can surface it as a typed terminal error state.\n */\nexport function validateEditExternalAddressScopeInput(\n input: EditExternalAddressScopeInput,\n): ContactsValidationError | null {\n try {\n validatePrintableLabel(input.contactName, {\n field: \"contactName\",\n bufferLength: CONTACT_NAME_BUFFER_LENGTH,\n });\n validatePrintableLabel(input.previousScope, {\n field: \"previousScope\",\n bufferLength: SCOPE_BUFFER_LENGTH,\n });\n validatePrintableLabel(input.newScope, {\n field: \"newScope\",\n bufferLength: SCOPE_BUFFER_LENGTH,\n });\n\n const family = input.blockchainFamily.toLowerCase();\n if (!(family in BLOCKCHAIN_FAMILY_BY_NAME)) {\n throw new ContactsValidationError(\n `Unsupported blockchain family: ${input.blockchainFamily}`,\n );\n }\n if (family === \"ethereum\") {\n validateByteLength(input.identifier, {\n field: \"identifier\",\n expectedBytes: ETH_ADDRESS_BYTES,\n });\n // CHAIN_ID is mandatory for the Ethereum family (multiple networks share\n // the same address format).\n if (input.chainId === undefined) {\n throw new ContactsValidationError(\n \"chainId is required for the Ethereum blockchain family.\",\n );\n }\n } else {\n if (input.identifier.length === 0) {\n throw new ContactsValidationError(\"identifier must not be empty.\");\n }\n }\n\n if (input.chainId !== undefined) {\n validateChainId(input.chainId);\n }\n\n validateByteLength(input.groupHandle, {\n field: \"groupHandle\",\n expectedBytes: GROUP_HANDLE_SIZE,\n });\n validateByteLength(input.hmacProof, {\n field: \"hmacProof\",\n expectedBytes: HMAC_PROOF_LENGTH,\n });\n validateByteLength(input.hmacRest, {\n field: \"hmacRest\",\n expectedBytes: HMAC_REST_LENGTH,\n });\n\n return null;\n } catch (error) {\n if (error instanceof ContactsValidationError) {\n return error;\n }\n throw error;\n }\n}\n"],
5
- "mappings": "AACA,OAAS,6BAAAA,MAAiC,+CAC1C,OACE,8BAAAC,EACA,2BAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,uBAAAC,EACA,sBAAAC,EACA,mBAAAC,EACA,0BAAAC,MACK,gDAGP,MAAMC,EAAmBL,EAOlB,SAASM,EACdC,EACgC,CAChC,GAAI,CACFH,EAAuBG,EAAM,YAAa,CACxC,MAAO,cACP,aAAcX,CAChB,CAAC,EACDQ,EAAuBG,EAAM,cAAe,CAC1C,MAAO,gBACP,aAAcN,CAChB,CAAC,EACDG,EAAuBG,EAAM,SAAU,CACrC,MAAO,WACP,aAAcN,CAChB,CAAC,EAED,MAAMO,EAASD,EAAM,iBAAiB,YAAY,EAClD,GAAI,EAAEC,KAAUb,GACd,MAAM,IAAIE,EACR,kCAAkCU,EAAM,gBAAgB,EAC1D,EAEF,GAAIC,IAAW,YAOb,GANAN,EAAmBK,EAAM,WAAY,CACnC,MAAO,aACP,cAAeT,CACjB,CAAC,EAGGS,EAAM,UAAY,OACpB,MAAM,IAAIV,EACR,yDACF,UAGEU,EAAM,WAAW,SAAW,EAC9B,MAAM,IAAIV,EAAwB,+BAA+B,EAIrE,OAAIU,EAAM,UAAY,QACpBJ,EAAgBI,EAAM,OAAO,EAG/BL,EAAmBK,EAAM,YAAa,CACpC,MAAO,cACP,cAAeR,CACjB,CAAC,EACDG,EAAmBK,EAAM,UAAW,CAClC,MAAO,YACP,cAAeP,CACjB,CAAC,EACDE,EAAmBK,EAAM,SAAU,CACjC,MAAO,WACP,cAAeF,CACjB,CAAC,EAEM,IACT,OAASI,EAAO,CACd,GAAIA,aAAiBZ,EACnB,OAAOY,EAET,MAAMA,CACR,CACF",
6
- "names": ["BLOCKCHAIN_FAMILY_BY_NAME", "CONTACT_NAME_BUFFER_LENGTH", "ContactsValidationError", "ETH_ADDRESS_BYTES", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "SCOPE_BUFFER_LENGTH", "validateByteLength", "validateChainId", "validatePrintableLabel", "HMAC_REST_LENGTH", "validateEditExternalAddressScopeInput", "input", "family", "error"]
4
+ "sourcesContent": ["import { type EditExternalAddressScopeInput } from \"@api/model/EditExternalAddressScope\";\nimport {\n CONTACT_NAME_BUFFER_LENGTH,\n ContactsValidationError,\n GROUP_HANDLE_SIZE,\n HMAC_PROOF_LENGTH,\n SCOPE_BUFFER_LENGTH,\n validateByteLength,\n validateFamilyIdentifiers,\n validatePrintableLabel,\n} from \"@internal/app-binder/model/contactsValidation\";\n\n// The address-level proof (`hmac_rest`) shares the 32-byte HMAC width.\nconst HMAC_REST_LENGTH = HMAC_PROOF_LENGTH;\n\n/**\n * Validate the caller input for Edit External Address Scope. Returns the first\n * `ContactsValidationError`, or `null` when valid. Non-throwing so the device\n * action can surface it as a typed terminal error state.\n */\nexport function validateEditExternalAddressScopeInput(\n input: EditExternalAddressScopeInput,\n): ContactsValidationError | null {\n try {\n validatePrintableLabel(input.contactName, {\n field: \"contactName\",\n bufferLength: CONTACT_NAME_BUFFER_LENGTH,\n });\n validatePrintableLabel(input.previousScope, {\n field: \"previousScope\",\n bufferLength: SCOPE_BUFFER_LENGTH,\n });\n validatePrintableLabel(input.newScope, {\n field: \"newScope\",\n bufferLength: SCOPE_BUFFER_LENGTH,\n });\n\n validateFamilyIdentifiers({\n blockchainFamily: input.blockchainFamily,\n identifiers: [{ field: \"identifier\", value: input.identifier }],\n chainId: input.chainId,\n });\n\n validateByteLength(input.groupHandle, {\n field: \"groupHandle\",\n expectedBytes: GROUP_HANDLE_SIZE,\n });\n validateByteLength(input.hmacProof, {\n field: \"hmacProof\",\n expectedBytes: HMAC_PROOF_LENGTH,\n });\n validateByteLength(input.hmacRest, {\n field: \"hmacRest\",\n expectedBytes: HMAC_REST_LENGTH,\n });\n\n return null;\n } catch (error) {\n if (error instanceof ContactsValidationError) {\n return error;\n }\n throw error;\n }\n}\n"],
5
+ "mappings": "AACA,OACE,8BAAAA,EACA,2BAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,uBAAAC,EACA,sBAAAC,EACA,6BAAAC,EACA,0BAAAC,MACK,gDAGP,MAAMC,EAAmBL,EAOlB,SAASM,EACdC,EACgC,CAChC,GAAI,CACF,OAAAH,EAAuBG,EAAM,YAAa,CACxC,MAAO,cACP,aAAcV,CAChB,CAAC,EACDO,EAAuBG,EAAM,cAAe,CAC1C,MAAO,gBACP,aAAcN,CAChB,CAAC,EACDG,EAAuBG,EAAM,SAAU,CACrC,MAAO,WACP,aAAcN,CAChB,CAAC,EAEDE,EAA0B,CACxB,iBAAkBI,EAAM,iBACxB,YAAa,CAAC,CAAE,MAAO,aAAc,MAAOA,EAAM,UAAW,CAAC,EAC9D,QAASA,EAAM,OACjB,CAAC,EAEDL,EAAmBK,EAAM,YAAa,CACpC,MAAO,cACP,cAAeR,CACjB,CAAC,EACDG,EAAmBK,EAAM,UAAW,CAClC,MAAO,YACP,cAAeP,CACjB,CAAC,EACDE,EAAmBK,EAAM,SAAU,CACjC,MAAO,WACP,cAAeF,CACjB,CAAC,EAEM,IACT,OAASG,EAAO,CACd,GAAIA,aAAiBV,EACnB,OAAOU,EAET,MAAMA,CACR,CACF",
6
+ "names": ["CONTACT_NAME_BUFFER_LENGTH", "ContactsValidationError", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "SCOPE_BUFFER_LENGTH", "validateByteLength", "validateFamilyIdentifiers", "validatePrintableLabel", "HMAC_REST_LENGTH", "validateEditExternalAddressScopeInput", "input", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{BLOCKCHAIN_FAMILY_BY_NAME as o}from"../../../app-binder/model/contactsConstants";import{CONTACT_NAME_BUFFER_LENGTH as a,ContactsValidationError as i,ETH_ADDRESS_BYTES as d,GROUP_HANDLE_SIZE as c,HMAC_PROOF_LENGTH as f,SCOPE_BUFFER_LENGTH as l,validateByteLength as r,validateChainId as s,validatePrintableLabel as n}from"../../../app-binder/model/contactsValidation";function E(e){try{n(e.contactName,{field:"contactName",bufferLength:a}),n(e.scope,{field:"scope",bufferLength:l});const t=e.blockchainFamily.toLowerCase();if(!(t in o))throw new i(`Unsupported blockchain family: ${e.blockchainFamily}`);if(t==="ethereum"){if(r(e.identifier,{field:"identifier",expectedBytes:d}),e.chainId===void 0)throw new i("chainId is required for the Ethereum blockchain family.")}else if(e.identifier.length===0)throw new i("identifier must not be empty.");return e.chainId!==void 0&&s(e.chainId),e.existingContactGroup&&(r(e.existingContactGroup.groupHandle,{field:"existingContactGroup.groupHandle",expectedBytes:c}),r(e.existingContactGroup.hmacProof,{field:"existingContactGroup.hmacProof",expectedBytes:f})),null}catch(t){if(t instanceof i)return t;throw t}}export{E as validateRegisterExternalAddressInput};
1
+ import{CONTACT_NAME_BUFFER_LENGTH as a,ContactsValidationError as n,GROUP_HANDLE_SIZE as o,HMAC_PROOF_LENGTH as l,SCOPE_BUFFER_LENGTH as c,validateByteLength as r,validateFamilyIdentifiers as d,validatePrintableLabel as i}from"../../../app-binder/model/contactsValidation";function f(e){try{return i(e.contactName,{field:"contactName",bufferLength:a}),i(e.scope,{field:"scope",bufferLength:c}),d({blockchainFamily:e.blockchainFamily,identifiers:[{field:"identifier",value:e.identifier}],chainId:e.chainId}),e.existingContactGroup&&(r(e.existingContactGroup.groupHandle,{field:"existingContactGroup.groupHandle",expectedBytes:o}),r(e.existingContactGroup.hmacProof,{field:"existingContactGroup.hmacProof",expectedBytes:l})),null}catch(t){if(t instanceof n)return t;throw t}}export{f as validateRegisterExternalAddressInput};
2
2
  //# sourceMappingURL=validateRegisterExternalAddressInput.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.ts"],
4
- "sourcesContent": ["import { type RegisterExternalAddressInput } from \"@api/model/RegisterExternalAddress\";\nimport { BLOCKCHAIN_FAMILY_BY_NAME } from \"@internal/app-binder/model/contactsConstants\";\nimport {\n CONTACT_NAME_BUFFER_LENGTH,\n ContactsValidationError,\n ETH_ADDRESS_BYTES,\n GROUP_HANDLE_SIZE,\n HMAC_PROOF_LENGTH,\n SCOPE_BUFFER_LENGTH,\n validateByteLength,\n validateChainId,\n validatePrintableLabel,\n} from \"@internal/app-binder/model/contactsValidation\";\n\n/**\n * Validate the caller input for Register External Address. Returns the first\n * `ContactsValidationError` found, or `null` when the input is valid.\n *\n * Non-throwing by design: the device action calls this so an invalid input is\n * surfaced as a typed terminal error state on the observable, keeping the\n * public `ContactsManager.registerExternalAddress` free of synchronous throws.\n */\nexport function validateRegisterExternalAddressInput(\n input: RegisterExternalAddressInput,\n): ContactsValidationError | null {\n try {\n validatePrintableLabel(input.contactName, {\n field: \"contactName\",\n bufferLength: CONTACT_NAME_BUFFER_LENGTH,\n });\n validatePrintableLabel(input.scope, {\n field: \"scope\",\n bufferLength: SCOPE_BUFFER_LENGTH,\n });\n\n const family = input.blockchainFamily.toLowerCase();\n if (!(family in BLOCKCHAIN_FAMILY_BY_NAME)) {\n throw new ContactsValidationError(\n `Unsupported blockchain family: ${input.blockchainFamily}`,\n );\n }\n if (family === \"ethereum\") {\n validateByteLength(input.identifier, {\n field: \"identifier\",\n expectedBytes: ETH_ADDRESS_BYTES,\n });\n // CHAIN_ID is mandatory for the Ethereum family (multiple networks share\n // the same address format).\n if (input.chainId === undefined) {\n throw new ContactsValidationError(\n \"chainId is required for the Ethereum blockchain family.\",\n );\n }\n } else if (input.identifier.length === 0) {\n throw new ContactsValidationError(\"identifier must not be empty.\");\n }\n\n if (input.chainId !== undefined) {\n validateChainId(input.chainId);\n }\n\n if (input.existingContactGroup) {\n validateByteLength(input.existingContactGroup.groupHandle, {\n field: \"existingContactGroup.groupHandle\",\n expectedBytes: GROUP_HANDLE_SIZE,\n });\n validateByteLength(input.existingContactGroup.hmacProof, {\n field: \"existingContactGroup.hmacProof\",\n expectedBytes: HMAC_PROOF_LENGTH,\n });\n }\n\n return null;\n } catch (error) {\n if (error instanceof ContactsValidationError) {\n return error;\n }\n throw error;\n }\n}\n"],
5
- "mappings": "AACA,OAAS,6BAAAA,MAAiC,+CAC1C,OACE,8BAAAC,EACA,2BAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,uBAAAC,EACA,sBAAAC,EACA,mBAAAC,EACA,0BAAAC,MACK,gDAUA,SAASC,EACdC,EACgC,CAChC,GAAI,CACFF,EAAuBE,EAAM,YAAa,CACxC,MAAO,cACP,aAAcV,CAChB,CAAC,EACDQ,EAAuBE,EAAM,MAAO,CAClC,MAAO,QACP,aAAcL,CAChB,CAAC,EAED,MAAMM,EAASD,EAAM,iBAAiB,YAAY,EAClD,GAAI,EAAEC,KAAUZ,GACd,MAAM,IAAIE,EACR,kCAAkCS,EAAM,gBAAgB,EAC1D,EAEF,GAAIC,IAAW,YAOb,GANAL,EAAmBI,EAAM,WAAY,CACnC,MAAO,aACP,cAAeR,CACjB,CAAC,EAGGQ,EAAM,UAAY,OACpB,MAAM,IAAIT,EACR,yDACF,UAEOS,EAAM,WAAW,SAAW,EACrC,MAAM,IAAIT,EAAwB,+BAA+B,EAGnE,OAAIS,EAAM,UAAY,QACpBH,EAAgBG,EAAM,OAAO,EAG3BA,EAAM,uBACRJ,EAAmBI,EAAM,qBAAqB,YAAa,CACzD,MAAO,mCACP,cAAeP,CACjB,CAAC,EACDG,EAAmBI,EAAM,qBAAqB,UAAW,CACvD,MAAO,iCACP,cAAeN,CACjB,CAAC,GAGI,IACT,OAASQ,EAAO,CACd,GAAIA,aAAiBX,EACnB,OAAOW,EAET,MAAMA,CACR,CACF",
6
- "names": ["BLOCKCHAIN_FAMILY_BY_NAME", "CONTACT_NAME_BUFFER_LENGTH", "ContactsValidationError", "ETH_ADDRESS_BYTES", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "SCOPE_BUFFER_LENGTH", "validateByteLength", "validateChainId", "validatePrintableLabel", "validateRegisterExternalAddressInput", "input", "family", "error"]
4
+ "sourcesContent": ["import { type RegisterExternalAddressInput } from \"@api/model/RegisterExternalAddress\";\nimport {\n CONTACT_NAME_BUFFER_LENGTH,\n ContactsValidationError,\n GROUP_HANDLE_SIZE,\n HMAC_PROOF_LENGTH,\n SCOPE_BUFFER_LENGTH,\n validateByteLength,\n validateFamilyIdentifiers,\n validatePrintableLabel,\n} from \"@internal/app-binder/model/contactsValidation\";\n\n/**\n * Validate the caller input for Register External Address. Returns the first\n * `ContactsValidationError` found, or `null` when the input is valid.\n *\n * Non-throwing by design: the device action calls this so an invalid input is\n * surfaced as a typed terminal error state on the observable, keeping the\n * public `ContactsManager.registerExternalAddress` free of synchronous throws.\n */\nexport function validateRegisterExternalAddressInput(\n input: RegisterExternalAddressInput,\n): ContactsValidationError | null {\n try {\n validatePrintableLabel(input.contactName, {\n field: \"contactName\",\n bufferLength: CONTACT_NAME_BUFFER_LENGTH,\n });\n validatePrintableLabel(input.scope, {\n field: \"scope\",\n bufferLength: SCOPE_BUFFER_LENGTH,\n });\n\n validateFamilyIdentifiers({\n blockchainFamily: input.blockchainFamily,\n identifiers: [{ field: \"identifier\", value: input.identifier }],\n chainId: input.chainId,\n });\n\n if (input.existingContactGroup) {\n validateByteLength(input.existingContactGroup.groupHandle, {\n field: \"existingContactGroup.groupHandle\",\n expectedBytes: GROUP_HANDLE_SIZE,\n });\n validateByteLength(input.existingContactGroup.hmacProof, {\n field: \"existingContactGroup.hmacProof\",\n expectedBytes: HMAC_PROOF_LENGTH,\n });\n }\n\n return null;\n } catch (error) {\n if (error instanceof ContactsValidationError) {\n return error;\n }\n throw error;\n }\n}\n"],
5
+ "mappings": "AACA,OACE,8BAAAA,EACA,2BAAAC,EACA,qBAAAC,EACA,qBAAAC,EACA,uBAAAC,EACA,sBAAAC,EACA,6BAAAC,EACA,0BAAAC,MACK,gDAUA,SAASC,EACdC,EACgC,CAChC,GAAI,CACF,OAAAF,EAAuBE,EAAM,YAAa,CACxC,MAAO,cACP,aAAcT,CAChB,CAAC,EACDO,EAAuBE,EAAM,MAAO,CAClC,MAAO,QACP,aAAcL,CAChB,CAAC,EAEDE,EAA0B,CACxB,iBAAkBG,EAAM,iBACxB,YAAa,CAAC,CAAE,MAAO,aAAc,MAAOA,EAAM,UAAW,CAAC,EAC9D,QAASA,EAAM,OACjB,CAAC,EAEGA,EAAM,uBACRJ,EAAmBI,EAAM,qBAAqB,YAAa,CACzD,MAAO,mCACP,cAAeP,CACjB,CAAC,EACDG,EAAmBI,EAAM,qBAAqB,UAAW,CACvD,MAAO,iCACP,cAAeN,CACjB,CAAC,GAGI,IACT,OAASO,EAAO,CACd,GAAIA,aAAiBT,EACnB,OAAOS,EAET,MAAMA,CACR,CACF",
6
+ "names": ["CONTACT_NAME_BUFFER_LENGTH", "ContactsValidationError", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "SCOPE_BUFFER_LENGTH", "validateByteLength", "validateFamilyIdentifiers", "validatePrintableLabel", "validateRegisterExternalAddressInput", "input", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- const o=176,_=16,t=1,x=32,C=3,A=4,E=224,T=46,e=0,n=64,r=32,c=32,s=32,N={bitcoin:0,ethereum:1,solana:2,polkadot:3,cosmos:4,cardano:5};export{N as BLOCKCHAIN_FAMILY_BY_NAME,o as CONTACTS_APDU_CLA,_ as CONTACTS_APDU_INS,n as GROUP_HANDLE_BYTES,s as HMAC_NAME_BYTES,r as HMAC_PROOF_BYTES,c as HMAC_REST_BYTES,E as RENAME_CONTACT_APDU_CLA,T as RENAME_CONTACT_APDU_INS,e as RENAME_CONTACT_P1,C as SUB_CMD_EDIT_IDENTIFIER,A as SUB_CMD_EDIT_SCOPE,x as SUB_CMD_PROVIDE_CONTACT,t as SUB_CMD_REGISTER_IDENTITY};
1
+ const o=176,_=16,t=1,x=32,C=3,A=4,E=224,T=46,e=0,n=64,r=32,c=32,s=32,N={bitcoin:0,ethereum:1,solana:2,polkadot:3,cosmos:4,cardano:5,tron:6};export{N as BLOCKCHAIN_FAMILY_BY_NAME,o as CONTACTS_APDU_CLA,_ as CONTACTS_APDU_INS,n as GROUP_HANDLE_BYTES,s as HMAC_NAME_BYTES,r as HMAC_PROOF_BYTES,c as HMAC_REST_BYTES,E as RENAME_CONTACT_APDU_CLA,T as RENAME_CONTACT_APDU_INS,e as RENAME_CONTACT_P1,C as SUB_CMD_EDIT_IDENTIFIER,A as SUB_CMD_EDIT_SCOPE,x as SUB_CMD_PROVIDE_CONTACT,t as SUB_CMD_REGISTER_IDENTITY};
2
2
  //# sourceMappingURL=contactsConstants.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/model/contactsConstants.ts"],
4
- "sourcesContent": ["/**\n * Protocol constants shared by the Contacts (Address Book) operations.\n *\n * Wire format and values follow the BOLOS SDK Address Book specification\n * (ledger-secure-sdk/app_features/address_book). Op-specific sub-command bytes\n * and response field sizes live here; TLV tags and struct-type bytes live in\n * {@link ./../services/contactsTlvSerializer}.\n */\n\n/** APDU class/instruction shared by every Address Book sub-command. */\nexport const CONTACTS_APDU_CLA = 0xb0;\nexport const CONTACTS_APDU_INS = 0x10;\n\n/** P1 sub-command selector for REGISTER IDENTITY (register external address). */\nexport const SUB_CMD_REGISTER_IDENTITY = 0x01;\n\n/** P1 sub-command selector for PROVIDE CONTACT (pre-signing decoration). */\nexport const SUB_CMD_PROVIDE_CONTACT = 0x20;\n\n/**\n * P1 sub-command selector for EDIT IDENTIFIER \u2014 an address-book app sub-command\n * (CLA 0xB0 / INS 0x10) served by the coin app, never OS-dispatched.\n */\nexport const SUB_CMD_EDIT_IDENTIFIER = 0x03;\n\n/**\n * P1 sub-command selector for EDIT SCOPE \u2014 an address-book app sub-command\n * (CLA 0xB0 / INS 0x10) served by the coin app, never OS-dispatched. Changes an\n * entry's scope while keeping its contact name and identifier.\n */\nexport const SUB_CMD_EDIT_SCOPE = 0x04;\n\n/**\n * EDIT CONTACT NAME (rename) is a blockchain-agnostic OS/dashboard command with\n * its own CLA/INS \u2014 NOT a sub-command of the address-book app APDU (0xB0/0x10).\n * The OS serves it directly, so it must run on the dashboard. P1 is a fixed\n * 0x00 (there is no sub-command selector for this command); P2 still carries the\n * chunk-continuation flag handled by {@link ./../services/sendFramedContactsPayload}.\n */\nexport const RENAME_CONTACT_APDU_CLA = 0xe0;\nexport const RENAME_CONTACT_APDU_INS = 0x2e;\nexport const RENAME_CONTACT_P1 = 0x00;\n\n/** Sizes (bytes) of the fields in the REGISTER IDENTITY final-chunk response. */\nexport const GROUP_HANDLE_BYTES = 64;\nexport const HMAC_PROOF_BYTES = 32;\nexport const HMAC_REST_BYTES = 32;\n\n/**\n * Size (bytes) of the rotated `hmac_name` returned on the EDIT CONTACT NAME\n * final-chunk response \u2014 the replacement group-level name proof.\n */\nexport const HMAC_NAME_BYTES = 32;\n\n/**\n * Blockchain-family byte encoded in the `BLOCKCHAIN_FAMILY` TLV, keyed by a\n * lowercase family name. v1 ships Ethereum only; the remaining families are\n * listed for completeness and will be enabled as their chains are supported.\n */\nexport const BLOCKCHAIN_FAMILY_BY_NAME: Readonly<Record<string, number>> = {\n bitcoin: 0x00,\n ethereum: 0x01,\n solana: 0x02,\n polkadot: 0x03,\n cosmos: 0x04,\n cardano: 0x05,\n};\n"],
5
- "mappings": "AAUO,MAAMA,EAAoB,IACpBC,EAAoB,GAGpBC,EAA4B,EAG5BC,EAA0B,GAM1BC,EAA0B,EAO1BC,EAAqB,EASrBC,EAA0B,IAC1BC,EAA0B,GAC1BC,EAAoB,EAGpBC,EAAqB,GACrBC,EAAmB,GACnBC,EAAkB,GAMlBC,EAAkB,GAOlBC,EAA8D,CACzE,QAAS,EACT,SAAU,EACV,OAAQ,EACR,SAAU,EACV,OAAQ,EACR,QAAS,CACX",
4
+ "sourcesContent": ["/**\n * Protocol constants shared by the Contacts (Address Book) operations.\n *\n * Wire format and values follow the BOLOS SDK Address Book specification\n * (ledger-secure-sdk/app_features/address_book). Op-specific sub-command bytes\n * and response field sizes live here; TLV tags and struct-type bytes live in\n * {@link ./../services/contactsTlvSerializer}.\n */\n\n/** APDU class/instruction shared by every Address Book sub-command. */\nexport const CONTACTS_APDU_CLA = 0xb0;\nexport const CONTACTS_APDU_INS = 0x10;\n\n/** P1 sub-command selector for REGISTER IDENTITY (register external address). */\nexport const SUB_CMD_REGISTER_IDENTITY = 0x01;\n\n/** P1 sub-command selector for PROVIDE CONTACT (pre-signing decoration). */\nexport const SUB_CMD_PROVIDE_CONTACT = 0x20;\n\n/**\n * P1 sub-command selector for EDIT IDENTIFIER \u2014 an address-book app sub-command\n * (CLA 0xB0 / INS 0x10) served by the coin app, never OS-dispatched.\n */\nexport const SUB_CMD_EDIT_IDENTIFIER = 0x03;\n\n/**\n * P1 sub-command selector for EDIT SCOPE \u2014 an address-book app sub-command\n * (CLA 0xB0 / INS 0x10) served by the coin app, never OS-dispatched. Changes an\n * entry's scope while keeping its contact name and identifier.\n */\nexport const SUB_CMD_EDIT_SCOPE = 0x04;\n\n/**\n * EDIT CONTACT NAME (rename) is a blockchain-agnostic OS/dashboard command with\n * its own CLA/INS \u2014 NOT a sub-command of the address-book app APDU (0xB0/0x10).\n * The OS serves it directly, so it must run on the dashboard. P1 is a fixed\n * 0x00 (there is no sub-command selector for this command); P2 still carries the\n * chunk-continuation flag handled by {@link ./../services/sendFramedContactsPayload}.\n */\nexport const RENAME_CONTACT_APDU_CLA = 0xe0;\nexport const RENAME_CONTACT_APDU_INS = 0x2e;\nexport const RENAME_CONTACT_P1 = 0x00;\n\n/** Sizes (bytes) of the fields in the REGISTER IDENTITY final-chunk response. */\nexport const GROUP_HANDLE_BYTES = 64;\nexport const HMAC_PROOF_BYTES = 32;\nexport const HMAC_REST_BYTES = 32;\n\n/**\n * Size (bytes) of the rotated `hmac_name` returned on the EDIT CONTACT NAME\n * final-chunk response \u2014 the replacement group-level name proof.\n */\nexport const HMAC_NAME_BYTES = 32;\n\n/**\n * Blockchain-family byte encoded in the `BLOCKCHAIN_FAMILY` TLV, keyed by a\n * lowercase family name. Values follow the BOLOS Address Book family enum\n * (`BlockchainFamily` in ragger / ledger-secure-sdk).\n */\nexport const BLOCKCHAIN_FAMILY_BY_NAME: Readonly<Record<string, number>> = {\n bitcoin: 0x00,\n ethereum: 0x01,\n solana: 0x02,\n polkadot: 0x03,\n cosmos: 0x04,\n cardano: 0x05,\n tron: 0x06,\n};\n"],
5
+ "mappings": "AAUO,MAAMA,EAAoB,IACpBC,EAAoB,GAGpBC,EAA4B,EAG5BC,EAA0B,GAM1BC,EAA0B,EAO1BC,EAAqB,EASrBC,EAA0B,IAC1BC,EAA0B,GAC1BC,EAAoB,EAGpBC,EAAqB,GACrBC,EAAmB,GACnBC,EAAkB,GAMlBC,EAAkB,GAOlBC,EAA8D,CACzE,QAAS,EACT,SAAU,EACV,OAAQ,EACR,SAAU,EACV,OAAQ,EACR,QAAS,EACT,KAAM,CACR",
6
6
  "names": ["CONTACTS_APDU_CLA", "CONTACTS_APDU_INS", "SUB_CMD_REGISTER_IDENTITY", "SUB_CMD_PROVIDE_CONTACT", "SUB_CMD_EDIT_IDENTIFIER", "SUB_CMD_EDIT_SCOPE", "RENAME_CONTACT_APDU_CLA", "RENAME_CONTACT_APDU_INS", "RENAME_CONTACT_P1", "GROUP_HANDLE_BYTES", "HMAC_PROOF_BYTES", "HMAC_REST_BYTES", "HMAC_NAME_BYTES", "BLOCKCHAIN_FAMILY_BY_NAME"]
7
7
  }
@@ -1,2 +1,2 @@
1
- const w=33,b=33,x=64,l=32,d=10,$=20;class i extends Error{_tag="ContactsValidationError";originalError;constructor(n){super(n),this.name="ContactsValidationError"}}const m=32,p=126,y=new TextEncoder;function E(t,n){const{field:r,bufferLength:e}=n;if(!t)throw new i(`${r} must not be empty (firmware rejects empty strings).`);const o=y.encode(t),s=e-1;if(o.length>s)throw new i(`${r} ${JSON.stringify(t)} is too long: ${o.length} bytes encoded (max ${s}). The device buffer is ${e} bytes including the trailing NUL.`);const f=[];for(let c=0;c<o.length;c++){const a=o[c];(a<m||a>p)&&f.push(c)}if(f.length>0){const a=Array.from(new Set(f.map(g=>o[g]))).sort((g,h)=>g-h).map(g=>`0x${g.toString(16).padStart(2,"0")}`).join(", ");throw new i(`${r} ${JSON.stringify(t)} contains ${f.length} non-ASCII byte(s) at position(s) [${f.join(", ")}]: ${a}. The device buffer is byte-level isprint() \u2014 only 0x20-0x7E are accepted, no UTF-8 / accents / emoji.`)}}function N(t,n){const{field:r,expectedBytes:e}=n;if(t.length!==e)throw new i(`${r} is ${t.length} bytes, expected ${e}.`)}function u(t){if(!t)throw new i(`derivationPath must not be empty (e.g. "m/44'/60'/0'/0/0").`);const n=t.split("/"),r=n[0]==="m"||n[0]==="M"?n.slice(1):n;if(r.length===0)throw new i(`derivationPath ${JSON.stringify(t)} has no segments past 'm'.`);if(r.length>d)throw new i(`derivationPath ${JSON.stringify(t)} has ${r.length} segments (max ${d}). Firmware rejects deeper paths.`);for(const e of r){const o=e.endsWith("'")?e.slice(0,-1):e;if(!o||!/^\d+$/.test(o))throw new i(`derivationPath ${JSON.stringify(t)} segment ${JSON.stringify(e)} is not numeric. Use plain integers, optionally suffixed with ' for hardened.`);const s=Number(o);if(!Number.isSafeInteger(s)||s>=2147483648)throw new i(`derivationPath ${JSON.stringify(t)} segment ${JSON.stringify(e)} >= 2^31. Use the ' suffix for hardening rather than overflowing.`)}}function I(t){const n=typeof t=="number";if(!n&&!(typeof t=="bigint"))throw new i(`chainId must be number or bigint, got ${typeof t}.`);if(n&&!Number.isInteger(t))throw new i(`chainId must be an integer, got ${t}.`);const e=typeof t=="bigint"?t:BigInt(t);if(e<=0n)throw new i(`chainId must be positive, got ${t}.`);const o=(1n<<64n)-1n;if(e>o)throw new i(`chainId ${t} exceeds uint64 range (max ${o}).`)}export{w as CONTACT_NAME_BUFFER_LENGTH,i as ContactsValidationError,$ as ETH_ADDRESS_BYTES,x as GROUP_HANDLE_SIZE,l as HMAC_PROOF_LENGTH,d as MAX_BIP32_DEPTH,b as SCOPE_BUFFER_LENGTH,N as validateByteLength,I as validateChainId,u as validateDerivationPath,E as validatePrintableLabel};
1
+ import{BLOCKCHAIN_FAMILY_BY_NAME as m}from"../../app-binder/model/contactsConstants";const E=33,I=33,N=64,S=32,h=10,y=20,p=32;class n extends Error{_tag="ContactsValidationError";originalError;constructor(i){super(i),this.name="ContactsValidationError"}}const w=32,b=126,u=new TextEncoder;function _(e,i){const{field:r,bufferLength:t}=i;if(!e)throw new n(`${r} must not be empty (firmware rejects empty strings).`);const o=u.encode(e),a=t-1;if(o.length>a)throw new n(`${r} ${JSON.stringify(e)} is too long: ${o.length} bytes encoded (max ${a}). The device buffer is ${t} bytes including the trailing NUL.`);const s=[];for(let f=0;f<o.length;f++){const c=o[f];(c<w||c>b)&&s.push(f)}if(s.length>0){const c=Array.from(new Set(s.map(d=>o[d]))).sort((d,l)=>d-l).map(d=>`0x${d.toString(16).padStart(2,"0")}`).join(", ");throw new n(`${r} ${JSON.stringify(e)} contains ${s.length} non-ASCII byte(s) at position(s) [${s.join(", ")}]: ${c}. The device buffer is byte-level isprint() \u2014 only 0x20-0x7E are accepted, no UTF-8 / accents / emoji.`)}}function g(e,i){const{field:r,expectedBytes:t}=i;if(e.length!==t)throw new n(`${r} is ${e.length} bytes, expected ${t}.`)}function B(e){if(!e)throw new n(`derivationPath must not be empty (e.g. "m/44'/60'/0'/0/0").`);const i=e.split("/"),r=i[0]==="m"||i[0]==="M"?i.slice(1):i;if(r.length===0)throw new n(`derivationPath ${JSON.stringify(e)} has no segments past 'm'.`);if(r.length>h)throw new n(`derivationPath ${JSON.stringify(e)} has ${r.length} segments (max ${h}). Firmware rejects deeper paths.`);for(const t of r){const o=t.endsWith("'")?t.slice(0,-1):t;if(!o||!/^\d+$/.test(o))throw new n(`derivationPath ${JSON.stringify(e)} segment ${JSON.stringify(t)} is not numeric. Use plain integers, optionally suffixed with ' for hardened.`);const a=Number(o);if(!Number.isSafeInteger(a)||a>=2147483648)throw new n(`derivationPath ${JSON.stringify(e)} segment ${JSON.stringify(t)} >= 2^31. Use the ' suffix for hardening rather than overflowing.`)}}function x(e){const i=typeof e=="number";if(!i&&!(typeof e=="bigint"))throw new n(`chainId must be number or bigint, got ${typeof e}.`);if(i&&!Number.isInteger(e))throw new n(`chainId must be an integer, got ${e}.`);const t=typeof e=="bigint"?e:BigInt(e);if(t<=0n)throw new n(`chainId must be positive, got ${e}.`);const o=(1n<<64n)-1n;if(t>o)throw new n(`chainId ${e} exceeds uint64 range (max ${o}).`)}function A(e){const{blockchainFamily:i,identifiers:r,chainId:t}=e,o=i.toLowerCase(),a=m[o];if(a===void 0)throw new n(`Unsupported blockchain family: ${i}`);if(o==="ethereum"){for(const{field:s,value:f}of r)g(f,{field:s,expectedBytes:y});if(t===void 0)throw new n("chainId is required for the Ethereum blockchain family.")}else if(o==="solana"){for(const{field:s,value:f}of r)g(f,{field:s,expectedBytes:p});if(t!==void 0)throw new n("chainId is not allowed for the Solana blockchain family.")}else for(const{field:s,value:f}of r)if(f.length===0)throw new n(`${s} must not be empty.`);return t!==void 0&&x(t),a}export{E as CONTACT_NAME_BUFFER_LENGTH,n as ContactsValidationError,y as ETH_ADDRESS_BYTES,N as GROUP_HANDLE_SIZE,S as HMAC_PROOF_LENGTH,h as MAX_BIP32_DEPTH,I as SCOPE_BUFFER_LENGTH,p as SOLANA_ADDRESS_BYTES,g as validateByteLength,x as validateChainId,B as validateDerivationPath,A as validateFamilyIdentifiers,_ as validatePrintableLabel};
2
2
  //# sourceMappingURL=contactsValidation.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/model/contactsValidation.ts"],
4
- "sourcesContent": ["/**\n * Pre-APDU input validators for the Contacts operations.\n *\n * Buffer-length constants mirror the Ledger secure SDK `#define` values\n * *including* the trailing NUL terminator (so a 32-printable-char name lives in\n * a 33-byte buffer). Validators subtract 1 internally so the constants remain\n * pure equality checks against the upstream `#define`s. The byte-level\n * `0x20..0x7E` printable check exactly matches firmware `is_printable_string`.\n */\nimport { type DmkError } from \"@ledgerhq/device-management-kit\";\n\n// ---- SDK-mirrored constants -------------------------------------------------\n// Source of truth: ledger-secure-sdk/app_features/address_book/include/\n\nexport const CONTACT_NAME_BUFFER_LENGTH = 33; // identity.h:49 (incl. NUL)\nexport const SCOPE_BUFFER_LENGTH = 33; // identity.h:50 (incl. NUL)\nexport const GROUP_HANDLE_SIZE = 64; // identity.h:47\nexport const HMAC_PROOF_LENGTH = 32; // CX_SHA256_SIZE\nexport const MAX_BIP32_DEPTH = 10; // bip32.h:15 (MAX_BIP32_PATH)\nexport const ETH_ADDRESS_BYTES = 20; // protocol convention, no header\n\n// ---- error type -------------------------------------------------------------\n\n/**\n * Raised when caller input fails a pre-APDU check. Implements `DmkError` (and\n * stays an `Error` subclass) so a Contacts device action can surface it as a\n * typed terminal error state on the observable rather than throwing out of the\n * public, device-action-returning API.\n */\nexport class ContactsValidationError extends Error implements DmkError {\n readonly _tag = \"ContactsValidationError\";\n readonly originalError?: unknown;\n constructor(message: string) {\n super(message);\n this.name = \"ContactsValidationError\";\n }\n}\n\n// ---- printable-string validation -------------------------------------------\n\nconst PRINTABLE_MIN = 0x20;\nconst PRINTABLE_MAX = 0x7e;\n\nconst utf8Encoder = new TextEncoder();\n\n/**\n * Mirror of firmware `is_printable_string` + length cap. `bufferLength` is the\n * firmware's fixed buffer size *including* the trailing NUL, so the maximum\n * payload byte length is `bufferLength - 1`.\n */\nexport function validatePrintableLabel(\n value: string,\n options: { field: string; bufferLength: number },\n): void {\n const { field, bufferLength } = options;\n if (!value) {\n throw new ContactsValidationError(\n `${field} must not be empty (firmware rejects empty strings).`,\n );\n }\n const encoded = utf8Encoder.encode(value);\n const maxBytes = bufferLength - 1;\n if (encoded.length > maxBytes) {\n throw new ContactsValidationError(\n `${field} ${JSON.stringify(value)} is too long: ${encoded.length} bytes ` +\n `encoded (max ${maxBytes}). The device buffer is ${bufferLength} bytes ` +\n `including the trailing NUL.`,\n );\n }\n const badPositions: number[] = [];\n for (let i = 0; i < encoded.length; i++) {\n const byte = encoded[i]!;\n if (byte < PRINTABLE_MIN || byte > PRINTABLE_MAX) {\n badPositions.push(i);\n }\n }\n if (badPositions.length > 0) {\n const offendingBytes = Array.from(\n new Set(badPositions.map((i) => encoded[i]!)),\n ).sort((a, b) => a - b);\n const offendingHex = offendingBytes\n .map((b) => `0x${b.toString(16).padStart(2, \"0\")}`)\n .join(\", \");\n throw new ContactsValidationError(\n `${field} ${JSON.stringify(value)} contains ${badPositions.length} ` +\n `non-ASCII byte(s) at position(s) [${badPositions.join(\", \")}]: ` +\n `${offendingHex}. The device buffer is byte-level isprint() \u2014 only ` +\n `0x20-0x7E are accepted, no UTF-8 / accents / emoji.`,\n );\n }\n}\n\n// ---- byte-buffer validation ------------------------------------------------\n\n/** Assert a byte buffer is exactly `expectedBytes` long and non-empty. */\nexport function validateByteLength(\n value: Uint8Array,\n options: { field: string; expectedBytes: number },\n): void {\n const { field, expectedBytes } = options;\n if (value.length !== expectedBytes) {\n throw new ContactsValidationError(\n `${field} is ${value.length} bytes, expected ${expectedBytes}.`,\n );\n }\n}\n\n// ---- BIP32 path validation -------------------------------------------------\n\n/**\n * Sanity-check a BIP32 path before serialization. Firmware enforces depth <=\n * MAX_BIP32_DEPTH and rejects malformed segments. Accepts `m/44'/60'/0'/0/0`\n * style; segments may end in `'` (hardened).\n */\nexport function validateDerivationPath(path: string): void {\n if (!path) {\n throw new ContactsValidationError(\n `derivationPath must not be empty (e.g. \"m/44'/60'/0'/0/0\").`,\n );\n }\n const parts = path.split(\"/\");\n const segments =\n parts[0] === \"m\" || parts[0] === \"M\" ? parts.slice(1) : parts;\n if (segments.length === 0) {\n throw new ContactsValidationError(\n `derivationPath ${JSON.stringify(path)} has no segments past 'm'.`,\n );\n }\n if (segments.length > MAX_BIP32_DEPTH) {\n throw new ContactsValidationError(\n `derivationPath ${JSON.stringify(path)} has ${segments.length} segments ` +\n `(max ${MAX_BIP32_DEPTH}). Firmware rejects deeper paths.`,\n );\n }\n for (const segment of segments) {\n const token = segment.endsWith(\"'\") ? segment.slice(0, -1) : segment;\n if (!token || !/^\\d+$/.test(token)) {\n throw new ContactsValidationError(\n `derivationPath ${JSON.stringify(path)} segment ${JSON.stringify(segment)} ` +\n `is not numeric. Use plain integers, optionally suffixed with ' for hardened.`,\n );\n }\n const n = Number(token);\n if (!Number.isSafeInteger(n) || n >= 0x80000000) {\n throw new ContactsValidationError(\n `derivationPath ${JSON.stringify(path)} segment ${JSON.stringify(segment)} ` +\n `>= 2^31. Use the ' suffix for hardening rather than overflowing.`,\n );\n }\n }\n}\n\n// ---- chain id validation ---------------------------------------------------\n\n/**\n * Firmware encodes chain_id as uint64. JS `number` is fine up to 2^53; accept\n * `bigint` for the high range so callers don't silently truncate.\n */\nexport function validateChainId(value: number | bigint): void {\n const isNumber = typeof value === \"number\";\n const isBigInt = typeof value === \"bigint\";\n if (!isNumber && !isBigInt) {\n throw new ContactsValidationError(\n `chainId must be number or bigint, got ${typeof value}.`,\n );\n }\n if (isNumber && !Number.isInteger(value)) {\n throw new ContactsValidationError(\n `chainId must be an integer, got ${value}.`,\n );\n }\n const v = typeof value === \"bigint\" ? value : BigInt(value);\n if (v <= 0n) {\n throw new ContactsValidationError(\n `chainId must be positive, got ${value}.`,\n );\n }\n const UINT64_MAX = (1n << 64n) - 1n;\n if (v > UINT64_MAX) {\n throw new ContactsValidationError(\n `chainId ${value} exceeds uint64 range (max ${UINT64_MAX}).`,\n );\n }\n}\n"],
5
- "mappings": "AAcO,MAAMA,EAA6B,GAC7BC,EAAsB,GACtBC,EAAoB,GACpBC,EAAoB,GACpBC,EAAkB,GAClBC,EAAoB,GAU1B,MAAMC,UAAgC,KAA0B,CAC5D,KAAO,0BACP,cACT,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,KAAO,yBACd,CACF,CAIA,MAAMC,EAAgB,GAChBC,EAAgB,IAEhBC,EAAc,IAAI,YAOjB,SAASC,EACdC,EACAC,EACM,CACN,KAAM,CAAE,MAAAC,EAAO,aAAAC,CAAa,EAAIF,EAChC,GAAI,CAACD,EACH,MAAM,IAAIN,EACR,GAAGQ,CAAK,sDACV,EAEF,MAAME,EAAUN,EAAY,OAAOE,CAAK,EAClCK,EAAWF,EAAe,EAChC,GAAIC,EAAQ,OAASC,EACnB,MAAM,IAAIX,EACR,GAAGQ,CAAK,IAAI,KAAK,UAAUF,CAAK,CAAC,iBAAiBI,EAAQ,MAAM,uBAC9CC,CAAQ,2BAA2BF,CAAY,oCAEnE,EAEF,MAAMG,EAAyB,CAAC,EAChC,QAASC,EAAI,EAAGA,EAAIH,EAAQ,OAAQG,IAAK,CACvC,MAAMC,EAAOJ,EAAQG,CAAC,GAClBC,EAAOZ,GAAiBY,EAAOX,IACjCS,EAAa,KAAKC,CAAC,CAEvB,CACA,GAAID,EAAa,OAAS,EAAG,CAI3B,MAAMG,EAHiB,MAAM,KAC3B,IAAI,IAAIH,EAAa,IAAKC,GAAMH,EAAQG,CAAC,CAAE,CAAC,CAC9C,EAAE,KAAK,CAACG,EAAGC,IAAMD,EAAIC,CAAC,EAEnB,IAAKA,GAAM,KA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K,UAAUqB,CAAI,CAAC,YAAY,KAAK,UAAUG,CAAO,CAAC,mEAE3E,CAEJ,CACF,CAQO,SAASG,EAAgBrB,EAA8B,CAC5D,MAAMsB,EAAW,OAAOtB,GAAU,SAElC,GAAI,CAACsB,GAAY,EADA,OAAOtB,GAAU,UAEhC,MAAM,IAAIN,EACR,yCAAyC,OAAOM,CAAK,GACvD,EAEF,GAAIsB,GAAY,CAAC,OAAO,UAAUtB,CAAK,EACrC,MAAM,IAAIN,EACR,mCAAmCM,CAAK,GAC1C,EAEF,MAAMuB,EAAI,OAAOvB,GAAU,SAAWA,EAAQ,OAAOA,CAAK,EAC1D,GAAIuB,GAAK,GACP,MAAM,IAAI7B,EACR,iCAAiCM,CAAK,GACxC,EAEF,MAAMwB,GAAc,IAAM,KAAO,GACjC,GAAID,EAAIC,EACN,MAAM,IAAI9B,EACR,WAAWM,CAAK,8BAA8BwB,CAAU,IAC1D,CAEJ",
6
- "names": ["CONTACT_NAME_BUFFER_LENGTH", "SCOPE_BUFFER_LENGTH", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "MAX_BIP32_DEPTH", "ETH_ADDRESS_BYTES", "ContactsValidationError", "message", "PRINTABLE_MIN", "PRINTABLE_MAX", "utf8Encoder", "validatePrintableLabel", "value", "options", "field", "bufferLength", "encoded", "maxBytes", "badPositions", "i", "byte", "offendingHex", "a", "b", "validateByteLength", "expectedBytes", "validateDerivationPath", "path", "parts", "segments", "segment", "token", "n", "validateChainId", "isNumber", "v", "UINT64_MAX"]
4
+ "sourcesContent": ["/**\n * Pre-APDU input validators for the Contacts operations.\n *\n * Buffer-length constants mirror the Ledger secure SDK `#define` values\n * *including* the trailing NUL terminator (so a 32-printable-char name lives in\n * a 33-byte buffer). Validators subtract 1 internally so the constants remain\n * pure equality checks against the upstream `#define`s. The byte-level\n * `0x20..0x7E` printable check exactly matches firmware `is_printable_string`.\n */\nimport { type DmkError } from \"@ledgerhq/device-management-kit\";\n\nimport { BLOCKCHAIN_FAMILY_BY_NAME } from \"@internal/app-binder/model/contactsConstants\";\n\n// ---- SDK-mirrored constants -------------------------------------------------\n// Source of truth: ledger-secure-sdk/app_features/address_book/include/\n\nexport const CONTACT_NAME_BUFFER_LENGTH = 33; // identity.h:49 (incl. NUL)\nexport const SCOPE_BUFFER_LENGTH = 33; // identity.h:50 (incl. NUL)\nexport const GROUP_HANDLE_SIZE = 64; // identity.h:47\nexport const HMAC_PROOF_LENGTH = 32; // CX_SHA256_SIZE\nexport const MAX_BIP32_DEPTH = 10; // bip32.h:15 (MAX_BIP32_PATH)\nexport const ETH_ADDRESS_BYTES = 20; // protocol convention, no header\nexport const SOLANA_ADDRESS_BYTES = 32; // ed25519 public key, no header\n\n// ---- error type -------------------------------------------------------------\n\n/**\n * Raised when caller input fails a pre-APDU check. Implements `DmkError` (and\n * stays an `Error` subclass) so a Contacts device action can surface it as a\n * typed terminal error state on the observable rather than throwing out of the\n * public, device-action-returning API.\n */\nexport class ContactsValidationError extends Error implements DmkError {\n readonly _tag = \"ContactsValidationError\";\n readonly originalError?: unknown;\n constructor(message: string) {\n super(message);\n this.name = \"ContactsValidationError\";\n }\n}\n\n// ---- printable-string validation -------------------------------------------\n\nconst PRINTABLE_MIN = 0x20;\nconst PRINTABLE_MAX = 0x7e;\n\nconst utf8Encoder = new TextEncoder();\n\n/**\n * Mirror of firmware `is_printable_string` + length cap. `bufferLength` is the\n * firmware's fixed buffer size *including* the trailing NUL, so the maximum\n * payload byte length is `bufferLength - 1`.\n */\nexport function validatePrintableLabel(\n value: string,\n options: { field: string; bufferLength: number },\n): void {\n const { field, bufferLength } = options;\n if (!value) {\n throw new ContactsValidationError(\n `${field} must not be empty (firmware rejects empty strings).`,\n );\n }\n const encoded = utf8Encoder.encode(value);\n const maxBytes = bufferLength - 1;\n if (encoded.length > maxBytes) {\n throw new ContactsValidationError(\n `${field} ${JSON.stringify(value)} is too long: ${encoded.length} bytes ` +\n `encoded (max ${maxBytes}). The device buffer is ${bufferLength} bytes ` +\n `including the trailing NUL.`,\n );\n }\n const badPositions: number[] = [];\n for (let i = 0; i < encoded.length; i++) {\n const byte = encoded[i]!;\n if (byte < PRINTABLE_MIN || byte > PRINTABLE_MAX) {\n badPositions.push(i);\n }\n }\n if (badPositions.length > 0) {\n const offendingBytes = Array.from(\n new Set(badPositions.map((i) => encoded[i]!)),\n ).sort((a, b) => a - b);\n const offendingHex = offendingBytes\n .map((b) => `0x${b.toString(16).padStart(2, \"0\")}`)\n .join(\", \");\n throw new ContactsValidationError(\n `${field} ${JSON.stringify(value)} contains ${badPositions.length} ` +\n `non-ASCII byte(s) at position(s) [${badPositions.join(\", \")}]: ` +\n `${offendingHex}. The device buffer is byte-level isprint() \u2014 only ` +\n `0x20-0x7E are accepted, no UTF-8 / accents / emoji.`,\n );\n }\n}\n\n// ---- byte-buffer validation ------------------------------------------------\n\n/** Assert a byte buffer is exactly `expectedBytes` long and non-empty. */\nexport function validateByteLength(\n value: Uint8Array,\n options: { field: string; expectedBytes: number },\n): void {\n const { field, expectedBytes } = options;\n if (value.length !== expectedBytes) {\n throw new ContactsValidationError(\n `${field} is ${value.length} bytes, expected ${expectedBytes}.`,\n );\n }\n}\n\n// ---- BIP32 path validation -------------------------------------------------\n\n/**\n * Sanity-check a BIP32 path before serialization. Firmware enforces depth <=\n * MAX_BIP32_DEPTH and rejects malformed segments. Accepts `m/44'/60'/0'/0/0`\n * style; segments may end in `'` (hardened).\n */\nexport function validateDerivationPath(path: string): void {\n if (!path) {\n throw new ContactsValidationError(\n `derivationPath must not be empty (e.g. \"m/44'/60'/0'/0/0\").`,\n );\n }\n const parts = path.split(\"/\");\n const segments =\n parts[0] === \"m\" || parts[0] === \"M\" ? parts.slice(1) : parts;\n if (segments.length === 0) {\n throw new ContactsValidationError(\n `derivationPath ${JSON.stringify(path)} has no segments past 'm'.`,\n );\n }\n if (segments.length > MAX_BIP32_DEPTH) {\n throw new ContactsValidationError(\n `derivationPath ${JSON.stringify(path)} has ${segments.length} segments ` +\n `(max ${MAX_BIP32_DEPTH}). Firmware rejects deeper paths.`,\n );\n }\n for (const segment of segments) {\n const token = segment.endsWith(\"'\") ? segment.slice(0, -1) : segment;\n if (!token || !/^\\d+$/.test(token)) {\n throw new ContactsValidationError(\n `derivationPath ${JSON.stringify(path)} segment ${JSON.stringify(segment)} ` +\n `is not numeric. Use plain integers, optionally suffixed with ' for hardened.`,\n );\n }\n const n = Number(token);\n if (!Number.isSafeInteger(n) || n >= 0x80000000) {\n throw new ContactsValidationError(\n `derivationPath ${JSON.stringify(path)} segment ${JSON.stringify(segment)} ` +\n `>= 2^31. Use the ' suffix for hardening rather than overflowing.`,\n );\n }\n }\n}\n\n// ---- chain id validation ---------------------------------------------------\n\n/**\n * Firmware encodes chain_id as uint64. JS `number` is fine up to 2^53; accept\n * `bigint` for the high range so callers don't silently truncate.\n */\nexport function validateChainId(value: number | bigint): void {\n const isNumber = typeof value === \"number\";\n const isBigInt = typeof value === \"bigint\";\n if (!isNumber && !isBigInt) {\n throw new ContactsValidationError(\n `chainId must be number or bigint, got ${typeof value}.`,\n );\n }\n if (isNumber && !Number.isInteger(value)) {\n throw new ContactsValidationError(\n `chainId must be an integer, got ${value}.`,\n );\n }\n const v = typeof value === \"bigint\" ? value : BigInt(value);\n if (v <= 0n) {\n throw new ContactsValidationError(\n `chainId must be positive, got ${value}.`,\n );\n }\n const UINT64_MAX = (1n << 64n) - 1n;\n if (v > UINT64_MAX) {\n throw new ContactsValidationError(\n `chainId ${value} exceeds uint64 range (max ${UINT64_MAX}).`,\n );\n }\n}\n\n// ---- blockchain family validation ------------------------------------------\n\n/** An address identifier to check, named after its input field. */\ntype IdentifierField = {\n readonly field: string;\n readonly value: Uint8Array;\n};\n\n/**\n * Check a blockchain family, its address identifiers and its chain id:\n * - Ethereum: 20-byte addresses, and CHAIN_ID is mandatory (multiple networks\n * share the same address format).\n * - Solana: 32-byte public keys, and no CHAIN_ID (the firmware specification\n * only defines one for Ethereum).\n * - Any other known family: non-empty identifiers.\n *\n * A chain id, when present, is range-checked. Returns the family byte encoded\n * in the `BLOCKCHAIN_FAMILY` TLV.\n */\nexport function validateFamilyIdentifiers(options: {\n blockchainFamily: string;\n identifiers: readonly IdentifierField[];\n chainId?: bigint;\n}): number {\n const { blockchainFamily, identifiers, chainId } = options;\n const family = blockchainFamily.toLowerCase();\n const familyByte = BLOCKCHAIN_FAMILY_BY_NAME[family];\n if (familyByte === undefined) {\n throw new ContactsValidationError(\n `Unsupported blockchain family: ${blockchainFamily}`,\n );\n }\n\n if (family === \"ethereum\") {\n for (const { field, value } of identifiers) {\n validateByteLength(value, { field, expectedBytes: ETH_ADDRESS_BYTES });\n }\n if (chainId === undefined) {\n throw new ContactsValidationError(\n \"chainId is required for the Ethereum blockchain family.\",\n );\n }\n } else if (family === \"solana\") {\n for (const { field, value } of identifiers) {\n validateByteLength(value, { field, expectedBytes: SOLANA_ADDRESS_BYTES });\n }\n if (chainId !== undefined) {\n throw new ContactsValidationError(\n \"chainId is not allowed for the Solana blockchain family.\",\n );\n }\n } else {\n for (const { field, value } of identifiers) {\n if (value.length === 0) {\n throw new ContactsValidationError(`${field} must not be empty.`);\n }\n }\n }\n\n if (chainId !== undefined) {\n validateChainId(chainId);\n }\n\n return familyByte;\n}\n"],
5
+ "mappings": "AAWA,OAAS,6BAAAA,MAAiC,+CAKnC,MAAMC,EAA6B,GAC7BC,EAAsB,GACtBC,EAAoB,GACpBC,EAAoB,GACpBC,EAAkB,GAClBC,EAAoB,GACpBC,EAAuB,GAU7B,MAAMC,UAAgC,KAA0B,CAC5D,KAAO,0BACP,cACT,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,KAAO,yBACd,CACF,CAIA,MAAMC,EAAgB,GAChBC,EAAgB,IAEhBC,EAAc,IAAI,YAOjB,SAASC,EACdC,EACAC,EACM,CACN,KAAM,CAAE,MAAAC,EAAO,aAAAC,CAAa,EAAIF,EAChC,GAAI,CAACD,EACH,MAAM,IAAIN,EACR,GAAG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AM,CAAE,iBAAAyB,EAAkB,YAAAC,EAAa,QAAAC,CAAQ,EAAI3B,EAC7C4B,EAASH,EAAiB,YAAY,EACtCI,EAAa5C,EAA0B2C,CAAM,EACnD,GAAIC,IAAe,OACjB,MAAM,IAAIpC,EACR,kCAAkCgC,CAAgB,EACpD,EAGF,GAAIG,IAAW,WAAY,CACzB,SAAW,CAAE,MAAA3B,EAAO,MAAAF,CAAM,IAAK2B,EAC7Bf,EAAmBZ,EAAO,CAAE,MAAAE,EAAO,cAAeV,CAAkB,CAAC,EAEvE,GAAIoC,IAAY,OACd,MAAM,IAAIlC,EACR,yDACF,CAEJ,SAAWmC,IAAW,SAAU,CAC9B,SAAW,CAAE,MAAA3B,EAAO,MAAAF,CAAM,IAAK2B,EAC7Bf,EAAmBZ,EAAO,CAAE,MAAAE,EAAO,cAAeT,CAAqB,CAAC,EAE1E,GAAImC,IAAY,OACd,MAAM,IAAIlC,EACR,0DACF,CAEJ,KACE,UAAW,CAAE,MAAAQ,EAAO,MAAAF,CAAM,IAAK2B,EAC7B,GAAI3B,EAAM,SAAW,EACnB,MAAM,IAAIN,EAAwB,GAAGQ,CAAK,qBAAqB,EAKrE,OAAI0B,IAAY,QACdP,EAAgBO,CAAO,EAGlBE,CACT",
6
+ "names": ["BLOCKCHAIN_FAMILY_BY_NAME", "CONTACT_NAME_BUFFER_LENGTH", "SCOPE_BUFFER_LENGTH", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "MAX_BIP32_DEPTH", "ETH_ADDRESS_BYTES", "SOLANA_ADDRESS_BYTES", "ContactsValidationError", "message", "PRINTABLE_MIN", "PRINTABLE_MAX", "utf8Encoder", "validatePrintableLabel", "value", "options", "field", "bufferLength", "encoded", "maxBytes", "badPositions", "i", "byte", "offendingHex", "a", "b", "validateByteLength", "expectedBytes", "validateDerivationPath", "path", "parts", "segments", "segment", "token", "n", "validateChainId", "isNumber", "v", "UINT64_MAX", "validateFamilyIdentifiers", "blockchainFamily", "identifiers", "chainId", "family", "familyByte"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{ByteArrayBuilder as c}from"@ledgerhq/device-management-kit";import{ProvideContactCommand as m}from"../../app-binder/command/ProvideContactCommand";import{BLOCKCHAIN_FAMILY_BY_NAME as l,SUB_CMD_PROVIDE_CONTACT as T}from"../../app-binder/model/contactsConstants";import{CONTACTS_TLV_TAG as r,encodeTlvAscii as d,encodeTlvBuffer as t,encodeTlvChainId as s,encodeTlvUInt8 as n,STRUCT_TYPE_PROVIDE_CONTACT as A,STRUCT_VERSION_VALUE as P}from"../../app-binder/services/contactsTlvSerializer";import{sendFramedContactsPayload as y}from"../../app-binder/services/sendFramedContactsPayload";function v(e){const a=l[e.blockchainFamily.toLowerCase()];if(a===void 0)throw new Error(`Unsupported blockchain family: ${e.blockchainFamily}`);const o=new c;return n(o,r.STRUCT_TYPE,A),n(o,r.STRUCT_VERSION,P),d(o,r.CONTACT_NAME,e.contactName),d(o,r.SCOPE,e.scope),t(o,r.ACCOUNT_IDENTIFIER,e.identifier),t(o,r.GROUP_HANDLE,e.groupHandle),e.chainId!==void 0&&s(o,r.CHAIN_ID,e.chainId),n(o,r.BLOCKCHAIN_FAMILY,a),t(o,r.HMAC_PROOF,e.hmacProof),t(o,r.HMAC_REST,e.hmacRest),o.build()}function R(e,{payload:a,logger:o}){return y(e,{payload:a,p1:T,makeCommand:(C,i)=>new m({data:C,p2:i}),logger:o,commandTag:"provideContact"})}export{v as buildProvideContactPayload,R as sendProvideContactPayload};
1
+ import{ByteArrayBuilder as m}from"@ledgerhq/device-management-kit";import{ProvideContactCommand as c}from"../../app-binder/command/ProvideContactCommand";import{SUB_CMD_PROVIDE_CONTACT as l}from"../../app-binder/model/contactsConstants";import{validateFamilyIdentifiers as T}from"../../app-binder/model/contactsValidation";import{CONTACTS_TLV_TAG as r,encodeTlvAscii as i,encodeTlvBuffer as a,encodeTlvChainId as s,encodeTlvUInt8 as d,STRUCT_TYPE_PROVIDE_CONTACT as P,STRUCT_VERSION_VALUE as f}from"../../app-binder/services/contactsTlvSerializer";import{sendFramedContactsPayload as y}from"../../app-binder/services/sendFramedContactsPayload";function R(o){const t=T({blockchainFamily:o.blockchainFamily,identifiers:[{field:"identifier",value:o.identifier}],chainId:o.chainId}),e=new m;return d(e,r.STRUCT_TYPE,P),d(e,r.STRUCT_VERSION,f),i(e,r.CONTACT_NAME,o.contactName),i(e,r.SCOPE,o.scope),a(e,r.ACCOUNT_IDENTIFIER,o.identifier),a(e,r.GROUP_HANDLE,o.groupHandle),o.chainId!==void 0&&s(e,r.CHAIN_ID,o.chainId),d(e,r.BLOCKCHAIN_FAMILY,t),a(e,r.HMAC_PROOF,o.hmacProof),a(e,r.HMAC_REST,o.hmacRest),e.build()}function O(o,{payload:t,logger:e}){return y(o,{payload:t,p1:l,makeCommand:(n,C)=>new c({data:n,p2:C}),logger:e,commandTag:"provideContact"})}export{R as buildProvideContactPayload,O as sendProvideContactPayload};
2
2
  //# sourceMappingURL=provideContact.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/internal/app-binder/services/provideContact.ts"],
4
- "sourcesContent": ["// TLV assembly and transport for op 0x20 (Provide Contact), dispatched via the\n// chunked-framing scheme shared with the other address-book ops.\n//\n// Reference: Address Book Final Specifications \u2014 Provide Contact. Tag order:\n// STRUCT_TYPE, STRUCT_VERSION, CONTACT_NAME, SCOPE, ACCOUNT_IDENTIFIER,\n// GROUP_HANDLE, CHAIN_ID (Ethereum only), BLOCKCHAIN_FAMILY, HMAC_PROOF,\n// HMAC_REST. No DERIVATION_PATH \u2014 that tag is Ledger-Account only.\n//\n// Device replies SW=0x9000 with empty data on success \u2014 no fields to extract.\nimport {\n ByteArrayBuilder,\n type CommandResult,\n type InternalApi,\n type LoggerPublisherService,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type ProvideContactInput } from \"@api/model/ProvideContact\";\nimport { ProvideContactCommand } from \"@internal/app-binder/command/ProvideContactCommand\";\nimport {\n BLOCKCHAIN_FAMILY_BY_NAME,\n SUB_CMD_PROVIDE_CONTACT,\n} from \"@internal/app-binder/model/contactsConstants\";\nimport { type ContactsErrorCodes } from \"@internal/app-binder/model/contactsErrors\";\nimport {\n CONTACTS_TLV_TAG,\n encodeTlvAscii,\n encodeTlvBuffer,\n encodeTlvChainId,\n encodeTlvUInt8,\n STRUCT_TYPE_PROVIDE_CONTACT,\n STRUCT_VERSION_VALUE,\n} from \"@internal/app-binder/services/contactsTlvSerializer\";\nimport { sendFramedContactsPayload } from \"@internal/app-binder/services/sendFramedContactsPayload\";\n\n/**\n * Encode a matched contact as the PROVIDE CONTACT TLV payload, without the\n * chunk framing. Pure, so callers can build it while matching a recipient\n * against the address book, with no device involved.\n */\nexport function buildProvideContactPayload(\n input: ProvideContactInput,\n): Uint8Array {\n const family =\n BLOCKCHAIN_FAMILY_BY_NAME[input.blockchainFamily.toLowerCase()];\n if (family === undefined) {\n throw new Error(`Unsupported blockchain family: ${input.blockchainFamily}`);\n }\n\n const builder = new ByteArrayBuilder();\n encodeTlvUInt8(\n builder,\n CONTACTS_TLV_TAG.STRUCT_TYPE,\n STRUCT_TYPE_PROVIDE_CONTACT,\n );\n encodeTlvUInt8(\n builder,\n CONTACTS_TLV_TAG.STRUCT_VERSION,\n STRUCT_VERSION_VALUE,\n );\n encodeTlvAscii(builder, CONTACTS_TLV_TAG.CONTACT_NAME, input.contactName);\n encodeTlvAscii(builder, CONTACTS_TLV_TAG.SCOPE, input.scope);\n encodeTlvBuffer(\n builder,\n CONTACTS_TLV_TAG.ACCOUNT_IDENTIFIER,\n input.identifier,\n );\n encodeTlvBuffer(builder, CONTACTS_TLV_TAG.GROUP_HANDLE, input.groupHandle);\n if (input.chainId !== undefined) {\n encodeTlvChainId(builder, CONTACTS_TLV_TAG.CHAIN_ID, input.chainId);\n }\n encodeTlvUInt8(builder, CONTACTS_TLV_TAG.BLOCKCHAIN_FAMILY, family);\n encodeTlvBuffer(builder, CONTACTS_TLV_TAG.HMAC_PROOF, input.hmacProof);\n encodeTlvBuffer(builder, CONTACTS_TLV_TAG.HMAC_REST, input.hmacRest);\n\n return builder.build();\n}\n\nexport type SendProvideContactPayloadArgs = {\n readonly payload: Uint8Array;\n readonly logger?: LoggerPublisherService;\n};\n\nexport function sendProvideContactPayload(\n api: InternalApi,\n { payload, logger }: SendProvideContactPayloadArgs,\n): Promise<CommandResult<void, ContactsErrorCodes>> {\n return sendFramedContactsPayload(api, {\n payload,\n p1: SUB_CMD_PROVIDE_CONTACT,\n makeCommand: (chunk, p2) => new ProvideContactCommand({ data: chunk, p2 }),\n logger,\n commandTag: \"provideContact\",\n }) as Promise<CommandResult<void, ContactsErrorCodes>>;\n}\n"],
5
- "mappings": "AASA,OACE,oBAAAA,MAIK,kCAGP,OAAS,yBAAAC,MAA6B,qDACtC,OACE,6BAAAC,EACA,2BAAAC,MACK,+CAEP,OACE,oBAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,kBAAAC,EACA,+BAAAC,EACA,wBAAAC,MACK,sDACP,OAAS,6BAAAC,MAAiC,0DAOnC,SAASC,EACdC,EACY,CACZ,MAAMC,EACJZ,EAA0BW,EAAM,iBAAiB,YAAY,CAAC,EAChE,GAAIC,IAAW,OACb,MAAM,IAAI,MAAM,kCAAkCD,EAAM,gBAAgB,EAAE,EAG5E,MAAME,EAAU,IAAIf,EACpB,OAAAQ,EACEO,EACAX,EAAiB,YACjBK,CACF,EACAD,EACEO,EACAX,EAAiB,eACjBM,CACF,EACAL,EAAeU,EAASX,EAAiB,aAAcS,EAAM,WAAW,EACxER,EAAeU,EAASX,EAAiB,MAAOS,EAAM,KAAK,EAC3DP,EACES,EACAX,EAAiB,mBACjBS,EAAM,UACR,EACAP,EAAgBS,EAASX,EAAiB,aAAcS,EAAM,WAAW,EACrEA,EAAM,UAAY,QACpBN,EAAiBQ,EAASX,EAAiB,SAAUS,EAAM,OAAO,EAEpEL,EAAeO,EAASX,EAAiB,kBAAmBU,CAAM,EAClER,EAAgBS,EAASX,EAAiB,WAAYS,EAAM,SAAS,EACrEP,EAAgBS,EAASX,EAAiB,UAAWS,EAAM,QAAQ,EAE5DE,EAAQ,MAAM,CACvB,CAOO,SAASC,EACdC,EACA,CAAE,QAAAC,EAAS,OAAAC,CAAO,EACgC,CAClD,OAAOR,EAA0BM,EAAK,CACpC,QAAAC,EACA,GAAIf,EACJ,YAAa,CAACiB,EAAOC,IAAO,IAAIpB,EAAsB,CAAE,KAAMmB,EAAO,GAAAC,CAAG,CAAC,EACzE,OAAAF,EACA,WAAY,gBACd,CAAC,CACH",
6
- "names": ["ByteArrayBuilder", "ProvideContactCommand", "BLOCKCHAIN_FAMILY_BY_NAME", "SUB_CMD_PROVIDE_CONTACT", "CONTACTS_TLV_TAG", "encodeTlvAscii", "encodeTlvBuffer", "encodeTlvChainId", "encodeTlvUInt8", "STRUCT_TYPE_PROVIDE_CONTACT", "STRUCT_VERSION_VALUE", "sendFramedContactsPayload", "buildProvideContactPayload", "input", "family", "builder", "sendProvideContactPayload", "api", "payload", "logger", "chunk", "p2"]
4
+ "sourcesContent": ["// TLV assembly and transport for op 0x20 (Provide Contact), dispatched via the\n// chunked-framing scheme shared with the other address-book ops.\n//\n// Reference: Address Book Final Specifications \u2014 Provide Contact. Tag order:\n// STRUCT_TYPE, STRUCT_VERSION, CONTACT_NAME, SCOPE, ACCOUNT_IDENTIFIER,\n// GROUP_HANDLE, CHAIN_ID (Ethereum only), BLOCKCHAIN_FAMILY, HMAC_PROOF,\n// HMAC_REST. No DERIVATION_PATH \u2014 that tag is Ledger-Account only.\n//\n// Device replies SW=0x9000 with empty data on success \u2014 no fields to extract.\nimport {\n ByteArrayBuilder,\n type CommandResult,\n type InternalApi,\n type LoggerPublisherService,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type ProvideContactInput } from \"@api/model/ProvideContact\";\nimport { ProvideContactCommand } from \"@internal/app-binder/command/ProvideContactCommand\";\nimport { SUB_CMD_PROVIDE_CONTACT } from \"@internal/app-binder/model/contactsConstants\";\nimport { type ContactsErrorCodes } from \"@internal/app-binder/model/contactsErrors\";\nimport { validateFamilyIdentifiers } from \"@internal/app-binder/model/contactsValidation\";\nimport {\n CONTACTS_TLV_TAG,\n encodeTlvAscii,\n encodeTlvBuffer,\n encodeTlvChainId,\n encodeTlvUInt8,\n STRUCT_TYPE_PROVIDE_CONTACT,\n STRUCT_VERSION_VALUE,\n} from \"@internal/app-binder/services/contactsTlvSerializer\";\nimport { sendFramedContactsPayload } from \"@internal/app-binder/services/sendFramedContactsPayload\";\n\n/**\n * Encode a matched contact as the PROVIDE CONTACT TLV payload, without the\n * chunk framing. Pure, so callers can build it while matching a recipient\n * against the address book, with no device involved.\n */\nexport function buildProvideContactPayload(\n input: ProvideContactInput,\n): Uint8Array {\n const family = validateFamilyIdentifiers({\n blockchainFamily: input.blockchainFamily,\n identifiers: [{ field: \"identifier\", value: input.identifier }],\n chainId: input.chainId,\n });\n\n const builder = new ByteArrayBuilder();\n encodeTlvUInt8(\n builder,\n CONTACTS_TLV_TAG.STRUCT_TYPE,\n STRUCT_TYPE_PROVIDE_CONTACT,\n );\n encodeTlvUInt8(\n builder,\n CONTACTS_TLV_TAG.STRUCT_VERSION,\n STRUCT_VERSION_VALUE,\n );\n encodeTlvAscii(builder, CONTACTS_TLV_TAG.CONTACT_NAME, input.contactName);\n encodeTlvAscii(builder, CONTACTS_TLV_TAG.SCOPE, input.scope);\n encodeTlvBuffer(\n builder,\n CONTACTS_TLV_TAG.ACCOUNT_IDENTIFIER,\n input.identifier,\n );\n encodeTlvBuffer(builder, CONTACTS_TLV_TAG.GROUP_HANDLE, input.groupHandle);\n if (input.chainId !== undefined) {\n encodeTlvChainId(builder, CONTACTS_TLV_TAG.CHAIN_ID, input.chainId);\n }\n encodeTlvUInt8(builder, CONTACTS_TLV_TAG.BLOCKCHAIN_FAMILY, family);\n encodeTlvBuffer(builder, CONTACTS_TLV_TAG.HMAC_PROOF, input.hmacProof);\n encodeTlvBuffer(builder, CONTACTS_TLV_TAG.HMAC_REST, input.hmacRest);\n\n return builder.build();\n}\n\nexport type SendProvideContactPayloadArgs = {\n readonly payload: Uint8Array;\n readonly logger?: LoggerPublisherService;\n};\n\nexport function sendProvideContactPayload(\n api: InternalApi,\n { payload, logger }: SendProvideContactPayloadArgs,\n): Promise<CommandResult<void, ContactsErrorCodes>> {\n return sendFramedContactsPayload(api, {\n payload,\n p1: SUB_CMD_PROVIDE_CONTACT,\n makeCommand: (chunk, p2) => new ProvideContactCommand({ data: chunk, p2 }),\n logger,\n commandTag: \"provideContact\",\n }) as Promise<CommandResult<void, ContactsErrorCodes>>;\n}\n"],
5
+ "mappings": "AASA,OACE,oBAAAA,MAIK,kCAGP,OAAS,yBAAAC,MAA6B,qDACtC,OAAS,2BAAAC,MAA+B,+CAExC,OAAS,6BAAAC,MAAiC,gDAC1C,OACE,oBAAAC,EACA,kBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,kBAAAC,EACA,+BAAAC,EACA,wBAAAC,MACK,sDACP,OAAS,6BAAAC,MAAiC,0DAOnC,SAASC,EACdC,EACY,CACZ,MAAMC,EAASX,EAA0B,CACvC,iBAAkBU,EAAM,iBACxB,YAAa,CAAC,CAAE,MAAO,aAAc,MAAOA,EAAM,UAAW,CAAC,EAC9D,QAASA,EAAM,OACjB,CAAC,EAEKE,EAAU,IAAIf,EACpB,OAAAQ,EACEO,EACAX,EAAiB,YACjBK,CACF,EACAD,EACEO,EACAX,EAAiB,eACjBM,CACF,EACAL,EAAeU,EAASX,EAAiB,aAAcS,EAAM,WAAW,EACxER,EAAeU,EAASX,EAAiB,MAAOS,EAAM,KAAK,EAC3DP,EACES,EACAX,EAAiB,mBACjBS,EAAM,UACR,EACAP,EAAgBS,EAASX,EAAiB,aAAcS,EAAM,WAAW,EACrEA,EAAM,UAAY,QACpBN,EAAiBQ,EAASX,EAAiB,SAAUS,EAAM,OAAO,EAEpEL,EAAeO,EAASX,EAAiB,kBAAmBU,CAAM,EAClER,EAAgBS,EAASX,EAAiB,WAAYS,EAAM,SAAS,EACrEP,EAAgBS,EAASX,EAAiB,UAAWS,EAAM,QAAQ,EAE5DE,EAAQ,MAAM,CACvB,CAOO,SAASC,EACdC,EACA,CAAE,QAAAC,EAAS,OAAAC,CAAO,EACgC,CAClD,OAAOR,EAA0BM,EAAK,CACpC,QAAAC,EACA,GAAIhB,EACJ,YAAa,CAACkB,EAAOC,IAAO,IAAIpB,EAAsB,CAAE,KAAMmB,EAAO,GAAAC,CAAG,CAAC,EACzE,OAAAF,EACA,WAAY,gBACd,CAAC,CACH",
6
+ "names": ["ByteArrayBuilder", "ProvideContactCommand", "SUB_CMD_PROVIDE_CONTACT", "validateFamilyIdentifiers", "CONTACTS_TLV_TAG", "encodeTlvAscii", "encodeTlvBuffer", "encodeTlvChainId", "encodeTlvUInt8", "STRUCT_TYPE_PROVIDE_CONTACT", "STRUCT_VERSION_VALUE", "sendFramedContactsPayload", "buildProvideContactPayload", "input", "family", "builder", "sendProvideContactPayload", "api", "payload", "logger", "chunk", "p2"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@ledgerhq/signer-utils": "^1.3.0",
3
+ "@ledgerhq/signer-utils": "workspace:^",
4
4
  "inversify": "catalog:",
5
5
  "purify-ts": "catalog:",
6
6
  "reflect-metadata": "catalog:",
@@ -36,7 +36,7 @@
36
36
  "license": "Apache-2.0",
37
37
  "name": "@ledgerhq/device-contacts-kit",
38
38
  "peerDependencies": {
39
- "@ledgerhq/device-management-kit": "^1.9.0"
39
+ "@ledgerhq/device-management-kit": "workspace:^"
40
40
  },
41
41
  "private": false,
42
42
  "repository": {
@@ -58,5 +58,5 @@
58
58
  "watch:builds": "pnpm ldmk-tool watch --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
59
59
  "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
60
60
  },
61
- "version": "0.4.1"
61
+ "version": "0.6.0"
62
62
  }
@@ -4,7 +4,7 @@ export { type RegisterExternalAddressDAError, type RegisterExternalAddressDAInpu
4
4
  export { type RenameContactDAError, type RenameContactDAInput, type RenameContactDAIntermediateValue, type RenameContactDAOutput, type RenameContactDARequiredInteraction, type RenameContactDAReturnType, type RenameContactDAState, } from "./app-binder/RenameContactDeviceActionTypes";
5
5
  export { type ContactsManager } from "./ContactsManager";
6
6
  export { ContactsManagerBuilder } from "./ContactsManagerBuilder";
7
- export { CONTACTS_VERSION_REQUIREMENTS, type ContactsModelRequirement, type ContactsModelSupport, type ContactsModelUnsupported, type ContactsVersionRequirements, ETHEREUM_APP_NAME, isVersionAtLeast, resolveContactsVersionRequirements, } from "./model/ContactsVersionRequirements";
7
+ export { CONTACTS_VERSION_REQUIREMENTS, type ContactsModelRequirement, type ContactsModelSupport, type ContactsModelUnsupported, type ContactsVersionRequirements, ETHEREUM_APP_NAME, isVersionAtLeast, resolveContactsVersionRequirements, SOLANA_APP_NAME, TRON_APP_NAME, } from "./model/ContactsVersionRequirements";
8
8
  export { type EditExternalAddressIdentifierInput, type EditExternalAddressIdentifierOutput, } from "./model/EditExternalAddressIdentifier";
9
9
  export { type EditExternalAddressScopeInput, type EditExternalAddressScopeOutput, } from "./model/EditExternalAddressScope";
10
10
  export { type ProvideContactInput } from "./model/ProvideContact";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oCAAoC,EACzC,KAAK,oCAAoC,EACzC,KAAK,gDAAgD,EACrD,KAAK,qCAAqC,EAC1C,KAAK,kDAAkD,EACvD,KAAK,yCAAyC,EAC9C,KAAK,oCAAoC,GAC1C,MAAM,gEAAgE,CAAC;AACxE,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,2CAA2C,EAChD,KAAK,gCAAgC,EACrC,KAAK,6CAA6C,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,0CAA0C,CAAC;AAClD,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,GACpC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,GACnC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,KAAK,6BAA6B,GACnC,MAAM,8CAA8C,CAAC"}
@@ -8,8 +8,7 @@ import { DeviceModelId } from "@ledgerhq/device-management-kit";
8
8
  * device dashboard), which are served by the device OS.
9
9
  * - `minAppVersion` gates app-owned operations (registering / editing external
10
10
  * addresses and Ledger accounts), which are served by the embedded app. It is
11
- * keyed by app name because the required version differs per app; v1 ships
12
- * Ethereum only.
11
+ * keyed by app name because the required version differs per app.
13
12
  */
14
13
  export type ContactsModelSupport = {
15
14
  readonly supported: true;
@@ -40,8 +39,10 @@ export type ContactsModelRequirement = ContactsModelSupport | ContactsModelUnsup
40
39
  * app-readiness checks, without duplicating the values.
41
40
  */
42
41
  export type ContactsVersionRequirements = Readonly<Record<DeviceModelId, ContactsModelRequirement>>;
43
- /** The name of the Ethereum embedded app (the only app supported in v1). */
42
+ /** Names of embedded apps supporting Contacts. */
44
43
  export declare const ETHEREUM_APP_NAME = "Ethereum";
44
+ export declare const TRON_APP_NAME = "Tron";
45
+ export declare const SOLANA_APP_NAME = "Solana";
45
46
  /**
46
47
  * Contacts APDUs are supported on the touchscreen device models (Stax, Flex,
47
48
  * Apex) and on Nano X / Nano SP. Nano S does not support Contacts at all.
@@ -1 +1 @@
1
- {"version":3,"file":"ContactsVersion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AChB,OAAO,CAMT"}
1
+ {"version":3,"file":"ContactsVersionRequirements.d.ts","sourceRoot":"","sources":["../../../../src/api/model/ContactsVersionRequirements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,0CAA0C,CAAC,EAAE,MAAM,CAAC;CAC9D,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC,oBAAoB,GACpB,wBAAwB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAChD,MAAM,CAAC,aAAa,EAAE,wBAAwB,CAAC,CAChD,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAC5C,eAAO,MAAM,aAAa,SAAS,CAAC;AACpC,eAAO,MAAM,eAAe,WAAW,CAAC;AAoCxC;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,2BAgC3C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,aAAa,EAAE,aAAa,GAC3B,wBAAwB,CAE1B;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAKzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,GAChB,OAAO,CAMT"}
@@ -13,9 +13,9 @@ export type EditExternalAddressIdentifierInput = {
13
13
  readonly scope: string;
14
14
  /** The current (pre-edit) address bytes, proven via `hmacRest`. */
15
15
  readonly previousIdentifier: Uint8Array;
16
- /** The replacement address bytes (20 bytes for Ethereum). */
16
+ /** The replacement address bytes (20 bytes for Ethereum, 32 for Solana). */
17
17
  readonly newIdentifier: Uint8Array;
18
- /** Blockchain family name, e.g. "ethereum" (v1 supports Ethereum only). */
18
+ /** Blockchain family name, e.g. "ethereum", "tron" or "solana". */
19
19
  readonly blockchainFamily: string;
20
20
  readonly chainId?: bigint;
21
21
  /** 64-byte group handle returned by the group's Register Identity. */
@@ -1 +1 @@
1
- {"version":3,"file":"EditExternalAddressIdentifier.d.ts","sourceRoot":"","sources":["../../../../src/api/model/EditExternalAddressIdentifier.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,gEAAgE;IAChE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACxC,6DAA6D;IAC7D,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC;IACnC,2EAA2E;IAC3E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC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IAC/B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,QAAQ,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACxC,oDAAoD;IACpD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;CAC/B,CAAC"}
@@ -14,9 +14,9 @@ export type EditExternalAddressScopeInput = {
14
14
  readonly previousScope: string;
15
15
  /** The replacement scope (max 32 printable ASCII chars). */
16
16
  readonly newScope: string;
17
- /** The entry's identifier bytes (20 bytes for Ethereum). Unchanged by the edit. */
17
+ /** The entry's identifier bytes (20 bytes for Ethereum, 32 for Solana). Unchanged by the edit. */
18
18
  readonly identifier: Uint8Array;
19
- /** Blockchain family name, e.g. "ethereum" (v1 supports Ethereum only). */
19
+ /** Blockchain family name, e.g. "ethereum", "tron" or "solana". */
20
20
  readonly blockchainFamily: string;
21
21
  readonly chainId?: bigint;
22
22
  /** 64-byte group handle returned by the group's Register Identity. */
@@ -1 +1 @@
1
- {"version":3,"file":"EditExternalAddressScope.d.ts","sourceRoot":"","sources":["../../../../src/api/model/EditExternalAddressScope.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,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AU,CAAC;CAC/B,CAAC"}
@@ -7,7 +7,7 @@
7
7
  export type ProvideContactInput = {
8
8
  readonly contactName: string;
9
9
  readonly scope: string;
10
- /** Raw bytes, chain-dependent: a 20-byte address for Ethereum. */
10
+ /** Raw bytes, chain-dependent: a 20-byte address for Ethereum, a 32-byte public key for Solana. */
11
11
  readonly identifier: Uint8Array;
12
12
  readonly groupHandle: Uint8Array;
13
13
  readonly hmacProof: Uint8Array;
@@ -1 +1 @@
1
- {"version":3,"file":"ProvideContact.d.ts","sourceRoot":"","sources":["../../../../src/api/model/ProvideContact.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,gDAAgD;IAChD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC"}
1
+ {"version":3,"file":"ProvideContact.d.ts","sourceRoot":"","sources":["../../../../src/api/model/ProvideContact.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,mGAAmG;IACnG,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,gDAAgD;IAChD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC"}
@@ -16,9 +16,9 @@ export type ExistingContactGroup = {
16
16
  export type RegisterExternalAddressInput = {
17
17
  readonly contactName: string;
18
18
  readonly scope: string;
19
- /** Chain address bytes (20 bytes for Ethereum). */
19
+ /** Chain address bytes (20 bytes for Ethereum, 32 for Solana). */
20
20
  readonly identifier: Uint8Array;
21
- /** Blockchain family name, e.g. "ethereum" (v1 supports Ethereum only). */
21
+ /** Blockchain family name, e.g. "ethereum", "tron" or "solana". */
22
22
  readonly blockchainFamily: string;
23
23
  readonly chainId?: bigint;
24
24
  /**