RPC API structures are part of the Ethereum lib proper for now.

This commit is contained in:
Fang 2018-03-13 14:47:21 +01:00
parent de116bbb2a
commit f28b9f7b60
2 changed files with 22 additions and 26 deletions

View File

@ -28,7 +28,7 @@
::
++ request-to-json
=, enjs:format
|= req=request:jrpc-api
|= req=request
^- json
%- pairs
=; cal=[m=@t p=(list json)]
@ -49,7 +49,7 @@
==
::
++ eth-call-to-json
|= cal=call:jrpc-api
|= cal=call
^- json
:- %o %- ~(gas by *(map @t json))
=- (murn - same)
@ -73,7 +73,7 @@
==
::
++ default-block-to-json
|= dob=default-block:jrpc-api
|= dob=default-block
^- json
?- -.dob
%quantity n+(crip ((d-co:co 0) n.dob))

View File

@ -15,28 +15,24 @@
==
::
:: ethereum json rpc api
::TODO make single ++eth-rpc core, or split off into separate sur+lib
::
++ jrpc-api
|%
++ request
$% [%eth-block-number ~]
[%eth-call cal=call deb=default-block]
[%eth-estimate-gas cal=call deb=default-block]
==
::
++ call
$: from=(unit @i)
to=@i
gas=(unit @ud)
gas-price=(unit @ud)
value=(unit @ud)
data=tape
==
::
++ default-block
$% [%quantity n=@ud]
[%label l=?(%earliest %latest %pending)]
==
--
++ request
$% [%eth-block-number ~]
[%eth-call cal=call deb=default-block]
[%eth-estimate-gas cal=call deb=default-block]
==
::
++ call
$: from=(unit @i)
to=@i
gas=(unit @ud)
gas-price=(unit @ud)
value=(unit @ud)
data=tape
==
::
++ default-block
$% [%quantity n=@ud]
[%label l=?(%earliest %latest %pending)]
==
--