import { Allocation, AssetOutcome } from '@statechannels/nitro-protocol'; import { Address, PrivateKey, SignedState, State, Uint256 } from '@statechannels/wallet-core'; import { providers } from 'ethers'; import { Logger } from 'pino'; import { Bytes32 } from '../type-aliases'; export declare type HoldingUpdatedArg = { channelId: Bytes32; asset: Address; amount: Uint256; }; export declare type AllocationUpdatedArg = { channelId: Bytes32; asset: Address; newHoldings: Uint256; externalPayouts: Allocation; internalPayouts: Allocation; newAssetOutcome: AssetOutcome; }; export declare type FundChannelArg = { channelId: Bytes32; asset: Address; expectedHeld: Uint256; amount: Uint256; }; export declare type ChannelFinalizedArg = { channelId: Bytes32; blockNumber: number; blockTimestamp: number; finalizedAt: number; }; export declare type ChallengeRegisteredArg = { channelId: string; finalizesAt: number; challengeStates: SignedState[]; }; export interface ChainEventSubscriberInterface { holdingUpdated(arg: HoldingUpdatedArg): T; allocationUpdated(arg: AllocationUpdatedArg): T; channelFinalized(arg: ChannelFinalizedArg): T; challengeRegistered(arg: ChallengeRegisteredArg): T; } interface ChainEventEmitterInterface { checkChainId(networkChainId: number): Promise; registerChannel(channelId: Bytes32, assets: Address[], listener: ChainEventSubscriberInterface): void; unregisterChannel(channelId: Bytes32): void; destructor(): void; } export declare type FundChannelRequest = { type: 'FundChannel'; } & FundChannelArg; export declare type ConcludeAndWithdrawRequest = { type: 'ConcludeAndWithdraw'; finalizationProof: SignedState[]; }; export declare type WithdrawRequest = { type: 'Withdraw'; state: State; }; export declare type ChallengeRequest = { type: 'Challenge'; challengeStates: SignedState[]; privateKey: PrivateKey; }; export declare type ChainRequest = FundChannelRequest | ConcludeAndWithdrawRequest | WithdrawRequest | ChallengeRequest; interface ChainModifierInterface { handleChainRequests(chainRequests: ChainRequest[]): Promise; fetchBytecode(address: string): Promise; } export declare type ChainServiceInterface = ChainModifierInterface & ChainEventEmitterInterface; export declare type AllowanceMode = 'PerDeposit' | 'MaxUint'; export declare type ChainServiceArgs = { provider: string; pk: string; pollingInterval?: number; allowanceMode: AllowanceMode; logger?: Logger; blockConfirmations?: number; }; export {}; //# sourceMappingURL=types.d.ts.map