Skip to content

Commit

Permalink
fix: timestamp on api response should be int not date (#39)
Browse files Browse the repository at this point in the history
* fix: timestamp on api response should be int not date

closes #38

* fix: expiry time
  • Loading branch information
dni authored Nov 29, 2024
1 parent 7bb4856 commit f766d2c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def lndhub_gettxs(
"type": "paid_invoice",
"fee": payment.fee / 1000,
"value": int(payment.amount / 1000),
"timestamp": payment.time,
"timestamp": int(payment.time.timestamp()),
"memo": (
payment.extra and payment.extra.get("comment") or payment.memo
if not payment.pending
Expand Down Expand Up @@ -144,8 +144,12 @@ async def lndhub_getuserinvoices(
"payment_hash": payment.payment_hash,
"ispaid": payment.success,
"amt": int(payment.amount / 1000),
"expire_time": int(time.time() + 1800),
"timestamp": payment.time,
"expire_time": (
int(payment.expiry.timestamp())
if payment.expiry
else payment.time.timestamp() + 3600
),
"timestamp": int(payment.time.timestamp()),
"type": "user_invoice",
}
for payment in reversed(
Expand Down

0 comments on commit f766d2c

Please sign in to comment.