Stefan Stammberger
5eb39c52a0
feat: add sync to blitz make target
2021-12-05 21:14:25 +01:00
Stefan Stammberger
7e2d383ea5
fix: process payment requests with route hints
...
fixes #54
2021-12-04 12:13:23 +01:00
Stefan Stammberger
20e0457a73
feat: send a wallet_locked_status SSE message
...
When someone connects to the SSE endpoint and the wallet is
locked a message with event name `wallet_lock_status` type is sent:
```js
// only sent when a new SSE connection is established and the wallet is
// locked at the same time
event: wallet_lock_status
data: {"locked": true}
```
When the wallet is unlocked either through SSH or the API, another
event is sent:
```js
// sent always when a new connection is established when the wallet
// is unlocked, or it is sent when the wallet was unlocked after
// connection was established
event: wallet_lock_status
data: {"locked": false}
```
It is always the first thing the client receives. After the unlock
event, the usual warmup data is sent.
refs #34
2021-11-30 19:57:17 +01:00
Stefan Stammberger
8e32b68786
feat: listen for external unlocks via command line
...
refs #34
2021-11-30 17:18:42 +01:00
Stefan Stammberger
a7dfe14aea
feat: round verification_progress value in SSE
...
Bitcoin Core calculates the blockchain verification by including
unconfirmed transactions. This means that everytime there is
a new transaction, a `btc_info` event is fired through the SSE
channel. For clients this information is usually not useful beyond
two digits. Solution: round to two digits for SSE events.
The full floating point value can still be fetched through
`/bitcoin/get-blockhain-info`
closes #52
2021-11-28 10:30:54 +01:00
Stefan Stammberger
71f87e06d7
feat: implement local cookie authentication
...
This is only useful for application running directly on the Raspiblitz.
This will create a file in ~/.blitz_api/.cookie with a valid JWT token.
Local applications can use this to authenticate to the API without
having to ask for the password. This is similar to how Bitcoin Cores
cookie auth works.
2021-11-28 08:42:52 +01:00
Stefan Stammberger
782464b61d
feat: implement handling of locked wallets
...
* new endpoint: /lightning/unlock-wallet
* ln endpoints return HTTP_423_LOCKED status if wallet is locked
* bootup sequence defers ln listeners setup if wallet is locked
refs #34
2021-11-24 11:12:10 +01:00
Stefan Stammberger
ba4aa25c01
chore: update grpc files and add WalletUnlocker
2021-11-23 20:19:03 +01:00
Stefan Stammberger
3c7a22e417
feat: implement /lightning/new-address endpoint
...
closes #43
2021-11-22 21:54:42 +01:00
Stefan Stammberger
63c52d2ba7
fix: encode JWT expiry time as int, not float
...
fixes #46
2021-11-22 20:44:14 +01:00
Stefan Stammberger
7b94aac3d8
feat: add "/system/refresh-token" endpoint
...
closes #41
2021-11-19 18:32:30 +01:00
Stefan Stammberger
bd6d293259
fix: tests and simplify the test code
...
refs# 21
2021-11-19 17:28:39 +01:00
Stefan Stammberger
964514f90c
fix: return HTTP status 401 when unauthorized
...
Previous status code 403 was inappropriately used.
2021-11-19 08:36:15 +01:00
Stefan Stammberger
58af4f56d5
feat: send full LnInfo when a new client connects
2021-11-18 19:50:04 +01:00
Stefan Stammberger
6ca9b97b87
fix: problems with included external packages
...
* Add proper licensing information
* Move sse_starlette to the externals folder
2021-11-18 11:30:48 +01:00
Stefan Stammberger
3a16015f23
chore: update dependencies
...
Package operations: 3 installs, 26 updates, 1 removal
• Removing chardet (4.0.0)
• Updating typing-extensions (3.10.0.2 -> 4.0.0)
• Updating zipp (3.5.0 -> 3.6.0)
• Updating async-timeout (3.0.1 -> 4.0.1)
• Installing frozenlist (1.2.0)
• Updating idna (3.2 -> 3.3)
• Updating importlib-metadata (4.8.1 -> 4.8.2)
• Updating multidict (5.1.0 -> 5.2.0)
• Updating pyparsing (2.4.7 -> 3.0.6)
• Updating aiojobs (0.3.0 -> 1.0.0)
• Installing aiosignal (1.2.0)
• Installing asynctest (0.13.0)
• Updating certifi (2021.5.30 -> 2021.10.8)
• Updating charset-normalizer (2.0.6 -> 2.0.7)
• Updating click (8.0.1 -> 8.0.3)
• Updating fastapi (0.68.1 -> 0.68.2)
• Updating grpcio (1.40.0 -> 1.42.0)
• Updating packaging (21.0 -> 21.3)
• Updating protobuf (3.18.0 -> 3.19.1)
• Updating py (1.10.0 -> 1.11.0)
• Updating regex (2021.9.24 -> 2021.11.10)
• Updating tomli (1.2.1 -> 1.2.2)
• Updating typed-ast (1.4.3 -> 1.5.0)
• Updating yarl (1.6.3 -> 1.7.2)
• Updating aiohttp (3.7.4.post0 -> 3.8.1)
• Updating black (21.9b0 -> 21.11b1)
• Updating deepdiff (5.5.0 -> 5.6.0)
• Updating grpcio-tools (1.40.0 -> 1.42.0)
• Updating pyjwt (2.1.0 -> 2.3.0)
• Updating python-decouple (3.4 -> 3.5)
2021-11-18 11:01:26 +01:00
Stefan Stammberger
2349d917b9
feat: add a "make export" command to Makefile
...
Export will update the requirements.txt file fir pip.
2021-11-18 10:57:27 +01:00
Stefan Stammberger
f9aae93ce9
fix: install problem due to include from git repo
...
fixes #40
2021-11-18 08:31:46 +01:00
Stefan Stammberger
ae59ef9181
feat: implement /lightning/list-all-tx endpoint
...
This call currently fetches all invoices, payments and transactions each
time the endpoint is hit. TODO: Find a better way to cache this.
Possibly it is a good idea to build this list once on startup and
keep it updatedwhen new transactions roll in.
refs #30
2021-11-02 19:02:08 +01:00
Stefan Stammberger
be1f1f6dde
feat: implement /lightning/list-payments endpoint
...
Currently implemented for LND only.
Low level list-payments endpoint in preparation to implement #30 .
2021-10-31 19:33:35 +01:00
Stefan Stammberger
4a6c6e9cf4
feat: implement /lightning/list-invoices endpoint
...
Currently implemented for LND only.
Low level list-invoices endpoint in preparation to implement #30 .
2021-10-31 19:04:39 +01:00
Stefan Stammberger
93d3fe3d51
fix: /lightning/list-onchain-tx route naming
2021-10-31 18:21:46 +01:00
Stefan Stammberger
21f0f389e3
refactor: implement grpc loaders as classmethods
2021-10-31 18:15:43 +01:00
Stefan Stammberger
5e068f0cb1
feat: implement list-onchain-tx endpoint for LND
...
Low level on-chain API in preparation to implement #30 .
2021-10-31 16:49:15 +01:00
fusion44
4d9030eac0
Merge pull request #38 from fusion44/sse-fix
...
fix: sse message composition
2021-10-30 21:46:55 +02:00
Stefan Stammberger
3f8860999b
fix: sse message composition
2021-10-27 19:23:21 +02:00
Stefan Stammberger
0acb332c65
docs: improve lightning/get-balance documentation
...
closes #27
2021-10-16 16:59:52 +02:00
Stefan Stammberger
6ad707e3ea
fix: SSE message JSON encoding
...
fixes #23 , #24 , #25
2021-10-12 21:36:15 +02:00
Stefan Stammberger
4d5ffbc03e
refactor: Shorten the url path of get ln info lite
...
old: /lightning/get-ln-info-lite
new: /lightning/get-info-lite
2021-10-05 19:50:32 +02:00
Stefan Stammberger
27463dfbfe
feat: Send warmup data to new SSE clients
...
closes #9
2021-10-05 19:36:09 +02:00
Stefan Stammberger
2d18e5a33f
refactor: Rename poorly named classes and events
2021-10-05 19:34:06 +02:00
fusion44
54760b04c1
Merge pull request #22 from cstenglein/add-cors-header
...
add CORS headers to responses
2021-10-04 20:17:58 +02:00
Christoph Stenglein
2ab56ca774
only allow localhst:3000 since other ports are not needed
2021-10-04 17:36:56 +02:00
Christoph Stenglein
c7cd337bf8
add CORS headers to responses
2021-10-04 17:30:01 +02:00
Stefan Stammberger
a8355687d4
feat: implement send coins (on-chain) endpoint
...
closes #15
2021-10-03 20:55:28 +02:00
Stefan Stammberger
8d1357cf09
feat: use secrets.compare_digest in login
...
More info:
https://fastapi.tiangolo.com/advanced/security/http-basic-auth/#timing-attacks
2021-10-03 10:58:46 +02:00
Stefan Stammberger
f7e1cf206d
test: improve ln test setup and coverage
2021-10-03 10:37:51 +02:00
Stefan Stammberger
0dfe740978
fix: remove wrong import
2021-10-03 10:32:06 +02:00
Stefan Stammberger
1748e5ba1c
feat: Add a Makefile as build system
2021-10-02 12:10:52 +02:00
Stefan Stammberger
acf7c7a03d
fix: Argument errors in Bip9Statistics.from_rpc
2021-10-02 12:02:29 +02:00
Stefan Stammberger
10cd9f7e79
test: Add testing dependencies and first tests
2021-10-02 12:00:44 +02:00
Stefan Stammberger
93610c8588
chore: update vscode config files
2021-10-02 10:01:43 +02:00
Stefan Stammberger
8ce482d6a8
refactor: move main.py file into the "app" package
...
This is in preparation to adding testing functionalities.
Also applied some formatting and removed unused imports to main.py
2021-10-02 10:01:17 +02:00
Stefan Stammberger
abc8b258ff
fix: BtcLocalAddress.from_rpc method
2021-10-01 22:31:22 +02:00
Stefan Stammberger
599bf36e53
fix: redirect to latest docs
2021-10-01 22:07:09 +02:00
Stefan Stammberger
640418795e
feat: improve naming conventions of APIs
2021-09-26 21:57:55 +02:00
Stefan Stammberger
3c722aa888
chore: update dependencies
2021-09-26 21:34:41 +02:00
fusion44
b5704b5af3
Merge pull request #20 from cstenglein/change_debug_log
...
change debug script path
2021-09-26 21:29:00 +02:00
Stefan Stammberger
900bfef495
fix: handling of multiple SSE clients
...
fixes #8
2021-09-26 21:26:39 +02:00
Christoph Stenglein
7ddf166f14
change debug script path
2021-09-26 18:21:38 +02:00