klaim reward BP harian (claim service V32-V34) + kill-switch DISTRIBUTE_ENABLED (V35) + Telegram dua kanal komunitas/internal (V30/V36) + placement web/scan/dist/claim != server2U

This commit is contained in:
proitlab committed 2026-08-06 06:30:19 +07:00
1 parent d3a0e768a0
commit b1e6e93796
14 files changed
+878 -72

No files matched your search

+23 -5
View File
@@ -5,6 +5,7 @@ di sini supaya semua modul (get_voters, dashboard) berbagi sumber yang sama.
"""
import os
from decimal import Decimal
from dotenv import load_dotenv
@@ -57,15 +58,32 @@ DASH_LIQUID_TTL = int(os.getenv('DASH_LIQUID_TTL', '60'))
BP_PRIVATE_KEY = os.getenv('VEX_BP_PRIVATE_KEY', '')
DISTRIBUTE_HOUR = int(os.getenv('DISTRIBUTE_HOUR', '10'))
DISTRIBUTE_MAX_ATTEMPTS = int(os.getenv('DISTRIBUTE_MAX_ATTEMPTS', '3'))
# Kill-switch distribusi (V35): default OFF — payout hanya jalan saat diset
# `true`. `--dry-run` tetap boleh jalan (read-only, ⊥ tanda tangan/tulis).
DISTRIBUTE_ENABLED = os.getenv(
'DISTRIBUTE_ENABLED', 'false').lower() in ('1', 'true', 'yes')
# ————————————————— Notifikasi Telegram (V30) —————————————————
# Bot token + daftar chat id (CSV) tujuan notifikasi mulai/selesai/gagal
# distribusi. Kosong → notifikasi nonaktif (no-op senyap).
# ————————————————— Notifikasi Telegram (V30/V36) —————————————————
# Bot token tunggal; dua daftar chat id (CSV): KOMUNITAS (`..._COMMUNITY_...`)
# hanya brief mulai/selesai distribusi, INTERNAL (`..._INTERNAL_...`) detail
# distribusi + semua kegagalan + klaim reward (⊥ komunitas). Kosong → kanal
# itu senyap.
TELEGRAM_BOT_TOKEN = os.getenv('TELEGRAM_BOT_TOKEN', '')
TELEGRAM_CHAT_IDS = [
c.strip() for c in os.getenv('TELEGRAM_CHAT_IDS', '').split(',')
TELEGRAM_COMMUNITY_CHAT_IDS = [
c.strip() for c in os.getenv('TELEGRAM_COMMUNITY_CHAT_IDS', '').split(',')
if c.strip()
]
TELEGRAM_INTERNAL_CHAT_IDS = [
c.strip() for c in os.getenv('TELEGRAM_INTERNAL_CHAT_IDS', '').split(',')
if c.strip()
]
# ————————————————— Klaim reward BP (V32..V34) —————————————————
# Poll interval (detik) saat mendekati jendela klaim; fee wallet + persentase
# 10% dari reward yang baru diklaim (floor 4 desimal).
CLAIM_RETRY_SECONDS = int(os.getenv('CLAIM_RETRY_SECONDS', '60'))
BP_FEE_WALLET = os.getenv('VEX_BP_FEE_WALLET', 'bpdbsjasprod')
BP_FEE_PERCENT = Decimal(os.getenv('VEX_BP_FEE_PERCENT', '0.10'))
# Kontrak token VEX = vex.token (⊥ eosio.token — tak ada di chain)
TOKEN_CONTRACT = 'vex.token'