import { AppRegistry } from "./app" ; import { providers , BigNumberish } from "ethers" ; import { Address , Bytes32 , DecString , PublicIdentifier , StringMapping , Transaction , UrlString , } from "./basic" ; import { IChannelProvider } from "./channelProvider" ; import { IChannelSigner } from "./crypto" ; import { NodeResponses } from "./node" ; import { IMessagingService } from "./messaging" ; import { ILoggerService } from "./logger" ; import { IStoreService } from "./store" ; import { ConditionalTransferTypes } from "./transfers" ; import { MiddlewareMap } from "./middleware" ; export interface AsyncNodeInitializationParameters extends NodeInitializationParameters { ethProvider : providers . JsonRpcProvider ; chainId : number ; messaging : IMessagingService ; messagingUrl ? : string ; store ? : IStoreService ; signer ? : IChannelSigner ; channelProvider ? : IChannelProvider ; middlewareMap ? : MiddlewareMap ; skipSync ? : boolean ; } export interface NodeInitializationParameters { chainId : number ; nodeUrl : string ; messaging : IMessagingService ; logger ? : ILoggerService ; userIdentifier ? : Address ; nodeIdentifier ? : Address ; channelProvider ? : IChannelProvider ; } export interface INodeApiClient { nodeUrl : UrlString ; chainId : number ; messaging : IMessagingService ; latestSwapRates : StringMapping ; log : ILoggerService ; userIdentifier : PublicIdentifier | undefined ; nodeIdentifier : PublicIdentifier | undefined ; config : NodeResponses . GetConfig | undefined ; channelProvider : IChannelProvider | undefined ; acquireLock ( lockName ) : Promise < string > ; releaseLock ( lockName , lockValue ) : Promise < void > ; appRegistry ( appDetails ? ) : Promise < AppRegistry > ; getConfig ( ) : Promise < NodeResponses . GetConfig > ; createChannel ( ) : Promise < NodeResponses . CreateChannel > ; clientCheckIn ( ) : Promise < void > ; getChannel ( ) : Promise < NodeResponses . GetChannel > ; getLatestSwapRate ( from , to ) : Promise < DecString > ; getRebalanceProfile ( assetId ? ) : Promise < NodeResponses . GetRebalanceProfile > ; getHashLockTransfer ( lockHash , assetId ? ) : Promise < NodeResponses . GetHashLockTransfer > ; installPendingTransfers ( ) : Promise < NodeResponses . GetPendingAsyncTransfers > ; getTransferHistory ( userAddress ? ) : Promise < NodeResponses . GetTransferHistory > ; getLatestWithdrawal ( ) : Promise < Transaction > ; installConditionalTransferReceiverApp ( paymentId , conditionType ) : Promise < NodeResponses . InstallConditionalTransferReceiverApp > ; requestCollateral ( assetId , amount ? ) : Promise < NodeResponses . RequestCollateral > ; fetchLinkedTransfer ( paymentId ) : Promise < NodeResponses . GetLinkedTransfer > ; fetchSignedTransfer ( paymentId ) : Promise < NodeResponses . GetSignedTransfer > ; fetchGraphTransfer ( paymentId ) : Promise < NodeResponses . GetSignedTransfer > ; resolveLinkedTransfer ( paymentId ) : Promise < NodeResponses . ResolveLinkedTransfer > ; resolveSignedTransfer ( paymentId ) : Promise < NodeResponses . ResolveSignedTransfer > ; restoreState ( userAddress ) : Promise < NodeResponses . ChannelRestore > ; subscribeToSwapRates ( from , to , callback ) : Promise < void > ; unsubscribeFromSwapRates ( from , to ) : Promise < void > ; cancelChallenge ( appIdentityHash , signature ) : Promise < NodeResponses . CancelChallenge > ; }