@did-btcr2/method 0.17.2 → 0.18.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 (366) hide show
  1. package/dist/browser.js +30124 -19552
  2. package/dist/browser.mjs +30123 -19551
  3. package/dist/cjs/core/beacon/aggregation/cohort/index.js +225 -0
  4. package/dist/cjs/core/beacon/aggregation/cohort/index.js.map +1 -0
  5. package/dist/{esm/core/beacon/aggregation → cjs/core/beacon/aggregation/cohort}/messages/base.js +3 -11
  6. package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js.map +1 -0
  7. package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js +11 -0
  8. package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js.map +1 -0
  9. package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js +98 -0
  10. package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js.map +1 -0
  11. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +30 -0
  12. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -0
  13. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +28 -0
  14. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -0
  15. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +26 -0
  16. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -0
  17. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +22 -0
  18. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -0
  19. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +27 -0
  20. package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -0
  21. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +28 -0
  22. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -0
  23. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +29 -0
  24. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -0
  25. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +29 -0
  26. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -0
  27. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js +29 -0
  28. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -0
  29. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +30 -0
  30. package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -0
  31. package/dist/cjs/core/beacon/aggregation/cohort/status.js.map +1 -0
  32. package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js +126 -0
  33. package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -0
  34. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js +230 -0
  35. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -0
  36. package/dist/cjs/core/beacon/aggregation/communication/error.js +12 -0
  37. package/dist/cjs/core/beacon/aggregation/communication/error.js.map +1 -0
  38. package/dist/cjs/core/beacon/aggregation/communication/factory.js +21 -0
  39. package/dist/cjs/core/beacon/aggregation/communication/factory.js.map +1 -0
  40. package/dist/cjs/core/beacon/aggregation/communication/service.js.map +1 -0
  41. package/dist/cjs/core/beacon/aggregation/coordinator.js +282 -56
  42. package/dist/cjs/core/beacon/aggregation/coordinator.js.map +1 -1
  43. package/dist/cjs/core/beacon/aggregation/participant.js +435 -1
  44. package/dist/cjs/core/beacon/aggregation/participant.js.map +1 -1
  45. package/dist/cjs/core/beacon/aggregation/session/index.js +233 -0
  46. package/dist/cjs/core/beacon/aggregation/session/index.js.map +1 -0
  47. package/dist/cjs/core/beacon/aggregation/session/status.js +11 -0
  48. package/dist/cjs/core/beacon/aggregation/session/status.js.map +1 -0
  49. package/dist/cjs/core/beacon/cid-aggregate.js.map +1 -1
  50. package/dist/cjs/core/beacon/error.js +37 -0
  51. package/dist/cjs/core/beacon/error.js.map +1 -0
  52. package/dist/cjs/core/beacon/factory.js.map +1 -1
  53. package/dist/cjs/core/beacon/singleton.js +8 -5
  54. package/dist/cjs/core/beacon/singleton.js.map +1 -1
  55. package/dist/cjs/core/beacon/smt-aggregate.js.map +1 -1
  56. package/dist/cjs/{utils/beacons.js → core/beacon/utils.js} +4 -4
  57. package/dist/cjs/core/beacon/utils.js.map +1 -0
  58. package/dist/cjs/core/crud/read.js +2 -9
  59. package/dist/cjs/core/crud/read.js.map +1 -1
  60. package/dist/cjs/core/crud/update.js +18 -19
  61. package/dist/cjs/core/crud/update.js.map +1 -1
  62. package/dist/{esm/utils → cjs/core}/identifier.js +18 -3
  63. package/dist/cjs/core/identifier.js.map +1 -0
  64. package/dist/cjs/did-btcr2.js +2 -2
  65. package/dist/cjs/did-btcr2.js.map +1 -1
  66. package/dist/cjs/index.js +28 -6
  67. package/dist/cjs/index.js.map +1 -1
  68. package/dist/cjs/interfaces/beacon.js.map +1 -1
  69. package/dist/cjs/utils/appendix.js +2 -3
  70. package/dist/cjs/utils/appendix.js.map +1 -1
  71. package/dist/cjs/utils/did-document.js +4 -6
  72. package/dist/cjs/utils/did-document.js.map +1 -1
  73. package/dist/cjs/utils/types.js +2 -0
  74. package/dist/cjs/utils/types.js.map +1 -0
  75. package/dist/esm/core/beacon/aggregation/cohort/index.js +225 -0
  76. package/dist/esm/core/beacon/aggregation/cohort/index.js.map +1 -0
  77. package/dist/{cjs/core/beacon/aggregation → esm/core/beacon/aggregation/cohort}/messages/base.js +3 -11
  78. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +1 -0
  79. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js +11 -0
  80. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js.map +1 -0
  81. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js +98 -0
  82. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js.map +1 -0
  83. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +30 -0
  84. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -0
  85. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +28 -0
  86. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -0
  87. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +26 -0
  88. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -0
  89. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +22 -0
  90. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -0
  91. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +27 -0
  92. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -0
  93. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +28 -0
  94. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -0
  95. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +29 -0
  96. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -0
  97. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +29 -0
  98. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -0
  99. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +29 -0
  100. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -0
  101. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +30 -0
  102. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -0
  103. package/dist/esm/core/beacon/aggregation/cohort/status.js.map +1 -0
  104. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +126 -0
  105. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -0
  106. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +230 -0
  107. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -0
  108. package/dist/esm/core/beacon/aggregation/communication/error.js +12 -0
  109. package/dist/esm/core/beacon/aggregation/communication/error.js.map +1 -0
  110. package/dist/esm/core/beacon/aggregation/communication/factory.js +21 -0
  111. package/dist/esm/core/beacon/aggregation/communication/factory.js.map +1 -0
  112. package/dist/esm/core/beacon/aggregation/communication/service.js.map +1 -0
  113. package/dist/esm/core/beacon/aggregation/coordinator.js +282 -56
  114. package/dist/esm/core/beacon/aggregation/coordinator.js.map +1 -1
  115. package/dist/esm/core/beacon/aggregation/participant.js +435 -1
  116. package/dist/esm/core/beacon/aggregation/participant.js.map +1 -1
  117. package/dist/esm/core/beacon/aggregation/session/index.js +233 -0
  118. package/dist/esm/core/beacon/aggregation/session/index.js.map +1 -0
  119. package/dist/esm/core/beacon/aggregation/session/status.js +11 -0
  120. package/dist/esm/core/beacon/aggregation/session/status.js.map +1 -0
  121. package/dist/esm/core/beacon/cid-aggregate.js.map +1 -1
  122. package/dist/esm/core/beacon/error.js +37 -0
  123. package/dist/esm/core/beacon/error.js.map +1 -0
  124. package/dist/esm/core/beacon/factory.js.map +1 -1
  125. package/dist/esm/core/beacon/singleton.js +8 -5
  126. package/dist/esm/core/beacon/singleton.js.map +1 -1
  127. package/dist/esm/core/beacon/smt-aggregate.js.map +1 -1
  128. package/dist/esm/{utils/beacons.js → core/beacon/utils.js} +4 -4
  129. package/dist/esm/core/beacon/utils.js.map +1 -0
  130. package/dist/esm/core/crud/read.js +2 -9
  131. package/dist/esm/core/crud/read.js.map +1 -1
  132. package/dist/esm/core/crud/update.js +18 -19
  133. package/dist/esm/core/crud/update.js.map +1 -1
  134. package/dist/{cjs/utils → esm/core}/identifier.js +18 -3
  135. package/dist/esm/core/identifier.js.map +1 -0
  136. package/dist/esm/did-btcr2.js +2 -2
  137. package/dist/esm/did-btcr2.js.map +1 -1
  138. package/dist/esm/index.js +28 -6
  139. package/dist/esm/index.js.map +1 -1
  140. package/dist/esm/interfaces/beacon.js.map +1 -1
  141. package/dist/esm/utils/appendix.js +2 -3
  142. package/dist/esm/utils/appendix.js.map +1 -1
  143. package/dist/esm/utils/did-document.js +4 -6
  144. package/dist/esm/utils/did-document.js.map +1 -1
  145. package/dist/esm/utils/types.js +2 -0
  146. package/dist/esm/utils/types.js.map +1 -0
  147. package/dist/types/core/beacon/aggregation/cohort/index.d.ts +135 -0
  148. package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +1 -0
  149. package/dist/types/core/beacon/aggregation/{messages → cohort/messages}/base.d.ts +13 -8
  150. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +1 -0
  151. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +10 -0
  152. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts.map +1 -0
  153. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +64 -0
  154. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts.map +1 -0
  155. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +28 -0
  156. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +1 -0
  157. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +26 -0
  158. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +1 -0
  159. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +23 -0
  160. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +1 -0
  161. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +19 -0
  162. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +1 -0
  163. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +24 -0
  164. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +1 -0
  165. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +24 -0
  166. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +1 -0
  167. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +25 -0
  168. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +1 -0
  169. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +25 -0
  170. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +1 -0
  171. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +25 -0
  172. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +1 -0
  173. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +26 -0
  174. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +1 -0
  175. package/dist/types/core/beacon/aggregation/cohort/status.d.ts.map +1 -0
  176. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +88 -0
  177. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +1 -0
  178. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +93 -0
  179. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +1 -0
  180. package/dist/types/core/beacon/aggregation/communication/error.d.ts +7 -0
  181. package/dist/types/core/beacon/aggregation/communication/error.d.ts.map +1 -0
  182. package/dist/types/core/beacon/aggregation/communication/factory.d.ts +9 -0
  183. package/dist/types/core/beacon/aggregation/communication/factory.d.ts.map +1 -0
  184. package/dist/types/core/beacon/aggregation/communication/service.d.ts +35 -0
  185. package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +1 -0
  186. package/dist/types/core/beacon/aggregation/coordinator.d.ts +79 -26
  187. package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +1 -1
  188. package/dist/types/core/beacon/aggregation/participant.d.ts +190 -0
  189. package/dist/types/core/beacon/aggregation/participant.d.ts.map +1 -1
  190. package/dist/types/core/beacon/aggregation/session/index.d.ts +155 -0
  191. package/dist/types/core/beacon/aggregation/session/index.d.ts.map +1 -0
  192. package/dist/types/core/beacon/aggregation/session/status.d.ts +10 -0
  193. package/dist/types/core/beacon/aggregation/session/status.d.ts.map +1 -0
  194. package/dist/types/core/beacon/cid-aggregate.d.ts +3 -4
  195. package/dist/types/core/beacon/cid-aggregate.d.ts.map +1 -1
  196. package/dist/types/core/beacon/error.d.ts +22 -0
  197. package/dist/types/core/beacon/error.d.ts.map +1 -0
  198. package/dist/types/core/beacon/factory.d.ts +2 -3
  199. package/dist/types/core/beacon/factory.d.ts.map +1 -1
  200. package/dist/types/core/beacon/singleton.d.ts +2 -3
  201. package/dist/types/core/beacon/singleton.d.ts.map +1 -1
  202. package/dist/types/core/beacon/smt-aggregate.d.ts +3 -4
  203. package/dist/types/core/beacon/smt-aggregate.d.ts.map +1 -1
  204. package/dist/types/{utils/beacons.d.ts → core/beacon/utils.d.ts} +3 -3
  205. package/dist/types/core/beacon/utils.d.ts.map +1 -0
  206. package/dist/types/core/crud/read.d.ts +3 -3
  207. package/dist/types/core/crud/read.d.ts.map +1 -1
  208. package/dist/types/core/crud/update.d.ts +1 -1
  209. package/dist/types/core/crud/update.d.ts.map +1 -1
  210. package/dist/types/{utils → core}/identifier.d.ts +24 -3
  211. package/dist/types/core/identifier.d.ts.map +1 -0
  212. package/dist/types/did-btcr2.d.ts +1 -1
  213. package/dist/types/did-btcr2.d.ts.map +1 -1
  214. package/dist/types/index.d.ts +28 -6
  215. package/dist/types/index.d.ts.map +1 -1
  216. package/dist/types/interfaces/beacon.d.ts +65 -5
  217. package/dist/types/interfaces/beacon.d.ts.map +1 -1
  218. package/dist/types/interfaces/crud.d.ts +1 -1
  219. package/dist/types/interfaces/crud.d.ts.map +1 -1
  220. package/dist/types/utils/appendix.d.ts +2 -10
  221. package/dist/types/utils/appendix.d.ts.map +1 -1
  222. package/dist/types/utils/did-document-builder.d.ts +1 -1
  223. package/dist/types/utils/did-document-builder.d.ts.map +1 -1
  224. package/dist/types/utils/did-document.d.ts +1 -1
  225. package/dist/types/utils/did-document.d.ts.map +1 -1
  226. package/dist/types/{types/crud.d.ts → utils/types.d.ts} +2 -2
  227. package/dist/types/utils/types.d.ts.map +1 -0
  228. package/package.json +4 -3
  229. package/src/core/beacon/aggregation/cohort/index.ts +292 -0
  230. package/src/core/beacon/aggregation/{messages → cohort/messages}/base.ts +14 -16
  231. package/src/core/beacon/aggregation/cohort/messages/constants.ts +12 -0
  232. package/src/core/beacon/aggregation/cohort/messages/index.ts +143 -0
  233. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +43 -0
  234. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +39 -0
  235. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +34 -0
  236. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +33 -0
  237. package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +35 -0
  238. package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +38 -0
  239. package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +39 -0
  240. package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +39 -0
  241. package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +39 -0
  242. package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +40 -0
  243. package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +153 -0
  244. package/src/core/beacon/aggregation/communication/adapter/nostr.ts +300 -0
  245. package/src/core/beacon/aggregation/communication/error.ts +13 -0
  246. package/src/core/beacon/aggregation/communication/factory.ts +25 -0
  247. package/src/core/beacon/aggregation/communication/service.ts +42 -0
  248. package/src/core/beacon/aggregation/coordinator.ts +338 -67
  249. package/src/core/beacon/aggregation/participant.ts +512 -0
  250. package/src/core/beacon/aggregation/session/index.ts +289 -0
  251. package/src/core/beacon/aggregation/session/status.ts +18 -0
  252. package/src/core/beacon/cid-aggregate.ts +4 -5
  253. package/src/core/beacon/error.ts +44 -0
  254. package/src/core/beacon/factory.ts +2 -3
  255. package/src/core/beacon/singleton.ts +10 -8
  256. package/src/core/beacon/smt-aggregate.ts +4 -5
  257. package/src/{utils/beacons.ts → core/beacon/utils.ts} +5 -5
  258. package/src/core/crud/read.ts +7 -16
  259. package/src/core/crud/update.ts +25 -22
  260. package/src/{utils → core}/identifier.ts +35 -5
  261. package/src/did-btcr2.ts +4 -4
  262. package/src/index.ts +36 -8
  263. package/src/interfaces/beacon.ts +75 -5
  264. package/src/interfaces/crud.ts +1 -1
  265. package/src/utils/appendix.ts +3 -11
  266. package/src/utils/did-document-builder.ts +1 -1
  267. package/src/utils/did-document.ts +4 -7
  268. package/src/{types/crud.ts → utils/types.ts} +2 -2
  269. package/dist/cjs/core/beacon/aggregation/messages/advert.js +0 -24
  270. package/dist/cjs/core/beacon/aggregation/messages/advert.js.map +0 -1
  271. package/dist/cjs/core/beacon/aggregation/messages/base.js.map +0 -1
  272. package/dist/cjs/core/beacon/aggregation/messages/cohort-set.js +0 -25
  273. package/dist/cjs/core/beacon/aggregation/messages/cohort-set.js.map +0 -1
  274. package/dist/cjs/core/beacon/aggregation/messages/keygen.js +0 -8
  275. package/dist/cjs/core/beacon/aggregation/messages/keygen.js.map +0 -1
  276. package/dist/cjs/core/beacon/aggregation/messages/opt-in.js +0 -23
  277. package/dist/cjs/core/beacon/aggregation/messages/opt-in.js.map +0 -1
  278. package/dist/cjs/core/beacon/aggregation/messages/sign.js +0 -7
  279. package/dist/cjs/core/beacon/aggregation/messages/sign.js.map +0 -1
  280. package/dist/cjs/core/beacon/aggregation/models/cohort/index.js +0 -92
  281. package/dist/cjs/core/beacon/aggregation/models/cohort/index.js.map +0 -1
  282. package/dist/cjs/core/beacon/aggregation/models/cohort/status.js.map +0 -1
  283. package/dist/cjs/core/beacon/aggregation/protocol/nostr.js +0 -57
  284. package/dist/cjs/core/beacon/aggregation/protocol/nostr.js.map +0 -1
  285. package/dist/cjs/core/beacon/aggregation/protocol/service.js.map +0 -1
  286. package/dist/cjs/core/key-manager/index.js +0 -290
  287. package/dist/cjs/core/key-manager/index.js.map +0 -1
  288. package/dist/cjs/core/key-manager/interface.js +0 -2
  289. package/dist/cjs/core/key-manager/interface.js.map +0 -1
  290. package/dist/cjs/interfaces/ibeacon.js +0 -2
  291. package/dist/cjs/interfaces/ibeacon.js.map +0 -1
  292. package/dist/cjs/types/crud.js +0 -2
  293. package/dist/cjs/types/crud.js.map +0 -1
  294. package/dist/cjs/utils/beacons.js.map +0 -1
  295. package/dist/cjs/utils/identifier.js.map +0 -1
  296. package/dist/esm/core/beacon/aggregation/messages/advert.js +0 -24
  297. package/dist/esm/core/beacon/aggregation/messages/advert.js.map +0 -1
  298. package/dist/esm/core/beacon/aggregation/messages/base.js.map +0 -1
  299. package/dist/esm/core/beacon/aggregation/messages/cohort-set.js +0 -25
  300. package/dist/esm/core/beacon/aggregation/messages/cohort-set.js.map +0 -1
  301. package/dist/esm/core/beacon/aggregation/messages/keygen.js +0 -8
  302. package/dist/esm/core/beacon/aggregation/messages/keygen.js.map +0 -1
  303. package/dist/esm/core/beacon/aggregation/messages/opt-in.js +0 -23
  304. package/dist/esm/core/beacon/aggregation/messages/opt-in.js.map +0 -1
  305. package/dist/esm/core/beacon/aggregation/messages/sign.js +0 -7
  306. package/dist/esm/core/beacon/aggregation/messages/sign.js.map +0 -1
  307. package/dist/esm/core/beacon/aggregation/models/cohort/index.js +0 -92
  308. package/dist/esm/core/beacon/aggregation/models/cohort/index.js.map +0 -1
  309. package/dist/esm/core/beacon/aggregation/models/cohort/status.js.map +0 -1
  310. package/dist/esm/core/beacon/aggregation/protocol/nostr.js +0 -57
  311. package/dist/esm/core/beacon/aggregation/protocol/nostr.js.map +0 -1
  312. package/dist/esm/core/beacon/aggregation/protocol/service.js.map +0 -1
  313. package/dist/esm/core/key-manager/index.js +0 -290
  314. package/dist/esm/core/key-manager/index.js.map +0 -1
  315. package/dist/esm/core/key-manager/interface.js +0 -2
  316. package/dist/esm/core/key-manager/interface.js.map +0 -1
  317. package/dist/esm/interfaces/ibeacon.js +0 -2
  318. package/dist/esm/interfaces/ibeacon.js.map +0 -1
  319. package/dist/esm/types/crud.js +0 -2
  320. package/dist/esm/types/crud.js.map +0 -1
  321. package/dist/esm/utils/beacons.js.map +0 -1
  322. package/dist/esm/utils/identifier.js.map +0 -1
  323. package/dist/types/core/beacon/aggregation/messages/advert.d.ts +0 -22
  324. package/dist/types/core/beacon/aggregation/messages/advert.d.ts.map +0 -1
  325. package/dist/types/core/beacon/aggregation/messages/base.d.ts.map +0 -1
  326. package/dist/types/core/beacon/aggregation/messages/cohort-set.d.ts +0 -23
  327. package/dist/types/core/beacon/aggregation/messages/cohort-set.d.ts.map +0 -1
  328. package/dist/types/core/beacon/aggregation/messages/keygen.d.ts +0 -6
  329. package/dist/types/core/beacon/aggregation/messages/keygen.d.ts.map +0 -1
  330. package/dist/types/core/beacon/aggregation/messages/opt-in.d.ts +0 -22
  331. package/dist/types/core/beacon/aggregation/messages/opt-in.d.ts.map +0 -1
  332. package/dist/types/core/beacon/aggregation/messages/sign.d.ts +0 -5
  333. package/dist/types/core/beacon/aggregation/messages/sign.d.ts.map +0 -1
  334. package/dist/types/core/beacon/aggregation/models/cohort/index.d.ts +0 -77
  335. package/dist/types/core/beacon/aggregation/models/cohort/index.d.ts.map +0 -1
  336. package/dist/types/core/beacon/aggregation/models/cohort/status.d.ts.map +0 -1
  337. package/dist/types/core/beacon/aggregation/protocol/nostr.d.ts +0 -36
  338. package/dist/types/core/beacon/aggregation/protocol/nostr.d.ts.map +0 -1
  339. package/dist/types/core/beacon/aggregation/protocol/service.d.ts +0 -6
  340. package/dist/types/core/beacon/aggregation/protocol/service.d.ts.map +0 -1
  341. package/dist/types/core/key-manager/index.d.ts +0 -145
  342. package/dist/types/core/key-manager/index.d.ts.map +0 -1
  343. package/dist/types/core/key-manager/interface.d.ts +0 -113
  344. package/dist/types/core/key-manager/interface.d.ts.map +0 -1
  345. package/dist/types/interfaces/ibeacon.d.ts +0 -65
  346. package/dist/types/interfaces/ibeacon.d.ts.map +0 -1
  347. package/dist/types/types/crud.d.ts.map +0 -1
  348. package/dist/types/utils/beacons.d.ts.map +0 -1
  349. package/dist/types/utils/identifier.d.ts.map +0 -1
  350. package/src/core/beacon/aggregation/messages/advert.ts +0 -36
  351. package/src/core/beacon/aggregation/messages/cohort-set.ts +0 -37
  352. package/src/core/beacon/aggregation/messages/keygen.ts +0 -8
  353. package/src/core/beacon/aggregation/messages/opt-in.ts +0 -35
  354. package/src/core/beacon/aggregation/messages/sign.ts +0 -7
  355. package/src/core/beacon/aggregation/models/cohort/index.ts +0 -112
  356. package/src/core/beacon/aggregation/protocol/nostr.ts +0 -81
  357. package/src/core/beacon/aggregation/protocol/service.ts +0 -6
  358. package/src/core/key-manager/index.ts +0 -364
  359. package/src/core/key-manager/interface.ts +0 -129
  360. package/src/interfaces/ibeacon.ts +0 -75
  361. /package/dist/cjs/core/beacon/aggregation/{models/cohort → cohort}/status.js +0 -0
  362. /package/dist/cjs/core/beacon/aggregation/{protocol → communication}/service.js +0 -0
  363. /package/dist/esm/core/beacon/aggregation/{models/cohort → cohort}/status.js +0 -0
  364. /package/dist/esm/core/beacon/aggregation/{protocol → communication}/service.js +0 -0
  365. /package/dist/types/core/beacon/aggregation/{models/cohort → cohort}/status.d.ts +0 -0
  366. /package/src/core/beacon/aggregation/{models/cohort → cohort}/status.ts +0 -0
