Translate expiry to expirySeconds for Phoenixd (#2901)

This commit is contained in:
blackcoffeexbt 2025-01-28 09:54:33 +00:00 committed by GitHub
parent cc33a49b12
commit 73e716085b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,7 +3,7 @@ import base64
import hashlib
import json
import urllib.parse
from typing import AsyncGenerator, Dict, Optional
from typing import Any, AsyncGenerator, Dict, Optional
import httpx
from loguru import logger
@ -100,7 +100,7 @@ class PhoenixdWallet(Wallet):
try:
msats_amount = amount
data: Dict = {
data: Dict[str, Any] = {
"amountSat": f"{msats_amount}",
"externalId": "",
}
@ -119,6 +119,9 @@ class PhoenixdWallet(Wallet):
else:
data["description"] = desc
# if expiry is not set, it defaults to 3600 seconds (1 hour)
data["expirySeconds"] = int(kwargs.get("expiry", 3600))
r = await self.client.post(
"/createinvoice",
data=data,