fix copilot memo None
This commit is contained in:
parent
59de66f00b
commit
189eed850a
1 changed files with 17 additions and 16 deletions
|
|
@ -1,26 +1,27 @@
|
||||||
|
import base64
|
||||||
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import hashlib
|
|
||||||
import math
|
import math
|
||||||
from fastapi import Request
|
|
||||||
import hashlib
|
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
from fastapi import Request
|
||||||
|
from fastapi.param_functions import Query
|
||||||
|
from fastapi.params import Depends
|
||||||
|
from lnurl import ( # type: ignore
|
||||||
|
LnurlErrorResponse,
|
||||||
|
LnurlPayActionResponse,
|
||||||
|
LnurlPayResponse,
|
||||||
|
)
|
||||||
|
from lnurl.types import LnurlPayMetadata
|
||||||
from starlette.exceptions import HTTPException
|
from starlette.exceptions import HTTPException
|
||||||
from starlette.responses import HTMLResponse, JSONResponse # type: ignore
|
from starlette.responses import HTMLResponse, JSONResponse # type: ignore
|
||||||
import base64
|
|
||||||
from lnurl import (
|
|
||||||
LnurlPayResponse,
|
|
||||||
LnurlPayActionResponse,
|
|
||||||
LnurlErrorResponse,
|
|
||||||
) # type: ignore
|
|
||||||
from lnurl.types import LnurlPayMetadata
|
|
||||||
from lnbits.core.services import create_invoice
|
from lnbits.core.services import create_invoice
|
||||||
from .models import Copilots, CreateCopilotData
|
|
||||||
from . import copilot_ext
|
from . import copilot_ext
|
||||||
from .crud import get_copilot
|
from .crud import get_copilot
|
||||||
from typing import Optional
|
from .models import Copilots, CreateCopilotData
|
||||||
from fastapi.params import Depends
|
|
||||||
from fastapi.param_functions import Query
|
|
||||||
|
|
||||||
|
|
||||||
@copilot_ext.get(
|
@copilot_ext.get(
|
||||||
|
|
@ -81,7 +82,7 @@ async def lnurl_callback(
|
||||||
payment_hash, payment_request = await create_invoice(
|
payment_hash, payment_request = await create_invoice(
|
||||||
wallet_id=cp.wallet,
|
wallet_id=cp.wallet,
|
||||||
amount=int(amount_received / 1000),
|
amount=int(amount_received / 1000),
|
||||||
memo=cp.lnurl_title,
|
memo=cp.lnurl_title or "",
|
||||||
description_hash=hashlib.sha256(
|
description_hash=hashlib.sha256(
|
||||||
(
|
(
|
||||||
LnurlPayMetadata(json.dumps([["text/plain", str(cp.lnurl_title)]]))
|
LnurlPayMetadata(json.dumps([["text/plain", str(cp.lnurl_title)]]))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue