import { ChannelUpdate, FullChannelState, FullTransferState } from "./channel"; import { ConditionalTransferRoutingCompletePayload } from "./engine"; import { EngineError, NodeError, MessagingError, ProtocolError, Result, RouterError, VectorError } from "./error"; import { LockInformation } from "./lock"; import { EngineParams, NodeResponses } from "./schemas"; export declare type CheckInInfo = { channelAddress: string; }; export declare type CheckInResponse = { aliceIdentifier: string; bobIdentifier: string; chainId: number; channelAddress: string; }; export interface IBasicMessaging { connect(): Promise; disconnect(): Promise; publish(subject: string, data: any): Promise; subscribe(subject: string, cb: (data: any) => any): Promise; unsubscribe(subject: string): Promise; flush(): Promise; request(subject: string, timeout: number, data: any): Promise; } declare type TransferQuoteRequest = Omit; export interface IMessagingService extends IBasicMessaging { onReceiveLockMessage(myPublicIdentifier: string, callback: (lockInfo: Result, from: string, inbox: string) => void): Promise; sendLockMessage(lockInfo: Result, to: string, from: string, timeout?: number, numRetries?: number): Promise>; respondToLockMessage(inbox: string, lockInformation: Result): Promise; onReceiveProtocolMessage(myPublicIdentifier: string, callback: (result: Result<{ update: ChannelUpdate; previousUpdate: ChannelUpdate; }, ProtocolError>, from: string, inbox: string) => void): Promise; sendProtocolMessage(channelUpdate: ChannelUpdate, previousUpdate?: ChannelUpdate, timeout?: number, numRetries?: number): Promise; previousUpdate: ChannelUpdate; }, ProtocolError | MessagingError>>; respondToProtocolMessage(inbox: string, channelUpdate: ChannelUpdate, previousUpdate?: ChannelUpdate): Promise; respondWithProtocolError(inbox: string, error: ProtocolError): Promise; sendSetupMessage(setupInfo: Result, EngineError>, to: string, from: string, timeout?: number, numRetries?: number): Promise>; onReceiveSetupMessage(publicIdentifier: string, callback: (setupInfo: Result, EngineError>, from: string, inbox: string) => void): Promise; respondToSetupMessage(inbox: string, params: Result<{ channelAddress: string; }, EngineError>): Promise; sendRestoreStateMessage(restoreData: Result<{ chainId: number; } | { channelAddress: string; }, EngineError>, to: string, from: string, timeout?: number, numRetries?: number): Promise>; onReceiveRestoreStateMessage(publicIdentifier: string, callback: (restoreData: Result<{ chainId: number; } | { channelAddress: string; }, EngineError>, from: string, inbox: string) => void): Promise; respondToRestoreStateMessage(inbox: string, restoreData: Result<{ channel: FullChannelState; activeTransfers: FullTransferState[]; } | void, EngineError>): Promise; sendIsAliveMessage(isAlive: Result<{ channelAddress: string; skipCheckIn?: boolean; }, EngineError>, to: string, from: string, timeout?: number, numRetries?: number): Promise>; onReceiveIsAliveMessage(publicIdentifier: string, callback: (isAlive: Result<{ channelAddress: string; skipCheckIn?: boolean; }, EngineError>, from: string, inbox: string) => void): Promise; respondToIsAliveMessage(inbox: string, params: Result<{ channelAddress: string; }, EngineError>): Promise; sendRequestCollateralMessage(requestCollateralParams: Result, to: string, from: string, timeout?: number, numRetries?: number): Promise>; onReceiveRequestCollateralMessage(publicIdentifier: string, callback: (params: Result, from: string, inbox: string) => void): Promise; respondToRequestCollateralMessage(inbox: string, params: Result<{ message?: string; }, EngineError>): Promise; onReceiveWithdrawalQuoteMessage(myPublicIdentifier: string, callback: (quoteRequest: Result, from: string, inbox: string) => void): Promise; sendWithdrawalQuoteMessage(quoteRequest: Result, to: string, from: string, timeout?: number, numRetries?: number): Promise>; respondToWithdrawalQuoteMessage(inbox: string, quote: Result): Promise; sendRouterConfigMessage(configRequest: Result, to: string, from: string, timeout?: number, numRetries?: number): Promise>; sendTransferQuoteMessage(quoteRequest: Result, to: string, from: string, timeout?: number, numRetries?: number): Promise>; publishTransferRoutingCompleteMessage(to: string, from: string, data: Result, VectorError>): Promise; onReceiveTransferRoutingCompleteMessage(myPublicIdentifier: string, callback: (data: Result, NodeError>, from: string, inbox: string) => void): Promise; publishWithdrawalSubmittedMessage(to: string, from: string, data: Result<{ channelAddress: string; txHash: string; transferId: string; }, VectorError>): Promise; onReceiveWithdrawalSubmittedMessage(myPublicIdentifier: string, callback: (submitted: Result<{ channelAddress: string; txHash: string; transferId: string; }, NodeError>, from: string, inbox: string) => void): Promise; } export {}; //# sourceMappingURL=messaging.d.ts.map