@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,25 +0,0 @@
1
- import type { Maybe } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- import { BEACON_COHORT_OPT_IN_ACCEPT } from '../constants.js';
4
- export interface CohortSubscribeMessage {
5
- type?: typeof BEACON_COHORT_OPT_IN_ACCEPT;
6
- to: string;
7
- from: string;
8
- }
9
- /**
10
- * Represents a message for subscribing to a cohort.
11
- * This message is sent by a coordinator to a participant to indicate acceptance in the cohort.
12
- * @class BeaconCohortSubscribeMessage
13
- * @extends BaseMessage
14
- * @type {BeaconCohortSubscribeMessage}
15
- */
16
- export declare class BeaconCohortSubscribeMessage extends BaseMessage {
17
- constructor({ to, from }: CohortSubscribeMessage);
18
- /**
19
- * Initializes a BeaconCohortSubscribeMessage from a possible CohortSubscribeMessage object.
20
- * @param {CohortSubscribeMessage} data The Subscribe object to initialize the SubscribeMessage.
21
- * @returns {BeaconCohortSubscribeMessage} The serialized SubscribeMessage.
22
- */
23
- static fromJSON(data: Maybe<CohortSubscribeMessage>): BeaconCohortSubscribeMessage;
24
- }
25
- //# sourceMappingURL=subscribe.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,OAAO,2BAA2B,CAAC;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,qBAAa,4BAA6B,SAAQ,WAAW;gBAC/C,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,sBAAsB;IAIhD;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,sBAAsB,CAAC,GAAG,4BAA4B;CAO1F"}
@@ -1,25 +0,0 @@
1
- import type { Maybe } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- export interface CohortAggregatedNonceMessage {
4
- to: string;
5
- from: string;
6
- cohortId: string;
7
- sessionId: string;
8
- aggregatedNonce: Uint8Array;
9
- }
10
- /**
11
- * Represents a message containing an aggregated nonce for a cohort in the Beacon protocol.
12
- * @class BeaconCohortAggregatedNonceMessage
13
- * @extends BaseMessage
14
- * @type {BeaconCohortAggregatedNonceMessage}
15
- */
16
- export declare class BeaconCohortAggregatedNonceMessage extends BaseMessage {
17
- constructor({ to, from, cohortId, sessionId, aggregatedNonce }: CohortAggregatedNonceMessage);
18
- /**
19
- * Initializes a BeaconCohortAggregatedNonceMessage from a given AggregatedNonce object.
20
- * @param {CohortAggregatedNonceMessage} data The data object to initialize the BeaconCohortAggregatedNonceMessage.
21
- * @returns {BeaconCohortAggregatedNonceMessage} The new BeaconCohortAggregatedNonceMessage.
22
- */
23
- static fromJSON(data: Maybe<CohortAggregatedNonceMessage>): BeaconCohortAggregatedNonceMessage;
24
- }
25
- //# sourceMappingURL=aggregated-nonce.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aggregated-nonce.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,UAAU,CAAC;CAC7B;AAED;;;;;GAKG;AACH,qBAAa,kCAAmC,SAAQ,WAAW;gBACrD,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,4BAA4B;IAM5F;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,4BAA4B,CAAC,GAAG,kCAAkC;CAOtG"}
@@ -1,26 +0,0 @@
1
- import type { Maybe } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- export interface CohortAuthorizationRequestMessage {
4
- to: string;
5
- from: string;
6
- cohortId: string;
7
- sessionId: string;
8
- pendingTx: string;
9
- }
10
- /**
11
- * Sends the unsigned PSBT that spends the Beacon UTXO (plus any SMT proofs).
12
- * Asks the cohort to begin a MuSig2 signing session.
13
- * @class BeaconCohortAuthorizationRequestMessage
14
- * @extends BaseMessage
15
- * @type {CohortAuthorizationRequestMessage}
16
- */
17
- export declare class BeaconCohortAuthorizationRequestMessage extends BaseMessage {
18
- constructor({ to, from, cohortId, sessionId, pendingTx }: CohortAuthorizationRequestMessage);
19
- /**
20
- * Initializes a BeaconCohortAuthorizationRequestMessage from a given AuthorizationRequest object.
21
- * @param {CohortAuthorizationRequestMessage} data The data object to initialize the BeaconCohortAuthorizationRequestMessage.
22
- * @returns {BeaconCohortAuthorizationRequestMessage} The serialized BeaconCohortAuthorizationRequestMessage.
23
- */
24
- static fromJSON(data: Maybe<CohortAuthorizationRequestMessage>): BeaconCohortAuthorizationRequestMessage;
25
- }
26
- //# sourceMappingURL=authorization-request.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authorization-request.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,MAAM,WAAW,iCAAiC;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,qBAAa,uCAAwC,SAAQ,WAAW;gBAC1D,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,iCAAiC;IAM3F;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,iCAAiC,CAAC,GAAG,uCAAuC;CAOhH"}
@@ -1,26 +0,0 @@
1
- import type { Maybe } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- export interface CohortNonceContributionMessage {
4
- to: string;
5
- from: string;
6
- cohortId: string;
7
- sessionId: string;
8
- nonceContribution: Uint8Array;
9
- }
10
- /**
11
- * Represents a message containing a nonce contribution for a cohort participant.
12
- * Participant → Coordinator. Participant sending their public nonce points for the ongoing signing session.
13
- * @class BeaconCohortNonceContributionMessage
14
- * @extends BaseMessage
15
- * @type {BeaconCohortNonceContributionMessage}
16
- */
17
- export declare class BeaconCohortNonceContributionMessage extends BaseMessage {
18
- constructor({ to, from, cohortId, sessionId, nonceContribution }: CohortNonceContributionMessage);
19
- /**
20
- * Initializes a NonceContributionMessage from a given CohortNonceContributionMessage object.
21
- * @param {CohortNonceContributionMessage} data The data object to initialize the BeaconCohortNonceContributionMessage.
22
- * @returns {BeaconCohortNonceContributionMessage} The new BeaconCohortNonceContributionMessage.
23
- */
24
- static fromJSON(data: Maybe<CohortNonceContributionMessage>): BeaconCohortNonceContributionMessage;
25
- }
26
- //# sourceMappingURL=nonce-contribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nonce-contribution.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,MAAM,WAAW,8BAA8B;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,qBAAa,oCAAqC,SAAQ,WAAW;gBACvD,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,8BAA8B;IAMhG;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,8BAA8B,CAAC,GAAG,oCAAoC;CAO1G"}
@@ -1,26 +0,0 @@
1
- import type { Maybe } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- export type CohortRequestSignatureMessage = {
4
- to: string;
5
- from: string;
6
- cohortId: string;
7
- sessionId?: string;
8
- data: string;
9
- };
10
- /**
11
- * Coordinator → Participants. Returns the aggregation of all participant nonces
12
- * so each participant can produce a correct partial signature.
13
- * @class BeaconCohortRequestSignatureMessage
14
- * @extends BaseMessage
15
- * @type {BeaconCohortRequestSignatureMessage}
16
- */
17
- export declare class BeaconCohortRequestSignatureMessage extends BaseMessage {
18
- constructor({ to, from, cohortId, sessionId, data }: CohortRequestSignatureMessage);
19
- /**
20
- * Initializes an BeaconCohortRequestSignatureMessage from a possible CohortRequestSignatureMessage object.
21
- * @param {CohortRequestSignatureMessage} data The data object to initialize the BeaconCohortRequestSignatureMessage.
22
- * @returns {BeaconCohortRequestSignatureMessage} The new BeaconCohortRequestSignatureMessage.
23
- */
24
- static fromJSON(data: Maybe<CohortRequestSignatureMessage>): BeaconCohortRequestSignatureMessage;
25
- }
26
- //# sourceMappingURL=request-signature.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-signature.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,MAAM,MAAM,6BAA6B,GAAG;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,mCAAoC,SAAQ,WAAW;gBACtD,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,6BAA6B;IAMlF;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,6BAA6B,CAAC,GAAG,mCAAmC;CAOxG"}
@@ -1,27 +0,0 @@
1
- import type { Maybe } from '@did-btcr2/common';
2
- import { BaseMessage } from '../base.js';
3
- export type CohortSignatureAuthorizationMessage = {
4
- to: string;
5
- from: string;
6
- cohortId: string;
7
- sessionId: string;
8
- partialSignature: Uint8Array;
9
- };
10
- /**
11
- * Participant → Coordinator. Delivers the participant’s partial signature over
12
- * the PSBT, authorizing the final Beacon signal (transaction) once all signatures
13
- * are collected.
14
- * @class BeaconCohortSignatureAuthorizationMessage
15
- * @extends BaseMessage
16
- * @type {BeaconCohortSignatureAuthorizationMessage}
17
- */
18
- export declare class BeaconCohortSignatureAuthorizationMessage extends BaseMessage {
19
- constructor({ to, from, cohortId, sessionId, partialSignature }: CohortSignatureAuthorizationMessage);
20
- /**
21
- * Initializes an BeaconCohortSignatureAuthorizationMessage from a given CohortSignatureAuthorizationMessage object.
22
- * @param {CohortSignatureAuthorizationMessage} data The data object to initialize the BeaconCohortSignatureAuthorizationMessage.
23
- * @returns {BeaconCohortSignatureAuthorizationMessage} The serialized BeaconCohortSignatureAuthorizationMessage.
24
- */
25
- static fromJSON(data: Maybe<CohortSignatureAuthorizationMessage>): BeaconCohortSignatureAuthorizationMessage;
26
- }
27
- //# sourceMappingURL=signature-authorization.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signature-authorization.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,MAAM,MAAM,mCAAmC,GAAG;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,UAAU,CAAC;CAC9B,CAAA;AAED;;;;;;;GAOG;AACH,qBAAa,yCAA0C,SAAQ,WAAW;gBAC5D,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,mCAAmC;IAMpG;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,mCAAmC,CAAC,GAAG,yCAAyC;CAOpH"}
@@ -1,8 +0,0 @@
1
- export type COHORT_STATUS_TYPE = 'ADVERTISED' | 'OPTED_IN' | 'COHORT_SET' | 'FAILED';
2
- export declare enum COHORT_STATUS {
3
- COHORT_ADVERTISED = "ADVERTISED",
4
- COHORT_OPTED_IN = "OPTED_IN",
5
- COHORT_SET_STATUS = "COHORT_SET",
6
- COHORT_FAILED = "FAILED"
7
- }
8
- //# sourceMappingURL=status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/cohort/status.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;AACrF,oBAAY,aAAa;IACvB,iBAAiB,eAAe;IAChC,eAAe,aAAa;IAC5B,iBAAiB,eAAe;IAChC,aAAa,WAAW;CACzB"}
@@ -1,89 +0,0 @@
1
- import type { RawSchnorrKeyPair } from '@did-btcr2/keypair';
2
- import type { AggregateBeaconMessageType } from '../../cohort/messages/index.js';
3
- import type { BaseMessage } from '../../cohort/messages/base.js';
4
- import type { CommunicationService, MessageHandler, ServiceAdapterConfig, ServiceAdapterIdentity } from '../service.js';
5
- /**
6
- * DidCommAdapterConfig is a configuration class for the DidCommAdapter.
7
- * It holds the necessary parameters to connect to Nostr relays and manage keys.
8
- * @class DidCommAdapterConfig
9
- * @implements {ServiceAdapterConfig}
10
- * @type {DidCommAdapterConfig}
11
- */
12
- export declare class DidCommAdapterConfig implements ServiceAdapterConfig {
13
- keys: RawSchnorrKeyPair;
14
- components: {
15
- idType: string;
16
- version: number;
17
- network: string;
18
- };
19
- did: string;
20
- coordinatorDids: string[];
21
- /**
22
- * Constructs a new DidCommAdapterConfig instance.
23
- * @param {Partial<ServiceAdapterConfig>} [config] Optional configuration parameters to initialize the adapter.
24
- * @constructor
25
- * @type {DidCommAdapterConfig}
26
- */
27
- constructor(config?: Partial<ServiceAdapterConfig>);
28
- }
29
- /**
30
- * DidCommAdapter implements the CommunicationService interface for DidComm protocol.
31
- * It handles message sending, receiving, and identity generation using DidComm.
32
- * @class DidCommAdapter
33
- * @implements {CommunicationService}
34
- * @type {DidCommAdapter}
35
- */
36
- export declare class DidCommAdapter implements CommunicationService {
37
- /**
38
- * The name of the communication service.
39
- * @type {string}
40
- */
41
- name: string;
42
- /**
43
- * The configuration for the DidComm adapter.
44
- * @type {DidCommAdapterConfig}
45
- */
46
- config: DidCommAdapterConfig;
47
- /**
48
- * A map of message handlers for different message types.
49
- * @type {Map<string, MessageHandler>}
50
- */
51
- private handlers;
52
- /**
53
- * Constructs a new DidCommAdapter instance with the provided configuration.
54
- * @param {DidCommAdapterConfig} [config] The configuration for the Nostr adapter.
55
- */
56
- constructor(config?: DidCommAdapterConfig);
57
- /**
58
- * Starts the DidComm service.
59
- * @returns {void} Returns the DidCommAdapter instance for method chaining.
60
- */
61
- start(): void;
62
- /**
63
- * Sets the keys used for Nostr communication.
64
- * @param {ServiceAdapterIdentity<NostrKeys>} keys The keys to set.
65
- */
66
- setKeys(keys: ServiceAdapterIdentity<RawSchnorrKeyPair>): void;
67
- /**
68
- * Registers a message handler for a specific message type.
69
- * @param {string} messageType The type of message to handle.
70
- * @param {MessageHandler} handler The handler function that processes the message.
71
- */
72
- registerMessageHandler(messageType: string, handler: MessageHandler): void;
73
- /**
74
- * Sends a message to a recipient using the Nostr protocol.
75
- * This method is a placeholder and should be implemented with actual Nostr message sending logic.
76
- * @param {AggregateBeaconMessageType} _message The message to send, typically containing the content and metadata.
77
- * @param {string} _recipient The public key or identifier of the recipient.
78
- * @param {string} _sender The public key or identifier of the sender.
79
- * @returns {Promise<void>} A promise that resolves when the message is sent.
80
- */
81
- sendMessage(_message: AggregateBeaconMessageType | BaseMessage, _recipient: string, _sender: string): Promise<void | Promise<string>[]>;
82
- /**
83
- * Generates a DidComm identity.
84
- * @param {RawKeyPair} [keys] Optional keys to use for identity generation.
85
- * @returns {ServiceAdapterConfig} The generated DidComm identity configuration.
86
- */
87
- generateIdentity(keys?: RawSchnorrKeyPair): ServiceAdapterConfig;
88
- }
89
- //# sourceMappingURL=did-comm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"did-comm.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/communication/adapter/did-comm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAG3D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAExH;;;;;;GAMG;AACH,qBAAa,oBAAqB,YAAW,oBAAoB;IACxD,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACK,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,EAAE,CAAC;IAEjC;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;CAUnD;AAED;;;;;;GAMG;AACH,qBAAa,cAAe,YAAW,oBAAoB;IACzD;;;OAGG;IACI,IAAI,EAAE,MAAM,CAAa;IAEhC;;;OAGG;IACI,MAAM,EAAE,oBAAoB,CAAC;IAEpC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAA0C;IAE1D;;;OAGG;gBACS,MAAM,GAAE,oBAAiD;IAIrE;;;OAGG;IACI,KAAK,IAAI,IAAI;IAIpB;;;OAGG;IACI,OAAO,CAAC,IAAI,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAIrE;;;;OAIG;IACI,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAIjF;;;;;;;OAOG;IACU,WAAW,CACtB,QAAQ,EAAE,0BAA0B,GAAG,WAAW,EAClD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IAIpC;;;;OAIG;IACI,gBAAgB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,oBAAoB;CAwBxE"}
@@ -1,103 +0,0 @@
1
- import type { Did } from '@did-btcr2/common';
2
- import type { RawSchnorrKeyPair } from '@did-btcr2/keypair';
3
- import { SimplePool } from 'nostr-tools';
4
- import type { AggregateBeaconMessageType } from '../../cohort/messages/index.js';
5
- import type { BaseMessage } from '../../cohort/messages/base.js';
6
- import type { CommunicationService, MessageHandler, ServiceAdapter, ServiceAdapterConfig, ServiceAdapterIdentity } from '../service.js';
7
- /**
8
- * TODO: Determine set of default Nostr relays to use.
9
- * DEFAULT_NOSTR_RELAYS provides a list of default Nostr relay URLs for communication.
10
- * These relays are used to connect to the Nostr network for sending and receiving messages.
11
- * @constant {Array<string>} DEFAULT_NOSTR_RELAYS
12
- */
13
- export declare const DEFAULT_NOSTR_RELAYS: string[];
14
- /**
15
- * NostrAdapterConfig defines the configuration structure for the Nostr communication adapter.
16
- * It includes relay URLs, key pairs, and components for identity generation.
17
- * @interface NostrAdapterConfig
18
- * @type {NostrAdapterConfig}
19
- */
20
- export interface NostrAdapterConfig {
21
- keys: RawSchnorrKeyPair;
22
- did?: string;
23
- components: {
24
- idType?: string;
25
- version?: number;
26
- network?: string;
27
- };
28
- relays: string[];
29
- [key: string]: any;
30
- }
31
- /**
32
- * NostrAdapter implements the CommunicationService interface for Nostr protocol communication.
33
- * It provides methods for starting the service, sending messages, and handling incoming events.
34
- * @class NostrAdapter
35
- * @type {NostrAdapter}
36
- * @implements {CommunicationService}
37
- */
38
- export declare class NostrAdapter implements CommunicationService {
39
- #private;
40
- /**
41
- * The name of the NostrAdapter service.
42
- * @type {string}
43
- */
44
- name: string;
45
- /**
46
- * The configuration for the NostrAdapter.
47
- * @type {NostrAdapterConfig}
48
- */
49
- config: NostrAdapterConfig;
50
- /**
51
- * The SimplePool instance for managing Nostr subscriptions.
52
- * @type {SimplePool}
53
- */
54
- pool?: SimplePool;
55
- /**
56
- * Constructs a new NostrAdapter instance with the given configuration.
57
- * @param {NostrAdapterConfig} config - The configuration for the NostrAdapter.
58
- * If no configuration is provided, a new key pair is generated and default relays are used.
59
- * @constructor
60
- */
61
- constructor(config?: NostrAdapterConfig);
62
- /**
63
- * Sets the keys for the NostrAdapter.
64
- * @param {ServiceAdapterIdentity<RawSchnorrKeyPair>} keys - The key pair to set.
65
- */
66
- setKeys(keys: ServiceAdapterIdentity<RawSchnorrKeyPair>): void;
67
- /**
68
- * TODO: Complete this method. Figure out best subscription patterns.
69
- * Starts the Nostr communication service by subscribing to relays.
70
- * @returns {ServiceAdapter<NostrAdapter>} Returns the NostrAdapter instance for method chaining.
71
- */
72
- start(): ServiceAdapter<NostrAdapter>;
73
- /**
74
- * TODO: Complete this method. Figure out best way to filter incoming nostr events.
75
- * Handles incoming Nostr events and dispatches them to the appropriate message handler.
76
- * @param {Event} event The Nostr event received from the relay.
77
- */
78
- private onEvent;
79
- /**
80
- * Registers a message handler for a specific message type.
81
- * @param {string} messageType The type of message to handle.
82
- * @param {MessageHandler} handler The handler function that processes the message.
83
- */
84
- registerMessageHandler(messageType: string, handler: MessageHandler): void;
85
- /**
86
- * TODO: Clean up and complete this method.
87
- * Sends a message to a recipient using the Nostr protocol.
88
- * This method is a placeholder and should be implemented with actual Nostr message sending logic.
89
- * @param {AggregateBeaconMessageType} message The message to send, typically containing the content and metadata.
90
- * @param {Did} from The identifier of the sender.
91
- * @param {Did} [to] The identifier of the recipient.
92
- * @returns {Promise<void>} A promise that resolves when the message is sent.
93
- */
94
- sendMessage(message: AggregateBeaconMessageType | BaseMessage, from: Did, to?: Did): Promise<void | Promise<string>[]>;
95
- /**
96
- * TODO: Determine if this method is needed.
97
- * Generates a Nostr identity using the Secp256k1SecretKey and Identifier classes.
98
- * @param {RawSchnorrKeyPair} [keys] Optional keys to use for identity generation.
99
- * @returns {ServiceAdapterConfig} The generated Nostr identity configuration.
100
- */
101
- generateIdentity(keys?: RawSchnorrKeyPair): ServiceAdapterConfig;
102
- }
103
- //# sourceMappingURL=nostr.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nostr.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/communication/adapter/nostr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAK3D,OAAO,EAAwB,UAAU,EAAE,MAAM,aAAa,CAAC;AAa/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAExI;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,UAKhC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE;QACV,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;;;GAMG;AACH,qBAAa,YAAa,YAAW,oBAAoB;;IACvD;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAW;IAEvB;;;OAGG;IACH,MAAM,EAAE,kBAAkB,CAAC;IAQ3B;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;OAKG;gBACS,MAAM,GAAE,kBAAoG;IAUxH;;;OAGG;IACI,OAAO,CAAC,IAAI,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAKrE;;;;OAIG;IACI,KAAK,IAAI,cAAc,CAAC,YAAY,CAAC;IAkB5C;;;;OAIG;YACW,OAAO;IAuCrB;;;;OAIG;IACI,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAKjF;;;;;;;;OAQG;IACU,WAAW,CAAC,OAAO,EAAE,0BAA0B,GAAG,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IA2FnI;;;;;OAKG;IACI,gBAAgB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,oBAAoB;CAwBxE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/communication/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,qBAAa,yBAA0B,SAAQ,WAAW;gBAC5C,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAoC,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGpG;AAED,qBAAa,yBAA0B,SAAQ,WAAW;gBAC5C,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAoC,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGpG"}
@@ -1,10 +0,0 @@
1
- import type { CommunicationService, Service } from './service.js';
2
- /**
3
- * Communication Factory pattern to create Communication Service instances.
4
- * @class CommunicationFactory
5
- * @type {CommunicationFactory}
6
- */
7
- export declare class CommunicationFactory {
8
- static establish(service: Service): CommunicationService;
9
- }
10
- //# sourceMappingURL=factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/communication/factory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAElE;;;;GAIG;AACH,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB;CAazD"}
@@ -1,36 +0,0 @@
1
- import type { AggregateBeaconMessageType } from '../cohort/messages/index.js';
2
- import type { BaseMessage } from '../cohort/messages/base.js';
3
- import type { RawSchnorrKeyPair } from '@did-btcr2/keypair';
4
- /**
5
- * ServiceAdapterConfig defines the configuration structure for the Nostr communication service.
6
- * It includes relay URLs, key pairs, and components for identity generation.
7
- * @interface ServiceAdapterConfig
8
- * @extends {Record<string, any>}
9
- * @type {ServiceAdapterConfig}
10
- */
11
- export interface ServiceAdapterConfig extends Record<string, any> {
12
- keys: ServiceAdapterIdentity<any>;
13
- did: string;
14
- }
15
- export type SyncMessageHandler = (msg: any) => void;
16
- export type AsyncMessageHandler = (msg: any) => Promise<void>;
17
- export type MessageHandler = SyncMessageHandler | AsyncMessageHandler;
18
- export type CommunicationServiceType = 'nostr' | 'didcomm';
19
- export type ServiceAdapterConfigType<T extends ServiceAdapterConfig> = T;
20
- export interface Service {
21
- type: CommunicationServiceType;
22
- keys: ServiceAdapterIdentity<RawSchnorrKeyPair>;
23
- did: string;
24
- name?: string;
25
- }
26
- export type ServiceAdapter<T extends CommunicationService> = T;
27
- export type ServiceAdapterIdentity<T extends RawSchnorrKeyPair> = T;
28
- export interface CommunicationService {
29
- name: string;
30
- start(): void;
31
- setKeys(keys: ServiceAdapterIdentity<RawSchnorrKeyPair>): void;
32
- registerMessageHandler(messageType: string, handler: MessageHandler): void;
33
- sendMessage(message: AggregateBeaconMessageType | BaseMessage, sender: string, recipient?: string): Promise<void | Promise<string>[]>;
34
- generateIdentity(keys?: RawSchnorrKeyPair): ServiceAdapterConfigType<ServiceAdapterConfig>;
35
- }
36
- //# sourceMappingURL=service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/communication/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC/D,IAAI,EAAE,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAClC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAEtE,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,SAAS,CAAC;AAC3D,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,oBAAoB,IAAI,CAAC,CAAC;AACzE,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,wBAAwB,CAAC;IAC/B,IAAI,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,oBAAoB,IAAI,CAAC,CAAC;AAC/D,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,iBAAiB,IAAI,CAAC,CAAC;AACpE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,CAAC,IAAI,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAC/D,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC3E,WAAW,CACT,OAAO,EAAE,0BAA0B,GAAG,WAAW,EACjD,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACrC,gBAAgB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;CAC5F"}
@@ -1,116 +0,0 @@
1
- import type { RawSchnorrKeyPair } from '@did-btcr2/keypair';
2
- import { AggregateBeaconCohort } from './cohort/index.js';
3
- import type { CommunicationService, Service, ServiceAdapterIdentity } from './communication/service.js';
4
- import type { BeaconCohortSigningSession } from './session/index.js';
5
- /**
6
- * Parameters for initializing a BeaconCoordinator.
7
- * @type {BeaconCoordinatorParams}
8
- * @property {CommunicationService} [protocol] - The communication protocol to be used.
9
- * @property {string} did - The Decentralized Identifier (DID) for the coordinator.
10
- * @property {ServiceAdapterIdentity<RawSchnorrKeyPair>} keys - The keys used for cryptographic operations.
11
- * @property {string} [name] - Optional name for the coordinator.
12
- */
13
- export type BeaconCoordinatorParams = {
14
- protocol?: CommunicationService;
15
- did: string;
16
- keys: ServiceAdapterIdentity<RawSchnorrKeyPair>;
17
- name?: string;
18
- };
19
- /**
20
- * The BeaconCoordinator class is responsible for managing the coordination of beacon aggregation.
21
- * @class BeaconCoordinator
22
- * @type {BeaconCoordinator}
23
- */
24
- export declare class BeaconCoordinator {
25
- #private;
26
- /**
27
- * The name of the BeaconCoordinator service.
28
- * @type {string}
29
- */
30
- name: string;
31
- /**
32
- * The DID of the BeaconCoordinator.
33
- * @type {Array<string>}
34
- */
35
- did: string;
36
- /**
37
- * The communication protocol used by the BeaconCoordinator.
38
- * @type {CommunicationService}
39
- */
40
- protocol: CommunicationService;
41
- /**
42
- * List of subscribers engaged in a Musig2 Cohort signing session with the BeaconCoordinator.
43
- * @type {Array<string>}
44
- */
45
- cohorts: Array<AggregateBeaconCohort>;
46
- /**
47
- * Active signing sessions for the BeaconCoordinator.
48
- * @type {Record<string, BeaconCohortSigningSession>}
49
- */
50
- activeSigningSessions: Map<string, BeaconCohortSigningSession>;
51
- /**
52
- * Constructs a new BeaconCoordinator instance.
53
- * @param {BeaconCoordinatorParams} params The parameters for the coordinator.
54
- * @param {CommunicationService} params.protocol The protocol service used for communication.
55
- * @param {string} [params.name] Optional name for the coordinator. If not provided, a default name will be generated.
56
- * @param {string} [params.did] Optional DID to use for the coordinator. If not provided, a new DID will be generated.
57
- * @param {ServiceAdapterIdentity<RawKeyPair>} params.keys The keys used for cryptographic operations.
58
- */
59
- constructor(params: {
60
- did: string;
61
- keys: ServiceAdapterIdentity<RawSchnorrKeyPair>;
62
- protocol?: CommunicationService;
63
- name?: string;
64
- });
65
- /**
66
- * Setup and start the BeaconCoordinator communication protocol.
67
- * @returns {void}
68
- */
69
- start(): void;
70
- /**
71
- * Starts the key generation process for a cohort once it has enough participants.
72
- * @param {Musig2Cohort} cohort The cohort for which to start key generation.
73
- * @returns {Promise<void>}
74
- */
75
- private _startKeyGeneration;
76
- /**
77
- * Accepts a subscription request from a participant.
78
- * @param {string} participant The DID of the participant requesting the subscription.
79
- * @returns {Promise<void>}
80
- */
81
- acceptSubscription(participant: string): Promise<void>;
82
- /**
83
- * Sends the aggregated nonce to all participants in the session.
84
- * @param {BeaconCohortSigningSession} session The session containing the aggregated nonce.
85
- * @returns {Promise<void>}
86
- */
87
- sendAggregatedNonce(session: BeaconCohortSigningSession): Promise<void>;
88
- /**
89
- * Announces a new cohort to all subscribers.
90
- * @param {number} minParticipants The minimum number of participants required for the cohort.
91
- * @param {string} [network='mutinynet'] The network on which the cohort operates (default is 'signet').
92
- * @param {string} [beaconType='SMTBeacon'] The type of beacon to be used (default is 'SMTBeacon').
93
- * @returns {Promise<AggregateBeaconCohort>} The newly created cohort.
94
- */
95
- advertiseCohort(minParticipants: number, network?: string, beaconType?: string): Promise<AggregateBeaconCohort>;
96
- /**
97
- * Announces to all subscribers a cohort is ready for signing.
98
- * @param {string} cohortId The minimum number of participants required for the cohort.
99
- * @returns {Promise<AggregateBeaconCohort>} The newly created cohort.
100
- */
101
- announceCohortReady(cohortId: string): Promise<AggregateBeaconCohort>;
102
- /**
103
- * Starts a signing session for a given cohort.
104
- * @param {string} cohortId The ID of the cohort for which to start a signing session.
105
- * @returns {Promise<BeaconCohortSigningSession>} The started signing session.
106
- * @throws {BeaconCoordinatorError} If the cohort with the given ID is not found.
107
- */
108
- startSigningSession(cohortId: string): Promise<BeaconCohortSigningSession>;
109
- /**
110
- * Static initialization method for the BeaconCoordinator.
111
- * @param {Service} service The communication service configuration.
112
- * @returns {BeaconCoordinator} Initialized BeaconCoordinator instance.
113
- */
114
- static initialize(service: Service): BeaconCoordinator;
115
- }
116
- //# sourceMappingURL=coordinator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/coordinator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAsB1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACxG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGrE;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAA;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAA;AACD;;;;GAIG;AACH,qBAAa,iBAAiB;;IAC5B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,QAAQ,EAAE,oBAAoB,CAAC;IAE/B;;;OAGG;IACH,OAAO,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAM;IAE3C;;;OAGG;IACH,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAa;IAE3E;;;;;;;OAOG;gBACS,MAAM,EAAE;QAClB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAA;QAC/C,QAAQ,CAAC,EAAE,oBAAoB,CAAC;QAChC,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IAOD;;;OAGG;IACH,KAAK,IAAI,IAAI;IAgKb;;;;OAIG;YACW,mBAAmB;IAWjC;;;;OAIG;IACG,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D;;;;OAIG;IACG,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB7E;;;;;;OAMG;IACG,eAAe,CACnB,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,MAAoB,EAC7B,UAAU,GAAE,MAAoB,GAC/B,OAAO,CAAC,qBAAqB,CAAC;IAkBjC;;;;OAIG;IACG,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA0B3E;;;;;OAKG;IACG,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAsBhF;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB;CAUvD"}