From f8eaa347c5ee8fa6f83b6ad2f27e26d395ef7632 Mon Sep 17 00:00:00 2001 From: timlucmiptev Date: Wed, 9 Dec 2020 19:33:50 +0200 Subject: [PATCH] psbt skeleton --- lib/btc.hoon | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/btc.hoon b/lib/btc.hoon index 583563cb3..6ae0cd1c9 100644 --- a/lib/btc.hoon +++ b/lib/btc.hoon @@ -67,6 +67,34 @@ :: ++ psbt |% + ++ en + |% + ++ globals + |= =rawtx + ^- map:^psbt + *map:^psbt + ++ inputs + |= (list in:^psbt) + ^- map:^psbt + *map:^psbt + ++ outputs + |= (list out:^psbt) + ^- map:^psbt + *map:^psbt + -- + :: +encode: make base64 cord of PSBT + :: + ++ encode + |= [=rawtx =txid inputs=(list in:^psbt) outputs=(list out:^psbt)] + ^- cord + :: TODO + :: make global map + :: raw tx hex + :: turn each input and output into a map (or ~) + :: put the 0x0 separator between all + :: parse to hex + :: encode as base64! + *cord :: +create: make base64 cord of PSBT :: ++ create