Skip to content

Commit 256ca48

Browse files
authored
Merge pull request #11 from kaloudis/loop-connectstreams
Loop: connectStreams call
2 parents 1b81f41 + 46b6584 commit 256ca48

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/api/loop/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ class LoopApi extends BaseApi<LoopEvents> {
4242
this.debug = createRpc(wasm, Debug);
4343
}
4444

45+
/**
46+
* Connect to the Loop streaming endpoint
47+
*/
48+
connectStreams() {
49+
this.subscribe(
50+
SwapClient.Monitor,
51+
new LOOP.MonitorRequest(),
52+
(swapStatus: any) => this.emit('status', swapStatus.toObject())
53+
);
54+
}
55+
4556
subscribe(
4657
call: any,
4758
request: any,

lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ export default class LNC {
391391
onError?: (res: Error) => void
392392
) {
393393
const method = `${methodDescriptor.service.serviceName}.${methodDescriptor.methodName}`;
394-
log.debug(`${method} request`, request.toObject());
395-
const hackedReq = this.hackRequest(request.toObject());
394+
log.debug(`${method} request`, request);
395+
const hackedReq = this.hackRequest(request);
396396
log.debug(`${method} hacked request`, hackedReq);
397397
const reqJSON = JSON.stringify(hackedReq);
398398
this.wasmNamespace.wasmClientInvokeRPC(

0 commit comments

Comments
 (0)