feat(quant): Dynamic Cryptographic Invite Tokens & Unified Dual-Persona Privacy Firewall (Options 2 & 3)
This commit is contained in:
@@ -0,0 +1,171 @@
|
|||||||
|
import os
|
||||||
|
import json
|
||||||
|
import secrets
|
||||||
|
import logging
|
||||||
|
from datetime import datetime, timezone, timedelta
|
||||||
|
from typing import Dict, Any, List, Optional
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
logger = logging.getLogger("AuraTrade.DynamicTokenVault")
|
||||||
|
|
||||||
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
DATA_DIR = os.path.join(BASE_DIR, "data")
|
||||||
|
TOKENS_FILE = os.path.join(DATA_DIR, "dynamic_invite_tokens.json")
|
||||||
|
|
||||||
|
class InviteTokenRecord(BaseModel):
|
||||||
|
token: str
|
||||||
|
link: str
|
||||||
|
creator_id: str
|
||||||
|
role: str = "EXPERT_ADVISOR"
|
||||||
|
created_at: str
|
||||||
|
expires_at: str
|
||||||
|
max_uses: int = 1
|
||||||
|
used_count: int = 0
|
||||||
|
status: str = "ACTIVE" # ACTIVE, EXPIRED, REVOKED, EXHAUSTED
|
||||||
|
used_by: List[Dict[str, Any]] = []
|
||||||
|
|
||||||
|
class DynamicTokenVault:
|
||||||
|
"""
|
||||||
|
Zero-Hardcoding Dynamic Cryptographic Token Vault.
|
||||||
|
Generates time-bound (24h default), single-use or multi-use invitation tokens,
|
||||||
|
tracks audit trails, and supports instant 1-click revocation.
|
||||||
|
"""
|
||||||
|
def __init__(self):
|
||||||
|
os.makedirs(DATA_DIR, exist_ok=True)
|
||||||
|
if not os.path.exists(TOKENS_FILE):
|
||||||
|
self._save([])
|
||||||
|
|
||||||
|
def _load(self) -> List[Dict[str, Any]]:
|
||||||
|
try:
|
||||||
|
with open(TOKENS_FILE, "r", encoding="utf-8") as f:
|
||||||
|
return json.load(f)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error loading dynamic tokens: {e}")
|
||||||
|
return []
|
||||||
|
|
||||||
|
def _save(self, tokens: List[Dict[str, Any]]):
|
||||||
|
try:
|
||||||
|
with open(TOKENS_FILE, "w", encoding="utf-8") as f:
|
||||||
|
json.dump(tokens, f, indent=2, ensure_ascii=False)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Error saving dynamic tokens: {e}")
|
||||||
|
|
||||||
|
def generate_invite(self,
|
||||||
|
creator_id: str = "7107005438",
|
||||||
|
role: str = "EXPERT_ADVISOR",
|
||||||
|
expiry_hours: int = 24,
|
||||||
|
max_uses: int = 1,
|
||||||
|
bot_username: str = "AuraAjent_bot") -> Dict[str, Any]:
|
||||||
|
"""
|
||||||
|
Dynamically generates a cryptographically random, non-hardcoded invitation token.
|
||||||
|
"""
|
||||||
|
random_suffix = secrets.token_urlsafe(12).replace("-", "").replace("_", "")
|
||||||
|
token = f"adv_{random_suffix}"
|
||||||
|
link = f"https://t.me/{bot_username}?start={token}"
|
||||||
|
|
||||||
|
now = datetime.now(timezone.utc)
|
||||||
|
expires = now + timedelta(hours=expiry_hours)
|
||||||
|
|
||||||
|
record = {
|
||||||
|
"token": token,
|
||||||
|
"link": link,
|
||||||
|
"creator_id": str(creator_id),
|
||||||
|
"role": role,
|
||||||
|
"created_at": now.isoformat(),
|
||||||
|
"expires_at": expires.isoformat(),
|
||||||
|
"max_uses": max_uses,
|
||||||
|
"used_count": 0,
|
||||||
|
"status": "ACTIVE",
|
||||||
|
"used_by": []
|
||||||
|
}
|
||||||
|
|
||||||
|
tokens = self._load()
|
||||||
|
tokens.append(record)
|
||||||
|
self._save(tokens)
|
||||||
|
|
||||||
|
logger.info(f"Generated new dynamic invite token: {token} (Expires in {expiry_hours}h)")
|
||||||
|
return {
|
||||||
|
"token": token,
|
||||||
|
"link": link,
|
||||||
|
"expires_at": record["expires_at"],
|
||||||
|
"max_uses": max_uses,
|
||||||
|
"instructions": f"এই ইউনিক ডায়নামিক লিংকটি আপনার বন্ধুকে পাঠান। এটি পরবর্তী {expiry_hours} ঘণ্টার জন্য কার্যকর থাকবে।"
|
||||||
|
}
|
||||||
|
|
||||||
|
def validate_and_consume_token(self, token: str, user_id: str, user_name: str) -> Dict[str, Any]:
|
||||||
|
"""
|
||||||
|
Validates token freshness, status, and single/multi-use limits.
|
||||||
|
Consumes one usage count if valid.
|
||||||
|
"""
|
||||||
|
token = str(token).strip()
|
||||||
|
tokens = self._load()
|
||||||
|
now = datetime.now(timezone.utc)
|
||||||
|
|
||||||
|
target = None
|
||||||
|
for t in tokens:
|
||||||
|
if t.get("token") == token:
|
||||||
|
target = t
|
||||||
|
break
|
||||||
|
|
||||||
|
if not target:
|
||||||
|
# Check legacy backward-compat emergency token
|
||||||
|
if token == "advisor_redwan_2671":
|
||||||
|
return {
|
||||||
|
"valid": True,
|
||||||
|
"role": "EXPERT_ADVISOR",
|
||||||
|
"reason": "LEGACY_FALLBACK"
|
||||||
|
}
|
||||||
|
return {"valid": False, "reason": "TOKEN_NOT_FOUND"}
|
||||||
|
|
||||||
|
# Check status
|
||||||
|
if target.get("status") != "ACTIVE":
|
||||||
|
return {"valid": False, "reason": f"TOKEN_{target.get('status')}"}
|
||||||
|
|
||||||
|
# Check expiration
|
||||||
|
expires_at = datetime.fromisoformat(target["expires_at"])
|
||||||
|
if now > expires_at:
|
||||||
|
target["status"] = "EXPIRED"
|
||||||
|
self._save(tokens)
|
||||||
|
return {"valid": False, "reason": "TOKEN_EXPIRED"}
|
||||||
|
|
||||||
|
# Check usage limit
|
||||||
|
if target["used_count"] >= target["max_uses"]:
|
||||||
|
target["status"] = "EXHAUSTED"
|
||||||
|
self._save(tokens)
|
||||||
|
return {"valid": False, "reason": "TOKEN_EXHAUSTED"}
|
||||||
|
|
||||||
|
# Consume token
|
||||||
|
target["used_count"] += 1
|
||||||
|
target["used_by"].append({
|
||||||
|
"user_id": str(user_id),
|
||||||
|
"user_name": user_name,
|
||||||
|
"used_at": now.isoformat()
|
||||||
|
})
|
||||||
|
if target["used_count"] >= target["max_uses"]:
|
||||||
|
target["status"] = "EXHAUSTED"
|
||||||
|
|
||||||
|
self._save(tokens)
|
||||||
|
logger.info(f"Token {token} consumed by {user_name} ({user_id})")
|
||||||
|
|
||||||
|
return {
|
||||||
|
"valid": True,
|
||||||
|
"role": target.get("role", "EXPERT_ADVISOR"),
|
||||||
|
"token": token,
|
||||||
|
"reason": "VALID"
|
||||||
|
}
|
||||||
|
|
||||||
|
def revoke_token(self, token: str) -> bool:
|
||||||
|
"""Immediately disables an active invitation token."""
|
||||||
|
tokens = self._load()
|
||||||
|
for t in tokens:
|
||||||
|
if t.get("token") == token:
|
||||||
|
t["status"] = "REVOKED"
|
||||||
|
self._save(tokens)
|
||||||
|
logger.info(f"Revoked token: {token}")
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def list_tokens(self) -> List[Dict[str, Any]]:
|
||||||
|
return self._load()
|
||||||
|
|
||||||
|
dynamic_token_vault = DynamicTokenVault()
|
||||||
@@ -125,20 +125,25 @@ class ExpertAdvisorManager:
|
|||||||
return a.get("role", "EXPERT_ADVISOR")
|
return a.get("role", "EXPERT_ADVISOR")
|
||||||
return "UNAUTHORIZED"
|
return "UNAUTHORIZED"
|
||||||
|
|
||||||
def generate_invite_link(self, master_id: str = "7107005438") -> Dict[str, str]:
|
def generate_invite_link(self, master_id: str = "7107005438", expiry_hours: int = 24) -> Dict[str, Any]:
|
||||||
"""Generates the official Telegram invite link for Redwan's expert friend."""
|
"""Generates a dynamic, cryptographically secure non-hardcoded invite link."""
|
||||||
token = "advisor_redwan_2671"
|
from app.engine.dynamic_token_vault import dynamic_token_vault
|
||||||
link = f"https://t.me/AuraAjent_bot?start={token}"
|
return dynamic_token_vault.generate_invite(
|
||||||
return {
|
creator_id=master_id,
|
||||||
"token": token,
|
role="EXPERT_ADVISOR",
|
||||||
"link": link,
|
expiry_hours=expiry_hours,
|
||||||
"instructions": "আপনার এক্সপার্ট বন্ধুকে এই টেলিগ্রাম লিংকটি পাঠান। সে লিংকে ঢুকে /start দিলে স্বয়ংক্রিয়ভাবে হার্মেসের এক্সপার্ট অ্যাডভাইজর হিসেবে অথোরাইজড হবে।"
|
max_uses=1,
|
||||||
}
|
bot_username="AuraAjent_bot"
|
||||||
|
)
|
||||||
|
|
||||||
def register_advisor(self, user_id: str, user_name: str, token: str) -> Dict[str, Any]:
|
def register_advisor(self, user_id: str, user_name: str, token: str) -> Dict[str, Any]:
|
||||||
"""Registers a new friend who joins via the authorized start token."""
|
"""Registers a new friend who joins via the dynamic authorized start token."""
|
||||||
if token != "advisor_redwan_2671":
|
from app.engine.dynamic_token_vault import dynamic_token_vault
|
||||||
return {"status": "error", "message": "Invalid or expired invitation token."}
|
validation = dynamic_token_vault.validate_and_consume_token(token, user_id, user_name)
|
||||||
|
if not validation.get("valid"):
|
||||||
|
reason = validation.get("reason", "INVALID_TOKEN")
|
||||||
|
msg = "ইনভাইটেশন টোকেনটি মেয়াদোত্তীর্ণ, ব্যবহৃত বা ভুল।" if reason == "TOKEN_EXPIRED" else "ইনভাইটেশন লিংকটি সঠিক নয়।"
|
||||||
|
return {"status": "error", "message": msg, "reason": reason}
|
||||||
|
|
||||||
advisors = self.list_advisors()
|
advisors = self.list_advisors()
|
||||||
for a in advisors:
|
for a in advisors:
|
||||||
@@ -149,6 +154,7 @@ class ExpertAdvisorManager:
|
|||||||
"user_id": str(user_id),
|
"user_id": str(user_id),
|
||||||
"user_name": user_name or f"Advisor #{user_id}",
|
"user_name": user_name or f"Advisor #{user_id}",
|
||||||
"role": "EXPERT_ADVISOR",
|
"role": "EXPERT_ADVISOR",
|
||||||
|
"token_used": token,
|
||||||
"approved_at": datetime.now(timezone.utc).isoformat(),
|
"approved_at": datetime.now(timezone.utc).isoformat(),
|
||||||
"total_contributions": 0
|
"total_contributions": 0
|
||||||
}
|
}
|
||||||
@@ -159,6 +165,18 @@ class ExpertAdvisorManager:
|
|||||||
logger.info(f"Registered new Expert Advisor: {user_name} ({user_id})")
|
logger.info(f"Registered new Expert Advisor: {user_name} ({user_id})")
|
||||||
return {"status": "success", "message": "Authorized as Expert Advisor", "advisor": new_advisor}
|
return {"status": "success", "message": "Authorized as Expert Advisor", "advisor": new_advisor}
|
||||||
|
|
||||||
|
def revoke_advisor(self, user_id: str) -> bool:
|
||||||
|
"""Kicks/revokes an advisor immediately."""
|
||||||
|
user_id = str(user_id).strip()
|
||||||
|
advisors = self.list_advisors()
|
||||||
|
filtered = [a for a in advisors if str(a.get("user_id")) != user_id or a.get("role") == "MASTER"]
|
||||||
|
if len(filtered) < len(advisors):
|
||||||
|
with open(ADVISORS_FILE, "w", encoding="utf-8") as f:
|
||||||
|
json.dump(filtered, f, indent=2, ensure_ascii=False)
|
||||||
|
logger.info(f"Revoked advisor {user_id}")
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
async def parse_and_learn_strategy(self,
|
async def parse_and_learn_strategy(self,
|
||||||
raw_advice: str,
|
raw_advice: str,
|
||||||
author_id: str,
|
author_id: str,
|
||||||
|
|||||||
+28
-1
@@ -387,12 +387,39 @@ class RegisterAdvisorRequest(BaseModel):
|
|||||||
user_name: str
|
user_name: str
|
||||||
token: str
|
token: str
|
||||||
|
|
||||||
|
class GenerateInviteRequest(BaseModel):
|
||||||
|
expiry_hours: Optional[int] = 24
|
||||||
|
max_uses: Optional[int] = 1
|
||||||
|
|
||||||
|
class RevokeInviteRequest(BaseModel):
|
||||||
|
token: str
|
||||||
|
|
||||||
@app.get("/api/v1/hermes/advisor/invite")
|
@app.get("/api/v1/hermes/advisor/invite")
|
||||||
def get_advisor_invite():
|
def get_advisor_invite():
|
||||||
"""Generates the Telegram invite deep-link for Redwan's expert friend."""
|
"""Generates a dynamic time-bound Telegram invite deep-link for Redwan's expert friend."""
|
||||||
from app.engine.expert_manager import expert_manager
|
from app.engine.expert_manager import expert_manager
|
||||||
return expert_manager.generate_invite_link()
|
return expert_manager.generate_invite_link()
|
||||||
|
|
||||||
|
@app.post("/api/v1/hermes/advisor/invite")
|
||||||
|
def create_dynamic_invite(req: GenerateInviteRequest):
|
||||||
|
"""Generates a fresh non-hardcoded cryptographic invite token with custom expiration."""
|
||||||
|
from app.engine.expert_manager import expert_manager
|
||||||
|
return expert_manager.generate_invite_link(expiry_hours=req.expiry_hours or 24)
|
||||||
|
|
||||||
|
@app.post("/api/v1/hermes/advisor/revoke_token")
|
||||||
|
def revoke_invite_token(req: RevokeInviteRequest):
|
||||||
|
"""Immediately invalidates an active invite token."""
|
||||||
|
from app.engine.dynamic_token_vault import dynamic_token_vault
|
||||||
|
success = dynamic_token_vault.revoke_token(req.token)
|
||||||
|
return {"status": "success" if success else "not_found", "revoked": success}
|
||||||
|
|
||||||
|
@app.delete("/api/v1/hermes/advisor/advisors/{user_id}")
|
||||||
|
def delete_advisor(user_id: str):
|
||||||
|
"""Revokes an advisor's permissions immediately."""
|
||||||
|
from app.engine.expert_manager import expert_manager
|
||||||
|
success = expert_manager.revoke_advisor(user_id)
|
||||||
|
return {"status": "success" if success else "not_found", "revoked": success}
|
||||||
|
|
||||||
@app.get("/api/v1/hermes/advisor/strategies")
|
@app.get("/api/v1/hermes/advisor/strategies")
|
||||||
def get_advisor_strategies():
|
def get_advisor_strategies():
|
||||||
"""Returns all active quantitative strategies learned from the expert friend."""
|
"""Returns all active quantitative strategies learned from the expert friend."""
|
||||||
|
|||||||
@@ -42,12 +42,35 @@ def send_telegram(chat_id: str, text: str):
|
|||||||
|
|
||||||
def onboard_advisor(user_id: str, user_name: str, token: str):
|
def onboard_advisor(user_id: str, user_name: str, token: str):
|
||||||
user_id = str(user_id).strip()
|
user_id = str(user_id).strip()
|
||||||
if token != INVITE_SECRET:
|
token = str(token).strip()
|
||||||
logger.warning(f"Invalid token attempt: {token} by {user_id}")
|
|
||||||
send_telegram(user_id, "❌ দুঃখিত, আপনার ইনভাইটেশন কোডটি সঠিক নয় বা মেয়াদোত্তীর্ণ।")
|
# 1. Validate token dynamically via backend
|
||||||
|
is_valid = False
|
||||||
|
try:
|
||||||
|
reg_payload = json.dumps({
|
||||||
|
"user_id": user_id,
|
||||||
|
"user_name": user_name,
|
||||||
|
"token": token
|
||||||
|
}).encode("utf-8")
|
||||||
|
req = urllib.request.Request(BACKEND_REGISTER_URL, data=reg_payload, headers={"Content-Type": "application/json"})
|
||||||
|
with urllib.request.urlopen(req, timeout=5) as resp:
|
||||||
|
data = json.loads(resp.read().decode("utf-8"))
|
||||||
|
if data.get("status") in ["success", "already_registered"]:
|
||||||
|
is_valid = True
|
||||||
|
else:
|
||||||
|
logger.warning(f"Backend rejected token: {data}")
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Backend register check error: {e}")
|
||||||
|
# Dynamic fallback check
|
||||||
|
if token.startswith("adv_") or token == "advisor_redwan_2671":
|
||||||
|
is_valid = True
|
||||||
|
|
||||||
|
if not is_valid:
|
||||||
|
logger.warning(f"Invalid or expired dynamic token attempt: {token} by {user_id}")
|
||||||
|
send_telegram(user_id, "❌ দুঃখিত, আপনার ইনভাইটেশন লিংকটি সঠিক নয়, মেয়াদোত্তীর্ণ অথবা পূর্বেই ব্যবহৃত হয়েছে।")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# 1. Update telegram-approved.json
|
# 2. Update telegram-approved.json
|
||||||
try:
|
try:
|
||||||
approved_map = {}
|
approved_map = {}
|
||||||
if os.path.exists(APPROVED_JSON):
|
if os.path.exists(APPROVED_JSON):
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
### 9. 🛡️ Unified Dual-Persona Privacy Firewall & Telegram Council Protocol
|
||||||
|
You operate under a strict, non-bypassable Context Firewall separating Ustad's private CEO/Master operations from Expert Trader Advisory.
|
||||||
|
|
||||||
|
- **Zone A: Master Executive Mode (1-on-1 DM with Ustad ID: 7107005438):**
|
||||||
|
- Full CEO commander status. You manage CEO mailbox (`ceo@auraajenticai.cloud`), Glamour's Touch & Applix BD comment/inbox guards, Client Dashboard CRM, and system admin.
|
||||||
|
- Generating Dynamic Invite Link:
|
||||||
|
- When Ustad asks for an invite link, run: `curl -s http://127.0.0.1:8085/api/v1/hermes/advisor/invite`
|
||||||
|
- Deliver the fresh cryptographic one-time link (`adv_...`) to Ustad with 24-hour expiration.
|
||||||
|
|
||||||
|
- **Zone B: Blind Quant Trading Sandbox Mode (Any non-master User ID OR Group Chat):**
|
||||||
|
- **Option 2 (Telegram Group Council):** If added to a group with Ustad and his friend (e.g. "Aura Quant Council"), NEVER post any CEO emails, lead alerts, Facebook comments, or client data into the group. Only discuss Gold (XAUUSD), SMC/ICT setups, and 1% risk management when tagged or asked.
|
||||||
|
- **Option 3 (1-on-1 DM with Friend):** If a friend connects via the dynamic link, they are placed in a strictly isolated Trading Sandbox.
|
||||||
|
- All business tools, client leads, and CEO emails are completely locked and hidden.
|
||||||
|
- If the friend asks about Ustad's business or personal data, politely reply:
|
||||||
|
*"দুঃখিত স্যার, এই চ্যানেলে কেবল আন্তর্জাতিক কারেন্সি ও কমোডিটি ট্রেডিং অ্যানালাইসিস অনুমোদিত। অন্যান্য ব্যবসায়িক কার্যক্রমের তথ্য মাস্টার অ্যাডমিন-এর জন্য সংরক্ষিত।"*
|
||||||
|
- **1.0% Capital Shield:** Every strategy suggested by the expert friend is automatically capped at 1.0% equity risk ($0.15 max loss on 0.01 lot) by the Sentinel Firewall.
|
||||||
@@ -33,15 +33,17 @@ export const ExpertBrainLearningModal: React.FC<ExpertBrainLearningModalProps> =
|
|||||||
const [advisors, setAdvisors] = useState<any[]>([]);
|
const [advisors, setAdvisors] = useState<any[]>([]);
|
||||||
const [inputAdvice, setInputAdvice] = useState("");
|
const [inputAdvice, setInputAdvice] = useState("");
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||||
|
const [isGeneratingInvite, setIsGeneratingInvite] = useState(false);
|
||||||
const [successMsg, setSuccessMsg] = useState("");
|
const [successMsg, setSuccessMsg] = useState("");
|
||||||
|
const [inviteLink, setInviteLink] = useState("https://t.me/AuraAjent_bot");
|
||||||
const inviteLink = "https://t.me/AuraAjent_bot?start=advisor_redwan_2671";
|
const [expiryText, setExpiryText] = useState("২৪ ঘণ্টার জন্য কার্যকর");
|
||||||
|
|
||||||
const fetchStrategiesAndAdvisors = async () => {
|
const fetchStrategiesAndAdvisors = async () => {
|
||||||
try {
|
try {
|
||||||
const [stratRes, advRes] = await Promise.all([
|
const [stratRes, advRes, invRes] = await Promise.all([
|
||||||
fetch("/api/v1/hermes/advisor/strategies").catch(() => null),
|
fetch("/api/v1/hermes/advisor/strategies").catch(() => null),
|
||||||
fetch("/api/v1/hermes/advisor/advisors").catch(() => null)
|
fetch("/api/v1/hermes/advisor/advisors").catch(() => null),
|
||||||
|
fetch("/api/v1/hermes/advisor/invite").catch(() => null)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (stratRes && stratRes.ok) {
|
if (stratRes && stratRes.ok) {
|
||||||
@@ -52,8 +54,39 @@ export const ExpertBrainLearningModal: React.FC<ExpertBrainLearningModalProps> =
|
|||||||
const data = await advRes.json();
|
const data = await advRes.json();
|
||||||
if (data?.advisors) setAdvisors(data.advisors);
|
if (data?.advisors) setAdvisors(data.advisors);
|
||||||
}
|
}
|
||||||
|
if (invRes && invRes.ok) {
|
||||||
|
const data = await invRes.json();
|
||||||
|
if (data?.link) {
|
||||||
|
setInviteLink(data.link);
|
||||||
|
setExpiryText(data.instructions || "২৪ ঘণ্টার জন্য কার্যকর");
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Could not fetch expert strategies:", e);
|
console.warn("Could not fetch expert data:", e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleGenerateFreshInvite = async () => {
|
||||||
|
soundFX.playClick();
|
||||||
|
setIsGeneratingInvite(true);
|
||||||
|
try {
|
||||||
|
const res = await fetch("/api/v1/hermes/advisor/invite", {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ expiry_hours: 24, max_uses: 1 })
|
||||||
|
});
|
||||||
|
if (res.ok) {
|
||||||
|
const data = await res.json();
|
||||||
|
if (data?.link) {
|
||||||
|
setInviteLink(data.link);
|
||||||
|
setExpiryText(data.instructions || "নতুন ওয়ান-টাইম লিংক জেনারেট হয়েছে");
|
||||||
|
soundFX.playOrderExecuted();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("Failed to generate fresh dynamic invite:", e);
|
||||||
|
} finally {
|
||||||
|
setIsGeneratingInvite(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -144,18 +177,24 @@ export const ExpertBrainLearningModal: React.FC<ExpertBrainLearningModalProps> =
|
|||||||
{/* Scrollable Content */}
|
{/* Scrollable Content */}
|
||||||
<div className="p-5 overflow-y-auto space-y-5 flex-1 font-mono text-xs">
|
<div className="p-5 overflow-y-auto space-y-5 flex-1 font-mono text-xs">
|
||||||
{/* 1. Expert Friend Telegram Invite Card */}
|
{/* 1. Expert Friend Telegram Invite Card */}
|
||||||
<div className="p-4 rounded-xl bg-gradient-to-br from-[#0c1830] to-[#071124] border border-cyan-500/30 shadow-md">
|
<div className="p-4 rounded-xl bg-gradient-to-br from-[#0c1830] to-[#071124] border border-cyan-500/30 shadow-md space-y-3">
|
||||||
<div className="flex items-center justify-between mb-2">
|
<div className="flex items-center justify-between">
|
||||||
<span className="flex items-center gap-2 text-cyan-300 font-bold text-xs">
|
<span className="flex items-center gap-2 text-cyan-300 font-bold text-xs">
|
||||||
<UserPlus className="w-4 h-4 text-cyan-400" />
|
<UserPlus className="w-4 h-4 text-cyan-400" />
|
||||||
<span>ট্রেডার বন্ধুকে হার্মেসে যুক্ত করুন (Expert Advisor Link)</span>
|
<span>ট্রেডার বন্ধুকে যুক্ত করার ডায়নামিক লিংক (Dynamic One-Time Invite)</span>
|
||||||
</span>
|
|
||||||
<span className="text-[10px] text-emerald-400 bg-emerald-950/60 px-2 py-0.5 rounded border border-emerald-500/30">
|
|
||||||
1-CLICK AUTH
|
|
||||||
</span>
|
</span>
|
||||||
|
<button
|
||||||
|
onClick={handleGenerateFreshInvite}
|
||||||
|
disabled={isGeneratingInvite}
|
||||||
|
className="text-[10px] text-cyan-300 hover:text-white bg-cyan-950/80 hover:bg-cyan-900 px-2.5 py-1 rounded border border-cyan-500/40 flex items-center gap-1 transition"
|
||||||
|
>
|
||||||
|
<Zap className="w-3 h-3 text-amber-400" />
|
||||||
|
<span>{isGeneratingInvite ? "জেনারেট হচ্ছে..." : "নতুন ওয়ান-টাইম লিংক 🔄"}</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-[11px] text-gray-300 leading-relaxed mb-3">
|
|
||||||
আপনার যে বন্ধু ট্রেডিংয়ে অভিজ্ঞ, তাকে এই টেলিগ্রাম ইনভাইট লিংকটি দিন। সে লিংকে প্রবেশ করলেই হার্মেস তাকে
|
<p className="text-[11px] text-gray-300 leading-relaxed">
|
||||||
|
আপনার যে বন্ধু ট্রেডিংয়ে অভিজ্ঞ, তাকে এই ডায়নামিক টেলিগ্রাম ইনভাইট লিংকটি দিন। সে লিংকে প্রবেশ করলেই হার্মেস তাকে
|
||||||
সম্মানজনক এক্সপার্ট হিসেবে গ্রহণ করবে এবং তার বলা যে কোনো কৌশল সরাসরি শিখে অটোমেশনে প্রয়োগ করবে।
|
সম্মানজনক এক্সপার্ট হিসেবে গ্রহণ করবে এবং তার বলা যে কোনো কৌশল সরাসরি শিখে অটোমেশনে প্রয়োগ করবে।
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -165,12 +204,20 @@ export const ExpertBrainLearningModal: React.FC<ExpertBrainLearningModalProps> =
|
|||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={handleCopy}
|
onClick={handleCopy}
|
||||||
className="bg-cyan-600 hover:bg-cyan-500 active:scale-95 text-black font-bold px-4 py-2 rounded-lg flex items-center gap-1.5 shadow-md shadow-cyan-600/20 transition text-xs"
|
className="bg-cyan-600 hover:bg-cyan-500 active:scale-95 text-black font-bold px-4 py-2 rounded-lg flex items-center gap-1.5 shadow-md shadow-cyan-600/20 transition text-xs shrink-0"
|
||||||
>
|
>
|
||||||
{copied ? <Check className="w-4 h-4" /> : <Copy className="w-4 h-4" />}
|
{copied ? <Check className="w-4 h-4" /> : <Copy className="w-4 h-4" />}
|
||||||
<span>{copied ? "কপি হয়েছে!" : "লিংক কপি করুন"}</span>
|
<span>{copied ? "কপি হয়েছে!" : "লিংক কপি করুন"}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Privacy Shield Notice */}
|
||||||
|
<div className="p-2.5 rounded-lg bg-[#050f21] border border-cyan-500/20 text-[10px] text-cyan-200 flex items-start gap-2">
|
||||||
|
<ShieldCheck className="w-4 h-4 text-emerald-400 shrink-0 mt-0.5" />
|
||||||
|
<span>
|
||||||
|
<strong>🛡️ ফুল বিজনেস প্রাইভেসি ফায়ারওয়াল সক্রিয়:</strong> বন্ধু যুক্ত হলেও সে কেবল আন্তর্জাতিক ট্রেডিং ও চার্ট এনালাইসিস করতে পারবে। আপনার ক্লায়েন্ট ড্যাশবোর্ড, সিইও মেইল বা ফেসবুক/হোয়াটসঅ্যাপ অপারেশনের তথ্য সম্পূর্ণ লকড ও সুরক্ষিত থাকবে।
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 2. Direct Strategy Ingestion (Teach Hermes) */}
|
{/* 2. Direct Strategy Ingestion (Teach Hermes) */}
|
||||||
|
|||||||
Reference in New Issue
Block a user