feat(quant): Dynamic Cryptographic Invite Tokens & Unified Dual-Persona Privacy Firewall (Options 2 & 3)
This commit is contained in:
@@ -33,15 +33,17 @@ export const ExpertBrainLearningModal: React.FC<ExpertBrainLearningModalProps> =
|
||||
const [advisors, setAdvisors] = useState<any[]>([]);
|
||||
const [inputAdvice, setInputAdvice] = useState("");
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
const [isGeneratingInvite, setIsGeneratingInvite] = useState(false);
|
||||
const [successMsg, setSuccessMsg] = useState("");
|
||||
|
||||
const inviteLink = "https://t.me/AuraAjent_bot?start=advisor_redwan_2671";
|
||||
const [inviteLink, setInviteLink] = useState("https://t.me/AuraAjent_bot");
|
||||
const [expiryText, setExpiryText] = useState("২৪ ঘণ্টার জন্য কার্যকর");
|
||||
|
||||
const fetchStrategiesAndAdvisors = async () => {
|
||||
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/advisors").catch(() => null)
|
||||
fetch("/api/v1/hermes/advisor/advisors").catch(() => null),
|
||||
fetch("/api/v1/hermes/advisor/invite").catch(() => null)
|
||||
]);
|
||||
|
||||
if (stratRes && stratRes.ok) {
|
||||
@@ -52,8 +54,39 @@ export const ExpertBrainLearningModal: React.FC<ExpertBrainLearningModalProps> =
|
||||
const data = await advRes.json();
|
||||
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) {
|
||||
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 */}
|
||||
<div className="p-5 overflow-y-auto space-y-5 flex-1 font-mono text-xs">
|
||||
{/* 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="flex items-center justify-between mb-2">
|
||||
<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">
|
||||
<span className="flex items-center gap-2 text-cyan-300 font-bold text-xs">
|
||||
<UserPlus className="w-4 h-4 text-cyan-400" />
|
||||
<span>ট্রেডার বন্ধুকে হার্মেসে যুক্ত করুন (Expert Advisor Link)</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>ট্রেডার বন্ধুকে যুক্ত করার ডায়নামিক লিংক (Dynamic One-Time Invite)</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>
|
||||
<p className="text-[11px] text-gray-300 leading-relaxed mb-3">
|
||||
আপনার যে বন্ধু ট্রেডিংয়ে অভিজ্ঞ, তাকে এই টেলিগ্রাম ইনভাইট লিংকটি দিন। সে লিংকে প্রবেশ করলেই হার্মেস তাকে
|
||||
|
||||
<p className="text-[11px] text-gray-300 leading-relaxed">
|
||||
আপনার যে বন্ধু ট্রেডিংয়ে অভিজ্ঞ, তাকে এই ডায়নামিক টেলিগ্রাম ইনভাইট লিংকটি দিন। সে লিংকে প্রবেশ করলেই হার্মেস তাকে
|
||||
সম্মানজনক এক্সপার্ট হিসেবে গ্রহণ করবে এবং তার বলা যে কোনো কৌশল সরাসরি শিখে অটোমেশনে প্রয়োগ করবে।
|
||||
</p>
|
||||
|
||||
@@ -165,12 +204,20 @@ export const ExpertBrainLearningModal: React.FC<ExpertBrainLearningModalProps> =
|
||||
</div>
|
||||
<button
|
||||
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" />}
|
||||
<span>{copied ? "কপি হয়েছে!" : "লিংক কপি করুন"}</span>
|
||||
</button>
|
||||
</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>
|
||||
|
||||
{/* 2. Direct Strategy Ingestion (Teach Hermes) */}
|
||||
|
||||
Reference in New Issue
Block a user