@did-btcr2/aggregation 0.1.0 → 0.3.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/.tsbuildinfo +1 -1
- package/dist/browser.js +18107 -18096
- package/dist/browser.mjs +18107 -18096
- package/dist/cjs/core/index.js +2423 -0
- package/dist/cjs/index.js +3513 -3521
- package/dist/cjs/participant/index.js +2425 -0
- package/dist/cjs/service/index.js +3199 -0
- package/dist/esm/{runner/aggregation-runner.js → aggregation-runner.js} +4 -4
- package/dist/esm/aggregation-runner.js.map +1 -0
- package/dist/esm/core/beacon-strategy.js.map +1 -0
- package/dist/esm/core/cohort.js.map +1 -0
- package/dist/esm/core/conditions.js.map +1 -0
- package/dist/esm/core/errors.js.map +1 -0
- package/dist/esm/core/fallback-spend.js.map +1 -0
- package/dist/esm/core/index.js +23 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/logger.js.map +1 -0
- package/dist/esm/core/messages/base.js.map +1 -0
- package/dist/esm/core/messages/bodies.js.map +1 -0
- package/dist/esm/core/messages/constants.js.map +1 -0
- package/dist/esm/core/messages/factories.js.map +1 -0
- package/dist/esm/core/messages/guards.js.map +1 -0
- package/dist/esm/core/messages/index.js.map +1 -0
- package/dist/esm/core/phases.js.map +1 -0
- package/dist/esm/core/recovery-policy.js.map +1 -0
- package/dist/esm/core/recovery-spend.js.map +1 -0
- package/dist/esm/core/signer.js.map +1 -0
- package/dist/esm/core/signing-session.js.map +1 -0
- package/dist/esm/core/transport/didcomm.js.map +1 -0
- package/dist/esm/core/transport/error.js.map +1 -0
- package/dist/esm/core/transport/http/envelope.js.map +1 -0
- package/dist/esm/core/transport/http/errors.js.map +1 -0
- package/dist/esm/core/transport/http/index.js +9 -0
- package/dist/esm/core/transport/http/index.js.map +1 -0
- package/dist/esm/core/transport/http/protocol.js.map +1 -0
- package/dist/esm/core/transport/http/request-auth.js.map +1 -0
- package/dist/esm/core/transport/in-memory.js.map +1 -0
- package/dist/esm/core/transport/index.js +12 -0
- package/dist/esm/core/transport/index.js.map +1 -0
- package/dist/esm/core/transport/nostr.js.map +1 -0
- package/dist/esm/core/transport/transport.js.map +1 -0
- package/dist/esm/core/typed-emitter.js.map +1 -0
- package/dist/esm/index.js +13 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/participant/events.js.map +1 -0
- package/dist/esm/{transport/http/client.js → participant/http-client.js} +6 -6
- package/dist/esm/participant/http-client.js.map +1 -0
- package/dist/esm/participant/index.js +13 -0
- package/dist/esm/participant/index.js.map +1 -0
- package/dist/esm/{runner → participant}/participant-runner.js +5 -5
- package/dist/esm/participant/participant-runner.js.map +1 -0
- package/dist/esm/{participant.js → participant/participant.js} +11 -11
- package/dist/esm/participant/participant.js.map +1 -0
- package/dist/esm/participant/sse-stream.js.map +1 -0
- package/dist/esm/service/events.js +2 -0
- package/dist/esm/{runner → service}/events.js.map +1 -1
- package/dist/esm/{transport/http/server.js → service/http-server.js} +6 -6
- package/dist/esm/service/http-server.js.map +1 -0
- package/dist/esm/service/inbox-buffer.js.map +1 -0
- package/dist/esm/service/index.js +16 -0
- package/dist/esm/service/index.js.map +1 -0
- package/dist/esm/service/nonce-cache.js.map +1 -0
- package/dist/esm/service/rate-limiter.js.map +1 -0
- package/dist/esm/{runner → service}/service-runner.js +5 -5
- package/dist/esm/service/service-runner.js.map +1 -0
- package/dist/esm/{service.js → service/service.js} +12 -12
- package/dist/esm/service/service.js.map +1 -0
- package/dist/esm/service/sse-writer.js.map +1 -0
- package/dist/esm/{transport/factory.js → transport-factory.js} +5 -5
- package/dist/esm/transport-factory.js.map +1 -0
- package/dist/types/{runner/aggregation-runner.d.ts → aggregation-runner.d.ts} +3 -3
- package/dist/types/aggregation-runner.d.ts.map +1 -0
- package/dist/types/{beacon-strategy.d.ts → core/beacon-strategy.d.ts} +2 -2
- package/dist/types/core/beacon-strategy.d.ts.map +1 -0
- package/dist/types/{cohort.d.ts → core/cohort.d.ts} +3 -3
- package/dist/types/core/cohort.d.ts.map +1 -0
- package/dist/types/core/conditions.d.ts.map +1 -0
- package/dist/types/core/errors.d.ts.map +1 -0
- package/dist/types/core/fallback-spend.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +15 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/logger.d.ts.map +1 -0
- package/dist/types/core/messages/base.d.ts.map +1 -0
- package/dist/types/core/messages/bodies.d.ts.map +1 -0
- package/dist/types/core/messages/constants.d.ts.map +1 -0
- package/dist/types/core/messages/factories.d.ts.map +1 -0
- package/dist/types/core/messages/guards.d.ts.map +1 -0
- package/dist/types/core/messages/index.d.ts.map +1 -0
- package/dist/types/core/phases.d.ts.map +1 -0
- package/dist/types/core/recovery-policy.d.ts.map +1 -0
- package/dist/types/core/recovery-spend.d.ts.map +1 -0
- package/dist/types/core/signer.d.ts.map +1 -0
- package/dist/types/core/signing-session.d.ts.map +1 -0
- package/dist/types/core/transport/didcomm.d.ts.map +1 -0
- package/dist/types/core/transport/error.d.ts.map +1 -0
- package/dist/types/core/transport/http/envelope.d.ts.map +1 -0
- package/dist/types/core/transport/http/errors.d.ts.map +1 -0
- package/dist/types/core/transport/http/index.d.ts +5 -0
- package/dist/types/core/transport/http/index.d.ts.map +1 -0
- package/dist/types/core/transport/http/protocol.d.ts.map +1 -0
- package/dist/types/core/transport/http/request-auth.d.ts.map +1 -0
- package/dist/types/core/transport/in-memory.d.ts.map +1 -0
- package/{src/transport/index.ts → dist/types/core/transport/index.d.ts} +1 -1
- package/dist/types/core/transport/index.d.ts.map +1 -0
- package/dist/types/core/transport/nostr.d.ts.map +1 -0
- package/dist/types/core/transport/transport.d.ts.map +1 -0
- package/dist/types/core/typed-emitter.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -16
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/{runner → participant}/events.d.ts +1 -76
- package/dist/types/participant/events.d.ts.map +1 -0
- package/dist/types/{transport/http/client.d.ts → participant/http-client.d.ts} +4 -4
- package/dist/types/participant/http-client.d.ts.map +1 -0
- package/dist/types/participant/index.d.ts +6 -0
- package/dist/types/participant/index.d.ts.map +1 -0
- package/dist/types/{runner → participant}/participant-runner.d.ts +6 -6
- package/dist/types/participant/participant-runner.d.ts.map +1 -0
- package/dist/types/{participant.d.ts → participant/participant.d.ts} +6 -6
- package/dist/types/participant/participant.d.ts.map +1 -0
- package/dist/types/participant/sse-stream.d.ts.map +1 -0
- package/dist/types/service/events.d.ts +76 -0
- package/dist/types/service/events.d.ts.map +1 -0
- package/dist/types/{transport/http/server.d.ts → service/http-server.d.ts} +4 -4
- package/dist/types/{transport/http/server.d.ts.map → service/http-server.d.ts.map} +1 -1
- package/dist/types/service/inbox-buffer.d.ts.map +1 -0
- package/dist/types/service/index.d.ts +9 -0
- package/dist/types/service/index.d.ts.map +1 -0
- package/dist/types/service/nonce-cache.d.ts.map +1 -0
- package/dist/types/service/rate-limiter.d.ts.map +1 -0
- package/dist/types/{runner → service}/service-runner.d.ts +4 -4
- package/dist/types/service/service-runner.d.ts.map +1 -0
- package/dist/types/{service.d.ts → service/service.d.ts} +6 -6
- package/dist/types/service/service.d.ts.map +1 -0
- package/dist/types/service/sse-writer.d.ts.map +1 -0
- package/dist/types/{transport/factory.d.ts → transport-factory.d.ts} +5 -5
- package/dist/types/transport-factory.d.ts.map +1 -0
- package/package.json +23 -6
- package/src/{runner/aggregation-runner.ts → aggregation-runner.ts} +7 -7
- package/src/{beacon-strategy.ts → core/beacon-strategy.ts} +2 -2
- package/src/{cohort.ts → core/cohort.ts} +3 -3
- package/src/core/index.ts +22 -0
- package/src/core/transport/http/index.ts +8 -0
- package/src/core/transport/index.ts +11 -0
- package/src/index.ts +13 -23
- package/src/{runner → participant}/events.ts +1 -59
- package/src/{transport/http/client.ts → participant/http-client.ts} +8 -8
- package/src/participant/index.ts +12 -0
- package/src/{runner → participant}/participant-runner.ts +10 -10
- package/src/{participant.ts → participant/participant.ts} +18 -18
- package/src/service/events.ts +58 -0
- package/src/{transport/http/server.ts → service/http-server.ts} +8 -8
- package/src/service/index.ts +15 -0
- package/src/{runner → service}/service-runner.ts +9 -9
- package/src/{service.ts → service/service.ts} +19 -19
- package/src/{transport/factory.ts → transport-factory.ts} +8 -8
- package/dist/esm/beacon-strategy.js.map +0 -1
- package/dist/esm/cohort.js.map +0 -1
- package/dist/esm/conditions.js.map +0 -1
- package/dist/esm/errors.js.map +0 -1
- package/dist/esm/fallback-spend.js.map +0 -1
- package/dist/esm/logger.js.map +0 -1
- package/dist/esm/messages/base.js.map +0 -1
- package/dist/esm/messages/bodies.js.map +0 -1
- package/dist/esm/messages/constants.js.map +0 -1
- package/dist/esm/messages/factories.js.map +0 -1
- package/dist/esm/messages/guards.js.map +0 -1
- package/dist/esm/messages/index.js.map +0 -1
- package/dist/esm/participant.js.map +0 -1
- package/dist/esm/phases.js.map +0 -1
- package/dist/esm/recovery-policy.js.map +0 -1
- package/dist/esm/recovery-spend.js.map +0 -1
- package/dist/esm/runner/aggregation-runner.js.map +0 -1
- package/dist/esm/runner/index.js +0 -6
- package/dist/esm/runner/index.js.map +0 -1
- package/dist/esm/runner/participant-runner.js.map +0 -1
- package/dist/esm/runner/service-runner.js.map +0 -1
- package/dist/esm/runner/typed-emitter.js.map +0 -1
- package/dist/esm/service.js.map +0 -1
- package/dist/esm/signer.js.map +0 -1
- package/dist/esm/signing-session.js.map +0 -1
- package/dist/esm/transport/didcomm.js.map +0 -1
- package/dist/esm/transport/error.js.map +0 -1
- package/dist/esm/transport/factory.js.map +0 -1
- package/dist/esm/transport/http/client.js.map +0 -1
- package/dist/esm/transport/http/envelope.js.map +0 -1
- package/dist/esm/transport/http/errors.js.map +0 -1
- package/dist/esm/transport/http/inbox-buffer.js.map +0 -1
- package/dist/esm/transport/http/index.js +0 -12
- package/dist/esm/transport/http/index.js.map +0 -1
- package/dist/esm/transport/http/nonce-cache.js.map +0 -1
- package/dist/esm/transport/http/protocol.js.map +0 -1
- package/dist/esm/transport/http/rate-limiter.js.map +0 -1
- package/dist/esm/transport/http/request-auth.js.map +0 -1
- package/dist/esm/transport/http/server.js.map +0 -1
- package/dist/esm/transport/http/sse-stream.js.map +0 -1
- package/dist/esm/transport/http/sse-writer.js.map +0 -1
- package/dist/esm/transport/in-memory.js.map +0 -1
- package/dist/esm/transport/index.js +0 -8
- package/dist/esm/transport/index.js.map +0 -1
- package/dist/esm/transport/nostr.js.map +0 -1
- package/dist/esm/transport/transport.js.map +0 -1
- package/dist/types/beacon-strategy.d.ts.map +0 -1
- package/dist/types/cohort.d.ts.map +0 -1
- package/dist/types/conditions.d.ts.map +0 -1
- package/dist/types/errors.d.ts.map +0 -1
- package/dist/types/fallback-spend.d.ts.map +0 -1
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/messages/base.d.ts.map +0 -1
- package/dist/types/messages/bodies.d.ts.map +0 -1
- package/dist/types/messages/constants.d.ts.map +0 -1
- package/dist/types/messages/factories.d.ts.map +0 -1
- package/dist/types/messages/guards.d.ts.map +0 -1
- package/dist/types/messages/index.d.ts.map +0 -1
- package/dist/types/participant.d.ts.map +0 -1
- package/dist/types/phases.d.ts.map +0 -1
- package/dist/types/recovery-policy.d.ts.map +0 -1
- package/dist/types/recovery-spend.d.ts.map +0 -1
- package/dist/types/runner/aggregation-runner.d.ts.map +0 -1
- package/dist/types/runner/events.d.ts.map +0 -1
- package/dist/types/runner/index.d.ts +0 -6
- package/dist/types/runner/index.d.ts.map +0 -1
- package/dist/types/runner/participant-runner.d.ts.map +0 -1
- package/dist/types/runner/service-runner.d.ts.map +0 -1
- package/dist/types/runner/typed-emitter.d.ts.map +0 -1
- package/dist/types/service.d.ts.map +0 -1
- package/dist/types/signer.d.ts.map +0 -1
- package/dist/types/signing-session.d.ts.map +0 -1
- package/dist/types/transport/didcomm.d.ts.map +0 -1
- package/dist/types/transport/error.d.ts.map +0 -1
- package/dist/types/transport/factory.d.ts.map +0 -1
- package/dist/types/transport/http/client.d.ts.map +0 -1
- package/dist/types/transport/http/envelope.d.ts.map +0 -1
- package/dist/types/transport/http/errors.d.ts.map +0 -1
- package/dist/types/transport/http/inbox-buffer.d.ts.map +0 -1
- package/dist/types/transport/http/index.d.ts +0 -12
- package/dist/types/transport/http/index.d.ts.map +0 -1
- package/dist/types/transport/http/nonce-cache.d.ts.map +0 -1
- package/dist/types/transport/http/protocol.d.ts.map +0 -1
- package/dist/types/transport/http/rate-limiter.d.ts.map +0 -1
- package/dist/types/transport/http/request-auth.d.ts.map +0 -1
- package/dist/types/transport/http/sse-stream.d.ts.map +0 -1
- package/dist/types/transport/http/sse-writer.d.ts.map +0 -1
- package/dist/types/transport/in-memory.d.ts.map +0 -1
- package/dist/types/transport/index.d.ts +0 -8
- package/dist/types/transport/index.d.ts.map +0 -1
- package/dist/types/transport/nostr.d.ts.map +0 -1
- package/dist/types/transport/transport.d.ts.map +0 -1
- package/src/runner/index.ts +0 -5
- package/src/transport/http/index.ts +0 -11
- /package/dist/esm/{beacon-strategy.js → core/beacon-strategy.js} +0 -0
- /package/dist/esm/{cohort.js → core/cohort.js} +0 -0
- /package/dist/esm/{conditions.js → core/conditions.js} +0 -0
- /package/dist/esm/{errors.js → core/errors.js} +0 -0
- /package/dist/esm/{fallback-spend.js → core/fallback-spend.js} +0 -0
- /package/dist/esm/{logger.js → core/logger.js} +0 -0
- /package/dist/esm/{messages → core/messages}/base.js +0 -0
- /package/dist/esm/{messages → core/messages}/bodies.js +0 -0
- /package/dist/esm/{messages → core/messages}/constants.js +0 -0
- /package/dist/esm/{messages → core/messages}/factories.js +0 -0
- /package/dist/esm/{messages → core/messages}/guards.js +0 -0
- /package/dist/esm/{messages → core/messages}/index.js +0 -0
- /package/dist/esm/{phases.js → core/phases.js} +0 -0
- /package/dist/esm/{recovery-policy.js → core/recovery-policy.js} +0 -0
- /package/dist/esm/{recovery-spend.js → core/recovery-spend.js} +0 -0
- /package/dist/esm/{signer.js → core/signer.js} +0 -0
- /package/dist/esm/{signing-session.js → core/signing-session.js} +0 -0
- /package/dist/esm/{transport → core/transport}/didcomm.js +0 -0
- /package/dist/esm/{transport → core/transport}/error.js +0 -0
- /package/dist/esm/{transport → core/transport}/http/envelope.js +0 -0
- /package/dist/esm/{transport → core/transport}/http/errors.js +0 -0
- /package/dist/esm/{transport → core/transport}/http/protocol.js +0 -0
- /package/dist/esm/{transport → core/transport}/http/request-auth.js +0 -0
- /package/dist/esm/{transport → core/transport}/in-memory.js +0 -0
- /package/dist/esm/{transport → core/transport}/nostr.js +0 -0
- /package/dist/esm/{transport → core/transport}/transport.js +0 -0
- /package/dist/esm/{runner → core}/typed-emitter.js +0 -0
- /package/dist/esm/{runner → participant}/events.js +0 -0
- /package/dist/esm/{transport/http → participant}/sse-stream.js +0 -0
- /package/dist/esm/{transport/http → service}/inbox-buffer.js +0 -0
- /package/dist/esm/{transport/http → service}/nonce-cache.js +0 -0
- /package/dist/esm/{transport/http → service}/rate-limiter.js +0 -0
- /package/dist/esm/{transport/http → service}/sse-writer.js +0 -0
- /package/dist/types/{conditions.d.ts → core/conditions.d.ts} +0 -0
- /package/dist/types/{errors.d.ts → core/errors.d.ts} +0 -0
- /package/dist/types/{fallback-spend.d.ts → core/fallback-spend.d.ts} +0 -0
- /package/dist/types/{logger.d.ts → core/logger.d.ts} +0 -0
- /package/dist/types/{messages → core/messages}/base.d.ts +0 -0
- /package/dist/types/{messages → core/messages}/bodies.d.ts +0 -0
- /package/dist/types/{messages → core/messages}/constants.d.ts +0 -0
- /package/dist/types/{messages → core/messages}/factories.d.ts +0 -0
- /package/dist/types/{messages → core/messages}/guards.d.ts +0 -0
- /package/dist/types/{messages → core/messages}/index.d.ts +0 -0
- /package/dist/types/{phases.d.ts → core/phases.d.ts} +0 -0
- /package/dist/types/{recovery-policy.d.ts → core/recovery-policy.d.ts} +0 -0
- /package/dist/types/{recovery-spend.d.ts → core/recovery-spend.d.ts} +0 -0
- /package/dist/types/{signer.d.ts → core/signer.d.ts} +0 -0
- /package/dist/types/{signing-session.d.ts → core/signing-session.d.ts} +0 -0
- /package/dist/types/{transport → core/transport}/didcomm.d.ts +0 -0
- /package/dist/types/{transport → core/transport}/error.d.ts +0 -0
- /package/dist/types/{transport → core/transport}/http/envelope.d.ts +0 -0
- /package/dist/types/{transport → core/transport}/http/errors.d.ts +0 -0
- /package/dist/types/{transport → core/transport}/http/protocol.d.ts +0 -0
- /package/dist/types/{transport → core/transport}/http/request-auth.d.ts +0 -0
- /package/dist/types/{transport → core/transport}/in-memory.d.ts +0 -0
- /package/dist/types/{transport → core/transport}/nostr.d.ts +0 -0
- /package/dist/types/{transport → core/transport}/transport.d.ts +0 -0
- /package/dist/types/{runner → core}/typed-emitter.d.ts +0 -0
- /package/dist/types/{transport/http → participant}/sse-stream.d.ts +0 -0
- /package/dist/types/{transport/http → service}/inbox-buffer.d.ts +0 -0
- /package/dist/types/{transport/http → service}/nonce-cache.d.ts +0 -0
- /package/dist/types/{transport/http → service}/rate-limiter.d.ts +0 -0
- /package/dist/types/{transport/http → service}/sse-writer.d.ts +0 -0
- /package/src/{conditions.ts → core/conditions.ts} +0 -0
- /package/src/{errors.ts → core/errors.ts} +0 -0
- /package/src/{fallback-spend.ts → core/fallback-spend.ts} +0 -0
- /package/src/{logger.ts → core/logger.ts} +0 -0
- /package/src/{messages → core/messages}/base.ts +0 -0
- /package/src/{messages → core/messages}/bodies.ts +0 -0
- /package/src/{messages → core/messages}/constants.ts +0 -0
- /package/src/{messages → core/messages}/factories.ts +0 -0
- /package/src/{messages → core/messages}/guards.ts +0 -0
- /package/src/{messages → core/messages}/index.ts +0 -0
- /package/src/{phases.ts → core/phases.ts} +0 -0
- /package/src/{recovery-policy.ts → core/recovery-policy.ts} +0 -0
- /package/src/{recovery-spend.ts → core/recovery-spend.ts} +0 -0
- /package/src/{signer.ts → core/signer.ts} +0 -0
- /package/src/{signing-session.ts → core/signing-session.ts} +0 -0
- /package/src/{transport → core/transport}/didcomm.ts +0 -0
- /package/src/{transport → core/transport}/error.ts +0 -0
- /package/src/{transport → core/transport}/http/envelope.ts +0 -0
- /package/src/{transport → core/transport}/http/errors.ts +0 -0
- /package/src/{transport → core/transport}/http/protocol.ts +0 -0
- /package/src/{transport → core/transport}/http/request-auth.ts +0 -0
- /package/src/{transport → core/transport}/in-memory.ts +0 -0
- /package/src/{transport → core/transport}/nostr.ts +0 -0
- /package/src/{transport → core/transport}/transport.ts +0 -0
- /package/src/{runner → core}/typed-emitter.ts +0 -0
- /package/src/{transport/http → participant}/sse-stream.ts +0 -0
- /package/src/{transport/http → service}/inbox-buffer.ts +0 -0
- /package/src/{transport/http → service}/nonce-cache.ts +0 -0
- /package/src/{transport/http → service}/rate-limiter.ts +0 -0
- /package/src/{transport/http → service}/sse-writer.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-emitter.d.ts","sourceRoot":"","sources":["../../../src/core/typed-emitter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;AAE9D,MAAM,MAAM,QAAQ,CAAC,IAAI,SAAS,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;AAEpF,qBAAa,iBAAiB,CAAC,MAAM,SAAS,QAAQ;;IAGpD,6BAA6B;IAC7B,EAAE,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAUzE,+EAA+E;IAC/E,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAQ3E,uCAAuC;IACvC,GAAG,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAK1E,iDAAiD;IACjD,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO;IAcnE,8DAA8D;IAC9D,kBAAkB,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI;IAS3D,wCAAwC;IACxC,aAAa,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM;CAGxD"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './participant.js';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './recovery-spend.js';
|
|
7
|
-
export * from './fallback-spend.js';
|
|
8
|
-
export * from './cohort.js';
|
|
9
|
-
export * from './signing-session.js';
|
|
10
|
-
export * from './phases.js';
|
|
11
|
-
export * from './errors.js';
|
|
12
|
-
export * from './beacon-strategy.js';
|
|
13
|
-
export * from './logger.js';
|
|
14
|
-
export * from './messages/index.js';
|
|
15
|
-
export * from './transport/index.js';
|
|
16
|
-
export * from './runner/index.js';
|
|
1
|
+
export * from './core/index.js';
|
|
2
|
+
export * from './participant/index.js';
|
|
3
|
+
export * from './service/index.js';
|
|
4
|
+
export * from './aggregation-runner.js';
|
|
5
|
+
export * from './transport-factory.js';
|
|
17
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { SerializedSMTProof } from '@did-btcr2/smt';
|
|
2
|
-
import type { CohortAdvert, PendingFallbackRequest, PendingSigningRequest, PendingValidation } from '
|
|
3
|
-
import type { AggregationResult, PendingOptIn, Rejection } from '../service.js';
|
|
2
|
+
import type { CohortAdvert, PendingFallbackRequest, PendingSigningRequest, PendingValidation } from './participant.js';
|
|
4
3
|
/**
|
|
5
4
|
* Sidecar data a participant keeps when a cohort completes from its
|
|
6
5
|
* perspective: the cohort's beacon coordinates plus the off-chain artifact it
|
|
@@ -19,80 +18,6 @@ export interface CohortCompleteInfo {
|
|
|
19
18
|
/** Inclusion proof (submitter) or non-inclusion proof (decliner) for this slot. Populated only for SMT beacons. */
|
|
20
19
|
smtProof?: SerializedSMTProof;
|
|
21
20
|
}
|
|
22
|
-
/**
|
|
23
|
-
* AggregationServiceRunner events are emitted by the AggregationServiceRunner to signal important
|
|
24
|
-
* milestones and actions during the aggregation process. They can be listened to by external code
|
|
25
|
-
* to react to these events, such as logging, updating a UI, or triggering additional actions.
|
|
26
|
-
*/
|
|
27
|
-
export type AggregationServiceEvents = {
|
|
28
|
-
/** A cohort has been created and the advert message broadcast. */
|
|
29
|
-
'cohort-advertised': [{
|
|
30
|
-
cohortId: string;
|
|
31
|
-
}];
|
|
32
|
-
/** A participant has opted in. Fires before the accept decision callback. */
|
|
33
|
-
'opt-in-received': [PendingOptIn];
|
|
34
|
-
/** A participant has been accepted into the cohort. */
|
|
35
|
-
'participant-accepted': [{
|
|
36
|
-
cohortId: string;
|
|
37
|
-
participantDid: string;
|
|
38
|
-
}];
|
|
39
|
-
/** Keygen has been finalized: beacon address is now available. */
|
|
40
|
-
'keygen-complete': [{
|
|
41
|
-
cohortId: string;
|
|
42
|
-
beaconAddress: string;
|
|
43
|
-
}];
|
|
44
|
-
/** A participant has submitted a signed update. */
|
|
45
|
-
'update-received': [{
|
|
46
|
-
cohortId: string;
|
|
47
|
-
participantDid: string;
|
|
48
|
-
}];
|
|
49
|
-
/**
|
|
50
|
-
* An inbound message was silently dropped by the state machine (bad proof,
|
|
51
|
-
* oversized payload, wrong wire version, etc.). Fires for *any* rejection,
|
|
52
|
-
* not just SUBMIT_UPDATE.
|
|
53
|
-
*/
|
|
54
|
-
'message-rejected': [Rejection & {
|
|
55
|
-
cohortId: string;
|
|
56
|
-
}];
|
|
57
|
-
/** Aggregated data has been distributed to all participants for validation. */
|
|
58
|
-
'data-distributed': [{
|
|
59
|
-
cohortId: string;
|
|
60
|
-
}];
|
|
61
|
-
/** A participant has acknowledged validation (approved or rejected). */
|
|
62
|
-
'validation-received': [{
|
|
63
|
-
cohortId: string;
|
|
64
|
-
participantDid: string;
|
|
65
|
-
approved: boolean;
|
|
66
|
-
}];
|
|
67
|
-
/** Signing has started: auth requests sent to participants. */
|
|
68
|
-
'signing-started': [{
|
|
69
|
-
cohortId: string;
|
|
70
|
-
sessionId: string;
|
|
71
|
-
}];
|
|
72
|
-
/**
|
|
73
|
-
* The optimistic n-of-n key path was abandoned and the k-of-n fallback
|
|
74
|
-
* (script-path) signing round started (ADR 042). After this, the cohort
|
|
75
|
-
* completes via the fallback once k members sign.
|
|
76
|
-
*/
|
|
77
|
-
'fallback-started': [{
|
|
78
|
-
cohortId: string;
|
|
79
|
-
sessionId: string;
|
|
80
|
-
}];
|
|
81
|
-
/** A participant has contributed their MuSig2 nonce. */
|
|
82
|
-
'nonce-received': [{
|
|
83
|
-
cohortId: string;
|
|
84
|
-
participantDid: string;
|
|
85
|
-
}];
|
|
86
|
-
/** Signing complete: final aggregated signature is ready to broadcast. */
|
|
87
|
-
'signing-complete': [AggregationResult];
|
|
88
|
-
/** Cohort transitioned to Failed phase (e.g. a participant rejected validation). */
|
|
89
|
-
'cohort-failed': [{
|
|
90
|
-
cohortId: string;
|
|
91
|
-
reason: string;
|
|
92
|
-
}];
|
|
93
|
-
/** A non-fatal error occurred. Fatal errors reject the run() promise. */
|
|
94
|
-
'error': [Error];
|
|
95
|
-
};
|
|
96
21
|
/**
|
|
97
22
|
* AggregationParticipantRunner events are emitted by the AggregationParticipantRunner to signal
|
|
98
23
|
* important milestones and actions during the participant's involvement in the aggregation process.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/participant/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEvH;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,QAAQ,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,mHAAmH;IACnH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,8EAA8E;IAC9E,mBAAmB,EAAE,CAAC,YAAY,CAAC,CAAC;IAEpC,4CAA4C;IAC5C,eAAe,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAExC,kEAAkE;IAClE,cAAc,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE9D,qDAAqD;IACrD,kBAAkB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE3C,uFAAuF;IACvF,iBAAiB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE1C,sFAAsF;IACtF,sBAAsB,EAAE,CAAC,iBAAiB,CAAC,CAAC;IAE5C,4EAA4E;IAC5E,mBAAmB,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAE7C;;;;OAIG;IACH,oBAAoB,EAAE,CAAC,sBAAsB,CAAC,CAAC;IAE/C;;;;;OAKG;IACH,iBAAiB,EAAE,CAAC,kBAAkB,CAAC,CAAC;IAExC,gEAAgE;IAChE,eAAe,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAExD,kCAAkC;IAClC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;CAClB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
2
2
|
import { CompressedSecp256k1PublicKey } from '@did-btcr2/keypair';
|
|
3
|
-
import type { Logger } from '
|
|
4
|
-
import type { BaseMessage } from '
|
|
5
|
-
import type { MessageHandler, Transport } from '../transport.js';
|
|
3
|
+
import type { Logger } from '../core/logger.js';
|
|
4
|
+
import type { BaseMessage } from '../core/messages/base.js';
|
|
5
|
+
import type { MessageHandler, Transport } from '../core/transport/transport.js';
|
|
6
6
|
export interface HttpClientTransportConfig {
|
|
7
7
|
/** Base URL of the aggregation service (e.g. `https://aggregator.example.com/`). */
|
|
8
8
|
baseUrl: string | URL;
|
|
@@ -53,4 +53,4 @@ export declare class HttpClientTransport implements Transport {
|
|
|
53
53
|
sendMessage(message: BaseMessage, sender: string, recipient?: string): Promise<void>;
|
|
54
54
|
publishRepeating(message: BaseMessage, sender: string, intervalMs: number, recipient?: string): () => void;
|
|
55
55
|
}
|
|
56
|
-
//# sourceMappingURL=client.d.ts.map
|
|
56
|
+
//# sourceMappingURL=http-client.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U,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI/C,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,UAAU,GAAG,IAAI;IAa5D,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI9C,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAY5F,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAI/D,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC1F,gBAAgB,CACd,OAAO,EAAI,WAAW,EACtB,MAAM,EAAK,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,IAAI;CA+Jd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/participant/index.ts"],"names":[],"mappings":"AAOA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SecuredDocument } from '@did-btcr2/cryptosuite';
|
|
2
2
|
import type { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
3
|
-
import type { CohortAdvert, PendingSigningRequest, PendingValidation } from '
|
|
4
|
-
import { AggregationParticipant } from '
|
|
5
|
-
import type { Transport } from '../transport/transport.js';
|
|
3
|
+
import type { CohortAdvert, PendingSigningRequest, PendingValidation } from './participant.js';
|
|
4
|
+
import { AggregationParticipant } from './participant.js';
|
|
5
|
+
import type { Transport } from '../core/transport/transport.js';
|
|
6
6
|
import type { AggregationParticipantEvents, CohortCompleteInfo } from './events.js';
|
|
7
|
-
import { TypedEventEmitter } from '
|
|
7
|
+
import { TypedEventEmitter } from '../core/typed-emitter.js';
|
|
8
8
|
/** Decision callback: filter discovered cohorts. Default rejects all. */
|
|
9
9
|
export type ShouldJoin = (advert: CohortAdvert) => Promise<boolean>;
|
|
10
10
|
/** Data callback: provide a signed BTCR2 update for a joined cohort. */
|
|
11
11
|
export type OnProvideUpdate = (info: {
|
|
12
12
|
cohortId: string;
|
|
13
13
|
beaconAddress: string;
|
|
14
|
-
}) => Promise<
|
|
14
|
+
}) => Promise<SecuredDocument | null>;
|
|
15
15
|
/** Decision callback: approve or reject aggregated data. */
|
|
16
16
|
export type OnValidateData = (info: PendingValidation) => Promise<{
|
|
17
17
|
approved: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"participant-runner.d.ts","sourceRoot":"","sources":["../../../src/participant/participant-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAWzD,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,KAAK,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpE,wEAAwE;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAA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,GACZ,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAiRjC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SecuredDocument } from '@did-btcr2/cryptosuite';
|
|
2
2
|
import type { SerializedSMTProof } from '@did-btcr2/smt';
|
|
3
|
-
import type { CohortConditions } from '
|
|
4
|
-
import type { BaseMessage } from '
|
|
5
|
-
import type { ParticipantCohortPhaseType } from '
|
|
6
|
-
import type { AggregationSigner } from '
|
|
3
|
+
import type { CohortConditions } from '../core/conditions.js';
|
|
4
|
+
import type { BaseMessage } from '../core/messages/base.js';
|
|
5
|
+
import type { ParticipantCohortPhaseType } from '../core/phases.js';
|
|
6
|
+
import type { AggregationSigner } from '../core/signer.js';
|
|
7
7
|
/**
|
|
8
8
|
* Cohort advert as discovered by the participant (UI: list of joinable cohorts).
|
|
9
9
|
* Carries the advertised {@link CohortConditions} (beaconType, minParticipants,
|
|
@@ -101,7 +101,7 @@ export declare class AggregationParticipant {
|
|
|
101
101
|
* User action: submit a signed BTCR2 update for inclusion in the cohort's
|
|
102
102
|
* aggregated signal.
|
|
103
103
|
*/
|
|
104
|
-
submitUpdate(cohortId: string, signedUpdate:
|
|
104
|
+
submitUpdate(cohortId: string, signedUpdate: SecuredDocument): BaseMessage[];
|
|
105
105
|
/**
|
|
106
106
|
* User action: decline to submit an update this round (cooperative
|
|
107
107
|
* non-inclusion). The member stays in the cohort and still signs; it will be
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"participant.d.ts","sourceRoot":"","sources":["../../../src/participant/participant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAMxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAI9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,C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CAAC,MAAM,EAAE,qBAAqB,CAAC,CAQ9E;IAiDD;;OAEG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IAqEpD;;;;OAIG;IACI,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IA+BhE,wFAAwF;IACxF,IAAW,uBAAuB,IAAI,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAQhF;IAqCD;;;;;;OAMG;IACI,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE;IA8ChD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,0BAA0B,GAAG,SAAS;IAI/E;;;;;OAKG;IACI,YAAY,IAAI,IAAI;CAK5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-stream.d.ts","sourceRoot":"","sources":["../../../src/participant/sse-stream.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAuB,cAAc,CACnC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAqFtC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { AggregationResult, PendingOptIn, Rejection } from './service.js';
|
|
2
|
+
/**
|
|
3
|
+
* AggregationServiceRunner events are emitted by the AggregationServiceRunner to signal important
|
|
4
|
+
* milestones and actions during the aggregation process. They can be listened to by external code
|
|
5
|
+
* to react to these events, such as logging, updating a UI, or triggering additional actions.
|
|
6
|
+
*/
|
|
7
|
+
export type AggregationServiceEvents = {
|
|
8
|
+
/** A cohort has been created and the advert message broadcast. */
|
|
9
|
+
'cohort-advertised': [{
|
|
10
|
+
cohortId: string;
|
|
11
|
+
}];
|
|
12
|
+
/** A participant has opted in. Fires before the accept decision callback. */
|
|
13
|
+
'opt-in-received': [PendingOptIn];
|
|
14
|
+
/** A participant has been accepted into the cohort. */
|
|
15
|
+
'participant-accepted': [{
|
|
16
|
+
cohortId: string;
|
|
17
|
+
participantDid: string;
|
|
18
|
+
}];
|
|
19
|
+
/** Keygen has been finalized: beacon address is now available. */
|
|
20
|
+
'keygen-complete': [{
|
|
21
|
+
cohortId: string;
|
|
22
|
+
beaconAddress: string;
|
|
23
|
+
}];
|
|
24
|
+
/** A participant has submitted a signed update. */
|
|
25
|
+
'update-received': [{
|
|
26
|
+
cohortId: string;
|
|
27
|
+
participantDid: string;
|
|
28
|
+
}];
|
|
29
|
+
/**
|
|
30
|
+
* An inbound message was silently dropped by the state machine (bad proof,
|
|
31
|
+
* oversized payload, wrong wire version, etc.). Fires for *any* rejection,
|
|
32
|
+
* not just SUBMIT_UPDATE.
|
|
33
|
+
*/
|
|
34
|
+
'message-rejected': [Rejection & {
|
|
35
|
+
cohortId: string;
|
|
36
|
+
}];
|
|
37
|
+
/** Aggregated data has been distributed to all participants for validation. */
|
|
38
|
+
'data-distributed': [{
|
|
39
|
+
cohortId: string;
|
|
40
|
+
}];
|
|
41
|
+
/** A participant has acknowledged validation (approved or rejected). */
|
|
42
|
+
'validation-received': [{
|
|
43
|
+
cohortId: string;
|
|
44
|
+
participantDid: string;
|
|
45
|
+
approved: boolean;
|
|
46
|
+
}];
|
|
47
|
+
/** Signing has started: auth requests sent to participants. */
|
|
48
|
+
'signing-started': [{
|
|
49
|
+
cohortId: string;
|
|
50
|
+
sessionId: string;
|
|
51
|
+
}];
|
|
52
|
+
/**
|
|
53
|
+
* The optimistic n-of-n key path was abandoned and the k-of-n fallback
|
|
54
|
+
* (script-path) signing round started (ADR 042). After this, the cohort
|
|
55
|
+
* completes via the fallback once k members sign.
|
|
56
|
+
*/
|
|
57
|
+
'fallback-started': [{
|
|
58
|
+
cohortId: string;
|
|
59
|
+
sessionId: string;
|
|
60
|
+
}];
|
|
61
|
+
/** A participant has contributed their MuSig2 nonce. */
|
|
62
|
+
'nonce-received': [{
|
|
63
|
+
cohortId: string;
|
|
64
|
+
participantDid: string;
|
|
65
|
+
}];
|
|
66
|
+
/** Signing complete: final aggregated signature is ready to broadcast. */
|
|
67
|
+
'signing-complete': [AggregationResult];
|
|
68
|
+
/** Cohort transitioned to Failed phase (e.g. a participant rejected validation). */
|
|
69
|
+
'cohort-failed': [{
|
|
70
|
+
cohortId: string;
|
|
71
|
+
reason: string;
|
|
72
|
+
}];
|
|
73
|
+
/** A non-fatal error occurred. Fatal errors reject the run() promise. */
|
|
74
|
+
'error': [Error];
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/service/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/E;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,kEAAkE;IAClE,mBAAmB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE5C,6EAA6E;IAC7E,iBAAiB,EAAE,CAAC,YAAY,CAAC,CAAC;IAElC,uDAAuD;IACvD,sBAAsB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEvE,kEAAkE;IAClE,iBAAiB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEjE,mDAAmD;IACnD,iBAAiB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAElE;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,SAAS,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEvD,+EAA+E;IAC/E,kBAAkB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE3C,wEAAwE;IACxE,qBAAqB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAEzF,+DAA+D;IAC/D,iBAAiB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE7D;;;;OAIG;IACH,kBAAkB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE9D,wDAAwD;IACxD,gBAAgB,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEjE,0EAA0E;IAC1E,kBAAkB,EAAE,CAAC,iBAAiB,CAAC,CAAC;IAExC,oFAAoF;IACpF,eAAe,EAAE,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAExD,yEAAyE;IACzE,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;CAClB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
2
2
|
import { CompressedSecp256k1PublicKey } from '@did-btcr2/keypair';
|
|
3
|
-
import type { Logger } from '
|
|
4
|
-
import type { BaseMessage } from '
|
|
5
|
-
import type { MessageHandler, Transport } from '../transport.js';
|
|
3
|
+
import type { Logger } from '../core/logger.js';
|
|
4
|
+
import type { BaseMessage } from '../core/messages/base.js';
|
|
5
|
+
import type { MessageHandler, Transport } from '../core/transport/transport.js';
|
|
6
6
|
import { NonceCache } from './nonce-cache.js';
|
|
7
7
|
import { RateLimiter } from './rate-limiter.js';
|
|
8
8
|
/** Framework-agnostic incoming-request shape. */
|
|
@@ -115,4 +115,4 @@ export declare class HttpServerTransport implements Transport {
|
|
|
115
115
|
*/
|
|
116
116
|
handleSse(req: HttpRequestLike, stream: SseStream): void;
|
|
117
117
|
}
|
|
118
|
-
//# sourceMappingURL=server.d.ts.map
|
|
118
|
+
//# sourceMappingURL=http-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../../../src/service/http-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAIhF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,iDAAiD;AACjD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,uDAAuD;IACvD,IA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,EAAE,SAAS,GAAG,IAAI;CAsQzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inbox-buffer.d.ts","sourceRoot":"","sources":["../../../src/service/inbox-buffer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,EAAE,EAAE,MAAM,CAAC;IACX,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,qBAAa,WAAW;;gBAKV,QAAQ,SAAM;IAK1B,8EAA8E;IAC9E,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW;IAOhD;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE;IAO1C,sCAAsC;IACtC,IAAI,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './service.js';
|
|
2
|
+
export * from './service-runner.js';
|
|
3
|
+
export * from './http-server.js';
|
|
4
|
+
export * from './inbox-buffer.js';
|
|
5
|
+
export * from './nonce-cache.js';
|
|
6
|
+
export * from './rate-limiter.js';
|
|
7
|
+
export * from './sse-writer.js';
|
|
8
|
+
export * from './events.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/service/index.ts"],"names":[],"mappings":"AAOA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonce-cache.d.ts","sourceRoot":"","sources":["../../../src/service/nonce-cache.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,qBAAa,UAAU;;gBAIT,MAAM,GAAE,gBAAqB;IAIzC;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO;IAWhE,+DAA+D;IAC/D,IAAI,IAAI,MAAM;CAGf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limiter.d.ts","sourceRoot":"","sources":["../../../src/service/rate-limiter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IAC1C,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAC5C;AAED,qBAAa,sBAAuB,YAAW,cAAc;;IAG3D,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI;CAG3C;AAED,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,qBAAa,WAAW;;gBAKV,MAAM,GAAE,iBAAsB;IAM1C,qFAAqF;IACrF,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;CAkB7C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
2
|
-
import type { AggregationResult, CohortConfig, PendingOptIn, SigningTxData } from '
|
|
3
|
-
import { AggregationService } from '
|
|
4
|
-
import type { Transport } from '../transport/transport.js';
|
|
2
|
+
import type { AggregationResult, CohortConfig, PendingOptIn, SigningTxData } from './service.js';
|
|
3
|
+
import { AggregationService } from './service.js';
|
|
4
|
+
import type { Transport } from '../core/transport/transport.js';
|
|
5
5
|
import type { FeeEstimator } from '@did-btcr2/bitcoin';
|
|
6
6
|
import type { AggregationServiceEvents } from './events.js';
|
|
7
|
-
import { TypedEventEmitter } from '
|
|
7
|
+
import { TypedEventEmitter } from '../core/typed-emitter.js';
|
|
8
8
|
/** Decision callback: accept or reject a participant's opt-in. */
|
|
9
9
|
export type OnOptInReceived = (optIn: PendingOptIn) => Promise<{
|
|
10
10
|
accepted: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-runner.d.ts","sourceRoot":"","sources":["../../../src/service/service-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAczD,OAAO,KAAK,EACV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EAAC,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAK7D,kEAAkE;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,Y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AAM,iCAAiC,QAAS,CAAC;AA6CxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB,CAAC,wBAAwB,CAAC;;IACvF,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;gBA0BzB,OAAO,EAAE,+BAA+B;IA2CpD;;;;;;;;;OASG;IACH,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAA;KAAE;IA6CnG;;;;;;OAMG;IACH,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAcjC;;;;;;;;;;OAUG;IACG,MAAM,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA+E5C;;;;;;;;;;;;;OAaG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6EtD;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IASlC;;;;OAIG;IACH,IAAI,IAAI,IAAI;CAgTb"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SecuredDocument } from '@did-btcr2/cryptosuite';
|
|
2
2
|
import type { CompressedSecp256k1PublicKey } from '@did-btcr2/keypair';
|
|
3
3
|
import type { Transaction } from '@scure/btc-signer';
|
|
4
|
-
import { AggregationCohort } from '
|
|
5
|
-
import { type CohortConditions } from '
|
|
6
|
-
import type { BaseMessage } from '
|
|
7
|
-
import type { ServiceCohortPhaseType } from '
|
|
4
|
+
import { AggregationCohort } from '../core/cohort.js';
|
|
5
|
+
import { type CohortConditions } from '../core/conditions.js';
|
|
6
|
+
import type { BaseMessage } from '../core/messages/base.js';
|
|
7
|
+
import type { ServiceCohortPhaseType } from '../core/phases.js';
|
|
8
8
|
/**
|
|
9
9
|
* Cohort configuration set by the service operator: the advertised cohort
|
|
10
10
|
* {@link CohortConditions} plus the Bitcoin network. `beaconType` and
|
|
@@ -127,7 +127,7 @@ export declare class AggregationService {
|
|
|
127
127
|
*/
|
|
128
128
|
finalizeKeygen(cohortId: string): BaseMessage[];
|
|
129
129
|
/** Updates collected so far for a cohort. */
|
|
130
|
-
collectedUpdates(cohortId: string): ReadonlyMap<string,
|
|
130
|
+
collectedUpdates(cohortId: string): ReadonlyMap<string, SecuredDocument>;
|
|
131
131
|
/**
|
|
132
132
|
* Build the aggregated data structure (CAS Announcement or SMT tree) and
|
|
133
133
|
* return distribute messages to send to all participants for validation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/service/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAA4B,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAKxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAoB5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAIhE;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,yDAAyD;AACzD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,UAAU,CAAC;IAC1B,eAAe,EAAE,UAAU,CAAC;CAC7B;AAED,oCAAoC;AACpC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,WAAW,C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AiB,GAAG,SAAS;IAI1D;;;;OAIG;IACH,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIzD,IAAI,OAAO,IAAI,aAAa,CAAC,iBAAiB,CAAC,CAE9C;IAED;;;OAGG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAGrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-writer.d.ts","sourceRoot":"","sources":["../../../src/service/sse-writer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ/E;AAED,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGxD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Logger } from '
|
|
2
|
-
import type { HttpClientTransportConfig } from './http
|
|
3
|
-
import type { HttpServerTransportConfig } from './http
|
|
4
|
-
import type { Transport } from './transport.js';
|
|
1
|
+
import type { Logger } from './core/logger.js';
|
|
2
|
+
import type { HttpClientTransportConfig } from './participant/http-client.js';
|
|
3
|
+
import type { HttpServerTransportConfig } from './service/http-server.js';
|
|
4
|
+
import type { Transport } from './core/transport/transport.js';
|
|
5
5
|
/** Discriminated-union config for {@link TransportFactory.establish}. */
|
|
6
6
|
export type TransportConfig = NostrTransportConfigOption | DidCommTransportConfigOption | HttpClientTransportConfigOption | HttpServerTransportConfigOption;
|
|
7
7
|
export interface NostrTransportConfigOption {
|
|
@@ -25,4 +25,4 @@ export interface HttpServerTransportConfigOption extends HttpServerTransportConf
|
|
|
25
25
|
export declare class TransportFactory {
|
|
26
26
|
static establish(config: TransportConfig): Transport;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
28
|
+
//# sourceMappingURL=transport-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-factory.d.ts","sourceRoot":"","sources":["../../src/transport-factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAG1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,yEAAyE;AACzE,MAAM,MAAM,eAAe,GACvB,0BAA0B,GAC1B,4BAA4B,GAC5B,+BAA+B,GAC/B,+BAA+B,CAAC;AAEpC,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,+BAAgC,SAAQ,yBAAyB;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,+BAAgC,SAAQ,yBAAyB;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,gDAAgD;AAChD,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS;CAwBrD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-btcr2/aggregation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Multi-party coordination for did:btcr2 aggregate beacons: sans-I/O AggregationService and AggregationParticipant state machines, MuSig2 (BIP-327) signing sessions, cohort conditions, and pluggable transports (Nostr, HTTP, in-memory).",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -13,6 +13,21 @@
|
|
|
13
13
|
"import": "./dist/esm/index.js",
|
|
14
14
|
"require": "./dist/cjs/index.js"
|
|
15
15
|
},
|
|
16
|
+
"./core": {
|
|
17
|
+
"types": "./dist/types/core/index.d.ts",
|
|
18
|
+
"import": "./dist/esm/core/index.js",
|
|
19
|
+
"require": "./dist/cjs/core/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./participant": {
|
|
22
|
+
"types": "./dist/types/participant/index.d.ts",
|
|
23
|
+
"import": "./dist/esm/participant/index.js",
|
|
24
|
+
"require": "./dist/cjs/participant/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./service": {
|
|
27
|
+
"types": "./dist/types/service/index.d.ts",
|
|
28
|
+
"import": "./dist/esm/service/index.js",
|
|
29
|
+
"require": "./dist/cjs/service/index.js"
|
|
30
|
+
},
|
|
16
31
|
"./browser": {
|
|
17
32
|
"types": "./dist/types/index.d.ts",
|
|
18
33
|
"default": "./dist/browser.mjs"
|
|
@@ -74,11 +89,11 @@
|
|
|
74
89
|
"@noble/hashes": "^1.8.0",
|
|
75
90
|
"@scure/btc-signer": "^1.8.1",
|
|
76
91
|
"nostr-tools": "^2.23.3",
|
|
92
|
+
"@did-btcr2/bitcoin": "^0.8.0",
|
|
93
|
+
"@did-btcr2/cryptosuite": "^9.0.0",
|
|
94
|
+
"@did-btcr2/common": "^9.1.0",
|
|
77
95
|
"@did-btcr2/smt": "^0.3.0",
|
|
78
|
-
"@did-btcr2/keypair": "^0.13.1"
|
|
79
|
-
"@did-btcr2/bitcoin": "^0.7.0",
|
|
80
|
-
"@did-btcr2/cryptosuite": "^8.0.0",
|
|
81
|
-
"@did-btcr2/common": "^9.1.0"
|
|
96
|
+
"@did-btcr2/keypair": "^0.13.1"
|
|
82
97
|
},
|
|
83
98
|
"devDependencies": {
|
|
84
99
|
"@eslint/js": "^9.20.0",
|
|
@@ -103,7 +118,8 @@
|
|
|
103
118
|
"tsup": "^8.5.1",
|
|
104
119
|
"typedoc-plugin-markdown": "^4.7.0",
|
|
105
120
|
"typescript": "^5.7.3",
|
|
106
|
-
"typescript-eslint": "^8.24.1"
|
|
121
|
+
"typescript-eslint": "^8.24.1",
|
|
122
|
+
"@did-btcr2/method": "^0.41.0"
|
|
107
123
|
},
|
|
108
124
|
"scripts": {
|
|
109
125
|
"clean": "rimraf dist coverage tests/compiled",
|
|
@@ -111,6 +127,7 @@
|
|
|
111
127
|
"clean:tests": "rimraf coverage tests/compiled",
|
|
112
128
|
"wipe": "rimraf node_modules pnpm-lock.json",
|
|
113
129
|
"reinstall": "pnpm install --force",
|
|
130
|
+
"do": "bun",
|
|
114
131
|
"build": "pnpm clean:build && pnpm build:esm && pnpm build:cjs && pnpm build:browser",
|
|
115
132
|
"build:esm": "rimraf dist/esm dist/types && pnpm tsc -p tsconfig.json",
|
|
116
133
|
"build:cjs": "tsup && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { SchnorrKeyPair } from '@did-btcr2/keypair';
|
|
2
2
|
import { bytesToHex } from '@noble/hashes/utils';
|
|
3
|
-
import { DEFAULT_FUNDING_MODEL, DEFAULT_RECOVERY_SEQUENCE } from '
|
|
4
|
-
import type { AggregationResult } from '
|
|
5
|
-
import { InMemoryBus, InMemoryTransport } from '
|
|
6
|
-
import { AggregationParticipantRunner } from './participant-runner.js';
|
|
7
|
-
import type { OnProvideUpdate } from './participant-runner.js';
|
|
8
|
-
import { AggregationServiceRunner } from './service-runner.js';
|
|
9
|
-
import type { OnProvideTxData } from './service-runner.js';
|
|
3
|
+
import { DEFAULT_FUNDING_MODEL, DEFAULT_RECOVERY_SEQUENCE } from './core/recovery-policy.js';
|
|
4
|
+
import type { AggregationResult } from './service/service.js';
|
|
5
|
+
import { InMemoryBus, InMemoryTransport } from './core/transport/in-memory.js';
|
|
6
|
+
import { AggregationParticipantRunner } from './participant/participant-runner.js';
|
|
7
|
+
import type { OnProvideUpdate } from './participant/participant-runner.js';
|
|
8
|
+
import { AggregationServiceRunner } from './service/service-runner.js';
|
|
9
|
+
import type { OnProvideTxData } from './service/service-runner.js';
|
|
10
10
|
import type { FeeEstimator } from '@did-btcr2/bitcoin';
|
|
11
11
|
|
|
12
12
|
/** Identity (DID + keys) for one actor in an {@link AggregationRunner.solo} run. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { canonicalize } from '@did-btcr2/common';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SecuredDocument } from '@did-btcr2/cryptosuite';
|
|
3
3
|
import type { SerializedSMTProof } from '@did-btcr2/smt';
|
|
4
4
|
import { base64UrlToHash, blockHash, didToIndex, hashToBase64Url, verifySerializedProof } from '@did-btcr2/smt';
|
|
5
5
|
import type { AggregationCohort } from './cohort.js';
|
|
@@ -52,7 +52,7 @@ export interface AggregateBeaconStrategy {
|
|
|
52
52
|
validateParticipantView(params: {
|
|
53
53
|
participantDid: string;
|
|
54
54
|
included: boolean;
|
|
55
|
-
submittedUpdate?:
|
|
55
|
+
submittedUpdate?: SecuredDocument;
|
|
56
56
|
expectedHash?: string;
|
|
57
57
|
body: BaseBody;
|
|
58
58
|
}): BeaconValidationResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getNetwork } from '@did-btcr2/bitcoin';
|
|
2
2
|
import { canonicalHash, canonicalize, hash } from '@did-btcr2/common';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SecuredDocument } from '@did-btcr2/cryptosuite';
|
|
4
4
|
import type { SerializedSMTProof, TreeEntry } from '@did-btcr2/smt';
|
|
5
5
|
import { BTCR2MerkleTree } from '@did-btcr2/smt';
|
|
6
6
|
import { schnorr } from '@noble/curves/secp256k1.js';
|
|
@@ -113,7 +113,7 @@ export class AggregationCohort {
|
|
|
113
113
|
beaconAddress: string = '';
|
|
114
114
|
|
|
115
115
|
/** Pending DID updates submitted by participants, keyed by DID. */
|
|
116
|
-
pendingUpdates: Map<string,
|
|
116
|
+
pendingUpdates: Map<string, SecuredDocument> = new Map();
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Participant DIDs that explicitly declined to submit an update this round
|
|
@@ -274,7 +274,7 @@ export class AggregationCohort {
|
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
public addUpdate(participantDid: string, signedUpdate:
|
|
277
|
+
public addUpdate(participantDid: string, signedUpdate: SecuredDocument): void {
|
|
278
278
|
if(!this.participants.includes(participantDid)) {
|
|
279
279
|
throw new AggregationCohortError(
|
|
280
280
|
`Participant ${participantDid} is not in cohort ${this.id}.`,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @did-btcr2/aggregation/core
|
|
2
|
+
//
|
|
3
|
+
// The shared base both the participant and service roles depend on: the
|
|
4
|
+
// protocol-and-crypto core, the wire messages, the cohort model and conditions,
|
|
5
|
+
// the recovery and fallback scripts, the protocol phases, the beacon strategy,
|
|
6
|
+
// the errors and logger, the base transport interface, the in-memory and Nostr
|
|
7
|
+
// transports, the shared HTTP primitives, and the generic typed event emitter.
|
|
8
|
+
// It depends on neither role.
|
|
9
|
+
export * from './errors.js';
|
|
10
|
+
export * from './logger.js';
|
|
11
|
+
export * from './conditions.js';
|
|
12
|
+
export * from './phases.js';
|
|
13
|
+
export * from './cohort.js';
|
|
14
|
+
export * from './signing-session.js';
|
|
15
|
+
export * from './signer.js';
|
|
16
|
+
export * from './beacon-strategy.js';
|
|
17
|
+
export * from './recovery-policy.js';
|
|
18
|
+
export * from './recovery-spend.js';
|
|
19
|
+
export * from './fallback-spend.js';
|
|
20
|
+
export * from './typed-emitter.js';
|
|
21
|
+
export * from './messages/index.js';
|
|
22
|
+
export * from './transport/index.js';
|