import { FundingStrategy } from '@statechannels/client-api-schema'; import { ChannelConstants, Participant, PrivateKey, SignedStateWithHash, SimpleAllocation, State, CloseChannel, DefundChannel, OpenChannel, Destination } from '@statechannels/wallet-core'; import { SignedState as WireState, Payload } from '@statechannels/wire-format'; import { WalletObjective } from '../../../models/objective'; import { SigningWallet } from '../../../models/signing-wallet'; import { Store } from '../../store'; import { Bytes32 } from '../../../type-aliases'; /** * Arguments for constructing a TestChannel * * @param finalFrom - a turnnumber where the channel bceoms finalized. All subsequent states willl be final and have this turn number */ interface TestChannelArgs { aBal?: number; bBal?: number; finalFrom?: number; fundingStrategy?: FundingStrategy; fundingLedgerChannelId?: Bytes32; } export declare type Bals = [string, number][] | [number, number]; /** A two-party channel between Alice and Bob, with state history. For testing purposes. */ export declare class TestChannel { participantA: Participant; participantB: Participant; signingWalletA: SigningWallet; signingWalletB: SigningWallet; startBals: Bals; channelNonce: number; finalFrom?: number; fundingStrategy: FundingStrategy; fundingLedgerChannelId: Bytes32 | undefined; static maximumNonce: number; asset: import("@statechannels/wallet-core").Address; get participants(): Participant[]; get signingWallets(): SigningWallet[]; static create(args: TestChannelArgs): TestChannel; protected constructor(args: TestChannelArgs); /** * Gives the nth state in the history, signed by the correct participant * * @param n - the index of the state in the history * * Note - in cases where participants double-sign the same states, n might _not_ * be the turnNum */ state(n: number, bals?: Bals): State; signedStateWithHash(n: number, bals?: Bals, signedBy?: SignedBy): SignedStateWithHash; /** * Gives the nth state in the history, signed by the correct participant */ wireState(n: number, bals?: Bals, signedBy?: SignedBy): WireState; wirePayload(n: number, bals?: Bals, signedBy?: SignedBy): Payload; get startOutcome(): SimpleAllocation; get isLedger(): boolean; toOutcome(bals: Bals): SimpleAllocation; get signingKeyA(): PrivateKey; get signingKeyB(): PrivateKey; get signingKeys(): PrivateKey[]; get channelConstants(): ChannelConstants; get channelId(): Destination; get openChannelObjective(): OpenChannel; closeChannelObjective(txSubmitterOrder?: number[]): CloseChannel; defundChannelObjective(): DefundChannel; get openChannelPayload(): Payload; get getChannelRequest(): Payload; static mergePayloads(payload1: Payload, payload2: Payload): Payload; static get emptyPayload(): Payload; get startBal(): number; insertState(store: Store, state: StateWithBals | number, bals?: Bals): Promise; /** * Calls addSigningKey, pushMessage, updateFunding, on the supplied store, patches the fundingStrategy, and adds the OpenChannel objective */ insertInto(store: Store, args?: InsertionParams): Promise>; } export interface InsertionParams { participant?: 0 | 1; states?: number[] | StateWithBals[]; funds?: number; bals?: Bals; } export declare type SignedBy = 0 | 1 | 'both'; export interface StateWithBals { turn: number; bals: Bals; signedBy: SignedBy; } export {}; //# sourceMappingURL=test-channel.d.ts.map