shrub/sur/btc-wallet-hook.hoon

38 lines
1.2 KiB
Plaintext
Raw Normal View History

2020-11-09 15:29:30 +03:00
/- *btc, bws=btc-wallet-store, bp=btc-provider
2020-10-24 19:13:36 +03:00
|%
2020-11-04 16:55:47 +03:00
:: req-id: hash of [xpub chyg idx]
2020-11-17 11:25:50 +03:00
:: pend: lookup of req-id -> requests from wallet-store
:: pend-txbu: lookup req-id -> txbu (to fetch and assoc raw-tx info with txid)
::
:: payment: a payment expected from another ship
:: - address: address generated for this payment
:: txbu: tx builder -- all information needed to make a transaction for signing
:: piym: incoming payments. Stores all ship moons inside
2020-11-16 20:47:00 +03:00
:: poym: outgoing payments
:: piym-watch/poym-watch:
:: let us link an address back to its incoming/outgoing payment
2020-11-04 16:55:47 +03:00
::
2020-11-16 20:06:45 +03:00
+$ btc-state [blockcount=@ud fee=sats t=@da]
2020-11-17 11:25:50 +03:00
+$ pend-addr (map req-id:bp request:bws)
+$ pend-txbu (map req-id:bp ship)
::
+$ payment [=address payer=ship value=sats]
2020-11-16 20:47:00 +03:00
+$ key [=bipt =chyg:bws =idx:bws]
+$ txin [=utxo raw-tx=byts =key]
2020-11-17 11:25:50 +03:00
+$ txout [=address value=sats]
+$ txbu [txins=(list txin) txouts=(list txout)]
2020-11-16 20:47:00 +03:00
::
+$ piym (jar ship payment)
2020-11-17 11:25:50 +03:00
+$ poym (map ship txbu)
2020-11-16 20:47:00 +03:00
+$ piym-watch (map address ship)
+$ poym-watch (map address ship)
::
2020-10-24 19:13:36 +03:00
+$ action
2020-11-04 16:55:47 +03:00
$% [%set-provider provider=ship]
2020-11-17 11:25:50 +03:00
[%set-default-wallet ~]
[%req-pay-address payee=ship value=sats]
[%pay-address payer=ship value=sats =address]
2020-11-09 18:34:29 +03:00
[%force-retry ~]
2020-10-24 19:13:36 +03:00
==
--