add currency env var

This commit is contained in:
9qeklajc
2025-06-30 15:27:09 +02:00
parent 34300074a8
commit ce24fd728b
2 changed files with 5 additions and 1 deletions
+1
View File
@@ -47,3 +47,4 @@ ONION_URL="XXX.onion"
RELAYS="wss://relay.damus.io,wss://relay.primal.net,wss://relay.snort.social,wss://relay.nostr.band"
CASHU_MINTS="https://mint.minibits.cash/Bitcoin,https://mint.cubabitcoin.org"
CURRENCY = ""
+4 -1
View File
@@ -1,8 +1,10 @@
import asyncio
import os
import time
from typing import cast
from sixty_nuts import Wallet
from sixty_nuts.mint import CurrencyUnit
from sqlmodel import col, func, select, update
from .db import ApiKey, AsyncSession, get_session
@@ -15,13 +17,14 @@ PAYOUT_INTERVAL = int(os.environ.get("PAYOUT_INTERVAL", 300)) # Default 5 minut
DEV_LN_ADDRESS = "routstr@minibits.cash"
DEVS_DONATION_RATE = float(os.environ.get("DEVS_DONATION_RATE", 0.021)) # 2.1%
NSEC = os.environ["NSEC"] # Nostr private key for the wallet
CURRENCY = cast(CurrencyUnit, os.environ.get("CURRENCY", "sat"))
WALLET: Wallet | None = None
async def init_wallet() -> None:
global WALLET
WALLET = await Wallet.create(nsec=NSEC, mint_urls=[MINT], currency="msat")
WALLET = await Wallet.create(nsec=NSEC, mint_urls=[MINT], currency=CURRENCY)
def wallet() -> Wallet: