Commit Graph

479 Commits

Author SHA1 Message Date
Arc
ef6d12fe10
Merge pull request #545 from talvasconcelos/fix/paymentsDecode
fix payments decode
2022-03-07 04:24:32 +00:00
benarc
5f52658626 Merge remote-tracking branch 'origin/main' into main 2022-03-07 04:05:43 +00:00
Joseph Pentland
baf55afc28
api: Fix conversion from fiat to satoshis (#516)
Conversion to satoshis incorrectly used data.to as fiat currency rather
than data._from.
2022-03-01 23:11:39 +03:00
benarc
e96701cb59 Added template banner 2022-02-24 16:03:10 +00:00
benarc
4a588dda1b Added ad space and option to turn off api docs 2022-02-23 13:51:30 +00:00
Tiago vasconcelos
eb7b369b6d fix payments decode 2022-02-22 16:45:35 +00:00
Tiago vasconcelos
a5a3331106 revert to fallback scheme + make request case insensitive 2022-02-22 16:23:50 +00:00
Arc
88df4266b7
Merge pull request #524 from lnbits/docs_api_add_unit_to_invoice
Fix fiat amount entry in invoice creation
2022-02-18 11:44:05 +00:00
callebtc
6496fac35f fill mask for fiat 2022-02-18 12:35:25 +01:00
Tiago vasconcelos
251ecb8f1d url_for params 2022-02-17 21:01:14 +00: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
callebtc
13a72d9a41 replace string with LNBITS_SITE_TITLE 2022-02-17 11:42:08 +01:00
callebtc
15c8557459 allow empty memo 2022-02-17 10:16:11 +01:00
callebtc
d559c604fa invoice without memo 2022-02-17 09:29:10 +01:00
callebtc
cd84623305 amount label adaptive to uni - look at me Im a frontent dev now 2022-02-17 09:14:07 +01:00
callebtc
9fb30080ab black 2022-02-16 22:42:27 +01:00
callebtc
30ab519c3a amount is float and sats are int 2022-02-16 22:41:12 +01:00
callebtc
914b9f3ffe allow amounts >0 2022-02-16 22:23:26 +01:00
Ben Arc
0367ee85a7 removed dense from lower buttons 2022-02-14 15:51:45 +00:00
Ben Arc
0aef9d4d9a Made dense to save space 2022-02-14 15:48:56 +00:00
Ben Arc
682226c4b6 chnaged button names 2022-02-14 15:36:10 +00:00
Ben Arc
c7e501ac08 Adds lower buttons to wallet UI for smaller screens 2022-02-14 15:29:10 +00:00
Arc
155c32504a
Update api.py 2022-02-14 11:31:42 +00: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
benarc
a7c65d5d60 Fixed admin debit input 2022-02-03 13:15:43 +00:00
benarc
50fcb15725 typo 2022-02-03 13:00:56 +00:00
benarc
75e78d2ab6 FakeWallet own denomination now working 2022-02-02 17:28:00 +00:00
benarc
568a1be91f Adding denomination for alternative currencies 2022-02-02 13:07:12 +00:00
Ben Arc
dab943baad fixed internal lnurl 2022-02-01 23:11:26 +00:00
Ben Arc
db734d4acd added hex 2022-02-01 23:04:40 +00:00
Ben Arc
3927545e32 fixed buggy lnurl checks 2022-02-01 21:22:20 +00:00
Ben Arc
3f0a855526 Black 2022-02-01 20:51:40 +00:00
Ben Arc
d2879aa80c added value to avoid error 2022-02-01 20:05:58 +00:00
Ben Arc
d1b390b929 Use scope instead of prop 2022-02-01 20:02:21 +00:00
Ben Arc
382622d5ac Fixed balance update not showing properly 2022-01-31 16:47:58 +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
Tiago Vasconcelos
918e9be7ed
Upgrade conversion endpoint (#491) 2022-01-14 09:19:30 -03:00
benarc
4e0e5b9956 Added conversion endpoint
Exposes fiat_amount_as_satoshis
2022-01-11 15:11:48 +00:00
Tiago vasconcelos
a00e46f629 Change _asdict() to dict() 2022-01-05 07:36:10 -03:00
mrbitcoiner
cdeccec01b 2% reserve only for external payments 2021-12-29 11:55:52 -03:00
calle
32ea1106f9
Crud webhook amount (#474)
* get_standalone_payment selects only incoming tx
2021-12-28 14:05:25 +00:00
benarc
4408f30285 removed print 2021-12-19 23:13:15 +00:00
benarc
fa23be7657 Added check fixed LNURL decode 2021-12-03 00:17:32 +00:00
benarc
907714838b Added check to explain fee reserve 2021-12-02 21:22:30 +00:00
benarc
69a4583203 wos debugging
lnurl debug

text identifier

text

try1

try2

debugging

more debug

...

....

hard code indentifier

.

more hard code

.

trying

revert

remove identifier

adding identifier...again

.

stupid

return text instead of json

htmlresponse

on more spin

.

added tag

revert to JSON return

.

ditch lnurl lib

.

..

..

clean prints
2021-12-01 21:55:04 +00:00
benarc
b9bc36fabf Merge remote-tracking branch 'origin/FastAPI' into FastAPI 2021-11-30 10:08:46 +00:00
Arc
b4ad8cb5b2
Merge pull request #443 from lnbits/fastapi_fix_lndrestwallet_fee_limit
(FastAPI) LNDRest fee limit
2021-11-30 09:04:01 +00:00
callebtc
12c2a04b2a LNDRest fee limit 2021-11-29 18:10:11 +01:00
Stefan Stammberger
3831bca9e2
fix: cleanup core/views/generic.py
* Fixed withdraw endpoint query params access
    was: request.query_params.get("usr")
    corrected: request.query_params.get("usr")
* Added missing response classes
* Removed old comments and commeted out code
* Deleted the unused auth_bearer.py file
2021-11-27 10:13:32 +01:00
Arc
ed198d3e7d
Merge pull request #435 from arcbtc/FastAPI
Cleanup and black
2021-11-26 05:59:10 +00:00
benarc
56397026c8 Chore, applied black 2021-11-26 05:58:20 +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
Tiago vasconcelos
2b0bd43974 clean prints 2021-11-25 17:26:46 +00:00
Tiago vasconcelos
b33f0ecae2 request issues again 2021-11-25 17:24:03 +00:00
Tiago vasconcelos
ae50b909eb again 2021-11-25 17:19:49 +00:00
Tiago vasconcelos
98a55bf0df request client 2021-11-25 17:12:41 +00:00
Tiago vasconcelos
4fff5c3b7a missing request 2021-11-25 17:08:20 +00:00
Stefan Stammberger
83b7779972
chore: apply black to all .py files 2021-11-24 14:31:55 +01:00
Arc
09ccf01fbb
Merge pull request #429 from arcbtc/FastAPI
added lnaddresss for testing
2021-11-24 08:56:13 +00:00
benarc
b122debd8c Merge remote-tracking branch 'arcbtc/lnaddress' into FastAPI 2021-11-24 08:42:14 +00:00
Arc
a3d2e43a4c
Merge pull request #418 from arcbtc/FastAPI
Posgres support
2021-11-15 20:46:49 -06:00
Tiago vasconcelos
e8882645c4 remove IF NOT EXISTS in CREATE VIEW 2021-11-15 21:45:13 +00:00
callebtc
bec0b1d1fe fix db connect 2021-11-13 11:42:11 +01:00
fiatjaf
0331861cc6 prevent pay_invoice from locking sqlite for the entire app. 2021-11-12 13:05:10 -03:00
benarc
267dea4f75 black 2021-11-12 04:14:55 +00:00
Ben Arc
cbc24a8fa5 Changed optional unit to sat 2021-11-09 22:25:20 +00:00
Ben Arc
1b46b61da9 changed see endpoint key back 2021-11-09 20:50:00 +00:00
Ben Arc
81d8d4e218 plugged few key issues 2021-11-09 17:44:05 +00:00
Ben Arc
a50c7b6e3a Added some IF NOT EXISTS to avoid errors on startup 2021-11-09 15:17:44 +00:00
benarc
114a6f1fed Made memo optional in model 2021-11-04 12:57:28 +00:00
benarc
43e016633b fixed unit check 2021-11-03 12:09:39 +00:00
benarc
3750dcfd0e fixed descrhash check 2021-11-03 12:03:48 +00:00
benarc
afbe46be8b reverted memo default 2021-11-03 11:49:13 +00:00
benarc
0c0e6e9275 chnaged memo back from optional 2021-11-03 11:23:16 +00:00
benarc
4fe45b34d1 added default memo value 2021-11-03 11:19:51 +00:00
benarc
3336767057 made default meme 2021-11-03 11:14:41 +00:00
benarc
97e4ced2f4 fixed bug 2021-11-03 11:07:01 +00:00
benarc
52455e14cd tweaked create_invoice 2021-11-03 11:02:33 +00:00
benarc
abff990ec3 Changed lnbits wallet check to detail from message 2021-11-03 10:29:39 +00:00
benarc
c734526bc1 reverted exception 2021-11-03 10:12:14 +00:00
benarc
00ec6f2af3 added NOT_FOUND to check payment endpoint, rather than OK 2021-11-03 09:49:52 +00:00
benarc
9630d8b363 restored create invoice api endpoint 2021-11-02 16:29:15 +00:00
Tiago vasconcelos
aff29663af lnaddress_ext proposal untested 2021-10-29 16:43:26 +01:00
Tiago vasconcelos
a276764f12 wallet fiat conversion fix 2021-10-29 13:06:59 +01:00
Tiago vasconcelos
55023fa85b fix delete wallet 2021-10-25 19:26:21 +01:00
benarc
e03370188a Fixed payment checking 2021-10-22 00:41:30 +01:00
Ben Arc
19df2f888b Added decode lnurl and extra payment check 2021-10-20 03:59:24 +01:00
Ben Arc
b6f5052da0 trying to fix payment check 2021-10-20 03:28:31 +01:00
benarc
cf6fae2ca7 Added internal payment listener to paid invoices and splitpayments 2021-10-18 13:24:32 +01:00
Tiago vasconcelos
19a50e3638 add default memo 2021-10-18 12:23:57 +01:00
benarc
1d3bb016a2 I want them to turn black 2021-10-17 18:33:29 +01:00
Stefan Stammberger
c5d96d21e9
fix: core pay via lnurl endpoint 2021-09-19 13:25:39 +02:00
Stefan Stammberger
32ca6289df
fix: broken payment API implementation 2021-09-19 09:31:16 +02:00
Stefan Stammberger
3bae5c92c2
fix: /extensions endpoint 2021-09-11 20:44:22 +02:00
Stefan Stammberger
9e76668269
fix: send payments via Wallet UI 2021-09-11 11:47:05 +02:00
Stefan Stammberger
63d0242685
fix: more return types 2021-09-11 11:02:48 +02:00
Stefan Stammberger
fa08177317
fix: FastAPify how data or exceptions are returned
FastAPI handles returning HTTPStatus codes differently than Quart did
2021-09-10 21:40:14 +02:00
Stefan Stammberger
d9849d43d2
refactor: replace Trio with asyncio/uvloop 2021-08-30 19:55:02 +02:00
Stefan Stammberger
fe79709698
fix: several more API calls restored 2021-08-29 19:38:42 +02:00
Stefan Stammberger
3e5af8c1d1
refactor: purge Quart from the codebase
Most functionality is still broken
2021-08-27 20:54:42 +02: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
Stefan Stammberger
6f38fdc39b
feat: move all non-api routes to their own router
This unclutters the docs page a bit by making html routes collapsible.
2021-08-23 21:17:46 +02:00
Ben Arc
e03eb3c82b Fixed formatting 2021-08-22 23:05:39 +01:00
Stefan Stammberger
938fc54af3
feat: switch from Quart to FastAPI part I 2021-08-22 20:07:24 +02:00
Ben Arc
2fb16d0382 Trying to add query params 2021-08-21 19:04:10 +01:00
Stefan Stammberger
d20c3ce119
fix: syntax errors 2021-08-21 12:14:23 +02:00
Ben Arc
bbdb96f4ac Converted views 2021-08-21 01:55:07 +01:00
Ben Arc
d3d24abb17 removed json_encoders 2021-08-21 00:39:31 +01:00
Ben Arc
c4b37c6508 Converted some core stuff 2021-08-20 21:31:01 +01:00
Stefan Stammberger
37a7950f0f
fix: syntax errors 2021-08-20 20:54:59 +02:00
Ben Arc
bfd9ca68e4 Broken, trying to convert 2021-08-18 21:40:50 +01:00
Ben Arc
0eccfb83f0 Trying list data validation 2021-08-16 20:30:11 +01:00
Ben Arc
1118b0ba56 Started converting endpoints 2021-08-16 19:27:39 +01:00
cd2357
b53ad5b64a Create Invoice popup: Mark memo field as required
Both amount and memo are required by the API, but only the amount field is marked as such in the UI. This commit also marks the memo field as required.
2021-08-14 06:01:21 -03:00
fiatjaf
8f2b42309d revert b7ed7fab59 2021-08-11 22:53:11 -03:00
Tiago Vasconcelos
b7ed7fab59
(TEMP) fix tickets not showing after payment (#292) 2021-08-11 13:52:54 -03:00
fiatjaf
b96a6661f8 fix "requesting" display for addresses. 2021-08-10 08:11:51 -03:00
fiatjaf
a019d29b9b support pay-to-identifier. 2021-08-10 07:25:51 -03:00
Tiago vasconcelos
723c9ea3ab cleanup 2021-08-06 12:37:30 -03:00
Tiago vasconcelos
b3856d5aff allow wallet rename issue #141 2021-08-06 12:37:30 -03:00
Tiago vasconcelos
d582ee87e5 fix postgres not showing payments 2021-08-05 08:57:50 -03:00
fiatjaf
e0496fb244 fix postgres type translation bug and add some logs. 2021-08-01 10:30:27 -03:00
Ben Arc
aa1c83cdc4 added dynamic titles for continuity 2021-07-25 14:26:20 +01:00
davidfrayne
3331dfeab6 Fix payments filter on wallets.html 2021-07-12 10:52:31 -03:00
fiatjaf
f6e255d9be remove one extra core.schema. 2021-07-03 15:39:58 -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
Ben Arc
ae0849143b Easier to customise title/tagline
Also added description that can replace frontpage blurb
2021-07-02 12:31:05 +01:00
Ben Arc
55c564fe21 Fixed jukebox to match style 2021-06-30 13:38:10 +01:00
Ben Arc
b0c0b9f851 Changed primary/secondary colours to branded 2021-06-29 02:10:30 +01:00
Ben Arc
8f441f32b5 added envs, testing color switch 2021-06-28 22:57:23 +01:00
fiatjaf
6f88973f75 fail longpolling endpoint after 45 seconds.
this should fix a possible bug in which connections are left open forever or worse.
2021-06-23 17:21:53 -03:00
Ben Arc
4d6e49cf0d made descriptions small for extensions 2021-06-23 20:21:27 +01:00
fiatjaf
688149fade add trio typing. 2021-06-20 21:17:32 -03:00
fiatjaf
f875dc7b63 "unit" optional on invoice creation, defaults to "sat" 2021-06-19 09:12:16 -03:00
fiatjaf
64c4b97ec9 catch error on redeem_lnurl_withdraw call. 2021-06-17 13:26:09 -03:00
Tiago vasconcelos
d91dbbcac3 allow invoices to be generated using Fiat values 2021-06-14 11:13:49 -03:00
oriolpont
37d9e30362 Change minWithdrawable from 1 msat to 1000 msats for the lnurl_full_withdraw
1 msat is fractional and thus unacceptable anyway. Also, when withdrawing from lnbits itself, this interferes with the input form to expect fractional 1.001 steps
2021-06-12 12:32:40 -03:00
fiatjaf
fc792f874b public api for checking an invoice status with longpolling. 2021-06-02 17:05:07 -03:00
fiatjaf
b06e1c8fa9 try-catch in pay_invoice on global lnurl-withdraw. 2021-06-01 13:28:05 -03:00
fiatjaf
b9db504f34 fix links to extensions in payments tags. 2021-05-21 22:57:22 -03:00
fiatjaf
5dbbca0ffb improve invoice deleting code. 2021-05-14 13:13:42 -03:00
fiatjaf
2b21a4f479 g.nursery -> current_app.nursery 2021-05-06 12:41:44 -03:00
fiatjaf
bcecf6d431 handle invalid lnurl-w responses on redeem_lnurl_withdraw. 2021-04-23 19:24:04 -03:00
Ben Arc
7134821fcd disable submit if no button 2021-04-22 09:07:35 +01:00
fiatjaf
b55cc82f1c evade lnurl encoding error for withdraw_full QR on localhost. 2021-04-21 23:27:57 -03:00
fiatjaf
2aa4a93da1 handle empty lnurl-withdraws to redeem. 2021-04-21 23:27:57 -03:00
fiatjaf
cbeb888761 fix lnurlwallet flow. 2021-04-17 23:44:26 -03:00
fiatjaf
a413685160 fix redeem_lnurl_withdraw code. 2021-04-17 23:30:26 -03:00
fiatjaf
943237e7ff prettier fixes. 2021-04-17 23:21:27 -03:00
fiatjaf
efd9c6917f lnurl balanceCheck and balanceNotify. 2021-04-17 23:21:19 -03:00
Ben Arc
a3bd36d44f Fixed 'runs on' images 2021-04-13 21:42:53 +01:00
fiatjaf
0f998419e7 basic webmanifest thing, must be improved. 2021-04-13 11:50:30 -03:00
Ben Arc
05a0861601 Added funding sources to homepage 2021-04-13 15:43:39 +01:00
Ben Arc
aa2e09bbeb Hidden api keys to prevent over shoulder attacks 2021-04-13 11:10:21 +01:00
fiatjaf
76199c66a1 livestream extension.
(except docs)
2021-04-11 00:44:55 -03:00
fiatjaf
fdf4f6c1ae catch errors in multiple places that might be destroying the async flow and causing lnbits to die silently. 2021-04-10 17:37:48 -03:00
fiatjaf
82731dc901 a special error for when payments fail. 2021-04-06 14:57:51 -03:00
fiatjaf
946279674a stop bloating the logs with checking routine. 2021-03-31 20:24:46 -03:00
fiatjaf
11679a4fa7 actually do the fee abs() thing on the balances view. 2021-03-31 20:22:34 -03:00
Ben Arc
045e069312 All fees are negative 2021-04-01 00:02:24 +01:00
fiatjaf
08d124c62a nicer print checking status. 2021-03-28 01:34:37 -03:00
fiatjaf
e112258c39 improve checking routine.
check pending invoices only once on startup,
then check outgoing payments every 30 minutes,
and delete outgoing payments that return False (meaning they have failed).

also fix a bug on sparko.
2021-03-28 00:11:45 -03:00
fiatjaf
574358a118 fix: lnurlpay comment was being parsed as number. 2021-03-26 21:10:15 -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
a787d60d93 be extra safe when failing a payment if pay_invoice throws on sparko. 2021-03-24 02:02:54 -03:00
fiatjaf
aabe3364f4 only check pending from the last 15 days. 2021-03-24 01:41:19 -03:00
fiatjaf
d4d069fc77 make all methods from all wallets async. 2021-03-24 01:01:09 -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
f27c2ebc21 marginally improve the checkpending situation. 2021-03-21 17:11:00 -03:00
fiatjaf
8df4dd702d
Merge pull request #154 from lnbits/offlineshop 2021-03-14 21:55:52 -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
fiatjaf
ec193ca697 put export-with-qr-code on a toggleable section. 2021-02-13 21:45:22 -03:00
fiatjaf
ea51af90d0 remove "Renew Keys" button.
it wasn't doing anything.
closes https://github.com/lnbits/lnbits/issues/147
2021-02-13 21:45:22 -03:00
Pac
378e408dca Update wallet.html 2021-02-13 21:45:22 -03:00
Pac
e251291076 Display QRcode for easy wallet export
This adds a QRcode of the "url_root/wallet?usr=#####&wal=####" so that
the user can create a wallet on desktop and easily use it on his phone.
Also, in a use case where the <User Manager> extension is used, the
manager can create a wallet and show the QRcode for the user to take it
(e.g. in a hotel front desk the clerk creates it and the user takes it
in his phone browser, to pay for laundry, massage, soda machine...)
2021-02-13 21:45:22 -03:00
fiatjaf
9c126696fc delete pending payments after WALLET.pay_invoice fails.
fixes https://github.com/lnbits/lnbits/issues/138
2021-01-05 22:29:02 -03:00
fiatjaf
45148d285e Revert "Fixed fee deduction "
This reverts commit 14b6e21a02.
2021-01-05 19:49:27 -03:00
Arc
e96c92e6df
Merge pull request #135 from grmkris/extensions/subdomains
subdomains extension
2021-01-05 22:35:06 +00:00
benarc
14b6e21a02 Fixed fee deduction 2021-01-05 21:54:58 +00: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
4623220316 specify webhooks from invoice creation and call them. 2020-12-24 09:39:46 -03:00
fiatjaf
d84915cb00 oops: formatting. 2020-11-21 23:23:11 -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
594e28eab7 formatting. 2020-11-18 22:26:30 -03:00
fiatjaf
a198842f50 wallet name on <title> 2020-11-12 15:32:41 -03:00
fiatjaf
54881d777e lnurl-auth: show wallet name on modal. 2020-11-11 22:43:01 -03:00