import { providers , BigNumberish } from "ethers" ; import { AppRegistry , DefaultApp , AppInstanceJson } from "./app" ; import { Address , Bytes32 , DecString , PublicIdentifier } from "./basic" ; import { ChannelProviderConfig , IChannelProvider } from "./channelProvider" ; import { IChannelSigner } from "./crypto" ; import { EventName , EventPayload } from "./events" ; import { ILogger , ILoggerService } from "./logger" ; import { IMessagingService } from "./messaging" ; import { NodeResponses } from "./node" ; import { MethodResults as mR , MethodParams as mP } from "./methods" ; import { IStoreService } from "./store" ; import { MiddlewareMap } from "./middleware" ; import { PublicParams as P , PublicResults as R } from "./public" ; import { AppAction } from "." ; export interface ClientOptions { channelProvider ? : IChannelProvider ; ethProvider ? : providers . JsonRpcProvider ; ethProviderUrl ? : string ; chainId ? : number ; signer ? : string | IChannelSigner ; store ? : IStoreService ; logger ? : ILogger ; loggerService ? : ILoggerService ; logLevel ? : number ; middlewareMap ? : MiddlewareMap ; messaging ? : IMessagingService ; nodeUrl ? : string ; messagingUrl ? : string ; skipSync ? : boolean ; skipInitStore ? : boolean ; watcherEnabled ? : boolean ; } export interface IConnextClient { appRegistry : AppRegistry ; chainId : number ; channelProvider : IChannelProvider ; config : NodeResponses . GetConfig ; ethProvider : providers . JsonRpcProvider ; messaging : IMessagingService ; multisigAddress : Address ; nodeIdentifier : PublicIdentifier ; nodeSignerAddress : Address ; publicIdentifier : PublicIdentifier ; signerAddress : Address ; store : IStoreService ; conditionalTransfer ( params ) : Promise < R . ConditionalTransfer > ; deposit ( params ) : Promise < R . Deposit > ; resolveCondition ( params ) : Promise < R . ResolveCondition > ; swap ( params ) : Promise < R . Swap > ; transfer ( params ) : Promise < R . ConditionalTransfer > ; withdraw ( params ) : Promise < R . Withdraw > ; on < T extends EventName > ( event , callback , filter ? ) : void ; once < T extends EventName > ( event , callback , filter ? ) : void ; waitFor < T extends EventName > ( event , timeout , filter ? ) : Promise < EventPayload [ T ] > ; emit < T extends EventName > ( event , payload ) : boolean ; off ( ) : void ; channelProviderConfig ( ) : Promise < ChannelProviderConfig > ; checkDepositRights ( params ) : Promise < R . CheckDepositRights > ; requestDepositRights ( params ) : Promise < R . RequestDepositRights > ; rescindDepositRights ( params ) : Promise < R . RescindDepositRights > ; restart ( ) : Promise < void > ; restoreState ( ) : Promise < void > ; initiateChallenge ( params ) : Promise < R . InitiateChallenge > ; cancelChallenge ( params ) : Promise < R . CancelChallenge > ; isAvailable ( ) : Promise < void > ; getChannel ( ) : Promise < NodeResponses . GetChannel > ; getLinkedTransfer ( paymentId ) : Promise < NodeResponses . GetLinkedTransfer > ; getHashLockTransfer ( lockHash , assetId ? ) : Promise < NodeResponses . GetHashLockTransfer > ; getSignedTransfer ( paymentId ) : Promise < NodeResponses . GetSignedTransfer > ; getGraphTransfer ( paymentId ) : Promise < NodeResponses . GetSignedTransfer > ; getAppRegistry ( appDetails ? ) : Promise < AppRegistry | DefaultApp | undefined > ; createChannel ( ) : Promise < NodeResponses . CreateChannel > ; subscribeToSwapRates ( from , to , callback ) : Promise < any > ; getLatestSwapRate ( from , to ) : Promise < DecString > ; unsubscribeToSwapRates ( from , to ) : Promise < void > ; requestCollateral ( tokenAddress , amount ? ) : Promise < R . RequestCollateral > ; getRebalanceProfile ( assetId ? ) : Promise < NodeResponses . GetRebalanceProfile | undefined > ; getTransferHistory ( ) : Promise < NodeResponses . GetTransferHistory > ; reclaimPendingAsyncTransfers ( ) : Promise < void > ; deployMultisig ( ) : Promise < mR . DeployStateDepositHolder > ; getStateChannel ( ) : Promise < mR . GetStateChannel > ; getFreeBalance ( assetId ? ) : Promise < mR . GetFreeBalanceState > ; getAppInstances ( ) : Promise < AppInstanceJson [ ] > ; getAppInstance ( appIdentityHash ) : Promise < mR . GetAppInstanceDetails | undefined > ; getProposedAppInstances ( multisigAddress ? ) : Promise < mR . GetProposedAppInstances | undefined > ; getProposedAppInstance ( appIdentityHash ) : Promise < mR . GetProposedAppInstance | undefined > ; proposeInstallApp ( params ) : Promise < mR . ProposeInstall > ; installApp ( appIdentityHash ) : Promise < mR . Install > ; rejectInstallApp ( appIdentityHash , reason ? ) : Promise < mR . Uninstall > ; takeAction ( appIdentityHash , action ) : Promise < mR . TakeAction > ; uninstallApp ( appIdentityHash , action ? ) : Promise < mR . Uninstall > ; }