mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 00:13:12 +03:00
roller-rpc: add rpc %spawns-remaining
This commit is contained in:
parent
360f5fdd35
commit
502fd5822b
@ -156,6 +156,7 @@
|
||||
%cancel-transaction (cancel-tx id +.params)
|
||||
%get-spawned `(get-spawned id +.params spawned:scry)
|
||||
%get-unspawned `(get-spawned id +.params unspawned:scry)
|
||||
%spawns-remaining `(spawns-remaining id +.params unspawned:scry)
|
||||
%get-owned-points `(get-ships id +.params owned:scry)
|
||||
%get-transferring-for `(get-ships id +.params transfers:scry)
|
||||
%get-manager-for `(get-ships id +.params manager:scry)
|
||||
|
@ -491,6 +491,15 @@
|
||||
~(params error:json-rpc id)
|
||||
[%result id (ships:to-json (scry u.ship))]
|
||||
::
|
||||
++ spawns-remaining
|
||||
|= [id=@t params=(map @t json) scry=$-(@p (list @p))]
|
||||
^- response:rpc
|
||||
?. =((lent ~(tap by params)) 1)
|
||||
~(params error:json-rpc id)
|
||||
?~ ship=(ship:from-json params)
|
||||
~(params error:json-rpc id)
|
||||
[%result id (numb:enjs:format (lent (scry u.ship)))]
|
||||
::
|
||||
++ process-rpc
|
||||
|= [id=@t params=(map @t json) action=l2-tx over-quota=$-(@p ?)]
|
||||
^- [(unit cage) response:rpc]
|
||||
|
Loading…
Reference in New Issue
Block a user