urbit/pkg/arvo/mar/eth/txs.hoon
Jared Tobin b3901ab42f Add 'pkg/arvo/' from commit 'c20e2a185f131ff3f5d3961829bd7a3fe0f227f8'
git-subtree-dir: pkg/arvo
git-subtree-mainline: 9c8f40bf6c
git-subtree-split: c20e2a185f
2019-06-28 12:48:05 +08:00

71 lines
1.2 KiB
Plaintext

:: list of ethereum transactions
::
=, format
=, ethereum
=, rpc
=, mimes:html
::
|_ txs=(list transaction)
++ u-parser
%- cook :_ nuck:so
|= =coin
?> ?=(%$ -.coin)
?> ?=(%u (end 3 1 p.p.coin))
`@`q.p.coin
::
++ grab
|%
++ mime
|= [p=mite:eyre q=octs:eyre]
=/ wan=wain (to-wain q.q)
?> ?=(^ wan)
%+ murn t.wan
|= tx=@t
^- (unit transaction)
?: =('' tx)
~
:- ~
%+ rash tx
;~ (glue com)
u-parser
u-parser
u-parser
;~(pfix (jest '0x') hex)
u-parser
;~(pfix (jest '0x') hex)
u-parser
==
++ noun (list transaction)
--
::
++ grow
=> v=.
|%
++ mime
=> v
:- /text/plain
%- as-octs %- of-wain
=- (weld - '' ~)
:- 'nonce,gas-price,gas,to,value,data,chain-id'
%+ turn txs
|= transaction
^- @t
%+ rap 3
:~ (scot %ui nonce)
','
(scot %ui gas-price)
','
(scot %ui gas)
','
(crip (address-to-hex to))
','
(scot %ui value)
','
(crip (prefix-hex (render-hex-bytes (max 1 (met 3 data)) `@`data)))
','
(scot %ux chain-id)
==
--
++ grad %mime
--