Commit Graph

162 Commits

Author SHA1 Message Date
Angus Pearson
e25100c1e0 Mint API: Check ?amount is within a sensible range (#226) 2023-05-18 22:31:20 +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
e0a8da4f77 enable tor test (#185) 2023-05-01 22:44:06 +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
d201b89df2 settings: add mint derivation path (#166) 2023-05-01 22:39:50 +02:00
Steffen
b3e02e1bf0 fix: test_step2 (#174) 2023-04-23 13:56:23 +02:00
calle
e0470111cb fix tests (#161) 2023-04-16 13:42:52 +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
callebtc
a673077005 bump to 0.11.0 2023-03-29 03:38:17 +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
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
e696e19479 wallet: invalidate proofs without checking with mint (#122) 2023-03-04 22:02:24 +01:00
calle
23f2b58430 wallet: mint specific amounts (#121)
* wallet: mint specific amounts

* make format
2023-03-04 21:49:39 +01:00
calle
2d66aeb79c Fix invoice asyncio wrapper (#113)
* mypy: fix lightning backend warnings

* fix asyncio invoice creation

* ignore weird mypy error
2023-02-25 16:44:51 +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
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
01d9cef407 fix nostr relay and refactor nostr_send and nostr_receive (#100)
* fix nostr relay and refactor nostr_send and nostr_receive

* bump to 0.8.4

* make format

* check test

* close nostr
2023-01-25 01:50:02 +01:00
calle
9acac156a7 Testing/click (#99)
* annotate context

* remove whitespace

* test CLI

* make format

* github action with submodule checkout

* maybe now

* vllt ja nu

* und no?

* back to normal mint running

* githuuuuub

* COME OOOON!

* SO. CLOSE.

* make format

* new test

* fix it

* make format

* receive v1 token test
2023-01-19 14:13:54 +01:00
callebtc
75bbf12679 merge 2023-01-14 20:20:06 +01:00
callebtc
db034a0e00 fix tests 2023-01-11 03:41:11 +01:00
callebtc
53a8387a0d refactor 2023-01-11 02:57:59 +01:00
callebtc
5fce0cf6e8 test: GET /keys/{id} 2022-12-25 11:31:46 +01:00
callebtc
0840ee184c fix typing 2022-12-24 15:43:48 +01:00
callebtc
cdabc86ba9 defer unpending 2022-12-14 23:27:40 +01:00
callebtc
86aea47e90 force tor if not manually disabled 2022-11-03 14:28:50 +01:00
callebtc
16815a283e own timeout 2022-10-31 11:01:41 +01:00
callebtc
f3ff129b98 make format 2022-10-29 23:23:58 +02:00
callebtc
89462cdd13 test multiple platforms 2022-10-29 23:17:26 +02:00
callebtc
4abf1ba8b0 turn off tor for tests 2022-10-29 23:01:25 +02:00
callebtc
d6fa754a6d test tor 2022-10-29 22:55:32 +02:00
callebtc
3094f7739f add more tests 2022-10-16 13:36:29 +02:00
callebtc
4652042de0 make format 2022-10-16 13:23:30 +02:00
callebtc
99d14352d7 test dhke 2022-10-16 13:19:31 +02:00
callebtc
d8fbdf4b8f client test that mint returns tokens with correct keyset id 2022-10-15 01:12:52 +02:00
callebtc
6f913e3cc9 make format 2022-10-15 00:59:21 +02:00
callebtc
7fb2c81ede test mint 2022-10-15 00:59:01 +02:00
callebtc
3437af041e ability to specify the keyset for generating promises mint 2022-10-13 20:07:04 +02:00
callebtc
7eb8ec8ccc make format 2022-10-11 00:49:27 +02:00
callebtc
6838b0be05 mypy 2022-10-11 00:41:55 +02:00
callebtc
d4a89ac76f add tests 2022-10-11 00:19:53 +02:00
callebtc
f35c1f3bfc make format 2022-10-09 23:40:34 +02:00
callebtc
f127c8dfb7 testing 2022-10-09 23:40:01 +02:00
callebtc
1bdb4568c4 started 2022-10-07 16:30:50 +02:00
callebtc
149d69f99d isort 2022-10-05 20:03:04 +02:00
callebtc
7f1f3e3574 test 2022-10-05 20:01:26 +02:00
callebtc
a264dd5c6d fst_ to frst_ and snd_ to scnd_ 2022-10-05 19:53:31 +02:00