Commit Graph

593 Commits

Author SHA1 Message Date
Michael Bumann
95a979a05f Merge branch 'main' into feature/configurable-port 2022-01-23 19:42:52 +02:00
Michael Bumann
bbada328d5 Longer login/passwords 2022-01-22 23:59:05 +01:00
Michael Bumann
c8de57c876 Update README.md 2022-01-23 00:55:26 +02:00
Michael Bumann
c2edd1302d Update notes.md 2022-01-23 00:40:03 +02:00
Michael Bumann
3e3e5fb3cf Document PORT config option 2022-01-22 23:25:31 +01:00
Michael Bumann
9435f75d1f Merge pull request #66 from getAlby/db/better-pg-constraints
Trying to get the PG constraints working
2022-01-23 00:23:07 +02:00
Michael Bumann
436baeeccb Merge pull request #64 from getAlby/invoice-update-subscriptions
First draft to subscribe for LND invoice update
2022-01-23 00:22:46 +02:00
Michael Bumann
f6559a6a0c Make port configurable 2022-01-22 23:11:13 +01:00
Michael Bumann
edd2abedfb Do not fail if invoice does not have a description 2022-01-22 23:05:21 +01:00
Michael Bumann
35e7da2f30 Search for correct state 2022-01-22 22:57:14 +01:00
Michael Bumann
af8c72d2c9 Store invoice expiry and use search for not expired invoices in the invoice subscription
When subscribing for invoice updates we only subscribe to not expired invoices.
We assume expired invoices will never get paid.
2022-01-22 21:11:19 +01:00
Michael Bumann
891dd8394c DRY up error responses 2022-01-22 20:38:14 +01:00
Michael Bumann
1359d97d6a Better payinvoice response
This is not exactly the response that lndhub gives but it should be good enough
2022-01-22 19:20:40 +01:00
Michael Bumann
39e162088a Do not return invoices that are in the initialized state
Initialized is an internal state before the invoice was created on LND.
We should not expose those. If an invoice is in that state it means it is either currently created or something went wrong.
2022-01-22 15:44:05 +01:00
Michael Bumann
0de0ed18b4 Missing fix 2022-01-22 15:19:30 +01:00
Michael Bumann
0de314abbc Fix typo 2022-01-22 14:33:23 +01:00
Michael Bumann
0021dc0a2e Update README.md 2022-01-22 15:22:41 +02:00
Michael Bumann
20e94714a5 Merge pull request #48 from getAlby/populate-readme
WIP: Populate Readme
2022-01-22 14:38:33 +02:00
Michael Bumann
d90a695172 Context how do they work... 2022-01-22 13:32:15 +01:00
Michael Bumann
a4e597ccfc Comments 2022-01-22 13:30:13 +01:00
Michael Bumann
b54f04701f Start invoice subscription from the last unsettled invoice
We want to get updates starting from those invoices.
This allows us to catch up in case the app was offline while some invoices got settled
2022-01-22 13:24:51 +01:00
Michael Bumann
319524ea4c Trying to get the PG constraints working
This uses row level locking on the accounts. If two transactions access the same account one fails
2022-01-22 13:00:46 +01:00
Michael Bumann
c75e703d80 Try reconnecting on invoice subscription errors 2022-01-22 12:57:00 +01:00
Michael Bumann
1c8d8a99b5 Merge pull request #65 from getAlby/fix/db-locked-err
use bun.Tx to avoid db locked err
2022-01-22 11:42:29 +02:00
kiwiidb
366f66a2e2 use bun.Tx to avoid db locked err 2022-01-22 10:33:54 +01:00
Michael Bumann
71eabae443 Split up process invoice updates 2022-01-21 21:29:16 +01:00
Michael Bumann
12dbb48c8d First draft to subscribe for LND invoice update 2022-01-21 20:57:41 +01:00
Michael Bumann
613a485d7e Merge pull request #54 from getAlby/payinvoice
Payinvoice
2022-01-21 21:56:12 +02:00
Michael Bumann
3e088a7652 Pass invoice description hash string to LND 2022-01-21 17:40:52 +01:00
Viktor Patchev
f02c20a2a6 Update readme 2022-01-21 17:18:37 +01:00
Michael Bumann
2606403489 Use tx to call do the db updates 2022-01-21 15:12:08 +01:00
Michael Bumann
43aba70dd8 Fix invoice preimages for internal payments
We create the preimage on incoming invoices. If it is an internal incoming payment (meaning from one user to another user) we use that preimage and save it on the outgoing invoice.
This makes sure we can give wallets the correct preimage for a payment request even though no lightning transaction happened
2022-01-21 13:56:02 +01:00
Michael Bumann
89acf29b24 cleanup 2022-01-21 12:25:19 +01:00
Michael Bumann
f683a22a66 Correct gettxs and getuserinvoices responses 2022-01-21 12:22:49 +01:00
Michael Bumann
228edcbe39 Return user invoices
and maybe correctly encode the Buffers?
2022-01-21 11:49:08 +01:00
Michael Bumann
55fbaeea92 nullzero entry for the parent txn 2022-01-21 11:17:19 +01:00
Michael Bumann
a5d1c3f4ed Add constraint to invoices DB to make sure settled invoices have a preimage saved
We just try to store as much potential relevant information as possible.
This could help debugging and verifiying payments if there is an issue
2022-01-21 11:16:48 +01:00
Michael Bumann
2097807c85 Support Amount values as string/integer in request JSON 2022-01-21 11:15:35 +01:00
Michael Bumann
289d7405f1 Rollback only in the SendPayment call
this one handles the transactions which is passed to the SendPaymentSync and SendInternalPayment call
2022-01-20 19:00:49 +01:00
Michael Bumann
9ed269dedf Split up functions for internal vs. external payments 2022-01-20 18:31:03 +01:00
Michael Bumann
7d955a1d7b Support self-payments
If the destination of the invoice is our node we only create internal transaction entries and do not call the underlaying lightning node
2022-01-20 16:50:26 +01:00
Michael Bumann
90a686677f Save invoice destination
And save the node pubkey in the service to make it usable
2022-01-20 15:41:50 +01:00
kiwiidb
ef169f7857 fix main branch name in workflow 2022-01-20 15:19:32 +01:00
kiwiidb
955a181a54 use newer dockerfile 2022-01-20 15:17:35 +01:00
Michael Bumann
72e9c9f1fd Merge pull request #59 from getAlby/feature/ci
Feature/ci
2022-01-20 15:46:04 +02:00
Michael Bumann
7d6dc15b8c Merge branch 'main' into payinvoice
* main:
  Correct style
  Add blank routes required for bluewallet
2022-01-20 14:28:26 +01:00
Michael Bumann
9e78d9001e Merge pull request #58 from getAlby/blank-routes
Add blank routes required for bluewallet
2022-01-20 15:28:04 +02:00
Michael Bumann
1d17708875 Correct style 2022-01-20 14:20:15 +01:00
kiwiidb
f2158de902 add dockerfile and workflow 0.0.1 2022-01-20 14:20:01 +01:00
Michael Bumann
3a67f86a34 Merge main 2022-01-20 14:15:40 +01:00