Commit Graph

64 Commits

Author SHA1 Message Date
callebtc
ae4eb43b8e fix wallet pubkey migration start (#259) 2023-06-23 20:21:21 +02:00
callebtc
25385f1f16 [Wallet] store public keys of each keyset (#165)
* store public keys of each keyset

* deserialize public keys from db

* Fix: import accidentally removed during merge

* Sort imports correctly

---------

Co-authored-by: sihamon <sihamon@proton.me>
2023-06-23 19:30:45 +02:00
sihamon
e7df2028fa Allow to set maximum peg in/out for mint (#209)
* Allow to set maximum peg in/out for mint

* Make format

* remove duplicate error

* move business logic to ledger

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2023-05-13 20:41:24 +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
callebtc
e9f33337db Fix/nut 04 payment hash (#191)
* payment_hash -> hash

* add aes encryption

* urlsafe base64 for free

* move files to crypto

* use random hash instead of encryption

* get rid of useless code

* simplify
2023-05-04 00:12:18 +02:00
calle
61078ce7c8 [Mint] add mint api tests (#189)
* add mint api tests

* add /info test and fix NUT-09 contact info strings

* add test mint api

* replace with requests
2023-05-02 00:43:49 +02:00
calle
3c47ab2ac7 squash many mypy warnings (#188) 2023-05-01 23:09:16 +02:00
calle
321fc733c8 [Mint] Fix key derivation (#187)
* fix private key derivation

* add backwards compatilibity for old keysets

* bump version

* test pubkeys and private keys

* make format

* reset keys for tests

* fix cli tests
2023-05-01 22:43:51 +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
47f886487c nut-09 mint info (#155)
* nut-09 mint info

* bump to 0.11.1

* make format
2023-04-01 00:47:27 +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
calle
70828b59d5 NUT-08 Lightning fee return (#114)
* skeleton

* works

* comments

* docsctrings ledger.py

* bump version to 0.10.

* fixes mypy stuff

* make format

* remove unwanted changes
2023-03-16 01:28:33 +01:00
calle
7e39e1b036 BREAKING: PostMeltRequest, CheckSpendableResponse ` (#106)
* fix PostMeltRequest and /checkfees to GET

* POST /check -> GET /check

* fix GetCheckSpendableResponse

* rename models

* make format

* revert GET

* bump version to 0.9

* skip nostr test
2023-01-30 09:13:46 +01:00
calle
2dd9fd356f Fix/tokenv2mints (#98)
* adjust tokenv2 and make it backwards compatible

* fix dict to list

* use pydantic object and not the dtoken

* make format

* fix typo in _meltrequest_include_fields

* reorder functions

* fixes and tests working

* bump version to 0.8.3
2023-01-19 08:35:32 +01:00
calle
344210d266 fix versions (#97) 2023-01-15 10:59:17 +01:00
callebtc
97aee02e0c get rid of baggage 2023-01-14 21:31:09 +01:00
callebtc
3cbdebf5a5 BlindedMessages is now List[BlindedMessage] (no blinded_messages field) and PostMintRequest (new) is now with outputs field 2023-01-14 21:23:06 +01:00
callebtc
af0984ccde clean 2023-01-14 15:29:09 +01:00
callebtc
c34636e2f3 rename TokenMintJson to TokenMintV2 2023-01-14 15:02:54 +01:00
callebtc
f808366eb2 clean base models 2023-01-14 15:01:23 +01:00
callebtc
20b99ee792 bumop to 0.8 2023-01-14 13:46:33 +01:00
callebtc
0194fef619 legacy test 2023-01-14 13:28:29 +01:00
callebtc
0e82fa5cdd V2 tokens: rename field tokens to proofs, add documentation 2023-01-14 13:18:52 +01:00
callebtc
53a8387a0d refactor 2023-01-11 02:57:59 +01:00
callebtc
c4f74f42a3 refactor 2022-12-28 03:35:45 +01:00
callebtc
86e8635a16 make format 2022-12-24 15:17:09 +01:00
callebtc
1181b64615 introduce basemodel for token 2022-12-24 15:15:40 +01:00
callebtc
519b375953 comments 2022-11-05 17:24:33 +01:00
callebtc
90a2992b82 Proof without id 2022-11-05 04:08:03 +01:00
callebtc
c110715f28 save lightning invoices 2022-10-18 11:16:30 +02:00
callebtc
d2363f8f2a wallet sends only relevant fields for /check endpoint 2022-10-14 00:30:24 +02:00
callebtc
5022d4e47f test melt without lightning 2022-10-14 00:05:47 +02:00
callebtc
a84b04605e refactor 2022-10-13 22:11:00 +02:00
callebtc
6838b0be05 mypy 2022-10-11 00:41:55 +02:00
callebtc
d5e92a3f44 keyset with version 2022-10-10 22:08:11 +02:00
callebtc
88a7e38da0 update hash_to_curve 2022-10-10 19:00:33 +02:00
callebtc
80597cecb3 fix typo 2022-10-09 22:09:43 +02:00
callebtc
a5eefb80b0 keyset not byte array 2022-10-09 21:58:19 +02:00
callebtc
2c93fee565 fix 2022-10-09 10:54:42 +02:00
callebtc
590a1a349a binary to string 2022-10-09 10:52:38 +02:00
callebtc
9f1e180274 file 2022-10-09 10:31:10 +02:00
callebtc
4cee885131 etza 2022-10-08 19:50:11 +02:00
callebtc
244ea4a343 multiple keysets per mint 2022-10-08 19:25:03 +02:00
callebtc
a54ca6e656 make format 2022-10-08 15:08:33 +02:00
callebtc
fad9b91061 mint saves keyset ids 2022-10-08 15:08:20 +02:00
callebtc
52250fae77 make format 2022-10-08 13:57:00 +02:00
callebtc
6ce15da527 keyset working 2022-10-08 13:56:01 +02:00
callebtc
1bdb4568c4 started 2022-10-07 16:30:50 +02:00
callebtc
2d48c3116c request fee from mint 2022-10-05 22:26:57 +02:00