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

View File

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