urbit/sur/ethereum.hoon

80 lines
1.5 KiB
Plaintext
Raw Normal View History

::
|%
2018-03-15 18:43:35 +03:00
:: ethereum types. integer bitsizes ignored.
++ etyp
$? :: static
%address %bool
%int %uint
%real %ureal
[%bytes-n n=@ud]
:: dynamic
%bytes %string
[%array-n t=etyp n=@ud]
[%array t=etyp]
==
::
2018-03-15 18:43:35 +03:00
:: ethereum-style typed data. integer bitsizes ignored.
++ data
$% [%address p=address]
[%string p=tape]
[%bool p=?]
[%int p=@sd]
[%uint p=@ud]
[%real p=@rs]
[%ureal p=@urs]
[%bytes-n p=octs]
[%bytes p=octs]
[%array-n p=(list data)]
[%array p=(list data)]
==
::
2018-03-15 18:43:35 +03:00
:: ethereum address, 20 bytes.
++ address @ux
::
:: ethereum json rpc api
::
2018-03-15 18:43:35 +03:00
:: supported requests.
++ request
$% [%eth-block-number ~]
2018-03-21 17:44:18 +03:00
[%eth-call cal=call deb=block]
$: %eth-new-filter
fro=(unit block)
tob=(unit block)
adr=(list address)
top=(list octs)
==
[%eth-get-filter-changes fid=@ud]
==
::
++ filter-change
$: :: null for pending logs
$= mined %- unit
$: log-index=@ud
transaction-index=@ud
block-hash=@ux
block-number=@ud
==
::
address=@ux
data=@t
event=@ux
topics=(list @t)
==
::
2018-03-15 18:43:35 +03:00
:: data for eth_call.
++ call
2018-03-15 18:43:35 +03:00
$: from=(unit address)
to=address
gas=(unit @ud)
gas-price=(unit @ud)
value=(unit @ud)
data=tape
==
::
2018-03-15 18:43:35 +03:00
:: block to operate on.
2018-03-21 17:44:18 +03:00
++ block
$% [%number n=@ud]
[%label l=?(%earliest %latest %pending)]
==
--