The TxShield badge gives your users an instant visual risk signal on any token page — no blockchain knowledge required on their end. One API call, one badge, full protection.This is the fastest way to integrate TxShield into a DEX, screener, or token explorer.
Drop this into any token page. Replace YOUR_API_KEY and call renderTxShieldBadge() with the token address and chain ID.
<div id="txshield-badge"></div><script>async function renderTxShieldBadge(targetContractAddress, chainId = 1) { const badge = document.getElementById('txshield-badge'); badge.innerHTML = '<span style="color:#94A3B8">⏳ Checking...</span>'; try { const res = await fetch('https://api.txshield.xyz/api/honeypot/honeypot-checks', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY' }, body: JSON.stringify({ targetContractAddress, chainId }) }); const data = await res.json(); if (!data.success) { badge.innerHTML = '<span style="color:#94A3B8">TxShield unavailable</span>'; return; } const hp = data.honeypotResponse; // Time-delayed honeypot takes highest priority if (hp.isTimeHoneypot) { badge.innerHTML = '<span style="color:#DC2626">🚨 TxShield Time Trap</span>'; } else if (hp.riskScore <= 20) { badge.innerHTML = '<span style="color:#16A34A">✅ TxShield Verified</span>'; } else if (hp.riskScore <= 70) { badge.innerHTML = '<span style="color:#F59E0B">⚠️ TxShield Caution</span>'; } else { badge.innerHTML = '<span style="color:#DC2626">❌ TxShield High Risk</span>'; } } catch (err) { badge.innerHTML = '<span style="color:#94A3B8">TxShield unavailable</span>'; console.error('[TxShield]', err); }}// Call on page load with your token address and chainrenderTxShieldBadge('0xTokenAddressHere', 1);</script>
Never expose your API key in client-side code in a production environment. Proxy the request through your own backend and keep the key in a server-side environment variable. See the pattern below.
Want to show full risk details on hover, a modal breakdown, or a risk score bar alongside the badge? We can provide UI component templates for your stack.Reach out via X @txshield_ or contactcodecommunity@gmail.com and mention your platform.
Honeypot Endpoint
Full reference for the data powering the badge.
EVM Simulation
Run deeper analysis including bytecode and transaction history.