Manage your Bolt Cards self custodian way
- More details
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/test_init.py b/tests/test_init.py
new file mode 100644
index 0000000..d2dbf0d
--- /dev/null
+++ b/tests/test_init.py
@@ -0,0 +1,11 @@
+import pytest
+from fastapi import APIRouter
+
+from .. import boltcards_ext
+
+
+# just import router and add it to a test router
+@pytest.mark.asyncio
+async def test_router():
+ router = APIRouter()
+ router.include_router(boltcards_ext)
diff --git a/toc.md b/toc.md
index 544be53..baa0342 100644
--- a/toc.md
+++ b/toc.md
@@ -1,22 +1,29 @@
# Terms and Conditions for LNbits Extension
## 1. Acceptance of Terms
+
By installing and using the LNbits extension ("Extension"), you agree to be bound by these terms and conditions ("Terms"). If you do not agree to these Terms, do not use the Extension.
## 2. License
+
The Extension is free and open-source software, released under [specify the FOSS license here, e.g., GPL-3.0, MIT, etc.]. You are permitted to use, copy, modify, and distribute the Extension under the terms of that license.
## 3. No Warranty
+
The Extension is provided "as is" and with all faults, and the developer expressly disclaims all warranties of any kind, whether express, implied, statutory, or otherwise, including but not limited to warranties of merchantability, fitness for a particular purpose, non-infringement, and any warranties arising out of course of dealing or usage of trade. No advice or information, whether oral or written, obtained from the developer or elsewhere will create any warranty not expressly stated in this Terms.
## 4. Limitation of Liability
+
In no event will the developer be liable to you or any third party for any direct, indirect, incidental, special, consequential, or punitive damages, including lost profit, lost revenue, loss of data, or other damages arising out of or in connection with your use of the Extension, even if the developer has been advised of the possibility of such damages. The foregoing limitation of liability shall apply to the fullest extent permitted by law in the applicable jurisdiction.
## 5. Modification of Terms
+
The developer reserves the right to modify these Terms at any time. You are advised to review these Terms periodically for any changes. Changes to these Terms are effective when they are posted on the appropriate location within or associated with the Extension.
## 6. General Provisions
+
If any provision of these Terms is held to be invalid or unenforceable, that provision will be enforced to the maximum extent permissible, and the other provisions of these Terms will remain in full force and effect. These Terms constitute the entire agreement between you and the developer regarding the use of the Extension.
## 7. Contact Information
-If you have any questions about these Terms, please contact the developer at [developer's contact information].
\ No newline at end of file
+
+If you have any questions about these Terms, please contact the developer at [developer's contact information].
diff --git a/views.py b/views.py
index d328bef..c6ab55c 100644
--- a/views.py
+++ b/views.py
@@ -2,11 +2,10 @@
from fastapi import Depends, Request
from fastapi.templating import Jinja2Templates
-from starlette.exceptions import HTTPException
-from starlette.responses import HTMLResponse
-
from lnbits.core.models import User
from lnbits.decorators import check_user_exists
+from starlette.exceptions import HTTPException
+from starlette.responses import HTMLResponse
from . import boltcards_ext, boltcards_renderer
from .crud import get_card_by_external_id, get_hits, get_refunds
diff --git a/views_api.py b/views_api.py
index b710518..afcad04 100644
--- a/views_api.py
+++ b/views_api.py
@@ -1,8 +1,6 @@
from http import HTTPStatus
-from typing import Optional
from fastapi import Depends, HTTPException, Query
-
from lnbits.core.crud import get_user
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key
@@ -64,9 +62,8 @@ def validate_card(data: CreateCardData):
@boltcards_ext.put(
"/api/v1/cards/{card_id}",
status_code=HTTPStatus.OK,
- dependencies=[Depends(validate_card)]
+ dependencies=[Depends(validate_card)],
)
-
async def api_card_update(
data: CreateCardData,
card_id: str,
@@ -79,9 +76,7 @@ async def api_card_update(
detail="Card does not exist.", status_code=HTTPStatus.NOT_FOUND
)
if card.wallet != wallet.wallet.id:
- raise HTTPException(
- detail="Not your card.", status_code=HTTPStatus.FORBIDDEN
- )
+ raise HTTPException(detail="Not your card.", status_code=HTTPStatus.FORBIDDEN)
checkUid = await get_card_by_uid(data.uid)
if checkUid and checkUid.id != card_id:
raise HTTPException(
@@ -96,7 +91,7 @@ async def api_card_update(
@boltcards_ext.post(
"/api/v1/cards",
status_code=HTTPStatus.CREATED,
- dependencies=[Depends(validate_card)]
+ dependencies=[Depends(validate_card)],
)
async def api_card_create(
data: CreateCardData,