lotus-sdk
Version:
Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem
34 lines • 1.16 kB
TypeScript
import { EventEmitter } from 'events';
import { MuSigSession, MuSigSessionPhase } from '../../bitcore/musig2/session.js';
export interface StateTransitionEvent {
sessionId: string;
fromState: MuSigSessionPhase;
toState: MuSigSessionPhase;
reason: string;
timestamp: number;
}
export declare class SessionStateMachine extends EventEmitter {
private session;
private readonly validTransitions;
constructor(session: MuSigSession);
get state(): MuSigSessionPhase;
get sessionId(): string;
private isValidState;
canTransitionTo(toState: MuSigSessionPhase): boolean;
isTerminal(): boolean;
transition(toState: MuSigSessionPhase, reason?: string): void;
getValidNextStates(): MuSigSessionPhase[];
getStateDescription(): string;
abort(reason: string): boolean;
getDiagnostics(): {
sessionId: string;
currentState: MuSigSessionPhase;
stateDescription: string;
isTerminal: boolean;
validNextStates: MuSigSessionPhase[];
createdAt: number;
updatedAt: number;
age: number;
};
}
//# sourceMappingURL=session-state-machine.d.ts.map