← Code LabJavaScript0/50 solved · 0%
Web3 · hard

46. Mock JSON-RPC client

What a provider really does.

Write `async function rpc(send, method, params)` that calls `send({ jsonrpc: "2.0", id: 1, method, params })` and returns `response.result`, throwing `response.error.message` when present.
Required in your answer: jsonrpcawait