onesec-bridge
Version:
A library for interacting with the onesec.to bridge
33 lines (32 loc) • 1 kB
TypeScript
import { BridgingPlan } from "..";
import type { About, EvmTx, Step, StepStatus, TransferId } from "../types";
/**
* Abstract base class for all bridging steps.
*
* Provides common functionality for step index management and status tracking.
* All concrete step implementations should extend this class.
*/
export declare abstract class BaseStep implements Step {
protected _plan?: BridgingPlan;
protected _index?: number;
protected _status: StepStatus;
abstract about(): About;
abstract run(): Promise<StepStatus>;
abstract expectedDurationMs(): number;
status(): StepStatus;
index(): number;
initialize(plan: BridgingPlan, index: number): void;
canRun(): boolean;
}
/**
* Interface for steps that can provide EVM transaction details.
*/
export interface GetEvmTx {
getEvmTx(): EvmTx | undefined;
}
/**
* Interface for steps that can provide transfer ID details.
*/
export interface GetTransferId {
getTransferId(): TransferId | undefined;
}