naive: add when %next-batch to rpc-api

This commit is contained in:
yosoyubik 2021-06-09 15:59:04 +02:00
parent 60ba0f81dd
commit 749f8e93f9
2 changed files with 14 additions and 0 deletions

View File

@ -143,6 +143,7 @@
%pending-by-ship [~ (ship:pending id +.params ship:pending:scry)] %pending-by-ship [~ (ship:pending id +.params ship:pending:scry)]
%pending-by-address [~ (addr:pending id +.params addr:pending:scry)] %pending-by-address [~ (addr:pending id +.params addr:pending:scry)]
%status [~ (status id +.params tx-status:scry)] %status [~ (status id +.params tx-status:scry)]
%next-batch [~ (next-batch id +.params next-batch:scry)]
:: %history [~ (history id +.params all:history:scry)] :: %history [~ (history id +.params all:history:scry)]
== ==
:: ::
@ -222,6 +223,12 @@
(~(scry agentio bowl) %aggregator /tx/(scot %ux keccak)/status/noun) (~(scry agentio bowl) %aggregator /tx/(scot %ux keccak)/status/noun)
== ==
:: ::
++ next-batch
.^ time
%gx
(~(scry agentio bowl) %aggregator /next-batch/noun)
==
::
++ nonce ++ nonce
|= [=ship =address:naive] |= [=ship =address:naive]
:: FIXME: use proper type from aggregator/index :: FIXME: use proper type from aggregator/index

View File

@ -482,6 +482,13 @@
~(parse error:json-rpc id) ~(parse error:json-rpc id)
[%result id (tx-status:to-json (scry u.keccak))] [%result id (tx-status:to-json (scry u.keccak))]
:: ::
++ next-batch
|= [id=@t params=(map @t json) when=time]
^- response:rpc
?. =((lent ~(tap by params)) 0)
~(params error:json-rpc id)
[%result id (time:enjs:format when)]
::
:: ++ history :: ++ history
:: |= $: id=@t :: |= $: id=@t
:: params=(map @t json) :: params=(map @t json)