import { DefundChannel, CloseChannel } from '@statechannels/wallet-core'; import { Transaction } from 'objection'; import { Logger } from 'pino'; import { Channel } from '../models/channel'; import { WalletObjective } from '../models/objective'; import { Store } from '../engine/store'; import { EngineResponse } from '../engine/engine-response'; /** * DefunderResult type is the return value of the crank method. The return value of the crank method * should be a boolean in the medium/long term. * * Why is that? * The boolean will represent whether the Defunder protocol has reached the terminal point. * This is the pattern established by the ChannelOpener protocol. The caller of the Defunder * protocol should not be concerned with internal details of whether a transaction is submitted. * * What about didSubmitTransaction? * In the short term, the ChannelDefunder protocol (which invoked the Defunder protocol) completes * upon transaction submission. ChannelDefunder protocol will not be used in the medium term. * Most likely, a ChallengeAndWithdraw protocol (which invokes this Defunder protocol) will * make the ChannelDefunder protocol aboslete. */ export declare type DefunderResult = { isChannelDefunded: boolean; didSubmitTransaction: boolean; }; declare type Objective = WalletObjective | WalletObjective; export declare class Defunder { private store; private logger; private timingMetrics; constructor(store: Store, logger: Logger, timingMetrics?: boolean); static create(store: Store, logger: Logger, timingMetrics?: boolean): Defunder; crank(channel: Channel, objective: Objective, response: EngineResponse, tx: Transaction): Promise; private directDefunder; private ledgerDefunder; private requestLedgerDefunding; } /** * Assume that we are going to submit collaborative transaction(s) unless: * 1. There is an agreed upon order of transaction submitters. * 2. There is a transaction submitter before us who has funds in the channel. */ export declare function shouldSubmitCollaborativeTx(channel: Channel, objective: Objective): boolean; export {}; //# sourceMappingURL=defunder.d.ts.map