import { AppRegistry } from "./app"; import { providers } 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"; export interface AsyncNodeInitializationParameters extends NodeInitializationParameters { ethProvider: providers.JsonRpcProvider; chainId: number; messaging: IMessagingService; messagingUrl?: string; store?: IStoreService; signer?: IChannelSigner; channelProvider?: IChannelProvider; 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: string): Promise; releaseLock(lockName: string, lockValue: string): Promise; appRegistry( appDetails?: | { name: string; chainId: number; } | { appDefinitionAddress: Address }, ): Promise; getConfig(): Promise; createChannel(): Promise; clientCheckIn(): Promise; getChannel(): Promise; getLatestSwapRate(from: Address, to: Address): Promise; getRebalanceProfile(assetId?: Address): Promise; getHashLockTransfer( lockHash: Bytes32, assetId?: Address, ): Promise; installPendingTransfers(): Promise; getTransferHistory(userAddress?: Address): Promise; getLatestWithdrawal(): Promise; installConditionalTransferReceiverApp( paymentId: string, conditionType: ConditionalTransferTypes, ): Promise; requestCollateral(assetId: Address): Promise; fetchLinkedTransfer(paymentId: Bytes32): Promise; fetchSignedTransfer(paymentId: Bytes32): Promise; fetchGraphTransfer(paymentId: Bytes32): Promise; resolveLinkedTransfer(paymentId: Bytes32): Promise; resolveSignedTransfer(paymentId: Bytes32): Promise; restoreState(userAddress: Address): Promise; subscribeToSwapRates(from: Address, to: Address, callback: any): Promise; unsubscribeFromSwapRates(from: Address, to: Address): Promise; }