raiden-ts
Version:
Raiden Light Client Typescript/Javascript SDK
120 lines (119 loc) • 4.46 kB
TypeScript
import type { Observable } from 'rxjs';
import type { RaidenAction } from '../../actions';
import { messageSend } from '../../messages/actions';
import type { Processed } from '../../messages/types';
import { LockExpired, Unlock } from '../../messages/types';
import type { RaidenState } from '../../state';
import { matrixPresence } from '../../transport/actions';
import type { RaidenEpicDeps } from '../../types';
import type { Address } from '../../utils/types';
import { transfer, transferProcessed, transferSecret, transferSecretRequest, transferSigned, withdraw, withdrawCompleted, withdrawExpire, withdrawMessage } from '../actions';
import { Direction } from '../state';
/**
* Serialize creation and signing of BalanceProof-changing messages or actions
* Actions which change any data in any channel balance proof must only ever be created reading
* state inside the serialization flow provided by the concatMap, and also be composed and produced
* inside it (inner, subscribed observable)
*
* @param action$ - Observable of RaidenActions
* @param state$ - Observable of RaidenStates
* @param deps - RaidenEpicDeps
* @returns Observable of output actions for this epic
*/
export declare function transferGenerateAndSignEnvelopeMessageEpic(action$: Observable<RaidenAction>, {}: Observable<RaidenState>, deps: RaidenEpicDeps): Observable<matrixPresence.request | messageSend.request | {
readonly type: "transfer/success";
readonly payload: {
balanceProof?: (import("../../channels/types").BalanceProof & Readonly<{
signature: import("../../utils/types").HexString<65>;
}>) | undefined;
};
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
} | transfer.failure | {
readonly type: "transfer/failure";
readonly payload: unknown;
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
readonly error: true;
} | transferSigned | transferProcessed | {
readonly type: "transfer/secret";
readonly payload: {
secret: import("../../utils/types").HexString<32>;
};
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
} | transferSecret | transferSecretRequest | {
readonly type: "transfer/unlock/success";
readonly payload: {
message: Unlock & Readonly<{
signature: import("../../utils/types").HexString<65>;
}>;
partner: Address;
} & {
userId?: string | undefined;
};
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
} | {
readonly type: "transfer/unlock/failure";
readonly payload: unknown;
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
readonly error: true;
} | {
readonly type: "transfer/unlock/processed";
readonly payload: {
message: Processed & Readonly<{
signature: import("../../utils/types").HexString<65>;
}>;
} & {
userId?: string | undefined;
};
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
} | {
readonly type: "transfer/expire/success";
readonly payload: {
message: LockExpired & Readonly<{
signature: import("../../utils/types").HexString<65>;
}>;
partner: Address;
};
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
} | {
readonly type: "transfer/expire/failure";
readonly payload: unknown;
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
readonly error: true;
} | {
readonly type: "transfer/expire/processed";
readonly payload: {
message: Processed & Readonly<{
signature: import("../../utils/types").HexString<65>;
}>;
} & {
userId?: string | undefined;
};
readonly meta: {
secrethash: import("../../utils/types").HexString<32>;
direction: Direction;
};
} | withdraw.failure | withdrawMessage.request | withdrawMessage.success | withdrawMessage.failure | withdrawExpire.success | withdrawExpire.failure | withdrawCompleted>;