No description
Find a file
Vlad Stan bfda0b62da
test: add unit tests for wallets (funding sources) (#2363)
* test: initial commit

* feat: allow external label for `create_invoice` (useful for testing)

* chore: code format

* fix: ignore temp coverage files

* feat: add properties to the Status classes for a better readability

* fix: add extra validation for data

* fix: comment out bad `status.pending` (to be fixed in core)

* fix: 404 tests

* test: first draft of generic rest wallet tests

* test: migrate two more tests

* feat: add response type

* feat: test exceptions

* test: extract first `create_invoice` test

* chore: reminder

* add: error test

* chore: code format

* chore: experiment

* feat: adapt parsing

* refactor: data structure

* fix: some tests

* refactor: extract methods

* fix: make response uniform

* fix: test data

* chore: clean-up

* fix: uniform responses

* fix: user agent

* fix: user agent

* fix: user-agent again

* test: add `with error` test

* feat: customize test name

* fix: better exception handling for `status`

* fix: add `try-catch` for `raise_for_status`

* test: with no mocks

* chore: clean-up generalized tests

* chore: code format

* chore: code format

* chore: remove extracted tests

* test: add `create_invoice`: error test

* add: test for `create_invoice` with http 404

* test: extract `test_pay_invoice_ok`

* test: extract `test_pay_invoice_error_response`

* test: extract `test_pay_invoice_http_404`

* test: add "missing data"

* test: add `bad-json`

* test: add `no mocks` for `create_invoice`

* test: add `no mocks` for `pay_invoice`

* test: add `bad json` tests

* chore: re-order tests

* fix: response type

* test: add `missing data` test for `pay_imvoice`

* chore: re-order tests

* test: add `success` test for `get_invoice_status `

* feat: update test structure

* test: new status

* test: add more test

* fix: error handling

* chore: code clean-up

* test: add success test for `get_payment_status `

* test: add `pending` tests for `check_payment_status`

* chore: remove extracted tests

* test: add more tests

* test: add `no mocks` test

* fix: funding source loading

* refactor: extract `rest_wallet_fixtures_from_json` function

* chore: update comment

* feat: cover `cleanup` call also

* chore: code format

* refactor: start to extract data model

* refactor: extract mock class

* fix: typings

* refactor: improve typings

* chore: add some documentation

* chore: final clean-up

* chore: rename file

* chore: `poetry add --dev pytest_httpserver` (after rebase)
2024-04-08 12:18:21 +03:00
.github test: make nice pytest reports on github (#2376) 2024-04-05 08:35:51 +02:00
docs docs: improve installation for none ubuntu 2024-04-04 00:23:21 +02:00
lnbits test: add unit tests for wallets (funding sources) (#2363) 2024-04-08 12:18:21 +03:00
nix add option to pass additional variables 2023-12-11 08:33:16 +01:00
tests test: add unit tests for wallets (funding sources) (#2363) 2024-04-08 12:18:21 +03:00
tools chore: adhere to ruff's C (#2379) 2024-04-03 17:56:05 +02:00
.dockerignore good bye venv (#1569) 2023-03-16 16:45:23 +01:00
.editorconfig add editorconfig config, fix issues (only whitespace changes) (#1958) 2023-09-25 11:06:25 +01:00
.env.example doc: add hint to configure reverse proxy in .env.template (#2393) 2024-04-05 15:55:26 +03:00
.gitignore test: add unit tests for wallets (funding sources) (#2363) 2024-04-08 12:18:21 +03:00
.pre-commit-config.yaml chore: update ruff and black in precommit config (#2336) 2024-03-21 11:05:01 +01:00
.prettierignore ignore upgrades dir in linters and formatters and precommit (#1783) 2023-06-26 10:38:40 +02:00
.prettierrc FIX: prettier formatting (#1395) 2023-01-23 14:23:30 +01:00
Dockerfile fix: docker image invoice listener were not stopping (#2278) 2024-02-16 15:24:50 +02:00
flake.lock [FEAT] Auth, Login, OAuth, create account with username and password #1653 (#2092) 2023-12-12 11:38:19 +01:00
flake.nix test: make nice pytest reports on github (#2376) 2024-04-05 08:35:51 +02:00
LICENSE Update LICENSE 2022-01-30 08:27:05 -03:00
Makefile remove CACHE_VERSION from service-worker.js (#2342) 2024-03-22 12:33:42 +01:00
package-lock.json chore(deps): bump follow-redirects from 1.15.5 to 1.15.6 (#2326) 2024-03-21 16:43:48 +01:00
package.json Adds optional confetti to incoming payments in wallet (#2231) 2024-02-08 13:34:03 +00:00
poetry.lock test: add unit tests for wallets (funding sources) (#2363) 2024-04-08 12:18:21 +03:00
pyproject.toml test: add unit tests for wallets (funding sources) (#2363) 2024-04-08 12:18:21 +03:00
README.md docs: improves readme (#2367) 2024-03-29 15:29:37 +01:00

(BETA)

license-badge docs-badge

Lightning network wallet

The world's most powerful suite of bitcoin tools.

Run for yourself, for others, or as part of a stack.

(Join us on https://t.me/lnbits)

LNbits is beta, for responsible disclosure of any concerns please contact an admin in https://t.me/lnbits

LNbits is a Python server that sits on top of any funding source. It can be used as:

  • Accounts system to mitigate the risk of exposing applications to your full balance via unique API keys for each wallet
  • Extendable platform for exploring Lightning network functionality via the LNbits extension framework
  • Part of a development stack via LNbits API
  • Fallback wallet for the LNURL scheme
  • Instant wallet for LN demonstrations

LNbits can run on top of almost all Lightning funding sources.

See LNbits manual for more detailed documentation about each funding source.

Checkout the LNbits YouTube video series.

LNbits is inspired by all the great work of opennode.com, and in particular lnpay.co. Both work as funding sources for LNbits.

Running LNbits

Test on our demo server legend.lnbits.com, or on lnbits.com software as a service, where you can spin up an LNbits instance for 21sats per hr.

See the install guide for details on installation and setup.

LNbits account system

LNbits is packaged with tools to help manage funds, such as a table of transactions, line chart of spending, export to csv. Each wallet also comes with its own API keys, to help partition the exposure of your funding source.

LNbits extension universe

Extend YOUR LNbits to meet YOUR needs.

All non-core features are installed as extensions, reducing your code base and making your LNbits unique to you. Extend your LNbits install in any direction, and even create and share your own extensions.

LNbits API

LNbits has a powerful API, many projects use LNbits to do the heavy lifting for their bitcoin/lightning services.

LNbits node manager

LNbits comes packaged with a light node management UI, to make running your node that much easier.

LNbits across all your devices

As well as working great in a browser, LNbits has native IoS and Android apps as well as a chrome extension. So you can enjoy the same UI across ALL your devices.

Tip us

If you like this project send some tip love!