import { Model, TransactionOrKnex } from 'objection'; import { Uint256, Destination, Bytes32 } from '../type-aliases'; export declare type LedgerRequestStatus = 'queued' | 'cancelled' | 'pending' | 'succeeded' | 'insufficient-funds' | 'inconsistent' | 'failed'; export interface LedgerRequestType { ledgerChannelId: Destination; channelToBeFunded: Destination; status: LedgerRequestStatus; amountA: Uint256; amountB: Uint256; lastSeenAgreedState: number | null; missedOpportunityCount: number; type: 'fund' | 'defund'; } export interface RichLedgerRequest extends LedgerRequestType { isPending: boolean; isQueued: boolean; isFund: boolean; isDefund: boolean; totalAmount: Uint256; $id: any; } export declare class LedgerRequest extends Model implements LedgerRequestType { channelToBeFunded: LedgerRequestType['channelToBeFunded']; ledgerChannelId: LedgerRequestType['ledgerChannelId']; status: LedgerRequestType['status']; type: LedgerRequestType['type']; amountA: Uint256; amountB: Uint256; missedOpportunityCount: number; lastSeenAgreedState: number | null; static tableName: string; static get idColumn(): string[]; static getRequest(channelToBeFunded: Bytes32, type: 'fund' | 'defund', tx: TransactionOrKnex): Promise; static setRequest(request: Omit & { missedOpportunityCount?: number; lastSeenAgreedState?: null | number; }, tx: TransactionOrKnex): Promise; markAsFailed(tx: TransactionOrKnex): Promise; static setRequestStatus(channelToBeFunded: Bytes32, type: 'fund' | 'defund', status: LedgerRequestStatus, tx: TransactionOrKnex): Promise; static getActiveRequests(ledgerChannelId: string, tx: TransactionOrKnex): Promise; static ledgersWithNewRequestsIds(tx: TransactionOrKnex): Promise; static saveAll(requests: LedgerRequest[], tx: TransactionOrKnex): Promise; static requestLedgerFunding(channelToBeFunded: Destination, ledgerChannelId: Destination, amountA: Uint256, // amount to be removed from/added to participant 0's balance amountB: Uint256, // amount to be removed from/added to participant 0's balance tx: TransactionOrKnex): Promise; static requestLedgerDefunding(channelToBeFunded: Destination, ledgerChannelId: Destination, amountA: Uint256, // amount to be removed from/added to participant 0's balance amountB: Uint256, // amount to be removed from/added to participant 0's balance tx: TransactionOrKnex): Promise; get isFund(): boolean; get isDefund(): boolean; get isQueued(): boolean; get isPending(): boolean; get isActive(): boolean; get isTerminal(): boolean; static markLedgerRequestsSuccessful(requests: Destination[], type: 'fund' | 'defund', tx: TransactionOrKnex): Promise; get totalAmount(): Uint256; } //# sourceMappingURL=ledger-request.d.ts.map