@metamask/profile-sync-controller 29.0.0 → 31.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/dist/controllers/authentication/{AuthenticationController-method-action-types.d.mts → AuthenticationController-method-action-types.d.ts} +2 -2
  3. package/dist/controllers/authentication/AuthenticationController-method-action-types.d.ts.map +1 -0
  4. package/dist/controllers/authentication/{AuthenticationController-method-action-types.mjs → AuthenticationController-method-action-types.js} +1 -1
  5. package/dist/controllers/authentication/AuthenticationController-method-action-types.js.map +1 -0
  6. package/dist/controllers/authentication/{AuthenticationController.d.mts → AuthenticationController.d.ts} +30 -12
  7. package/dist/controllers/authentication/AuthenticationController.d.ts.map +1 -0
  8. package/dist/controllers/authentication/AuthenticationController.js +656 -0
  9. package/dist/controllers/authentication/AuthenticationController.js.map +1 -0
  10. package/dist/controllers/authentication/{index.d.cts → index.d.ts} +5 -5
  11. package/dist/controllers/authentication/index.d.ts.map +1 -0
  12. package/dist/controllers/authentication/index.js +6 -0
  13. package/dist/controllers/authentication/index.js.map +1 -0
  14. package/dist/controllers/authentication/mocks/index.d.ts +2 -0
  15. package/dist/controllers/authentication/mocks/index.d.ts.map +1 -0
  16. package/dist/controllers/authentication/mocks/index.js +2 -0
  17. package/dist/controllers/authentication/mocks/index.js.map +1 -0
  18. package/dist/controllers/authentication/mocks/{mockResponses.d.cts → mockResponses.d.ts} +12 -1
  19. package/dist/controllers/authentication/mocks/{mockResponses.d.cts.map → mockResponses.d.ts.map} +1 -1
  20. package/dist/controllers/authentication/mocks/{mockResponses.mjs → mockResponses.js} +10 -2
  21. package/dist/controllers/authentication/mocks/mockResponses.js.map +1 -0
  22. package/dist/controllers/index.d.ts +3 -0
  23. package/dist/controllers/index.d.ts.map +1 -0
  24. package/dist/controllers/index.js +3 -0
  25. package/dist/controllers/index.js.map +1 -0
  26. package/dist/controllers/user-storage/{UserStorageController-method-action-types.d.mts → UserStorageController-method-action-types.d.ts} +2 -2
  27. package/dist/controllers/user-storage/UserStorageController-method-action-types.d.ts.map +1 -0
  28. package/dist/controllers/user-storage/{UserStorageController-method-action-types.mjs → UserStorageController-method-action-types.js} +1 -1
  29. package/dist/controllers/user-storage/UserStorageController-method-action-types.js.map +1 -0
  30. package/dist/controllers/user-storage/{UserStorageController.d.cts → UserStorageController.d.ts} +15 -16
  31. package/dist/controllers/user-storage/UserStorageController.d.ts.map +1 -0
  32. package/dist/controllers/user-storage/UserStorageController.js +429 -0
  33. package/dist/controllers/user-storage/UserStorageController.js.map +1 -0
  34. package/dist/controllers/user-storage/constants.d.ts +15 -0
  35. package/dist/controllers/user-storage/constants.d.ts.map +1 -0
  36. package/dist/controllers/user-storage/{constants.mjs → constants.js} +1 -1
  37. package/dist/controllers/user-storage/constants.js.map +1 -0
  38. package/dist/controllers/user-storage/contact-syncing/{constants.d.cts → constants.d.ts} +1 -1
  39. package/dist/controllers/user-storage/contact-syncing/constants.d.ts.map +1 -0
  40. package/dist/controllers/user-storage/contact-syncing/{constants.mjs → constants.js} +1 -1
  41. package/dist/controllers/user-storage/contact-syncing/constants.js.map +1 -0
  42. package/dist/controllers/user-storage/contact-syncing/{controller-integration.d.cts → controller-integration.d.ts} +3 -3
  43. package/dist/controllers/user-storage/contact-syncing/controller-integration.d.ts.map +1 -0
  44. package/dist/controllers/user-storage/contact-syncing/{controller-integration.mjs → controller-integration.js} +6 -6
  45. package/dist/controllers/user-storage/contact-syncing/controller-integration.js.map +1 -0
  46. package/dist/controllers/user-storage/contact-syncing/{setup-subscriptions.d.cts → setup-subscriptions.d.ts} +2 -2
  47. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.d.ts.map +1 -0
  48. package/dist/controllers/user-storage/contact-syncing/{setup-subscriptions.mjs → setup-subscriptions.js} +4 -4
  49. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.js.map +1 -0
  50. package/dist/controllers/user-storage/contact-syncing/{sync-utils.d.cts → sync-utils.d.ts} +2 -2
  51. package/dist/controllers/user-storage/contact-syncing/sync-utils.d.ts.map +1 -0
  52. package/dist/controllers/user-storage/contact-syncing/{sync-utils.mjs → sync-utils.js} +1 -1
  53. package/dist/controllers/user-storage/contact-syncing/sync-utils.js.map +1 -0
  54. package/dist/controllers/user-storage/contact-syncing/{types.d.cts → types.d.ts} +6 -6
  55. package/dist/controllers/user-storage/contact-syncing/types.d.ts.map +1 -0
  56. package/dist/controllers/user-storage/contact-syncing/types.js +2 -0
  57. package/dist/controllers/user-storage/contact-syncing/types.js.map +1 -0
  58. package/dist/controllers/user-storage/contact-syncing/{utils.d.cts → utils.d.ts} +3 -3
  59. package/dist/controllers/user-storage/contact-syncing/utils.d.ts.map +1 -0
  60. package/dist/controllers/user-storage/contact-syncing/{utils.mjs → utils.js} +2 -2
  61. package/dist/controllers/user-storage/contact-syncing/utils.js.map +1 -0
  62. package/dist/controllers/user-storage/{index.d.cts → index.d.ts} +8 -8
  63. package/dist/controllers/user-storage/index.d.ts.map +1 -0
  64. package/dist/controllers/user-storage/index.js +9 -0
  65. package/dist/controllers/user-storage/index.js.map +1 -0
  66. package/dist/controllers/user-storage/mocks/index.d.ts +3 -0
  67. package/dist/controllers/user-storage/mocks/index.d.ts.map +1 -0
  68. package/dist/controllers/user-storage/mocks/index.js +3 -0
  69. package/dist/controllers/user-storage/mocks/index.js.map +1 -0
  70. package/dist/controllers/user-storage/mocks/{mockResponses.d.mts → mockResponses.d.ts} +3 -3
  71. package/dist/controllers/user-storage/mocks/mockResponses.d.ts.map +1 -0
  72. package/dist/controllers/user-storage/mocks/{mockResponses.mjs → mockResponses.js} +4 -4
  73. package/dist/controllers/user-storage/mocks/mockResponses.js.map +1 -0
  74. package/dist/controllers/user-storage/mocks/{mockStorage.d.cts → mockStorage.d.ts} +1 -1
  75. package/dist/controllers/user-storage/mocks/mockStorage.d.ts.map +1 -0
  76. package/dist/controllers/user-storage/mocks/{mockStorage.mjs → mockStorage.js} +3 -3
  77. package/dist/controllers/user-storage/mocks/mockStorage.js.map +1 -0
  78. package/dist/controllers/user-storage/{types.d.cts → types.d.ts} +3 -3
  79. package/dist/controllers/user-storage/types.d.ts.map +1 -0
  80. package/dist/controllers/user-storage/types.js +2 -0
  81. package/dist/controllers/user-storage/types.js.map +1 -0
  82. package/dist/controllers/user-storage/{utils.d.cts → utils.d.ts} +1 -1
  83. package/dist/controllers/user-storage/utils.d.ts.map +1 -0
  84. package/dist/controllers/user-storage/{utils.mjs → utils.js} +1 -1
  85. package/dist/controllers/user-storage/utils.js.map +1 -0
  86. package/dist/index.d.ts +4 -0
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +4 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/sdk/authentication-jwt-bearer/{flow-siwe.d.cts → flow-siwe.d.ts} +2 -2
  91. package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.ts.map +1 -0
  92. package/dist/sdk/authentication-jwt-bearer/flow-siwe.js +99 -0
  93. package/dist/sdk/authentication-jwt-bearer/flow-siwe.js.map +1 -0
  94. package/dist/sdk/authentication-jwt-bearer/{flow-srp.d.mts → flow-srp.d.ts} +6 -5
  95. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.ts.map +1 -0
  96. package/dist/sdk/authentication-jwt-bearer/flow-srp.js +258 -0
  97. package/dist/sdk/authentication-jwt-bearer/flow-srp.js.map +1 -0
  98. package/dist/sdk/authentication-jwt-bearer/{services.d.mts → services.d.ts} +20 -5
  99. package/dist/sdk/authentication-jwt-bearer/services.d.ts.map +1 -0
  100. package/dist/sdk/authentication-jwt-bearer/{services.mjs → services.js} +47 -6
  101. package/dist/sdk/authentication-jwt-bearer/services.js.map +1 -0
  102. package/dist/sdk/authentication-jwt-bearer/{types.d.cts → types.d.ts} +22 -3
  103. package/dist/sdk/authentication-jwt-bearer/types.d.ts.map +1 -0
  104. package/dist/sdk/authentication-jwt-bearer/{types.mjs → types.js} +1 -1
  105. package/dist/sdk/authentication-jwt-bearer/types.js.map +1 -0
  106. package/dist/sdk/authentication-jwt-bearer/utils/{identifier.d.cts → identifier.d.ts} +2 -2
  107. package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.ts.map +1 -0
  108. package/dist/sdk/authentication-jwt-bearer/utils/{identifier.mjs → identifier.js} +2 -2
  109. package/dist/sdk/authentication-jwt-bearer/utils/identifier.js.map +1 -0
  110. package/dist/sdk/authentication-jwt-bearer/utils/{time.d.cts → time.d.ts} +1 -1
  111. package/dist/sdk/authentication-jwt-bearer/utils/time.d.ts.map +1 -0
  112. package/dist/sdk/authentication-jwt-bearer/utils/{time.mjs → time.js} +1 -1
  113. package/dist/sdk/authentication-jwt-bearer/utils/time.js.map +1 -0
  114. package/dist/sdk/{authentication.d.cts → authentication.d.ts} +10 -9
  115. package/dist/sdk/authentication.d.ts.map +1 -0
  116. package/dist/sdk/authentication.js +104 -0
  117. package/dist/sdk/authentication.js.map +1 -0
  118. package/dist/sdk/{constants.d.cts → constants.d.ts} +2 -1
  119. package/dist/sdk/constants.d.ts.map +1 -0
  120. package/dist/sdk/{constants.mjs → constants.js} +2 -1
  121. package/dist/sdk/constants.js.map +1 -0
  122. package/dist/sdk/{errors.d.mts → errors.d.ts} +10 -1
  123. package/dist/sdk/errors.d.ts.map +1 -0
  124. package/dist/sdk/{errors.mjs → errors.js} +16 -3
  125. package/dist/sdk/errors.js.map +1 -0
  126. package/dist/sdk/index.d.ts +8 -0
  127. package/dist/sdk/index.d.ts.map +1 -0
  128. package/dist/sdk/index.js +8 -0
  129. package/dist/sdk/index.js.map +1 -0
  130. package/dist/sdk/mocks/{auth.d.cts → auth.d.ts} +13 -2
  131. package/dist/sdk/mocks/auth.d.ts.map +1 -0
  132. package/dist/sdk/mocks/{auth.mjs → auth.js} +14 -3
  133. package/dist/sdk/mocks/auth.js.map +1 -0
  134. package/dist/sdk/mocks/{userstorage.d.cts → userstorage.d.ts} +1 -1
  135. package/dist/sdk/mocks/userstorage.d.ts.map +1 -0
  136. package/dist/sdk/mocks/{userstorage.mjs → userstorage.js} +5 -5
  137. package/dist/sdk/mocks/userstorage.js.map +1 -0
  138. package/dist/sdk/{user-storage.d.mts → user-storage.d.ts} +5 -5
  139. package/dist/sdk/user-storage.d.ts.map +1 -0
  140. package/dist/sdk/user-storage.js +364 -0
  141. package/dist/sdk/user-storage.js.map +1 -0
  142. package/dist/sdk/utils/{eip-6963-metamask-provider.d.cts → eip-6963-metamask-provider.d.ts} +2 -2
  143. package/dist/sdk/utils/eip-6963-metamask-provider.d.ts.map +1 -0
  144. package/dist/sdk/utils/{eip-6963-metamask-provider.mjs → eip-6963-metamask-provider.js} +1 -1
  145. package/dist/sdk/utils/eip-6963-metamask-provider.js.map +1 -0
  146. package/dist/sdk/utils/{messaging-signing-snap-requests.d.mts → messaging-signing-snap-requests.d.ts} +2 -2
  147. package/dist/sdk/utils/messaging-signing-snap-requests.d.ts.map +1 -0
  148. package/dist/sdk/utils/{messaging-signing-snap-requests.mjs → messaging-signing-snap-requests.js} +1 -1
  149. package/dist/sdk/utils/messaging-signing-snap-requests.js.map +1 -0
  150. package/dist/sdk/utils/{validate-login-response.d.mts → validate-login-response.d.ts} +2 -2
  151. package/dist/sdk/utils/validate-login-response.d.ts.map +1 -0
  152. package/dist/sdk/utils/{validate-login-response.mjs → validate-login-response.js} +1 -1
  153. package/dist/sdk/utils/validate-login-response.js.map +1 -0
  154. package/dist/sdk/utils/{validate-pair-response.d.cts → validate-pair-response.d.ts} +1 -1
  155. package/dist/sdk/utils/validate-pair-response.d.ts.map +1 -0
  156. package/dist/sdk/utils/{validate-pair-response.mjs → validate-pair-response.js} +1 -1
  157. package/dist/sdk/utils/validate-pair-response.js.map +1 -0
  158. package/dist/shared/encryption/{cache.d.cts → cache.d.ts} +1 -1
  159. package/dist/shared/encryption/cache.d.ts.map +1 -0
  160. package/dist/shared/encryption/{cache.mjs → cache.js} +4 -4
  161. package/dist/shared/encryption/cache.js.map +1 -0
  162. package/dist/shared/encryption/{constants.d.cts → constants.d.ts} +2 -2
  163. package/dist/shared/encryption/constants.d.ts.map +1 -0
  164. package/dist/shared/encryption/{constants.mjs → constants.js} +1 -1
  165. package/dist/shared/encryption/constants.js.map +1 -0
  166. package/dist/shared/encryption/{encryption.d.cts → encryption.d.ts} +3 -3
  167. package/dist/shared/encryption/encryption.d.ts.map +1 -0
  168. package/dist/shared/encryption/encryption.js +202 -0
  169. package/dist/shared/encryption/encryption.js.map +1 -0
  170. package/dist/shared/encryption/index.d.ts +5 -0
  171. package/dist/shared/encryption/index.d.ts.map +1 -0
  172. package/dist/shared/encryption/index.js +5 -0
  173. package/dist/shared/encryption/index.js.map +1 -0
  174. package/dist/shared/encryption/{utils.d.cts → utils.d.ts} +3 -3
  175. package/dist/shared/encryption/utils.d.ts.map +1 -0
  176. package/dist/shared/encryption/{utils.mjs → utils.js} +1 -1
  177. package/dist/shared/encryption/utils.js.map +1 -0
  178. package/dist/shared/{env.d.mts → env.d.ts} +1 -1
  179. package/dist/shared/env.d.ts.map +1 -0
  180. package/dist/shared/{env.mjs → env.js} +1 -1
  181. package/dist/shared/env.js.map +1 -0
  182. package/dist/shared/{storage-schema.d.mts → storage-schema.d.ts} +1 -1
  183. package/dist/shared/storage-schema.d.ts.map +1 -0
  184. package/dist/shared/{storage-schema.mjs → storage-schema.js} +2 -2
  185. package/dist/shared/storage-schema.js.map +1 -0
  186. package/dist/shared/types/{encryption.d.cts → encryption.d.ts} +1 -1
  187. package/dist/shared/types/encryption.d.ts.map +1 -0
  188. package/dist/shared/types/encryption.js +2 -0
  189. package/dist/shared/types/encryption.js.map +1 -0
  190. package/dist/shared/types/{services.d.cts → services.d.ts} +2 -2
  191. package/dist/shared/types/services.d.ts.map +1 -0
  192. package/dist/shared/types/services.js +2 -0
  193. package/dist/shared/types/services.js.map +1 -0
  194. package/dist/shared/utils/entropy-source.d.ts +22 -0
  195. package/dist/shared/utils/entropy-source.d.ts.map +1 -0
  196. package/dist/shared/utils/entropy-source.js +32 -0
  197. package/dist/shared/utils/entropy-source.js.map +1 -0
  198. package/dist/shared/utils/{event-queue.d.cts → event-queue.d.ts} +1 -1
  199. package/dist/shared/utils/event-queue.d.ts.map +1 -0
  200. package/dist/shared/utils/{event-queue.mjs → event-queue.js} +2 -4
  201. package/dist/shared/utils/event-queue.js.map +1 -0
  202. package/dist/shared/utils/hd-keyring-seed.d.ts +27 -0
  203. package/dist/shared/utils/hd-keyring-seed.d.ts.map +1 -0
  204. package/dist/shared/utils/hd-keyring-seed.js +45 -0
  205. package/dist/shared/utils/hd-keyring-seed.js.map +1 -0
  206. package/dist/shared/utils/message-signing.d.ts +73 -0
  207. package/dist/shared/utils/message-signing.d.ts.map +1 -0
  208. package/dist/shared/utils/message-signing.js +140 -0
  209. package/dist/shared/utils/message-signing.js.map +1 -0
  210. package/package.json +35 -69
  211. package/dist/controllers/authentication/AuthenticationController-method-action-types.cjs +0 -7
  212. package/dist/controllers/authentication/AuthenticationController-method-action-types.cjs.map +0 -1
  213. package/dist/controllers/authentication/AuthenticationController-method-action-types.d.cts +0 -102
  214. package/dist/controllers/authentication/AuthenticationController-method-action-types.d.cts.map +0 -1
  215. package/dist/controllers/authentication/AuthenticationController-method-action-types.d.mts.map +0 -1
  216. package/dist/controllers/authentication/AuthenticationController-method-action-types.mjs.map +0 -1
  217. package/dist/controllers/authentication/AuthenticationController.cjs +0 -501
  218. package/dist/controllers/authentication/AuthenticationController.cjs.map +0 -1
  219. package/dist/controllers/authentication/AuthenticationController.d.cts +0 -131
  220. package/dist/controllers/authentication/AuthenticationController.d.cts.map +0 -1
  221. package/dist/controllers/authentication/AuthenticationController.d.mts.map +0 -1
  222. package/dist/controllers/authentication/AuthenticationController.mjs +0 -497
  223. package/dist/controllers/authentication/AuthenticationController.mjs.map +0 -1
  224. package/dist/controllers/authentication/auth-snap-requests.cjs +0 -60
  225. package/dist/controllers/authentication/auth-snap-requests.cjs.map +0 -1
  226. package/dist/controllers/authentication/auth-snap-requests.d.cts +0 -27
  227. package/dist/controllers/authentication/auth-snap-requests.d.cts.map +0 -1
  228. package/dist/controllers/authentication/auth-snap-requests.d.mts +0 -27
  229. package/dist/controllers/authentication/auth-snap-requests.d.mts.map +0 -1
  230. package/dist/controllers/authentication/auth-snap-requests.mjs +0 -54
  231. package/dist/controllers/authentication/auth-snap-requests.mjs.map +0 -1
  232. package/dist/controllers/authentication/index.cjs +0 -35
  233. package/dist/controllers/authentication/index.cjs.map +0 -1
  234. package/dist/controllers/authentication/index.d.cts.map +0 -1
  235. package/dist/controllers/authentication/index.d.mts +0 -7
  236. package/dist/controllers/authentication/index.d.mts.map +0 -1
  237. package/dist/controllers/authentication/index.mjs +0 -6
  238. package/dist/controllers/authentication/index.mjs.map +0 -1
  239. package/dist/controllers/authentication/mocks/index.cjs +0 -18
  240. package/dist/controllers/authentication/mocks/index.cjs.map +0 -1
  241. package/dist/controllers/authentication/mocks/index.d.cts +0 -2
  242. package/dist/controllers/authentication/mocks/index.d.cts.map +0 -1
  243. package/dist/controllers/authentication/mocks/index.d.mts +0 -2
  244. package/dist/controllers/authentication/mocks/index.d.mts.map +0 -1
  245. package/dist/controllers/authentication/mocks/index.mjs +0 -2
  246. package/dist/controllers/authentication/mocks/index.mjs.map +0 -1
  247. package/dist/controllers/authentication/mocks/mockResponses.cjs +0 -126
  248. package/dist/controllers/authentication/mocks/mockResponses.cjs.map +0 -1
  249. package/dist/controllers/authentication/mocks/mockResponses.d.mts +0 -58
  250. package/dist/controllers/authentication/mocks/mockResponses.d.mts.map +0 -1
  251. package/dist/controllers/authentication/mocks/mockResponses.mjs.map +0 -1
  252. package/dist/controllers/index.cjs +0 -29
  253. package/dist/controllers/index.cjs.map +0 -1
  254. package/dist/controllers/index.d.cts +0 -3
  255. package/dist/controllers/index.d.cts.map +0 -1
  256. package/dist/controllers/index.d.mts +0 -3
  257. package/dist/controllers/index.d.mts.map +0 -1
  258. package/dist/controllers/index.mjs +0 -3
  259. package/dist/controllers/index.mjs.map +0 -1
  260. package/dist/controllers/user-storage/UserStorageController-method-action-types.cjs +0 -7
  261. package/dist/controllers/user-storage/UserStorageController-method-action-types.cjs.map +0 -1
  262. package/dist/controllers/user-storage/UserStorageController-method-action-types.d.cts +0 -137
  263. package/dist/controllers/user-storage/UserStorageController-method-action-types.d.cts.map +0 -1
  264. package/dist/controllers/user-storage/UserStorageController-method-action-types.d.mts.map +0 -1
  265. package/dist/controllers/user-storage/UserStorageController-method-action-types.mjs.map +0 -1
  266. package/dist/controllers/user-storage/UserStorageController.cjs +0 -413
  267. package/dist/controllers/user-storage/UserStorageController.cjs.map +0 -1
  268. package/dist/controllers/user-storage/UserStorageController.d.cts.map +0 -1
  269. package/dist/controllers/user-storage/UserStorageController.d.mts +0 -183
  270. package/dist/controllers/user-storage/UserStorageController.d.mts.map +0 -1
  271. package/dist/controllers/user-storage/UserStorageController.mjs +0 -409
  272. package/dist/controllers/user-storage/UserStorageController.mjs.map +0 -1
  273. package/dist/controllers/user-storage/constants.cjs +0 -19
  274. package/dist/controllers/user-storage/constants.cjs.map +0 -1
  275. package/dist/controllers/user-storage/constants.d.cts +0 -15
  276. package/dist/controllers/user-storage/constants.d.cts.map +0 -1
  277. package/dist/controllers/user-storage/constants.d.mts +0 -15
  278. package/dist/controllers/user-storage/constants.d.mts.map +0 -1
  279. package/dist/controllers/user-storage/constants.mjs.map +0 -1
  280. package/dist/controllers/user-storage/contact-syncing/constants.cjs +0 -12
  281. package/dist/controllers/user-storage/contact-syncing/constants.cjs.map +0 -1
  282. package/dist/controllers/user-storage/contact-syncing/constants.d.cts.map +0 -1
  283. package/dist/controllers/user-storage/contact-syncing/constants.d.mts +0 -9
  284. package/dist/controllers/user-storage/contact-syncing/constants.d.mts.map +0 -1
  285. package/dist/controllers/user-storage/contact-syncing/constants.mjs.map +0 -1
  286. package/dist/controllers/user-storage/contact-syncing/controller-integration.cjs +0 -346
  287. package/dist/controllers/user-storage/contact-syncing/controller-integration.cjs.map +0 -1
  288. package/dist/controllers/user-storage/contact-syncing/controller-integration.d.cts.map +0 -1
  289. package/dist/controllers/user-storage/contact-syncing/controller-integration.d.mts +0 -47
  290. package/dist/controllers/user-storage/contact-syncing/controller-integration.d.mts.map +0 -1
  291. package/dist/controllers/user-storage/contact-syncing/controller-integration.mjs.map +0 -1
  292. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.cjs +0 -50
  293. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.cjs.map +0 -1
  294. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.d.cts.map +0 -1
  295. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.d.mts +0 -8
  296. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.d.mts.map +0 -1
  297. package/dist/controllers/user-storage/contact-syncing/setup-subscriptions.mjs.map +0 -1
  298. package/dist/controllers/user-storage/contact-syncing/sync-utils.cjs +0 -23
  299. package/dist/controllers/user-storage/contact-syncing/sync-utils.cjs.map +0 -1
  300. package/dist/controllers/user-storage/contact-syncing/sync-utils.d.cts.map +0 -1
  301. package/dist/controllers/user-storage/contact-syncing/sync-utils.d.mts +0 -9
  302. package/dist/controllers/user-storage/contact-syncing/sync-utils.d.mts.map +0 -1
  303. package/dist/controllers/user-storage/contact-syncing/sync-utils.mjs.map +0 -1
  304. package/dist/controllers/user-storage/contact-syncing/types.cjs +0 -3
  305. package/dist/controllers/user-storage/contact-syncing/types.cjs.map +0 -1
  306. package/dist/controllers/user-storage/contact-syncing/types.d.cts.map +0 -1
  307. package/dist/controllers/user-storage/contact-syncing/types.d.mts +0 -37
  308. package/dist/controllers/user-storage/contact-syncing/types.d.mts.map +0 -1
  309. package/dist/controllers/user-storage/contact-syncing/types.mjs +0 -2
  310. package/dist/controllers/user-storage/contact-syncing/types.mjs.map +0 -1
  311. package/dist/controllers/user-storage/contact-syncing/utils.cjs +0 -64
  312. package/dist/controllers/user-storage/contact-syncing/utils.cjs.map +0 -1
  313. package/dist/controllers/user-storage/contact-syncing/utils.d.cts.map +0 -1
  314. package/dist/controllers/user-storage/contact-syncing/utils.d.mts +0 -36
  315. package/dist/controllers/user-storage/contact-syncing/utils.d.mts.map +0 -1
  316. package/dist/controllers/user-storage/contact-syncing/utils.mjs.map +0 -1
  317. package/dist/controllers/user-storage/index.cjs +0 -38
  318. package/dist/controllers/user-storage/index.cjs.map +0 -1
  319. package/dist/controllers/user-storage/index.d.cts.map +0 -1
  320. package/dist/controllers/user-storage/index.d.mts +0 -10
  321. package/dist/controllers/user-storage/index.d.mts.map +0 -1
  322. package/dist/controllers/user-storage/index.mjs +0 -9
  323. package/dist/controllers/user-storage/index.mjs.map +0 -1
  324. package/dist/controllers/user-storage/mocks/index.cjs +0 -19
  325. package/dist/controllers/user-storage/mocks/index.cjs.map +0 -1
  326. package/dist/controllers/user-storage/mocks/index.d.cts +0 -3
  327. package/dist/controllers/user-storage/mocks/index.d.cts.map +0 -1
  328. package/dist/controllers/user-storage/mocks/index.d.mts +0 -3
  329. package/dist/controllers/user-storage/mocks/index.d.mts.map +0 -1
  330. package/dist/controllers/user-storage/mocks/index.mjs +0 -3
  331. package/dist/controllers/user-storage/mocks/index.mjs.map +0 -1
  332. package/dist/controllers/user-storage/mocks/mockResponses.cjs +0 -113
  333. package/dist/controllers/user-storage/mocks/mockResponses.cjs.map +0 -1
  334. package/dist/controllers/user-storage/mocks/mockResponses.d.cts +0 -66
  335. package/dist/controllers/user-storage/mocks/mockResponses.d.cts.map +0 -1
  336. package/dist/controllers/user-storage/mocks/mockResponses.d.mts.map +0 -1
  337. package/dist/controllers/user-storage/mocks/mockResponses.mjs.map +0 -1
  338. package/dist/controllers/user-storage/mocks/mockStorage.cjs +0 -36
  339. package/dist/controllers/user-storage/mocks/mockStorage.cjs.map +0 -1
  340. package/dist/controllers/user-storage/mocks/mockStorage.d.cts.map +0 -1
  341. package/dist/controllers/user-storage/mocks/mockStorage.d.mts +0 -5
  342. package/dist/controllers/user-storage/mocks/mockStorage.d.mts.map +0 -1
  343. package/dist/controllers/user-storage/mocks/mockStorage.mjs.map +0 -1
  344. package/dist/controllers/user-storage/types.cjs +0 -3
  345. package/dist/controllers/user-storage/types.cjs.map +0 -1
  346. package/dist/controllers/user-storage/types.d.cts.map +0 -1
  347. package/dist/controllers/user-storage/types.d.mts +0 -23
  348. package/dist/controllers/user-storage/types.d.mts.map +0 -1
  349. package/dist/controllers/user-storage/types.mjs +0 -2
  350. package/dist/controllers/user-storage/types.mjs.map +0 -1
  351. package/dist/controllers/user-storage/utils.cjs +0 -32
  352. package/dist/controllers/user-storage/utils.cjs.map +0 -1
  353. package/dist/controllers/user-storage/utils.d.cts.map +0 -1
  354. package/dist/controllers/user-storage/utils.d.mts +0 -19
  355. package/dist/controllers/user-storage/utils.d.mts.map +0 -1
  356. package/dist/controllers/user-storage/utils.mjs.map +0 -1
  357. package/dist/index.cjs +0 -30
  358. package/dist/index.cjs.map +0 -1
  359. package/dist/index.d.cts +0 -4
  360. package/dist/index.d.cts.map +0 -1
  361. package/dist/index.d.mts +0 -4
  362. package/dist/index.d.mts.map +0 -1
  363. package/dist/index.mjs +0 -4
  364. package/dist/index.mjs.map +0 -1
  365. package/dist/sdk/authentication-jwt-bearer/flow-siwe.cjs +0 -114
  366. package/dist/sdk/authentication-jwt-bearer/flow-siwe.cjs.map +0 -1
  367. package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.cts.map +0 -1
  368. package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.mts +0 -25
  369. package/dist/sdk/authentication-jwt-bearer/flow-siwe.d.mts.map +0 -1
  370. package/dist/sdk/authentication-jwt-bearer/flow-siwe.mjs +0 -110
  371. package/dist/sdk/authentication-jwt-bearer/flow-siwe.mjs.map +0 -1
  372. package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs +0 -290
  373. package/dist/sdk/authentication-jwt-bearer/flow-srp.cjs.map +0 -1
  374. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts +0 -44
  375. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.cts.map +0 -1
  376. package/dist/sdk/authentication-jwt-bearer/flow-srp.d.mts.map +0 -1
  377. package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs +0 -263
  378. package/dist/sdk/authentication-jwt-bearer/flow-srp.mjs.map +0 -1
  379. package/dist/sdk/authentication-jwt-bearer/services.cjs +0 -400
  380. package/dist/sdk/authentication-jwt-bearer/services.cjs.map +0 -1
  381. package/dist/sdk/authentication-jwt-bearer/services.d.cts +0 -105
  382. package/dist/sdk/authentication-jwt-bearer/services.d.cts.map +0 -1
  383. package/dist/sdk/authentication-jwt-bearer/services.d.mts.map +0 -1
  384. package/dist/sdk/authentication-jwt-bearer/services.mjs.map +0 -1
  385. package/dist/sdk/authentication-jwt-bearer/types.cjs +0 -12
  386. package/dist/sdk/authentication-jwt-bearer/types.cjs.map +0 -1
  387. package/dist/sdk/authentication-jwt-bearer/types.d.cts.map +0 -1
  388. package/dist/sdk/authentication-jwt-bearer/types.d.mts +0 -114
  389. package/dist/sdk/authentication-jwt-bearer/types.d.mts.map +0 -1
  390. package/dist/sdk/authentication-jwt-bearer/types.mjs.map +0 -1
  391. package/dist/sdk/authentication-jwt-bearer/utils/identifier.cjs +0 -27
  392. package/dist/sdk/authentication-jwt-bearer/utils/identifier.cjs.map +0 -1
  393. package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.cts.map +0 -1
  394. package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.mts +0 -13
  395. package/dist/sdk/authentication-jwt-bearer/utils/identifier.d.mts.map +0 -1
  396. package/dist/sdk/authentication-jwt-bearer/utils/identifier.mjs.map +0 -1
  397. package/dist/sdk/authentication-jwt-bearer/utils/time.cjs +0 -17
  398. package/dist/sdk/authentication-jwt-bearer/utils/time.cjs.map +0 -1
  399. package/dist/sdk/authentication-jwt-bearer/utils/time.d.cts.map +0 -1
  400. package/dist/sdk/authentication-jwt-bearer/utils/time.d.mts +0 -8
  401. package/dist/sdk/authentication-jwt-bearer/utils/time.d.mts.map +0 -1
  402. package/dist/sdk/authentication-jwt-bearer/utils/time.mjs.map +0 -1
  403. package/dist/sdk/authentication.cjs +0 -132
  404. package/dist/sdk/authentication.cjs.map +0 -1
  405. package/dist/sdk/authentication.d.cts.map +0 -1
  406. package/dist/sdk/authentication.d.mts +0 -38
  407. package/dist/sdk/authentication.d.mts.map +0 -1
  408. package/dist/sdk/authentication.mjs +0 -112
  409. package/dist/sdk/authentication.mjs.map +0 -1
  410. package/dist/sdk/constants.cjs +0 -7
  411. package/dist/sdk/constants.cjs.map +0 -1
  412. package/dist/sdk/constants.d.cts.map +0 -1
  413. package/dist/sdk/constants.d.mts +0 -4
  414. package/dist/sdk/constants.d.mts.map +0 -1
  415. package/dist/sdk/constants.mjs.map +0 -1
  416. package/dist/sdk/errors.cjs +0 -76
  417. package/dist/sdk/errors.cjs.map +0 -1
  418. package/dist/sdk/errors.d.cts +0 -34
  419. package/dist/sdk/errors.d.cts.map +0 -1
  420. package/dist/sdk/errors.d.mts.map +0 -1
  421. package/dist/sdk/errors.mjs.map +0 -1
  422. package/dist/sdk/index.cjs +0 -24
  423. package/dist/sdk/index.cjs.map +0 -1
  424. package/dist/sdk/index.d.cts +0 -8
  425. package/dist/sdk/index.d.cts.map +0 -1
  426. package/dist/sdk/index.d.mts +0 -8
  427. package/dist/sdk/index.d.mts.map +0 -1
  428. package/dist/sdk/index.mjs +0 -8
  429. package/dist/sdk/index.mjs.map +0 -1
  430. package/dist/sdk/mocks/auth.cjs +0 -82
  431. package/dist/sdk/mocks/auth.cjs.map +0 -1
  432. package/dist/sdk/mocks/auth.d.cts.map +0 -1
  433. package/dist/sdk/mocks/auth.d.mts +0 -69
  434. package/dist/sdk/mocks/auth.d.mts.map +0 -1
  435. package/dist/sdk/mocks/auth.mjs.map +0 -1
  436. package/dist/sdk/mocks/userstorage.cjs +0 -43
  437. package/dist/sdk/mocks/userstorage.cjs.map +0 -1
  438. package/dist/sdk/mocks/userstorage.d.cts.map +0 -1
  439. package/dist/sdk/mocks/userstorage.d.mts +0 -10
  440. package/dist/sdk/mocks/userstorage.d.mts.map +0 -1
  441. package/dist/sdk/mocks/userstorage.mjs.map +0 -1
  442. package/dist/sdk/user-storage.cjs +0 -386
  443. package/dist/sdk/user-storage.cjs.map +0 -1
  444. package/dist/sdk/user-storage.d.cts +0 -47
  445. package/dist/sdk/user-storage.d.cts.map +0 -1
  446. package/dist/sdk/user-storage.d.mts.map +0 -1
  447. package/dist/sdk/user-storage.mjs +0 -358
  448. package/dist/sdk/user-storage.mjs.map +0 -1
  449. package/dist/sdk/utils/eip-6963-metamask-provider.cjs +0 -70
  450. package/dist/sdk/utils/eip-6963-metamask-provider.cjs.map +0 -1
  451. package/dist/sdk/utils/eip-6963-metamask-provider.d.cts.map +0 -1
  452. package/dist/sdk/utils/eip-6963-metamask-provider.d.mts +0 -25
  453. package/dist/sdk/utils/eip-6963-metamask-provider.d.mts.map +0 -1
  454. package/dist/sdk/utils/eip-6963-metamask-provider.mjs.map +0 -1
  455. package/dist/sdk/utils/messaging-signing-snap-requests.cjs +0 -96
  456. package/dist/sdk/utils/messaging-signing-snap-requests.cjs.map +0 -1
  457. package/dist/sdk/utils/messaging-signing-snap-requests.d.cts +0 -41
  458. package/dist/sdk/utils/messaging-signing-snap-requests.d.cts.map +0 -1
  459. package/dist/sdk/utils/messaging-signing-snap-requests.d.mts.map +0 -1
  460. package/dist/sdk/utils/messaging-signing-snap-requests.mjs.map +0 -1
  461. package/dist/sdk/utils/validate-login-response.cjs +0 -49
  462. package/dist/sdk/utils/validate-login-response.cjs.map +0 -1
  463. package/dist/sdk/utils/validate-login-response.d.cts +0 -14
  464. package/dist/sdk/utils/validate-login-response.d.cts.map +0 -1
  465. package/dist/sdk/utils/validate-login-response.d.mts.map +0 -1
  466. package/dist/sdk/utils/validate-login-response.mjs.map +0 -1
  467. package/dist/sdk/utils/validate-pair-response.cjs +0 -29
  468. package/dist/sdk/utils/validate-pair-response.cjs.map +0 -1
  469. package/dist/sdk/utils/validate-pair-response.d.cts.map +0 -1
  470. package/dist/sdk/utils/validate-pair-response.d.mts +0 -26
  471. package/dist/sdk/utils/validate-pair-response.d.mts.map +0 -1
  472. package/dist/sdk/utils/validate-pair-response.mjs.map +0 -1
  473. package/dist/shared/encryption/cache.cjs +0 -77
  474. package/dist/shared/encryption/cache.cjs.map +0 -1
  475. package/dist/shared/encryption/cache.d.cts.map +0 -1
  476. package/dist/shared/encryption/cache.d.mts +0 -32
  477. package/dist/shared/encryption/cache.d.mts.map +0 -1
  478. package/dist/shared/encryption/cache.mjs.map +0 -1
  479. package/dist/shared/encryption/constants.cjs +0 -17
  480. package/dist/shared/encryption/constants.cjs.map +0 -1
  481. package/dist/shared/encryption/constants.d.cts.map +0 -1
  482. package/dist/shared/encryption/constants.d.mts +0 -9
  483. package/dist/shared/encryption/constants.d.mts.map +0 -1
  484. package/dist/shared/encryption/constants.mjs.map +0 -1
  485. package/dist/shared/encryption/encryption.cjs +0 -209
  486. package/dist/shared/encryption/encryption.cjs.map +0 -1
  487. package/dist/shared/encryption/encryption.d.cts.map +0 -1
  488. package/dist/shared/encryption/encryption.d.mts +0 -30
  489. package/dist/shared/encryption/encryption.d.mts.map +0 -1
  490. package/dist/shared/encryption/encryption.mjs +0 -205
  491. package/dist/shared/encryption/encryption.mjs.map +0 -1
  492. package/dist/shared/encryption/index.cjs +0 -25
  493. package/dist/shared/encryption/index.cjs.map +0 -1
  494. package/dist/shared/encryption/index.d.cts +0 -5
  495. package/dist/shared/encryption/index.d.cts.map +0 -1
  496. package/dist/shared/encryption/index.d.mts +0 -5
  497. package/dist/shared/encryption/index.d.mts.map +0 -1
  498. package/dist/shared/encryption/index.mjs +0 -5
  499. package/dist/shared/encryption/index.mjs.map +0 -1
  500. package/dist/shared/encryption/utils.cjs +0 -21
  501. package/dist/shared/encryption/utils.cjs.map +0 -1
  502. package/dist/shared/encryption/utils.d.cts.map +0 -1
  503. package/dist/shared/encryption/utils.d.mts +0 -5
  504. package/dist/shared/encryption/utils.d.mts.map +0 -1
  505. package/dist/shared/encryption/utils.mjs.map +0 -1
  506. package/dist/shared/env.cjs +0 -85
  507. package/dist/shared/env.cjs.map +0 -1
  508. package/dist/shared/env.d.cts +0 -34
  509. package/dist/shared/env.d.cts.map +0 -1
  510. package/dist/shared/env.d.mts.map +0 -1
  511. package/dist/shared/env.mjs.map +0 -1
  512. package/dist/shared/storage-schema.cjs +0 -42
  513. package/dist/shared/storage-schema.cjs.map +0 -1
  514. package/dist/shared/storage-schema.d.cts +0 -34
  515. package/dist/shared/storage-schema.d.cts.map +0 -1
  516. package/dist/shared/storage-schema.d.mts.map +0 -1
  517. package/dist/shared/storage-schema.mjs.map +0 -1
  518. package/dist/shared/types/encryption.cjs +0 -3
  519. package/dist/shared/types/encryption.cjs.map +0 -1
  520. package/dist/shared/types/encryption.d.cts.map +0 -1
  521. package/dist/shared/types/encryption.d.mts +0 -2
  522. package/dist/shared/types/encryption.d.mts.map +0 -1
  523. package/dist/shared/types/encryption.mjs +0 -2
  524. package/dist/shared/types/encryption.mjs.map +0 -1
  525. package/dist/shared/types/services.cjs +0 -3
  526. package/dist/shared/types/services.cjs.map +0 -1
  527. package/dist/shared/types/services.d.cts.map +0 -1
  528. package/dist/shared/types/services.d.mts +0 -17
  529. package/dist/shared/types/services.d.mts.map +0 -1
  530. package/dist/shared/types/services.mjs +0 -2
  531. package/dist/shared/types/services.mjs.map +0 -1
  532. package/dist/shared/utils/event-queue.cjs +0 -24
  533. package/dist/shared/utils/event-queue.cjs.map +0 -1
  534. package/dist/shared/utils/event-queue.d.cts.map +0 -1
  535. package/dist/shared/utils/event-queue.d.mts +0 -6
  536. package/dist/shared/utils/event-queue.d.mts.map +0 -1
  537. package/dist/shared/utils/event-queue.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hd-keyring-seed.js","sourceRoot":"","sources":["../../../src/shared/utils/hd-keyring-seed.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH,MAAM,eAAe,GAAwB,IAAI,CAAC;AAElD,MAAM,8BAA8B,GAClC,mDAAmD,CAAC;AAiBtD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,SAAuC,EACvC,eAAuB;IAEvB,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,CAAC,MAAM,SAAS,CAAC,IAAI,CACvC,uCAAuC,EACvC,EAAE,EAAE,EAAE,eAAe,EAAE,EACvB,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;YACpB,MAAM,SAAS,GAAG,OAAoB,CAAC;YACvC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;QACxD,CAAC,CACF,CAA+C,CAAC;QAEjD,IAAI,WAAW,CAAC,IAAI,KAAK,eAAe,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QAED,OAAO,WAAW,CAAC,IAAI,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import type { HdKeyring } from '@metamask/eth-hd-keyring/v2';\nimport type { KeyringType } from '@metamask/keyring-api/v2';\nimport type { KeyringControllerWithKeyringV2UnsafeAction } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\n\n/**\n * HD keyring seed access for native SIP-6 message signing.\n *\n * This mirrors `@metamask/snaps-rpc-methods` `getMnemonicSeed` (when called\n * with an entropy source id):\n * `KeyringController:withKeyringV2Unsafe` → assert HD → return `keyring.seed`.\n *\n * Those helpers are not a public export of snaps-rpc-methods, so this thin wrapper lives here.\n *\n * @see https://github.com/MetaMask/snaps/blob/main/packages/snaps-rpc-methods/src/utils.ts\n */\n\n/**\n * V2 HD keyring type (`KeyringType.Hd`). The template type keeps the literal\n * aligned with `@metamask/keyring-api/v2` without a runtime dependency.\n */\nconst HD_KEYRING_TYPE: `${KeyringType.Hd}` = 'hd';\n\nconst ENTROPY_SOURCE_NOT_FOUND_ERROR =\n 'Entropy source not found or is not an HD keyring.';\n\n/**\n * Structural messenger shape for `withKeyringV2Unsafe`.\n *\n * Not `Messenger<string, KeyringControllerWithKeyringV2UnsafeAction>` because\n * `Messenger` is invariant in its action union — Auth / UserStorage messengers\n * (which allow additional actions) are not assignable to that narrow type.\n */\ntype MessengerWithKeyringV2Unsafe = {\n call: (\n ...args: Parameters<\n Messenger<string, KeyringControllerWithKeyringV2UnsafeAction>['call']\n >\n ) => unknown;\n};\n\n/**\n * Reads the BIP-39 seed for an HD keyring entropy source via\n * `KeyringController:withKeyringV2Unsafe`.\n *\n * Equivalent to snaps-rpc-methods `getMnemonicSeed(messenger, source)` for a\n * concrete entropy source id.\n *\n * @param messenger - Messenger that can call `withKeyringV2Unsafe`.\n * @param entropySourceId - Keyring metadata ID (SIP-30 entropy source).\n * @returns The HD keyring seed.\n * @throws If the keyring is missing or is not an HD keyring with a seed.\n */\nexport async function getHdKeyringSeed(\n messenger: MessengerWithKeyringV2Unsafe,\n entropySourceId: string,\n): Promise<Uint8Array> {\n try {\n const keyringData = (await messenger.call(\n 'KeyringController:withKeyringV2Unsafe',\n { id: entropySourceId },\n async ({ keyring }) => {\n const hdKeyring = keyring as HdKeyring;\n return { type: hdKeyring.type, seed: hdKeyring.seed };\n },\n )) as { type: string; seed?: Uint8Array | null };\n\n if (keyringData.type !== HD_KEYRING_TYPE || !keyringData.seed) {\n throw new Error(ENTROPY_SOURCE_NOT_FOUND_ERROR);\n }\n\n return keyringData.seed;\n } catch {\n throw new Error(ENTROPY_SOURCE_NOT_FOUND_ERROR);\n }\n}\n"]}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Native SIP-6 message-signing helpers for AuthenticationController /
