@did-btcr2/method 0.17.2 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +30124 -19552
- package/dist/browser.mjs +30123 -19551
- 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 +4 -3
- 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
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RawSchnorrKeyPair } from '@did-btcr2/keypair';
|
|
2
|
+
import { AggregateBeaconCohort } from './cohort/index.js';
|
|
3
|
+
import { CommunicationService, Service, ServiceAdapterIdentity } from './communication/service.js';
|
|
4
|
+
import { BeaconCohortSigningSession } from './session/index.js';
|
|
5
|
+
type BeaconCoordinatorParams = {
|
|
6
|
+
protocol?: CommunicationService;
|
|
7
|
+
did: string;
|
|
8
|
+
keys: ServiceAdapterIdentity<RawSchnorrKeyPair>;
|
|
9
|
+
name?: string;
|
|
10
|
+
};
|
|
3
11
|
/**
|
|
4
12
|
* The BeaconCoordinator class is responsible for managing the coordination of beacon aggregation.
|
|
5
13
|
* @class BeaconCoordinator
|
|
@@ -17,48 +25,59 @@ export declare class BeaconCoordinator {
|
|
|
17
25
|
*/
|
|
18
26
|
did: string;
|
|
19
27
|
/**
|
|
20
|
-
* The protocol
|
|
21
|
-
* @type {
|
|
28
|
+
* The communication protocol used by the BeaconCoordinator.
|
|
29
|
+
* @type {CommunicationService}
|
|
22
30
|
*/
|
|
23
|
-
protocol:
|
|
31
|
+
protocol: CommunicationService;
|
|
24
32
|
/**
|
|
25
|
-
* List of subscribers
|
|
33
|
+
* List of subscribers engaged in a Musig2 Cohort signing session with the BeaconCoordinator.
|
|
26
34
|
* @type {Array<string>}
|
|
27
35
|
*/
|
|
28
|
-
cohorts: Array<
|
|
36
|
+
cohorts: Array<AggregateBeaconCohort>;
|
|
29
37
|
/**
|
|
30
|
-
*
|
|
31
|
-
* @type {
|
|
38
|
+
* Active signing sessions for the BeaconCoordinator.
|
|
39
|
+
* @type {Record<string, BeaconCohortSigningSession>}
|
|
32
40
|
*/
|
|
33
|
-
|
|
41
|
+
activeSigningSessions: Map<string, BeaconCohortSigningSession>;
|
|
34
42
|
/**
|
|
35
43
|
* Constructs a new BeaconCoordinator instance.
|
|
36
|
-
* @param {
|
|
37
|
-
* @param {
|
|
44
|
+
* @param {BeaconCoordinatorParams} params The parameters for the coordinator.
|
|
45
|
+
* @param {CommunicationService} params.protocol The protocol service used for communication.
|
|
46
|
+
* @param {string} [params.name] Optional name for the coordinator. If not provided, a default name will be generated.
|
|
47
|
+
* @param {string} [params.did] Optional DID to use for the coordinator. If not provided, a new DID will be generated.
|
|
48
|
+
* @param {ServiceAdapterIdentity<RawKeyPair>} params.keys The keys used for cryptographic operations.
|
|
38
49
|
*/
|
|
39
|
-
constructor(
|
|
50
|
+
constructor(params: BeaconCoordinatorParams);
|
|
40
51
|
/**
|
|
41
|
-
*
|
|
52
|
+
* Setup and start the BeaconCoordinator communication protocol.
|
|
42
53
|
* @returns {void}
|
|
43
54
|
*/
|
|
44
|
-
|
|
55
|
+
start(): void;
|
|
45
56
|
/**
|
|
46
|
-
*
|
|
47
|
-
* @param {
|
|
57
|
+
* Handles opt-in requests from participants to join a cohort.
|
|
58
|
+
* @param {OptInMessage} message The message containing the opt-in request.
|
|
59
|
+
* @returns {Promise<void>}
|
|
48
60
|
*/
|
|
49
|
-
|
|
61
|
+
private _handleOptIn;
|
|
50
62
|
/**
|
|
51
|
-
* Handles
|
|
52
|
-
* @
|
|
63
|
+
* Handles request signature messages from participants.
|
|
64
|
+
* @private
|
|
65
|
+
* @param {CohortRequestSignatureMessage} message The message containing the request signature.
|
|
53
66
|
* @returns {Promise<void>}
|
|
54
67
|
*/
|
|
55
|
-
private
|
|
68
|
+
private _handleRequestSignature;
|
|
56
69
|
/**
|
|
57
|
-
* Handles
|
|
58
|
-
* @param {
|
|
70
|
+
* Handles nonce contribution messages from participants.
|
|
71
|
+
* @param {CohortNonceContributionMessage} message The message containing the nonce contribution.
|
|
59
72
|
* @returns {Promise<void>}
|
|
60
73
|
*/
|
|
61
|
-
private
|
|
74
|
+
private _handleNonceContribution;
|
|
75
|
+
/**
|
|
76
|
+
* Handles signature authorization messages from participants.
|
|
77
|
+
* @param {Maybe<CohortSignatureAuthorizationMessage>} message The message containing the signature authorization request.
|
|
78
|
+
* @returns {Promise<void>}
|
|
79
|
+
*/
|
|
80
|
+
private _handleSignatureAuthorization;
|
|
62
81
|
/**
|
|
63
82
|
* Starts the key generation process for a cohort once it has enough participants.
|
|
64
83
|
* @param {Musig2Cohort} cohort The cohort for which to start key generation.
|
|
@@ -67,8 +86,42 @@ export declare class BeaconCoordinator {
|
|
|
67
86
|
private _startKeyGeneration;
|
|
68
87
|
/**
|
|
69
88
|
* Accepts a subscription request from a participant.
|
|
70
|
-
* @param {string}
|
|
89
|
+
* @param {string} participant The DID of the participant requesting the subscription.
|
|
71
90
|
* @returns {Promise<void>}
|
|
72
91
|
*/
|
|
73
|
-
acceptSubscription(
|
|
92
|
+
acceptSubscription(participant: string): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Sends the aggregated nonce to all participants in the session.
|
|
95
|
+
* @param {BeaconCohortSigningSession} session The session containing the aggregated nonce.
|
|
96
|
+
* @returns {Promise<void>}
|
|
97
|
+
*/
|
|
98
|
+
sendAggregatedNonce(session: BeaconCohortSigningSession): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Announces a new cohort to all subscribers.
|
|
101
|
+
* @param {number} minParticipants The minimum number of participants required for the cohort.
|
|
102
|
+
* @param {string} [network='mutinynet'] The network on which the cohort operates (default is 'signet').
|
|
103
|
+
* @param {string} [beaconType='SMTAggregateBeacon'] The type of beacon to be used (default is 'SMTAggregateBeacon').
|
|
104
|
+
* @returns {Promise<AggregateBeaconCohort>} The newly created cohort.
|
|
105
|
+
*/
|
|
106
|
+
advertiseCohort(minParticipants: number, network?: string, beaconType?: string): Promise<AggregateBeaconCohort>;
|
|
107
|
+
/**
|
|
108
|
+
* Announces to all subscribers a cohort is ready for signing.
|
|
109
|
+
* @param {string} cohortId The minimum number of participants required for the cohort.
|
|
110
|
+
* @returns {Promise<AggregateBeaconCohort>} The newly created cohort.
|
|
111
|
+
*/
|
|
112
|
+
announceCohortReady(cohortId: string): Promise<AggregateBeaconCohort>;
|
|
113
|
+
/**
|
|
114
|
+
* Starts a signing session for a given cohort.
|
|
115
|
+
* @param {string} cohortId The ID of the cohort for which to start a signing session.
|
|
116
|
+
* @returns {Promise<BeaconCohortSigningSession>} The started signing session.
|
|
117
|
+
* @throws {BeaconCoordinatorError} If the cohort with the given ID is not found.
|
|
118
|
+
*/
|
|
119
|
+
startSigningSession(cohortId: string): Promise<BeaconCohortSigningSession>;
|
|
120
|
+
/**
|
|
121
|
+
* Static initialization method for the BeaconCoordinator.
|
|
122
|
+
* @param {Service} service The communication service configuration.
|
|
123
|
+
* @returns {BeaconCoordinator} Initialized BeaconCoordinator instance.
|
|
124
|
+
*/
|
|
125
|
+
static initialize(service: Service): BeaconCoordinator;
|
|
74
126
|
}
|
|
127
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/coordinator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/coordinator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAkB1D,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,KAAK,uBAAuB,GAAG;IAC7B,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;AAEH,qBAAa,iBAAiB;IAC5B;;;OAGG;IACI,IAAI,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACI,GAAG,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACI,QAAQ,EAAE,oBAAoB,CAAC;IAEtC;;;OAGG;IACI,OAAO,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAM;IAElD;;;OAGG;IACI,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAa;IAElF;;;;;;;OAOG;gBACS,MAAM,EAAE,uBAAuB;IAO3C;;;OAGG;IACI,KAAK,IAAI,IAAI;IASpB;;;;OAIG;YACW,YAAY;IAqB1B;;;;;OAKG;YACW,uBAAuB;IAgBrC;;;;OAIG;YACW,wBAAwB;IA2CtC;;;;OAIG;YACW,6BAA6B;IAkD3C;;;;OAIG;YACW,mBAAmB;IAWjC;;;;OAIG;IACU,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUnE;;;;OAIG;IACU,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBpF;;;;;;OAMG;IACU,eAAe,CAC1B,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,MAAoB,EAC7B,UAAU,GAAE,MAA6B,GACxC,OAAO,CAAC,qBAAqB,CAAC;IAkBjC;;;;OAIG;IACU,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA0BlF;;;;;OAKG;IACU,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAsBvF;;;;OAIG;WACW,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB;CAU9D"}
|
|
@@ -1 +1,191 @@
|
|
|
1
|
+
import { KeyBytes, Maybe } from '@did-btcr2/common';
|
|
2
|
+
import { HDKey } from '@scure/bip32';
|
|
3
|
+
import { AggregateBeaconCohort } from './cohort/index.js';
|
|
4
|
+
import { CohortAdvertMessage } from './cohort/messages/keygen/cohort-advert.js';
|
|
5
|
+
import { CohortReadyMessage } from './cohort/messages/keygen/cohort-ready.js';
|
|
6
|
+
import { CohortAggregatedNonceMessage } from './cohort/messages/sign/aggregated-nonce.js';
|
|
7
|
+
import { CohortAuthorizationRequestMessage } from './cohort/messages/sign/authorization-request.js';
|
|
8
|
+
import { CommunicationService } from './communication/service.js';
|
|
9
|
+
import { BeaconCohortSigningSession } from './session/index.js';
|
|
10
|
+
type Seed = KeyBytes;
|
|
11
|
+
type Mnemonic = string;
|
|
12
|
+
type SessionId = string;
|
|
13
|
+
type ActiveSigningSessions = Map<SessionId, BeaconCohortSigningSession>;
|
|
14
|
+
type CohortId = string;
|
|
15
|
+
type KeyIndex = number;
|
|
16
|
+
type CohortKeyState = Map<CohortId, KeyIndex>;
|
|
17
|
+
type BeaconParticipantParams = {
|
|
18
|
+
ent: Seed | Mnemonic;
|
|
19
|
+
protocol?: CommunicationService;
|
|
20
|
+
did: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Represents a participant in the did:btc1 Beacon Aggregation protocol.
|
|
25
|
+
* @class BeaconParticipant
|
|
26
|
+
* @type {BeaconParticipant}
|
|
27
|
+
*/
|
|
28
|
+
export declare class BeaconParticipant {
|
|
29
|
+
/**
|
|
30
|
+
* The name of the BeaconParticipant service.
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
name: string;
|
|
34
|
+
/**
|
|
35
|
+
* The DID of the BeaconParticipant.
|
|
36
|
+
* @type {Array<string>}
|
|
37
|
+
*/
|
|
38
|
+
did: string;
|
|
39
|
+
/**
|
|
40
|
+
* The communication protocol used by the BeaconParticipant.
|
|
41
|
+
* @type {CommunicationService}
|
|
42
|
+
*/
|
|
43
|
+
protocol: CommunicationService;
|
|
44
|
+
/**
|
|
45
|
+
* The HD key used by the BeaconParticipant.
|
|
46
|
+
* @type {HDKey}
|
|
47
|
+
*/
|
|
48
|
+
hdKey: HDKey;
|
|
49
|
+
/**
|
|
50
|
+
* The current index for the beacon key.
|
|
51
|
+
* @type {number}
|
|
52
|
+
*/
|
|
53
|
+
beaconKeyIndex: number;
|
|
54
|
+
/**
|
|
55
|
+
* The coordinator DIDs that the participant is subscribed to.
|
|
56
|
+
* @type {Array<string>}
|
|
57
|
+
*/
|
|
58
|
+
coordinatorDids: Array<string>;
|
|
59
|
+
/**
|
|
60
|
+
* The cohorts that the participant is part of.
|
|
61
|
+
* @type {Array<AggregateBeaconCohort>}
|
|
62
|
+
*/
|
|
63
|
+
cohorts: Array<AggregateBeaconCohort>;
|
|
64
|
+
/**
|
|
65
|
+
* A mapping of Cohort IDs to HDKey indexes (CohortId => KeyIndex).
|
|
66
|
+
* @type {CohortKeyState}
|
|
67
|
+
*/
|
|
68
|
+
cohortKeyState: CohortKeyState;
|
|
69
|
+
/**
|
|
70
|
+
* A mapping of active Session IDs to their sessions (sessionId => BeaconCohortSigningSession).
|
|
71
|
+
* @type {ActiveSigningSessions}
|
|
72
|
+
*/
|
|
73
|
+
activeSigningSessions: ActiveSigningSessions;
|
|
74
|
+
/**
|
|
75
|
+
* Creates an instance of BeaconParticipant.
|
|
76
|
+
* @param {BeaconParticipantParams} params The parameters for the participant.
|
|
77
|
+
* @param {Seed | Mnemonic} params.ent The seed or mnemonic to derive the HD key.
|
|
78
|
+
* @param {CommunicationService} params.protocol The communication protocol to use.
|
|
79
|
+
* @param {string} params.did The DID of the participant.
|
|
80
|
+
* @param {string} [params.name] Optional name for the participant. If not provided, a random name will be generated.
|
|
81
|
+
*/
|
|
82
|
+
constructor({ ent, protocol, did, name }: BeaconParticipantParams);
|
|
83
|
+
/**
|
|
84
|
+
* Setup and start the BeaconParticipant communication protocol..
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
start(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Retrieves the HD key for a specific cohort based on its ID.
|
|
90
|
+
* @param {string} cohortId The ID of the cohort for which to retrieve the key.
|
|
91
|
+
* @returns {HDKey} The HD key for the cohort, or throws an error if not found.
|
|
92
|
+
* @throws {BeaconParticipantError} If the cohort key state is not found for the given cohort ID.
|
|
93
|
+
*/
|
|
94
|
+
getCohortKey(cohortId: string): HDKey;
|
|
95
|
+
/**
|
|
96
|
+
* Sets the state of the cohort key for a given cohort ID and key index.
|
|
97
|
+
* @param {string} cohortId The ID of the cohort for which to set the key state.
|
|
98
|
+
* @returns {void}
|
|
99
|
+
*/
|
|
100
|
+
setCohortKey(cohortId: string): void;
|
|
101
|
+
/**
|
|
102
|
+
* Finalizes the placeholder "__UNSET__" key and assigns it to the provided cohortId.
|
|
103
|
+
* If no "__UNSET__" entry exists, throws an error.
|
|
104
|
+
* If cohortId already exists, logs a warning and does nothing.
|
|
105
|
+
* @param {string} cohortId The ID of the cohort to finalize the unset key for.
|
|
106
|
+
* @throws {BeaconParticipantError} If no "__UNSET__" cohort key state is found.
|
|
107
|
+
* @returns {void}
|
|
108
|
+
*/
|
|
109
|
+
finalizeUnsetCohortKey(cohortId: string): void;
|
|
110
|
+
/**
|
|
111
|
+
* Handle subscription acceptance from a coordinator.
|
|
112
|
+
* @param {CohortOptInAcceptMessage} message The message containing the subscription acceptance.
|
|
113
|
+
* @returns {Promise<void>}
|
|
114
|
+
*/
|
|
115
|
+
private _handleSubscribeAccept;
|
|
116
|
+
/**
|
|
117
|
+
* Handles a cohort advertisement message.
|
|
118
|
+
* @param {Maybe<BeaconCohortAdvertMessage>} message The cohort advertisement message.
|
|
119
|
+
* @returns {Promise<void>}
|
|
120
|
+
*/
|
|
121
|
+
_handleCohortAdvert(message: Maybe<CohortAdvertMessage>): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Handles a cohort set message.
|
|
124
|
+
* @param {Maybe<CohortReadyMessage>} message The cohort set message.
|
|
125
|
+
* @returns {Promise<void>}
|
|
126
|
+
*/
|
|
127
|
+
_handleCohortReady(message: Maybe<CohortReadyMessage>): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Handles an authorization request message.
|
|
130
|
+
* @param {Maybe<CohortAuthorizationRequestMessage>} message The authorization request message.
|
|
131
|
+
* @returns {Promise<void>}
|
|
132
|
+
*/
|
|
133
|
+
_handleAuthorizationRequest(message: Maybe<CohortAuthorizationRequestMessage>): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Handles an aggregated nonce message.
|
|
136
|
+
* @param {Maybe<CohortAggregatedNonceMessage>} message The aggregated nonce message.
|
|
137
|
+
* @returns {Promise<void>}
|
|
138
|
+
*/
|
|
139
|
+
_handleAggregatedNonce(message: Maybe<CohortAggregatedNonceMessage>): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Subscribes to a coordinator's messages.
|
|
142
|
+
* @param {string} coordinatorDid The DID of the coordinator to subscribe to.
|
|
143
|
+
* @returns {Promise<void>}
|
|
144
|
+
*/
|
|
145
|
+
subscribeToCoordinator(coordinatorDid: string): Promise<any>;
|
|
146
|
+
/**
|
|
147
|
+
* Joins a cohort with the given ID and coordinator DID.
|
|
148
|
+
* @param {string} cohortId The ID of the cohort to join.
|
|
149
|
+
* @param {string} coordinatorDid The DID of the cohort coordinator.
|
|
150
|
+
* @returns {Promise<void>}
|
|
151
|
+
*/
|
|
152
|
+
joinCohort(cohortId: string, coordinatorDid: string): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Requests a signature for the given cohort and data.
|
|
155
|
+
* @param {string} cohortId The ID of the cohort for which to request a signature.
|
|
156
|
+
* @param {string} data The data for which to request a signature.
|
|
157
|
+
* @returns {Promise<boolean>} Whether the signature request was successful.
|
|
158
|
+
*/
|
|
159
|
+
requestCohortSignature(cohortId: string, data: string): Promise<boolean>;
|
|
160
|
+
/**
|
|
161
|
+
* Generates a nonce contribution for the given cohort and session.
|
|
162
|
+
* @param {AggregateBeaconCohort} cohort The cohort for which to generate the nonce contribution.
|
|
163
|
+
* @param {BeaconCohortSigningSession} session The session for which to generate the nonce contribution.
|
|
164
|
+
* @returns {Promise<string[]>} An array of nonce points in hexadecimal format.
|
|
165
|
+
*/
|
|
166
|
+
generateNonceContribution(cohort: AggregateBeaconCohort, session: BeaconCohortSigningSession): Uint8Array;
|
|
167
|
+
/**
|
|
168
|
+
* Sends a nonce contribution message to the cohort coordinator.
|
|
169
|
+
* @param {AggregateBeaconCohort} cohort The cohort to which the nonce contribution is sent.
|
|
170
|
+
* @param {Uint8Array} nonceContribution The nonce contribution points in hexadecimal format.
|
|
171
|
+
* @param {BeaconCohortSigningSession} session The session associated with the nonce contribution.
|
|
172
|
+
*/
|
|
173
|
+
sendNonceContribution(cohort: AggregateBeaconCohort, nonceContribution: Uint8Array, session: BeaconCohortSigningSession): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Sends a partial signature for the given session.
|
|
176
|
+
* @param {BeaconCohortSigningSession} session The session for which the partial signature is sent.
|
|
177
|
+
* @param {Uint8Array} partialSig The partial signature to send.
|
|
178
|
+
* @returns {Promise<void>}
|
|
179
|
+
*/
|
|
180
|
+
sendPartialSignature(session: BeaconCohortSigningSession, partialSig: Uint8Array): Promise<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Initializes a new BeaconParticipant instance.
|
|
183
|
+
* @param {Seed | Mnemonic} ent The secret key used for signing.
|
|
184
|
+
* @param {CommunicationService} protocol The communication protocol used by the participant.
|
|
185
|
+
* @param {string} [name] The name of the participant.
|
|
186
|
+
* @param {string} [did] The decentralized identifier (DID) of the participant.
|
|
187
|
+
* @returns {BeaconParticipant} A new instance of BeaconParticipant.
|
|
188
|
+
*/
|
|
189
|
+
static initialize(ent: Seed | Mnemonic, protocol: CommunicationService, did: string, name?: string): BeaconParticipant;
|
|
190
|
+
}
|
|
1
191
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/participant.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/participant.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import * as musig2 from '@scure/btc-signer/musig2';
|
|
2
|
+
import { Transaction } from 'bitcoinjs-lib';
|
|
3
|
+
import { AggregateBeaconCohort } from '../cohort/index.js';
|
|
4
|
+
import { BeaconCohortAuthorizationRequestMessage } from '../cohort/messages/sign/authorization-request.js';
|
|
5
|
+
import { SIGNING_SESSION_STATUS_TYPE } from './status.js';
|
|
6
|
+
/**
|
|
7
|
+
* Convert a big-endian byte array into a bigint.
|
|
8
|
+
* @param bytes - The input Uint8Array representing a big-endian integer.
|
|
9
|
+
* @returns The integer value as a bigint.
|
|
10
|
+
*/
|
|
11
|
+
export declare function bigEndianToInt(bytes: Uint8Array): bigint;
|
|
12
|
+
/**
|
|
13
|
+
* Convert a bigint to a big-endian Uint8Array of specified length.
|
|
14
|
+
* @param xInit - The bigint to convert.
|
|
15
|
+
* @param length - The desired length of the output array in bytes.
|
|
16
|
+
* @returns A Uint8Array representing the bigint in big-endian form.
|
|
17
|
+
*/
|
|
18
|
+
export declare function intToBigEndian(xInit: bigint, length: number): Uint8Array;
|
|
19
|
+
type PublicKeyHex = string;
|
|
20
|
+
type Nonce = Uint8Array;
|
|
21
|
+
type NonceContributions = Map<PublicKeyHex, Nonce>;
|
|
22
|
+
type PartialSignatures = Map<string, Uint8Array>;
|
|
23
|
+
type ProcessedRequests = Record<string, string>;
|
|
24
|
+
export interface SigningSession {
|
|
25
|
+
id?: string;
|
|
26
|
+
cohort: AggregateBeaconCohort;
|
|
27
|
+
pendingTx: Transaction;
|
|
28
|
+
nonceContributions?: NonceContributions;
|
|
29
|
+
aggregatedNonce?: Uint8Array;
|
|
30
|
+
partialSignatures?: PartialSignatures;
|
|
31
|
+
signature?: Uint8Array;
|
|
32
|
+
status?: SIGNING_SESSION_STATUS_TYPE;
|
|
33
|
+
processedRequests?: ProcessedRequests;
|
|
34
|
+
nonceSecrets?: bigint;
|
|
35
|
+
}
|
|
36
|
+
export declare class BeaconCohortSigningSession implements SigningSession {
|
|
37
|
+
/**
|
|
38
|
+
* Unique identifier for the signing session.
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/**
|
|
43
|
+
* DID of the coordinator.
|
|
44
|
+
* @type {AggregateBeaconCohort}
|
|
45
|
+
*/
|
|
46
|
+
cohort: AggregateBeaconCohort;
|
|
47
|
+
/**
|
|
48
|
+
* Pending transaction to be signed.
|
|
49
|
+
* @type {Transaction}
|
|
50
|
+
*/
|
|
51
|
+
pendingTx: Transaction;
|
|
52
|
+
/**
|
|
53
|
+
* Map of nonce contributions from participants.
|
|
54
|
+
* @type {Map<PublicKeyHex, Nonce>}
|
|
55
|
+
*/
|
|
56
|
+
nonceContributions: Map<PublicKeyHex, Nonce>;
|
|
57
|
+
/**
|
|
58
|
+
* Aggregated nonce from all participants.
|
|
59
|
+
* @type {Uint8Array}
|
|
60
|
+
*/
|
|
61
|
+
aggregatedNonce?: Uint8Array;
|
|
62
|
+
/**
|
|
63
|
+
* Map of partial signatures from participants.
|
|
64
|
+
* @type {Map<string, Uint8Array>}
|
|
65
|
+
*/
|
|
66
|
+
partialSignatures: Map<string, Uint8Array>;
|
|
67
|
+
/**
|
|
68
|
+
* Final signature for the transaction.
|
|
69
|
+
* @type {Uint8Array}
|
|
70
|
+
*/
|
|
71
|
+
signature?: Uint8Array;
|
|
72
|
+
/**
|
|
73
|
+
* Current status of the signing session.
|
|
74
|
+
* @type {SIGNING_SESSION_STATUS_TYPE}
|
|
75
|
+
*/
|
|
76
|
+
status: SIGNING_SESSION_STATUS_TYPE;
|
|
77
|
+
/**
|
|
78
|
+
* Map of processed requests from participants.
|
|
79
|
+
* @type {Record<string, string>}
|
|
80
|
+
*/
|
|
81
|
+
processedRequests: Record<string, string>;
|
|
82
|
+
/**
|
|
83
|
+
* Secrets for nonces contributed by participants.
|
|
84
|
+
* @type {Array<bigint>}
|
|
85
|
+
*/
|
|
86
|
+
nonceSecrets?: bigint;
|
|
87
|
+
/**
|
|
88
|
+
* Musig2 session for signing operations.
|
|
89
|
+
* @type {musig2.Session}
|
|
90
|
+
*/
|
|
91
|
+
musig2Session?: musig2.Session;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a new instance of BeaconCohortSigningSession.
|
|
94
|
+
* @param {SigningSession} params Parameters to initialize the signing session.
|
|
95
|
+
* @param {Transaction} params.pendingTx The pending transaction to be signed.
|
|
96
|
+
* @param {string} [params.id] Optional unique identifier for the signing session. If not provided, a new UUID will be generated.
|
|
97
|
+
* @param {AggregateBeaconCohort} [params.cohort] The cohort associated with the signing session.
|
|
98
|
+
* @param {Record<string, string>} [params.processedRequests] Map of processed requests from participants.
|
|
99
|
+
* @param {SIGNING_SESSION_STATUS_TYPE} [params.status] The current status of the signing session. Defaults to AWAITING_NONCE_CONTRIBUTIONS.
|
|
100
|
+
*/
|
|
101
|
+
constructor({ id, cohort, pendingTx, processedRequests, status }: SigningSession);
|
|
102
|
+
/**
|
|
103
|
+
* Gets the authorization request message for a participant.
|
|
104
|
+
* @param {string} to The public key of the participant to whom the request is sent.
|
|
105
|
+
* @param {string} from The public key of the participant sending the request.
|
|
106
|
+
* @returns {AuthorizationRequest} The authorization request message.
|
|
107
|
+
*/
|
|
108
|
+
getAuthorizationRequest(to: string, from: string): BeaconCohortAuthorizationRequestMessage;
|
|
109
|
+
/**
|
|
110
|
+
* Adds a nonce contribution from a participant to the session.
|
|
111
|
+
* @param {string} from The public key of the participant contributing the nonce.
|
|
112
|
+
* @param {Array<string>} nonceContribution The nonce contribution from the participant.
|
|
113
|
+
* @throws {Error} If the session is not awaiting nonce contributions or if the contribution is invalid.
|
|
114
|
+
*/
|
|
115
|
+
addNonceContribution(from: string, nonceContribution: Uint8Array): void;
|
|
116
|
+
/**
|
|
117
|
+
* Generates the aggregated nonce from all nonce contributions for the session.
|
|
118
|
+
* @returns {Uint8Array} The aggregated nonce.
|
|
119
|
+
* @throws {AggregateBeaconError} If not all nonce contributions have been received.
|
|
120
|
+
*/
|
|
121
|
+
generateAggregatedNonce(): Uint8Array;
|
|
122
|
+
/**
|
|
123
|
+
* Adds a partial signature from a participant to the session.
|
|
124
|
+
* @param {string} from The public key of the participant contributing the partial signature.
|
|
125
|
+
* @param {Uint8Array} partialSignature The partial signature from the participant.
|
|
126
|
+
*/
|
|
127
|
+
addPartialSignature(from: string, partialSignature: Uint8Array): void;
|
|
128
|
+
/**
|
|
129
|
+
* Generates the final signature from all partial signatures.
|
|
130
|
+
* @returns {Uint8Array} The final aggregated signature.
|
|
131
|
+
*/
|
|
132
|
+
generateFinalSignature(): Promise<Uint8Array>;
|
|
133
|
+
/**
|
|
134
|
+
* Generates a partial signature for the session using the participant's secret key.
|
|
135
|
+
* @param {Uint8Array} participantSk The secret key of the participant.
|
|
136
|
+
* @returns {Uint8Array} The partial signature generated by the participant.
|
|
137
|
+
*/
|
|
138
|
+
generatePartialSignature(participantSk: Uint8Array): Uint8Array;
|
|
139
|
+
/**
|
|
140
|
+
* Converts the signing session instance to a JSON object representation.
|
|
141
|
+
* @returns {BeaconCohortSigningSession} The JSON object representation of the signing session.
|
|
142
|
+
*/
|
|
143
|
+
json(): BeaconCohortSigningSession;
|
|
144
|
+
/**
|
|
145
|
+
* Checks if the signing session is a completed state.
|
|
146
|
+
* @returns {boolean} True if the session is complete, false otherwise.
|
|
147
|
+
*/
|
|
148
|
+
isComplete(): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Checks if the signing session is in a failed state.
|
|
151
|
+
* @returns {boolean} True if the session has failed, false otherwise.
|
|
152
|
+
*/
|
|
153
|
+
isFailed(): boolean;
|
|
154
|
+
}
|
|
155
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/session/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type SIGNING_SESSION_STATUS_TYPE = 'AWAITING_NONCE_CONTRIBUTIONS' | 'NONCE_CONTRIBUTION_SENT' | 'NONCE_CONTRIBUTIONS_RECEIVED' | 'AWAITING_PARTIAL_SIGNATURES' | 'PARTIAL_SIGNATURES_RECEIVED' | 'SIGNATURE_COMPLETE' | 'FAILED';
|
|
2
|
+
export declare enum SIGNING_SESSION_STATUS {
|
|
3
|
+
AWAITING_NONCE_CONTRIBUTIONS = "AWAITING_NONCE_CONTRIBUTIONS",
|
|
4
|
+
NONCE_CONTRIBUTION_SENT = "NONCE_CONTRIBUTION_SENT",
|
|
5
|
+
NONCE_CONTRIBUTIONS_RECEIVED = "NONCE_CONTRIBUTIONS_RECEIVED",
|
|
6
|
+
AWAITING_PARTIAL_SIGNATURES = "AWAITING_PARTIAL_SIGNATURES",
|
|
7
|
+
PARTIAL_SIGNATURES_RECEIVED = "PARTIAL_SIGNATURES_RECEIVED",
|
|
8
|
+
SIGNATURE_COMPLETE = "SIGNATURE_COMPLETE",
|
|
9
|
+
FAILED = "FAILED"
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../../src/core/beacon/aggregation/session/status.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GACjC,8BAA8B,GAC9B,yBAAyB,GACzB,8BAA8B,GAC9B,6BAA6B,GAC7B,6BAA6B,GAC7B,oBAAoB,GACpB,QAAQ,CAAA;AAEd,oBAAY,sBAAsB;IAC9B,4BAA4B,iCAAiC;IAC7D,uBAAuB,4BAA4B;IACnD,4BAA4B,iCAAiC;IAC7D,2BAA2B,gCAAgC;IAC3D,2BAA2B,gCAAgC;IAC3D,kBAAkB,uBAAuB;IACzC,MAAM,WAAW;CACpB"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { RawTransactionV2 } from '@did-btcr2/bitcoin';
|
|
1
2
|
import { DidUpdateInvocation, DidUpdatePayload } from '@did-btcr2/common';
|
|
2
3
|
import { DidServiceEndpoint } from '@web5/dids';
|
|
3
|
-
import { Beacon } from '../../interfaces/beacon.js';
|
|
4
|
-
import {
|
|
5
|
-
import { RawTransactionV2 } from '@did-btcr2/bitcoin';
|
|
6
|
-
import { BeaconSidecarData, CIDAggregateSidecar, SignalsMetadata } from '../../types/crud.js';
|
|
4
|
+
import { Beacon, BeaconService, BeaconSignal } from '../../interfaces/beacon.js';
|
|
5
|
+
import { BeaconSidecarData, CIDAggregateSidecar, SignalsMetadata } from '../../utils/types.js';
|
|
7
6
|
/**
|
|
8
7
|
* Implements {@link https://dcdpr.github.io/did-btcr2/#cidaggregate-beacon | 5.2 CIDAggregate Beacon}.
|
|
9
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cid-aggregate.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/cid-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cid-aggregate.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/cid-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE/F;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,kBAAmB,SAAQ,MAAM;IAC5C;;;;OAIG;gBACS,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,mBAAmB,CAAC;IAGpF,IAAI,OAAO,IAAI,aAAa,CAM3B;IAGD;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,GAAG,kBAAkB;IAKnG;;;;;OAKG;IACH,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY;IAKtD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,aAAa,CAAC,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAInH;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CA8B9E"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MethodError } from '@did-btcr2/common';
|
|
2
|
+
export declare class BeaconError extends MethodError {
|
|
3
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
4
|
+
}
|
|
5
|
+
export declare class BeaconCoordinatorError extends MethodError {
|
|
6
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
7
|
+
}
|
|
8
|
+
export declare class BeaconParticipantError extends MethodError {
|
|
9
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
10
|
+
}
|
|
11
|
+
export declare class SingletonBeaconError extends MethodError {
|
|
12
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
13
|
+
}
|
|
14
|
+
export declare class AggregateBeaconError extends MethodError {
|
|
15
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
16
|
+
}
|
|
17
|
+
export declare class CIDAggregateBeaconError extends MethodError {
|
|
18
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
19
|
+
}
|
|
20
|
+
export declare class SMTAggregateBeaconError extends MethodError {
|
|
21
|
+
constructor(message: string, type?: string, data?: Record<string, any>);
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,qBAAa,WAAY,SAAQ,WAAW;gBAC9B,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAsB,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGtF;AAED,qBAAa,sBAAuB,SAAQ,WAAW;gBACzC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAiC,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGjG;AAED,qBAAa,sBAAuB,SAAQ,WAAW;gBACzC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAiC,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGjG;AAGD,qBAAa,oBAAqB,SAAQ,WAAW;gBACvC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAA+B,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAG/F;AAED,qBAAa,oBAAqB,SAAQ,WAAW;gBACvC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAA+B,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAG/F;AAED,qBAAa,uBAAwB,SAAQ,WAAW;gBAC1C,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkC,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGlG;AAED,qBAAa,uBAAwB,SAAQ,WAAW;gBAC1C,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkC,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGlG"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Beacon } from '../../interfaces/beacon.js';
|
|
2
|
-
import {
|
|
3
|
-
import { SidecarData } from '../../types/crud.js';
|
|
1
|
+
import { Beacon, BeaconService } from '../../interfaces/beacon.js';
|
|
2
|
+
import { SidecarData } from '../../utils/types.js';
|
|
4
3
|
/**
|
|
5
4
|
* Beacon Factory pattern to create Beacon instances.
|
|
6
5
|
* @class BeaconFactory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAuB,WAAW,EAAuB,MAAM,sBAAsB,CAAC;AAK7F;;;;GAIG;AACH,qBAAa,aAAa;IACxB;;;;;OAKG;IACH,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM;CAexE"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { RawTransactionRest, RawTransactionV2 } from '@did-btcr2/bitcoin';
|
|
2
2
|
import { DidUpdatePayload } from '@did-btcr2/common';
|
|
3
|
-
import { Beacon } from '../../interfaces/beacon.js';
|
|
4
|
-
import {
|
|
5
|
-
import { BeaconSidecarData, SignalsMetadata, SingletonSidecar } from '../../types/crud.js';
|
|
3
|
+
import { Beacon, BeaconService, BeaconSignal } from '../../interfaces/beacon.js';
|
|
4
|
+
import { BeaconSidecarData, SignalsMetadata, SingletonSidecar } from '../../utils/types.js';
|
|
6
5
|
/**
|
|
7
6
|
* Implements {@link https://dcdpr.github.io/did-btcr2/#singleton-beacon | 5.1 Singleton Beacon}.
|
|
8
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,kBAAkB,EAAE,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAC9H,OAAO,EAAE,gBAAgB,EAAqE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,kBAAkB,EAAE,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAC9H,OAAO,EAAE,gBAAgB,EAAqE,MAAM,mBAAmB,CAAC;AAKxH,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAY,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAMtG;;;;;;;;;;;;GAYG;AACH,qBAAa,eAAgB,SAAQ,MAAM;IAEzC;;;;OAIG;gBACS,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;IAIjF;;;;OAIG;IACH,IAAI,OAAO,IAAI,aAAa,CAM3B;IAED;;;;;;;;;;;;;;;OAeG;WACW,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,eAAe;IAI9G;;;;;OAKG;IACI,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY;IAI7D;;;;;;;;;;;;;;;OAeG;IACU,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAiElJ;;;;;;;;;;;;;;;;;OAiBG;IACU,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;CAyE3F"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { RawTransactionV2 } from '@did-btcr2/bitcoin';
|
|
1
2
|
import { DidUpdatePayload } from '@did-btcr2/common';
|
|
2
3
|
import { DidServiceEndpoint } from '@web5/dids';
|
|
3
|
-
import { Beacon } from '../../interfaces/beacon.js';
|
|
4
|
-
import {
|
|
5
|
-
import { RawTransactionV2 } from '@did-btcr2/bitcoin';
|
|
6
|
-
import { BeaconSidecarData, SignalsMetadata, SMTAggregateSidecar } from '../../types/crud.js';
|
|
4
|
+
import { Beacon, BeaconService, BeaconSignal } from '../../interfaces/beacon.js';
|
|
5
|
+
import { BeaconSidecarData, SignalsMetadata, SMTAggregateSidecar } from '../../utils/types.js';
|
|
7
6
|
/**
|
|
8
7
|
* TODO: Finish implementation
|
|
9
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smt-aggregate.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/smt-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"smt-aggregate.d.ts","sourceRoot":"","sources":["../../../../src/core/beacon/smt-aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE/F;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,kBAAmB,SAAQ,MAAM;IAC5C;;;;OAIG;gBACS,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB,CAAC,mBAAmB,CAAC;IAIpF;;;;OAIG;IACH,IAAI,OAAO,IAAI,aAAa,CAO3B;IAED;;;;;OAKG;IACI,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY;IAI7D;;;;;;;;;;;;;;;;;;;OAmBG;WACW,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,kBAAkB,GAAG,kBAAkB;IAI1G;;;;;;;;;;;;;;;;;;OAkBG;IACI,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAKpF;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,aAAa,CAAC,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;CAGxH"}
|