Commit Graph

8 Commits

Author SHA1 Message Date
lollerfirst
d98d166df1 Support NUT-XX (signatures on quotes) for mint and wallet side (#670)
* nut-19 sign mint quote

* ephemeral key for quote

* `mint` adjustments + crypto/nut19.py

* wip: mint side working

* fix import

* post-merge fixups

* more fixes

* make format

* move nut19 to nuts directory

* `key` -> `privkey` and `pubkey`

* make format

* mint_info method for nut-19 support

* fix tests imports

* fix signature missing positional argument + fix db migration format not correctly escaped + pass in NUT-19 keypair to `request_mint` `request_mint_with_callback`

* make format

* fix `get_invoice_status`

* rename to xx

* nutxx -> nut20

* mypy

* remove `mint_quote_signature_required` as per spec

* wip edits

* clean up

* fix tests

* fix deprecated api tests

* fix redis tests

* fix cache tests

* fix regtest mint external

* fix mint regtest

* add test without signature

* test pubkeys in quotes

* wip

* add compat

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2024-12-15 00:39:53 +01:00
callebtc
d30b1a2777 Add fees (#503)
* wip

* wip

* model

* refactor wallet transactions

* refactor wallet

* sending with fees works and outputs fill up the wallet

* wip work

* ok

* comments

* receive with amount=0

* correctly import postmeltrequest

* fix melt amount

* tests working

* remove mint_loaded decorator in deprecated wallet api

* wallet works with units

* refactor: melt_quote

* fix fees

* add file

* fees for melt inputs

* set default input fee for internal quotes to 0

* fix coinselect

* coin selection working

* yo

* fix all tests

* clean up

* last commit added fees for inputs for melt transactions - this commit adds a blanace too low exception

* fix fee return and melt quote max allowed amount check during creation of melt quote

* clean up code

* add tests for fees

* add melt tests

* update wallet fee information
2024-06-15 16:22:41 +02:00
callebtc
b8ad0e0a8f Mint: Recover pending melts at startup (#499)
* wip works with fakewallet

* startup refactor

* add tests

* regtest tests for pending melts

* wip CLN

* remove db migration

* remove foreign key relation to keyset id

* fix: get_promise from db and restore DLEQs

* test: check for keyset not found error

* fix migrations

* lower-case all db column names

* add more tests for regtest

* simlate failure for lightning

* test wallet spent state with hodl invoices

* retry

* regtest with postgres

* retry postgres

* add sleeps

* longer sleep on github

* more sleep for github sigh

* increase sleep ffs

* add sleep loop

* try something

* do not pay with wallet but with ledger

* fix lnbits pending state

* fix pipeline to use fake admin from docker
2024-04-03 17:14:21 +02:00
callebtc
6ddce571a0 Keysets per seed and postgres (#400)
* allow generation of keys per seed phrase

* emit errors correctly

* parse timestamps for melt and mint quotes correctly

* error messages

* adjust error message

* postgres works

* prepare postgres tests

* timestamps refactor

* add command to key activation

* generate keys per seed

* add keyset tests

* keyest uniqueness constaint on (derivation_path, seed)

* add tables ony if not exists

* log leve
2024-02-02 21:25:02 +01:00
callebtc
3d676dd35f Add custom error types (#290)
* add error types

* better subclassing

* add response models

* fix comments

* add response_description to mint endpoints
2023-07-25 23:26:50 +02:00
callebtc
53a8387a0d refactor 2023-01-11 02:57:59 +01:00
callebtc
9f1e180274 file 2022-10-09 10:31:10 +02:00
callebtc
6ce15da527 keyset working 2022-10-08 13:56:01 +02:00