@@ -0,0 +1,98 @@
1
+ import { BEACON_COHORT_ADVERT, BEACON_COHORT_AGGREGATED_NONCE, BEACON_COHORT_AUTHORIZATION_REQUEST, BEACON_COHORT_NONCE_CONTRIBUTION, BEACON_COHORT_OPT_IN, BEACON_COHORT_OPT_IN_ACCEPT, BEACON_COHORT_READY, BEACON_COHORT_REQUEST_SIGNATURE, BEACON_COHORT_SIGNATURE_AUTHORIZATION } from './constants.js';
2
+ /**
3
+ * AggregateBeaconMessage is a utility class that provides constants and type checks
4
+ * for various message types used in the aggregate beacon communication protocol.
5
+ * It includes methods to validate message types and retrieve message types from objects.
6
+ * @class AggregateBeaconMessage
7
+ * @type {AggregateBeaconMessageType}
8
+ */
9
+ export class AggregateBeaconMessage {
10
+ static BEACON_COHORT_ADVERT = BEACON_COHORT_ADVERT;
11
+ static BEACON_COHORT_OPT_IN = BEACON_COHORT_OPT_IN;
12
+ static BEACON_COHORT_READY = BEACON_COHORT_READY;
13
+ static BEACON_COHORT_OPT_IN_ACCEPT = BEACON_COHORT_OPT_IN_ACCEPT;
14
+ static BEACON_COHORT_KEY_GEN_MESSAGES = new Map([
15
+ ['BEACON_COHORT_ADVERT', 'BEACON_COHORT_ADVERT'],
16
+ ['BEACON_COHORT_OPT_IN', 'BEACON_COHORT_OPT_IN'],
17
+ ['BEACON_COHORT_READY', 'BEACON_COHORT_READY'],
18
+ ['BEACON_COHORT_OPT_IN_ACCEPT', 'BEACON_COHORT_OPT_IN_ACCEPT'],
19
+ ]);
20
+ static BEACON_COHORT_REQUEST_SIGNATURE = BEACON_COHORT_REQUEST_SIGNATURE;
21
+ static BEACON_COHORT_AUTHORIZATION_REQUEST = BEACON_COHORT_AUTHORIZATION_REQUEST;
22
+ static BEACON_COHORT_NONCE_CONTRIBUTION = BEACON_COHORT_NONCE_CONTRIBUTION;
23
+ static BEACON_COHORT_AGGREGATED_NONCE = BEACON_COHORT_AGGREGATED_NONCE;
24
+ static BEACON_COHORT_SIGNATURE_AUTHORIZATION = BEACON_COHORT_SIGNATURE_AUTHORIZATION;
25
+ static BEACON_COHORT_SIGN_MESSAGES = new Map([
26
+ ['BEACON_COHORT_REQUEST_SIGNATURE', 'BEACON_COHORT_REQUEST_SIGNATURE'],
27
+ ['BEACON_COHORT_AUTHORIZATION_REQUEST', 'BEACON_COHORT_AUTHORIZATION_REQUEST'],
28
+ ['BEACON_COHORT_NONCE_CONTRIBUTION', 'BEACON_COHORT_NONCE_CONTRIBUTION'],
29
+ ['BEACON_COHORT_AGGREGATED_NONCE', 'BEACON_COHORT_AGGREGATED_NONCE'],
30
+ ['BEACON_COHORT_SIGNATURE_AUTHORIZATION', 'BEACON_COHORT_SIGNATURE_AUTHORIZATION'],
31
+ ]);
32
+ static ALL_MESSAGES = [
33
+ BEACON_COHORT_ADVERT,
34
+ BEACON_COHORT_OPT_IN,
35
+ BEACON_COHORT_READY,
36
+ BEACON_COHORT_OPT_IN_ACCEPT,
37
+ BEACON_COHORT_REQUEST_SIGNATURE,
38
+ BEACON_COHORT_AUTHORIZATION_REQUEST,
39
+ BEACON_COHORT_NONCE_CONTRIBUTION,
40
+ BEACON_COHORT_AGGREGATED_NONCE,
41
+ BEACON_COHORT_SIGNATURE_AUTHORIZATION
42
+ ];
43
+ /**
44
+ * Checks if the name provided is a valid message name.
45
+ * @param {string} type - The type of the message.
46
+ * @returns
47
+ */
48
+ static isValidType(type) {
49
+ return this.BEACON_COHORT_KEY_GEN_MESSAGES.has(type) || this.BEACON_COHORT_SIGN_MESSAGES.has(type);
50
+ }
51
+ /**
52
+ * Get the message value based on the type.
53
+ * @param {string} type - The type (or name) of the message.
54
+ * @returns {string | undefined} - The corresponding type value.
55
+ */
56
+ static getMessageValueByType(type) {
57
+ if (!this.isValidType(type)) {
58
+ return undefined;
59
+ }
60
+ return this.BEACON_COHORT_KEY_GEN_MESSAGES.get(type) || this.BEACON_COHORT_SIGN_MESSAGES.get(type);
61
+ }
62
+ /**
63
+ * Checks if the provided type is a valid AggregateBeaconMessageType.
64
+ * @param {string} type - The message type to check.
65
+ * @returns {boolean} - Returns true if the type is valid, otherwise false.
66
+ */
67
+ static isValidValue(type) {
68
+ return this.ALL_MESSAGES.includes(type);
69
+ }
70
+ /**
71
+ * Checks if the provided type is a valid KeyGenMessageType.
72
+ * @param {string} value - The message type to check.
73
+ * @returns {boolean} - Returns true if the type is a key generation message type, otherwise false.
74
+ */
75
+ static isKeyGenMessageValue(value) {
76
+ return this.isValidValue(value) && [
77
+ BEACON_COHORT_ADVERT,
78
+ BEACON_COHORT_READY,
79
+ BEACON_COHORT_OPT_IN,
80
+ BEACON_COHORT_OPT_IN_ACCEPT,
81
+ ].includes(value);
82
+ }
83
+ /**
84
+ * Checks if the provided type is a valid SignMessageType.
85
+ * @param {string} value - The message type to check.
86
+ * @returns {boolean} - Returns true if the type is a sign message type, otherwise false.
87
+ */
88
+ static isSignMessageValue(value) {
89
+ return this.isValidValue(value) && [
90
+ BEACON_COHORT_AGGREGATED_NONCE,
91
+ BEACON_COHORT_AUTHORIZATION_REQUEST,
92
+ BEACON_COHORT_NONCE_CONTRIBUTION,
93
+ BEACON_COHORT_REQUEST_SIGNATURE,
94
+ BEACON_COHORT_SIGNATURE_AUTHORIZATION
95
+ ].includes(value);
96
+ }
97
+ }
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/cohort/messages/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,30 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_ADVERT } from '../constants.js';
3
+ /**
4
+ * Represents a message advertising a cohort to potential participants.
5
+ * @class BeaconCohortAdvertMessage
6
+ * @extends BaseMessage
7
+ * @type {BeaconCohortAdvertMessage}
8
+ */
9
+ export class BeaconCohortAdvertMessage extends BaseMessage {
10
+ id;
11
+ constructor({ from, id, cohortId, cohortSize, beaconType, network }) {
12
+ const body = { cohortId, cohortSize, beaconType, network };
13
+ const type = BEACON_COHORT_ADVERT;
14
+ super({ from, body, type });
15
+ this.id = id || `${type}/${cohortId}`;
16
+ }
17
+ /**
18
+ * Initializes a BeaconCohortAdvertMessage from a possible CohortAdvertMessage object.
19
+ * @param {CohortAdvertMessage} data The CohortAdvertMessage object to initialize the BeaconCohortAdvertMessage.
20
+ * @returns {BeaconCohortAdvertMessage} The new BeaconCohortAdvertMessage.
21
+ */
22
+ static fromJSON(data) {
23
+ const message = JSON.parse(data);
24
+ if (message.type !== BEACON_COHORT_ADVERT) {
25
+ throw new Error(`Invalid type: ${message.type}`);
26
+ }
27
+ return new BeaconCohortAdvertMessage(message);
28
+ }
29
+ }
30
+ //# sourceMappingURL=cohort-advert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohort-advert.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAYvD;;;;;GAKG;AACH,MAAM,OAAO,yBAA0B,SAAQ,WAAW;IACjD,EAAE,CAAS;IAElB,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAuB;QACtF,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;QAC3D,MAAM,IAAI,GAAG,oBAAoB,CAAC;QAClC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5B,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,IAAI,QAAQ,EAAE,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAgC;QACrD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,KAAK,oBAAoB,EAAC,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_READY } from '../constants.js';
3
+ /**
4
+ * Represents a message indicating that a cohort has met the required conditions.
5
+ * @class BeaconCohortReadyMessage
6
+ * @extends BaseMessage
7
+ * @type {BeaconCohortReadyMessage}
8
+ */
9
+ export class BeaconCohortReadyMessage extends BaseMessage {
10
+ constructor({ from, to, cohortId, beaconAddress, cohortKeys }) {
11
+ const body = { cohortId, beaconAddress, cohortKeys };
12
+ const type = BEACON_COHORT_READY;
13
+ super({ from, to, body, type });
14
+ }
15
+ /**
16
+ * Initializes an BeaconCohortReadyMessage from a given OptIn object.
17
+ * @param {CohortReadyMessage} data The CohortReadyMessage object to initialize the BeaconCohortReadyMessage.
18
+ * @returns {BeaconCohortReadyMessage} The new BeaconCohortReadyMessage.
19
+ */
20
+ static fromJSON(data) {
21
+ const message = JSON.parse(data);
22
+ if (message.type !== BEACON_COHORT_READY) {
23
+ throw new Error(`Invalid type: ${message.type}`);
24
+ }
25
+ return new BeaconCohortReadyMessage(message);
26
+ }
27
+ }
28
+ //# sourceMappingURL=cohort-ready.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohort-ready.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAWtD;;;;;GAKG;AACH,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IACvD,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAsB;QAC/E,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,mBAAmB,CAAC;QACjC,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAA+B;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -0,0 +1,26 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_OPT_IN_ACCEPT } from '../constants.js';
3
+ /**
4
+ * Represents a message for a coordinator accepting a participant subscribe to a cohort.
5
+ * @class BeaconCohortOptInAcceptMessage
6
+ * @extends BaseMessage
7
+ * @type {BeaconCohortOptInAcceptMessage}
8
+ */
9
+ export class BeaconCohortOptInAcceptMessage extends BaseMessage {
10
+ constructor({ to, from }) {
11
+ super({ to, from, type: BEACON_COHORT_OPT_IN_ACCEPT });
12
+ }
13
+ /**
14
+ * Initializes a BeaconCohortOptInAcceptMessage from a possible CohortOptInAcceptMessage object.
15
+ * @param {CohortOptInAcceptMessage} data The CohortOptInAcceptMessage object to initialize the BeaconCohortOptInAcceptMessage.
16
+ * @returns {BeaconCohortOptInAcceptMessage} The new BeaconCohortOptInAcceptMessage.
17
+ */
18
+ static fromJSON(data) {
19
+ const message = JSON.parse(data);
20
+ if (message.type != BEACON_COHORT_OPT_IN_ACCEPT) {
21
+ throw new Error(`Invalid type: ${message.type}`);
22
+ }
23
+ return new BeaconCohortOptInAcceptMessage(message);
24
+ }
25
+ }
26
+ //# sourceMappingURL=opt-in-accept.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opt-in-accept.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAQ9D;;;;;GAKG;AACH,MAAM,OAAO,8BAA+B,SAAQ,WAAW;IAC7D,YAAY,EAAE,EAAE,EAAE,IAAI,EAA4B;QAChD,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAqC;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,IAAI,2BAA2B,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,8BAA8B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_OPT_IN } from '../constants.js';
3
+ export class BeaconCohortOptInMessage extends BaseMessage {
4
+ constructor({ from, to, cohortId, participantPk }) {
5
+ const body = { cohortId, participantPk };
6
+ const type = BEACON_COHORT_OPT_IN;
7
+ super({ from, to, body, type });
8
+ }
9
+ /**
10
+ * Initializes a BeaconCohortOptInMessage from a possible CohortOptInMessage object.
11
+ * @param {CohortOptInMessage} data The CohortOptInMessage object to initialize the BeaconCohortOptInMessage.
12
+ * @returns {BeaconCohortOptInMessage} The new BeaconCohortOptInMessage.
13
+ */
14
+ static fromJSON(data) {
15
+ const message = JSON.parse(data);
16
+ if (message.type != BEACON_COHORT_OPT_IN) {
17
+ throw new Error(`Invalid type: ${message.type}`);
18
+ }
19
+ return new BeaconCohortOptInMessage(message);
20
+ }
21
+ }
22
+ //# sourceMappingURL=opt-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opt-in.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAUvD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IAEvD,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAsB;QACnE,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;QACzC,MAAM,IAAI,GAAG,oBAAoB,CAAC;QAClC,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAA+B;QACpD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,IAAI,oBAAoB,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_OPT_IN_ACCEPT } from '../constants.js';
3
+ /**
4
+ * Represents a message for subscribing to a cohort.
5
+ * This message is sent by a coordinator to a participant to indicate acceptance in the cohort.
6
+ * @class BeaconCohortSubscribeMessage
7
+ * @extends BaseMessage
8
+ * @type {BeaconCohortSubscribeMessage}
9
+ */
10
+ export class BeaconCohortSubscribeMessage extends BaseMessage {
11
+ constructor({ to, from }) {
12
+ super({ to, from, type: BEACON_COHORT_OPT_IN_ACCEPT });
13
+ }
14
+ /**
15
+ * Initializes a BeaconCohortSubscribeMessage from a possible CohortSubscribeMessage object.
16
+ * @param {CohortSubscribeMessage} data The Subscribe object to initialize the SubscribeMessage.
17
+ * @returns {BeaconCohortSubscribeMessage} The serialized SubscribeMessage.
18
+ */
19
+ static fromJSON(data) {
20
+ const message = JSON.parse(data);
21
+ if (message.type != BEACON_COHORT_OPT_IN_ACCEPT) {
22
+ throw new Error(`Invalid type: ${message.type}`);
23
+ }
24
+ return new BeaconCohortSubscribeMessage(message);
25
+ }
26
+ }
27
+ //# sourceMappingURL=subscribe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscribe.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAQ9D;;;;;;GAMG;AACH,MAAM,OAAO,4BAA6B,SAAQ,WAAW;IAC3D,YAAY,EAAE,EAAE,EAAE,IAAI,EAA0B;QAC9C,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,2BAA2B,EAAE,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAmC;QACxD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,IAAI,2BAA2B,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_AGGREGATED_NONCE } from '../constants.js';
3
+ /**
4
+ * Represents a message containing an aggregated nonce for a cohort in the Beacon protocol.
5
+ * @class BeaconCohortAggregatedNonceMessage
6
+ * @extends BaseMessage
7
+ * @type {BeaconCohortAggregatedNonceMessage}
8
+ */
9
+ export class BeaconCohortAggregatedNonceMessage extends BaseMessage {
10
+ constructor({ to, from, cohortId, sessionId, aggregatedNonce }) {
11
+ const body = { cohortId, sessionId, aggregatedNonce };
12
+ const type = BEACON_COHORT_AGGREGATED_NONCE;
13
+ super({ to, from, body, type });
14
+ }
15
+ /**
16
+ * Initializes a BeaconCohortAggregatedNonceMessage from a given AggregatedNonce object.
17
+ * @param {CohortAggregatedNonceMessage} data The data object to initialize the BeaconCohortAggregatedNonceMessage.
18
+ * @returns {BeaconCohortAggregatedNonceMessage} The new BeaconCohortAggregatedNonceMessage.
19
+ */
20
+ static fromJSON(data) {
21
+ const message = JSON.parse(data);
22
+ if (message.type != BEACON_COHORT_AGGREGATED_NONCE) {
23
+ throw new Error(`Invalid type: ${message.type}`);
24
+ }
25
+ return new BeaconCohortAggregatedNonceMessage(message);
26
+ }
27
+ }
28
+ //# sourceMappingURL=aggregated-nonce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregated-nonce.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAUjE;;;;;GAKG;AACH,MAAM,OAAO,kCAAmC,SAAQ,WAAW;IACjE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAgC;QAC1F,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;QACtD,MAAM,IAAI,GAAG,8BAA8B,CAAC;QAC5C,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAyC;QAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,IAAI,8BAA8B,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,kCAAkC,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -0,0 +1,29 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_AUTHORIZATION_REQUEST } from '../constants.js';
3
+ /**
4
+ * Sends the unsigned PSBT that spends the Beacon UTXO (plus any SMT proofs).
5
+ * Asks the cohort to begin a MuSig2 signing session.
6
+ * @class BeaconCohortAuthorizationRequestMessage
7
+ * @extends BaseMessage
8
+ * @type {CohortAuthorizationRequestMessage}
9
+ */
10
+ export class BeaconCohortAuthorizationRequestMessage extends BaseMessage {
11
+ constructor({ to, from, cohortId, sessionId, pendingTx }) {
12
+ const body = { cohortId, sessionId, pendingTx };
13
+ const type = BEACON_COHORT_AUTHORIZATION_REQUEST;
14
+ super({ to, from, body, type });
15
+ }
16
+ /**
17
+ * Initializes a BeaconCohortAuthorizationRequestMessage from a given AuthorizationRequest object.
18
+ * @param {CohortAuthorizationRequestMessage} data The data object to initialize the BeaconCohortAuthorizationRequestMessage.
19
+ * @returns {BeaconCohortAuthorizationRequestMessage} The serialized BeaconCohortAuthorizationRequestMessage.
20
+ */
21
+ static fromJSON(data) {
22
+ const message = JSON.parse(data);
23
+ if (message.type != BEACON_COHORT_AUTHORIZATION_REQUEST) {
24
+ throw new Error(`Invalid type: ${message.type}`);
25
+ }
26
+ return new BeaconCohortAuthorizationRequestMessage(message);
27
+ }
28
+ }
29
+ //# sourceMappingURL=authorization-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-request.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,mCAAmC,EAAE,MAAM,iBAAiB,CAAC;AAUtE;;;;;;GAMG;AACH,MAAM,OAAO,uCAAwC,SAAQ,WAAW;IACtE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAqC;QACzF,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,mCAAmC,CAAC;QACjD,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAA8C;QACnE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,IAAI,mCAAmC,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,uCAAuC,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -0,0 +1,29 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_NONCE_CONTRIBUTION } from '../constants.js';
3
+ /**
4
+ * Represents a message containing a nonce contribution for a cohort participant.
5
+ * Participant → Coordinator. Participant sending their public nonce points for the ongoing signing session.
6
+ * @class BeaconCohortNonceContributionMessage
7
+ * @extends BaseMessage
8
+ * @type {BeaconCohortNonceContributionMessage}
9
+ */
10
+ export class BeaconCohortNonceContributionMessage extends BaseMessage {
11
+ constructor({ to, from, cohortId, sessionId, nonceContribution }) {
12
+ const body = { cohortId, sessionId, nonceContribution };
13
+ const type = BEACON_COHORT_NONCE_CONTRIBUTION;
14
+ super({ to, from, body, type });
15
+ }
16
+ /**
17
+ * Initializes a NonceContributionMessage from a given CohortNonceContributionMessage object.
18
+ * @param {CohortNonceContributionMessage} data The data object to initialize the BeaconCohortNonceContributionMessage.
19
+ * @returns {BeaconCohortNonceContributionMessage} The new BeaconCohortNonceContributionMessage.
20
+ */
21
+ static fromJSON(data) {
22
+ const message = JSON.parse(data);
23
+ if (message.type != BEACON_COHORT_NONCE_CONTRIBUTION) {
24
+ throw new Error(`Invalid type: ${message.type}`);
25
+ }
26
+ return new BeaconCohortNonceContributionMessage(message);
27
+ }
28
+ }
29
+ //# sourceMappingURL=nonce-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nonce-contribution.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AAUnE;;;;;;GAMG;AACH,MAAM,OAAO,oCAAqC,SAAQ,WAAW;IACnE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAkC;QAC9F,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;QACxD,MAAM,IAAI,GAAG,gCAAgC,CAAC;QAC9C,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAA2C;QAChE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,IAAI,gCAAgC,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,oCAAoC,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF"}
@@ -0,0 +1,29 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_REQUEST_SIGNATURE } from '../constants.js';
3
+ /**
4
+ * Coordinator → Participants. Returns the aggregation of all participant nonces
5
+ * so each participant can produce a correct partial signature.
6
+ * @class BeaconCohortRequestSignatureMessage
7
+ * @extends BaseMessage
8
+ * @type {BeaconCohortRequestSignatureMessage}
9
+ */
10
+ export class BeaconCohortRequestSignatureMessage extends BaseMessage {
11
+ constructor({ to, from, cohortId, sessionId, data }) {
12
+ const body = { cohortId, sessionId, data };
13
+ const type = BEACON_COHORT_REQUEST_SIGNATURE;
14
+ super({ to, from, body, type });
15
+ }
16
+ /**
17
+ * Initializes an BeaconCohortRequestSignatureMessage from a possible CohortRequestSignatureMessage object.
18
+ * @param {CohortRequestSignatureMessage} data The data object to initialize the BeaconCohortRequestSignatureMessage.
19
+ * @returns {BeaconCohortRequestSignatureMessage} The new BeaconCohortRequestSignatureMessage.
20
+ */
21
+ static fromJSON(data) {
22
+ const message = JSON.parse(data);
23
+ if (message.type != BEACON_COHORT_REQUEST_SIGNATURE) {
24
+ throw new Error(`Invalid type: ${message.type}`);
25
+ }
26
+ return new BeaconCohortRequestSignatureMessage(message);
27
+ }
28
+ }
29
+ //# sourceMappingURL=request-signature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-signature.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAUlE;;;;;;GAMG;AACH,MAAM,OAAO,mCAAoC,SAAQ,WAAW;IAClE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAiC;QAChF,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,+BAA+B,CAAC;QAC7C,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAA0C;QAC/D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,IAAI,+BAA+B,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,mCAAmC,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF"}
@@ -0,0 +1,30 @@
1
+ import { BaseMessage } from '../base.js';
2
+ import { BEACON_COHORT_SIGNATURE_AUTHORIZATION } from '../constants.js';
3
+ /**
4
+ * Participant → Coordinator. Delivers the participant’s partial signature over
5
+ * the PSBT, authorizing the final Beacon signal (transaction) once all signatures
6
+ * are collected.
7
+ * @class BeaconCohortSignatureAuthorizationMessage
8
+ * @extends BaseMessage
9
+ * @type {BeaconCohortSignatureAuthorizationMessage}
10
+ */
11
+ export class BeaconCohortSignatureAuthorizationMessage extends BaseMessage {
12
+ constructor({ to, from, cohortId, sessionId, partialSignature }) {
13
+ const body = { cohortId, sessionId, partialSignature };
14
+ const type = BEACON_COHORT_SIGNATURE_AUTHORIZATION;
15
+ super({ to, from, body, type });
16
+ }
17
+ /**
18
+ * Initializes an BeaconCohortSignatureAuthorizationMessage from a given CohortSignatureAuthorizationMessage object.
19
+ * @param {CohortSignatureAuthorizationMessage} data The data object to initialize the BeaconCohortSignatureAuthorizationMessage.
20
+ * @returns {BeaconCohortSignatureAuthorizationMessage} The serialized BeaconCohortSignatureAuthorizationMessage.
21
+ */
22
+ static fromJSON(data) {
23
+ const message = JSON.parse(data);
24
+ if (message.type != BEACON_COHORT_SIGNATURE_AUTHORIZATION) {
25
+ throw new Error(`Invalid type: ${message.type}`);
26
+ }
27
+ return new BeaconCohortSignatureAuthorizationMessage(message);
28
+ }
29
+ }
30
+ //# sourceMappingURL=signature-authorization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature-authorization.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,qCAAqC,EAAE,MAAM,iBAAiB,CAAC;AAUxE;;;;;;;GAOG;AACH,MAAM,OAAO,yCAA0C,SAAQ,WAAW;IACxE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAuC;QAClG,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;QACvD,MAAM,IAAI,GAAG,qCAAqC,CAAC;QACnD,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAgD;QACrE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,CAAC,IAAI,IAAI,qCAAqC,EAAE,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,iBAAiB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,IAAI,yCAAyC,CAAC,OAAO,CAAC,CAAC;IAChE,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/cohort/status.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,iDAAgC,CAAA;IAChC,6CAA4B,CAAA;IAC5B,iDAAgC,CAAA;IAChC,yCAAwB,CAAA;AAC1B,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB"}
@@ -0,0 +1,126 @@
1
+ import { NotImplementedError } from '@did-btcr2/common';
2
+ import { SchnorrKeyPair, Secp256k1SecretKey } from '@did-btcr2/keypair';
3
+ import { Identifier } from '../../../../identifier.js';
4
+ /**
5
+ * DidCommAdapterConfig is a configuration class for the DidCommAdapter.
6
+ * It holds the necessary parameters to connect to Nostr relays and manage keys.
7
+ * @class DidCommAdapterConfig
8
+ * @implements {ServiceAdapterConfig}
9
+ * @type {DidCommAdapterConfig}
10
+ */
11
+ export class DidCommAdapterConfig {
12
+ keys;
13
+ components;
14
+ did;
15
+ coordinatorDids;
16
+ /**
17
+ * Constructs a new DidCommAdapterConfig instance.
18
+ * @param {Partial<ServiceAdapterConfig>} [config] Optional configuration parameters to initialize the adapter.
19
+ * @constructor
20
+ * @type {DidCommAdapterConfig}
21
+ */
22
+ constructor(config) {
23
+ this.keys = config?.keys || SchnorrKeyPair.generate().raw,
24
+ this.components = config?.components || {
25
+ version: 1,
26
+ idType: 'KEY',
27
+ network: 'mutinynet'
28
+ };
29
+ this.did = config?.did || Identifier.encode({
30
+ ...this.components,
31
+ genesisBytes: this.keys.public
32
+ });
33
+ this.coordinatorDids = config?.coordinatorDids || [];
34
+ }
35
+ }
36
+ /**
37
+ * DidCommAdapter implements the CommunicationService interface for DidComm protocol.
38
+ * It handles message sending, receiving, and identity generation using DidComm.
39
+ * @class DidCommAdapter
40
+ * @implements {CommunicationService}
41
+ * @type {DidCommAdapter}
42
+ */
43
+ export class DidCommAdapter {
44
+ /**
45
+ * The name of the communication service.
46
+ * @type {string}
47
+ */
48
+ name = 'didcomm';
49
+ /**
50
+ * The configuration for the DidComm adapter.
51
+ * @type {DidCommAdapterConfig}
52
+ */
53
+ config;
54
+ /**
55
+ * A map of message handlers for different message types.
56
+ * @type {Map<string, MessageHandler>}
57
+ */
58
+ handlers = new Map();
59
+ /**
60
+ * Constructs a new DidCommAdapter instance with the provided configuration.
61
+ * @param {DidCommAdapterConfig} [config] The configuration for the Nostr adapter.
62
+ */
63
+ constructor(config = {}) {
64
+ this.config = new DidCommAdapterConfig(config);
65
+ }
66
+ /**
67
+ * Starts the DidComm service.
68
+ * @returns {void} Returns the DidCommAdapter instance for method chaining.
69
+ */
70
+ start() {
71
+ throw new NotImplementedError('DidCommAdapter is not implemented. Use NostrAdapter instead.');
72
+ }
73
+ /**
74
+ * Sets the keys used for Nostr communication.
75
+ * @param {ServiceAdapterIdentity<NostrKeys>} keys The keys to set.
76
+ */
77
+ setKeys(keys) {
78
+ this.config.keys = keys;
79
+ }
80
+ /**
81
+ * Registers a message handler for a specific message type.
82
+ * @param {string} messageType The type of message to handle.
83
+ * @param {MessageHandler} handler The handler function that processes the message.
84
+ */
85
+ registerMessageHandler(messageType, handler) {
86
+ this.handlers.set(messageType, handler);
87
+ }
88
+ /**
89
+ * Sends a message to a recipient using the Nostr protocol.
90
+ * This method is a placeholder and should be implemented with actual Nostr message sending logic.
91
+ * @param {Maybe<AggregateBeaconMessageType>} _message The message to send, typically containing the content and metadata.
92
+ * @param {string} _recipient The public key or identifier of the recipient.
93
+ * @param {string} _sender The public key or identifier of the sender.
94
+ * @returns {Promise<void>} A promise that resolves when the message is sent.
95
+ */
96
+ async sendMessage(_message, _recipient, _sender) {
97
+ throw new NotImplementedError('DidCommAdapter.start() is not implemented. Use NostrAdapter instead.');
98
+ }
99
+ /**
100
+ * Generates a DidComm identity.
101
+ * @param {RawKeyPair} [keys] Optional keys to use for identity generation.
102
+ * @returns {ServiceAdapterConfig} The generated DidComm identity configuration.
103
+ */
104
+ generateIdentity(keys) {
105
+ if (!keys) {
106
+ this.config.keys.secret = Secp256k1SecretKey.random();
107
+ this.config.keys.public = Secp256k1SecretKey.getPublicKey(this.config.keys.secret).compressed;
108
+ this.config.did = Identifier.encode({
109
+ idType: this.config.components.idType || 'KEY',
110
+ version: this.config.components.version || 1,
111
+ network: this.config.components.network || 'signet',
112
+ genesisBytes: this.config.keys.public
113
+ });
114
+ return this.config;
115
+ }
116
+ this.config.keys = keys;
117
+ this.config.did = Identifier.encode({
118
+ idType: this.config.components.idType || 'KEY',
119
+ version: this.config.components.version || 1,
120
+ network: this.config.components.network || 'signet',
121
+ genesisBytes: this.config.keys.public
122
+ });
123
+ return this.config;
124
+ }
125
+ }
126
+ //# sourceMappingURL=did-comm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did-comm.js","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/communication/adapter/did-comm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAqB,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB;IACxB,IAAI,CAAoB;IACxB,UAAU,CAIf;IACK,GAAG,CAAS;IACZ,eAAe,CAAW;IAEjC;;;;;OAKG;IACH,YAAY,MAAsC;QAChD,IAAI,CAAC,IAAI,GAAG,MAAM,EAAE,IAAI,IAAI,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG;YACzD,IAAI,CAAC,UAAU,GAAG,MAAM,EAAE,UAAU,IAAI;gBACtC,OAAO,EAAG,CAAC;gBACX,MAAM,EAAI,KAAK;gBACf,OAAO,EAAG,WAAW;aACtB,CAAC;QACF,IAAI,CAAC,GAAG,GAAG,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,MAAM,CACzC;YACE,GAAG,IAAI,CAAC,UAAU;YAClB,YAAY,EAAG,IAAI,CAAC,IAAI,CAAC,MAAM;SAChC,CACF,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,MAAM,EAAE,eAAe,IAAI,EAAE,CAAC;IACvD,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,cAAc;IACzB;;;OAGG;IACI,IAAI,GAAW,SAAS,CAAC;IAEhC;;;OAGG;IACI,MAAM,CAAuB;IAEpC;;;OAGG;IACK,QAAQ,GAAgC,IAAI,GAAG,EAAE,CAAC;IAE1D;;;OAGG;IACH,YAAY,SAA+B,EAA0B;QACnE,IAAI,CAAC,MAAM,GAAG,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,MAAM,IAAI,mBAAmB,CAAC,8DAA8D,CAAC,CAAC;IAChG,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,IAA+C;QAC5D,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACI,sBAAsB,CAAC,WAAmB,EAAE,OAAuB;QACxE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,WAAW,CACtB,QAA2C,EAC3C,UAAkB,EAClB,OAAe;QAEf,MAAM,IAAI,mBAAmB,CAAC,sEAAsE,CAAC,CAAC;IACxG,CAAC;IAED;;;;OAIG;IACI,gBAAgB,CAAC,IAAwB;QAC9C,IAAG,CAAC,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAAE,CAAC;YACtD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC;YAC9F,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CACjC;gBACE,MAAM,EAAS,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,IAAK,KAAK;gBACtD,OAAO,EAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC;gBAClD,OAAO,EAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,IAAI,QAAQ;gBACzD,YAAY,EAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;aACvC,CACF,CAAC;YACF,OAAO,IAAI,CAAC,MAA8B,CAAC;QAC7C,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CACjC;YACE,MAAM,EAAS,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,IAAK,KAAK;YACtD,OAAO,EAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC;YAClD,OAAO,EAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,IAAI,QAAQ;YACzD,YAAY,EAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;SACvC,CACF,CAAC;QACF,OAAO,IAAI,CAAC,MAA8B,CAAC;IAC7C,CAAC;CACF"}