3
+ * UserStorageController.
4
+ *
5
+ * These are intentional copies of the message-signing snap crypto path so auth
6
+ * and user-storage can derive/sign without booting
7
+ * `npm:@metamask/message-signing-snap`. Behavior must stay byte-identical to:
8
+ *
9
+ * - SIP-6 derivation:
10
+ * `@metamask/snaps-rpc-methods` `deriveEntropyFromSeed` /
11
+ * `getEntropyDerivationPath` / `getDerivationPathArray`
12
+ * (https://github.com/MetaMask/snaps/blob/main/packages/snaps-rpc-methods/src/utils.ts)
13
+ * - Magic constant:
14
+ * `@metamask/snaps-utils` `SIP_6_MAGIC_VALUE`
15
+ * - Pubkey + `metamask:…` signing:
16
+ * `@metamask/message-signing-snap` `getPublicEntropyKey` /
17
+ * `signMessageWithEntropyKey`
18
+ * (https://github.com/MetaMask/message-signing-snap/blob/main/src/entropy-keys.ts)
19
+ *
20
+ * `deriveEntropyFromSeed` is not a public export of
21
+ * `@metamask/snaps-rpc-methods` today (and no core package depends on that
22
+ * package), so the SIP-6 math is vendored here rather than imported.
23
+ */
24
+ /**
25
+ * Snap ID used as the SIP-6 `input` so derived keys match
26
+ * `@metamask/message-signing-snap` (`snap_getEntropy` origin).
27
+ */
28
+ export declare const MESSAGE_SIGNING_SNAP_ID = "npm:@metamask/message-signing-snap";
29
+ /**
30
+ * Copy of `@metamask/snaps-rpc-methods` `deriveEntropyFromSeed` (SIP-6),
31
+ * returning raw private-key bytes instead of a `0x`-prefixed hex string.
32
+ *
33
+ * @param options - Derivation options.
34
+ * @param options.seed - BIP-39 mnemonic seed.
35
+ * @param options.input - SIP-6 input (snap ID for `snap_getEntropy`).
36
+ * @param options.salt - Optional salt. Internal auth uses `''`.
37
+ * @returns 32-byte private key.
38
+ */
39
+ export declare function deriveSip6PrivateKey({ seed, input, salt, }: {
40
+ seed: Uint8Array;
41
+ input: string;
42
+ salt?: string;
43
+ }): Promise<Uint8Array>;
44
+ /**
45
+ * Derives the message-signing private key via SIP-6, matching
46
+ * `snap_getEntropy` for the message-signing snap with empty salt
47
+ * (internal `metamask` origin).
48
+ *
49
+ * @param seed - BIP-39 mnemonic seed from an HD keyring.
50
+ * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.
51
+ * @returns 32-byte private key.
52
+ */
53
+ export declare function deriveMessageSigningPrivateKey(seed: Uint8Array, salt?: string): Promise<Uint8Array>;
54
+ /**
55
+ * Copy of message-signing-snap `getPublicEntropyKey`: secp256k1 pubkey hex
56
+ * for the SIP-6 message-signing private key.
57
+ *
58
+ * @param seed - BIP-39 mnemonic seed from an HD keyring.
59
+ * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.
60
+ * @returns Public key hex with `0x` prefix.
61
+ */
62
+ export declare function getMessageSigningPublicKey(seed: Uint8Array, salt?: string): Promise<string>;
63
+ /**
64
+ * Copy of message-signing-snap `signMessageWithEntropyKey`: sha256(message)
65
+ * then compact secp256k1 signature.
66
+ *
67
+ * @param message - Message to sign (must be validated by the caller).
68
+ * @param seed - BIP-39 mnemonic seed from an HD keyring.
69
+ * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.
70
+ * @returns Compact secp256k1 signature hex with `0x` prefix.
71
+ */
72
+ export declare function signMessageWithMessageSigningKey(message: string, seed: Uint8Array, salt?: string): Promise<string>;
73
+ //# sourceMappingURL=message-signing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-signing.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/message-signing.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB,uCAAuC,CAAC;AA+C5E;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,IAAI,EACJ,KAAK,EACL,IAAS,GACV,EAAE;IACD,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,UAAU,CAAC,CAoBtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,UAAU,EAChB,IAAI,SAAK,GACR,OAAO,CAAC,UAAU,CAAC,CAMrB;AAED;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,UAAU,EAChB,IAAI,SAAK,GACR,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,gCAAgC,CACpD,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,EAChB,IAAI,SAAK,GACR,OAAO,CAAC,MAAM,CAAC,CAKjB"}
@@ -0,0 +1,140 @@
1
+ import { SLIP10Node } from '@metamask/key-tree';
2
+ import { assert, bytesToHex, concatBytes, createDataView, hexToBytes, stringToBytes, } from '@metamask/utils';
3
+ import { secp256k1 } from '@noble/curves/secp256k1';
4
+ import { hmac } from '@noble/hashes/hmac';
5
+ import { sha256, sha512 } from '@noble/hashes/sha2';
6
+ import { keccak_256 as keccak256 } from '@noble/hashes/sha3';
7
+ /**
8
+ * Native SIP-6 message-signing helpers for AuthenticationController /
9
+ * UserStorageController.
10
+ *
11
+ * These are intentional copies of the message-signing snap crypto path so auth
12
+ * and user-storage can derive/sign without booting
13
+ * `npm:@metamask/message-signing-snap`. Behavior must stay byte-identical to:
14
+ *
15
+ * - SIP-6 derivation:
16
+ * `@metamask/snaps-rpc-methods` `deriveEntropyFromSeed` /
17
+ * `getEntropyDerivationPath` / `getDerivationPathArray`
18
+ * (https://github.com/MetaMask/snaps/blob/main/packages/snaps-rpc-methods/src/utils.ts)
19
+ * - Magic constant:
20
+ * `@metamask/snaps-utils` `SIP_6_MAGIC_VALUE`
21
+ * - Pubkey + `metamask:…` signing:
22
+ * `@metamask/message-signing-snap` `getPublicEntropyKey` /
23
+ * `signMessageWithEntropyKey`
24
+ * (https://github.com/MetaMask/message-signing-snap/blob/main/src/entropy-keys.ts)
25
+ *
26
+ * `deriveEntropyFromSeed` is not a public export of
27
+ * `@metamask/snaps-rpc-methods` today (and no core package depends on that
28
+ * package), so the SIP-6 math is vendored here rather than imported.
29
+ */
30
+ /**
31
+ * Snap ID used as the SIP-6 `input` so derived keys match
32
+ * `@metamask/message-signing-snap` (`snap_getEntropy` origin).
33
+ */
34
+ export const MESSAGE_SIGNING_SNAP_ID = 'npm:@metamask/message-signing-snap';
35
+ /**
36
+ * Copy of `@metamask/snaps-utils` `SIP_6_MAGIC_VALUE`
37
+ * (`0xd36e6170 - 0x80000000`).
38
+ *
39
+ * @see https://metamask.github.io/SIPs/SIPS/sip-6
40
+ */
41
+ const SIP_6_MAGIC_VALUE = `1399742832'`;
42
+ const HARDENED_VALUE = 0x80000000;
43
+ /**
44
+ * HMAC-SHA-512 for `@metamask/key-tree`.
45
+ *
46
+ * Passed into `SLIP10Node.fromSeed` so SIP-6 never uses Web Crypto.
47
+ * `@metamask/key-tree` treats any `crypto.subtle` as complete and then HMAC
48
+ * via `importKey` / `sign`. React Native only implements `digest`; its
49
+ * SubtleCrypto cannot HMAC. Noble HMAC is byte-identical without SubtleCrypto.
50
+ */
51
+ const NOBLE_HMAC_SHA512 = {
52
+ hmacSha512: async (key, data) => hmac(sha512, key, data),
53
+ };
54
+ /**
55
+ * Copy of `@metamask/snaps-rpc-methods` `getDerivationPathArray`.
56
+ *
57
+ * Maps a 32-byte hash to eight hardened BIP-32 indices for `@metamask/key-tree`.
58
+ *
59
+ * @param hash - 32-byte hash.
60
+ * @returns Hardened BIP-32 path nodes.
61
+ */
62
+ function getDerivationPathArray(hash) {
63
+ const array = [];
64
+ const view = createDataView(hash);
65
+ for (let index = 0; index < 8; index++) {
66
+ const uint32 = view.getUint32(index * 4);
67
+ // eslint-disable-next-line no-bitwise
68
+ const pathIndex = (uint32 | HARDENED_VALUE) >>> 0;
69
+ array.push(`bip32:${pathIndex - HARDENED_VALUE}'`);
70
+ }
71
+ return array;
72
+ }
73
+ /**
74
+ * Copy of `@metamask/snaps-rpc-methods` `deriveEntropyFromSeed` (SIP-6),
75
+ * returning raw private-key bytes instead of a `0x`-prefixed hex string.
76
+ *
77
+ * @param options - Derivation options.
78
+ * @param options.seed - BIP-39 mnemonic seed.
79
+ * @param options.input - SIP-6 input (snap ID for `snap_getEntropy`).
80
+ * @param options.salt - Optional salt. Internal auth uses `''`.
81
+ * @returns 32-byte private key.
82
+ */
83
+ export async function deriveSip6PrivateKey({ seed, input, salt = '', }) {
84
+ const hash = keccak256(concatBytes([stringToBytes(input), keccak256(stringToBytes(salt))]));
85
+ const computedDerivationPath = getDerivationPathArray(hash);
86
+ const { privateKey } = await SLIP10Node.fromSeed({
87
+ derivationPath: [
88
+ seed,
89
+ `bip32:${SIP_6_MAGIC_VALUE}`,
90
+ ...computedDerivationPath,
91
+ ],
92
+ curve: 'secp256k1',
93
+ }, NOBLE_HMAC_SHA512);
94
+ assert(privateKey, 'Failed to derive SIP-6 entropy.');
95
+ return hexToBytes(privateKey);
96
+ }
97
+ /**
98
+ * Derives the message-signing private key via SIP-6, matching
99
+ * `snap_getEntropy` for the message-signing snap with empty salt
100
+ * (internal `metamask` origin).
101
+ *
102
+ * @param seed - BIP-39 mnemonic seed from an HD keyring.
103
+ * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.
104
+ * @returns 32-byte private key.
105
+ */
106
+ export async function deriveMessageSigningPrivateKey(seed, salt = '') {
107
+ return deriveSip6PrivateKey({
108
+ seed,
109
+ input: MESSAGE_SIGNING_SNAP_ID,
110
+ salt,
111
+ });
112
+ }
113
+ /**
114
+ * Copy of message-signing-snap `getPublicEntropyKey`: secp256k1 pubkey hex
115
+ * for the SIP-6 message-signing private key.
116
+ *
117
+ * @param seed - BIP-39 mnemonic seed from an HD keyring.
118
+ * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.
119
+ * @returns Public key hex with `0x` prefix.
120
+ */
121
+ export async function getMessageSigningPublicKey(seed, salt = '') {
122
+ const privateKey = await deriveMessageSigningPrivateKey(seed, salt);
123
+ return bytesToHex(secp256k1.getPublicKey(privateKey));
124
+ }
125
+ /**
126
+ * Copy of message-signing-snap `signMessageWithEntropyKey`: sha256(message)
127
+ * then compact secp256k1 signature.
128
+ *
129
+ * @param message - Message to sign (must be validated by the caller).
130
+ * @param seed - BIP-39 mnemonic seed from an HD keyring.
131
+ * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.
132
+ * @returns Compact secp256k1 signature hex with `0x` prefix.
133
+ */
134
+ export async function signMessageWithMessageSigningKey(message, seed, salt = '') {
135
+ const privateKey = await deriveMessageSigningPrivateKey(seed, salt);
136
+ const digest = sha256(message);
137
+ const signature = secp256k1.sign(digest, privateKey);
138
+ return `0x${signature.toCompactHex()}`;
139
+ }
140
+ //# sourceMappingURL=message-signing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-signing.js","sourceRoot":"","sources":["../../../src/shared/utils/message-signing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,oCAAoC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,aAA6B,CAAC;AAExD,MAAM,cAAc,GAAG,UAAU,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAAG;IACxB,UAAU,EAAE,KAAK,EAAE,GAAe,EAAE,IAAgB,EAAuB,EAAE,CAC3E,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC;CAC1B,CAAC;AAEF;;;;;;;GAOG;AACH,SAAS,sBAAsB,CAAC,IAAgB;IAC9C,MAAM,KAAK,GAAwB,EAAE,CAAC;IACtC,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAElC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACzC,sCAAsC;QACtC,MAAM,SAAS,GAAG,CAAC,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,cAAc,GAAY,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,IAAI,EACJ,KAAK,EACL,IAAI,GAAG,EAAE,GAKV;IACC,MAAM,IAAI,GAAG,SAAS,CACpB,WAAW,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACpE,CAAC;IACF,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAE5D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,UAAU,CAAC,QAAQ,CAC9C;QACE,cAAc,EAAE;YACd,IAAI;YACJ,SAAS,iBAAiB,EAAE;YAC5B,GAAG,sBAAsB;SAC1B;QACD,KAAK,EAAE,WAAW;KACnB,EACD,iBAAiB,CAClB,CAAC;IAEF,MAAM,CAAC,UAAU,EAAE,iCAAiC,CAAC,CAAC;IACtD,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,IAAgB,EAChB,IAAI,GAAG,EAAE;IAET,OAAO,oBAAoB,CAAC;QAC1B,IAAI;QACJ,KAAK,EAAE,uBAAuB;QAC9B,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,IAAgB,EAChB,IAAI,GAAG,EAAE;IAET,MAAM,UAAU,GAAG,MAAM,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpE,OAAO,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,OAAe,EACf,IAAgB,EAChB,IAAI,GAAG,EAAE;IAET,MAAM,UAAU,GAAG,MAAM,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpE,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrD,OAAO,KAAK,SAAS,CAAC,YAAY,EAAE,EAAE,CAAC;AACzC,CAAC","sourcesContent":["import type { HardenedBIP32Node } from '@metamask/key-tree';\nimport { SLIP10Node } from '@metamask/key-tree';\nimport {\n assert,\n bytesToHex,\n concatBytes,\n createDataView,\n hexToBytes,\n stringToBytes,\n} from '@metamask/utils';\nimport { secp256k1 } from '@noble/curves/secp256k1';\nimport { hmac } from '@noble/hashes/hmac';\nimport { sha256, sha512 } from '@noble/hashes/sha2';\nimport { keccak_256 as keccak256 } from '@noble/hashes/sha3';\n\n/**\n * Native SIP-6 message-signing helpers for AuthenticationController /\n * UserStorageController.\n *\n * These are intentional copies of the message-signing snap crypto path so auth\n * and user-storage can derive/sign without booting\n * `npm:@metamask/message-signing-snap`. Behavior must stay byte-identical to:\n *\n * - SIP-6 derivation:\n * `@metamask/snaps-rpc-methods` `deriveEntropyFromSeed` /\n * `getEntropyDerivationPath` / `getDerivationPathArray`\n * (https://github.com/MetaMask/snaps/blob/main/packages/snaps-rpc-methods/src/utils.ts)\n * - Magic constant:\n * `@metamask/snaps-utils` `SIP_6_MAGIC_VALUE`\n * - Pubkey + `metamask:…` signing:\n * `@metamask/message-signing-snap` `getPublicEntropyKey` /\n * `signMessageWithEntropyKey`\n * (https://github.com/MetaMask/message-signing-snap/blob/main/src/entropy-keys.ts)\n *\n * `deriveEntropyFromSeed` is not a public export of\n * `@metamask/snaps-rpc-methods` today (and no core package depends on that\n * package), so the SIP-6 math is vendored here rather than imported.\n */\n\n/**\n * Snap ID used as the SIP-6 `input` so derived keys match\n * `@metamask/message-signing-snap` (`snap_getEntropy` origin).\n */\nexport const MESSAGE_SIGNING_SNAP_ID = 'npm:@metamask/message-signing-snap';\n\n/**\n * Copy of `@metamask/snaps-utils` `SIP_6_MAGIC_VALUE`\n * (`0xd36e6170 - 0x80000000`).\n *\n * @see https://metamask.github.io/SIPs/SIPS/sip-6\n */\nconst SIP_6_MAGIC_VALUE = `1399742832'` as `${number}'`;\n\nconst HARDENED_VALUE = 0x80000000;\n\n/**\n * HMAC-SHA-512 for `@metamask/key-tree`.\n *\n * Passed into `SLIP10Node.fromSeed` so SIP-6 never uses Web Crypto.\n * `@metamask/key-tree` treats any `crypto.subtle` as complete and then HMAC\n * via `importKey` / `sign`. React Native only implements `digest`; its\n * SubtleCrypto cannot HMAC. Noble HMAC is byte-identical without SubtleCrypto.\n */\nconst NOBLE_HMAC_SHA512 = {\n hmacSha512: async (key: Uint8Array, data: Uint8Array): Promise<Uint8Array> =>\n hmac(sha512, key, data),\n};\n\n/**\n * Copy of `@metamask/snaps-rpc-methods` `getDerivationPathArray`.\n *\n * Maps a 32-byte hash to eight hardened BIP-32 indices for `@metamask/key-tree`.\n *\n * @param hash - 32-byte hash.\n * @returns Hardened BIP-32 path nodes.\n */\nfunction getDerivationPathArray(hash: Uint8Array): HardenedBIP32Node[] {\n const array: HardenedBIP32Node[] = [];\n const view = createDataView(hash);\n\n for (let index = 0; index < 8; index++) {\n const uint32 = view.getUint32(index * 4);\n // eslint-disable-next-line no-bitwise\n const pathIndex = (uint32 | HARDENED_VALUE) >>> 0;\n array.push(`bip32:${pathIndex - HARDENED_VALUE}'` as const);\n }\n\n return array;\n}\n\n/**\n * Copy of `@metamask/snaps-rpc-methods` `deriveEntropyFromSeed` (SIP-6),\n * returning raw private-key bytes instead of a `0x`-prefixed hex string.\n *\n * @param options - Derivation options.\n * @param options.seed - BIP-39 mnemonic seed.\n * @param options.input - SIP-6 input (snap ID for `snap_getEntropy`).\n * @param options.salt - Optional salt. Internal auth uses `''`.\n * @returns 32-byte private key.\n */\nexport async function deriveSip6PrivateKey({\n seed,\n input,\n salt = '',\n}: {\n seed: Uint8Array;\n input: string;\n salt?: string;\n}): Promise<Uint8Array> {\n const hash = keccak256(\n concatBytes([stringToBytes(input), keccak256(stringToBytes(salt))]),\n );\n const computedDerivationPath = getDerivationPathArray(hash);\n\n const { privateKey } = await SLIP10Node.fromSeed(\n {\n derivationPath: [\n seed,\n `bip32:${SIP_6_MAGIC_VALUE}`,\n ...computedDerivationPath,\n ],\n curve: 'secp256k1',\n },\n NOBLE_HMAC_SHA512,\n );\n\n assert(privateKey, 'Failed to derive SIP-6 entropy.');\n return hexToBytes(privateKey);\n}\n\n/**\n * Derives the message-signing private key via SIP-6, matching\n * `snap_getEntropy` for the message-signing snap with empty salt\n * (internal `metamask` origin).\n *\n * @param seed - BIP-39 mnemonic seed from an HD keyring.\n * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.\n * @returns 32-byte private key.\n */\nexport async function deriveMessageSigningPrivateKey(\n seed: Uint8Array,\n salt = '',\n): Promise<Uint8Array> {\n return deriveSip6PrivateKey({\n seed,\n input: MESSAGE_SIGNING_SNAP_ID,\n salt,\n });\n}\n\n/**\n * Copy of message-signing-snap `getPublicEntropyKey`: secp256k1 pubkey hex\n * for the SIP-6 message-signing private key.\n *\n * @param seed - BIP-39 mnemonic seed from an HD keyring.\n * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.\n * @returns Public key hex with `0x` prefix.\n */\nexport async function getMessageSigningPublicKey(\n seed: Uint8Array,\n salt = '',\n): Promise<string> {\n const privateKey = await deriveMessageSigningPrivateKey(seed, salt);\n return bytesToHex(secp256k1.getPublicKey(privateKey));\n}\n\n/**\n * Copy of message-signing-snap `signMessageWithEntropyKey`: sha256(message)\n * then compact secp256k1 signature.\n *\n * @param message - Message to sign (must be validated by the caller).\n * @param seed - BIP-39 mnemonic seed from an HD keyring.\n * @param salt - Optional SIP-6 salt. Auth / user-storage use `''`.\n * @returns Compact secp256k1 signature hex with `0x` prefix.\n */\nexport async function signMessageWithMessageSigningKey(\n message: string,\n seed: Uint8Array,\n salt = '',\n): Promise<string> {\n const privateKey = await deriveMessageSigningPrivateKey(seed, salt);\n const digest = sha256(message);\n const signature = secp256k1.sign(digest, privateKey);\n return `0x${signature.toCompactHex()}`;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/profile-sync-controller",
3
- "version": "29.0.0",
3
+ "version": "31.0.0",
4
4
  "description": "The profile sync helps developers synchronize data across multiple clients and devices in a privacy-preserving way. All data saved in the user storage database is encrypted client-side to preserve privacy. The user storage provides a modular design, giving developers the flexibility to construct and manage their storage spaces in a way that best suits their needs",
5
5
  "keywords": [
6
6
  "Ethereum",
@@ -21,69 +21,32 @@
21
21
  "user-storage/",
22
22
  "sdk/"
23
23
  ],
24
+ "type": "module",
24
25
  "sideEffects": false,
25
- "main": "./dist/index.cjs",
26
- "types": "./dist/index.d.cts",
27
26
  "exports": {
28
27
  ".": {
29
- "import": {
30
- "types": "./dist/index.d.mts",
31
- "default": "./dist/index.mjs"
32
- },
33
- "require": {
34
- "types": "./dist/index.d.cts",
35
- "default": "./dist/index.cjs"
36
- }
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/index.js"
37
30
  },
38
31
  "./sdk": {
39
- "import": {
40
- "types": "./dist/sdk/index.d.mts",
41
- "default": "./dist/sdk/index.mjs"
42
- },
43
- "require": {
44
- "types": "./dist/sdk/index.d.cts",
45
- "default": "./dist/sdk/index.cjs"
46
- }
32
+ "types": "./dist/sdk/index.d.ts",
33
+ "default": "./dist/sdk/index.js"
47
34
  },
48
35
  "./auth": {
49
- "import": {
50
- "types": "./dist/controllers/authentication/index.d.mts",
51
- "default": "./dist/controllers/authentication/index.mjs"
52
- },
53
- "require": {
54
- "types": "./dist/controllers/authentication/index.d.cts",
55
- "default": "./dist/controllers/authentication/index.cjs"
56
- }
36
+ "types": "./dist/controllers/authentication/index.d.ts",
37
+ "default": "./dist/controllers/authentication/index.js"
57
38
  },
58
39
  "./auth/mocks": {
59
- "import": {
60
- "types": "./dist/controllers/authentication/mocks/index.d.mts",
61
- "default": "./dist/controllers/authentication/mocks/index.mjs"
62
- },
63
- "require": {
64
- "types": "./dist/controllers/authentication/mocks/index.d.cts",
65
- "default": "./dist/controllers/authentication/mocks/index.cjs"
66
- }
40
+ "types": "./dist/controllers/authentication/mocks/index.d.ts",
41
+ "default": "./dist/controllers/authentication/mocks/index.js"
67
42
  },
68
43
  "./user-storage": {
69
- "import": {
70
- "types": "./dist/controllers/user-storage/index.d.mts",
71
- "default": "./dist/controllers/user-storage/index.mjs"
72
- },
73
- "require": {
74
- "types": "./dist/controllers/user-storage/index.d.cts",
75
- "default": "./dist/controllers/user-storage/index.cjs"
76
- }
44
+ "types": "./dist/controllers/user-storage/index.d.ts",
45
+ "default": "./dist/controllers/user-storage/index.js"
77
46
  },
78
47
  "./user-storage/mocks": {
79
- "import": {
80
- "types": "./dist/controllers/user-storage/mocks/index.d.mts",
81
- "default": "./dist/controllers/user-storage/mocks/index.mjs"
82
- },
83
- "require": {
84
- "types": "./dist/controllers/user-storage/mocks/index.d.cts",
85
- "default": "./dist/controllers/user-storage/mocks/index.cjs"
86
- }
48
+ "types": "./dist/controllers/user-storage/mocks/index.d.ts",
49
+ "default": "./dist/controllers/user-storage/mocks/index.js"
87
50
  },
88
51
  "./package.json": "./package.json"
89
52
  },
@@ -92,9 +55,11 @@
92
55
  "registry": "https://registry.npmjs.org/"
93
56
  },
94
57
  "scripts": {
95
- "build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
96
- "build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
58
+ "build": "tsc --project tsconfig.build.json",
59
+ "build:all": "tsc --build tsconfig.build.json --verbose",
60
+ "build:clean": "yarn build:only-clean && yarn build",
97
61
  "build:docs": "typedoc",
62
+ "build:only-clean": "rimraf './dist' './tsconfig.build.tsbuildinfo'",
98
63
  "changelog:update": "../../scripts/update-changelog.sh @metamask/profile-sync-controller",
99
64
  "changelog:validate": "../../scripts/validate-changelog.sh @metamask/profile-sync-controller",
100
65
  "lint:tsconfigs": "tsx ../../scripts/lint-tsconfigs/lint-tsconfigs.mts",
@@ -108,40 +73,41 @@
108
73
  "test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
109
74
  },
110
75
  "dependencies": {
111
- "@metamask/address-book-controller": "^7.1.2",
112
- "@metamask/base-controller": "^9.1.0",
113
- "@metamask/keyring-controller": "^27.1.0",
114
- "@metamask/messenger": "^2.0.0",
115
- "@metamask/seedless-onboarding-controller": "^10.1.1",
116
- "@metamask/snaps-controllers": "^19.0.0",
117
- "@metamask/snaps-sdk": "^11.0.0",
118
- "@metamask/snaps-utils": "^12.1.2",
119
- "@metamask/utils": "^11.11.0",
76
+ "@metamask/address-book-controller": "^8.0.0",
77
+ "@metamask/base-controller": "^10.0.0",
78
+ "@metamask/key-tree": "^10.1.1",
79
+ "@metamask/keyring-controller": "^28.0.0",
80
+ "@metamask/messenger": "^3.0.0",
81
+ "@metamask/seedless-onboarding-controller": "^11.0.0",
82
+ "@metamask/utils": "^11.12.0",
120
83
  "@noble/ciphers": "^1.3.0",
84
+ "@noble/curves": "^1.9.2",
121
85
  "@noble/hashes": "^1.8.0",
86
+ "@signinwithethereum/siwe": "^4.2.1",
122
87
  "immer": "^9.0.6",
123
- "loglevel": "^1.8.1",
124
- "siwe": "^2.3.2"
88
+ "loglevel": "^1.8.1"
125
89
  },
126
90
  "devDependencies": {
127
91
  "@lavamoat/allow-scripts": "^3.0.4",
128
92
  "@lavamoat/preinstall-always-fail": "^2.1.0",
129
93
  "@metamask/auto-changelog": "^6.1.0",
130
- "@metamask/keyring-api": "^23.7.0",
131
- "@metamask/keyring-internal-api": "^11.0.2",
94
+ "@metamask/eth-hd-keyring": "^15.0.0",
95
+ "@metamask/keyring-api": "^24.0.0",
96
+ "@metamask/keyring-internal-api": "^12.0.0",
132
97
  "@metamask/providers": "^22.1.0",
133
- "@ts-bridge/cli": "^0.6.4",
134
98
  "@types/jest": "^30.0.0",
99
+ "@typescript/native": "npm:typescript@^7.0.2",
135
100
  "deepmerge": "^4.2.2",
136
101
  "ethers": "^6.12.0",
137
102
  "jest": "^30.4.2",
138
103
  "jest-environment-jsdom": "^30.4.1",
139
104
  "nock": "^13.3.1",
105
+ "rimraf": "^5.0.5",
140
106
  "ts-jest": "^29.4.11",
141
107
  "tsx": "^4.20.5",
142
108
  "typedoc": "^0.25.13",
143
109
  "typedoc-plugin-missing-exports": "^2.0.0",
144
- "typescript": "~5.3.3",
110
+ "typescript": "npm:@typescript/typescript6@^6.0.2",
145
111
  "webextension-polyfill": "^0.12.0"
146
112
  },
147
113
  "peerDependencies": {
@@ -149,7 +115,7 @@
149
115
  "webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
150
116
  },
151
117
  "engines": {
152
- "node": "^18.18 || >=20"
118
+ "node": "^22.14.0 || ^24"
153
119
  },
154
120
  "lavamoat": {
155
121
  "allowScripts": {}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file is auto generated.
4
- * Do not edit manually.
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=AuthenticationController-method-action-types.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthenticationController-method-action-types.cjs","sourceRoot":"","sources":["../../../src/controllers/authentication/AuthenticationController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { AuthenticationController } from './AuthenticationController.js';\n\nexport type AuthenticationControllerPerformSignInAction = {\n type: `AuthenticationController:performSignIn`;\n handler: AuthenticationController['performSignIn'];\n};\n\n/**\n * Marks profile pairing as needed. Clients call this when the SRP set\n * changes (e.g. a new keyring was added) so the next auto-sign-in cycle\n * re-runs `performSignIn` and re-pairs.\n */\nexport type AuthenticationControllerRequestProfilePairingAction = {\n type: `AuthenticationController:requestProfilePairing`;\n handler: AuthenticationController['requestProfilePairing'];\n};\n\nexport type AuthenticationControllerPerformSignOutAction = {\n type: `AuthenticationController:performSignOut`;\n handler: AuthenticationController['performSignOut'];\n};\n\n/**\n * Returns a bearer token for the specified SRP, logging in if needed.\n *\n * When called without `entropySourceId`, returns the primary (first) SRP's\n * access token, which is effectively the canonical\n * profile's token that can be used by alias-aware consumers for cross-SRP\n * operations.\n *\n * @param entropySourceId - The entropy source ID. Omit for the primary SRP.\n * @returns The OIDC access token.\n */\nexport type AuthenticationControllerGetBearerTokenAction = {\n type: `AuthenticationController:getBearerToken`;\n handler: AuthenticationController['getBearerToken'];\n};\n\n/**\n * Returns the cached session profile, logging in if no session exists.\n *\n * The returned `canonicalProfileId` reflects the value from the most recent\n * login or pairing. In the rare event where a canonical changed because of\n * a pairing that happened on another device, the cached value may be stale\n * until the next login. For guaranteed freshness, call\n * `refreshCanonicalProfileId()` before reading `canonicalProfileId`.\n *\n * @param entropySourceId - The entropy source ID used to derive the key,\n * when multiple sources are available (Multi-SRP).\n * @returns profile for the session.\n */\nexport type AuthenticationControllerGetSessionProfileAction = {\n type: `AuthenticationController:getSessionProfile`;\n handler: AuthenticationController['getSessionProfile'];\n};\n\n/**\n * Forces a fresh retrieval of the canonical profile ID from the server\n * and propagates it to all cached SRP sessions.\n *\n * This method invalidates the primary SRP's cached session and forces a\n * re-login. Use it before operations that require a guaranteed-fresh\n * canonical (e.g. storage key derivation for Accounts ADR 0005). For\n * best-effort reads, use\n * `getSessionProfile().canonicalProfileId` instead.\n *\n * Only the primary SRP is re-logged-in regardless of how many SRPs exist —\n * the server returns the current canonical for the entire pairing group\n * from any single SRP login.\n *\n * @returns The refreshed canonical profile ID.\n */\nexport type AuthenticationControllerRefreshCanonicalProfileIdAction = {\n type: `AuthenticationController:refreshCanonicalProfileId`;\n handler: AuthenticationController['refreshCanonicalProfileId'];\n};\n\nexport type AuthenticationControllerGetUserProfileLineageAction = {\n type: `AuthenticationController:getUserProfileLineage`;\n handler: AuthenticationController['getUserProfileLineage'];\n};\n\n/**\n * Returns a Customer Service specific access token for the specified SRP,\n * logging in if needed.\n *\n * Exchanges the OIDC access token for a short-lived token scoped to the\n * customer-service audience. Customer Service tooling consumes this token to\n * identify and authenticate the user.\n *\n * @param entropySourceId - The entropy source ID. Omit for the primary SRP.\n * @returns The customer-service access token.\n */\nexport type AuthenticationControllerGetCustomerServiceTokenAction = {\n type: `AuthenticationController:getCustomerServiceToken`;\n handler: AuthenticationController['getCustomerServiceToken'];\n};\n\nexport type AuthenticationControllerIsSignedInAction = {\n type: `AuthenticationController:isSignedIn`;\n handler: AuthenticationController['isSignedIn'];\n};\n\n/**\n * Union of all AuthenticationController action types.\n */\nexport type AuthenticationControllerMethodActions =\n | AuthenticationControllerPerformSignInAction\n | AuthenticationControllerRequestProfilePairingAction\n | AuthenticationControllerPerformSignOutAction\n | AuthenticationControllerGetBearerTokenAction\n | AuthenticationControllerGetSessionProfileAction\n | AuthenticationControllerRefreshCanonicalProfileIdAction\n | AuthenticationControllerGetUserProfileLineageAction\n | AuthenticationControllerGetCustomerServiceTokenAction\n | AuthenticationControllerIsSignedInAction;\n"]}
@@ -1,102 +0,0 @@
1
- /**
2
- * This file is auto generated.
3
- * Do not edit manually.
4
- */
5
- import type { AuthenticationController } from "./AuthenticationController.cjs";
6
- export type AuthenticationControllerPerformSignInAction = {
7
- type: `AuthenticationController:performSignIn`;
8
- handler: AuthenticationController['performSignIn'];
9
- };
10
- /**
11
- * Marks profile pairing as needed. Clients call this when the SRP set
12
- * changes (e.g. a new keyring was added) so the next auto-sign-in cycle
13
- * re-runs `performSignIn` and re-pairs.
14
- */
15
- export type AuthenticationControllerRequestProfilePairingAction = {
16
- type: `AuthenticationController:requestProfilePairing`;
17
- handler: AuthenticationController['requestProfilePairing'];
18
- };
19
- export type AuthenticationControllerPerformSignOutAction = {
20
- type: `AuthenticationController:performSignOut`;
21
- handler: AuthenticationController['performSignOut'];
22
- };
23
- /**
24
- * Returns a bearer token for the specified SRP, logging in if needed.
25
- *
26
- * When called without `entropySourceId`, returns the primary (first) SRP's
27
- * access token, which is effectively the canonical
28
- * profile's token that can be used by alias-aware consumers for cross-SRP
29
- * operations.
30
- *
31
- * @param entropySourceId - The entropy source ID. Omit for the primary SRP.
32
- * @returns The OIDC access token.
33
- */
34
- export type AuthenticationControllerGetBearerTokenAction = {
35
- type: `AuthenticationController:getBearerToken`;
36
- handler: AuthenticationController['getBearerToken'];
37
- };
38
- /**
39
- * Returns the cached session profile, logging in if no session exists.
40
- *
41
- * The returned `canonicalProfileId` reflects the value from the most recent
42
- * login or pairing. In the rare event where a canonical changed because of
43
- * a pairing that happened on another device, the cached value may be stale
44
- * until the next login. For guaranteed freshness, call
45
- * `refreshCanonicalProfileId()` before reading `canonicalProfileId`.
46
- *
47
- * @param entropySourceId - The entropy source ID used to derive the key,
48
- * when multiple sources are available (Multi-SRP).
49
- * @returns profile for the session.
50
- */
51
- export type AuthenticationControllerGetSessionProfileAction = {
52
- type: `AuthenticationController:getSessionProfile`;
53
- handler: AuthenticationController['getSessionProfile'];
54
- };
55
- /**
56
- * Forces a fresh retrieval of the canonical profile ID from the server
57
- * and propagates it to all cached SRP sessions.
58
- *
59
- * This method invalidates the primary SRP's cached session and forces a
60
- * re-login. Use it before operations that require a guaranteed-fresh
61
- * canonical (e.g. storage key derivation for Accounts ADR 0005). For
62
- * best-effort reads, use
63
- * `getSessionProfile().canonicalProfileId` instead.
64
- *
65
- * Only the primary SRP is re-logged-in regardless of how many SRPs exist —
66
- * the server returns the current canonical for the entire pairing group
67
- * from any single SRP login.
68
- *
69
- * @returns The refreshed canonical profile ID.
70
- */
71
- export type AuthenticationControllerRefreshCanonicalProfileIdAction = {
72
- type: `AuthenticationController:refreshCanonicalProfileId`;
73
- handler: AuthenticationController['refreshCanonicalProfileId'];
74
- };
75
- export type AuthenticationControllerGetUserProfileLineageAction = {
76
- type: `AuthenticationController:getUserProfileLineage`;
77
- handler: AuthenticationController['getUserProfileLineage'];
78
- };
79
- /**
80
- * Returns a Customer Service specific access token for the specified SRP,
81
- * logging in if needed.
82
- *
83
- * Exchanges the OIDC access token for a short-lived token scoped to the
84
- * customer-service audience. Customer Service tooling consumes this token to
85
- * identify and authenticate the user.
86
- *
87
- * @param entropySourceId - The entropy source ID. Omit for the primary SRP.
88
- * @returns The customer-service access token.
89
- */
90
- export type AuthenticationControllerGetCustomerServiceTokenAction = {
91
- type: `AuthenticationController:getCustomerServiceToken`;
92
- handler: AuthenticationController['getCustomerServiceToken'];
93
- };
94
- export type AuthenticationControllerIsSignedInAction = {
95
- type: `AuthenticationController:isSignedIn`;
96
- handler: AuthenticationController['isSignedIn'];
97
- };
98
- /**
99
- * Union of all AuthenticationController action types.
100
- */
101
- export type AuthenticationControllerMethodActions = AuthenticationControllerPerformSignInAction | AuthenticationControllerRequestProfilePairingAction | AuthenticationControllerPerformSignOutAction | AuthenticationControllerGetBearerTokenAction | AuthenticationControllerGetSessionProfileAction | AuthenticationControllerRefreshCanonicalProfileIdAction | AuthenticationControllerGetUserProfileLineageAction | AuthenticationControllerGetCustomerServiceTokenAction | AuthenticationControllerIsSignedInAction;
102
- //# sourceMappingURL=AuthenticationController-method-action-types.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthenticationController-method-action-types.d.cts","sourceRoot":"","sources":["../../../src/controllers/authentication/AuthenticationController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAsC;AAE9E,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,wBAAwB,CAAC,eAAe,CAAC,CAAC;CACpD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,wBAAwB,CAAC,uBAAuB,CAAC,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,uDAAuD,GAAG;IACpE,IAAI,EAAE,oDAAoD,CAAC;IAC3D,OAAO,EAAE,wBAAwB,CAAC,2BAA2B,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,wBAAwB,CAAC,uBAAuB,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qDAAqD,GAAG;IAClE,IAAI,EAAE,kDAAkD,CAAC;IACzD,OAAO,EAAE,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,wBAAwB,CAAC,YAAY,CAAC,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC7C,2CAA2C,GAC3C,mDAAmD,GACnD,4CAA4C,GAC5C,4CAA4C,GAC5C,+CAA+C,GAC/C,uDAAuD,GACvD,mDAAmD,GACnD,qDAAqD,GACrD,wCAAwC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthenticationController-method-action-types.d.mts","sourceRoot":"","sources":["../../../src/controllers/authentication/AuthenticationController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAsC;AAE9E,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,wBAAwB,CAAC,eAAe,CAAC,CAAC;CACpD,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,wBAAwB,CAAC,uBAAuB,CAAC,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,uDAAuD,GAAG;IACpE,IAAI,EAAE,oDAAoD,CAAC;IAC3D,OAAO,EAAE,wBAAwB,CAAC,2BAA2B,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,mDAAmD,GAAG;IAChE,IAAI,EAAE,gDAAgD,CAAC;IACvD,OAAO,EAAE,wBAAwB,CAAC,uBAAuB,CAAC,CAAC;CAC5D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qDAAqD,GAAG;IAClE,IAAI,EAAE,kDAAkD,CAAC;IACzD,OAAO,EAAE,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,wBAAwB,CAAC,YAAY,CAAC,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC7C,2CAA2C,GAC3C,mDAAmD,GACnD,4CAA4C,GAC5C,4CAA4C,GAC5C,+CAA+C,GAC/C,uDAAuD,GACvD,mDAAmD,GACnD,qDAAqD,GACrD,wCAAwC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthenticationController-method-action-types.mjs","sourceRoot":"","sources":["../../../src/controllers/authentication/AuthenticationController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { AuthenticationController } from './AuthenticationController.js';\n\nexport type AuthenticationControllerPerformSignInAction = {\n type: `AuthenticationController:performSignIn`;\n handler: AuthenticationController['performSignIn'];\n};\n\n/**\n * Marks profile pairing as needed. Clients call this when the SRP set\n * changes (e.g. a new keyring was added) so the next auto-sign-in cycle\n * re-runs `performSignIn` and re-pairs.\n */\nexport type AuthenticationControllerRequestProfilePairingAction = {\n type: `AuthenticationController:requestProfilePairing`;\n handler: AuthenticationController['requestProfilePairing'];\n};\n\nexport type AuthenticationControllerPerformSignOutAction = {\n type: `AuthenticationController:performSignOut`;\n handler: AuthenticationController['performSignOut'];\n};\n\n/**\n * Returns a bearer token for the specified SRP, logging in if needed.\n *\n * When called without `entropySourceId`, returns the primary (first) SRP's\n * access token, which is effectively the canonical\n * profile's token that can be used by alias-aware consumers for cross-SRP\n * operations.\n *\n * @param entropySourceId - The entropy source ID. Omit for the primary SRP.\n * @returns The OIDC access token.\n */\nexport type AuthenticationControllerGetBearerTokenAction = {\n type: `AuthenticationController:getBearerToken`;\n handler: AuthenticationController['getBearerToken'];\n};\n\n/**\n * Returns the cached session profile, logging in if no session exists.\n *\n * The returned `canonicalProfileId` reflects the value from the most recent\n * login or pairing. In the rare event where a canonical changed because of\n * a pairing that happened on another device, the cached value may be stale\n * until the next login. For guaranteed freshness, call\n * `refreshCanonicalProfileId()` before reading `canonicalProfileId`.\n *\n * @param entropySourceId - The entropy source ID used to derive the key,\n * when multiple sources are available (Multi-SRP).\n * @returns profile for the session.\n */\nexport type AuthenticationControllerGetSessionProfileAction = {\n type: `AuthenticationController:getSessionProfile`;\n handler: AuthenticationController['getSessionProfile'];\n};\n\n/**\n * Forces a fresh retrieval of the canonical profile ID from the server\n * and propagates it to all cached SRP sessions.\n *\n * This method invalidates the primary SRP's cached session and forces a\n * re-login. Use it before operations that require a guaranteed-fresh\n * canonical (e.g. storage key derivation for Accounts ADR 0005). For\n * best-effort reads, use\n * `getSessionProfile().canonicalProfileId` instead.\n *\n * Only the primary SRP is re-logged-in regardless of how many SRPs exist —\n * the server returns the current canonical for the entire pairing group\n * from any single SRP login.\n *\n * @returns The refreshed canonical profile ID.\n */\nexport type AuthenticationControllerRefreshCanonicalProfileIdAction = {\n type: `AuthenticationController:refreshCanonicalProfileId`;\n handler: AuthenticationController['refreshCanonicalProfileId'];\n};\n\nexport type AuthenticationControllerGetUserProfileLineageAction = {\n type: `AuthenticationController:getUserProfileLineage`;\n handler: AuthenticationController['getUserProfileLineage'];\n};\n\n/**\n * Returns a Customer Service specific access token for the specified SRP,\n * logging in if needed.\n *\n * Exchanges the OIDC access token for a short-lived token scoped to the\n * customer-service audience. Customer Service tooling consumes this token to\n * identify and authenticate the user.\n *\n * @param entropySourceId - The entropy source ID. Omit for the primary SRP.\n * @returns The customer-service access token.\n */\nexport type AuthenticationControllerGetCustomerServiceTokenAction = {\n type: `AuthenticationController:getCustomerServiceToken`;\n handler: AuthenticationController['getCustomerServiceToken'];\n};\n\nexport type AuthenticationControllerIsSignedInAction = {\n type: `AuthenticationController:isSignedIn`;\n handler: AuthenticationController['isSignedIn'];\n};\n\n/**\n * Union of all AuthenticationController action types.\n */\nexport type AuthenticationControllerMethodActions =\n | AuthenticationControllerPerformSignInAction\n | AuthenticationControllerRequestProfilePairingAction\n | AuthenticationControllerPerformSignOutAction\n | AuthenticationControllerGetBearerTokenAction\n | AuthenticationControllerGetSessionProfileAction\n | AuthenticationControllerRefreshCanonicalProfileIdAction\n | AuthenticationControllerGetUserProfileLineageAction\n | AuthenticationControllerGetCustomerServiceTokenAction\n | AuthenticationControllerIsSignedInAction;\n"]}