WIP: integrated, not working

This commit is contained in:
timlucmiptev 2020-11-04 17:24:00 +02:00 committed by ixv
parent 236745444e
commit 9539a17080
5 changed files with 19 additions and 14 deletions

View File

@ -62,6 +62,7 @@ abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon
### manual scanning of empty wallet
With max-gap=3
```
:btc-wallet-hook|action [%set-provider ~dopzod]
=btc -build-file %/lib/btc/hoon
=scan-xpub 'zpub6rFR7y4Q2AijBEqTUquhVz398htDFrtymD9xYYfG1m4wAcvPhXNfE3EfH1r1ADqtfSdVCToUG868RvUUkgDKf31mGDtKsAYz2oz2AGutZYs'
:btc-wallet-store|action [%add-wallet scan-xpub ~ [~ 3]]

View File

@ -85,7 +85,7 @@
|^ ^- (quip card _state)
=/ ract=action:rpc
?- -.act
%watch-address
%get-address-info
[%erpc %get-address-utxos address.act]
==
[~[(req-card act ract)] state]

View File

@ -115,22 +115,24 @@
^- (quip card _state)
?- -.act
%set-provider
=* sub-card
[%pass /set-prov %agent [provider.act %btc-provider] %watch /clients]
:_ state
:: TODO %+ weld
:: ?~(provider *(list card) ~[[%pass /leave-prov %agent [host.u.provider %btc-provider] %leave ~]])
~[[%pass /set-prov %agent [provider.act %btc-provider] %watch /clients]]
?~ provider ~[sub-card]
:~ [%pass /leave-prov %agent [host.u.provider %btc-provider] %leave ~]
sub-card
==
==
++ handle-request
|= req=request:bws
^- (quip card _state)
?- -.req
%scan-address
?~ provider ~|("provider not set" !!)
=/ ri=req-id (mk-req-id +.req)
=/ a=address *address
:: TODO (~(mk-address (from-xpub:walt:lib-bws xpub.req) chyg.req) idx.req)
:- ~[(get-address-info host.u.provider a)]
state(pend (~(put by pend) ri +.req))
?~ provider
~|("provider not set" !!)
=/ ri=req-id (mk-req-id +>.req)
:- ~[(get-address-info host.u.provider a.req)]
state(pend (~(put by pend) ri +>.req))
==
::
++ get-address-info
@ -143,6 +145,7 @@
|= [=xpub =chyg:bws =idx:bws] ^- req-id
=/ chygidx=@ (cat 3 ?:(=(%0 chyg) '0' '1') idx)
=/ dat=@ (cat 3 xpub chygidx)
%- ripemd-160:ripemd:crypto
[(met 3 dat) dat]
--

View File

@ -84,10 +84,10 @@
?- -.act
%add-wallet
=/ w=_walt (from-xpub:walt +.act)
=. walts (~(put by walts) xpub.act w)
=^ cards state
(init-batches xpub.act (dec max-gap.st.w))
:- cards
state(walts (~(put by walts) xpub.act w))
[cards state]
::
%watch-address
(watch-address +.act)
@ -106,11 +106,12 @@
++ req-scan
|= [b=batch =xpub =chyg]
^- (list card)
=/ w=_walt (~(got by walts) xpub)
%+ turn ~(tap in todo.b)
|= =idx
:* %give %fact ~[/requests]
%btc-wallet-store-request
!>([%scan-address xpub chyg idx])
!>([%scan-address (~(mk-address w chyg) idx) xpub chyg idx])
==
::
++ scan-status

View File

@ -45,6 +45,6 @@
==
::
+$ request
$% [%scan-address =xpub =chyg =idx]
$% [%scan-address a=address =xpub =chyg =idx]
==
--