mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-06 12:38:23 +00:00
fix
This commit is contained in:
+4
-4
@@ -17,16 +17,17 @@ NSEC = os.environ["NSEC"] # Nostr private key for the wallet
|
||||
|
||||
WALLET = Wallet(nsec=NSEC, mint_urls=[MINT])
|
||||
|
||||
|
||||
async def init_wallet():
|
||||
global WALLET
|
||||
WALLET = await Wallet.create(nsec=NSEC, mint_urls=[MINT])
|
||||
|
||||
|
||||
|
||||
async def close_wallet():
|
||||
global WALLET
|
||||
await WALLET.aclose()
|
||||
|
||||
|
||||
|
||||
async def pay_out() -> None:
|
||||
"""
|
||||
Calculates the pay-out amount based on the spent balance, profit, and donation rate.
|
||||
@@ -93,7 +94,7 @@ async def credit_balance(cashu_token: str, key: ApiKey, session: AsyncSession) -
|
||||
stmt = (
|
||||
update(ApiKey)
|
||||
.where(col(ApiKey.hashed_key) == key.hashed_key)
|
||||
.values(balance=col(ApiKey.balance) + amount)
|
||||
.values(balance=col(ApiKey.balance) + amount_msats)
|
||||
)
|
||||
await session.exec(stmt) # type: ignore[call-overload]
|
||||
await session.commit()
|
||||
@@ -101,7 +102,6 @@ async def credit_balance(cashu_token: str, key: ApiKey, session: AsyncSession) -
|
||||
return amount_msats
|
||||
|
||||
|
||||
|
||||
async def check_for_refunds() -> None:
|
||||
"""
|
||||
Periodically checks for API keys that are eligible for refunds and processes them.
|
||||
|
||||
Reference in New Issue
Block a user