mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-05 22:03:50 +03:00
support for only doing witness part
This commit is contained in:
parent
741093a588
commit
6a4ebcf239
@ -108,7 +108,7 @@
|
|||||||
=/ outs=(list out:psbt:btc)
|
=/ outs=(list out:psbt:btc)
|
||||||
%+ turn txos.t
|
%+ turn txos.t
|
||||||
|=(=txo [address.txo hk.txo])
|
|=(=txo [address.txo hk.txo])
|
||||||
`(encode:pbt:btc get-rawtx get-txid ins outs)
|
`(encode:pbt:btc %.y get-rawtx get-txid ins outs)
|
||||||
--
|
--
|
||||||
:: wad: door for processing walts (wallets)
|
:: wad: door for processing walts (wallets)
|
||||||
:: parameterized on a walt and it's chyg account
|
:: parameterized on a walt and it's chyg account
|
||||||
|
17
lib/btc.hoon
17
lib/btc.hoon
@ -193,10 +193,12 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ input
|
++ input
|
||||||
|= i=in:psbt
|
|= [only-witness=? i=in:psbt]
|
||||||
^- map:psbt
|
^- map:psbt
|
||||||
:~ [[1 0x0] rawtx.i]
|
%+ weld
|
||||||
(witness-tx i)
|
?: only-witness ~
|
||||||
|
~[[1^0x0 rawtx.i]]
|
||||||
|
:~ (witness-tx i)
|
||||||
(hdkey %input hdkey.i)
|
(hdkey %input hdkey.i)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -262,9 +264,14 @@
|
|||||||
%- en:base64:mimes:html
|
%- en:base64:mimes:html
|
||||||
(flip:byt b)
|
(flip:byt b)
|
||||||
:: +encode: make base64 cord of PSBT
|
:: +encode: make base64 cord of PSBT
|
||||||
|
:: - only-witness: don't include non-witness UTXO
|
||||||
::
|
::
|
||||||
++ encode
|
++ encode
|
||||||
|= [=rawtx =txid inputs=(list in:psbt) outputs=(list out:psbt)]
|
|= $: only-witness=?
|
||||||
|
=rawtx =txid
|
||||||
|
inputs=(list in:psbt)
|
||||||
|
outputs=(list out:psbt)
|
||||||
|
==
|
||||||
^- base64:psbt
|
^- base64:psbt
|
||||||
=/ sep=(unit bytc) `1^0x0
|
=/ sep=(unit bytc) `1^0x0
|
||||||
=/ final=(list (unit bytc))
|
=/ final=(list (unit bytc))
|
||||||
@ -272,7 +279,7 @@
|
|||||||
%+ turn
|
%+ turn
|
||||||
%- zing
|
%- zing
|
||||||
:~ ~[(globals:en rawtx)]
|
:~ ~[(globals:en rawtx)]
|
||||||
(turn inputs input:en)
|
(turn inputs (cury input:en only-witness))
|
||||||
(turn outputs output:en)
|
(turn outputs output:en)
|
||||||
==
|
==
|
||||||
map-byts:en
|
map-byts:en
|
||||||
|
Loading…
Reference in New Issue
Block a user