Commit Graph

12 Commits

Author SHA1 Message Date
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
f3cf1c69c4 [Wallet] Bugfix/enable-funding-multiple-mints (#210)
* Fix bug where no additional mints can be funded

As soon as one mint is in the database, the new multimint selector only
considers this mint, even if the `MINT_` environment variables point to
a different one. This commit fixes it by explicitly adding the set mint
URL to the selector.

Additionally did some small cleanups.

* Move mint adding to higher-level function

* bypass selection at first time

* use contextx, more explicit

* remove whitespace

---------

Co-authored-by: xphade <18196286+xphade@users.noreply.github.com>
2023-05-13 19:49:37 +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
calle
89fb2787e6 Python/relative_import (#186)
* relative import all the things

* make format

* add __init__.py to cli/

* fix mypy errors

* get rid of more mypy

* mypy fix crud.py

* fix another mypy error
2023-05-01 22:39:23 +02:00
calle
c3752fb20a load keys of output, not of inputs (#169) 2023-04-17 22:16:43 +02:00
calle
d42092d62e fix: load mint with most recent keyset (#162) 2023-04-16 15:46:17 +02:00
calle
2ded9c8b5c use tokenObj in burn (#156)
* use tokenObj in burn

* refactor token serialization

* add tests

* rename
2023-04-01 00:46:56 +02:00
calle
db27105d17 TokenV3 and new Mint startup in tests (#149)
* tokenv3 send and receive
* receive v2 and v1 tokens with tests
2023-03-28 22:35:22 +02:00
sihamon
258de87a9a Fix: Mints are sorted by balance which can suddenly change (#145)
* Sort mints by URL when displaying balances

* Use mint with largest balance as default when spending

* Make format

* Display mint with largest balance in prompt
2023-03-19 15:09:03 +01:00
calle
f3a31fd09e use settings module (#136)
* use settings module
2023-03-16 00:59:50 +01:00
calle
a7eef68c97 wallet: load keys without keysets (#123)
* wallet: load keys without keysets

* fix cli
2023-03-05 02:51:20 +01:00
calle
46eeb2c36e Nostr-p2nip5 (#110)
* move cli

* set_requests decorator

* fix wrapper

* refactor nostr.py

* ignore coroutine unpack error

* nostr lib 0.8

* make format
2023-02-25 12:27:33 +01:00