shrub/pkg/arvo/sur/json/rpc.hoon
Fang 38e4e06e0b
json-rpc: support batch requests
Because this updates +validate-request, we must update azimuth-rpc
to match.

Naming of $batch-requests is admittedly a bit questionable...
2021-07-07 17:29:12 +02:00

29 lines
513 B
Plaintext

:: json-rpc: protocol types
::
|%
+$ batch-request
$% [%a p=(list request)]
[%o p=request]
==
::
+$ request
$: id=@t
jsonrpc=@t
method=@t
params=request-params
==
::
+$ request-params
$% [%list (list json)]
[%map (map @t json)]
[%object (list (pair @t json))]
==
+$ response
$~ [%fail *httr:eyre]
$% [%result id=@t res=json]
[%error id=@t code=@t message=@t] ::TODO data?
[%fail hit=httr:eyre]
[%batch bas=(list response)]
==
--