UNPKG

raiden-ts

Version:

Raiden Light Client Typescript/Javascript SDK

18 lines 938 B
/* eslint-disable @typescript-eslint/no-namespace */ import * as t from 'io-ts'; import { createAction, createAsyncAction } from '../utils/actions'; import { Address, instanceOf, PublicKey } from '../utils/types'; import { RaidenMatrixSetup } from './state'; import { Caps } from './types'; const NodeId = t.type({ address: Address }); /* MatrixClient instance is ready and logged in to payload.server with credentials payload.setup */ export const matrixSetup = createAction('matrix/setup', t.type({ server: t.string, setup: RaidenMatrixSetup, })); export const matrixPresence = createAsyncAction(NodeId, 'matrix/presence', undefined, t.intersection([ t.type({ userId: t.string, available: t.boolean, ts: t.number, pubkey: PublicKey }), t.partial({ caps: Caps }), ])); export const rtcChannel = createAction('rtc/channel', t.union([t.undefined, instanceOf('RTCDataChannel')]), NodeId); //# sourceMappingURL=actions.js.map