@did-btcr2/method 0.26.0 → 0.27.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 (282) hide show
  1. package/README.md +86 -233
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/browser.js +24111 -20342
  4. package/dist/browser.mjs +24111 -20342
  5. package/dist/cjs/index.js +2463 -2174
  6. package/dist/esm/core/aggregation/cohort.js +178 -0
  7. package/dist/esm/core/aggregation/cohort.js.map +1 -0
  8. package/dist/esm/core/aggregation/errors.js +22 -0
  9. package/dist/esm/core/aggregation/errors.js.map +1 -0
  10. package/dist/esm/core/{beacon/aggregation/cohort → aggregation}/messages/base.js +0 -1
  11. package/dist/esm/core/aggregation/messages/base.js.map +1 -0
  12. package/dist/esm/core/aggregation/messages/constants.js +26 -0
  13. package/dist/esm/core/aggregation/messages/constants.js.map +1 -0
  14. package/dist/esm/core/aggregation/messages/factories.js +113 -0
  15. package/dist/esm/core/aggregation/messages/factories.js.map +1 -0
  16. package/dist/esm/core/aggregation/messages/guards.js +37 -0
  17. package/dist/esm/core/aggregation/messages/guards.js.map +1 -0
  18. package/dist/esm/core/aggregation/messages/index.js +5 -0
  19. package/dist/esm/core/aggregation/messages/index.js.map +1 -0
  20. package/dist/esm/core/aggregation/participant.js +376 -0
  21. package/dist/esm/core/aggregation/participant.js.map +1 -0
  22. package/dist/esm/core/aggregation/phases.js +39 -0
  23. package/dist/esm/core/aggregation/phases.js.map +1 -0
  24. package/dist/esm/core/aggregation/runner/events.js +2 -0
  25. package/dist/esm/core/aggregation/runner/events.js.map +1 -0
  26. package/dist/esm/core/aggregation/runner/index.js +5 -0
  27. package/dist/esm/core/aggregation/runner/index.js.map +1 -0
  28. package/dist/esm/core/aggregation/runner/participant-runner.js +282 -0
  29. package/dist/esm/core/aggregation/runner/participant-runner.js.map +1 -0
  30. package/dist/esm/core/aggregation/runner/service-runner.js +290 -0
  31. package/dist/esm/core/aggregation/runner/service-runner.js.map +1 -0
  32. package/dist/esm/core/aggregation/runner/typed-emitter.js +80 -0
  33. package/dist/esm/core/aggregation/runner/typed-emitter.js.map +1 -0
  34. package/dist/esm/core/aggregation/service.js +416 -0
  35. package/dist/esm/core/aggregation/service.js.map +1 -0
  36. package/dist/esm/core/aggregation/signing-session.js +133 -0
  37. package/dist/esm/core/aggregation/signing-session.js.map +1 -0
  38. package/dist/esm/core/aggregation/transport/didcomm.js +32 -0
  39. package/dist/esm/core/aggregation/transport/didcomm.js.map +1 -0
  40. package/dist/esm/core/aggregation/transport/error.js +12 -0
  41. package/dist/esm/core/aggregation/transport/error.js.map +1 -0
  42. package/dist/esm/core/aggregation/transport/factory.js +20 -0
  43. package/dist/esm/core/aggregation/transport/factory.js.map +1 -0
  44. package/dist/esm/core/aggregation/transport/index.js +6 -0
  45. package/dist/esm/core/aggregation/transport/index.js.map +1 -0
  46. package/dist/esm/core/aggregation/transport/nostr.js +262 -0
  47. package/dist/esm/core/aggregation/transport/nostr.js.map +1 -0
  48. package/dist/esm/core/aggregation/transport/transport.js +2 -0
  49. package/dist/esm/core/aggregation/transport/transport.js.map +1 -0
  50. package/dist/esm/core/beacon/beacon.js +80 -0
  51. package/dist/esm/core/beacon/beacon.js.map +1 -1
  52. package/dist/esm/core/beacon/cas-beacon.js +15 -56
  53. package/dist/esm/core/beacon/cas-beacon.js.map +1 -1
  54. package/dist/esm/core/beacon/error.js +0 -10
  55. package/dist/esm/core/beacon/error.js.map +1 -1
  56. package/dist/esm/core/beacon/fee-estimator.js +30 -0
  57. package/dist/esm/core/beacon/fee-estimator.js.map +1 -0
  58. package/dist/esm/core/beacon/singleton-beacon.js +10 -53
  59. package/dist/esm/core/beacon/singleton-beacon.js.map +1 -1
  60. package/dist/esm/core/beacon/smt-beacon.js +85 -9
  61. package/dist/esm/core/beacon/smt-beacon.js.map +1 -1
  62. package/dist/esm/core/identifier.js +13 -0
  63. package/dist/esm/core/identifier.js.map +1 -1
  64. package/dist/esm/core/resolver.js +9 -0
  65. package/dist/esm/core/resolver.js.map +1 -1
  66. package/dist/esm/index.js +14 -24
  67. package/dist/esm/index.js.map +1 -1
  68. package/dist/types/core/aggregation/cohort.d.ts +94 -0
  69. package/dist/types/core/aggregation/cohort.d.ts.map +1 -0
  70. package/dist/types/core/aggregation/errors.d.ts +14 -0
  71. package/dist/types/core/aggregation/errors.d.ts.map +1 -0
  72. package/dist/types/core/{beacon/aggregation/cohort → aggregation}/messages/base.d.ts +7 -1
  73. package/dist/types/core/aggregation/messages/base.d.ts.map +1 -0
  74. package/dist/types/core/aggregation/messages/constants.d.ts +23 -0
  75. package/dist/types/core/aggregation/messages/constants.d.ts.map +1 -0
  76. package/dist/types/core/aggregation/messages/factories.d.ts +177 -0
  77. package/dist/types/core/aggregation/messages/factories.d.ts.map +1 -0
  78. package/dist/types/core/aggregation/messages/guards.d.ts +11 -0
  79. package/dist/types/core/aggregation/messages/guards.d.ts.map +1 -0
  80. package/dist/types/core/aggregation/messages/index.d.ts +5 -0
  81. package/dist/types/core/aggregation/messages/index.d.ts.map +1 -0
  82. package/dist/types/core/aggregation/participant.d.ts +101 -0
  83. package/dist/types/core/aggregation/participant.d.ts.map +1 -0
  84. package/dist/types/core/aggregation/phases.d.ts +49 -0
  85. package/dist/types/core/aggregation/phases.d.ts.map +1 -0
  86. package/dist/types/core/aggregation/runner/events.d.ts +89 -0
  87. package/dist/types/core/aggregation/runner/events.d.ts.map +1 -0
  88. package/dist/types/core/aggregation/runner/index.d.ts +5 -0
  89. package/dist/types/core/aggregation/runner/index.d.ts.map +1 -0
  90. package/dist/types/core/aggregation/runner/participant-runner.d.ts +107 -0
  91. package/dist/types/core/aggregation/runner/participant-runner.d.ts.map +1 -0
  92. package/dist/types/core/aggregation/runner/service-runner.d.ts +102 -0
  93. package/dist/types/core/aggregation/runner/service-runner.d.ts.map +1 -0
  94. package/dist/types/core/aggregation/runner/typed-emitter.d.ts +41 -0
  95. package/dist/types/core/aggregation/runner/typed-emitter.d.ts.map +1 -0
  96. package/dist/types/core/aggregation/service.d.ts +112 -0
  97. package/dist/types/core/aggregation/service.d.ts.map +1 -0
  98. package/dist/types/core/aggregation/signing-session.d.ts +69 -0
  99. package/dist/types/core/aggregation/signing-session.d.ts.map +1 -0
  100. package/dist/types/core/aggregation/transport/didcomm.d.ts +20 -0
  101. package/dist/types/core/aggregation/transport/didcomm.d.ts.map +1 -0
  102. package/dist/types/core/{beacon/aggregation/communication → aggregation/transport}/error.d.ts +2 -2
  103. package/dist/types/core/aggregation/transport/error.d.ts.map +1 -0
  104. package/dist/types/core/aggregation/transport/factory.d.ts +13 -0
  105. package/dist/types/core/aggregation/transport/factory.d.ts.map +1 -0
  106. package/dist/types/core/aggregation/transport/index.d.ts +6 -0
  107. package/dist/types/core/aggregation/transport/index.d.ts.map +1 -0
  108. package/dist/types/core/aggregation/transport/nostr.d.ts +55 -0
  109. package/dist/types/core/aggregation/transport/nostr.d.ts.map +1 -0
  110. package/dist/types/core/aggregation/transport/transport.d.ts +37 -0
  111. package/dist/types/core/aggregation/transport/transport.d.ts.map +1 -0
  112. package/dist/types/core/beacon/beacon.d.ts +37 -2
  113. package/dist/types/core/beacon/beacon.d.ts.map +1 -1
  114. package/dist/types/core/beacon/cas-beacon.d.ts +19 -7
  115. package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
  116. package/dist/types/core/beacon/error.d.ts +0 -6
  117. package/dist/types/core/beacon/error.d.ts.map +1 -1
  118. package/dist/types/core/beacon/fee-estimator.d.ts +40 -0
  119. package/dist/types/core/beacon/fee-estimator.d.ts.map +1 -0
  120. package/dist/types/core/beacon/interfaces.d.ts +8 -0
  121. package/dist/types/core/beacon/interfaces.d.ts.map +1 -1
  122. package/dist/types/core/beacon/singleton-beacon.d.ts +9 -2
  123. package/dist/types/core/beacon/singleton-beacon.d.ts.map +1 -1
  124. package/dist/types/core/beacon/smt-beacon.d.ts +27 -7
  125. package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
  126. package/dist/types/core/identifier.d.ts +8 -0
  127. package/dist/types/core/identifier.d.ts.map +1 -1
  128. package/dist/types/core/interfaces.d.ts +2 -2
  129. package/dist/types/core/resolver.d.ts +11 -1
  130. package/dist/types/core/resolver.d.ts.map +1 -1
  131. package/dist/types/index.d.ts +9 -24
  132. package/dist/types/index.d.ts.map +1 -1
  133. package/package.json +31 -30
  134. package/src/core/aggregation/cohort.ts +247 -0
  135. package/src/core/aggregation/errors.ts +25 -0
  136. package/src/core/{beacon/aggregation/cohort → aggregation}/messages/base.ts +8 -3
  137. package/src/core/aggregation/messages/constants.ts +28 -0
  138. package/src/core/aggregation/messages/factories.ts +240 -0
  139. package/src/core/aggregation/messages/guards.ts +55 -0
  140. package/src/core/aggregation/messages/index.ts +4 -0
  141. package/src/core/aggregation/participant.ts +510 -0
  142. package/src/core/aggregation/phases.ts +82 -0
  143. package/src/core/aggregation/runner/events.ts +77 -0
  144. package/src/core/aggregation/runner/index.ts +4 -0
  145. package/src/core/aggregation/runner/participant-runner.ts +360 -0
  146. package/src/core/aggregation/runner/service-runner.ts +365 -0
  147. package/src/core/aggregation/runner/typed-emitter.ts +87 -0
  148. package/src/core/aggregation/service.ts +547 -0
  149. package/src/core/aggregation/signing-session.ts +209 -0
  150. package/src/core/aggregation/transport/didcomm.ts +42 -0
  151. package/src/core/aggregation/transport/error.ts +13 -0
  152. package/src/core/aggregation/transport/factory.ts +29 -0
  153. package/src/core/aggregation/transport/index.ts +5 -0
  154. package/src/core/aggregation/transport/nostr.ts +333 -0
  155. package/src/core/aggregation/transport/transport.ts +46 -0
  156. package/src/core/beacon/beacon.ts +122 -2
  157. package/src/core/beacon/cas-beacon.ts +28 -76
  158. package/src/core/beacon/error.ts +0 -12
  159. package/src/core/beacon/fee-estimator.ts +52 -0
  160. package/src/core/beacon/interfaces.ts +10 -1
  161. package/src/core/beacon/singleton-beacon.ts +14 -75
  162. package/src/core/beacon/smt-beacon.ts +109 -11
  163. package/src/core/identifier.ts +17 -0
  164. package/src/core/interfaces.ts +2 -2
  165. package/src/core/resolver.ts +25 -2
  166. package/src/index.ts +15 -29
  167. package/dist/esm/core/beacon/aggregation/cohort/index.js +0 -237
  168. package/dist/esm/core/beacon/aggregation/cohort/index.js.map +0 -1
  169. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +0 -1
  170. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js +0 -11
  171. package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js.map +0 -1
  172. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js +0 -98
  173. package/dist/esm/core/beacon/aggregation/cohort/messages/index.js.map +0 -1
  174. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +0 -31
  175. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +0 -1
  176. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +0 -29
  177. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +0 -1
  178. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +0 -27
  179. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +0 -1
  180. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +0 -23
  181. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +0 -1
  182. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +0 -28
  183. package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +0 -1
  184. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +0 -29
  185. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +0 -1
  186. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +0 -30
  187. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +0 -1
  188. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +0 -30
  189. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +0 -1
  190. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +0 -30
  191. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +0 -1
  192. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +0 -31
  193. package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +0 -1
  194. package/dist/esm/core/beacon/aggregation/cohort/status.js +0 -8
  195. package/dist/esm/core/beacon/aggregation/cohort/status.js.map +0 -1
  196. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +0 -121
  197. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +0 -1
  198. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +0 -245
  199. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +0 -1
  200. package/dist/esm/core/beacon/aggregation/communication/error.js +0 -12
  201. package/dist/esm/core/beacon/aggregation/communication/error.js.map +0 -1
  202. package/dist/esm/core/beacon/aggregation/communication/factory.js +0 -21
  203. package/dist/esm/core/beacon/aggregation/communication/factory.js.map +0 -1
  204. package/dist/esm/core/beacon/aggregation/communication/service.js +0 -2
  205. package/dist/esm/core/beacon/aggregation/communication/service.js.map +0 -1
  206. package/dist/esm/core/beacon/aggregation/coordinator.js +0 -343
  207. package/dist/esm/core/beacon/aggregation/coordinator.js.map +0 -1
  208. package/dist/esm/core/beacon/aggregation/participant.js +0 -435
  209. package/dist/esm/core/beacon/aggregation/participant.js.map +0 -1
  210. package/dist/esm/core/beacon/aggregation/session/index.js +0 -244
  211. package/dist/esm/core/beacon/aggregation/session/index.js.map +0 -1
  212. package/dist/esm/core/beacon/aggregation/session/status.js +0 -11
  213. package/dist/esm/core/beacon/aggregation/session/status.js.map +0 -1
  214. package/dist/types/core/beacon/aggregation/cohort/index.d.ts +0 -136
  215. package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +0 -1
  216. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +0 -1
  217. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +0 -11
  218. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts.map +0 -1
  219. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +0 -65
  220. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts.map +0 -1
  221. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +0 -29
  222. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +0 -1
  223. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +0 -26
  224. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +0 -1
  225. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +0 -24
  226. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +0 -1
  227. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +0 -20
  228. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +0 -1
  229. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +0 -25
  230. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +0 -1
  231. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +0 -25
  232. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +0 -1
  233. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +0 -26
  234. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +0 -1
  235. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +0 -26
  236. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +0 -1
  237. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +0 -26
  238. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +0 -1
  239. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +0 -27
  240. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +0 -1
  241. package/dist/types/core/beacon/aggregation/cohort/status.d.ts +0 -8
  242. package/dist/types/core/beacon/aggregation/cohort/status.d.ts.map +0 -1
  243. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +0 -89
  244. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +0 -1
  245. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +0 -103
  246. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +0 -1
  247. package/dist/types/core/beacon/aggregation/communication/error.d.ts.map +0 -1
  248. package/dist/types/core/beacon/aggregation/communication/factory.d.ts +0 -10
  249. package/dist/types/core/beacon/aggregation/communication/factory.d.ts.map +0 -1
  250. package/dist/types/core/beacon/aggregation/communication/service.d.ts +0 -36
  251. package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +0 -1
  252. package/dist/types/core/beacon/aggregation/coordinator.d.ts +0 -116
  253. package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +0 -1
  254. package/dist/types/core/beacon/aggregation/participant.d.ts +0 -192
  255. package/dist/types/core/beacon/aggregation/participant.d.ts.map +0 -1
  256. package/dist/types/core/beacon/aggregation/session/index.d.ts +0 -156
  257. package/dist/types/core/beacon/aggregation/session/index.d.ts.map +0 -1
  258. package/dist/types/core/beacon/aggregation/session/status.d.ts +0 -11
  259. package/dist/types/core/beacon/aggregation/session/status.d.ts.map +0 -1
  260. package/src/core/beacon/aggregation/cohort/index.ts +0 -305
  261. package/src/core/beacon/aggregation/cohort/messages/constants.ts +0 -12
  262. package/src/core/beacon/aggregation/cohort/messages/index.ts +0 -143
  263. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +0 -44
  264. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +0 -40
  265. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +0 -35
  266. package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +0 -34
  267. package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +0 -36
  268. package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +0 -39
  269. package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +0 -40
  270. package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +0 -40
  271. package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +0 -40
  272. package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +0 -41
  273. package/src/core/beacon/aggregation/cohort/status.ts +0 -7
  274. package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +0 -148
  275. package/src/core/beacon/aggregation/communication/adapter/nostr.ts +0 -323
  276. package/src/core/beacon/aggregation/communication/error.ts +0 -13
  277. package/src/core/beacon/aggregation/communication/factory.ts +0 -25
  278. package/src/core/beacon/aggregation/communication/service.ts +0 -42
  279. package/src/core/beacon/aggregation/coordinator.ts +0 -419
  280. package/src/core/beacon/aggregation/participant.ts +0 -517
  281. package/src/core/beacon/aggregation/session/index.ts +0 -301
  282. package/src/core/beacon/aggregation/session/status.ts +0 -18
