Commit Graph

146 Commits

Author SHA1 Message Date
Vlad Stan
98e0ea5ae2 refactor: only use one (direction) flag for identifying payment 2022-12-22 12:23:46 +02:00
Vlad Stan
a434731729 fix: update the rest of update_payment_extra calls 2022-12-22 11:28:12 +02:00
Vlad Stan
b56d08a70e fix: handle extra updates for internal payments 2022-12-22 11:12:19 +02:00
Vlad Stan
f3c884111d refactor: use dict.update() 2022-12-21 15:47:22 +02:00
Vlad Stan
ec01c74da1 fix: mypy 2022-12-21 15:10:12 +02:00
Vlad Stan
dd4a9f10cf feat: add function to update the extra JSON values 2022-12-21 15:06:45 +02:00
Vlad Stan
1d509fb9d2 fix: typo Setings -> Settings 2022-12-19 11:07:24 +02:00
Vlad Stan
c9745f849e fix: mypy 2022-12-16 12:14:00 +02:00
Vlad Stan
1751831e57 fix: create default wallet for auto created super_user 2022-12-16 12:09:13 +02:00
Vlad Stan
d596992993 feat: .env super_user overwrites DB super_user 2022-12-16 11:22:32 +02:00
Vlad Stan
4ee68628cc fix: use super_admin from .env if present 2022-12-16 10:29:43 +02:00
Vlad Stan
6cab77ece4
Merge branch 'main' into FinalAdminUI 2022-12-12 10:49:31 +02:00
Vlad Stan
b758cb5be3 fix: remove super_admin from lnbits_admin_users 2022-12-12 10:28:53 +02:00
Vlad Stan
6252119485 fix: add super_user to the lnbits_admin_users list 2022-12-09 14:53:09 +02:00
Vlad Stan
d6d42250a9 refactor: use JSON for settings 2022-12-09 13:14:22 +02:00
Vlad Stan
0d4954c01a chore: temp commit (does not work); don't want to lose changes 2022-12-09 09:46:30 +02:00
Vlad Stan
d15782521d refactor: include admin extension into core 2022-12-08 15:41:52 +02:00
callebtc
441d5337a3 fix expiry integer 2022-12-06 10:48:16 +01:00
dni âš¡
c56a31e6f5 add superuser and refactor check_admin function, also put it into satspay 2022-12-05 20:41:23 +01:00
callebtc
2134b63cea readd comments 2022-12-02 17:48:47 +01:00
callebtc
4e69924c9c fix datetime conversion 2022-12-02 17:38:36 +01:00
callebtc
79ffbb7bc2 merge main 2022-12-02 11:23:20 +01:00
dni âš¡
86d2780c9f fix template typos and also update settings in memory after a admin PUT 2022-11-30 23:47:52 +01:00
dni âš¡
74eece78de merge from master 2022-11-24 14:35:32 +01:00
Tiago Vasconcelos
4549190e86 abstract get latest payments for extensions 2022-11-17 12:59:40 +00:00
dni âš¡
f9de542361 use new settings and remove unused amdin extension stuff 2022-10-25 09:23:30 +02:00
calle
d1302e4868
show progress (#987) 2022-10-11 08:52:39 +02:00
callebtc
efc024e1c0 check expiry upon payment creation 2022-10-05 14:17:23 +02:00
Gene Takavic
e75610a04f
API auditor (#1002)
* just quick auditor

* fix for none balance

* handle node down case

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2022-09-23 16:33:51 +03:00
calle
e7a6e86e7a
Fix/duplicate payments (#973)
* check if wallet exists

* check wallet existence in key check

* fix duplicate removal
2022-09-18 16:27:03 +03:00
calle
4662a79c3b
little more logging (#953) 2022-09-09 16:46:27 +03:00
calle
d757154125
print time of expiration (#952) 2022-09-09 16:27:37 +03:00
calle
2ee10e28c5
Backend: Unstuck outgoing payments (#857)
* first attempts

* lndrest works

* fix details

* optional fee update

* use base64.urlsafe_b64encode

* return paymentstatus

* CLN: return pending for pending invoices

* grpc wip

* lndgrpc works

* cln: return pending for pending invoices really this time

* retry wallet out of exception

* wip eclair

* take all routines into try except

* cliche: return error

* rename payment.check_pending() to payment.check_status()

* rename payment.check_pending() to payment.check_status()

* eclair: works

* eclair: better error check

* opennode: works

* check payment.checking_id istead of payment.ok

* payment.ok check as well

* cln: works?

* cln: works

* lntxbot: works

* lnbits/wallets/lnpay.py

* cln: error handling

* make format

* lndhub full detail update

* spark: wip

* error to False

* wallets: return clean PaymentResponse

* opennode: strict error

* cliche: works

* lnbits: works

* cln: dont throw error

* preimage not error

* fix cln

* do not add duplicate payments

* revert cln

* extra safety for cln

* undo crud changes until tests work

* tasks: better logging and 0.5s sleep for regular status check

* 0.1 s

* check if wallet exists

* lnbits unhashed description

* remove sleep

* revert app.py

* cleanup

* add check

* clean error

* readd app.py

* fix eclaid
2022-08-30 13:28:58 +02:00
calle
4fc0a25d41
Mega-merge 4: Reenable LndWallet gRPC and use TrackPaymentV2 (#745)
* readd lndgrpc

* debug logging

* Use TrackPaymentV2

* /v2/router/track

* lnd_router_grpc

* flag for blocking check

* error handling

* fix name

* regtest lndgrpc

* new test pipeline

* fix env

* check for description hash

* remove unnecessary asserts for clarity

* assume that description_hash is a hash already

* no lock

* description hashing in backend

* restore bolt11.py

* /api/v1/payments with hex of description

* comment

* refactor wallets

* forgot eclair

* fix lnpay

* bytes directly

* make format

* mypy check

* make format

* remove old code

* WIP status check

* LND GRPC docs

* restore cln to main

* fix regtest

* import

* remove unused import

* format

* do not expect ok

* check ok

* delete comments
2022-08-09 11:49:39 +02:00
dni
808bd36e23 some more mypy fixes 2022-07-25 12:02:59 +02:00
calle
f4e7d62ca3
make format everything (#743) 2022-07-16 14:23:03 +02:00
calle
63d4e60542
Testing: postgres db backend (#711)
* try postgres run

* fix yaml

* test with postgres

* check with postgres

* inkey_from

* remove trio

* add coverage

* add coverage

* more python testing

* use @pytest_asyncio.fixture

* remove unused imports

* fix api_payment payment lookup

* measure durations
2022-07-07 18:29:26 +02:00
calle
906f0166bd
Core: fix internal webhooks (#649)
* fix internal webhooks

* argument annotation
2022-06-03 14:33:31 +02:00
calle
c626e12fa3
LNDHhub for fastapi with LIMIT (#499)
* add limit to get_payments

* add limit to lndhub

* fix defaults

* default memo

* add offset cluase

* offset for the api
2022-02-17 13:10:34 +01:00
Arc
728ab517f5
Merge branch 'main' into fix/disapearingAdminExt 2022-02-11 11:17:37 +00:00
Tiago vasconcelos
6d58027147 remove print 2022-02-10 17:06:15 +00:00
Tiago vasconcelos
4a35f84e95 fix admin default false 2022-02-10 16:44:47 +00:00
benarc
b5aad94ecd rolled back admin fix 2022-02-10 13:55:45 +00:00
benarc
0f79213b0f Tals admin extension fix 2022-02-10 10:09:44 +00:00
Arc
da6a2e772b
Revert "fix disapearing admin extension" 2022-02-10 09:56:02 +00:00
Tiago vasconcelos
d1d62583c4 fix for whitespace in admin users list 2022-02-09 11:16:13 +00:00
Tiago vasconcelos
4c18eb0b34 fix disapearing admin extension 2022-02-09 10:57:24 +00:00
Ben Arc
dbab181759 Admin users can credit accounts 2022-01-31 16:29:42 +00:00
benarc
228717195b back 2022-01-30 19:43:30 +00:00
calle
b4d00a490b
remove restriction for positive amount to check outgoing payments (#500) 2022-01-27 22:58:35 +01:00
calle
32ea1106f9
Crud webhook amount (#474)
* get_standalone_payment selects only incoming tx
2021-12-28 14:05:25 +00:00
Stefan Stammberger
efec7cb8f0 Revert "chore: apply black to all .py files"
This reverts commit 83b7779972.
2021-11-26 05:56:30 +00:00
Stefan Stammberger
83b7779972
chore: apply black to all .py files 2021-11-24 14:31:55 +01:00
benarc
1d3bb016a2 I want them to turn black 2021-10-17 18:33:29 +01:00
Stefan Stammberger
f119053953
fix: main page and creating a user and a wallet
The wallet page will still not renders correctly, but the backend does
create the user his first wallet.
2021-08-24 21:23:18 +02:00
Tiago vasconcelos
b3856d5aff allow wallet rename issue #141 2021-08-06 12:37:30 -03:00
fiatjaf
ffadce02b0 support cockroachdb. 2021-07-02 18:32:58 -03:00
fiatjaf
2f309c9863 postgres support. 2021-07-02 17:34:31 -03:00
fiatjaf
5dbbca0ffb improve invoice deleting code. 2021-05-14 13:13:42 -03:00
fiatjaf
efd9c6917f lnurl balanceCheck and balanceNotify. 2021-04-17 23:21:19 -03:00
fiatjaf
76199c66a1 livestream extension.
(except docs)
2021-04-11 00:44:55 -03:00
fiatjaf
85011d23c3 fix sqlite database locked issues by using an async lock on the database and requiring explicit transaction control (or each command will be its own transaction). 2021-03-26 19:10:30 -03:00
fiatjaf
aabe3364f4 only check pending from the last 15 days. 2021-03-24 01:41:19 -03:00
fiatjaf
42bd5ea989 remove exception to black line-length and reformat. 2021-03-24 00:40:32 -03:00
fiatjaf
7e4a42e7ff stop doing the check_invoices thing on each call. do it once on lnbits starup and then rely on the invoices listener. 2021-03-21 17:57:33 -03:00
fiatjaf
1630a28da0 prettier and black stuff. 2021-03-07 19:18:02 -03:00
fiatjaf
63ae553565 QR codes, printing, success-action and other fixes. 2021-03-07 16:13:20 -03:00
fiatjaf
732d06c1e5 basic offlineshop functionality. 2021-03-07 00:08:36 -03:00
Kristjan
c082c953f3 black formatting 2020-12-31 18:50:16 +01:00
fiatjaf
1c922a5ddc finish webhooks for normal invoices with two extra columns. 2020-12-24 09:39:46 -03:00
fiatjaf
d3fc52cd49 migrate to sqlalchemy-aio.
a big refactor that:

- fixes some issues that might have happened (or not) with asynchronous
    reactions to payments;
- paves the way to https://github.com/lnbits/lnbits/issues/121;
- uses more async/await notation which just looks nice; and
- makes it simple(r?) for one extension to modify stuff from other extensions.
2020-11-21 23:02:14 -03:00
fiatjaf
04222f1f01 basic invoice listeners. 2020-10-04 12:04:47 -03:00
fiatjaf
f01028eac7 migrate from flask to quart.
also remove all flaskiness from static file serving.
and reference all vendored scripts on the base tempĺate for simplicity.
2020-09-14 16:03:25 -03:00
fiatjaf
6210305791 checking pending invoices and payments from lndhub interface. 2020-09-12 21:55:13 -03:00
fiatjaf
4855e2cd3d make every request a database transaction. 2020-09-11 14:17:09 -03:00
fiatjaf
487f082eb2 take extra care on check_internal() 2020-09-11 14:17:09 -03:00
fiatjaf
ab6229806c fix: column is called hash, not payment_hash. 2020-09-06 22:15:29 -03:00
Eneko Illarramendi
23cfe0d417 chore: update github workflows 2020-09-03 23:10:41 +02:00
fiatjaf
dc3d96c6a8 fix many mypy complaints, specially on bolt11.py 2020-09-02 22:21:56 -03:00
fiatjaf
197af922d0 use {"tag": ext} for extension-related payments. 2020-09-02 12:44:54 -03:00
fiatjaf
4447a48724 deleting expired invoices based on their actual expiry date.
also fixes a possible bug that could have caused pending outgoing
payments to be deleted and affecting the balance. probably never happened.
2020-09-02 11:10:48 -03:00
fiatjaf
bf3c44b3c4 extra fields on apipayments + index payments by payment_hash 2020-09-02 11:10:48 -03:00
arcbtc
c96b22664e internal payments. 2020-09-02 11:10:48 -03:00
fiatjaf
fadddc995a get_wallet_payments with more fine-grained, explicit filters. 2020-08-31 22:16:19 -03:00
fiatjaf
24dc6e5415 fix validation rules so description_hash works. 2020-07-04 22:28:08 -03:00
fiatjaf
c3ce18c8d9 allow inkey endpoints to be accessed with adminkeys. 2020-05-05 05:46:05 -03:00
Eneko Illarramendi
c3e337a319 fix: mypy errors 2020-04-26 16:58:29 +02:00
Eneko Illarramendi
efb9deb028 feat: remove FEE_RESERVE 2020-04-21 23:17:11 +02:00
Eneko Illarramendi
d4c9043278 feat(core): delete expired payments 2020-04-17 21:13:57 +02:00
Eneko Illarramendi
dd23b20090 chore: various tweaks 2020-04-16 20:58:16 +02:00
Eneko Illarramendi
fb7dfb3a32 chore: minor fixes 2020-04-05 12:19:25 +02:00
Eneko Illarramendi
d03785558b refactor: a wallet is a wallet is a wallet 2020-03-31 19:05:25 +02:00
Eneko Illarramendi
75d97ddfc1 refactor: camera ready 2020-03-10 23:12:22 +01:00
Eneko Illarramendi
49addb8d56 refactor: breaking bad 2020-03-08 23:00:41 +01:00
Eneko Illarramendi
d862b16ee6 refactor: "payments" is the name, and API updates 2020-03-07 22:27:00 +01:00
Eneko Illarramendi
f98a5040ac refactor: decorators, models and more broken bits 2020-03-04 23:11:15 +01:00