@ledgerhq/device-contacts-kit 0.0.0-mockserver-react-20260929124741 → 0.0.0-same-usb-id-20261126151637

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 (265) 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/contactsValidation.js +1 -1
  17. package/lib/cjs/internal/app-binder/model/contactsValidation.js.map +3 -3
  18. package/lib/cjs/internal/app-binder/services/provideContact.js +1 -1
  19. package/lib/cjs/internal/app-binder/services/provideContact.js.map +3 -3
  20. package/lib/cjs/package.json +1 -1
  21. package/lib/esm/api/index.js +1 -1
  22. package/lib/esm/api/index.js.map +3 -3
  23. package/lib/esm/api/model/ContactsVersionRequirements.js +1 -1
  24. package/lib/esm/api/model/ContactsVersionRequirements.js.map +3 -3
  25. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.js +1 -1
  26. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.js.map +3 -3
  27. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.js +1 -1
  28. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.js.map +3 -3
  29. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.js +1 -1
  30. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.js.map +3 -3
  31. package/lib/esm/internal/app-binder/model/contactsValidation.js +1 -1
  32. package/lib/esm/internal/app-binder/model/contactsValidation.js.map +3 -3
  33. package/lib/esm/internal/app-binder/services/provideContact.js +1 -1
  34. package/lib/esm/internal/app-binder/services/provideContact.js.map +3 -3
  35. package/lib/esm/package.json +1 -1
  36. package/lib/types/api/index.d.ts +1 -1
  37. package/lib/types/api/index.d.ts.map +1 -1
  38. package/lib/types/api/model/ContactsVersionRequirements.d.ts +1 -0
  39. package/lib/types/api/model/ContactsVersionRequirements.d.ts.map +1 -1
  40. package/lib/types/api/model/EditExternalAddressIdentifier.d.ts +2 -2
  41. package/lib/types/api/model/EditExternalAddressIdentifier.d.ts.map +1 -1
  42. package/lib/types/api/model/EditExternalAddressScope.d.ts +2 -2
  43. package/lib/types/api/model/EditExternalAddressScope.d.ts.map +1 -1
  44. package/lib/types/api/model/ProvideContact.d.ts +1 -1
  45. package/lib/types/api/model/ProvideContact.d.ts.map +1 -1
  46. package/lib/types/api/model/RegisterExternalAddress.d.ts +2 -2
  47. package/lib/types/api/model/RegisterExternalAddress.d.ts.map +1 -1
  48. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.d.ts.map +1 -1
  49. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.d.ts.map +1 -1
  50. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.d.ts.map +1 -1
  51. package/lib/types/internal/app-binder/model/contactsValidation.d.ts +23 -0
  52. package/lib/types/internal/app-binder/model/contactsValidation.d.ts.map +1 -1
  53. package/lib/types/internal/app-binder/services/provideContact.d.ts.map +1 -1
  54. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  55. package/package.json +7 -7
  56. package/lib/cjs/api/ContactsManagerBuilder.test.js +0 -2
  57. package/lib/cjs/api/ContactsManagerBuilder.test.js.map +0 -7
  58. package/lib/cjs/api/model/ContactsVersionRequirements.test.js +0 -2
  59. package/lib/cjs/api/model/ContactsVersionRequirements.test.js.map +0 -7
  60. package/lib/cjs/internal/DefaultContactsManager.test.js +0 -2
  61. package/lib/cjs/internal/DefaultContactsManager.test.js.map +0 -7
  62. package/lib/cjs/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.js +0 -2
  63. package/lib/cjs/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.js.map +0 -7
  64. package/lib/cjs/internal/app-binder/command/EditExternalAddressScopeCommand.test.js +0 -2
  65. package/lib/cjs/internal/app-binder/command/EditExternalAddressScopeCommand.test.js.map +0 -7
  66. package/lib/cjs/internal/app-binder/command/ProvideContactCommand.test.js +0 -2
  67. package/lib/cjs/internal/app-binder/command/ProvideContactCommand.test.js.map +0 -7
  68. package/lib/cjs/internal/app-binder/command/RegisterIdentityCommand.test.js +0 -2
  69. package/lib/cjs/internal/app-binder/command/RegisterIdentityCommand.test.js.map +0 -7
  70. package/lib/cjs/internal/app-binder/command/RenameContactCommand.test.js +0 -2
  71. package/lib/cjs/internal/app-binder/command/RenameContactCommand.test.js.map +0 -7
  72. package/lib/cjs/internal/app-binder/contactsVersionGuards.test.js +0 -2
  73. package/lib/cjs/internal/app-binder/contactsVersionGuards.test.js.map +0 -7
  74. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.js +0 -2
  75. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.js.map +0 -7
  76. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.js +0 -2
  77. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.js.map +0 -7
  78. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.js +0 -2
  79. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.js.map +0 -7
  80. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.js +0 -2
  81. package/lib/cjs/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.js.map +0 -7
  82. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.js +0 -2
  83. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.js.map +0 -7
  84. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.js +0 -2
  85. package/lib/cjs/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.js.map +0 -7
  86. package/lib/cjs/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js +0 -2
  87. package/lib/cjs/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js.map +0 -7
  88. package/lib/cjs/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.js +0 -2
  89. package/lib/cjs/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.js.map +0 -7
  90. package/lib/cjs/internal/app-binder/device-action/__test-utils__/makeInternalApi.js +0 -2
  91. package/lib/cjs/internal/app-binder/device-action/__test-utils__/makeInternalApi.js.map +0 -7
  92. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.js +0 -2
  93. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.js.map +0 -7
  94. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.js +0 -2
  95. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.js.map +0 -7
  96. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.js +0 -2
  97. package/lib/cjs/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.js.map +0 -7
  98. package/lib/cjs/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.js +0 -2
  99. package/lib/cjs/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.js.map +0 -7
  100. package/lib/cjs/internal/app-binder/model/contactsValidation.test.js +0 -2
  101. package/lib/cjs/internal/app-binder/model/contactsValidation.test.js.map +0 -7
  102. package/lib/cjs/internal/app-binder/services/contactsTlvSerializer.test.js +0 -2
  103. package/lib/cjs/internal/app-binder/services/contactsTlvSerializer.test.js.map +0 -7
  104. package/lib/cjs/internal/app-binder/services/provideContact.test.js +0 -2
  105. package/lib/cjs/internal/app-binder/services/provideContact.test.js.map +0 -7
  106. package/lib/cjs/internal/app-binder/services/sendFramedContactsPayload.test.js +0 -2
  107. package/lib/cjs/internal/app-binder/services/sendFramedContactsPayload.test.js.map +0 -7
  108. package/lib/cjs/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.js +0 -2
  109. package/lib/cjs/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.js.map +0 -7
  110. package/lib/cjs/internal/app-binder/task/SendEditExternalAddressScopeTask.test.js +0 -2
  111. package/lib/cjs/internal/app-binder/task/SendEditExternalAddressScopeTask.test.js.map +0 -7
  112. package/lib/cjs/internal/app-binder/task/SendRegisterIdentityTask.test.js +0 -2
  113. package/lib/cjs/internal/app-binder/task/SendRegisterIdentityTask.test.js.map +0 -7
  114. package/lib/cjs/internal/app-binder/task/SendRenameContactTask.test.js +0 -2
  115. package/lib/cjs/internal/app-binder/task/SendRenameContactTask.test.js.map +0 -7
  116. package/lib/cjs/internal/di.test.js +0 -2
  117. package/lib/cjs/internal/di.test.js.map +0 -7
  118. package/lib/cjs/internal/use-cases/EditExternalAddressIdentifierUseCase.test.js +0 -2
  119. package/lib/cjs/internal/use-cases/EditExternalAddressIdentifierUseCase.test.js.map +0 -7
  120. package/lib/cjs/internal/use-cases/EditExternalAddressScopeUseCase.test.js +0 -2
  121. package/lib/cjs/internal/use-cases/EditExternalAddressScopeUseCase.test.js.map +0 -7
  122. package/lib/cjs/internal/use-cases/RegisterExternalAddressUseCase.test.js +0 -2
  123. package/lib/cjs/internal/use-cases/RegisterExternalAddressUseCase.test.js.map +0 -7
  124. package/lib/cjs/internal/use-cases/RenameContactUseCase.test.js +0 -2
  125. package/lib/cjs/internal/use-cases/RenameContactUseCase.test.js.map +0 -7
  126. package/lib/esm/api/ContactsManagerBuilder.test.js +0 -2
  127. package/lib/esm/api/ContactsManagerBuilder.test.js.map +0 -7
  128. package/lib/esm/api/model/ContactsVersionRequirements.test.js +0 -2
  129. package/lib/esm/api/model/ContactsVersionRequirements.test.js.map +0 -7
  130. package/lib/esm/internal/DefaultContactsManager.test.js +0 -2
  131. package/lib/esm/internal/DefaultContactsManager.test.js.map +0 -7
  132. package/lib/esm/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.js +0 -2
  133. package/lib/esm/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.js.map +0 -7
  134. package/lib/esm/internal/app-binder/command/EditExternalAddressScopeCommand.test.js +0 -2
  135. package/lib/esm/internal/app-binder/command/EditExternalAddressScopeCommand.test.js.map +0 -7
  136. package/lib/esm/internal/app-binder/command/ProvideContactCommand.test.js +0 -2
  137. package/lib/esm/internal/app-binder/command/ProvideContactCommand.test.js.map +0 -7
  138. package/lib/esm/internal/app-binder/command/RegisterIdentityCommand.test.js +0 -2
  139. package/lib/esm/internal/app-binder/command/RegisterIdentityCommand.test.js.map +0 -7
  140. package/lib/esm/internal/app-binder/command/RenameContactCommand.test.js +0 -2
  141. package/lib/esm/internal/app-binder/command/RenameContactCommand.test.js.map +0 -7
  142. package/lib/esm/internal/app-binder/contactsVersionGuards.test.js +0 -2
  143. package/lib/esm/internal/app-binder/contactsVersionGuards.test.js.map +0 -7
  144. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.js +0 -2
  145. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.js.map +0 -7
  146. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.js +0 -2
  147. package/lib/esm/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.js.map +0 -7
  148. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.js +0 -2
  149. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.js.map +0 -7
  150. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.js +0 -2
  151. package/lib/esm/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.js.map +0 -7
  152. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.js +0 -2
  153. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.js.map +0 -7
  154. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.js +0 -2
  155. package/lib/esm/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.js.map +0 -7
  156. package/lib/esm/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js +0 -2
  157. package/lib/esm/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js.map +0 -7
  158. package/lib/esm/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.js +0 -2
  159. package/lib/esm/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.js.map +0 -7
  160. package/lib/esm/internal/app-binder/device-action/__test-utils__/makeInternalApi.js +0 -2
  161. package/lib/esm/internal/app-binder/device-action/__test-utils__/makeInternalApi.js.map +0 -7
  162. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.js +0 -2
  163. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.js.map +0 -7
  164. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.js +0 -2
  165. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.js.map +0 -7
  166. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.js +0 -2
  167. package/lib/esm/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.js.map +0 -7
  168. package/lib/esm/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.js +0 -2
  169. package/lib/esm/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.js.map +0 -7
  170. package/lib/esm/internal/app-binder/model/contactsValidation.test.js +0 -2
  171. package/lib/esm/internal/app-binder/model/contactsValidation.test.js.map +0 -7
  172. package/lib/esm/internal/app-binder/services/contactsTlvSerializer.test.js +0 -2
  173. package/lib/esm/internal/app-binder/services/contactsTlvSerializer.test.js.map +0 -7
  174. package/lib/esm/internal/app-binder/services/provideContact.test.js +0 -2
  175. package/lib/esm/internal/app-binder/services/provideContact.test.js.map +0 -7
  176. package/lib/esm/internal/app-binder/services/sendFramedContactsPayload.test.js +0 -2
  177. package/lib/esm/internal/app-binder/services/sendFramedContactsPayload.test.js.map +0 -7
  178. package/lib/esm/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.js +0 -2
  179. package/lib/esm/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.js.map +0 -7
  180. package/lib/esm/internal/app-binder/task/SendEditExternalAddressScopeTask.test.js +0 -2
  181. package/lib/esm/internal/app-binder/task/SendEditExternalAddressScopeTask.test.js.map +0 -7
  182. package/lib/esm/internal/app-binder/task/SendRegisterIdentityTask.test.js +0 -2
  183. package/lib/esm/internal/app-binder/task/SendRegisterIdentityTask.test.js.map +0 -7
  184. package/lib/esm/internal/app-binder/task/SendRenameContactTask.test.js +0 -2
  185. package/lib/esm/internal/app-binder/task/SendRenameContactTask.test.js.map +0 -7
  186. package/lib/esm/internal/di.test.js +0 -2
  187. package/lib/esm/internal/di.test.js.map +0 -7
  188. package/lib/esm/internal/use-cases/EditExternalAddressIdentifierUseCase.test.js +0 -2
  189. package/lib/esm/internal/use-cases/EditExternalAddressIdentifierUseCase.test.js.map +0 -7
  190. package/lib/esm/internal/use-cases/EditExternalAddressScopeUseCase.test.js +0 -2
  191. package/lib/esm/internal/use-cases/EditExternalAddressScopeUseCase.test.js.map +0 -7
  192. package/lib/esm/internal/use-cases/RegisterExternalAddressUseCase.test.js +0 -2
  193. package/lib/esm/internal/use-cases/RegisterExternalAddressUseCase.test.js.map +0 -7
  194. package/lib/esm/internal/use-cases/RenameContactUseCase.test.js +0 -2
  195. package/lib/esm/internal/use-cases/RenameContactUseCase.test.js.map +0 -7
  196. package/lib/types/api/ContactsManagerBuilder.test.d.ts +0 -2
  197. package/lib/types/api/ContactsManagerBuilder.test.d.ts.map +0 -1
  198. package/lib/types/api/model/ContactsVersionRequirements.test.d.ts +0 -2
  199. package/lib/types/api/model/ContactsVersionRequirements.test.d.ts.map +0 -1
  200. package/lib/types/internal/DefaultContactsManager.test.d.ts +0 -2
  201. package/lib/types/internal/DefaultContactsManager.test.d.ts.map +0 -1
  202. package/lib/types/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.d.ts +0 -2
  203. package/lib/types/internal/app-binder/command/EditExternalAddressIdentifierCommand.test.d.ts.map +0 -1
  204. package/lib/types/internal/app-binder/command/EditExternalAddressScopeCommand.test.d.ts +0 -2
  205. package/lib/types/internal/app-binder/command/EditExternalAddressScopeCommand.test.d.ts.map +0 -1
  206. package/lib/types/internal/app-binder/command/ProvideContactCommand.test.d.ts +0 -2
  207. package/lib/types/internal/app-binder/command/ProvideContactCommand.test.d.ts.map +0 -1
  208. package/lib/types/internal/app-binder/command/RegisterIdentityCommand.test.d.ts +0 -2
  209. package/lib/types/internal/app-binder/command/RegisterIdentityCommand.test.d.ts.map +0 -1
  210. package/lib/types/internal/app-binder/command/RenameContactCommand.test.d.ts +0 -2
  211. package/lib/types/internal/app-binder/command/RenameContactCommand.test.d.ts.map +0 -1
  212. package/lib/types/internal/app-binder/contactsVersionGuards.test.d.ts +0 -2
  213. package/lib/types/internal/app-binder/contactsVersionGuards.test.d.ts.map +0 -1
  214. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.d.ts +0 -2
  215. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/EditExternalAddressIdentifierDeviceAction.test.d.ts.map +0 -1
  216. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.d.ts +0 -2
  217. package/lib/types/internal/app-binder/device-action/EditExternalAddressIdentifier/validateEditExternalAddressIdentifierInput.test.d.ts.map +0 -1
  218. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.d.ts +0 -2
  219. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/EditExternalAddressScopeDeviceAction.test.d.ts.map +0 -1
  220. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.d.ts +0 -2
  221. package/lib/types/internal/app-binder/device-action/EditExternalAddressScope/validateEditExternalAddressScopeInput.test.d.ts.map +0 -1
  222. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.d.ts +0 -2
  223. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/RegisterExternalAddressDeviceAction.test.d.ts.map +0 -1
  224. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.d.ts +0 -2
  225. package/lib/types/internal/app-binder/device-action/RegisterExternalAddress/validateRegisterExternalAddressInput.test.d.ts.map +0 -1
  226. package/lib/types/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.d.ts +0 -2
  227. package/lib/types/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.d.ts.map +0 -1
  228. package/lib/types/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.d.ts +0 -2
  229. package/lib/types/internal/app-binder/device-action/RenameContact/validateRenameContactInput.test.d.ts.map +0 -1
  230. package/lib/types/internal/app-binder/device-action/__test-utils__/makeInternalApi.d.ts +0 -4
  231. package/lib/types/internal/app-binder/device-action/__test-utils__/makeInternalApi.d.ts.map +0 -1
  232. package/lib/types/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.d.ts +0 -12
  233. package/lib/types/internal/app-binder/device-action/__test-utils__/setupGoToDashboardDAMock.d.ts.map +0 -1
  234. package/lib/types/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.d.ts +0 -2
  235. package/lib/types/internal/app-binder/device-action/__test-utils__/setupOpenAppDAMock.d.ts.map +0 -1
  236. package/lib/types/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.d.ts +0 -17
  237. package/lib/types/internal/app-binder/device-action/__test-utils__/setupWaitForAppAndVersionDAMock.d.ts.map +0 -1
  238. package/lib/types/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.d.ts +0 -15
  239. package/lib/types/internal/app-binder/device-action/__test-utils__/testDeviceActionStates.d.ts.map +0 -1
  240. package/lib/types/internal/app-binder/model/contactsValidation.test.d.ts +0 -2
  241. package/lib/types/internal/app-binder/model/contactsValidation.test.d.ts.map +0 -1
  242. package/lib/types/internal/app-binder/services/contactsTlvSerializer.test.d.ts +0 -2
  243. package/lib/types/internal/app-binder/services/contactsTlvSerializer.test.d.ts.map +0 -1
  244. package/lib/types/internal/app-binder/services/provideContact.test.d.ts +0 -2
  245. package/lib/types/internal/app-binder/services/provideContact.test.d.ts.map +0 -1
  246. package/lib/types/internal/app-binder/services/sendFramedContactsPayload.test.d.ts +0 -2
  247. package/lib/types/internal/app-binder/services/sendFramedContactsPayload.test.d.ts.map +0 -1
  248. package/lib/types/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.d.ts +0 -2
  249. package/lib/types/internal/app-binder/task/SendEditExternalAddressIdentifierTask.test.d.ts.map +0 -1
  250. package/lib/types/internal/app-binder/task/SendEditExternalAddressScopeTask.test.d.ts +0 -2
  251. package/lib/types/internal/app-binder/task/SendEditExternalAddressScopeTask.test.d.ts.map +0 -1
  252. package/lib/types/internal/app-binder/task/SendRegisterIdentityTask.test.d.ts +0 -2
  253. package/lib/types/internal/app-binder/task/SendRegisterIdentityTask.test.d.ts.map +0 -1
  254. package/lib/types/internal/app-binder/task/SendRenameContactTask.test.d.ts +0 -2
  255. package/lib/types/internal/app-binder/task/SendRenameContactTask.test.d.ts.map +0 -1
  256. package/lib/types/internal/di.test.d.ts +0 -2
  257. package/lib/types/internal/di.test.d.ts.map +0 -1
  258. package/lib/types/internal/use-cases/EditExternalAddressIdentifierUseCase.test.d.ts +0 -2
  259. package/lib/types/internal/use-cases/EditExternalAddressIdentifierUseCase.test.d.ts.map +0 -1
  260. package/lib/types/internal/use-cases/EditExternalAddressScopeUseCase.test.d.ts +0 -2
  261. package/lib/types/internal/use-cases/EditExternalAddressScopeUseCase.test.d.ts.map +0 -1
  262. package/lib/types/internal/use-cases/RegisterExternalAddressUseCase.test.d.ts +0 -2
  263. package/lib/types/internal/use-cases/RegisterExternalAddressUseCase.test.d.ts.map +0 -1
  264. package/lib/types/internal/use-cases/RenameContactUseCase.test.d.ts +0 -2
  265. package/lib/types/internal/use-cases/RenameContactUseCase.test.d.ts.map +0 -1
