raiden-ts
Version:
Raiden Light Client Typescript/Javascript SDK
66 lines (65 loc) • 3.52 kB
TypeScript
import type { Observable } from 'rxjs';
import type { RaidenAction } from '../../actions';
import { messageServiceSend } from '../../messages/actions';
import type { RaidenState } from '../../state';
import { matrixPresence } from '../../transport/actions';
import type { RaidenEpicDeps } from '../../types';
import type { iouClear, iouPersist } from '../actions';
import { pathFind, servicesValid } from '../actions';
/**
* Check if a transfer can be made and return a set of paths for it.
*
* @param action$ - Observable of pathFind.request actions
* @param state$ - Observable of RaidenStates
* @param deps - RaidenEpicDeps object
* @returns Observable of pathFind.{success|failure} actions
*/
export declare function pfsRequestEpic(action$: Observable<RaidenAction>, {}: Observable<RaidenState>, deps: RaidenEpicDeps): Observable<matrixPresence.request | pathFind.success | pathFind.failure | iouPersist | iouClear>;
/**
* Sends a [[PFSCapacityUpdate]] to PFSs on new deposit on our side of channels
*
* @param action$ - Observable of channelDeposit.success actions
* @param state$ - Observable of RaidenStates
* @param deps - Epics dependencies
* @param deps.log - Logger instance
* @param deps.address - Our address
* @param deps.network - Current Network
* @param deps.signer - Signer instance
* @param deps.config$ - Config observable
* @returns Observable of messageServiceSend.request actions
*/
export declare function pfsCapacityUpdateEpic({}: Observable<RaidenAction>, state$: Observable<RaidenState>, { log, address, network, signer, config$ }: RaidenEpicDeps): Observable<messageServiceSend.request>;
/**
* When monitoring a channel (either a new channel or a previously monitored one), send a matching
* PFSFeeUpdate to PFSs, so they can pick us for mediation
*
* @param action$ - Observable of channelMonitored actions
* @param state$ - Observable of RaidenStates
* @param deps - Raiden epic dependencies
* @param deps.log - Logger instance
* @param deps.address - Our address
* @param deps.network - Current network
* @param deps.signer - Signer instance
* @param deps.config$ - Config observable
* @param deps.mediationFeeCalculator - Calculator for mediation fees schedule
* @returns Observable of messageServiceSend.request actions
*/
export declare function pfsFeeUpdateEpic({}: Observable<RaidenAction>, state$: Observable<RaidenState>, { log, address, network, signer, config$, mediationFeeCalculator }: RaidenEpicDeps): Observable<messageServiceSend.request>;
/**
* Fetch & monitors ServiceRegistry's RegisteredService events, keep track of valid_till expiration
* and aggregate list of valid service addresses
*
* Notice this epic only deals with the events & addresses, and don't fetch URLs, which need to be
* fetched on-demand through [[pfsInfo]] & [[pfsListInfo]].
*
* @param action$ - Observable of RaidenActions
* @param state$ - Observable of RaidenStates
* @param deps - RaidenEpicDeps object
* @param deps.provider - Provider instance
* @param deps.serviceRegistryContract - ServiceRegistry contract instance
* @param deps.contractsInfo - Contracts info mapping
* @param deps.config$ - Config observable
* @param deps.init$ - Init$ tasks subject
* @returns Observable of servicesValid actions
*/
export declare function pfsServiceRegistryMonitorEpic(action$: Observable<RaidenAction>, state$: Observable<RaidenState>, { provider, serviceRegistryContract, contractsInfo, config$, init$ }: RaidenEpicDeps): Observable<servicesValid>;