Writable PRISM state interface extending PrismStateRead with event storage capabilities.
Adds methods to persist blockchain events to the state backend. Events are added without validation, allowing implementations to handle ordering and chain integrity according to their storage strategy.
Attributes
- Example
-
val state: PrismState = ??? val event: MySignedPrismEvent[CreateDidOP] = ??? for { _ <- state.addEvent(event) ssi <- state.getSSI(event.event.didPrism) } yield ssi - Companion
- object
- Graph
-
- Supertypes
- Known subtypes
-
class PrismStateInMemoryclass PrismStateMongoDB
- Self type
Members list
Value members
Abstract methods
Adds a signed PRISM event to the state.
Adds a signed PRISM event to the state.
Events are indexed without validation. Implementations may handle out-of-order events differently.
Attributes
Concrete methods
Adds an event after filtering out invalid ones.
Adds an event after filtering out invalid ones.
Only valid MySignedPrismEvent instances are added; invalid objects are silently ignored.
Attributes
Inherited methods
Fetches all events in the chain for the given DID.
Fetches all events in the chain for the given DID.
Attributes
- Returns
-
ZIO effect that may fail with
Throwable(RuntimeException if event hash missing or type validation fails) and succeeds with sequence of DID-related MySignedPrismEvent - Inherited from:
- PrismStateRead
Fetches all events in the chain for the given VDR reference.
Fetches all events in the chain for the given VDR reference.
Value parameters
- refVDR
-
The VDR reference to query
Attributes
- Returns
-
ZIO effect that may fail with
Throwable(RuntimeException if event hash missing or type validation fails) and succeeds with sequence of storage-related MySignedPrismEvent - Inherited from:
- PrismStateRead
Gets the current SSI state.
Gets the full SSIHistory for a SSI.
Gets the VDR state with full ownership validation.
Returns the last synced block timestamp.
Returns the last synced block timestamp.
Attributes
- Returns
-
Tuple of (epoch seconds, nanoseconds)
- Note
-
Current implementation returns current time (FIXME: should track actual sync state)
- Inherited from:
- PrismStateRead
Returns count of SSI DIDs in the state.
Returns count of SSI DIDs in the state.
Attributes
- Note
-
TODO: improve in specific implementations for better performance
- Inherited from:
- PrismStateRead
Returns count of VDRs in the state.
Returns count of VDRs in the state.
Attributes
- Note
-
TODO: improve in specific implementations for better performance
- Inherited from:
- PrismStateRead
Inherited and Abstract methods
Attributes
- Returns
-
EventCursor of the latest Event
- Inherited from:
- PrismStateRead
Gets a specific event by its EventHash.
Returns event references for a specific SSI DID.
Returns event references for a specific VDR.
Returns mapping of all SSI DIDs to their event references.
Returns mapping of all SSI DIDs to their event references.
Attributes
- Note
-
TODO: make it a Stream of (DIDSubject, Seq[EventRef])
- Inherited from:
- PrismStateRead
Returns mapping of all VDRs to their event references.
Returns mapping of all VDRs to their event references.
Attributes
- Note
-
TODO: make it a Stream of (RefVDR, Seq[EventRef])
- Inherited from:
- PrismStateRead