package/README.md CHANGED
@@ -55,6 +55,18 @@ observable.subscribe((state) => {
55
55
  });
56
56
  ```
57
57
 
58
+ `identifier` is the address as raw bytes; converting an address string to bytes (hex for
59
+ Ethereum, base58 for Tron and Solana) is up to the host. The kit checks it against the blockchain
60
+ family before anything reaches the device:
61
+
62
+ | `blockchainFamily` | `identifier` | `chainId` | Embedded app |
63
+ | ------------------ | ----------------------- | ----------- | ------------ |
64
+ | `"ethereum"` | 20-byte address | Required | `Ethereum` |
65
+ | `"tron"` | Non-empty address bytes | Not used | `Tron` |
66
+ | `"solana"` | 32-byte public key | Not allowed | `Solana` |
67
+
68
+ The same rules apply to the edit operations and to `buildProvideContactPayload`.
69
+
58
70
  ## Renaming a contact
59
71
 
60
72
  `renameContact` runs the device's EDIT CONTACT NAME operation. Unlike the register operations, this
@@ -116,8 +128,8 @@ if (requirement.supported) {
116
128
 
117
129
  The two axes are checked independently, never as one combined verdict: `minOsVersion` gates
118
130
  OS-owned operations (served by the device OS, e.g. renaming a contact from the dashboard) and
119
- `minAppVersion` gates app-owned operations (served by the embedded app, keyed by app name — v1
120
- ships Ethereum only). A device can satisfy one and not the other, and each Contacts operation
131
+ `minAppVersion` gates app-owned operations (served by the embedded app, keyed by app name: `ETHEREUM_APP_NAME`,
132
+ `TRON_APP_NAME`, `SOLANA_APP_NAME`). A device can satisfy one and not the other, and each Contacts operation
121
133
  depends on exactly one of them, so collapsing them into a single "is Contacts supported" answer
122
134
  would reject devices that can serve the operation the host actually wants.
123
135
 
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var y=(r,t)=>{for(var n in t)o(r,n,{get:t[n],enumerable:!0})},u=(r,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of A(t))!E.call(r,d)&&d!==n&&o(r,d,{get:()=>t[d],enumerable:!(s=i(t,d))||s.enumerable});return r};var x=r=>u(o({},"__esModule",{value:!0}),r);var l={};y(l,{CONTACTS_VERSION_REQUIREMENTS:()=>e.CONTACTS_VERSION_REQUIREMENTS,ContactsManagerBuilder:()=>a.ContactsManagerBuilder,ETHEREUM_APP_NAME:()=>e.ETHEREUM_APP_NAME,TRON_APP_NAME:()=>e.TRON_APP_NAME,buildProvideContactPayload:()=>p.buildProvideContactPayload,isVersionAtLeast:()=>e.isVersionAtLeast,resolveContactsVersionRequirements:()=>e.resolveContactsVersionRequirements,sendProvideContactPayload:()=>p.sendProvideContactPayload});module.exports=x(l);var a=require("./ContactsManagerBuilder"),e=require("./model/ContactsVersionRequirements"),p=require("../internal/app-binder/services/provideContact");0&&(module.exports={CONTACTS_VERSION_REQUIREMENTS,ContactsManagerBuilder,ETHEREUM_APP_NAME,TRON_APP_NAME,buildProvideContactPayload,isVersionAtLeast,resolveContactsVersionRequirements,sendProvideContactPayload});
1
+ "use strict";var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var y=(r,t)=>{for(var n in t)o(r,n,{get:t[n],enumerable:!0})},u=(r,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of A(t))!E.call(r,d)&&d!==n&&o(r,d,{get:()=>t[d],enumerable:!(s=i(t,d))||s.enumerable});return r};var x=r=>u(o({},"__esModule",{value:!0}),r);var l={};y(l,{CONTACTS_VERSION_REQUIREMENTS:()=>e.CONTACTS_VERSION_REQUIREMENTS,ContactsManagerBuilder:()=>a.ContactsManagerBuilder,ETHEREUM_APP_NAME:()=>e.ETHEREUM_APP_NAME,SOLANA_APP_NAME:()=>e.SOLANA_APP_NAME,TRON_APP_NAME:()=>e.TRON_APP_NAME,buildProvideContactPayload:()=>p.buildProvideContactPayload,isVersionAtLeast:()=>e.isVersionAtLeast,resolveContactsVersionRequirements:()=>e.resolveContactsVersionRequirements,sendProvideContactPayload:()=>p.sendProvideContactPayload});module.exports=x(l);var a=require("./ContactsManagerBuilder"),e=require("./model/ContactsVersionRequirements"),p=require("../internal/app-binder/services/provideContact");0&&(module.exports={CONTACTS_VERSION_REQUIREMENTS,ContactsManagerBuilder,ETHEREUM_APP_NAME,SOLANA_APP_NAME,TRON_APP_NAME,buildProvideContactPayload,isVersionAtLeast,resolveContactsVersionRequirements,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 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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8bAAAE,EAAAF,GAqCA,IAAAG,EAAuC,uCACvCC,EAUO,kDAqBPC,EAIO",
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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oeAAAE,EAAAF,GAqCA,IAAAG,EAAuC,uCACvCC,EAWO,kDAqBPC,EAIO",
6
6
  "names": ["api_exports", "__export", "__toCommonJS", "import_ContactsManagerBuilder", "import_ContactsVersionRequirements", "import_provideContact"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var P=(e,n)=>{for(var o in n)a(e,o,{get:n[o],enumerable:!0})},M=(e,n,o,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of V(n))!m.call(e,i)&&i!==o&&a(e,i,{get:()=>n[i],enumerable:!(t=E(n,i))||t.enumerable});return e};var S=e=>M(a({},"__esModule",{value:!0}),e);var y={};P(y,{CONTACTS_VERSION_REQUIREMENTS:()=>u,ETHEREUM_APP_NAME:()=>c,TRON_APP_NAME:()=>_,isVersionAtLeast:()=>X,isVersionBelow:()=>A,renameRequiresDerivationPath:()=>x,resolveContactsVersionRequirements:()=>U});module.exports=S(y);var s=require("@ledgerhq/device-management-kit"),r=require("semver");const c="Ethereum",_="Tron",I={supported:!1},d="1.11.0",l="1.7.0",N="1.2.0",O="2.8.0",R="1.7.0",T="1.23.0",f="0.8.0",p={[c]:T,[_]:f},C=`${d}-rc3`,q=`${l}-rc3`,v=`${N}-rc3`,D=`${O}-rc3`,F=`${R}-rc3`,u={[s.DeviceModelId.NANO_S]:I,[s.DeviceModelId.NANO_SP]:{supported:!0,minOsVersion:R,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:F},[s.DeviceModelId.NANO_X]:{supported:!0,minOsVersion:O,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:D},[s.DeviceModelId.STAX]:{supported:!0,minOsVersion:d,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:C},[s.DeviceModelId.FLEX]:{supported:!0,minOsVersion:l,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:q},[s.DeviceModelId.APEX]:{supported:!0,minOsVersion:N,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:v}};function U(e){return u[e]}function X(e,n){const o=(0,r.valid)((0,r.coerce)(e)),t=(0,r.valid)((0,r.coerce)(n));return o===null||t===null?!1:(0,r.gte)(o,t)}function A(e,n){const o=(0,r.valid)(e),t=(0,r.valid)(n);return o===null||t===null?!1:(0,r.lt)(o,t)}function x(e,n){const o=u[e];if(!o.supported)return!1;const t=o.renameDerivationPathRequiredBelowOsVersion;return t===void 0?!1:A(n,t)}0&&(module.exports={CONTACTS_VERSION_REQUIREMENTS,ETHEREUM_APP_NAME,TRON_APP_NAME,isVersionAtLeast,isVersionBelow,renameRequiresDerivationPath,resolveContactsVersionRequirements});
1
+ "use strict";var a=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var M=(e,o)=>{for(var n in o)a(e,n,{get:o[n],enumerable:!0})},S=(e,o,n,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of V(o))!m.call(e,i)&&i!==n&&a(e,i,{get:()=>o[i],enumerable:!(r=P(o,i))||r.enumerable});return e};var I=e=>S(a({},"__esModule",{value:!0}),e);var h={};M(h,{CONTACTS_VERSION_REQUIREMENTS:()=>_,ETHEREUM_APP_NAME:()=>c,SOLANA_APP_NAME:()=>l,TRON_APP_NAME:()=>u,isVersionAtLeast:()=>y,isVersionBelow:()=>R,renameRequiresDerivationPath:()=>g,resolveContactsVersionRequirements:()=>X});module.exports=I(h);var s=require("@ledgerhq/device-management-kit"),t=require("semver");const c="Ethereum",u="Tron",l="Solana",T={supported:!1},N="1.11.0",d="1.7.0",O="1.2.0",A="2.8.0",E="1.7.0",f="1.23.0",C="0.8.0",q="10.0.0",p={[c]:f,[u]:C,[l]:q},v=`${N}-rc3`,D=`${d}-rc3`,F=`${O}-rc3`,U=`${A}-rc3`,x=`${E}-rc3`,_={[s.DeviceModelId.NANO_S]:T,[s.DeviceModelId.NANO_SP]:{supported:!0,minOsVersion:E,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:x},[s.DeviceModelId.NANO_X]:{supported:!0,minOsVersion:A,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:U},[s.DeviceModelId.STAX]:{supported:!0,minOsVersion:N,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:v},[s.DeviceModelId.FLEX]:{supported:!0,minOsVersion:d,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:D},[s.DeviceModelId.APEX]:{supported:!0,minOsVersion:O,minAppVersion:p,renameDerivationPathRequiredBelowOsVersion:F}};function X(e){return _[e]}function y(e,o){const n=(0,t.valid)((0,t.coerce)(e)),r=(0,t.valid)((0,t.coerce)(o));return n===null||r===null?!1:(0,t.gte)(n,r)}function R(e,o){const n=(0,t.valid)(e),r=(0,t.valid)(o);return n===null||r===null?!1:(0,t.lt)(n,r)}function g(e,o){const n=_[e];if(!n.supported)return!1;const r=n.renameDerivationPathRequiredBelowOsVersion;return r===void 0?!1:R(o,r)}0&&(module.exports={CONTACTS_VERSION_REQUIREMENTS,ETHEREUM_APP_NAME,SOLANA_APP_NAME,TRON_APP_NAME,isVersionAtLeast,isVersionBelow,renameRequiresDerivationPath,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.\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\";\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\nconst MIN_APP_VERSION = {\n [ETHEREUM_APP_NAME]: MIN_ETHEREUM_APP_VERSION,\n [TRON_APP_NAME]: MIN_TRON_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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mCAAAE,EAAA,sBAAAC,EAAA,kBAAAC,EAAA,qBAAAC,EAAA,mBAAAC,EAAA,iCAAAC,EAAA,uCAAAC,IAAA,eAAAC,EAAAT,GAAA,IAAAU,EAA8B,2CAC9BC,EAAuC,kBAmDhC,MAAMR,EAAoB,WACpBC,EAAgB,OAEvBQ,EAAwC,CAAE,UAAW,EAAM,EAE3DC,EAAsB,SACtBC,EAAsB,QACtBC,EAAsB,QACtBC,EAAwB,QACxBC,EAAyB,QAEzBC,EAA2B,SAC3BC,EAAuB,QAEvBC,EAAkB,CACtB,CAACjB,CAAiB,EAAGe,EACrB,CAACd,CAAa,EAAGe,CACnB,EAQME,EAA0B,GAAGR,CAAmB,OAChDS,EAA0B,GAAGR,CAAmB,OAChDS,EAA0B,GAAGR,CAAmB,OAChDS,EAA4B,GAAGR,CAAqB,OACpDS,EAA6B,GAAGR,CAAsB,OAM/Cf,EAA6D,CACxE,CAAC,gBAAc,MAAM,EAAGU,EACxB,CAAC,gBAAc,OAAO,EAAG,CACvB,UAAW,GACX,aAAcK,EACd,cAAeG,EACf,2CAA4CK,CAC9C,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,UAAW,GACX,aAAcT,EACd,cAAeI,EACf,2CAA4CI,CAC9C,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcX,EACd,cAAeO,EACf,2CAA4CC,CAC9C,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcP,EACd,cAAeM,EACf,2CAA4CE,CAC9C,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcP,EACd,cAAeK,EACf,2CAA4CG,CAC9C,CACF,EAMO,SAASf,EACdkB,EAC0B,CAC1B,OAAOxB,EAA8BwB,CAAa,CACpD,CAUO,SAASrB,EAAiBsB,EAAgBC,EAA0B,CACzE,MAAMC,KAAI,YAAM,UAAOF,CAAM,CAAC,EACxBG,KAAI,YAAM,UAAOF,CAAO,CAAC,EAC/B,OAAIC,IAAM,MAAQC,IAAM,KAAa,MAC9B,OAAID,EAAGC,CAAC,CACjB,CAYO,SAASxB,EAAeqB,EAAgBI,EAA2B,CACxE,MAAMF,KAAI,SAAMF,CAAM,EAChBG,KAAI,SAAMC,CAAQ,EACxB,OAAIF,IAAM,MAAQC,IAAM,KAAa,MAC9B,MAAGD,EAAGC,CAAC,CAChB,CAWO,SAASvB,EACdmB,EACAM,EACS,CACT,MAAMC,EAAc/B,EAA8BwB,CAAa,EAC/D,GAAI,CAACO,EAAY,UAAW,MAAO,GACnC,MAAMC,EAASD,EAAY,2CAC3B,OAAIC,IAAW,OAAkB,GAC1B5B,EAAe0B,EAAWE,CAAM,CACzC",
6
- "names": ["ContactsVersionRequirements_exports", "__export", "CONTACTS_VERSION_REQUIREMENTS", "ETHEREUM_APP_NAME", "TRON_APP_NAME", "isVersionAtLeast", "isVersionBelow", "renameRequiresDerivationPath", "resolveContactsVersionRequirements", "__toCommonJS", "import_device_management_kit", "import_semver", "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_APP_VERSION", "RENAME_PATH_CUTOFF_STAX", "RENAME_PATH_CUTOFF_FLEX", "RENAME_PATH_CUTOFF_APEX", "RENAME_PATH_CUTOFF_NANO_X", "RENAME_PATH_CUTOFF_NANO_SP", "deviceModelId", "actual", "minimum", "a", "b", "boundary", "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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mCAAAE,EAAA,sBAAAC,EAAA,oBAAAC,EAAA,kBAAAC,EAAA,qBAAAC,EAAA,mBAAAC,EAAA,iCAAAC,EAAA,uCAAAC,IAAA,eAAAC,EAAAV,GAAA,IAAAW,EAA8B,2CAC9BC,EAAuC,kBAmDhC,MAAMT,EAAoB,WACpBE,EAAgB,OAChBD,EAAkB,SAEzBS,EAAwC,CAAE,UAAW,EAAM,EAE3DC,EAAsB,SACtBC,EAAsB,QACtBC,EAAsB,QACtBC,EAAwB,QACxBC,EAAyB,QAEzBC,EAA2B,SAC3BC,EAAuB,QAKvBC,EAAyB,SAEzBC,EAAkB,CACtB,CAACnB,CAAiB,EAAGgB,EACrB,CAACd,CAAa,EAAGe,EACjB,CAAChB,CAAe,EAAGiB,CACrB,EAQME,EAA0B,GAAGT,CAAmB,OAChDU,EAA0B,GAAGT,CAAmB,OAChDU,EAA0B,GAAGT,CAAmB,OAChDU,EAA4B,GAAGT,CAAqB,OACpDU,EAA6B,GAAGT,CAAsB,OAM/ChB,EAA6D,CACxE,CAAC,gBAAc,MAAM,EAAGW,EACxB,CAAC,gBAAc,OAAO,EAAG,CACvB,UAAW,GACX,aAAcK,EACd,cAAeI,EACf,2CAA4CK,CAC9C,EACA,CAAC,gBAAc,MAAM,EAAG,CACtB,UAAW,GACX,aAAcV,EACd,cAAeK,EACf,2CAA4CI,CAC9C,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcZ,EACd,cAAeQ,EACf,2CAA4CC,CAC9C,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcR,EACd,cAAeO,EACf,2CAA4CE,CAC9C,EACA,CAAC,gBAAc,IAAI,EAAG,CACpB,UAAW,GACX,aAAcR,EACd,cAAeM,EACf,2CAA4CG,CAC9C,CACF,EAMO,SAAShB,EACdmB,EAC0B,CAC1B,OAAO1B,EAA8B0B,CAAa,CACpD,CAUO,SAAStB,EAAiBuB,EAAgBC,EAA0B,CACzE,MAAMC,KAAI,YAAM,UAAOF,CAAM,CAAC,EACxBG,KAAI,YAAM,UAAOF,CAAO,CAAC,EAC/B,OAAIC,IAAM,MAAQC,IAAM,KAAa,MAC9B,OAAID,EAAGC,CAAC,CACjB,CAYO,SAASzB,EAAesB,EAAgBI,EAA2B,CACxE,MAAMF,KAAI,SAAMF,CAAM,EAChBG,KAAI,SAAMC,CAAQ,EACxB,OAAIF,IAAM,MAAQC,IAAM,KAAa,MAC9B,MAAGD,EAAGC,CAAC,CAChB,CAWO,SAASxB,EACdoB,EACAM,EACS,CACT,MAAMC,EAAcjC,EAA8B0B,CAAa,EAC/D,GAAI,CAACO,EAAY,UAAW,MAAO,GACnC,MAAMC,EAASD,EAAY,2CAC3B,OAAIC,IAAW,OAAkB,GAC1B7B,EAAe2B,EAAWE,CAAM,CACzC",
6
+ "names": ["ContactsVersionRequirements_exports", "__export", "CONTACTS_VERSION_REQUIREMENTS", "ETHEREUM_APP_NAME", "SOLANA_APP_NAME", "TRON_APP_NAME", "isVersionAtLeast", "isVersionBelow", "renameRequiresDerivationPath", "resolveContactsVersionRequirements", "__toCommonJS", "import_device_management_kit", "import_semver", "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", "deviceModelId", "actual", "minimum", "a", "b", "boundary", "osVersion", "requirement", "cutoff"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/model/EditExternalAddressIdentifier.ts"],
4
- "sourcesContent": ["/**\n * Public input/output types for `ContactsManager.editExternalAddressIdentifier`.\n *\n * EDIT IDENTIFIER replaces an entry's identifier bytes within an existing\n * contact group. Only the address-level `hmacRest` rotates; the group-level\n * `hmacProof` passes through unchanged. Proof material is raw bytes (the host\n * owns persistence); `derivationPath` is kit-internal and not exposed.\n */\n\nexport type EditExternalAddressIdentifierInput = {\n /** The contact's name, proven to the device via `hmacProof`. */\n readonly contactName: string;\n /** The entry's current label/scope; shown on the approval screen. */\n readonly scope: string;\n /** The current (pre-edit) address bytes, proven via `hmacRest`. */\n readonly previousIdentifier: Uint8Array;\n /** The replacement address bytes (20 bytes for Ethereum). */\n readonly newIdentifier: Uint8Array;\n /** Blockchain family name, e.g. \"ethereum\" (v1 supports Ethereum only). */\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** 64-byte group handle returned by the group's Register Identity. */\n readonly groupHandle: Uint8Array;\n /**\n * The contact-group name proof (device `hmac_name`) \u2014 passed back so the\n * device can verify the entry belongs to the group. Unchanged by the edit.\n */\n readonly hmacProof: Uint8Array;\n /**\n * The entry's current 32-byte address proof (`hmac_rest`) \u2014 passed back so the\n * device can verify continuity before approving. Replaced by the returned\n * `hmacRest` on success.\n */\n readonly hmacRest: Uint8Array;\n /**\n * When `true`, the open-app step is skipped (the caller guarantees the app is\n * already open). The app-version guard still runs.\n */\n readonly skipOpenApp?: boolean;\n};\n\nexport type EditExternalAddressIdentifierOutput = {\n /** Echoed input, needed by the host to locate the entry it is replacing. */\n readonly contactName: string;\n readonly scope: string;\n /** Echoed previous address bytes, to match the entry being replaced. */\n readonly previousIdentifier: Uint8Array;\n /** The new address bytes now bound to the entry. */\n readonly identifier: Uint8Array;\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** Echoed group handle, unchanged by the edit. */\n readonly groupHandle: Uint8Array;\n /** Echoed group-level name proof, unchanged by the edit. */\n readonly hmacProof: Uint8Array;\n /** The replacement address-level proof (rotated `hmac_rest`) to persist. */\n readonly hmacRest: Uint8Array;\n};\n"],
4
+ "sourcesContent": ["/**\n * Public input/output types for `ContactsManager.editExternalAddressIdentifier`.\n *\n * EDIT IDENTIFIER replaces an entry's identifier bytes within an existing\n * contact group. Only the address-level `hmacRest` rotates; the group-level\n * `hmacProof` passes through unchanged. Proof material is raw bytes (the host\n * owns persistence); `derivationPath` is kit-internal and not exposed.\n */\n\nexport type EditExternalAddressIdentifierInput = {\n /** The contact's name, proven to the device via `hmacProof`. */\n readonly contactName: string;\n /** The entry's current label/scope; shown on the approval screen. */\n readonly scope: string;\n /** The current (pre-edit) address bytes, proven via `hmacRest`. */\n readonly previousIdentifier: Uint8Array;\n /** The replacement address bytes (20 bytes for Ethereum, 32 for Solana). */\n readonly newIdentifier: Uint8Array;\n /** Blockchain family name, e.g. \"ethereum\", \"tron\" or \"solana\". */\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** 64-byte group handle returned by the group's Register Identity. */\n readonly groupHandle: Uint8Array;\n /**\n * The contact-group name proof (device `hmac_name`) \u2014 passed back so the\n * device can verify the entry belongs to the group. Unchanged by the edit.\n */\n readonly hmacProof: Uint8Array;\n /**\n * The entry's current 32-byte address proof (`hmac_rest`) \u2014 passed back so the\n * device can verify continuity before approving. Replaced by the returned\n * `hmacRest` on success.\n */\n readonly hmacRest: Uint8Array;\n /**\n * When `true`, the open-app step is skipped (the caller guarantees the app is\n * already open). The app-version guard still runs.\n */\n readonly skipOpenApp?: boolean;\n};\n\nexport type EditExternalAddressIdentifierOutput = {\n /** Echoed input, needed by the host to locate the entry it is replacing. */\n readonly contactName: string;\n readonly scope: string;\n /** Echoed previous address bytes, to match the entry being replaced. */\n readonly previousIdentifier: Uint8Array;\n /** The new address bytes now bound to the entry. */\n readonly identifier: Uint8Array;\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** Echoed group handle, unchanged by the edit. */\n readonly groupHandle: Uint8Array;\n /** Echoed group-level name proof, unchanged by the edit. */\n readonly hmacProof: Uint8Array;\n /** The replacement address-level proof (rotated `hmac_rest`) to persist. */\n readonly hmacRest: Uint8Array;\n};\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["EditExternalAddressIdentifier_exports", "__toCommonJS"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/model/EditExternalAddressScope.ts"],
4
- "sourcesContent": ["/**\n * Public input/output types for `ContactsManager.editExternalAddressScope`.\n *\n * EDIT SCOPE replaces an entry's scope (its context label) within an existing\n * contact group while keeping the same contact name and identifier. Only the\n * address-level `hmacRest` rotates; the group-level `hmacProof` passes through\n * unchanged. Proof material is raw bytes (the host owns persistence);\n * `derivationPath` is kit-internal and not exposed.\n */\n\nexport type EditExternalAddressScopeInput = {\n /** The contact's name, proven to the device via `hmacProof`. Unchanged. */\n readonly contactName: string;\n /** The entry's current scope; shown on the approval screen and proven via `hmacRest`. */\n readonly previousScope: string;\n /** The replacement scope (max 32 printable ASCII chars). */\n readonly newScope: string;\n /** The entry's identifier bytes (20 bytes for Ethereum). Unchanged by the edit. */\n readonly identifier: Uint8Array;\n /** Blockchain family name, e.g. \"ethereum\" (v1 supports Ethereum only). */\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** 64-byte group handle returned by the group's Register Identity. */\n readonly groupHandle: Uint8Array;\n /**\n * The contact-group name proof (device `hmac_name`) \u2014 passed back so the\n * device can verify the entry belongs to the group. Unchanged by the edit.\n */\n readonly hmacProof: Uint8Array;\n /**\n * The entry's current 32-byte address proof (`hmac_rest`) \u2014 passed back so the\n * device can verify the previous scope/identifier before approving. Replaced\n * by the returned `hmacRest` on success.\n */\n readonly hmacRest: Uint8Array;\n /**\n * When `true`, the open-app step is skipped (the caller guarantees the app is\n * already open). The app-version guard still runs.\n */\n readonly skipOpenApp?: boolean;\n};\n\nexport type EditExternalAddressScopeOutput = {\n /** Echoed input, needed by the host to locate the entry it is replacing. */\n readonly contactName: string;\n /** Echoed previous scope, to match the entry being replaced. */\n readonly previousScope: string;\n /** The new scope now bound to the entry. */\n readonly scope: string;\n /** Echoed identifier bytes, unchanged by the edit. */\n readonly identifier: Uint8Array;\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** Echoed group handle, unchanged by the edit. */\n readonly groupHandle: Uint8Array;\n /** Echoed group-level name proof, unchanged by the edit. */\n readonly hmacProof: Uint8Array;\n /** The replacement address-level proof (rotated `hmac_rest`) to persist. */\n readonly hmacRest: Uint8Array;\n};\n"],
4
+ "sourcesContent": ["/**\n * Public input/output types for `ContactsManager.editExternalAddressScope`.\n *\n * EDIT SCOPE replaces an entry's scope (its context label) within an existing\n * contact group while keeping the same contact name and identifier. Only the\n * address-level `hmacRest` rotates; the group-level `hmacProof` passes through\n * unchanged. Proof material is raw bytes (the host owns persistence);\n * `derivationPath` is kit-internal and not exposed.\n */\n\nexport type EditExternalAddressScopeInput = {\n /** The contact's name, proven to the device via `hmacProof`. Unchanged. */\n readonly contactName: string;\n /** The entry's current scope; shown on the approval screen and proven via `hmacRest`. */\n readonly previousScope: string;\n /** The replacement scope (max 32 printable ASCII chars). */\n readonly newScope: string;\n /** The entry's identifier bytes (20 bytes for Ethereum, 32 for Solana). Unchanged by the edit. */\n readonly identifier: Uint8Array;\n /** Blockchain family name, e.g. \"ethereum\", \"tron\" or \"solana\". */\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** 64-byte group handle returned by the group's Register Identity. */\n readonly groupHandle: Uint8Array;\n /**\n * The contact-group name proof (device `hmac_name`) \u2014 passed back so the\n * device can verify the entry belongs to the group. Unchanged by the edit.\n */\n readonly hmacProof: Uint8Array;\n /**\n * The entry's current 32-byte address proof (`hmac_rest`) \u2014 passed back so the\n * device can verify the previous scope/identifier before approving. Replaced\n * by the returned `hmacRest` on success.\n */\n readonly hmacRest: Uint8Array;\n /**\n * When `true`, the open-app step is skipped (the caller guarantees the app is\n * already open). The app-version guard still runs.\n */\n readonly skipOpenApp?: boolean;\n};\n\nexport type EditExternalAddressScopeOutput = {\n /** Echoed input, needed by the host to locate the entry it is replacing. */\n readonly contactName: string;\n /** Echoed previous scope, to match the entry being replaced. */\n readonly previousScope: string;\n /** The new scope now bound to the entry. */\n readonly scope: string;\n /** Echoed identifier bytes, unchanged by the edit. */\n readonly identifier: Uint8Array;\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** Echoed group handle, unchanged by the edit. */\n readonly groupHandle: Uint8Array;\n /** Echoed group-level name proof, unchanged by the edit. */\n readonly hmacProof: Uint8Array;\n /** The replacement address-level proof (rotated `hmac_rest`) to persist. */\n readonly hmacRest: Uint8Array;\n};\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["EditExternalAddressScope_exports", "__toCommonJS"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/model/ProvideContact.ts"],
4
- "sourcesContent": ["/**\n * Everything the device needs to accept a registered external contact as a\n * decoration for an upcoming signing flow: the name-level material shared by\n * the whole contact group, plus the address-level material of the one matched\n * address.\n */\nexport type ProvideContactInput = {\n readonly contactName: string;\n readonly scope: string;\n /** Raw bytes, chain-dependent: a 20-byte address for Ethereum. */\n readonly identifier: Uint8Array;\n readonly groupHandle: Uint8Array;\n readonly hmacProof: Uint8Array;\n readonly hmacRest: Uint8Array;\n /** Lowercase family name, e.g. `\"ethereum\"`. */\n readonly blockchainFamily: string;\n /** Mandatory for Ethereum, omitted for every other family. */\n readonly chainId?: bigint;\n};\n"],
4
+ "sourcesContent": ["/**\n * Everything the device needs to accept a registered external contact as a\n * decoration for an upcoming signing flow: the name-level material shared by\n * the whole contact group, plus the address-level material of the one matched\n * address.\n */\nexport type ProvideContactInput = {\n readonly contactName: string;\n readonly scope: string;\n /** Raw bytes, chain-dependent: a 20-byte address for Ethereum, a 32-byte public key for Solana. */\n readonly identifier: Uint8Array;\n readonly groupHandle: Uint8Array;\n readonly hmacProof: Uint8Array;\n readonly hmacRest: Uint8Array;\n /** Lowercase family name, e.g. `\"ethereum\"`. */\n readonly blockchainFamily: string;\n /** Mandatory for Ethereum, omitted for every other family. */\n readonly chainId?: bigint;\n};\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["ProvideContact_exports", "__toCommonJS"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/api/model/RegisterExternalAddress.ts"],
4
- "sourcesContent": ["/**\n * Public input/output types for `ContactsManager.registerExternalAddress`.\n *\n * Proof material (`groupHandle`, `hmacProof`, `hmacRest`) is returned as raw\n * bytes; the host owns persistence and address-book state. `derivationPath` is\n * intentionally absent \u2014 the kit owns a single internal value for external\n * addresses and does not expose it.\n */\n\n/** The existing contact group to extend, when adding an address to it. */\nexport type ExistingContactGroup = {\n /** 64-byte group handle returned by the group's first Register Identity. */\n readonly groupHandle: Uint8Array;\n /** 32-byte name proof (device `hmac_name`) bound to that group. */\n readonly hmacProof: Uint8Array;\n};\n\nexport type RegisterExternalAddressInput = {\n readonly contactName: string;\n readonly scope: string;\n /** Chain address bytes (20 bytes for Ethereum). */\n readonly identifier: Uint8Array;\n /** Blockchain family name, e.g. \"ethereum\" (v1 supports Ethereum only). */\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /**\n * Set to add the address to an existing contact group. Omit to create a new\n * contact group.\n */\n readonly existingContactGroup?: ExistingContactGroup;\n /**\n * When `true`, the open-app step is skipped (the caller guarantees the app is\n * already open). The app-version guard still runs.\n */\n readonly skipOpenApp?: boolean;\n};\n\nexport type RegisterExternalAddressMode =\n | \"newContactGroup\"\n | \"existingContactGroup\";\n\nexport type RegisterExternalAddressOutput = {\n /** Whether a new contact group was created or an existing one was extended. */\n readonly mode: RegisterExternalAddressMode;\n /** Echoed input, needed by the host to persist the returned proof material. */\n readonly contactName: string;\n readonly scope: string;\n readonly identifier: Uint8Array;\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** Device-issued proof material. */\n readonly groupHandle: Uint8Array;\n readonly hmacProof: Uint8Array;\n readonly hmacRest: Uint8Array;\n};\n"],
4
+ "sourcesContent": ["/**\n * Public input/output types for `ContactsManager.registerExternalAddress`.\n *\n * Proof material (`groupHandle`, `hmacProof`, `hmacRest`) is returned as raw\n * bytes; the host owns persistence and address-book state. `derivationPath` is\n * intentionally absent \u2014 the kit owns a single internal value for external\n * addresses and does not expose it.\n */\n\n/** The existing contact group to extend, when adding an address to it. */\nexport type ExistingContactGroup = {\n /** 64-byte group handle returned by the group's first Register Identity. */\n readonly groupHandle: Uint8Array;\n /** 32-byte name proof (device `hmac_name`) bound to that group. */\n readonly hmacProof: Uint8Array;\n};\n\nexport type RegisterExternalAddressInput = {\n readonly contactName: string;\n readonly scope: string;\n /** Chain address bytes (20 bytes for Ethereum, 32 for Solana). */\n readonly identifier: Uint8Array;\n /** Blockchain family name, e.g. \"ethereum\", \"tron\" or \"solana\". */\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /**\n * Set to add the address to an existing contact group. Omit to create a new\n * contact group.\n */\n readonly existingContactGroup?: ExistingContactGroup;\n /**\n * When `true`, the open-app step is skipped (the caller guarantees the app is\n * already open). The app-version guard still runs.\n */\n readonly skipOpenApp?: boolean;\n};\n\nexport type RegisterExternalAddressMode =\n | \"newContactGroup\"\n | \"existingContactGroup\";\n\nexport type RegisterExternalAddressOutput = {\n /** Whether a new contact group was created or an existing one was extended. */\n readonly mode: RegisterExternalAddressMode;\n /** Echoed input, needed by the host to persist the returned proof material. */\n readonly contactName: string;\n readonly scope: string;\n readonly identifier: Uint8Array;\n readonly blockchainFamily: string;\n readonly chainId?: bigint;\n /** Device-issued proof material. */\n readonly groupHandle: Uint8Array;\n readonly hmacProof: Uint8Array;\n readonly hmacRest: Uint8Array;\n};\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["RegisterExternalAddress_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var s=(t,i)=>{for(var n in i)d(t,n,{get:i[n],enumerable:!0})},h=(t,i,n,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of l(i))!c.call(t,r)&&r!==n&&d(t,r,{get:()=>i[r],enumerable:!(o=f(i,r))||o.enumerable});return t};var E=t=>h(d({},"__esModule",{value:!0}),t);var _={};s(_,{validateEditExternalAddressIdentifierInput:()=>I});module.exports=E(_);var a=require("../../../app-binder/model/contactsConstants"),e=require("../../../app-binder/model/contactsValidation");const m=e.HMAC_PROOF_LENGTH;function I(t){try{(0,e.validatePrintableLabel)(t.contactName,{field:"contactName",bufferLength:e.CONTACT_NAME_BUFFER_LENGTH}),(0,e.validatePrintableLabel)(t.scope,{field:"scope",bufferLength:e.SCOPE_BUFFER_LENGTH});const i=t.blockchainFamily.toLowerCase();if(!(i in a.BLOCKCHAIN_FAMILY_BY_NAME))throw new e.ContactsValidationError(`Unsupported blockchain family: ${t.blockchainFamily}`);if(i==="ethereum"){if((0,e.validateByteLength)(t.previousIdentifier,{field:"previousIdentifier",expectedBytes:e.ETH_ADDRESS_BYTES}),(0,e.validateByteLength)(t.newIdentifier,{field:"newIdentifier",expectedBytes:e.ETH_ADDRESS_BYTES}),t.chainId===void 0)throw new e.ContactsValidationError("chainId is required for the Ethereum blockchain family.")}else{if(t.previousIdentifier.length===0)throw new e.ContactsValidationError("previousIdentifier must not be empty.");if(t.newIdentifier.length===0)throw new e.ContactsValidationError("newIdentifier must not be empty.")}return t.chainId!==void 0&&(0,e.validateChainId)(t.chainId),(0,e.validateByteLength)(t.groupHandle,{field:"groupHandle",expectedBytes:e.GROUP_HANDLE_SIZE}),(0,e.validateByteLength)(t.hmacProof,{field:"hmacProof",expectedBytes:e.HMAC_PROOF_LENGTH}),(0,e.validateByteLength)(t.hmacRest,{field:"hmacRest",expectedBytes:m}),null}catch(i){if(i instanceof e.ContactsValidationError)return i;throw i}}0&&(module.exports={validateEditExternalAddressIdentifierInput});
1
+ "use strict";var d=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var c=(t,i)=>{for(var a in i)d(t,a,{get:i[a],enumerable:!0})},s=(t,i,a,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of o(i))!f.call(t,r)&&r!==a&&d(t,r,{get:()=>i[r],enumerable:!(n=l(i,r))||n.enumerable});return t};var E=t=>s(d({},"__esModule",{value:!0}),t);var m={};c(m,{validateEditExternalAddressIdentifierInput:()=>h});module.exports=E(m);var e=require("../../../app-binder/model/contactsValidation");const I=e.HMAC_PROOF_LENGTH;function h(t){try{return(0,e.validatePrintableLabel)(t.contactName,{field:"contactName",bufferLength:e.CONTACT_NAME_BUFFER_LENGTH}),(0,e.validatePrintableLabel)(t.scope,{field:"scope",bufferLength:e.SCOPE_BUFFER_LENGTH}),(0,e.validateFamilyIdentifiers)({blockchainFamily:t.blockchainFamily,identifiers:[{field:"previousIdentifier",value:t.previousIdentifier},{field:"newIdentifier",value:t.newIdentifier}],chainId:t.chainId}),(0,e.validateByteLength)(t.groupHandle,{field:"groupHandle",expectedBytes:e.GROUP_HANDLE_SIZE}),(0,e.validateByteLength)(t.hmacProof,{field:"hmacProof",expectedBytes:e.HMAC_PROOF_LENGTH}),(0,e.validateByteLength)(t.hmacRest,{field:"hmacRest",expectedBytes:I}),null}catch(i){if(i instanceof e.ContactsValidationError)return i;throw i}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gDAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA0C,wDAC1CC,EAUO,yDAGP,MAAMC,EAAmB,oBAOlB,SAASJ,EACdK,EACgC,CAChC,GAAI,IACF,0BAAuBA,EAAM,YAAa,CACxC,MAAO,cACP,aAAc,4BAChB,CAAC,KACD,0BAAuBA,EAAM,MAAO,CAClC,MAAO,QACP,aAAc,qBAChB,CAAC,EAED,MAAMC,EAASD,EAAM,iBAAiB,YAAY,EAClD,GAAI,EAAEC,KAAU,6BACd,MAAM,IAAI,0BACR,kCAAkCD,EAAM,gBAAgB,EAC1D,EAEF,GAAIC,IAAW,YAWb,MAVA,sBAAmBD,EAAM,mBAAoB,CAC3C,MAAO,qBACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,cAAe,CACtC,MAAO,gBACP,cAAe,mBACjB,CAAC,EAGGA,EAAM,UAAY,OACpB,MAAM,IAAI,0BACR,yDACF,MAEG,CACL,GAAIA,EAAM,mBAAmB,SAAW,EACtC,MAAM,IAAI,0BACR,uCACF,EAEF,GAAIA,EAAM,cAAc,SAAW,EACjC,MAAM,IAAI,0BAAwB,kCAAkC,CAExE,CAEA,OAAIA,EAAM,UAAY,WACpB,mBAAgBA,EAAM,OAAO,KAG/B,sBAAmBA,EAAM,YAAa,CACpC,MAAO,cACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,UAAW,CAClC,MAAO,YACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,SAAU,CACjC,MAAO,WACP,cAAeD,CACjB,CAAC,EAEM,IACT,OAASG,EAAO,CACd,GAAIA,aAAiB,0BACnB,OAAOA,EAET,MAAMA,CACR,CACF",
6
- "names": ["validateEditExternalAddressIdentifierInput_exports", "__export", "validateEditExternalAddressIdentifierInput", "__toCommonJS", "import_contactsConstants", "import_contactsValidation", "HMAC_REST_LENGTH", "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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gDAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EASO,yDAGP,MAAMC,EAAmB,oBAOlB,SAASH,EACdI,EACgC,CAChC,GAAI,CACF,mCAAuBA,EAAM,YAAa,CACxC,MAAO,cACP,aAAc,4BAChB,CAAC,KACD,0BAAuBA,EAAM,MAAO,CAClC,MAAO,QACP,aAAc,qBAChB,CAAC,KAED,6BAA0B,CACxB,iBAAkBA,EAAM,iBACxB,YAAa,CACX,CAAE,MAAO,qBAAsB,MAAOA,EAAM,kBAAmB,EAC/D,CAAE,MAAO,gBAAiB,MAAOA,EAAM,aAAc,CACvD,EACA,QAASA,EAAM,OACjB,CAAC,KAED,sBAAmBA,EAAM,YAAa,CACpC,MAAO,cACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,UAAW,CAClC,MAAO,YACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,SAAU,CACjC,MAAO,WACP,cAAeD,CACjB,CAAC,EAEM,IACT,OAASE,EAAO,CACd,GAAIA,aAAiB,0BACnB,OAAOA,EAET,MAAMA,CACR,CACF",
6
+ "names": ["validateEditExternalAddressIdentifierInput_exports", "__export", "validateEditExternalAddressIdentifierInput", "__toCommonJS", "import_contactsValidation", "HMAC_REST_LENGTH", "input", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var h=(t,r)=>{for(var o in r)a(t,o,{get:r[o],enumerable:!0})},s=(t,r,o,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of f(r))!l.call(t,i)&&i!==o&&a(t,i,{get:()=>r[i],enumerable:!(d=c(r,i))||d.enumerable});return t};var E=t=>s(a({},"__esModule",{value:!0}),t);var p={};h(p,{validateEditExternalAddressScopeInput:()=>_});module.exports=E(p);var n=require("../../../app-binder/model/contactsConstants"),e=require("../../../app-binder/model/contactsValidation");const m=e.HMAC_PROOF_LENGTH;function _(t){try{(0,e.validatePrintableLabel)(t.contactName,{field:"contactName",bufferLength:e.CONTACT_NAME_BUFFER_LENGTH}),(0,e.validatePrintableLabel)(t.previousScope,{field:"previousScope",bufferLength:e.SCOPE_BUFFER_LENGTH}),(0,e.validatePrintableLabel)(t.newScope,{field:"newScope",bufferLength:e.SCOPE_BUFFER_LENGTH});const r=t.blockchainFamily.toLowerCase();if(!(r in n.BLOCKCHAIN_FAMILY_BY_NAME))throw new e.ContactsValidationError(`Unsupported blockchain family: ${t.blockchainFamily}`);if(r==="ethereum"){if((0,e.validateByteLength)(t.identifier,{field:"identifier",expectedBytes:e.ETH_ADDRESS_BYTES}),t.chainId===void 0)throw new e.ContactsValidationError("chainId is required for the Ethereum blockchain family.")}else if(t.identifier.length===0)throw new e.ContactsValidationError("identifier must not be empty.");return t.chainId!==void 0&&(0,e.validateChainId)(t.chainId),(0,e.validateByteLength)(t.groupHandle,{field:"groupHandle",expectedBytes:e.GROUP_HANDLE_SIZE}),(0,e.validateByteLength)(t.hmacProof,{field:"hmacProof",expectedBytes:e.HMAC_PROOF_LENGTH}),(0,e.validateByteLength)(t.hmacRest,{field:"hmacRest",expectedBytes:m}),null}catch(r){if(r instanceof e.ContactsValidationError)return r;throw r}}0&&(module.exports={validateEditExternalAddressScopeInput});
1
+ "use strict";var o=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var f=(t,r)=>{for(var i in r)o(t,i,{get:r[i],enumerable:!0})},s=(t,r,i,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of l(r))!n.call(t,a)&&a!==i&&o(t,a,{get:()=>r[a],enumerable:!(d=c(r,a))||d.enumerable});return t};var E=t=>s(o({},"__esModule",{value:!0}),t);var p={};f(p,{validateEditExternalAddressScopeInput:()=>m});module.exports=E(p);var e=require("../../../app-binder/model/contactsValidation");const h=e.HMAC_PROOF_LENGTH;function m(t){try{return(0,e.validatePrintableLabel)(t.contactName,{field:"contactName",bufferLength:e.CONTACT_NAME_BUFFER_LENGTH}),(0,e.validatePrintableLabel)(t.previousScope,{field:"previousScope",bufferLength:e.SCOPE_BUFFER_LENGTH}),(0,e.validatePrintableLabel)(t.newScope,{field:"newScope",bufferLength:e.SCOPE_BUFFER_LENGTH}),(0,e.validateFamilyIdentifiers)({blockchainFamily:t.blockchainFamily,identifiers:[{field:"identifier",value:t.identifier}],chainId:t.chainId}),(0,e.validateByteLength)(t.groupHandle,{field:"groupHandle",expectedBytes:e.GROUP_HANDLE_SIZE}),(0,e.validateByteLength)(t.hmacProof,{field:"hmacProof",expectedBytes:e.HMAC_PROOF_LENGTH}),(0,e.validateByteLength)(t.hmacRest,{field:"hmacRest",expectedBytes:h}),null}catch(r){if(r instanceof e.ContactsValidationError)return r;throw r}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA0C,wDAC1CC,EAUO,yDAGP,MAAMC,EAAmB,oBAOlB,SAASJ,EACdK,EACgC,CAChC,GAAI,IACF,0BAAuBA,EAAM,YAAa,CACxC,MAAO,cACP,aAAc,4BAChB,CAAC,KACD,0BAAuBA,EAAM,cAAe,CAC1C,MAAO,gBACP,aAAc,qBAChB,CAAC,KACD,0BAAuBA,EAAM,SAAU,CACrC,MAAO,WACP,aAAc,qBAChB,CAAC,EAED,MAAMC,EAASD,EAAM,iBAAiB,YAAY,EAClD,GAAI,EAAEC,KAAU,6BACd,MAAM,IAAI,0BACR,kCAAkCD,EAAM,gBAAgB,EAC1D,EAEF,GAAIC,IAAW,YAOb,MANA,sBAAmBD,EAAM,WAAY,CACnC,MAAO,aACP,cAAe,mBACjB,CAAC,EAGGA,EAAM,UAAY,OACpB,MAAM,IAAI,0BACR,yDACF,UAGEA,EAAM,WAAW,SAAW,EAC9B,MAAM,IAAI,0BAAwB,+BAA+B,EAIrE,OAAIA,EAAM,UAAY,WACpB,mBAAgBA,EAAM,OAAO,KAG/B,sBAAmBA,EAAM,YAAa,CACpC,MAAO,cACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,UAAW,CAClC,MAAO,YACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,SAAU,CACjC,MAAO,WACP,cAAeD,CACjB,CAAC,EAEM,IACT,OAASG,EAAO,CACd,GAAIA,aAAiB,0BACnB,OAAOA,EAET,MAAMA,CACR,CACF",
6
- "names": ["validateEditExternalAddressScopeInput_exports", "__export", "validateEditExternalAddressScopeInput", "__toCommonJS", "import_contactsConstants", "import_contactsValidation", "HMAC_REST_LENGTH", "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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EASO,yDAGP,MAAMC,EAAmB,oBAOlB,SAASH,EACdI,EACgC,CAChC,GAAI,CACF,mCAAuBA,EAAM,YAAa,CACxC,MAAO,cACP,aAAc,4BAChB,CAAC,KACD,0BAAuBA,EAAM,cAAe,CAC1C,MAAO,gBACP,aAAc,qBAChB,CAAC,KACD,0BAAuBA,EAAM,SAAU,CACrC,MAAO,WACP,aAAc,qBAChB,CAAC,KAED,6BAA0B,CACxB,iBAAkBA,EAAM,iBACxB,YAAa,CAAC,CAAE,MAAO,aAAc,MAAOA,EAAM,UAAW,CAAC,EAC9D,QAASA,EAAM,OACjB,CAAC,KAED,sBAAmBA,EAAM,YAAa,CACpC,MAAO,cACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,UAAW,CAClC,MAAO,YACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,SAAU,CACjC,MAAO,WACP,cAAeD,CACjB,CAAC,EAEM,IACT,OAASE,EAAO,CACd,GAAIA,aAAiB,0BACnB,OAAOA,EAET,MAAMA,CACR,CACF",
6
+ "names": ["validateEditExternalAddressScopeInput_exports", "__export", "validateEditExternalAddressScopeInput", "__toCommonJS", "import_contactsValidation", "HMAC_REST_LENGTH", "input", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var s=(t,i)=>{for(var n in i)o(t,n,{get:i[n],enumerable:!0})},h=(t,i,n,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of f(i))!l.call(t,r)&&r!==n&&o(t,r,{get:()=>i[r],enumerable:!(a=c(i,r))||a.enumerable});return t};var m=t=>h(o({},"__esModule",{value:!0}),t);var C={};s(C,{validateRegisterExternalAddressInput:()=>E});module.exports=m(C);var d=require("../../../app-binder/model/contactsConstants"),e=require("../../../app-binder/model/contactsValidation");function E(t){try{(0,e.validatePrintableLabel)(t.contactName,{field:"contactName",bufferLength:e.CONTACT_NAME_BUFFER_LENGTH}),(0,e.validatePrintableLabel)(t.scope,{field:"scope",bufferLength:e.SCOPE_BUFFER_LENGTH});const i=t.blockchainFamily.toLowerCase();if(!(i in d.BLOCKCHAIN_FAMILY_BY_NAME))throw new e.ContactsValidationError(`Unsupported blockchain family: ${t.blockchainFamily}`);if(i==="ethereum"){if((0,e.validateByteLength)(t.identifier,{field:"identifier",expectedBytes:e.ETH_ADDRESS_BYTES}),t.chainId===void 0)throw new e.ContactsValidationError("chainId is required for the Ethereum blockchain family.")}else if(t.identifier.length===0)throw new e.ContactsValidationError("identifier must not be empty.");return t.chainId!==void 0&&(0,e.validateChainId)(t.chainId),t.existingContactGroup&&((0,e.validateByteLength)(t.existingContactGroup.groupHandle,{field:"existingContactGroup.groupHandle",expectedBytes:e.GROUP_HANDLE_SIZE}),(0,e.validateByteLength)(t.existingContactGroup.hmacProof,{field:"existingContactGroup.hmacProof",expectedBytes:e.HMAC_PROOF_LENGTH})),null}catch(i){if(i instanceof e.ContactsValidationError)return i;throw i}}0&&(module.exports={validateRegisterExternalAddressInput});
1
+ "use strict";var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var s=(t,r)=>{for(var a in r)n(t,a,{get:r[a],enumerable:!0})},f=(t,r,a,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of c(r))!d.call(t,i)&&i!==a&&n(t,i,{get:()=>r[i],enumerable:!(o=l(r,i))||o.enumerable});return t};var E=t=>f(n({},"__esModule",{value:!0}),t);var h={};s(h,{validateRegisterExternalAddressInput:()=>g});module.exports=E(h);var e=require("../../../app-binder/model/contactsValidation");function g(t){try{return(0,e.validatePrintableLabel)(t.contactName,{field:"contactName",bufferLength:e.CONTACT_NAME_BUFFER_LENGTH}),(0,e.validatePrintableLabel)(t.scope,{field:"scope",bufferLength:e.SCOPE_BUFFER_LENGTH}),(0,e.validateFamilyIdentifiers)({blockchainFamily:t.blockchainFamily,identifiers:[{field:"identifier",value:t.identifier}],chainId:t.chainId}),t.existingContactGroup&&((0,e.validateByteLength)(t.existingContactGroup.groupHandle,{field:"existingContactGroup.groupHandle",expectedBytes:e.GROUP_HANDLE_SIZE}),(0,e.validateByteLength)(t.existingContactGroup.hmacProof,{field:"existingContactGroup.hmacProof",expectedBytes:e.HMAC_PROOF_LENGTH})),null}catch(r){if(r instanceof e.ContactsValidationError)return r;throw r}}0&&(module.exports={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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA0C,wDAC1CC,EAUO,yDAUA,SAASH,EACdI,EACgC,CAChC,GAAI,IACF,0BAAuBA,EAAM,YAAa,CACxC,MAAO,cACP,aAAc,4BAChB,CAAC,KACD,0BAAuBA,EAAM,MAAO,CAClC,MAAO,QACP,aAAc,qBAChB,CAAC,EAED,MAAMC,EAASD,EAAM,iBAAiB,YAAY,EAClD,GAAI,EAAEC,KAAU,6BACd,MAAM,IAAI,0BACR,kCAAkCD,EAAM,gBAAgB,EAC1D,EAEF,GAAIC,IAAW,YAOb,MANA,sBAAmBD,EAAM,WAAY,CACnC,MAAO,aACP,cAAe,mBACjB,CAAC,EAGGA,EAAM,UAAY,OACpB,MAAM,IAAI,0BACR,yDACF,UAEOA,EAAM,WAAW,SAAW,EACrC,MAAM,IAAI,0BAAwB,+BAA+B,EAGnE,OAAIA,EAAM,UAAY,WACpB,mBAAgBA,EAAM,OAAO,EAG3BA,EAAM,0BACR,sBAAmBA,EAAM,qBAAqB,YAAa,CACzD,MAAO,mCACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,qBAAqB,UAAW,CACvD,MAAO,iCACP,cAAe,mBACjB,CAAC,GAGI,IACT,OAASE,EAAO,CACd,GAAIA,aAAiB,0BACnB,OAAOA,EAET,MAAMA,CACR,CACF",
6
- "names": ["validateRegisterExternalAddressInput_exports", "__export", "validateRegisterExternalAddressInput", "__toCommonJS", "import_contactsConstants", "import_contactsValidation", "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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0CAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EASO,yDAUA,SAASF,EACdG,EACgC,CAChC,GAAI,CACF,mCAAuBA,EAAM,YAAa,CACxC,MAAO,cACP,aAAc,4BAChB,CAAC,KACD,0BAAuBA,EAAM,MAAO,CAClC,MAAO,QACP,aAAc,qBAChB,CAAC,KAED,6BAA0B,CACxB,iBAAkBA,EAAM,iBACxB,YAAa,CAAC,CAAE,MAAO,aAAc,MAAOA,EAAM,UAAW,CAAC,EAC9D,QAASA,EAAM,OACjB,CAAC,EAEGA,EAAM,0BACR,sBAAmBA,EAAM,qBAAqB,YAAa,CACzD,MAAO,mCACP,cAAe,mBACjB,CAAC,KACD,sBAAmBA,EAAM,qBAAqB,UAAW,CACvD,MAAO,iCACP,cAAe,mBACjB,CAAC,GAGI,IACT,OAASC,EAAO,CACd,GAAIA,aAAiB,0BACnB,OAAOA,EAET,MAAMA,CACR,CACF",
6
+ "names": ["validateRegisterExternalAddressInput_exports", "__export", "validateRegisterExternalAddressInput", "__toCommonJS", "import_contactsValidation", "input", "error"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var b=(t,e)=>{for(var o in e)d(t,o,{get:e[o],enumerable:!0})},x=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of y(e))!w.call(t,n)&&n!==o&&d(t,n,{get:()=>e[n],enumerable:!(i=p(e,n))||i.enumerable});return t};var l=t=>x(d({},"__esModule",{value:!0}),t);var L={};b(L,{CONTACT_NAME_BUFFER_LENGTH:()=>$,ContactsValidationError:()=>r,ETH_ADDRESS_BYTES:()=>I,GROUP_HANDLE_SIZE:()=>N,HMAC_PROOF_LENGTH:()=>u,MAX_BIP32_DEPTH:()=>h,SCOPE_BUFFER_LENGTH:()=>E,validateByteLength:()=>T,validateChainId:()=>O,validateDerivationPath:()=>A,validatePrintableLabel:()=>P});module.exports=l(L);const $=33,E=33,N=64,u=32,h=10,I=20;class r extends Error{_tag="ContactsValidationError";originalError;constructor(e){super(e),this.name="ContactsValidationError"}}const S=32,_=126,B=new TextEncoder;function P(t,e){const{field:o,bufferLength:i}=e;if(!t)throw new r(`${o} must not be empty (firmware rejects empty strings).`);const n=B.encode(t),s=i-1;if(n.length>s)throw new r(`${o} ${JSON.stringify(t)} is too long: ${n.length} bytes encoded (max ${s}). The device buffer is ${i} bytes including the trailing NUL.`);const f=[];for(let c=0;c<n.length;c++){const a=n[c];(a<S||a>_)&&f.push(c)}if(f.length>0){const a=Array.from(new Set(f.map(g=>n[g]))).sort((g,m)=>g-m).map(g=>`0x${g.toString(16).padStart(2,"0")}`).join(", ");throw new r(`${o} ${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 T(t,e){const{field:o,expectedBytes:i}=e;if(t.length!==i)throw new r(`${o} is ${t.length} bytes, expected ${i}.`)}function A(t){if(!t)throw new r(`derivationPath must not be empty (e.g. "m/44'/60'/0'/0/0").`);const e=t.split("/"),o=e[0]==="m"||e[0]==="M"?e.slice(1):e;if(o.length===0)throw new r(`derivationPath ${JSON.stringify(t)} has no segments past 'm'.`);if(o.length>h)throw new r(`derivationPath ${JSON.stringify(t)} has ${o.length} segments (max ${h}). Firmware rejects deeper paths.`);for(const i of o){const n=i.endsWith("'")?i.slice(0,-1):i;if(!n||!/^\d+$/.test(n))throw new r(`derivationPath ${JSON.stringify(t)} segment ${JSON.stringify(i)} is not numeric. Use plain integers, optionally suffixed with ' for hardened.`);const s=Number(n);if(!Number.isSafeInteger(s)||s>=2147483648)throw new r(`derivationPath ${JSON.stringify(t)} segment ${JSON.stringify(i)} >= 2^31. Use the ' suffix for hardening rather than overflowing.`)}}function O(t){const e=typeof t=="number";if(!e&&!(typeof t=="bigint"))throw new r(`chainId must be number or bigint, got ${typeof t}.`);if(e&&!Number.isInteger(t))throw new r(`chainId must be an integer, got ${t}.`);const i=typeof t=="bigint"?t:BigInt(t);if(i<=0n)throw new r(`chainId must be positive, got ${t}.`);const n=(1n<<64n)-1n;if(i>n)throw new r(`chainId ${t} exceeds uint64 range (max ${n}).`)}0&&(module.exports={CONTACT_NAME_BUFFER_LENGTH,ContactsValidationError,ETH_ADDRESS_BYTES,GROUP_HANDLE_SIZE,HMAC_PROOF_LENGTH,MAX_BIP32_DEPTH,SCOPE_BUFFER_LENGTH,validateByteLength,validateChainId,validateDerivationPath,validatePrintableLabel});
1
+ "use strict";var h=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var E=(e,t)=>{for(var o in t)h(e,o,{get:t[o],enumerable:!0})},I=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of x(t))!$.call(e,i)&&i!==o&&h(e,i,{get:()=>t[i],enumerable:!(n=u(t,i))||n.enumerable});return e};var N=e=>I(h({},"__esModule",{value:!0}),e);var C={};E(C,{CONTACT_NAME_BUFFER_LENGTH:()=>S,ContactsValidationError:()=>r,ETH_ADDRESS_BYTES:()=>y,GROUP_HANDLE_SIZE:()=>B,HMAC_PROOF_LENGTH:()=>A,MAX_BIP32_DEPTH:()=>g,SCOPE_BUFFER_LENGTH:()=>_,SOLANA_ADDRESS_BYTES:()=>p,validateByteLength:()=>l,validateChainId:()=>w,validateDerivationPath:()=>F,validateFamilyIdentifiers:()=>v,validatePrintableLabel:()=>P});module.exports=N(C);var m=require("../../app-binder/model/contactsConstants");const S=33,_=33,B=64,A=32,g=10,y=20,p=32;class r extends Error{_tag="ContactsValidationError";originalError;constructor(t){super(t),this.name="ContactsValidationError"}}const T=32,L=126,O=new TextEncoder;function P(e,t){const{field:o,bufferLength:n}=t;if(!e)throw new r(`${o} must not be empty (firmware rejects empty strings).`);const i=O.encode(e),a=n-1;if(i.length>a)throw new r(`${o} ${JSON.stringify(e)} is too long: ${i.length} bytes encoded (max ${a}). The device buffer is ${n} bytes including the trailing NUL.`);const s=[];for(let f=0;f<i.length;f++){const c=i[f];(c<T||c>L)&&s.push(f)}if(s.length>0){const c=Array.from(new Set(s.map(d=>i[d]))).sort((d,b)=>d-b).map(d=>`0x${d.toString(16).padStart(2,"0")}`).join(", ");throw new r(`${o} ${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 l(e,t){const{field:o,expectedBytes:n}=t;if(e.length!==n)throw new r(`${o} is ${e.length} bytes, expected ${n}.`)}function F(e){if(!e)throw new r(`derivationPath must not be empty (e.g. "m/44'/60'/0'/0/0").`);const t=e.split("/"),o=t[0]==="m"||t[0]==="M"?t.slice(1):t;if(o.length===0)throw new r(`derivationPath ${JSON.stringify(e)} has no segments past 'm'.`);if(o.length>g)throw new r(`derivationPath ${JSON.stringify(e)} has ${o.length} segments (max ${g}). Firmware rejects deeper paths.`);for(const n of o){const i=n.endsWith("'")?n.slice(0,-1):n;if(!i||!/^\d+$/.test(i))throw new r(`derivationPath ${JSON.stringify(e)} segment ${JSON.stringify(n)} is not numeric. Use plain integers, optionally suffixed with ' for hardened.`);const a=Number(i);if(!Number.isSafeInteger(a)||a>=2147483648)throw new r(`derivationPath ${JSON.stringify(e)} segment ${JSON.stringify(n)} >= 2^31. Use the ' suffix for hardening rather than overflowing.`)}}function w(e){const t=typeof e=="number";if(!t&&!(typeof e=="bigint"))throw new r(`chainId must be number or bigint, got ${typeof e}.`);if(t&&!Number.isInteger(e))throw new r(`chainId must be an integer, got ${e}.`);const n=typeof e=="bigint"?e:BigInt(e);if(n<=0n)throw new r(`chainId must be positive, got ${e}.`);const i=(1n<<64n)-1n;if(n>i)throw new r(`chainId ${e} exceeds uint64 range (max ${i}).`)}function v(e){const{blockchainFamily:t,identifiers:o,chainId:n}=e,i=t.toLowerCase(),a=m.BLOCKCHAIN_FAMILY_BY_NAME[i];if(a===void 0)throw new r(`Unsupported blockchain family: ${t}`);if(i==="ethereum"){for(const{field:s,value:f}of o)l(f,{field:s,expectedBytes:y});if(n===void 0)throw new r("chainId is required for the Ethereum blockchain family.")}else if(i==="solana"){for(const{field:s,value:f}of o)l(f,{field:s,expectedBytes:p});if(n!==void 0)throw new r("chainId is not allowed for the Solana blockchain family.")}else for(const{field:s,value:f}of o)if(f.length===0)throw new r(`${s} must not be empty.`);return n!==void 0&&w(n),a}0&&(module.exports={CONTACT_NAME_BUFFER_LENGTH,ContactsValidationError,ETH_ADDRESS_BYTES,GROUP_HANDLE_SIZE,HMAC_PROOF_LENGTH,MAX_BIP32_DEPTH,SCOPE_BUFFER_LENGTH,SOLANA_ADDRESS_BYTES,validateByteLength,validateChainId,validateDerivationPath,validateFamilyIdentifiers,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,4BAAAC,EAAA,sBAAAC,EAAA,sBAAAC,EAAA,sBAAAC,EAAA,oBAAAC,EAAA,wBAAAC,EAAA,uBAAAC,EAAA,oBAAAC,EAAA,2BAAAC,EAAA,2BAAAC,IAAA,eAAAC,EAAAb,GAcO,MAAME,EAA6B,GAC7BM,EAAsB,GACtBH,EAAoB,GACpBC,EAAoB,GACpBC,EAAkB,GAClBH,EAAoB,GAU1B,MAAMD,UAAgC,KAA0B,CAC5D,KAAO,0BACP,cACT,YAAYW,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,KAAO,yBACd,CACF,CAIA,MAAMC,EAAgB,GAChBC,EAAgB,IAEhBC,EAAc,IAAI,YAOjB,SAASL,EACdM,EACAC,EACM,CACN,KAAM,CAAE,MAAAC,EAAO,aAAAC,CAAa,EAAIF,EAChC,GAAI,CAACD,EACH,MAAM,IAAIf,EACR,GAAGiB,CAAK,sDACV,EAEF,MAAME,EAAUL,EAAY,OAAOC,CAAK,EAClCK,EAAWF,EAAe,EAChC,GAAIC,EAAQ,OAASC,EACnB,MAAM,IAAIpB,EACR,GAAGiB,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,EAAOX,GAAiBW,EAAOV,IACjCQ,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,KAAKA,EAAE,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,CAAC,EAAE,EACjD,KAAK,IAAI,EACZ,MAAM,IAAI1B,EACR,GAAGiB,CAAK,IAAI,KAAK,UAAUF,CAAK,CAAC,aAAaM,EAAa,MAAM,sCAC1BA,EAAa,KAAK,IAAI,CAAC,MACzDG,CAAY,6GAEnB,CACF,CACF,CAKO,SAASlB,EACdS,EACAC,EACM,CACN,KAAM,CAAE,MAAAC,EAAO,cAAAU,CAAc,EAAIX,EACjC,GAAID,EAAM,SAAWY,EACnB,MAAM,IAAI3B,EACR,GAAGiB,CAAK,OAAOF,EAAM,MAAM,oBAAoBY,CAAa,GAC9D,CAEJ,CASO,SAASnB,EAAuBoB,EAAoB,CACzD,GAAI,CAACA,EACH,MAAM,IAAI5B,EACR,6DACF,EAEF,MAAM6B,EAAQD,EAAK,MAAM,GAAG,EACtBE,EACJD,EAAM,CAAC,IAAM,KAAOA,EAAM,CAAC,IAAM,IAAMA,EAAM,MAAM,CAAC,EAAIA,EAC1D,GAAIC,EAAS,SAAW,EACtB,MAAM,IAAI9B,EACR,kBAAkB,KAAK,UAAU4B,CAAI,CAAC,4BACxC,EAEF,GAAIE,EAAS,OAAS1B,EACpB,MAAM,IAAIJ,EACR,kBAAkB,KAAK,UAAU4B,CAAI,CAAC,QAAQE,EAAS,MAAM,kBACnD1B,CAAe,mCAC3B,EAEF,UAAW2B,KAAWD,EAAU,CAC9B,MAAME,EAAQD,EAAQ,SAAS,GAAG,EAAIA,EAAQ,MAAM,EAAG,EAAE,EAAIA,EAC7D,GAAI,CAACC,GAAS,CAAC,QAAQ,KAAKA,CAAK,EAC/B,MAAM,IAAIhC,EACR,kBAAkB,KAAK,UAAU4B,CAAI,CAAC,YAAY,KAAK,UAAUG,CAAO,CAAC,+EAE3E,EAEF,MAAME,EAAI,OAAOD,CAAK,EACtB,GAAI,CAAC,OAAO,cAAcC,CAAC,GAAKA,GAAK,WACnC,MAAM,IAAIjC,EACR,kBAAkB,KAAK,UAAU4B,CAAI,CAAC,YAAY,KAAK,UAAUG,CAAO,CAAC,mEAE3E,CAEJ,CACF,CAQO,SAASxB,EAAgBQ,EAA8B,CAC5D,MAAMmB,EAAW,OAAOnB,GAAU,SAElC,GAAI,CAACmB,GAAY,EADA,OAAOnB,GAAU,UAEhC,MAAM,IAAIf,EACR,yCAAyC,OAAOe,CAAK,GACvD,EAEF,GAAImB,GAAY,CAAC,OAAO,UAAUnB,CAAK,EACrC,MAAM,IAAIf,EACR,mCAAmCe,CAAK,GAC1C,EAEF,MAAMoB,EAAI,OAAOpB,GAAU,SAAWA,EAAQ,OAAOA,CAAK,EAC1D,GAAIoB,GAAK,GACP,MAAM,IAAInC,EACR,iCAAiCe,CAAK,GACxC,EAEF,MAAMqB,GAAc,IAAM,KAAO,GACjC,GAAID,EAAIC,EACN,MAAM,IAAIpC,EACR,WAAWe,CAAK,8BAA8BqB,CAAU,IAC1D,CAEJ",
6
- "names": ["contactsValidation_exports", "__export", "CONTACT_NAME_BUFFER_LENGTH", "ContactsValidationError", "ETH_ADDRESS_BYTES", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "MAX_BIP32_DEPTH", "SCOPE_BUFFER_LENGTH", "validateByteLength", "validateChainId", "validateDerivationPath", "validatePrintableLabel", "__toCommonJS", "message", "PRINTABLE_MIN", "PRINTABLE_MAX", "utf8Encoder", "value", "options", "field", "bufferLength", "encoded", "maxBytes", "badPositions", "i", "byte", "offendingHex", "a", "b", "expectedBytes", "path", "parts", "segments", "segment", "token", "n", "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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,4BAAAC,EAAA,sBAAAC,EAAA,sBAAAC,EAAA,sBAAAC,EAAA,oBAAAC,EAAA,wBAAAC,EAAA,yBAAAC,EAAA,uBAAAC,EAAA,oBAAAC,EAAA,2BAAAC,EAAA,8BAAAC,EAAA,2BAAAC,IAAA,eAAAC,EAAAf,GAWA,IAAAgB,EAA0C,wDAKnC,MAAMd,EAA6B,GAC7BM,EAAsB,GACtBH,EAAoB,GACpBC,EAAoB,GACpBC,EAAkB,GAClBH,EAAoB,GACpBK,EAAuB,GAU7B,MAAMN,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,SAASN,EACdO,EACAC,EACM,CACN,KAAM,CAAE,MAAAC,EAAO,aAAAC,CAAa,EAAIF,EAChC,GAAI,CAACD,EACH,MAAM,IAAIlB,EACR,GAAGoB,CAAK,sDACV,EAEF,MAAME,EAAUL,EAAY,OAAOC,CAAK,EAClCK,EAAWF,EAAe,EAChC,GAAIC,EAAQ,OAASC,EACnB,MAAM,IAAIvB,EACR,GAAGoB,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,EAAOX,GAAiBW,EAAOV,IACjCQ,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,EAAG,IAAMA,EAAI,CAAC,EAEnB,IAAKC,GAAM,KAAKA,EAAE,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,CAAC,EAAE,EACjD,KAAK,IAAI,EACZ,MAAM,IAAI7B,EACR,GAAGoB,CAAK,IAAI,KAAK,UAAUF,CAAK,CAAC,aAAaM,EAAa,MAAM,sCAC1BA,EAAa,KAAK,IAAI,CAAC,MACzDG,CAAY,6GAEnB,CACF,CACF,CAKO,SAASpB,EACdW,EACAC,EACM,CACN,KAAM,CAAE,MAAAC,EAAO,cAAAU,CAAc,EAAIX,EACjC,GAAID,EAAM,SAAWY,EACnB,MAAM,IAAI9B,EACR,GAAGoB,CAAK,OAAOF,EAAM,MAAM,oBAAoBY,CAAa,GAC9D,CAEJ,CASO,SAASrB,EAAuBsB,EAAoB,CACzD,GAAI,CAACA,EACH,MAAM,IAAI/B,EACR,6DACF,EAEF,MAAMgC,EAAQD,EAAK,MAAM,GAAG,EACtBE,EACJD,EAAM,CAAC,IAAM,KAAOA,EAAM,CAAC,IAAM,IAAMA,EAAM,MAAM,CAAC,EAAIA,EAC1D,GAAIC,EAAS,SAAW,EACtB,MAAM,IAAIjC,EACR,kBAAkB,KAAK,UAAU+B,CAAI,CAAC,4BACxC,EAEF,GAAIE,EAAS,OAAS7B,EACpB,MAAM,IAAIJ,EACR,kBAAkB,KAAK,UAAU+B,CAAI,CAAC,QAAQE,EAAS,MAAM,kBACnD7B,CAAe,mCAC3B,EAEF,UAAW8B,KAAWD,EAAU,CAC9B,MAAME,EAAQD,EAAQ,SAAS,GAAG,EAAIA,EAAQ,MAAM,EAAG,EAAE,EAAIA,EAC7D,GAAI,CAACC,GAAS,CAAC,QAAQ,KAAKA,CAAK,EAC/B,MAAM,IAAInC,EACR,kBAAkB,KAAK,UAAU+B,CAAI,CAAC,YAAY,KAAK,UAAUG,CAAO,CAAC,+EAE3E,EAEF,MAAME,EAAI,OAAOD,CAAK,EACtB,GAAI,CAAC,OAAO,cAAcC,CAAC,GAAKA,GAAK,WACnC,MAAM,IAAIpC,EACR,kBAAkB,KAAK,UAAU+B,CAAI,CAAC,YAAY,KAAK,UAAUG,CAAO,CAAC,mEAE3E,CAEJ,CACF,CAQO,SAAS1B,EAAgBU,EAA8B,CAC5D,MAAMmB,EAAW,OAAOnB,GAAU,SAElC,GAAI,CAACmB,GAAY,EADA,OAAOnB,GAAU,UAEhC,MAAM,IAAIlB,EACR,yCAAyC,OAAOkB,CAAK,GACvD,EAEF,GAAImB,GAAY,CAAC,OAAO,UAAUnB,CAAK,EACrC,MAAM,IAAIlB,EACR,mCAAmCkB,CAAK,GAC1C,EAEF,MAAMoB,EAAI,OAAOpB,GAAU,SAAWA,EAAQ,OAAOA,CAAK,EAC1D,GAAIoB,GAAK,GACP,MAAM,IAAItC,EACR,iCAAiCkB,CAAK,GACxC,EAEF,MAAMqB,GAAc,IAAM,KAAO,GACjC,GAAID,EAAIC,EACN,MAAM,IAAIvC,EACR,WAAWkB,CAAK,8BAA8BqB,CAAU,IAC1D,CAEJ,CAqBO,SAAS7B,EAA0BS,EAI/B,CACT,KAAM,CAAE,iBAAAqB,EAAkB,YAAAC,EAAa,QAAAC,CAAQ,EAAIvB,EAC7CwB,EAASH,EAAiB,YAAY,EACtCI,EAAa,4BAA0BD,CAAM,EACnD,GAAIC,IAAe,OACjB,MAAM,IAAI5C,EACR,kCAAkCwC,CAAgB,EACpD,EAGF,GAAIG,IAAW,WAAY,CACzB,SAAW,CAAE,MAAAvB,EAAO,MAAAF,CAAM,IAAKuB,EAC7BlC,EAAmBW,EAAO,CAAE,MAAAE,EAAO,cAAenB,CAAkB,CAAC,EAEvE,GAAIyC,IAAY,OACd,MAAM,IAAI1C,EACR,yDACF,CAEJ,SAAW2C,IAAW,SAAU,CAC9B,SAAW,CAAE,MAAAvB,EAAO,MAAAF,CAAM,IAAKuB,EAC7BlC,EAAmBW,EAAO,CAAE,MAAAE,EAAO,cAAed,CAAqB,CAAC,EAE1E,GAAIoC,IAAY,OACd,MAAM,IAAI1C,EACR,0DACF,CAEJ,KACE,UAAW,CAAE,MAAAoB,EAAO,MAAAF,CAAM,IAAKuB,EAC7B,GAAIvB,EAAM,SAAW,EACnB,MAAM,IAAIlB,EAAwB,GAAGoB,CAAK,qBAAqB,EAKrE,OAAIsB,IAAY,QACdlC,EAAgBkC,CAAO,EAGlBE,CACT",
6
+ "names": ["contactsValidation_exports", "__export", "CONTACT_NAME_BUFFER_LENGTH", "ContactsValidationError", "ETH_ADDRESS_BYTES", "GROUP_HANDLE_SIZE", "HMAC_PROOF_LENGTH", "MAX_BIP32_DEPTH", "SCOPE_BUFFER_LENGTH", "SOLANA_ADDRESS_BYTES", "validateByteLength", "validateChainId", "validateDerivationPath", "validateFamilyIdentifiers", "validatePrintableLabel", "__toCommonJS", "import_contactsConstants", "message", "PRINTABLE_MIN", "PRINTABLE_MAX", "utf8Encoder", "value", "options", "field", "bufferLength", "encoded", "maxBytes", "badPositions", "i", "byte", "offendingHex", "a", "b", "expectedBytes", "path", "parts", "segments", "segment", "token", "n", "isNumber", "v", "UINT64_MAX", "blockchainFamily", "identifiers", "chainId", "family", "familyByte"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var C=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var A=(e,a)=>{for(var r in a)C(e,r,{get:a[r],enumerable:!0})},P=(e,a,r,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of T(a))!s.call(e,t)&&t!==r&&C(e,t,{get:()=>a[t],enumerable:!(n=l(a,t))||n.enumerable});return e};var y=e=>P(C({},"__esModule",{value:!0}),e);var f={};A(f,{buildProvideContactPayload:()=>_,sendProvideContactPayload:()=>I});module.exports=y(f);var i=require("@ledgerhq/device-management-kit"),c=require("../../app-binder/command/ProvideContactCommand"),d=require("../../app-binder/model/contactsConstants"),o=require("../../app-binder/services/contactsTlvSerializer"),m=require("../../app-binder/services/sendFramedContactsPayload");function _(e){const a=d.BLOCKCHAIN_FAMILY_BY_NAME[e.blockchainFamily.toLowerCase()];if(a===void 0)throw new Error(`Unsupported blockchain family: ${e.blockchainFamily}`);const r=new i.ByteArrayBuilder;return(0,o.encodeTlvUInt8)(r,o.CONTACTS_TLV_TAG.STRUCT_TYPE,o.STRUCT_TYPE_PROVIDE_CONTACT),(0,o.encodeTlvUInt8)(r,o.CONTACTS_TLV_TAG.STRUCT_VERSION,o.STRUCT_VERSION_VALUE),(0,o.encodeTlvAscii)(r,o.CONTACTS_TLV_TAG.CONTACT_NAME,e.contactName),(0,o.encodeTlvAscii)(r,o.CONTACTS_TLV_TAG.SCOPE,e.scope),(0,o.encodeTlvBuffer)(r,o.CONTACTS_TLV_TAG.ACCOUNT_IDENTIFIER,e.identifier),(0,o.encodeTlvBuffer)(r,o.CONTACTS_TLV_TAG.GROUP_HANDLE,e.groupHandle),e.chainId!==void 0&&(0,o.encodeTlvChainId)(r,o.CONTACTS_TLV_TAG.CHAIN_ID,e.chainId),(0,o.encodeTlvUInt8)(r,o.CONTACTS_TLV_TAG.BLOCKCHAIN_FAMILY,a),(0,o.encodeTlvBuffer)(r,o.CONTACTS_TLV_TAG.HMAC_PROOF,e.hmacProof),(0,o.encodeTlvBuffer)(r,o.CONTACTS_TLV_TAG.HMAC_REST,e.hmacRest),r.build()}function I(e,{payload:a,logger:r}){return(0,m.sendFramedContactsPayload)(e,{payload:a,p1:d.SUB_CMD_PROVIDE_CONTACT,makeCommand:(n,t)=>new c.ProvideContactCommand({data:n,p2:t}),logger:r,commandTag:"provideContact"})}0&&(module.exports={buildProvideContactPayload,sendProvideContactPayload});
1
+ "use strict";var i=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var f=(e,a)=>{for(var r in a)i(e,r,{get:a[r],enumerable:!0})},y=(e,a,r,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of s(a))!P.call(e,t)&&t!==r&&i(e,t,{get:()=>a[t],enumerable:!(d=T(a,t))||d.enumerable});return e};var A=e=>y(i({},"__esModule",{value:!0}),e);var v={};f(v,{buildProvideContactPayload:()=>I,sendProvideContactPayload:()=>_});module.exports=A(v);var n=require("@ledgerhq/device-management-kit"),C=require("../../app-binder/command/ProvideContactCommand"),m=require("../../app-binder/model/contactsConstants"),c=require("../../app-binder/model/contactsValidation"),o=require("../../app-binder/services/contactsTlvSerializer"),l=require("../../app-binder/services/sendFramedContactsPayload");function I(e){const a=(0,c.validateFamilyIdentifiers)({blockchainFamily:e.blockchainFamily,identifiers:[{field:"identifier",value:e.identifier}],chainId:e.chainId}),r=new n.ByteArrayBuilder;return(0,o.encodeTlvUInt8)(r,o.CONTACTS_TLV_TAG.STRUCT_TYPE,o.STRUCT_TYPE_PROVIDE_CONTACT),(0,o.encodeTlvUInt8)(r,o.CONTACTS_TLV_TAG.STRUCT_VERSION,o.STRUCT_VERSION_VALUE),(0,o.encodeTlvAscii)(r,o.CONTACTS_TLV_TAG.CONTACT_NAME,e.contactName),(0,o.encodeTlvAscii)(r,o.CONTACTS_TLV_TAG.SCOPE,e.scope),(0,o.encodeTlvBuffer)(r,o.CONTACTS_TLV_TAG.ACCOUNT_IDENTIFIER,e.identifier),(0,o.encodeTlvBuffer)(r,o.CONTACTS_TLV_TAG.GROUP_HANDLE,e.groupHandle),e.chainId!==void 0&&(0,o.encodeTlvChainId)(r,o.CONTACTS_TLV_TAG.CHAIN_ID,e.chainId),(0,o.encodeTlvUInt8)(r,o.CONTACTS_TLV_TAG.BLOCKCHAIN_FAMILY,a),(0,o.encodeTlvBuffer)(r,o.CONTACTS_TLV_TAG.HMAC_PROOF,e.hmacProof),(0,o.encodeTlvBuffer)(r,o.CONTACTS_TLV_TAG.HMAC_REST,e.hmacRest),r.build()}function _(e,{payload:a,logger:r}){return(0,l.sendFramedContactsPayload)(e,{payload:a,p1:m.SUB_CMD_PROVIDE_CONTACT,makeCommand:(d,t)=>new C.ProvideContactCommand({data:d,p2:t}),logger:r,commandTag:"provideContact"})}0&&(module.exports={buildProvideContactPayload,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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,8BAAAC,IAAA,eAAAC,EAAAJ,GASA,IAAAK,EAKO,2CAGPC,EAAsC,8DACtCC,EAGO,wDAEPC,EAQO,+DACPC,EAA0C,mEAOnC,SAASP,EACdQ,EACY,CACZ,MAAMC,EACJ,4BAA0BD,EAAM,iBAAiB,YAAY,CAAC,EAChE,GAAIC,IAAW,OACb,MAAM,IAAI,MAAM,kCAAkCD,EAAM,gBAAgB,EAAE,EAG5E,MAAME,EAAU,IAAI,mBACpB,2BACEA,EACA,mBAAiB,YACjB,6BACF,KACA,kBACEA,EACA,mBAAiB,eACjB,sBACF,KACA,kBAAeA,EAAS,mBAAiB,aAAcF,EAAM,WAAW,KACxE,kBAAeE,EAAS,mBAAiB,MAAOF,EAAM,KAAK,KAC3D,mBACEE,EACA,mBAAiB,mBACjBF,EAAM,UACR,KACA,mBAAgBE,EAAS,mBAAiB,aAAcF,EAAM,WAAW,EACrEA,EAAM,UAAY,WACpB,oBAAiBE,EAAS,mBAAiB,SAAUF,EAAM,OAAO,KAEpE,kBAAeE,EAAS,mBAAiB,kBAAmBD,CAAM,KAClE,mBAAgBC,EAAS,mBAAiB,WAAYF,EAAM,SAAS,KACrE,mBAAgBE,EAAS,mBAAiB,UAAWF,EAAM,QAAQ,EAE5DE,EAAQ,MAAM,CACvB,CAOO,SAAST,EACdU,EACA,CAAE,QAAAC,EAAS,OAAAC,CAAO,EACgC,CAClD,SAAO,6BAA0BF,EAAK,CACpC,QAAAC,EACA,GAAI,0BACJ,YAAa,CAACE,EAAOC,IAAO,IAAI,wBAAsB,CAAE,KAAMD,EAAO,GAAAC,CAAG,CAAC,EACzE,OAAAF,EACA,WAAY,gBACd,CAAC,CACH",
6
- "names": ["provideContact_exports", "__export", "buildProvideContactPayload", "sendProvideContactPayload", "__toCommonJS", "import_device_management_kit", "import_ProvideContactCommand", "import_contactsConstants", "import_contactsTlvSerializer", "import_sendFramedContactsPayload", "input", "family", "builder", "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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gCAAAE,EAAA,8BAAAC,IAAA,eAAAC,EAAAJ,GASA,IAAAK,EAKO,2CAGPC,EAAsC,8DACtCC,EAAwC,wDAExCC,EAA0C,yDAC1CC,EAQO,+DACPC,EAA0C,mEAOnC,SAASR,EACdS,EACY,CACZ,MAAMC,KAAS,6BAA0B,CACvC,iBAAkBD,EAAM,iBACxB,YAAa,CAAC,CAAE,MAAO,aAAc,MAAOA,EAAM,UAAW,CAAC,EAC9D,QAASA,EAAM,OACjB,CAAC,EAEKE,EAAU,IAAI,mBACpB,2BACEA,EACA,mBAAiB,YACjB,6BACF,KACA,kBACEA,EACA,mBAAiB,eACjB,sBACF,KACA,kBAAeA,EAAS,mBAAiB,aAAcF,EAAM,WAAW,KACxE,kBAAeE,EAAS,mBAAiB,MAAOF,EAAM,KAAK,KAC3D,mBACEE,EACA,mBAAiB,mBACjBF,EAAM,UACR,KACA,mBAAgBE,EAAS,mBAAiB,aAAcF,EAAM,WAAW,EACrEA,EAAM,UAAY,WACpB,oBAAiBE,EAAS,mBAAiB,SAAUF,EAAM,OAAO,KAEpE,kBAAeE,EAAS,mBAAiB,kBAAmBD,CAAM,KAClE,mBAAgBC,EAAS,mBAAiB,WAAYF,EAAM,SAAS,KACrE,mBAAgBE,EAAS,mBAAiB,UAAWF,EAAM,QAAQ,EAE5DE,EAAQ,MAAM,CACvB,CAOO,SAASV,EACdW,EACA,CAAE,QAAAC,EAAS,OAAAC,CAAO,EACgC,CAClD,SAAO,6BAA0BF,EAAK,CACpC,QAAAC,EACA,GAAI,0BACJ,YAAa,CAACE,EAAOC,IAAO,IAAI,wBAAsB,CAAE,KAAMD,EAAO,GAAAC,CAAG,CAAC,EACzE,OAAAF,EACA,WAAY,gBACd,CAAC,CACH",
6
+ "names": ["provideContact_exports", "__export", "buildProvideContactPayload", "sendProvideContactPayload", "__toCommonJS", "import_device_management_kit", "import_ProvideContactCommand", "import_contactsConstants", "import_contactsValidation", "import_contactsTlvSerializer", "import_sendFramedContactsPayload", "input", "family", "builder", "api", "payload", "logger", "chunk", "p2"]
7
7
  }
@@ -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.0.0-mockserver-react-20260929124741"
61
+ "version": "0.0.0-same-usb-id-20261126151637"
62
62
  }
@@ -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,TRON_APP_NAME as a}from"./model/ContactsVersionRequirements";import{buildProvideContactPayload as A,sendProvideContactPayload as E}from"../internal/app-binder/services/provideContact";export{n as CONTACTS_VERSION_REQUIREMENTS,r as ContactsManagerBuilder,p as ETHEREUM_APP_NAME,a as TRON_APP_NAME,A as buildProvideContactPayload,o as isVersionAtLeast,s as resolveContactsVersionRequirements,E 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 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,iBAAAC,MACK,yCAqBP,OACE,8BAAAC,EACA,6BAAAC,MAEK",
6
- "names": ["ContactsManagerBuilder", "CONTACTS_VERSION_REQUIREMENTS", "ETHEREUM_APP_NAME", "isVersionAtLeast", "resolveContactsVersionRequirements", "TRON_APP_NAME", "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 p,gte as N,lt as O,valid as i}from"semver";const R="Ethereum",A="Tron",E={supported:!1},a="1.11.0",u="1.7.0",c="1.2.0",_="2.8.0",d="1.7.0",V="1.23.0",m="0.8.0",s={[R]:V,[A]:m},P=`${a}-rc3`,M=`${u}-rc3`,S=`${c}-rc3`,I=`${_}-rc3`,T=`${d}-rc3`,l={[r.NANO_S]:E,[r.NANO_SP]:{supported:!0,minOsVersion:d,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:T},[r.NANO_X]:{supported:!0,minOsVersion:_,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:I},[r.STAX]:{supported:!0,minOsVersion:a,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:P},[r.FLEX]:{supported:!0,minOsVersion:u,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:M},[r.APEX]:{supported:!0,minOsVersion:c,minAppVersion:s,renameDerivationPathRequiredBelowOsVersion:S}};function v(o){return l[o]}function D(o,t){const e=i(p(o)),n=i(p(t));return e===null||n===null?!1:N(e,n)}function f(o,t){const e=i(o),n=i(t);return e===null||n===null?!1:O(e,n)}function F(o,t){const e=l[o];if(!e.supported)return!1;const n=e.renameDerivationPathRequiredBelowOsVersion;return n===void 0?!1:f(t,n)}export{l as CONTACTS_VERSION_REQUIREMENTS,R as ETHEREUM_APP_NAME,A as TRON_APP_NAME,D as isVersionAtLeast,f as isVersionBelow,F as renameRequiresDerivationPath,v 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