import { Allocation, ChannelResult, CreateChannelParams } from '@statechannels/client-api-schema'; import EventEmitter from 'eventemitter3'; import { Address } from '@statechannels/wallet-core'; import { MessageServiceFactory, MessageServiceInterface } from '../message-service/types'; import { IncomingWalletConfig } from '../engine'; import { ObjectiveResult, WalletEvents, UpdateChannelResult, CreateLedgerChannelParams } from './types'; export declare class Wallet extends EventEmitter { private _engine; private _chainService; private _chainNetworkId; private _logger; private _syncOptions; /** * Constructs a channel manager that will ensure objectives get accomplished by resending messages if needed. * @param incomingConfig The configuration object that specifies various options. * @param messageServiceFactory A function that returns a message service when passed in a handler. * @returns A channel manager. */ static create(incomingConfig: IncomingWalletConfig, messageServiceFactory: MessageServiceFactory): Promise; private _messageService; private _syncInterval; private _chainListener; private constructor(); /** * Pulls and stores the ForceMoveApp definition bytecode at the supplied blockchain address. * * @remarks * Storing the bytecode is necessary for the engine to verify ForceMoveApp transitions. * * @param appDefinition - An ethereum address where ForceMoveApp rules are deployed. * @returns A promise that resolves when the bytecode has been successfully stored. */ registerAppDefinition(appDefinition: string): Promise; /** * Creates a ledger channel * @param channelParams The parameters for the ledger channel * @param fundingStrategy The funding strategy to use * @returns An ObjectiveResult indicating success or the error that occured */ createLedgerChannel(channelParams: CreateLedgerChannelParams): Promise; /** * Approves an objective that has been proposed by another participant. * Once the objective has been approved progress can be made to completing the objective. * @remarks * This is used to "join" channels by approving a CreateChannel Objective. * @param objectiveIds The ids of the objective you want to approve. * @returns A promise that resolves to a collection of ObjectiveResult. */ approveObjectives(objectiveIds: string[]): Promise; /** Creates channels using the given parameters. * @param channelParameters The parameters to use for channel creation. A channel will be created for each entry in the array. * @returns A promise that resolves to a collection of ObjectiveResult. */ createChannels(channelParameters: CreateChannelParams[]): Promise; /** * Updates a channel with the given allocations and app data. * @param channelId The id of the channel to update. * @param allocations The updated allocations for the channel. * @param appData The updated appData for the channel. * @returns A promise that resolves to either a sucess result (which includes the updated channel) or * an error type that contains more information about the error. */ updateChannel(channelId: string, allocations: Allocation[], appData: string): Promise; private syncObjectives; /** Closes the specified channels * @param channelIds The ids of the channels to close. * @returns A promise that resolves to a collection of ObjectiveResult. */ closeChannels(channelIds: string[]): Promise; /** * Finds any approved objectives and attempts to make progress on them. * This is useful for restarting progress after a restart or crash. * @returns A collection of ObjectiveResults. There will be an ObjectiveResult for each approved objective found. */ jumpStartObjectives(): Promise; private emitEvents; /** * Emits events, sends messages and requests transactions based on the output of the engine. * @param output */ private handleEngineOutput; get messageService(): MessageServiceInterface; private createObjectiveDoneResult; /** * Registers any channels existing in the database with the chain service. * * @remarks * Enables the chain service to alert the engine of of any blockchain events for existing channels. * * @returns A promise that resolves when the channels have been successfully registered. */ private registerExistingChannelsWithChainService; private registerChannels; private createChainEventlistener; getSigningAddress(): Promise
; getChannels(): Promise; /** * Registers a peer with the message service so messages can be sent to the peer. * @param peerUrl The endpoint for the peer. */ registerPeerMessageService(peerUrl: string): Promise; destroy(): Promise; } //# sourceMappingURL=wallet.d.ts.map