MCPcopy Create free account
hub / github.com/Web3Auth/Auth / processMessage

Function processMessage

src/jrpc/jrpc.ts:106–120  ·  view source on GitHub ↗
(res: JRPCResponse<unknown>, _encoding: unknown, cb: (error?: Error | null) => void)

Source from the content-addressed store, hash-verified

104 }
105
106 function processMessage(res: JRPCResponse<unknown>, _encoding: unknown, cb: (error?: Error | null) => void) {
107 let err: Error;
108 try {
109 const isNotification = isJRPCNotification(res as JRPCNotification<JRPCParams> | JRPCRequest<JRPCParams>);
110 if (isNotification) {
111 processNotification(res as JRPCNotification<JRPCParams>);
112 } else {
113 processResponse(res);
114 }
115 } catch (_err: unknown) {
116 err = _err as Error;
117 }
118 // continue processing stream
119 cb(err);
120 }
121
122 const stream = new Duplex({
123 objectMode: true,

Callers

nothing calls this directly

Calls 3

isJRPCNotificationFunction · 0.90
processNotificationFunction · 0.85
processResponseFunction · 0.85

Tested by

no test coverage detected