import { SignatureEntry, SignedState, State, Uint256 } from '../types'; import { BaseObjective, BaseObjectiveEvent } from './objective'; export declare const MAX_WAITING_TIME = 5000; export declare type OpenChannelEvent = BaseObjectiveEvent & ({ type: 'Crank'; } | { type: 'StatesReceived'; states: SignedState[]; } | { type: 'FundingUpdated'; amount: Uint256; finalized: boolean; } | { type: 'DepositSubmitted'; tx: string; attempt: number; submittedAt: number; } | { type: 'Approval'; }); export declare type SignedStateHash = { hash: string; signatures: SignatureEntry[]; }; export declare enum WaitingFor { approval = "DirectFunder.approval", theirPreFundSetup = "DirectFunder.theirPreFundSetup", safeToDeposit = "DirectFunder.safeToDeposit", channelFunded = "DirectFunder.channelFunded", theirPostFundState = "DirectFunder.theirPostFundSetup" } export declare type OpenChannelObjective = BaseObjective & { status: WaitingFor | 'success' | 'error'; approved: boolean; channelId: string; openingState: State; myIndex: number; preFundSetup: SignedStateHash; funding: { amount: Uint256; finalized: boolean; }; fundingRequest: { tx: string; attempts: number; submittedAt: number; } | undefined; postFundSetup: SignedStateHash; }; export declare function initialize(openingState: State | SignedState, myIndex: number, approved?: boolean): OpenChannelObjective; export declare type Action = { type: 'sendStates'; states: SignedState[]; } | { type: 'deposit'; amount: Uint256; } | { type: 'handleError'; error: Error; }; export declare type OpenChannelResult = { objective: OpenChannelObjective; actions: Action[]; }; export declare function openChannelCranker(currentObjectiveState: OpenChannelObjective, event: OpenChannelEvent, myPrivateKey: string): OpenChannelResult; declare type FundingMilestone = { targetBefore: Uint256; targetAfter: Uint256; targetTotal: Uint256; }; export declare const utils: { fundingMilestone(state: State, destination: string): FundingMilestone; }; export declare type ErrorModes = { message: 'NonParticipantSignature'; signature: SignatureEntry; } | { message: 'ReceivedUnexpectedState'; received: string; expected: [string, string]; } | { message: 'TimedOutWhileFunding'; now: number; submittedAt: number; } | { message: 'UnexpectedEvent'; event: any; }; export {}; //# sourceMappingURL=direct-funder.d.ts.map