diff --git a/app/btc-wallet-store.hoon b/app/btc-wallet-store.hoon index 7d01850a1c..0099b08f76 100644 --- a/app/btc-wallet-store.hoon +++ b/app/btc-wallet-store.hoon @@ -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 diff --git a/sur/btc-wallet-store.hoon b/sur/btc-wallet-store.hoon index 804f08ef9f..ee47b140ca 100644 --- a/sur/btc-wallet-store.hoon +++ b/sur/btc-wallet-store.hoon @@ -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