@psavelis/enterprise-blockchain 0.1.0 → 1.1.1
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/README.md +15 -2
- package/dist/aid-settlement/application/reconciler.d.ts +13 -0
- package/dist/aid-settlement/application/reconciler.d.ts.map +1 -0
- package/dist/aid-settlement/application/reconciler.js +77 -0
- package/dist/aid-settlement/domain/entities.d.ts +24 -0
- package/dist/aid-settlement/domain/entities.d.ts.map +1 -0
- package/dist/aid-settlement/domain/entities.js +1 -0
- package/dist/aid-settlement/domain/ports.d.ts +10 -0
- package/dist/aid-settlement/domain/ports.d.ts.map +1 -0
- package/dist/aid-settlement/domain/ports.js +1 -0
- package/dist/aid-settlement/index.d.ts +19 -0
- package/dist/aid-settlement/index.d.ts.map +1 -0
- package/dist/aid-settlement/index.js +23 -0
- package/dist/aid-settlement/infrastructure/in-memory-store.d.ts +12 -0
- package/dist/aid-settlement/infrastructure/in-memory-store.d.ts.map +1 -0
- package/dist/aid-settlement/infrastructure/in-memory-store.js +17 -0
- package/dist/credentialing/application/clearance-evaluator.d.ts +10 -0
- package/dist/credentialing/application/clearance-evaluator.d.ts.map +1 -0
- package/dist/credentialing/application/clearance-evaluator.js +63 -0
- package/dist/credentialing/domain/entities.d.ts +28 -0
- package/dist/credentialing/domain/entities.d.ts.map +1 -0
- package/dist/credentialing/domain/entities.js +1 -0
- package/dist/credentialing/domain/ports.d.ts +9 -0
- package/dist/credentialing/domain/ports.d.ts.map +1 -0
- package/dist/credentialing/domain/ports.js +1 -0
- package/dist/credentialing/index.d.ts +19 -0
- package/dist/credentialing/index.d.ts.map +1 -0
- package/dist/credentialing/index.js +23 -0
- package/dist/credentialing/infrastructure/in-memory-store.d.ts +11 -0
- package/dist/credentialing/infrastructure/in-memory-store.d.ts.map +1 -0
- package/dist/credentialing/infrastructure/in-memory-store.js +14 -0
- package/dist/hsm/application/asymmetric-key-service.d.ts +23 -0
- package/dist/hsm/application/asymmetric-key-service.d.ts.map +1 -0
- package/dist/hsm/application/asymmetric-key-service.js +109 -0
- package/dist/hsm/application/envelope-encryption-service.d.ts +18 -0
- package/dist/hsm/application/envelope-encryption-service.d.ts.map +1 -0
- package/dist/hsm/application/envelope-encryption-service.js +59 -0
- package/dist/hsm/application/symmetric-key-service.d.ts +34 -0
- package/dist/hsm/application/symmetric-key-service.d.ts.map +1 -0
- package/dist/hsm/application/symmetric-key-service.js +107 -0
- package/dist/hsm/domain/entities.d.ts +104 -0
- package/dist/hsm/domain/entities.d.ts.map +1 -0
- package/dist/hsm/domain/entities.js +10 -0
- package/dist/hsm/domain/ports.d.ts +20 -0
- package/dist/hsm/domain/ports.d.ts.map +1 -0
- package/dist/hsm/domain/ports.js +1 -0
- package/dist/hsm/index.d.ts +48 -0
- package/dist/hsm/index.d.ts.map +1 -0
- package/dist/hsm/index.js +97 -0
- package/dist/hsm/infrastructure/audit-log-factory.d.ts +59 -0
- package/dist/hsm/infrastructure/audit-log-factory.d.ts.map +1 -0
- package/dist/hsm/infrastructure/audit-log-factory.js +95 -0
- package/dist/hsm/infrastructure/audit-log.d.ts +8 -0
- package/dist/hsm/infrastructure/audit-log.d.ts.map +1 -0
- package/dist/hsm/infrastructure/audit-log.js +18 -0
- package/dist/hsm/infrastructure/file-audit-log.d.ts +55 -0
- package/dist/hsm/infrastructure/file-audit-log.d.ts.map +1 -0
- package/dist/hsm/infrastructure/file-audit-log.js +128 -0
- package/dist/hsm/infrastructure/key-store.d.ts +9 -0
- package/dist/hsm/infrastructure/key-store.d.ts.map +1 -0
- package/dist/hsm/infrastructure/key-store.js +12 -0
- package/dist/hsm/infrastructure/syslog-audit-log.d.ts +64 -0
- package/dist/hsm/infrastructure/syslog-audit-log.d.ts.map +1 -0
- package/dist/hsm/infrastructure/syslog-audit-log.js +167 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/integrations/besu-client/error-mapper.d.ts +9 -0
- package/dist/integrations/besu-client/error-mapper.d.ts.map +1 -0
- package/dist/integrations/besu-client/error-mapper.js +22 -0
- package/dist/integrations/besu-client/index.d.ts +65 -0
- package/dist/integrations/besu-client/index.d.ts.map +1 -0
- package/dist/integrations/besu-client/index.js +276 -0
- package/dist/integrations/besu-client/ports.d.ts +44 -0
- package/dist/integrations/besu-client/ports.d.ts.map +1 -0
- package/dist/integrations/besu-client/ports.js +1 -0
- package/dist/integrations/corda-gateway/index.d.ts +37 -0
- package/dist/integrations/corda-gateway/index.d.ts.map +1 -0
- package/dist/integrations/corda-gateway/index.js +234 -0
- package/dist/integrations/corda-gateway/ports.d.ts +33 -0
- package/dist/integrations/corda-gateway/ports.d.ts.map +1 -0
- package/dist/integrations/corda-gateway/ports.js +1 -0
- package/dist/integrations/fabric-gateway/index.d.ts +78 -0
- package/dist/integrations/fabric-gateway/index.d.ts.map +1 -0
- package/dist/integrations/fabric-gateway/index.js +214 -0
- package/dist/integrations/fabric-gateway/ports.d.ts +50 -0
- package/dist/integrations/fabric-gateway/ports.d.ts.map +1 -0
- package/dist/integrations/fabric-gateway/ports.js +1 -0
- package/dist/integrations/index.d.ts +19 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +19 -0
- package/dist/integrations/shared/env.d.ts +4 -0
- package/dist/integrations/shared/env.d.ts.map +1 -0
- package/dist/integrations/shared/env.js +24 -0
- package/dist/integrations/shared/retry.d.ts +79 -0
- package/dist/integrations/shared/retry.d.ts.map +1 -0
- package/dist/integrations/shared/retry.js +315 -0
- package/dist/mpc/adapters.d.ts +36 -0
- package/dist/mpc/adapters.d.ts.map +1 -0
- package/dist/mpc/adapters.js +46 -0
- package/dist/mpc/crypto.d.ts +2 -0
- package/dist/mpc/crypto.d.ts.map +1 -0
- package/dist/mpc/crypto.js +2 -0
- package/dist/mpc/dsa.d.ts +134 -0
- package/dist/mpc/dsa.d.ts.map +1 -0
- package/dist/mpc/dsa.js +127 -0
- package/dist/mpc/field.d.ts +127 -0
- package/dist/mpc/field.d.ts.map +1 -0
- package/dist/mpc/field.js +209 -0
- package/dist/mpc/hybrid-kem.d.ts +96 -0
- package/dist/mpc/hybrid-kem.d.ts.map +1 -0
- package/dist/mpc/hybrid-kem.js +136 -0
- package/dist/mpc/index.d.ts +135 -0
- package/dist/mpc/index.d.ts.map +1 -0
- package/dist/mpc/index.js +348 -0
- package/dist/mpc/kyber.d.ts +134 -0
- package/dist/mpc/kyber.d.ts.map +1 -0
- package/dist/mpc/kyber.js +143 -0
- package/dist/mpc/ports.d.ts +67 -0
- package/dist/mpc/ports.d.ts.map +1 -0
- package/dist/mpc/ports.js +9 -0
- package/dist/mpc/quantum.d.ts +80 -0
- package/dist/mpc/quantum.d.ts.map +1 -0
- package/dist/mpc/quantum.js +180 -0
- package/dist/p2mr/adapters.d.ts +31 -0
- package/dist/p2mr/adapters.d.ts.map +1 -0
- package/dist/p2mr/adapters.js +35 -0
- package/dist/p2mr/index.d.ts +63 -0
- package/dist/p2mr/index.d.ts.map +1 -0
- package/dist/p2mr/index.js +59 -0
- package/dist/p2mr/merkle-tree.d.ts +109 -0
- package/dist/p2mr/merkle-tree.d.ts.map +1 -0
- package/dist/p2mr/merkle-tree.js +239 -0
- package/dist/p2mr/p2mr-output.d.ts +142 -0
- package/dist/p2mr/p2mr-output.d.ts.map +1 -0
- package/dist/p2mr/p2mr-output.js +150 -0
- package/dist/p2mr/ports.d.ts +52 -0
- package/dist/p2mr/ports.d.ts.map +1 -0
- package/dist/p2mr/ports.js +9 -0
- package/dist/p2mr/script-interpreter.d.ts +92 -0
- package/dist/p2mr/script-interpreter.d.ts.map +1 -0
- package/dist/p2mr/script-interpreter.js +535 -0
- package/dist/p2mr/script-leaf.d.ts +70 -0
- package/dist/p2mr/script-leaf.d.ts.map +1 -0
- package/dist/p2mr/script-leaf.js +203 -0
- package/dist/p2mr/spend-proof.d.ts +95 -0
- package/dist/p2mr/spend-proof.d.ts.map +1 -0
- package/dist/p2mr/spend-proof.js +358 -0
- package/dist/p2mr/types.d.ts +209 -0
- package/dist/p2mr/types.d.ts.map +1 -0
- package/dist/p2mr/types.js +9 -0
- package/dist/privacy/application/view-projector.d.ts +13 -0
- package/dist/privacy/application/view-projector.d.ts.map +1 -0
- package/dist/privacy/application/view-projector.js +85 -0
- package/dist/privacy/domain/entities.d.ts +26 -0
- package/dist/privacy/domain/entities.d.ts.map +1 -0
- package/dist/privacy/domain/entities.js +1 -0
- package/dist/privacy/domain/ports.d.ts +7 -0
- package/dist/privacy/domain/ports.d.ts.map +1 -0
- package/dist/privacy/domain/ports.js +1 -0
- package/dist/privacy/index.d.ts +21 -0
- package/dist/privacy/index.d.ts.map +1 -0
- package/dist/privacy/index.js +25 -0
- package/dist/privacy/infrastructure/in-memory-store.d.ts +8 -0
- package/dist/privacy/infrastructure/in-memory-store.d.ts.map +1 -0
- package/dist/privacy/infrastructure/in-memory-store.js +7 -0
- package/dist/protocols/besu-port.d.ts +80 -0
- package/dist/protocols/besu-port.d.ts.map +1 -0
- package/dist/protocols/besu-port.js +1 -0
- package/dist/protocols/corda-port.d.ts +103 -0
- package/dist/protocols/corda-port.d.ts.map +1 -0
- package/dist/protocols/corda-port.js +9 -0
- package/dist/protocols/credentialing-port.d.ts +11 -0
- package/dist/protocols/credentialing-port.d.ts.map +1 -0
- package/dist/protocols/credentialing-port.js +1 -0
- package/dist/protocols/fabric-port.d.ts +89 -0
- package/dist/protocols/fabric-port.d.ts.map +1 -0
- package/dist/protocols/fabric-port.js +9 -0
- package/dist/protocols/index.d.ts +14 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/index.js +7 -0
- package/dist/protocols/p2mr-port.d.ts +159 -0
- package/dist/protocols/p2mr-port.d.ts.map +1 -0
- package/dist/protocols/p2mr-port.js +12 -0
- package/dist/protocols/privacy-port.d.ts +9 -0
- package/dist/protocols/privacy-port.d.ts.map +1 -0
- package/dist/protocols/privacy-port.js +1 -0
- package/dist/protocols/traceability-port.d.ts +12 -0
- package/dist/protocols/traceability-port.d.ts.map +1 -0
- package/dist/protocols/traceability-port.js +1 -0
- package/dist/shared/collection-store.d.ts +12 -0
- package/dist/shared/collection-store.d.ts.map +1 -0
- package/dist/shared/collection-store.js +26 -0
- package/dist/shared/commit.d.ts +24 -0
- package/dist/shared/commit.d.ts.map +1 -0
- package/dist/shared/commit.js +50 -0
- package/dist/shared/crypto.d.ts +2 -0
- package/dist/shared/crypto.d.ts.map +1 -0
- package/dist/shared/crypto.js +4 -0
- package/dist/shared/date.d.ts +2 -0
- package/dist/shared/date.d.ts.map +1 -0
- package/dist/shared/date.js +3 -0
- package/dist/shared/index.d.ts +9 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +11 -0
- package/dist/shared/logger.d.ts +37 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +45 -0
- package/dist/shared/store.d.ts +25 -0
- package/dist/shared/store.d.ts.map +1 -0
- package/dist/shared/store.js +18 -0
- package/dist/shared/telemetry-sdk.d.ts +26 -0
- package/dist/shared/telemetry-sdk.d.ts.map +1 -0
- package/dist/shared/telemetry-sdk.js +97 -0
- package/dist/shared/telemetry.d.ts +86 -0
- package/dist/shared/telemetry.d.ts.map +1 -0
- package/dist/shared/telemetry.js +137 -0
- package/dist/stark-settlement/application/aggregator-service.d.ts +112 -0
- package/dist/stark-settlement/application/aggregator-service.d.ts.map +1 -0
- package/dist/stark-settlement/application/aggregator-service.js +256 -0
- package/dist/stark-settlement/application/ledger-service.d.ts +114 -0
- package/dist/stark-settlement/application/ledger-service.d.ts.map +1 -0
- package/dist/stark-settlement/application/ledger-service.js +318 -0
- package/dist/stark-settlement/application/settlement-service.d.ts +104 -0
- package/dist/stark-settlement/application/settlement-service.d.ts.map +1 -0
- package/dist/stark-settlement/application/settlement-service.js +251 -0
- package/dist/stark-settlement/domain/entities.d.ts +365 -0
- package/dist/stark-settlement/domain/entities.d.ts.map +1 -0
- package/dist/stark-settlement/domain/entities.js +29 -0
- package/dist/stark-settlement/domain/ports.d.ts +485 -0
- package/dist/stark-settlement/domain/ports.d.ts.map +1 -0
- package/dist/stark-settlement/domain/ports.js +14 -0
- package/dist/stark-settlement/domain/value-objects.d.ts +268 -0
- package/dist/stark-settlement/domain/value-objects.d.ts.map +1 -0
- package/dist/stark-settlement/domain/value-objects.js +500 -0
- package/dist/stark-settlement/index.d.ts +172 -0
- package/dist/stark-settlement/index.d.ts.map +1 -0
- package/dist/stark-settlement/index.js +193 -0
- package/dist/stark-settlement/infrastructure/adapters/audit-adapter.d.ts +52 -0
- package/dist/stark-settlement/infrastructure/adapters/audit-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/audit-adapter.js +154 -0
- package/dist/stark-settlement/infrastructure/adapters/bitcoin-adapter.d.ts +88 -0
- package/dist/stark-settlement/infrastructure/adapters/bitcoin-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/bitcoin-adapter.js +187 -0
- package/dist/stark-settlement/infrastructure/adapters/clock-adapter.d.ts +59 -0
- package/dist/stark-settlement/infrastructure/adapters/clock-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/clock-adapter.js +85 -0
- package/dist/stark-settlement/infrastructure/adapters/dilithium-adapter.d.ts +60 -0
- package/dist/stark-settlement/infrastructure/adapters/dilithium-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/dilithium-adapter.js +104 -0
- package/dist/stark-settlement/infrastructure/adapters/event-emitter-adapter.d.ts +115 -0
- package/dist/stark-settlement/infrastructure/adapters/event-emitter-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/event-emitter-adapter.js +191 -0
- package/dist/stark-settlement/infrastructure/adapters/fiat-adapter.d.ts +65 -0
- package/dist/stark-settlement/infrastructure/adapters/fiat-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/fiat-adapter.js +207 -0
- package/dist/stark-settlement/infrastructure/adapters/mock-stark-adapter.d.ts +73 -0
- package/dist/stark-settlement/infrastructure/adapters/mock-stark-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/mock-stark-adapter.js +287 -0
- package/dist/stark-settlement/infrastructure/adapters/solana-adapter.d.ts +78 -0
- package/dist/stark-settlement/infrastructure/adapters/solana-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/solana-adapter.js +172 -0
- package/dist/stark-settlement/infrastructure/adapters/starknet-proof-adapter.d.ts +56 -0
- package/dist/stark-settlement/infrastructure/adapters/starknet-proof-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/starknet-proof-adapter.js +261 -0
- package/dist/stark-settlement/infrastructure/adapters/stone-proof-adapter.d.ts +125 -0
- package/dist/stark-settlement/infrastructure/adapters/stone-proof-adapter.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/adapters/stone-proof-adapter.js +416 -0
- package/dist/stark-settlement/infrastructure/persistence/ledger-store.d.ts +68 -0
- package/dist/stark-settlement/infrastructure/persistence/ledger-store.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/persistence/ledger-store.js +238 -0
- package/dist/stark-settlement/infrastructure/persistence/offset-store.d.ts +30 -0
- package/dist/stark-settlement/infrastructure/persistence/offset-store.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/persistence/offset-store.js +57 -0
- package/dist/stark-settlement/infrastructure/persistence/outbox-store.d.ts +45 -0
- package/dist/stark-settlement/infrastructure/persistence/outbox-store.d.ts.map +1 -0
- package/dist/stark-settlement/infrastructure/persistence/outbox-store.js +171 -0
- package/dist/traceability/application/recall-assessor.d.ts +13 -0
- package/dist/traceability/application/recall-assessor.d.ts.map +1 -0
- package/dist/traceability/application/recall-assessor.js +74 -0
- package/dist/traceability/domain/entities.d.ts +23 -0
- package/dist/traceability/domain/entities.d.ts.map +1 -0
- package/dist/traceability/domain/entities.js +1 -0
- package/dist/traceability/domain/ports.d.ts +23 -0
- package/dist/traceability/domain/ports.d.ts.map +1 -0
- package/dist/traceability/domain/ports.js +1 -0
- package/dist/traceability/domain/recall.d.ts +12 -0
- package/dist/traceability/domain/recall.d.ts.map +1 -0
- package/dist/traceability/domain/recall.js +1 -0
- package/dist/traceability/index.d.ts +22 -0
- package/dist/traceability/index.d.ts.map +1 -0
- package/dist/traceability/index.js +26 -0
- package/dist/traceability/infrastructure/in-memory-store.d.ts +13 -0
- package/dist/traceability/infrastructure/in-memory-store.d.ts.map +1 -0
- package/dist/traceability/infrastructure/in-memory-store.js +24 -0
- package/package.json +12 -9
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port Interfaces for Aggregated STARK Settlement Layer (Hexagonal Architecture)
|
|
3
|
+
*
|
|
4
|
+
* Ports define the boundaries of the domain:
|
|
5
|
+
* - Input ports: How the application receives requests
|
|
6
|
+
* - Output ports: How the application interacts with external systems
|
|
7
|
+
*
|
|
8
|
+
* All ports are pure interfaces with no implementation details.
|
|
9
|
+
* Adapters in the infrastructure layer implement these ports.
|
|
10
|
+
*
|
|
11
|
+
* @see modules/p2mr/src/ports.ts for similar hexagonal pattern
|
|
12
|
+
* @see docs/adr/ADR-0001-hexagonal-architecture.md
|
|
13
|
+
*/
|
|
14
|
+
import type { AssetType, MirrorAccount, LedgerTransaction, TransactionPayload, BaseProof, Tier1Proof, Tier2BlockProof, OutboxEntry, NetTransfer, SolanaSettlementResult, BitcoinSettlementResult, FiatSettlementResult, DepositEvent, AuditRecord, RaftNode } from "./entities.js";
|
|
15
|
+
/**
|
|
16
|
+
* Port for STARK proof generation and verification.
|
|
17
|
+
*
|
|
18
|
+
* Implementations:
|
|
19
|
+
* - StarknetProofAdapter: Real proof generation via starknet.js
|
|
20
|
+
* - MockProofAdapter: Simulated proofs for testing
|
|
21
|
+
*/
|
|
22
|
+
export interface StarkProofGeneratorPort {
|
|
23
|
+
/**
|
|
24
|
+
* Generate a base proof for a single transaction.
|
|
25
|
+
*
|
|
26
|
+
* @param tx - The ledger transaction to prove
|
|
27
|
+
* @param preStateRoot - State root before the transaction
|
|
28
|
+
* @param postStateRoot - State root after the transaction
|
|
29
|
+
* @returns Base proof with STARK data and public inputs
|
|
30
|
+
*/
|
|
31
|
+
generateBaseProof(tx: LedgerTransaction, preStateRoot: string, postStateRoot: string): Promise<BaseProof>;
|
|
32
|
+
/**
|
|
33
|
+
* Aggregate 128 base proofs into a Tier-1 proof using recursive verification.
|
|
34
|
+
*
|
|
35
|
+
* @param baseProofs - Exactly 128 base proofs to aggregate
|
|
36
|
+
* @returns Aggregated Tier-1 proof
|
|
37
|
+
* @throws If baseProofs.length !== 128
|
|
38
|
+
*/
|
|
39
|
+
aggregateTier1(baseProofs: readonly BaseProof[]): Promise<Tier1Proof>;
|
|
40
|
+
/**
|
|
41
|
+
* Aggregate 64 Tier-1 proofs into a final Tier-2 block proof.
|
|
42
|
+
*
|
|
43
|
+
* @param tier1Proofs - Exactly 64 Tier-1 proofs to aggregate
|
|
44
|
+
* @returns Final block proof ready for settlement
|
|
45
|
+
* @throws If tier1Proofs.length !== 64
|
|
46
|
+
*/
|
|
47
|
+
aggregateTier2(tier1Proofs: readonly Tier1Proof[]): Promise<Tier2BlockProof>;
|
|
48
|
+
/**
|
|
49
|
+
* Verify a Tier-2 block proof off-chain.
|
|
50
|
+
*
|
|
51
|
+
* @param blockProof - The block proof to verify
|
|
52
|
+
* @returns true if proof is valid
|
|
53
|
+
*/
|
|
54
|
+
verifyBlockProof(blockProof: Tier2BlockProof): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Get the verification key hash for the current proof system.
|
|
57
|
+
*/
|
|
58
|
+
getVerificationKeyHash(): Promise<string>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Port for ledger state persistence.
|
|
62
|
+
*
|
|
63
|
+
* Implementations:
|
|
64
|
+
* - InMemoryLedgerStore: For testing and demos
|
|
65
|
+
* - PostgresLedgerStore: For production (future)
|
|
66
|
+
*/
|
|
67
|
+
export interface LedgerPersistencePort {
|
|
68
|
+
/**
|
|
69
|
+
* Create a new mirror account.
|
|
70
|
+
*/
|
|
71
|
+
createAccount(account: MirrorAccount): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Get an account by ID.
|
|
74
|
+
*/
|
|
75
|
+
getAccount(accountId: string): Promise<MirrorAccount | null>;
|
|
76
|
+
/**
|
|
77
|
+
* Get an account by external address and asset type.
|
|
78
|
+
*/
|
|
79
|
+
getAccountByAddress(externalAddress: string, assetType: AssetType): Promise<MirrorAccount | null>;
|
|
80
|
+
/**
|
|
81
|
+
* Update an account's balance.
|
|
82
|
+
*
|
|
83
|
+
* @param accountId - Account to update
|
|
84
|
+
* @param delta - Amount to add (positive) or subtract (negative)
|
|
85
|
+
* @param newProofRoot - Updated proof root
|
|
86
|
+
*/
|
|
87
|
+
updateAccountBalance(accountId: string, delta: bigint, newProofRoot: string): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Get all accounts for an asset type.
|
|
90
|
+
*/
|
|
91
|
+
getAccountsByAssetType(assetType: AssetType): Promise<readonly MirrorAccount[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Append a transaction to the ledger (append-only).
|
|
94
|
+
*/
|
|
95
|
+
appendTransaction(tx: LedgerTransaction): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Get a transaction by ID.
|
|
98
|
+
*/
|
|
99
|
+
getTransaction(txId: string): Promise<LedgerTransaction | null>;
|
|
100
|
+
/**
|
|
101
|
+
* Get transactions by idempotency key (for duplicate detection).
|
|
102
|
+
*/
|
|
103
|
+
getTransactionsByIdempotencyKey(idempotencyKey: string): Promise<readonly LedgerTransaction[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Get pending transactions (not yet proved).
|
|
106
|
+
*/
|
|
107
|
+
getPendingTransactions(limit: number): Promise<readonly LedgerTransaction[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Update transaction status.
|
|
110
|
+
*/
|
|
111
|
+
updateTransactionStatus(txId: string, status: LedgerTransaction["status"]): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Save a base proof.
|
|
114
|
+
*/
|
|
115
|
+
saveBaseProof(proof: BaseProof): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Get a base proof by ID.
|
|
118
|
+
*/
|
|
119
|
+
getBaseProof(proofId: string): Promise<BaseProof | null>;
|
|
120
|
+
/**
|
|
121
|
+
* Get base proofs that haven't been aggregated into Tier-1.
|
|
122
|
+
*/
|
|
123
|
+
getUnaggregatedBaseProofs(limit: number): Promise<readonly BaseProof[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Save a Tier-1 proof.
|
|
126
|
+
*/
|
|
127
|
+
saveTier1Proof(proof: Tier1Proof): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Get a Tier-1 proof by ID.
|
|
130
|
+
*/
|
|
131
|
+
getTier1Proof(proofId: string): Promise<Tier1Proof | null>;
|
|
132
|
+
/**
|
|
133
|
+
* Get Tier-1 proofs that haven't been aggregated into Tier-2.
|
|
134
|
+
*/
|
|
135
|
+
getUnaggregatedTier1Proofs(limit: number): Promise<readonly Tier1Proof[]>;
|
|
136
|
+
/**
|
|
137
|
+
* Save a Tier-2 block proof.
|
|
138
|
+
*/
|
|
139
|
+
saveTier2Proof(proof: Tier2BlockProof): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Get a Tier-2 proof by ID.
|
|
142
|
+
*/
|
|
143
|
+
getTier2Proof(blockProofId: string): Promise<Tier2BlockProof | null>;
|
|
144
|
+
/**
|
|
145
|
+
* Get the latest block proof.
|
|
146
|
+
*/
|
|
147
|
+
getLatestBlockProof(): Promise<Tier2BlockProof | null>;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Port for the settlement outbox queue.
|
|
151
|
+
*
|
|
152
|
+
* Implements append-only queue with exactly-once consumption semantics.
|
|
153
|
+
*/
|
|
154
|
+
export interface OutboxPort {
|
|
155
|
+
/**
|
|
156
|
+
* Append an entry to the outbox.
|
|
157
|
+
* Returns the stored entry with the assigned sequential offset.
|
|
158
|
+
*/
|
|
159
|
+
appendEntry(entry: OutboxEntry): Promise<OutboxEntry>;
|
|
160
|
+
/**
|
|
161
|
+
* Get pending entries for an asset type.
|
|
162
|
+
*/
|
|
163
|
+
getPendingEntries(assetType: AssetType, limit: number): Promise<readonly OutboxEntry[]>;
|
|
164
|
+
/**
|
|
165
|
+
* Get an entry by ID.
|
|
166
|
+
*/
|
|
167
|
+
getEntry(entryId: string): Promise<OutboxEntry | null>;
|
|
168
|
+
/**
|
|
169
|
+
* Mark an entry as processing (in-flight).
|
|
170
|
+
*/
|
|
171
|
+
markProcessing(entryId: string): Promise<void>;
|
|
172
|
+
/**
|
|
173
|
+
* Mark an entry as settled.
|
|
174
|
+
*/
|
|
175
|
+
markSettled(entryId: string, settlementTxId: string): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Mark an entry as failed.
|
|
178
|
+
*/
|
|
179
|
+
markFailed(entryId: string, errorMessage: string): Promise<void>;
|
|
180
|
+
/**
|
|
181
|
+
* Get entries that need retry (failed but under max retries).
|
|
182
|
+
*/
|
|
183
|
+
getRetryableEntries(assetType: AssetType, limit: number): Promise<readonly OutboxEntry[]>;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Port for tracking consumer offsets in the outbox.
|
|
187
|
+
*
|
|
188
|
+
* Enables exactly-once processing by tracking the last processed offset.
|
|
189
|
+
*/
|
|
190
|
+
export interface OffsetTrackingPort {
|
|
191
|
+
/**
|
|
192
|
+
* Get the current offset for a consumer.
|
|
193
|
+
*/
|
|
194
|
+
getOffset(consumerId: string, assetType: AssetType): Promise<bigint>;
|
|
195
|
+
/**
|
|
196
|
+
* Commit a new offset (atomically).
|
|
197
|
+
*/
|
|
198
|
+
commitOffset(consumerId: string, assetType: AssetType, offset: bigint): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* Get all consumer offsets for an asset type.
|
|
201
|
+
*/
|
|
202
|
+
getConsumerOffsets(assetType: AssetType): Promise<ReadonlyMap<string, bigint>>;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Port for Solana settlement operations.
|
|
206
|
+
*/
|
|
207
|
+
export interface SolanaSettlementPort {
|
|
208
|
+
/**
|
|
209
|
+
* Execute a batched transfer using VersionedTransaction with lookup tables.
|
|
210
|
+
*
|
|
211
|
+
* @param transfers - Net transfers to execute
|
|
212
|
+
* @param blockProof - Block proof for commitment
|
|
213
|
+
* @returns Settlement result with signature
|
|
214
|
+
*/
|
|
215
|
+
executeBatchedTransfer(transfers: readonly NetTransfer[], blockProof: Tier2BlockProof): Promise<SolanaSettlementResult>;
|
|
216
|
+
/**
|
|
217
|
+
* Subscribe to deposit events on specified addresses.
|
|
218
|
+
*/
|
|
219
|
+
subscribeDeposits(addresses: readonly string[], callback: (deposit: DepositEvent) => void): Promise<{
|
|
220
|
+
unsubscribe: () => void;
|
|
221
|
+
}>;
|
|
222
|
+
/**
|
|
223
|
+
* Get the current slot for health checks.
|
|
224
|
+
*/
|
|
225
|
+
getHealth(): Promise<{
|
|
226
|
+
healthy: boolean;
|
|
227
|
+
slot: number;
|
|
228
|
+
}>;
|
|
229
|
+
/**
|
|
230
|
+
* Get or create an address lookup table for batch optimization.
|
|
231
|
+
*/
|
|
232
|
+
getOrCreateLookupTable(addresses: readonly string[]): Promise<string>;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Port for Bitcoin settlement operations.
|
|
236
|
+
*/
|
|
237
|
+
export interface BitcoinSettlementPort {
|
|
238
|
+
/**
|
|
239
|
+
* Execute a batched UTXO spend using PSBT.
|
|
240
|
+
*
|
|
241
|
+
* @param transfers - Net transfers to execute
|
|
242
|
+
* @param blockProof - Block proof for OP_RETURN commitment
|
|
243
|
+
* @returns Settlement result with txid
|
|
244
|
+
*/
|
|
245
|
+
executeBatchedSpend(transfers: readonly NetTransfer[], blockProof: Tier2BlockProof): Promise<BitcoinSettlementResult>;
|
|
246
|
+
/**
|
|
247
|
+
* Watch addresses for incoming deposits.
|
|
248
|
+
*/
|
|
249
|
+
watchAddresses(addresses: readonly string[], callback: (deposit: DepositEvent) => void): Promise<{
|
|
250
|
+
unwatch: () => void;
|
|
251
|
+
}>;
|
|
252
|
+
/**
|
|
253
|
+
* Get the current block height for health checks.
|
|
254
|
+
*/
|
|
255
|
+
getHealth(): Promise<{
|
|
256
|
+
healthy: boolean;
|
|
257
|
+
blockHeight: number;
|
|
258
|
+
}>;
|
|
259
|
+
/**
|
|
260
|
+
* Get UTXOs for an address.
|
|
261
|
+
*/
|
|
262
|
+
getUtxos(address: string): Promise<readonly {
|
|
263
|
+
txid: string;
|
|
264
|
+
vout: number;
|
|
265
|
+
value: bigint;
|
|
266
|
+
confirmed: boolean;
|
|
267
|
+
}[]>;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Port for fiat settlement operations (mock ISO 20022).
|
|
271
|
+
*/
|
|
272
|
+
export interface FiatSettlementPort {
|
|
273
|
+
/**
|
|
274
|
+
* Execute a credit transfer via ISO 20022 pain.001.
|
|
275
|
+
*
|
|
276
|
+
* @param transfers - Net transfers to execute
|
|
277
|
+
* @param blockProof - Block proof for remittance info
|
|
278
|
+
* @returns Settlement result with message ID
|
|
279
|
+
*/
|
|
280
|
+
executeTransfer(transfers: readonly NetTransfer[], blockProof: Tier2BlockProof): Promise<FiatSettlementResult>;
|
|
281
|
+
/**
|
|
282
|
+
* Get the health status of the fiat rail.
|
|
283
|
+
*/
|
|
284
|
+
getHealth(): Promise<{
|
|
285
|
+
healthy: boolean;
|
|
286
|
+
}>;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Port for bidirectional gRPC streaming of outbox entries.
|
|
290
|
+
*/
|
|
291
|
+
export interface OutboxListenerPort {
|
|
292
|
+
/**
|
|
293
|
+
* Start streaming outbox entries for an asset type.
|
|
294
|
+
*
|
|
295
|
+
* @param assetType - Asset type to stream
|
|
296
|
+
* @param onEntry - Callback for each entry
|
|
297
|
+
* @param onError - Error callback
|
|
298
|
+
* @returns Control object to stop streaming
|
|
299
|
+
*/
|
|
300
|
+
startStreaming(assetType: AssetType, onEntry: (entry: OutboxEntry) => Promise<void>, onError: (error: Error) => void): Promise<{
|
|
301
|
+
stop: () => void;
|
|
302
|
+
}>;
|
|
303
|
+
/**
|
|
304
|
+
* Acknowledge processing of an entry (commits offset).
|
|
305
|
+
*/
|
|
306
|
+
acknowledge(entryId: string, offset: bigint): Promise<void>;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Port for ML-DSA-65 (Dilithium) signing operations.
|
|
310
|
+
*
|
|
311
|
+
* Reuses the existing MPC module's ML-DSA implementation.
|
|
312
|
+
*/
|
|
313
|
+
export interface DilithiumSigningPort {
|
|
314
|
+
/**
|
|
315
|
+
* Generate an ML-DSA-65 keypair.
|
|
316
|
+
*/
|
|
317
|
+
generateKeyPair(): {
|
|
318
|
+
publicKey: Uint8Array;
|
|
319
|
+
secretKey: Uint8Array;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Sign a message with ML-DSA-65.
|
|
323
|
+
*/
|
|
324
|
+
sign(message: Uint8Array, secretKey: Uint8Array): Uint8Array;
|
|
325
|
+
/**
|
|
326
|
+
* Verify an ML-DSA-65 signature.
|
|
327
|
+
*/
|
|
328
|
+
verify(message: Uint8Array, signature: Uint8Array, publicKey: Uint8Array): boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Get the SHA-256 hash of a public key.
|
|
331
|
+
*/
|
|
332
|
+
hashPublicKey(publicKey: Uint8Array): string;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Port for signing transaction payloads.
|
|
336
|
+
*
|
|
337
|
+
* Combines serialization and ML-DSA signing.
|
|
338
|
+
*/
|
|
339
|
+
export interface TransactionSigningPort {
|
|
340
|
+
/**
|
|
341
|
+
* Sign a transaction payload.
|
|
342
|
+
*
|
|
343
|
+
* @param payload - Transaction payload to sign
|
|
344
|
+
* @param secretKey - ML-DSA-65 secret key
|
|
345
|
+
* @returns Signature bytes
|
|
346
|
+
*/
|
|
347
|
+
signPayload(payload: TransactionPayload, secretKey: Uint8Array): Uint8Array;
|
|
348
|
+
/**
|
|
349
|
+
* Verify a transaction signature.
|
|
350
|
+
*
|
|
351
|
+
* @param payload - Original payload
|
|
352
|
+
* @param signature - Signature to verify
|
|
353
|
+
* @param publicKey - Signer's public key
|
|
354
|
+
* @returns true if valid
|
|
355
|
+
*/
|
|
356
|
+
verifyPayload(payload: TransactionPayload, signature: Uint8Array, publicKey: Uint8Array): boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Serialize a payload to canonical bytes for signing.
|
|
359
|
+
*/
|
|
360
|
+
serializePayload(payload: TransactionPayload): Uint8Array;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Port for audit logging (compliance).
|
|
364
|
+
*/
|
|
365
|
+
export interface AuditPort {
|
|
366
|
+
/**
|
|
367
|
+
* Append an audit record.
|
|
368
|
+
*/
|
|
369
|
+
append(record: Omit<AuditRecord, "recordId" | "previousHash" | "recordHash">): Promise<AuditRecord>;
|
|
370
|
+
/**
|
|
371
|
+
* Get audit records for an entity.
|
|
372
|
+
*/
|
|
373
|
+
getRecordsForEntity(entityId: string): Promise<readonly AuditRecord[]>;
|
|
374
|
+
/**
|
|
375
|
+
* Verify the integrity of the audit chain.
|
|
376
|
+
*/
|
|
377
|
+
verifyChainIntegrity(): Promise<{
|
|
378
|
+
valid: boolean;
|
|
379
|
+
lastValidRecord: string | null;
|
|
380
|
+
errorMessage: string | null;
|
|
381
|
+
}>;
|
|
382
|
+
/**
|
|
383
|
+
* Get the latest audit record.
|
|
384
|
+
*/
|
|
385
|
+
getLatestRecord(): Promise<AuditRecord | null>;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Port for Raft consensus operations (HA cluster).
|
|
389
|
+
*/
|
|
390
|
+
export interface RaftPort {
|
|
391
|
+
/**
|
|
392
|
+
* Get the current node state.
|
|
393
|
+
*/
|
|
394
|
+
getNodeState(): Promise<RaftNode>;
|
|
395
|
+
/**
|
|
396
|
+
* Check if this node is the leader.
|
|
397
|
+
*/
|
|
398
|
+
isLeader(): Promise<boolean>;
|
|
399
|
+
/**
|
|
400
|
+
* Get the current leader ID (null if no leader).
|
|
401
|
+
*/
|
|
402
|
+
getLeaderId(): Promise<string | null>;
|
|
403
|
+
/**
|
|
404
|
+
* Propose a value to the cluster (must be leader).
|
|
405
|
+
*/
|
|
406
|
+
propose<T>(value: T): Promise<{
|
|
407
|
+
accepted: boolean;
|
|
408
|
+
term: bigint;
|
|
409
|
+
}>;
|
|
410
|
+
/**
|
|
411
|
+
* Wait for leadership (blocks until this node becomes leader).
|
|
412
|
+
*/
|
|
413
|
+
waitForLeadership(timeoutMs: number): Promise<boolean>;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Port for time operations (enables deterministic testing).
|
|
417
|
+
*/
|
|
418
|
+
export interface ClockPort {
|
|
419
|
+
/**
|
|
420
|
+
* Get the current timestamp in milliseconds.
|
|
421
|
+
*/
|
|
422
|
+
now(): number;
|
|
423
|
+
/**
|
|
424
|
+
* Generate a UUID v4.
|
|
425
|
+
*/
|
|
426
|
+
uuid(): string;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Domain events emitted by the settlement layer.
|
|
430
|
+
*/
|
|
431
|
+
export type SettlementEvent = {
|
|
432
|
+
type: "transaction:submitted";
|
|
433
|
+
tx: LedgerTransaction;
|
|
434
|
+
} | {
|
|
435
|
+
type: "proof:base:generated";
|
|
436
|
+
proof: BaseProof;
|
|
437
|
+
} | {
|
|
438
|
+
type: "proof:tier1:generated";
|
|
439
|
+
proof: Tier1Proof;
|
|
440
|
+
} | {
|
|
441
|
+
type: "proof:tier2:generated";
|
|
442
|
+
proof: Tier2BlockProof;
|
|
443
|
+
} | {
|
|
444
|
+
type: "settlement:initiated";
|
|
445
|
+
entry: OutboxEntry;
|
|
446
|
+
} | {
|
|
447
|
+
type: "settlement:completed";
|
|
448
|
+
entry: OutboxEntry;
|
|
449
|
+
result: SolanaSettlementResult | BitcoinSettlementResult | FiatSettlementResult;
|
|
450
|
+
} | {
|
|
451
|
+
type: "settlement:failed";
|
|
452
|
+
entry: OutboxEntry;
|
|
453
|
+
error: string;
|
|
454
|
+
} | {
|
|
455
|
+
type: "deposit:detected";
|
|
456
|
+
event: DepositEvent;
|
|
457
|
+
} | {
|
|
458
|
+
type: "deposit:mirrored";
|
|
459
|
+
event: DepositEvent;
|
|
460
|
+
tx: LedgerTransaction;
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* Port for domain event emission (observable pattern).
|
|
464
|
+
*/
|
|
465
|
+
export interface EventEmitterPort {
|
|
466
|
+
/**
|
|
467
|
+
* Emit a domain event.
|
|
468
|
+
*/
|
|
469
|
+
emit(event: SettlementEvent): void;
|
|
470
|
+
/**
|
|
471
|
+
* Subscribe to domain events.
|
|
472
|
+
*/
|
|
473
|
+
subscribe(handler: (event: SettlementEvent) => void): {
|
|
474
|
+
unsubscribe: () => void;
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* Subscribe to a specific event type.
|
|
478
|
+
*/
|
|
479
|
+
on<T extends SettlementEvent["type"]>(eventType: T, handler: (event: Extract<SettlementEvent, {
|
|
480
|
+
type: T;
|
|
481
|
+
}>) => void): {
|
|
482
|
+
unsubscribe: () => void;
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../../src/stark-settlement/domain/ports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,sBAAs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EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG;QACpD,WAAW,EAAE,MAAM,IAAI,CAAC;KACzB,CAAC;IAEF;;OAEG;IACH,EAAE,CAAC,CAAC,SAAS,eAAe,CAAC,MAAM,CAAC,EAClC,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,eAAe,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,KAAK,IAAI,GAC9D;QAAE,WAAW,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CAChC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port Interfaces for Aggregated STARK Settlement Layer (Hexagonal Architecture)
|
|
3
|
+
*
|
|
4
|
+
* Ports define the boundaries of the domain:
|
|
5
|
+
* - Input ports: How the application receives requests
|
|
6
|
+
* - Output ports: How the application interacts with external systems
|
|
7
|
+
*
|
|
8
|
+
* All ports are pure interfaces with no implementation details.
|
|
9
|
+
* Adapters in the infrastructure layer implement these ports.
|
|
10
|
+
*
|
|
11
|
+
* @see modules/p2mr/src/ports.ts for similar hexagonal pattern
|
|
12
|
+
* @see docs/adr/ADR-0001-hexagonal-architecture.md
|
|
13
|
+
*/
|
|
14
|
+
export {};
|