pub struct Saga {
pub operation_id: Uuid,
pub operation_kind: OperationKind,
pub state: SagaStateEnum,
pub blinded_secrets: Vec<PublicKey>,
pub input_ys: Vec<PublicKey>,
pub quote_id: Option<String>,
pub created_at: u64,
pub updated_at: u64,
}Expand description
Persisted saga for recovery
Fields§
§operation_id: UuidOperation ID (correlation key)
operation_kind: OperationKindOperation kind (swap, mint, melt)
state: SagaStateEnumCurrent saga state (operation-specific)
blinded_secrets: Vec<PublicKey>Blinded secrets (B values) from output blinded messages
input_ys: Vec<PublicKey>Y values (public keys) from input proofs
quote_id: Option<String>Quote ID for melt operations (used for payment status lookup during recovery) None for swap operations
created_at: u64Unix timestamp when saga was created
updated_at: u64Unix timestamp when saga was last updated
Implementations§
Source§impl Saga
impl Saga
Sourcepub fn new_swap(
operation_id: Uuid,
state: SwapSagaState,
blinded_secrets: Vec<PublicKey>,
input_ys: Vec<PublicKey>,
) -> Self
pub fn new_swap( operation_id: Uuid, state: SwapSagaState, blinded_secrets: Vec<PublicKey>, input_ys: Vec<PublicKey>, ) -> Self
Create new swap saga
Sourcepub fn update_swap_state(&mut self, new_state: SwapSagaState)
pub fn update_swap_state(&mut self, new_state: SwapSagaState)
Update swap saga state
Sourcepub fn new_melt(
operation_id: Uuid,
state: MeltSagaState,
input_ys: Vec<PublicKey>,
blinded_secrets: Vec<PublicKey>,
quote_id: String,
) -> Self
pub fn new_melt( operation_id: Uuid, state: MeltSagaState, input_ys: Vec<PublicKey>, blinded_secrets: Vec<PublicKey>, quote_id: String, ) -> Self
Create new melt saga
Sourcepub fn update_melt_state(&mut self, new_state: MeltSagaState)
pub fn update_melt_state(&mut self, new_state: MeltSagaState)
Update melt saga state
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Saga
impl<'de> Deserialize<'de> for Saga
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Saga
impl StructuralPartialEq for Saga
Auto Trait Implementations§
impl Freeze for Saga
impl RefUnwindSafe for Saga
impl Send for Saga
impl Sync for Saga
impl Unpin for Saga
impl UnwindSafe for Saga
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more