Commit Graph

11 Commits

Author SHA1 Message Date
callebtc
4beaf8ff41 add http proxy option to wallet (#269) 2023-06-29 22:43:45 +02:00
sihamon
a0df47f13a Add multi-mint swap to CLI and API (#212)
* Add multi-mint swap to CLI and API

* Add confirmation prompt to CLI

* Replace several assert statements

* Define response for API endpoint swap

* Adapt to latest changes on main

* Fix: missing argument after latest changes on main

* API: use local wallet for swap

* Improve swap command

* clean up cli swap

* fix comment

* clean up router

* fix up

* remove outgoing

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2023-06-23 20:04:28 +02:00
callebtc
62a6ec34b0 no async for deserialization functions (#255) 2023-06-23 00:21:31 +02:00
callebtc
defcf7aac4 [Wallet] DB optimization for faster payments (#250)
* get rid of redundant proof loads

* fix test?

* fix one test?

* api: load_mint for invoice

* clean up tests
2023-06-11 00:10:07 +02:00
callebtc
959cc00c8a [Wallet] send without split (#249)
* send without split

* change test amount for nosplit send
2023-06-10 21:45:47 +02:00
callebtc
af3e82691e [Wallet] Allow minting of specific amounts (#248)
* Allow to start wallet API by cashu --daemon

* Provide access to wallet name via settings

* Make format

* Use flag is_eager for daemon option

* add setting api_host

* fix: add missing amount

* refactor mint

* cli and api for splitting and tests

* invoice balance?

* remove balance checks until I know why it doesnt update

* remove all balance checks from tests

* delete old code

* remove debug logs

---------

Co-authored-by: sihamon <sihamon@proton.me>
2023-06-10 20:45:03 +02:00
sihamon
786fbf2856 Allow to start wallet API by cashu --daemon (#243)
* Allow to start wallet API by cashu --daemon

* Provide access to wallet name via settings

* Make format

* Use flag is_eager for daemon option

* add setting api_host

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2023-06-08 14:42:37 +02:00
xphade
21069fb61a Implement dynamic amount of tokens for change (#223)
With the recent update to NUT-08, we can ensure that the amount of blank
outputs is always enough to cover any overpaid lightning fees. This
change implements this functionality for both the wallet and the mint.
The mint updateis backwards-compatible with respect to old wallets.
2023-05-23 17:40:48 +02:00
sihamon
5df0a9aa59 Catch all exceptions in wallet API (#220)
* Catch all exceptions in wallet API

* Use middleware instead of route class to catch exceptions

* Wallet API: simplify load_mint
2023-05-22 21:06:31 +02:00
sihamon
08ceeda36f [Wallet] Define responses for API (#233)
* Define responses for wallet API

* Make format
2023-05-22 14:31:29 +02:00
callebtc
4088ab2876 Wallet REST API (#199)
* Add REST API for Cashu wallet

* Add simple way to start REST API server

* Add simple tests for wallet REST API

* Add TokenV3 to REST API

* Improve tests for wallet REST API

* Make format

* Remove unused import

* Rename nostr module for API

* Unify helper functions for CLI and API

* Make format

* Move error handling from helper functions to API

* Remove 'is_api' flag where possible

* Make format, cleanup, add comments

* Fix typo for burn also in API

* Improve error handling for API

* Add flag 'trust_new_mint' to receive command

To enable trusting or mistrusting unknown mints via API

* Allow selecting mint for sending from API

* Fix: set specific mint via API

* Fix: select mint with maximum balance via CLI

* Use different variables for mint_nr

* Allow selecting mint when sending via nostr via API

* Remove unnessecary 'is_api' flags from 'send_nostr'

* Remove HTTPException from nostr.py

* Allow selecting mint for sending with parameter also via CLI

* Allow trusting unknown mint for receiving also via CLI

* Make format

* Enable trusting unknown mint also when receiving via nostr

* Fix: wrong indentation of in receive function

* Use relative imports for wallet API

* Unify get_mint_wallet for CLI and API

* Unify send command for CLI and API

* Unify receive for CLI and API

* Catch errors in nostr via API

* Remove flag 'is_api' from verify_mints_tokenv2

* Remove cli_helpers left from last merge

* refactor cli selection

* load mint in nostr_send

* cleanup

* add cli_helpers.py

* legacy deserialization in cli

* make format

* clean up api response

* fix tests

* try pk

* verify mints in api

* try github tests

* Fix: verify_mints for API

* Uncomment verify_mints in receive of API

* update README

* Show mint url in pending

* clean up balance response

* fix test

* mint selection in api

* clean up API

* CLI: verify mint for receive -a

* clean up

* Rest -> REST

* Remove unused imports

---------

Co-authored-by: sihamon <sihamon@proton.me>
Co-authored-by: sihamon <126967444+sihamon@users.noreply.github.com>
2023-05-11 23:27:13 +02:00