%delete-wallet support

This commit is contained in:
timlucmiptev 2021-02-09 16:20:11 +04:00 committed by ixv
parent 685b9fefee
commit 4b61c30e55
4 changed files with 17 additions and 3 deletions

View File

@ -141,8 +141,16 @@
::
%set-default-wallet
=/ xs=(list xpub) scry-scanned
?. (gth (lent xs) 0) `state
`state(def-wallet `(snag 0 xs))
=/ i=(unit @) (find ~[xpub.comm] xs)
?~ i `state
`state(def-wallet `(snag u.i xs))
::
%delete-wallet
:- ~[(poke-store [%delete-wallet xpub.comm])]
?~ def-wallet state
?. =(u.def-wallet xpub.comm) state
state(def-wallet ~)
:: TODO if wallet is xpub.comm, clear
::
:: %req-pay-address
:: overwrites any payment being built currently

View File

@ -111,6 +111,10 @@
=/ w=walt (from-xpub +.act)
=. walts (~(put by walts) xpub.act w)
(init-batches xpub.act (dec max-gap.w))
::
%delete-wallet
`state(walts (~(del by walts) xpub.act))
::
:: TODO
:: if blank address we're watching gets a value
:: "blank" = unused

View File

@ -28,7 +28,8 @@
::
+$ command
$% [%set-provider provider=ship =network]
[%set-default-wallet ~]
[%set-default-wallet =xpub]
[%delete-wallet =xpub]
[%clear-poym ~]
[%force-retry ~]
[%req-pay-address payee=ship value=sats feyb=(unit sats)]

View File

@ -90,6 +90,7 @@
::
+$ action
$% [%add-wallet =xpub =fprint scan-to=(unit scon) max-gap=(unit @ud) confs=(unit @ud)]
[%delete-wallet =xpub]
[%address-info =xpub =chyg =idx utxos=(set utxo) used=? block=@ud]
[%tx-info =info:tx block=@ud]
[%generate-address =xpub =chyg =pmet]