@renproject/rentx
Version:
XState Statemachines for tracking RenVM transactions reactively
50 lines (49 loc) • 1.21 kB
TypeScript
import RenJS from "@renproject/ren";
import { GatewaySession, GatewayTransaction } from "../types/transaction";
import { LockChain, MintChain } from "@renproject/interfaces";
export interface BurnMachineContext {
tx: GatewaySession;
sdk: RenJS;
providers: any;
toChainMap: {
[key in string]: (context: BurnMachineContext) => LockChain<any>;
};
fromChainMap: {
[key in string]: (context: BurnMachineContext) => MintChain<any>;
};
}
export interface BurnMachineSchema {
states: {
restoring: {};
created: {};
createError: {};
srcSettling: {};
srcConfirmed: {};
destInitiated: {};
};
}
export declare type BurnMachineEvent = {
type: "NOOP";
} | {
type: "RETRY";
} | {
type: "RESTORE";
} | {
type: "RELEASE_ERROR";
data: any;
} | {
type: "BURN_ERROR";
data: any;
} | {
type: "CONFIRMATION";
data: GatewayTransaction;
} | {
type: "CONFIRMED";
data: GatewayTransaction;
} | {
type: "RELEASED";
};
export declare const burnMachine: import("xstate").StateMachine<BurnMachineContext, BurnMachineSchema, BurnMachineEvent, {
value: any;
context: BurnMachineContext;
}>;