urbit/pkg/base-dev/sur/json/rpc.hoon

29 lines
513 B
Plaintext
Raw Normal View History

2021-08-26 06:00:58 +03:00
:: json-rpc: protocol types
::
|%
+$ batch-request
$% [%a p=(list request)]
[%o p=request]
==
::
2021-08-26 06:00:58 +03:00
+$ request
$: id=@t
jsonrpc=@t
2021-08-26 06:00:58 +03:00
method=@t
params=request-params
==
::
+$ request-params
$% [%list (list json)]
[%map (map @t json)]
2021-08-26 06:00:58 +03:00
[%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)]
==
--