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

Function isRequest

src/utils/jrpc.ts:68–72  ·  view source on GitHub ↗
(
  message: (JRPCNotification<Params> | JRPCRequest<Params>) | Readonly<JRPCNotification<Params> | JRPCRequest<Params>>
)

Source from the content-addressed store, hash-verified

66 * Unlike {@link isJRPCRequest}, this also accepts `Readonly<>` wrapped messages.
67 */
68export function isRequest<Params extends JRPCParams>(
69 message: (JRPCNotification<Params> | JRPCRequest<Params>) | Readonly<JRPCNotification<Params> | JRPCRequest<Params>>
70): message is JRPCRequest<Params> {
71 return hasProperty(message, "id");
72}
73
74/**
75 * V2-compatible type guard to check if a JSON-RPC message is a notification (no `id` property).

Callers 7

mixedMiddlewareFunction · 0.90
utils.test.tsFile · 0.90
makeEngineFunction · 0.90
handleRequestFunction · 0.90
handleMethod · 0.90
isNotificationFunction · 0.85

Calls 1

hasPropertyFunction · 0.90

Tested by 2

mixedMiddlewareFunction · 0.72
makeEngineFunction · 0.72