raiden-ts
Version:
Raiden Light Client Typescript/Javascript SDK
24 lines (23 loc) • 1.42 kB
TypeScript
import type { Observable } from 'rxjs';
import type { RaidenAction } from '../../actions';
import { messageReceived, messageSend } from '../../messages/actions';
import type { RaidenState } from '../../state';
import type { RaidenEpicDeps } from '../../types';
import { matrixPresence, rtcChannel } from '../actions';
/**
* Creates and manages WebRTC connection requests
*
* For whitelisted peers, it'll always listen for 'offer' messages and answer to try to establish
* the RTC channel. If a new one comes while the previous is waiting, it'll teardown the previous
* request and answer the new.
* For Raiden channel partners (on startup/channelOpen), targets, initiators and also upon new
* messageSend.requests, it's checked if the peer is online, and in parallel with any callee
* handling, a call is initiated, times out after a few seconds and is retried a few times (to be
* retried again in any of the above events). The winner channel of the callee/caller race is used.
*
* @param action$ - Observable of RaidenActions
* @param deps - Epics dependencies
* @returns Observable of rtcChannel|messageSend.request|messageReceived|matrixPresence.request
* actions
*/
export declare function rtcConnectionManagerEpic(action$: Observable<RaidenAction>, {}: Observable<RaidenState>, deps: RaidenEpicDeps): Observable<rtcChannel | messageSend.request | messageReceived | matrixPresence.request>;