mirror of
https://github.com/urbit/shrub.git
synced 2024-12-25 04:52:06 +03:00
poym done
This commit is contained in:
parent
bd3f056e31
commit
a903301d9a
@ -10,7 +10,7 @@
|
|||||||
:: - updates to existing address info
|
:: - updates to existing address info
|
||||||
::
|
::
|
||||||
:: Sends updates to:
|
:: Sends updates to:
|
||||||
:: none
|
:: /sign-me
|
||||||
::
|
::
|
||||||
/- *btc, *btc-wallet-hook, bws=btc-wallet-store
|
/- *btc, *btc-wallet-hook, bws=btc-wallet-store
|
||||||
/+ dbug, default-agent, bwsl=btc-wallet-store, bp=btc-provider
|
/+ dbug, default-agent, bwsl=btc-wallet-store, bp=btc-provider
|
||||||
@ -76,6 +76,7 @@
|
|||||||
==
|
==
|
||||||
[cards this]
|
[cards this]
|
||||||
::
|
::
|
||||||
|
:: TODO: handle /sign-me path
|
||||||
++ on-watch on-watch:def
|
++ on-watch on-watch:def
|
||||||
++ on-leave on-leave:def
|
++ on-leave on-leave:def
|
||||||
++ on-peek on-peek:def
|
++ on-peek on-peek:def
|
||||||
@ -190,9 +191,10 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
%raw-tx
|
%raw-tx
|
||||||
:: TODO: check whether in poym. We have txid in the update
|
=. state (update-poym +.body.p.upd)
|
||||||
~& >> rawtx.body.p.upd
|
:_ state
|
||||||
`state
|
?. poym-ready ~
|
||||||
|
~[(send-tx poym)]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ handle-wallet-store-request
|
++ handle-wallet-store-request
|
||||||
@ -229,8 +231,6 @@
|
|||||||
?~ provider ~&(>>> "provider not set" ~)
|
?~ provider ~&(>>> "provider not set" ~)
|
||||||
%+ turn txis.txbu.upd
|
%+ turn txis.txbu.upd
|
||||||
|=(=txi:bws (get-raw-tx host.u.provider txid.utxo.txi))
|
|=(=txi:bws (get-raw-tx host.u.provider txid.utxo.txi))
|
||||||
|
|
||||||
:: TODO: send all its input tx-ids out for feedback
|
|
||||||
::
|
::
|
||||||
%scan-done
|
%scan-done
|
||||||
?~ def-wallet
|
?~ def-wallet
|
||||||
@ -262,6 +262,24 @@
|
|||||||
state(piym (~(put by piym) fam ps))
|
state(piym (~(put by piym) fam ps))
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
|
++ update-poym
|
||||||
|
|= [=txid rt=rawtx]
|
||||||
|
^- _state
|
||||||
|
=* txis txis.txbu.poym
|
||||||
|
=| i=@
|
||||||
|
|-
|
||||||
|
?: (gte i (lent txis)) state
|
||||||
|
=/ ith=txi:bws (snag i txis)
|
||||||
|
=? txis =(txid txid.utxo.ith)
|
||||||
|
(snap txis i `txi:bws`ith(ur `rt))
|
||||||
|
$(i +(i))
|
||||||
|
:: poym-ready: do we have all rawtx for inputs?
|
||||||
|
::
|
||||||
|
++ poym-ready
|
||||||
|
^- ?
|
||||||
|
%+ levy txis.txbu.poym
|
||||||
|
|=(t=txi:bws ?=(^ ur.t))
|
||||||
|
::
|
||||||
++ retry
|
++ retry
|
||||||
|= p=^pend-addr
|
|= p=^pend-addr
|
||||||
^- (list card)
|
^- (list card)
|
||||||
@ -298,6 +316,11 @@
|
|||||||
%btc-wallet-hook-action !>(act)
|
%btc-wallet-hook-action !>(act)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
++ send-tx
|
||||||
|
|= p=^poym
|
||||||
|
^- card
|
||||||
|
[%give %fact ~[/sign-me] %btc-wallet-hook-request !>([%sign-tx p])]
|
||||||
|
::
|
||||||
++ poke-wallet-store
|
++ poke-wallet-store
|
||||||
|= act=action:bws
|
|= act=action:bws
|
||||||
^- card
|
^- card
|
||||||
|
@ -28,4 +28,7 @@
|
|||||||
[%ret-pay-address =address payer=ship value=sats]
|
[%ret-pay-address =address payer=ship value=sats]
|
||||||
[%force-retry ~]
|
[%force-retry ~]
|
||||||
==
|
==
|
||||||
|
+$ request
|
||||||
|
$% [%sign-tx payee=(unit ship) =txbu:bws]
|
||||||
|
==
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user