@@ -1,23 +0,0 @@
1
- import { JSONUtils } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- import { BEACON_COHORT_OPT_IN } from '../constants.js';
4
- export class BeaconCohortOptInMessage extends BaseMessage {
5
- constructor({ from, to, cohortId, participantPk }) {
6
- const body = { cohortId, participantPk };
7
- const type = BEACON_COHORT_OPT_IN;
8
- super({ from, to, body, type });
9
- }
10
- /**
11
- * Initializes a BeaconCohortOptInMessage from a possible CohortOptInMessage object.
12
- * @param {CohortOptInMessage} data The CohortOptInMessage object to initialize the BeaconCohortOptInMessage.
13
- * @returns {BeaconCohortOptInMessage} The new BeaconCohortOptInMessage.
14
- */
15
- static fromJSON(data) {
16
- const message = JSONUtils.isParsable(data) ? JSON.parse(data) : data;
17
- if (message.type != BEACON_COHORT_OPT_IN) {
18
- throw new Error(`Invalid type: ${message.type}`);
19
- }
20
- return new BeaconCohortOptInMessage(message);
21
- }
22
- }
23
- //# sourceMappingURL=opt-in.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"opt-in.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,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,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,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"}
@@ -1,28 +0,0 @@
1
- import { JSONUtils } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- import { BEACON_COHORT_OPT_IN_ACCEPT } from '../constants.js';
4
- /**
5
- * Represents a message for subscribing to a cohort.
6
- * This message is sent by a coordinator to a participant to indicate acceptance in the cohort.
7
- * @class BeaconCohortSubscribeMessage
8
- * @extends BaseMessage
9
- * @type {BeaconCohortSubscribeMessage}
10
- */
11
- export class BeaconCohortSubscribeMessage extends BaseMessage {
12
- constructor({ to, from }) {
13
- super({ to, from, type: BEACON_COHORT_OPT_IN_ACCEPT });
14
- }
15
- /**
16
- * Initializes a BeaconCohortSubscribeMessage from a possible CohortSubscribeMessage object.
17
- * @param {CohortSubscribeMessage} data The Subscribe object to initialize the SubscribeMessage.
18
- * @returns {BeaconCohortSubscribeMessage} The serialized SubscribeMessage.
19
- */
20
- static fromJSON(data) {
21
- const message = JSONUtils.isParsable(data) ? JSON.parse(data) : data;
22
- if (message.type != BEACON_COHORT_OPT_IN_ACCEPT) {
23
- throw new Error(`Invalid type: ${message.type}`);
24
- }
25
- return new BeaconCohortSubscribeMessage(message);
26
- }
27
- }
28
- //# sourceMappingURL=subscribe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscribe.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,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,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,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"}
@@ -1,29 +0,0 @@
1
- import { JSONUtils } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- import { BEACON_COHORT_AGGREGATED_NONCE } from '../constants.js';
4
- /**
5
- * Represents a message containing an aggregated nonce for a cohort in the Beacon protocol.
6
- * @class BeaconCohortAggregatedNonceMessage
7
- * @extends BaseMessage
8
- * @type {BeaconCohortAggregatedNonceMessage}
9
- */
10
- export class BeaconCohortAggregatedNonceMessage extends BaseMessage {
11
- constructor({ to, from, cohortId, sessionId, aggregatedNonce }) {
12
- const body = { cohortId, sessionId, aggregatedNonce };
13
- const type = BEACON_COHORT_AGGREGATED_NONCE;
14
- super({ to, from, body, type });
15
- }
16
- /**
17
- * Initializes a BeaconCohortAggregatedNonceMessage from a given AggregatedNonce object.
18
- * @param {CohortAggregatedNonceMessage} data The data object to initialize the BeaconCohortAggregatedNonceMessage.
19
- * @returns {BeaconCohortAggregatedNonceMessage} The new BeaconCohortAggregatedNonceMessage.
20
- */
21
- static fromJSON(data) {
22
- const message = JSONUtils.isParsable(data) ? JSON.parse(data) : data;
23
- if (message.type != BEACON_COHORT_AGGREGATED_NONCE) {
24
- throw new Error(`Invalid type: ${message.type}`);
25
- }
26
- return new BeaconCohortAggregatedNonceMessage(message);
27
- }
28
- }
29
- //# sourceMappingURL=aggregated-nonce.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aggregated-nonce.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,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,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,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"}
@@ -1,30 +0,0 @@
1
- import { JSONUtils } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- import { BEACON_COHORT_AUTHORIZATION_REQUEST } from '../constants.js';
4
- /**
5
- * Sends the unsigned PSBT that spends the Beacon UTXO (plus any SMT proofs).
6
- * Asks the cohort to begin a MuSig2 signing session.
7
- * @class BeaconCohortAuthorizationRequestMessage
8
- * @extends BaseMessage
9
- * @type {CohortAuthorizationRequestMessage}
10
- */
11
- export class BeaconCohortAuthorizationRequestMessage extends BaseMessage {
12
- constructor({ to, from, cohortId, sessionId, pendingTx }) {
13
- const body = { cohortId, sessionId, pendingTx };
14
- const type = BEACON_COHORT_AUTHORIZATION_REQUEST;
15
- super({ to, from, body, type });
16
- }
17
- /**
18
- * Initializes a BeaconCohortAuthorizationRequestMessage from a given AuthorizationRequest object.
19
- * @param {CohortAuthorizationRequestMessage} data The data object to initialize the BeaconCohortAuthorizationRequestMessage.
20
- * @returns {BeaconCohortAuthorizationRequestMessage} The serialized BeaconCohortAuthorizationRequestMessage.
21
- */
22
- static fromJSON(data) {
23
- const message = JSONUtils.isParsable(data) ? JSON.parse(data) : data;
24
- if (message.type != BEACON_COHORT_AUTHORIZATION_REQUEST) {
25
- throw new Error(`Invalid type: ${message.type}`);
26
- }
27
- return new BeaconCohortAuthorizationRequestMessage(message);
28
- }
29
- }
30
- //# sourceMappingURL=authorization-request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authorization-request.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,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,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,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"}
@@ -1,30 +0,0 @@
1
- import { JSONUtils } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- import { BEACON_COHORT_NONCE_CONTRIBUTION } from '../constants.js';
4
- /**
5
- * Represents a message containing a nonce contribution for a cohort participant.
6
- * Participant → Coordinator. Participant sending their public nonce points for the ongoing signing session.
7
- * @class BeaconCohortNonceContributionMessage
8
- * @extends BaseMessage
9
- * @type {BeaconCohortNonceContributionMessage}
10
- */
11
- export class BeaconCohortNonceContributionMessage extends BaseMessage {
12
- constructor({ to, from, cohortId, sessionId, nonceContribution }) {
13
- const body = { cohortId, sessionId, nonceContribution };
14
- const type = BEACON_COHORT_NONCE_CONTRIBUTION;
15
- super({ to, from, body, type });
16
- }
17
- /**
18
- * Initializes a NonceContributionMessage from a given CohortNonceContributionMessage object.
19
- * @param {CohortNonceContributionMessage} data The data object to initialize the BeaconCohortNonceContributionMessage.
20
- * @returns {BeaconCohortNonceContributionMessage} The new BeaconCohortNonceContributionMessage.
21
- */
22
- static fromJSON(data) {
23
- const message = JSONUtils.isParsable(data) ? JSON.parse(data) : data;
24
- if (message.type != BEACON_COHORT_NONCE_CONTRIBUTION) {
25
- throw new Error(`Invalid type: ${message.type}`);
26
- }
27
- return new BeaconCohortNonceContributionMessage(message);
28
- }
29
- }
30
- //# sourceMappingURL=nonce-contribution.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nonce-contribution.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,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,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,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"}
@@ -1,30 +0,0 @@
1
- import { JSONUtils } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- import { BEACON_COHORT_REQUEST_SIGNATURE } from '../constants.js';
4
- /**
5
- * Coordinator → Participants. Returns the aggregation of all participant nonces
6
- * so each participant can produce a correct partial signature.
7
- * @class BeaconCohortRequestSignatureMessage
8
- * @extends BaseMessage
9
- * @type {BeaconCohortRequestSignatureMessage}
10
- */
11
- export class BeaconCohortRequestSignatureMessage extends BaseMessage {
12
- constructor({ to, from, cohortId, sessionId, data }) {
13
- const body = { cohortId, sessionId, data };
14
- const type = BEACON_COHORT_REQUEST_SIGNATURE;
15
- super({ to, from, body, type });
16
- }
17
- /**
18
- * Initializes an BeaconCohortRequestSignatureMessage from a possible CohortRequestSignatureMessage object.
19
- * @param {CohortRequestSignatureMessage} data The data object to initialize the BeaconCohortRequestSignatureMessage.
20
- * @returns {BeaconCohortRequestSignatureMessage} The new BeaconCohortRequestSignatureMessage.
21
- */
22
- static fromJSON(data) {
23
- const message = JSONUtils.isParsable(data) ? JSON.parse(data) : data;
24
- if (message.type != BEACON_COHORT_REQUEST_SIGNATURE) {
25
- throw new Error(`Invalid type: ${message.type}`);
26
- }
27
- return new BeaconCohortRequestSignatureMessage(message);
28
- }
29
- }
30
- //# sourceMappingURL=request-signature.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-signature.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,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,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,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"}
@@ -1,31 +0,0 @@
1
- import { JSONUtils } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- import { BEACON_COHORT_SIGNATURE_AUTHORIZATION } from '../constants.js';
4
- /**
5
- * Participant → Coordinator. Delivers the participant’s partial signature over
6
- * the PSBT, authorizing the final Beacon signal (transaction) once all signatures
7
- * are collected.
8
- * @class BeaconCohortSignatureAuthorizationMessage
9
- * @extends BaseMessage
10
- * @type {BeaconCohortSignatureAuthorizationMessage}
11
- */
12
- export class BeaconCohortSignatureAuthorizationMessage extends BaseMessage {
13
- constructor({ to, from, cohortId, sessionId, partialSignature }) {
14
- const body = { cohortId, sessionId, partialSignature };
15
- const type = BEACON_COHORT_SIGNATURE_AUTHORIZATION;
16
- super({ to, from, body, type });
17
- }
18
- /**
19
- * Initializes an BeaconCohortSignatureAuthorizationMessage from a given CohortSignatureAuthorizationMessage object.
20
- * @param {CohortSignatureAuthorizationMessage} data The data object to initialize the BeaconCohortSignatureAuthorizationMessage.
21
- * @returns {BeaconCohortSignatureAuthorizationMessage} The serialized BeaconCohortSignatureAuthorizationMessage.
22
- */
23
- static fromJSON(data) {
24
- const message = JSONUtils.isParsable(data) ? JSON.parse(data) : data;
25
- if (message.type != BEACON_COHORT_SIGNATURE_AUTHORIZATION) {
26
- throw new Error(`Invalid type: ${message.type}`);
27
- }
28
- return new BeaconCohortSignatureAuthorizationMessage(message);
29
- }
30
- }
31
- //# sourceMappingURL=signature-authorization.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signature-authorization.js","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,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,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACrE,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"}
@@ -1,8 +0,0 @@
1
- export var COHORT_STATUS;
2
- (function (COHORT_STATUS) {
3
- COHORT_STATUS["COHORT_ADVERTISED"] = "ADVERTISED";
4
- COHORT_STATUS["COHORT_OPTED_IN"] = "OPTED_IN";
5
- COHORT_STATUS["COHORT_SET_STATUS"] = "COHORT_SET";
6
- COHORT_STATUS["COHORT_FAILED"] = "FAILED";
7
- })(COHORT_STATUS || (COHORT_STATUS = {}));
8
- //# sourceMappingURL=status.js.map
@@ -1 +0,0 @@
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"}
@@ -1,121 +0,0 @@
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(this.keys.public, this.components);
30
- this.coordinatorDids = config?.coordinatorDids || [];
31
- }
32
- }
33
- /**
34
- * DidCommAdapter implements the CommunicationService interface for DidComm protocol.
35
- * It handles message sending, receiving, and identity generation using DidComm.
36
- * @class DidCommAdapter
37
- * @implements {CommunicationService}
38
- * @type {DidCommAdapter}
39
- */
40
- export class DidCommAdapter {
41
- /**
42
- * The name of the communication service.
43
- * @type {string}
44
- */
45
- name = 'didcomm';
46
- /**
47
- * The configuration for the DidComm adapter.
48
- * @type {DidCommAdapterConfig}
49
- */
50
- config;
51
- /**
52
- * A map of message handlers for different message types.
53
- * @type {Map<string, MessageHandler>}
54
- */
55
- handlers = new Map();
56
- /**
57
- * Constructs a new DidCommAdapter instance with the provided configuration.
58
- * @param {DidCommAdapterConfig} [config] The configuration for the Nostr adapter.
59
- */
60
- constructor(config = {}) {
61
- this.config = new DidCommAdapterConfig(config);
62
- }
63
- /**
64
- * Starts the DidComm service.
65
- * @returns {void} Returns the DidCommAdapter instance for method chaining.
66
- */
67
- start() {
68
- throw new NotImplementedError('DidCommAdapter is not implemented. Use NostrAdapter instead.');
69
- }
70
- /**
71
- * Sets the keys used for Nostr communication.
72
- * @param {ServiceAdapterIdentity<NostrKeys>} keys The keys to set.
73
- */
74
- setKeys(keys) {
75
- this.config.keys = keys;
76
- }
77
- /**
78
- * Registers a message handler for a specific message type.
79
- * @param {string} messageType The type of message to handle.
80
- * @param {MessageHandler} handler The handler function that processes the message.
81
- */
82
- registerMessageHandler(messageType, handler) {
83
- this.handlers.set(messageType, handler);
84
- }
85
- /**
86
- * Sends a message to a recipient using the Nostr protocol.
87
- * This method is a placeholder and should be implemented with actual Nostr message sending logic.
88
- * @param {AggregateBeaconMessageType} _message The message to send, typically containing the content and metadata.
89
- * @param {string} _recipient The public key or identifier of the recipient.
90
- * @param {string} _sender The public key or identifier of the sender.
91
- * @returns {Promise<void>} A promise that resolves when the message is sent.
92
- */
93
- async sendMessage(_message, _recipient, _sender) {
94
- throw new NotImplementedError('DidCommAdapter.start() is not implemented. Use NostrAdapter instead.');
95
- }
96
- /**
97
- * Generates a DidComm identity.
98
- * @param {RawKeyPair} [keys] Optional keys to use for identity generation.
99
- * @returns {ServiceAdapterConfig} The generated DidComm identity configuration.
100
- */
101
- generateIdentity(keys) {
102
- if (!keys) {
103
- this.config.keys.secret = Secp256k1SecretKey.random();
104
- this.config.keys.public = Secp256k1SecretKey.getPublicKey(this.config.keys.secret).compressed;
105
- this.config.did = Identifier.encode(this.config.keys.public, {
106
- idType: this.config.components.idType || 'KEY',
107
- version: this.config.components.version || 1,
108
- network: this.config.components.network || 'regtest',
109
- });
110
- return this.config;
111
- }
112
- this.config.keys = keys;
113
- this.config.did = Identifier.encode(this.config.keys.public, {
114
- idType: this.config.components.idType || 'KEY',
115
- version: this.config.components.version || 1,
116
- network: this.config.components.network || 'regtest',
117
- });
118
- return this.config;
119
- }
120
- }
121
- //# sourceMappingURL=did-comm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"did-comm.js","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/communication/adapter/did-comm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAKvD;;;;;;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,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AAC,MAAM,CAAC,CAAC,UAAU,CAAC;YAC9F,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EACzD;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,SAAS;aAC3D,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,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EACzD;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,SAAS;SAC3D,CACF,CAAC;QACF,OAAO,IAAI,CAAC,MAA8B,CAAC;IAC7C,CAAC;CACF"}
@@ -1,245 +0,0 @@
1
- // TODO: Finish nostr adapter implementation. Rethink patterns used.
2
- import { CompressedSecp256k1PublicKey, SchnorrKeyPair, Secp256k1SecretKey } from '@did-btcr2/keypair';
3
- import { bytesToHex } from '@noble/hashes/utils';
4
- import { nonceGen } from '@scure/btc-signer/musig2';
5
- import { finalizeEvent, nip44, SimplePool } from 'nostr-tools';
6
- import { Identifier } from '../../../../identifier.js';
7
- 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 '../../cohort/messages/constants.js';
8
- import { AggregateBeaconMessage } from '../../cohort/messages/index.js';
9
- import { CommunicationAdapterError } from '../error.js';
10
- /**
11
- * TODO: Determine set of default Nostr relays to use.
12
- * DEFAULT_NOSTR_RELAYS provides a list of default Nostr relay URLs for communication.
13
- * These relays are used to connect to the Nostr network for sending and receiving messages.
14
- * @constant {Array<string>} DEFAULT_NOSTR_RELAYS
15
- */
16
- export const DEFAULT_NOSTR_RELAYS = [
17
- 'wss://relay.damus.io',
18
- // 'wss://nos.lol',
19
- // 'wss://relay.snort.social',
20
- // 'wss://nostr-pub.wellorder.net',
21
- ];
22
- /**
23
- * NostrAdapter implements the CommunicationService interface for Nostr protocol communication.
24
- * It provides methods for starting the service, sending messages, and handling incoming events.
25
- * @class NostrAdapter
26
- * @type {NostrAdapter}
27
- * @implements {CommunicationService}
28
- */
29
- export class NostrAdapter {
30
- /**
31
- * The name of the NostrAdapter service.
32
- * @type {string}
33
- */
34
- name = 'nostr';
35
- /**
36
- * The configuration for the NostrAdapter.
37
- * @type {NostrAdapterConfig}
38
- */
39
- config;
40
- /**
41
- * A map of message handlers for different message types.
42
- * @type {Map<string, MessageHandler>}
43
- */
44
- #handlers = new Map();
45
- /**
46
- * The SimplePool instance for managing Nostr subscriptions.
47
- * @type {SimplePool}
48
- */
49
- pool;
50
- /**
51
- * Constructs a new NostrAdapter instance with the given configuration.
52
- * @param {NostrAdapterConfig} config - The configuration for the NostrAdapter.
53
- * If no configuration is provided, a new key pair is generated and default relays are used.
54
- * @constructor
55
- */
56
- constructor(config = { keys: {}, components: {}, relays: DEFAULT_NOSTR_RELAYS }) {
57
- this.config = config;
58
- this.config.keys = this.config.keys || SchnorrKeyPair.generate().raw;
59
- this.config.did = config.did || Identifier.encode(this.config.keys.public, {
60
- idType: config.components.idType || 'KEY',
61
- version: config.components.version || 1,
62
- network: config.components.network || 'signet'
63
- });
64
- }
65
- /**
66
- * Sets the keys for the NostrAdapter.
67
- * @param {ServiceAdapterIdentity<RawSchnorrKeyPair>} keys - The key pair to set.
68
- */
69
- setKeys(keys) {
70
- this.config.keys = keys;
71
- }
72
- /**
73
- * TODO: Complete this method. Figure out best subscription patterns.
74
- * Starts the Nostr communication service by subscribing to relays.
75
- * @returns {ServiceAdapter<NostrAdapter>} Returns the NostrAdapter instance for method chaining.
76
- */
77
- start() {
78
- this.pool = new SimplePool();
79
- this.pool.subscribe(this.config.relays, { kinds: [1] }, {
80
- onclose: (reasons) => console.log('Subscription to kind 1 closed', reasons),
81
- onevent: this.onEvent.bind(this),
82
- });
83
- // this.pool.subscribe(this.config.relays, { kinds: [1059] } as Filter, {
84
- // onclose : (reasons: string[]) => console.log('Subscription to kind 1059 closed for reasons:', reasons),
85
- // onevent : this.onEvent.bind(this),
86
- // oneose : () => { Logger.info('EOSE kinds 1059'); }
87
- // });
88
- return this;
89
- }
90
- /**
91
- * TODO: Complete this method. Figure out best way to filter incoming nostr events.
92
- * Handles incoming Nostr events and dispatches them to the appropriate message handler.
93
- * @param {Event} event The Nostr event received from the relay.
94
- */
95
- async onEvent(event) {
96
- // Logger.debug('nostr.onEvent: event.tags', event.tags);
97
- // Dispatch the event to the registered handler
98
- const ptags = event.tags.filter(([name, _]) => name === 'p') ?? [];
99
- // Logger.debug('nostr.onEvent: event.tags.find => ptags', ptags);
100
- for (const [p, pk] of ptags) {
101
- if (pk === 'b71d3052dcdc8ba4564388948b655b58aaa7f37497ef1fc98829f9191adc8f85') {
102
- console.debug('nostr.onEvent: event.tags.find => p, pk', p, pk);
103
- }
104
- }
105
- // if(!type && !value) {
106
- // // Logger.warn(`Event ${event.id} does not have a valid tag, skipping handler dispatch.`);
107
- // return;
108
- // }
109
- // Logger.debug('nostr.onEvent: event.tags.find => type, value', type, value);
110
- // Logger.debug('nostr.onEvent: event', event);
111
- // Logger.debug('nostr.onEvent: event.tags', event.tags);
112
- // if(event.kind === 1 && !AggregateBeaconMessage.isKeyGenMessageValue(value)) {
113
- // Logger.warn(`Event ${event.id} is not a key generation message type: ${value}, skipping handler dispatch.`);
114
- // return;
115
- // }
116
- // if(event.kind === 1059 && !AggregateBeaconMessage.isSignMessageValue(value)) {
117
- // Logger.warn(`Event ${event.id} has an invalid title tag: ${value}, skipping handler dispatch.`);
118
- // return;
119
- // }
120
- // const handler = this.handlers.get(value);
121
- // if (!handler) {
122
- // Logger.warn(`No handler found for message with tag value: ${value}`);
123
- // return;
124
- // }
125
- // await handler(event);
126
- }
127
- /**
128
- * Registers a message handler for a specific message type.
129
- * @param {string} messageType The type of message to handle.
130
- * @param {MessageHandler} handler The handler function that processes the message.
131
- */
132
- registerMessageHandler(messageType, handler) {
133
- this.#handlers.set(messageType, handler);
134
- }
135
- /**
136
- * TODO: Clean up and complete this method.
137
- * Sends a message to a recipient using the Nostr protocol.
138
- * This method is a placeholder and should be implemented with actual Nostr message sending logic.
139
- * @param {AggregateBeaconMessageType} message The message to send, typically containing the content and metadata.
140
- * @param {Did} from The identifier of the sender.
141
- * @param {Did} [to] The identifier of the recipient.
142
- * @returns {Promise<void>} A promise that resolves when the message is sent.
143
- */
144
- async sendMessage(message, from, to) {
145
- // Check if the sender and recipient DIDs are valid identifiers
146
- if ([from, to]
147
- .filter(did => !!did)
148
- .every(did => !Identifier.isValid(did))) {
149
- console.error(`Invalid identifiers: sender ${from}, recipient ${to}`);
150
- throw new CommunicationAdapterError(`Invalid identifiers: sender ${from}, recipient ${to}`, 'SEND_MESSAGE_ERROR', { adapter: this.name });
151
- }
152
- // Decode the sender and recipient DIDs to get their genesis bytes in hex
153
- const sender = new CompressedSecp256k1PublicKey(Identifier.decode(from).genesisBytes);
154
- console.info(`Sending message from ${sender}:`, message);
155
- // if(message.type === BEACON_COHORT_SUBSCRIBE_ACCEPT) {
156
- // this.config.coordinatorDids.push(recipient);
157
- // }
158
- const tags = [['p', bytesToHex(sender.x)]];
159
- if (to) {
160
- const recipient = new CompressedSecp256k1PublicKey(Identifier.decode(to).genesisBytes);
161
- tags.push(['p', bytesToHex(recipient.x)]);
162
- }
163
- const { type } = message ?? {};
164
- if (!type) {
165
- console.error('Message type is undefined:', message);
166
- throw new CommunicationAdapterError('Message type is undefined', 'SEND_MESSAGE_ERROR', { adapter: this.name });
167
- }
168
- if (AggregateBeaconMessage.isKeyGenMessageValue(type)) {
169
- switch (type) {
170
- case BEACON_COHORT_ADVERT:
171
- console.info('Add tag', ['BEACON_COHORT_ADVERT', type]);
172
- break;
173
- case BEACON_COHORT_OPT_IN:
174
- console.info('Add tag', ['BEACON_COHORT_OPT_IN', type]);
175
- break;
176
- case BEACON_COHORT_OPT_IN_ACCEPT:
177
- console.info('Add tag', ['BEACON_COHORT_OPT_IN_ACCEPT', type]);
178
- break;
179
- case BEACON_COHORT_READY:
180
- console.info('Add tag', ['BEACON_COHORT_READY', type]);
181
- break;
182
- }
183
- const event = finalizeEvent({
184
- kind: 1,
185
- created_at: Math.floor(Date.now() / 1000),
186
- tags,
187
- content: JSON.stringify(message)
188
- }, this.config.keys.secret);
189
- console.info(`Sending message kind 1 event ...`, event);
190
- return this.pool?.publish(this.config.relays, event);
191
- }
192
- if (AggregateBeaconMessage.isSignMessageValue(type)) {
193
- switch (type) {
194
- case BEACON_COHORT_REQUEST_SIGNATURE:
195
- console.info('Add tag', ['BEACON_COHORT_REQUEST_SIGNATURE', type]);
196
- break;
197
- case BEACON_COHORT_AUTHORIZATION_REQUEST:
198
- console.info('Add tag', ['BEACON_COHORT_AUTHORIZATION_REQUEST', type]);
199
- break;
200
- case BEACON_COHORT_NONCE_CONTRIBUTION:
201
- console.info('Add tag', ['BEACON_COHORT_NONCE_CONTRIBUTION', type]);
202
- break;
203
- case BEACON_COHORT_AGGREGATED_NONCE:
204
- console.info('Add tag', ['BEACON_COHORT_AGGREGATED_NONCE', type]);
205
- break;
206
- case BEACON_COHORT_SIGNATURE_AUTHORIZATION:
207
- console.info('Add tag', ['BEACON_COHORT_SIGNATURE_AUTHORIZATION', type]);
208
- break;
209
- }
210
- const { publicKey, secretKey } = SchnorrKeyPair.generate();
211
- const content = nip44.encrypt(JSON.stringify(message), secretKey.bytes, nonceGen(publicKey.x).public);
212
- console.debug('NostrAdapter content:', content);
213
- const event = finalizeEvent({ content, tags, kind: 1059 }, this.config.keys.secret);
214
- console.debug('NostrAdapter event:', event);
215
- return this.pool?.publish(this.config.relays, event);
216
- }
217
- console.error(`Unsupported message type: ${type}`);
218
- }
219
- /**
220
- * TODO: Determine if this method is needed.
221
- * Generates a Nostr identity using the Secp256k1SecretKey and Identifier classes.
222
- * @param {RawSchnorrKeyPair} [keys] Optional keys to use for identity generation.
223
- * @returns {ServiceAdapterConfig} The generated Nostr identity configuration.
224
- */
225
- generateIdentity(keys) {
226
- if (!keys) {
227
- this.config.keys.secret = Secp256k1SecretKey.random();
228
- this.config.keys.public = Secp256k1SecretKey.getPublicKey(this.config.keys.secret).compressed;
229
- this.config.did = Identifier.encode(this.config.keys.public, {
230
- idType: this.config.components.idType || 'KEY',
231
- version: this.config.components.version || 1,
232
- network: this.config.components.network || 'signet',
233
- });
234
- return this.config;
235
- }
236
- this.config.keys = keys;
237
- this.config.did = Identifier.encode(this.config.keys.public, {
238
- idType: this.config.components.idType || 'KEY',
239
- version: this.config.components.version || 1,
240
- network: this.config.components.network || 'signet',
241
- });
242
- return this.config;
243
- }
244
- }
245
- //# sourceMappingURL=nostr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nostr.js","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/communication/adapter/nostr.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAIpE,OAAO,EAAE,4BAA4B,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,MAAM,qBA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