generate address action

This commit is contained in:
timlucmiptev 2020-11-11 10:17:54 +02:00 committed by ixv
parent 6678f31beb
commit 98f5701ccc
2 changed files with 16 additions and 4 deletions

View File

@ -85,17 +85,24 @@
%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]
(init-batches xpub.act (dec max-gap.st.w))
::
%watch-address
(watch-address +.act)
::
%update-address
`state
::
%generate-address
=/ uw=(unit _walt) (~(get by walts) xpub.act)
?~ uw
~|("btc-wallet-store, %generate-address: non-existent wallet" !!)
=/ [a=address:btc w=_walt]
~(gen-address u.uw chyg.act)
:_ state(walts (~(put by walts) xpub.act w))
~[[%give %fact ~[/updates] %btc-wallet-store-update !>([%generate-address a])]]
==
:: Wallet-scan algorithm:
:: wallet scan algorithm:
:: Initiate a batch for each chyg, with max-gap idxs in it
:: Send that to /requests subscribers to call out to providers and get the info
:: Whenever a %watch-address result comes back

View File

@ -42,6 +42,11 @@
$% [%add-wallet =xpub scan-to=(unit scon) max-gap=(unit @)]
[%watch-address =xpub =chyg =idx utxos=(set utxo) used=?]
[%update-address a=address utxos=(set utxo)]
[%generate-address =xpub =chyg]
==
::
+$ update
$% [%generate-address =address]
==
::
+$ req-method