@did-btcr2/method 0.17.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +30124 -19542
- package/dist/browser.mjs +30123 -19541
- package/dist/cjs/core/beacon/aggregation/cohort/index.js +225 -0
- package/dist/cjs/core/beacon/aggregation/cohort/index.js.map +1 -0
- package/dist/{esm/core/beacon/aggregation → cjs/core/beacon/aggregation/cohort}/messages/base.js +3 -11
- package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js +11 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/constants.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js +98 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/index.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +30 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +28 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +26 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +22 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +27 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +28 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +29 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +29 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js +29 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +30 -0
- package/dist/cjs/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/cohort/status.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js +126 -0
- package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js +230 -0
- package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/communication/error.js +12 -0
- package/dist/cjs/core/beacon/aggregation/communication/error.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/communication/factory.js +21 -0
- package/dist/cjs/core/beacon/aggregation/communication/factory.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/communication/service.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/coordinator.js +282 -56
- package/dist/cjs/core/beacon/aggregation/coordinator.js.map +1 -1
- package/dist/cjs/core/beacon/aggregation/participant.js +435 -1
- package/dist/cjs/core/beacon/aggregation/participant.js.map +1 -1
- package/dist/cjs/core/beacon/aggregation/session/index.js +233 -0
- package/dist/cjs/core/beacon/aggregation/session/index.js.map +1 -0
- package/dist/cjs/core/beacon/aggregation/session/status.js +11 -0
- package/dist/cjs/core/beacon/aggregation/session/status.js.map +1 -0
- package/dist/cjs/core/beacon/cid-aggregate.js.map +1 -1
- package/dist/cjs/core/beacon/error.js +37 -0
- package/dist/cjs/core/beacon/error.js.map +1 -0
- package/dist/cjs/core/beacon/factory.js.map +1 -1
- package/dist/cjs/core/beacon/singleton.js +8 -5
- package/dist/cjs/core/beacon/singleton.js.map +1 -1
- package/dist/cjs/core/beacon/smt-aggregate.js.map +1 -1
- package/dist/cjs/{utils/beacons.js → core/beacon/utils.js} +4 -4
- package/dist/cjs/core/beacon/utils.js.map +1 -0
- package/dist/cjs/core/crud/read.js +2 -9
- package/dist/cjs/core/crud/read.js.map +1 -1
- package/dist/cjs/core/crud/update.js +18 -19
- package/dist/cjs/core/crud/update.js.map +1 -1
- package/dist/{esm/utils → cjs/core}/identifier.js +18 -3
- package/dist/cjs/core/identifier.js.map +1 -0
- package/dist/cjs/did-btcr2.js +2 -2
- package/dist/cjs/did-btcr2.js.map +1 -1
- package/dist/cjs/index.js +28 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/beacon.js.map +1 -1
- package/dist/cjs/utils/appendix.js +2 -3
- package/dist/cjs/utils/appendix.js.map +1 -1
- package/dist/cjs/utils/did-document.js +4 -6
- package/dist/cjs/utils/did-document.js.map +1 -1
- package/dist/cjs/utils/types.js +2 -0
- package/dist/cjs/utils/types.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/index.js +225 -0
- package/dist/esm/core/beacon/aggregation/cohort/index.js.map +1 -0
- package/dist/{cjs/core/beacon/aggregation → esm/core/beacon/aggregation/cohort}/messages/base.js +3 -11
- package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js +11 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/index.js +98 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/index.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +30 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +28 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +26 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +22 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +27 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +28 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +29 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +29 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +29 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +30 -0
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/cohort/status.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +126 -0
- package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +230 -0
- package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/communication/error.js +12 -0
- package/dist/esm/core/beacon/aggregation/communication/error.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/communication/factory.js +21 -0
- package/dist/esm/core/beacon/aggregation/communication/factory.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/communication/service.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/coordinator.js +282 -56
- package/dist/esm/core/beacon/aggregation/coordinator.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/participant.js +435 -1
- package/dist/esm/core/beacon/aggregation/participant.js.map +1 -1
- package/dist/esm/core/beacon/aggregation/session/index.js +233 -0
- package/dist/esm/core/beacon/aggregation/session/index.js.map +1 -0
- package/dist/esm/core/beacon/aggregation/session/status.js +11 -0
- package/dist/esm/core/beacon/aggregation/session/status.js.map +1 -0
- package/dist/esm/core/beacon/cid-aggregate.js.map +1 -1
- package/dist/esm/core/beacon/error.js +37 -0
- package/dist/esm/core/beacon/error.js.map +1 -0
- package/dist/esm/core/beacon/factory.js.map +1 -1
- package/dist/esm/core/beacon/singleton.js +8 -5
- package/dist/esm/core/beacon/singleton.js.map +1 -1
- package/dist/esm/core/beacon/smt-aggregate.js.map +1 -1
- package/dist/esm/{utils/beacons.js → core/beacon/utils.js} +4 -4
- package/dist/esm/core/beacon/utils.js.map +1 -0
- package/dist/esm/core/crud/read.js +2 -9
- package/dist/esm/core/crud/read.js.map +1 -1
- package/dist/esm/core/crud/update.js +18 -19
- package/dist/esm/core/crud/update.js.map +1 -1
- package/dist/{cjs/utils → esm/core}/identifier.js +18 -3
- package/dist/esm/core/identifier.js.map +1 -0
- package/dist/esm/did-btcr2.js +2 -2
- package/dist/esm/did-btcr2.js.map +1 -1
- package/dist/esm/index.js +28 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/beacon.js.map +1 -1
- package/dist/esm/utils/appendix.js +2 -3
- package/dist/esm/utils/appendix.js.map +1 -1
- package/dist/esm/utils/did-document.js +4 -6
- package/dist/esm/utils/did-document.js.map +1 -1
- package/dist/esm/utils/types.js +2 -0
- package/dist/esm/utils/types.js.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/index.d.ts +135 -0
- package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/{messages → cohort/messages}/base.d.ts +13 -8
- package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +10 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +64 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +28 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +26 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +23 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +19 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +24 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +24 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +25 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +25 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +25 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +26 -0
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/cohort/status.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +88 -0
- package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +93 -0
- package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/communication/error.d.ts +7 -0
- package/dist/types/core/beacon/aggregation/communication/error.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/communication/factory.d.ts +9 -0
- package/dist/types/core/beacon/aggregation/communication/factory.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/communication/service.d.ts +35 -0
- package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/coordinator.d.ts +79 -26
- package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/participant.d.ts +190 -0
- package/dist/types/core/beacon/aggregation/participant.d.ts.map +1 -1
- package/dist/types/core/beacon/aggregation/session/index.d.ts +155 -0
- package/dist/types/core/beacon/aggregation/session/index.d.ts.map +1 -0
- package/dist/types/core/beacon/aggregation/session/status.d.ts +10 -0
- package/dist/types/core/beacon/aggregation/session/status.d.ts.map +1 -0
- package/dist/types/core/beacon/cid-aggregate.d.ts +3 -4
- package/dist/types/core/beacon/cid-aggregate.d.ts.map +1 -1
- package/dist/types/core/beacon/error.d.ts +22 -0
- package/dist/types/core/beacon/error.d.ts.map +1 -0
- package/dist/types/core/beacon/factory.d.ts +2 -3
- package/dist/types/core/beacon/factory.d.ts.map +1 -1
- package/dist/types/core/beacon/singleton.d.ts +2 -3
- package/dist/types/core/beacon/singleton.d.ts.map +1 -1
- package/dist/types/core/beacon/smt-aggregate.d.ts +3 -4
- package/dist/types/core/beacon/smt-aggregate.d.ts.map +1 -1
- package/dist/types/{utils/beacons.d.ts → core/beacon/utils.d.ts} +3 -3
- package/dist/types/core/beacon/utils.d.ts.map +1 -0
- package/dist/types/core/crud/read.d.ts +3 -3
- package/dist/types/core/crud/read.d.ts.map +1 -1
- package/dist/types/core/crud/update.d.ts +1 -1
- package/dist/types/core/crud/update.d.ts.map +1 -1
- package/dist/types/{utils → core}/identifier.d.ts +24 -3
- package/dist/types/core/identifier.d.ts.map +1 -0
- package/dist/types/did-btcr2.d.ts +1 -1
- package/dist/types/did-btcr2.d.ts.map +1 -1
- package/dist/types/index.d.ts +28 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/interfaces/beacon.d.ts +65 -5
- package/dist/types/interfaces/beacon.d.ts.map +1 -1
- package/dist/types/interfaces/crud.d.ts +1 -1
- package/dist/types/interfaces/crud.d.ts.map +1 -1
- package/dist/types/utils/appendix.d.ts +2 -10
- package/dist/types/utils/appendix.d.ts.map +1 -1
- package/dist/types/utils/did-document-builder.d.ts +1 -1
- package/dist/types/utils/did-document-builder.d.ts.map +1 -1
- package/dist/types/utils/did-document.d.ts +1 -1
- package/dist/types/utils/did-document.d.ts.map +1 -1
- package/dist/types/{types/crud.d.ts → utils/types.d.ts} +2 -2
- package/dist/types/utils/types.d.ts.map +1 -0
- package/package.json +5 -6
- package/src/core/beacon/aggregation/cohort/index.ts +292 -0
- package/src/core/beacon/aggregation/{messages → cohort/messages}/base.ts +14 -16
- package/src/core/beacon/aggregation/cohort/messages/constants.ts +12 -0
- package/src/core/beacon/aggregation/cohort/messages/index.ts +143 -0
- package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +43 -0
- package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +39 -0
- package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +34 -0
- package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +33 -0
- package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +35 -0
- package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +38 -0
- package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +39 -0
- package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +39 -0
- package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +39 -0
- package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +40 -0
- package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +153 -0
- package/src/core/beacon/aggregation/communication/adapter/nostr.ts +300 -0
- package/src/core/beacon/aggregation/communication/error.ts +13 -0
- package/src/core/beacon/aggregation/communication/factory.ts +25 -0
- package/src/core/beacon/aggregation/communication/service.ts +42 -0
- package/src/core/beacon/aggregation/coordinator.ts +338 -67
- package/src/core/beacon/aggregation/participant.ts +512 -0
- package/src/core/beacon/aggregation/session/index.ts +289 -0
- package/src/core/beacon/aggregation/session/status.ts +18 -0
- package/src/core/beacon/cid-aggregate.ts +4 -5
- package/src/core/beacon/error.ts +44 -0
- package/src/core/beacon/factory.ts +2 -3
- package/src/core/beacon/singleton.ts +10 -8
- package/src/core/beacon/smt-aggregate.ts +4 -5
- package/src/{utils/beacons.ts → core/beacon/utils.ts} +5 -5
- package/src/core/crud/read.ts +7 -16
- package/src/core/crud/update.ts +25 -22
- package/src/{utils → core}/identifier.ts +35 -5
- package/src/did-btcr2.ts +4 -4
- package/src/index.ts +36 -8
- package/src/interfaces/beacon.ts +75 -5
- package/src/interfaces/crud.ts +1 -1
- package/src/utils/appendix.ts +3 -11
- package/src/utils/did-document-builder.ts +1 -1
- package/src/utils/did-document.ts +4 -7
- package/src/{types/crud.ts → utils/types.ts} +2 -2
- package/dist/cjs/core/beacon/aggregation/messages/advert.js +0 -24
- package/dist/cjs/core/beacon/aggregation/messages/advert.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/messages/base.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/messages/cohort-set.js +0 -25
- package/dist/cjs/core/beacon/aggregation/messages/cohort-set.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/messages/keygen.js +0 -8
- package/dist/cjs/core/beacon/aggregation/messages/keygen.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/messages/opt-in.js +0 -23
- package/dist/cjs/core/beacon/aggregation/messages/opt-in.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/messages/sign.js +0 -7
- package/dist/cjs/core/beacon/aggregation/messages/sign.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/models/cohort/index.js +0 -92
- package/dist/cjs/core/beacon/aggregation/models/cohort/index.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/models/cohort/status.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/protocol/nostr.js +0 -57
- package/dist/cjs/core/beacon/aggregation/protocol/nostr.js.map +0 -1
- package/dist/cjs/core/beacon/aggregation/protocol/service.js.map +0 -1
- package/dist/cjs/core/key-manager/index.js +0 -290
- package/dist/cjs/core/key-manager/index.js.map +0 -1
- package/dist/cjs/core/key-manager/interface.js +0 -2
- package/dist/cjs/core/key-manager/interface.js.map +0 -1
- package/dist/cjs/interfaces/ibeacon.js +0 -2
- package/dist/cjs/interfaces/ibeacon.js.map +0 -1
- package/dist/cjs/types/crud.js +0 -2
- package/dist/cjs/types/crud.js.map +0 -1
- package/dist/cjs/utils/beacons.js.map +0 -1
- package/dist/cjs/utils/identifier.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/messages/advert.js +0 -24
- package/dist/esm/core/beacon/aggregation/messages/advert.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/messages/base.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/messages/cohort-set.js +0 -25
- package/dist/esm/core/beacon/aggregation/messages/cohort-set.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/messages/keygen.js +0 -8
- package/dist/esm/core/beacon/aggregation/messages/keygen.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/messages/opt-in.js +0 -23
- package/dist/esm/core/beacon/aggregation/messages/opt-in.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/messages/sign.js +0 -7
- package/dist/esm/core/beacon/aggregation/messages/sign.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/models/cohort/index.js +0 -92
- package/dist/esm/core/beacon/aggregation/models/cohort/index.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/models/cohort/status.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/protocol/nostr.js +0 -57
- package/dist/esm/core/beacon/aggregation/protocol/nostr.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/protocol/service.js.map +0 -1
- package/dist/esm/core/key-manager/index.js +0 -290
- package/dist/esm/core/key-manager/index.js.map +0 -1
- package/dist/esm/core/key-manager/interface.js +0 -2
- package/dist/esm/core/key-manager/interface.js.map +0 -1
- package/dist/esm/interfaces/ibeacon.js +0 -2
- package/dist/esm/interfaces/ibeacon.js.map +0 -1
- package/dist/esm/types/crud.js +0 -2
- package/dist/esm/types/crud.js.map +0 -1
- package/dist/esm/utils/beacons.js.map +0 -1
- package/dist/esm/utils/identifier.js.map +0 -1
- package/dist/types/core/beacon/aggregation/messages/advert.d.ts +0 -22
- package/dist/types/core/beacon/aggregation/messages/advert.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/messages/base.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/messages/cohort-set.d.ts +0 -23
- package/dist/types/core/beacon/aggregation/messages/cohort-set.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/messages/keygen.d.ts +0 -6
- package/dist/types/core/beacon/aggregation/messages/keygen.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/messages/opt-in.d.ts +0 -22
- package/dist/types/core/beacon/aggregation/messages/opt-in.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/messages/sign.d.ts +0 -5
- package/dist/types/core/beacon/aggregation/messages/sign.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/models/cohort/index.d.ts +0 -77
- package/dist/types/core/beacon/aggregation/models/cohort/index.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/models/cohort/status.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/protocol/nostr.d.ts +0 -36
- package/dist/types/core/beacon/aggregation/protocol/nostr.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/protocol/service.d.ts +0 -6
- package/dist/types/core/beacon/aggregation/protocol/service.d.ts.map +0 -1
- package/dist/types/core/key-manager/index.d.ts +0 -145
- package/dist/types/core/key-manager/index.d.ts.map +0 -1
- package/dist/types/core/key-manager/interface.d.ts +0 -113
- package/dist/types/core/key-manager/interface.d.ts.map +0 -1
- package/dist/types/interfaces/ibeacon.d.ts +0 -65
- package/dist/types/interfaces/ibeacon.d.ts.map +0 -1
- package/dist/types/types/crud.d.ts.map +0 -1
- package/dist/types/utils/beacons.d.ts.map +0 -1
- package/dist/types/utils/identifier.d.ts.map +0 -1
- package/src/core/beacon/aggregation/messages/advert.ts +0 -36
- package/src/core/beacon/aggregation/messages/cohort-set.ts +0 -37
- package/src/core/beacon/aggregation/messages/keygen.ts +0 -8
- package/src/core/beacon/aggregation/messages/opt-in.ts +0 -35
- package/src/core/beacon/aggregation/messages/sign.ts +0 -7
- package/src/core/beacon/aggregation/models/cohort/index.ts +0 -112
- package/src/core/beacon/aggregation/protocol/nostr.ts +0 -81
- package/src/core/beacon/aggregation/protocol/service.ts +0 -6
- package/src/core/key-manager/index.ts +0 -364
- package/src/core/key-manager/interface.ts +0 -129
- package/src/interfaces/ibeacon.ts +0 -75
- /package/dist/cjs/core/beacon/aggregation/{models/cohort → cohort}/status.js +0 -0
- /package/dist/cjs/core/beacon/aggregation/{protocol → communication}/service.js +0 -0
- /package/dist/esm/core/beacon/aggregation/{models/cohort → cohort}/status.js +0 -0
- /package/dist/esm/core/beacon/aggregation/{protocol → communication}/service.js +0 -0
- /package/dist/types/core/beacon/aggregation/{models/cohort → cohort}/status.d.ts +0 -0
- /package/src/core/beacon/aggregation/{models/cohort → cohort}/status.ts +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { BaseMessage } from '../base.js';
|
|
3
|
+
import { BEACON_COHORT_ADVERT } from '../constants.js';
|
|
4
|
+
export interface CohortAdvertMessage {
|
|
5
|
+
type?: typeof BEACON_COHORT_ADVERT;
|
|
6
|
+
id?: string;
|
|
7
|
+
from: string;
|
|
8
|
+
cohortId: string;
|
|
9
|
+
cohortSize: number;
|
|
10
|
+
beaconType: string;
|
|
11
|
+
network: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents a message advertising a cohort to potential participants.
|
|
15
|
+
* @class BeaconCohortAdvertMessage
|
|
16
|
+
* @extends BaseMessage
|
|
17
|
+
* @type {BeaconCohortAdvertMessage}
|
|
18
|
+
*/
|
|
19
|
+
export declare class BeaconCohortAdvertMessage extends BaseMessage {
|
|
20
|
+
id: string;
|
|
21
|
+
constructor({ from, id, cohortId, cohortSize, beaconType, network }: CohortAdvertMessage);
|
|
22
|
+
/**
|
|
23
|
+
* Initializes a BeaconCohortAdvertMessage from a possible CohortAdvertMessage object.
|
|
24
|
+
* @param {CohortAdvertMessage} data The CohortAdvertMessage object to initialize the BeaconCohortAdvertMessage.
|
|
25
|
+
* @returns {BeaconCohortAdvertMessage} The new BeaconCohortAdvertMessage.
|
|
26
|
+
*/
|
|
27
|
+
static fromJSON(data: Maybe<CohortAdvertMessage>): BeaconCohortAdvertMessage;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohort-advert.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,qBAAa,yBAA0B,SAAQ,WAAW;IACjD,EAAE,EAAE,MAAM,CAAC;gBAEN,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,mBAAmB;IAOxF;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,mBAAmB,CAAC,GAAG,yBAAyB;CAOpF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { BaseMessage } from '../base.js';
|
|
3
|
+
import { BEACON_COHORT_READY } from '../constants.js';
|
|
4
|
+
export interface CohortReadyMessage {
|
|
5
|
+
type?: typeof BEACON_COHORT_READY;
|
|
6
|
+
to: string;
|
|
7
|
+
from: string;
|
|
8
|
+
cohortId: string;
|
|
9
|
+
beaconAddress: string;
|
|
10
|
+
cohortKeys: Array<Uint8Array>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents a message indicating that a cohort has met the required conditions.
|
|
14
|
+
* @class BeaconCohortReadyMessage
|
|
15
|
+
* @extends BaseMessage
|
|
16
|
+
* @type {BeaconCohortReadyMessage}
|
|
17
|
+
*/
|
|
18
|
+
export declare class BeaconCohortReadyMessage extends BaseMessage {
|
|
19
|
+
constructor({ from, to, cohortId, beaconAddress, cohortKeys }: CohortReadyMessage);
|
|
20
|
+
/**
|
|
21
|
+
* Initializes an BeaconCohortReadyMessage from a given OptIn object.
|
|
22
|
+
* @param {CohortReadyMessage} data The CohortReadyMessage object to initialize the BeaconCohortReadyMessage.
|
|
23
|
+
* @returns {BeaconCohortReadyMessage} The new BeaconCohortReadyMessage.
|
|
24
|
+
*/
|
|
25
|
+
static fromJSON(data: Maybe<CohortReadyMessage>): BeaconCohortReadyMessage;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohort-ready.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,mBAAmB,CAAC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC/B;AAED;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,WAAW;gBAC3C,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE,kBAAkB;IAMjF;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,wBAAwB;CAOlF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { BaseMessage } from '../base.js';
|
|
3
|
+
import { BEACON_COHORT_OPT_IN_ACCEPT } from '../constants.js';
|
|
4
|
+
export interface CohortOptInAcceptMessage {
|
|
5
|
+
type?: typeof BEACON_COHORT_OPT_IN_ACCEPT;
|
|
6
|
+
to: string;
|
|
7
|
+
from: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Represents a message for a coordinator accepting a participant subscribe to a cohort.
|
|
11
|
+
* @class BeaconCohortOptInAcceptMessage
|
|
12
|
+
* @extends BaseMessage
|
|
13
|
+
* @type {BeaconCohortOptInAcceptMessage}
|
|
14
|
+
*/
|
|
15
|
+
export declare class BeaconCohortOptInAcceptMessage extends BaseMessage {
|
|
16
|
+
constructor({ to, from }: CohortOptInAcceptMessage);
|
|
17
|
+
/**
|
|
18
|
+
* Initializes a BeaconCohortOptInAcceptMessage from a possible CohortOptInAcceptMessage object.
|
|
19
|
+
* @param {CohortOptInAcceptMessage} data The CohortOptInAcceptMessage object to initialize the BeaconCohortOptInAcceptMessage.
|
|
20
|
+
* @returns {BeaconCohortOptInAcceptMessage} The new BeaconCohortOptInAcceptMessage.
|
|
21
|
+
*/
|
|
22
|
+
static fromJSON(data: Maybe<CohortOptInAcceptMessage>): BeaconCohortOptInAcceptMessage;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opt-in-accept.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,OAAO,2BAA2B,CAAC;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,qBAAa,8BAA+B,SAAQ,WAAW;gBACjD,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,wBAAwB;IAIlD;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,8BAA8B;CAO9F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { BaseMessage } from '../base.js';
|
|
3
|
+
import { BEACON_COHORT_OPT_IN } from '../constants.js';
|
|
4
|
+
export interface CohortOptInMessage {
|
|
5
|
+
type?: typeof BEACON_COHORT_OPT_IN;
|
|
6
|
+
to: string;
|
|
7
|
+
from: string;
|
|
8
|
+
cohortId: string;
|
|
9
|
+
participantPk: Uint8Array;
|
|
10
|
+
}
|
|
11
|
+
export declare class BeaconCohortOptInMessage extends BaseMessage {
|
|
12
|
+
constructor({ from, to, cohortId, participantPk }: CohortOptInMessage);
|
|
13
|
+
/**
|
|
14
|
+
* Initializes a BeaconCohortOptInMessage from a possible CohortOptInMessage object.
|
|
15
|
+
* @param {CohortOptInMessage} data The CohortOptInMessage object to initialize the BeaconCohortOptInMessage.
|
|
16
|
+
* @returns {BeaconCohortOptInMessage} The new BeaconCohortOptInMessage.
|
|
17
|
+
*/
|
|
18
|
+
static fromJSON(data: Maybe<CohortOptInMessage>): BeaconCohortOptInMessage;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opt-in.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,oBAAoB,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,UAAU,CAAC;CAC3B;AAED,qBAAa,wBAAyB,SAAQ,WAAW;gBAE3C,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,kBAAkB;IAMrE;;;;OAIG;WACW,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,wBAAwB;CAOlF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { 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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { 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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregated-nonce.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { 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
|
+
}
|
package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization-request.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { 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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonce-contribution.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { 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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-signature.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { 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
|
+
}
|
package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-authorization.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { RawSchnorrKeyPair } from '@did-btcr2/keypair';
|
|
3
|
+
import { AggregateBeaconMessageType } from '../../cohort/messages/index.js';
|
|
4
|
+
import { 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 {Maybe<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: Maybe<AggregateBeaconMessageType>, _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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"did-comm.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/communication/adapter/did-comm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAuB,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAsC,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEnH;;;;;;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;CAenD;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,KAAK,CAAC,0BAA0B,CAAC,EAC3C,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;CA0BxE"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Did, Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { RawSchnorrKeyPair } from '@did-btcr2/keypair';
|
|
3
|
+
import { SimplePool } from 'nostr-tools/pool';
|
|
4
|
+
import { AggregateBeaconMessageType } from '../../cohort/messages/index.js';
|
|
5
|
+
import { CommunicationService, MessageHandler, ServiceAdapter, ServiceAdapterConfig, ServiceAdapterIdentity } from '../service.js';
|
|
6
|
+
/**
|
|
7
|
+
* DEFAULT_NOSTR_RELAYS provides a list of default Nostr relay URLs for communication.
|
|
8
|
+
* These relays are used to connect to the Nostr network for sending and receiving messages.
|
|
9
|
+
* @constant {Array<string>} DEFAULT_NOSTR_RELAYS
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_NOSTR_RELAYS: string[];
|
|
12
|
+
/**
|
|
13
|
+
* NostrAdapterConfig defines the configuration structure for the Nostr communication adapter.
|
|
14
|
+
* It includes relay URLs, key pairs, and components for identity generation.
|
|
15
|
+
* @interface NostrAdapterConfig
|
|
16
|
+
* @type {NostrAdapterConfig}
|
|
17
|
+
*/
|
|
18
|
+
export interface NostrAdapterConfig {
|
|
19
|
+
keys: RawSchnorrKeyPair;
|
|
20
|
+
did?: string;
|
|
21
|
+
components: {
|
|
22
|
+
idType?: string;
|
|
23
|
+
version?: number;
|
|
24
|
+
network?: string;
|
|
25
|
+
};
|
|
26
|
+
relays: string[];
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
export declare class NostrAdapter implements CommunicationService {
|
|
30
|
+
/**
|
|
31
|
+
* The name of the NostrAdapter service.
|
|
32
|
+
* @type {string}
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* The configuration for the NostrAdapter.
|
|
37
|
+
* @type {NostrAdapterConfig}
|
|
38
|
+
*/
|
|
39
|
+
config: NostrAdapterConfig;
|
|
40
|
+
/**
|
|
41
|
+
* A map of message handlers for different message types.
|
|
42
|
+
* @type {Map<string, MessageHandler>}
|
|
43
|
+
*/
|
|
44
|
+
private handlers;
|
|
45
|
+
/**
|
|
46
|
+
* The SimplePool instance for managing Nostr subscriptions.
|
|
47
|
+
* @type {SimplePool}
|
|
48
|
+
*/
|
|
49
|
+
pool?: SimplePool;
|
|
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?: NostrAdapterConfig);
|
|
57
|
+
/**
|
|
58
|
+
* Sets the keys for the NostrAdapter.
|
|
59
|
+
* @param {ServiceAdapterIdentity<RawSchnorrKeyPair>} keys - The key pair to set.
|
|
60
|
+
*/
|
|
61
|
+
setKeys(keys: ServiceAdapterIdentity<RawSchnorrKeyPair>): void;
|
|
62
|
+
/**
|
|
63
|
+
* Starts the Nostr communication service by subscribing to relays.
|
|
64
|
+
* @returns {ServiceAdapter<NostrAdapter>} Returns the NostrAdapter instance for method chaining.
|
|
65
|
+
*/
|
|
66
|
+
start(): ServiceAdapter<NostrAdapter>;
|
|
67
|
+
/**
|
|
68
|
+
* Handles incoming Nostr events and dispatches them to the appropriate message handler.
|
|
69
|
+
* @param {Event} event The Nostr event received from the relay.
|
|
70
|
+
*/
|
|
71
|
+
private onEvent;
|
|
72
|
+
/**
|
|
73
|
+
* Registers a message handler for a specific message type.
|
|
74
|
+
* @param {string} messageType The type of message to handle.
|
|
75
|
+
* @param {MessageHandler} handler The handler function that processes the message.
|
|
76
|
+
*/
|
|
77
|
+
registerMessageHandler(messageType: string, handler: MessageHandler): void;
|
|
78
|
+
/**
|
|
79
|
+
* Sends a message to a recipient using the Nostr protocol.
|
|
80
|
+
* This method is a placeholder and should be implemented with actual Nostr message sending logic.
|
|
81
|
+
* @param {Maybe<AggregateBeaconMessageType>} message The message to send, typically containing the content and metadata.
|
|
82
|
+
* @param {Did} from The identifier of the sender.
|
|
83
|
+
* @param {Did} [to] The identifier of the recipient.
|
|
84
|
+
* @returns {Promise<void>} A promise that resolves when the message is sent.
|
|
85
|
+
*/
|
|
86
|
+
sendMessage(message: Maybe<AggregateBeaconMessageType>, from: Did, to?: Did): Promise<void | Promise<string>[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Generates a Nostr identity using the Secp256k1SecretKey and Identifier classes.
|
|
89
|
+
* @param {RawSchnorrKeyPair} [keys] Optional keys to use for identity generation.
|
|
90
|
+
* @returns {ServiceAdapterConfig} The generated Nostr identity configuration.
|
|
91
|
+
*/
|
|
92
|
+
generateIdentity(keys?: RawSchnorrKeyPair): ServiceAdapterConfig;
|
|
93
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nostr.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/beacon/aggregation/communication/adapter/nostr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAgC,iBAAiB,EAAsC,MAAM,oBAAoB,CAAC;AAGzH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAa9C,OAAO,EAA0B,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAEpG,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEnI;;;;GAIG;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,qBAAa,YAAa,YAAW,oBAAoB;IACvD;;;OAGG;IACI,IAAI,EAAE,MAAM,CAAW;IAE9B;;;OAGG;IACI,MAAM,EAAE,kBAAkB,CAAC;IAElC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAA0C;IAE1D;;;OAGG;IACI,IAAI,CAAC,EAAE,UAAU,CAAC;IAEzB;;;;;OAKG;gBACS,MAAM,GAAE,kBAAoG;IAWxH;;;OAGG;IACI,OAAO,CAAC,IAAI,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAKrE;;;OAGG;IACI,KAAK,IAAI,cAAc,CAAC,YAAY,CAAC;IAkB5C;;;OAGG;YACW,OAAO;IAuCrB;;;;OAIG;IACI,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAKjF;;;;;;;OAOG;IACU,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IAmF5H;;;;OAIG;IACI,gBAAgB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,oBAAoB;CA0BxE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MethodError } from '@did-btcr2/common';
|
|
2
|
+
export declare class CommunicationServiceError extends MethodError {
|
|
3
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
4
|
+
}
|
|
5
|
+
export declare class CommunicationAdapterError extends MethodError {
|
|
6
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { 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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/communication/factory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;GAIG;AACH,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB;CAazD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { AggregateBeaconMessageType } from '../cohort/messages/index.js';
|
|
3
|
+
import { 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: Maybe<AggregateBeaconMessageType>, sender: string, recipient?: string): Promise<void | Promise<string>[]>;
|
|
34
|
+
generateIdentity(keys?: RawSchnorrKeyPair): ServiceAdapterConfigType<ServiceAdapterConfig>;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/communication/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;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,KAAK,CAAC,0BAA0B,CAAC,EAC1C,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"}
|