mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 20:28:23 +00:00
add currency env var
This commit is contained in:
@@ -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
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user