Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse filesFiles changed (3)
- card_formatter.py+12-11
- early_buyer_scanner.py+2-1
- test_suite.py+22-1
12345672 unmodified lines798081828384858687888990919293944 unmodified lines991001011021031041051061078 unmodified lines116117118119120121122123124187 unmodified lines312313314315316317318import htmlimport refrom telegram import InlineKeyboardButton, InlineKeyboardMarkupALLOWED_TAGS = {"b", "strong", "i", "em", "u", "ins", "s", "strike", "del", "code", "pre", "blockquote", "tg-spoiler"}72 unmodified lines"""Build Telegram inline keyboard with quick action buttons.Supports Solana, BSC, and Robinhood Chain tokens."""chain_lower = (chain or "").lower()is_robinhood = (chain_lower == "robinhood" or "rh" in chain_lower)is_bsc = mint.startswith("0x") and not is_robinhoodif is_robinhood:keyboard = [[InlineKeyboardButton("π Check CA on π", url=f"https://x.com/search?q={mint}&f=live")],[InlineKeyboardButton("π¦ DexScreener", url=f"https://dexscreener.com/robinhood/{mint}"),InlineKeyboardButton("π RobinScreener", url=f"https://robinscreener.io/token/{mint}")4 unmodified lines]elif is_bsc:keyboard = [[InlineKeyboardButton("π Check CA on π", url=f"https://x.com/search?q={mint}&f=live")],[InlineKeyboardButton("π₯ PancakeSwap", url=f"https://pancakeswap.finance/swap?outputCurrency={mint}"),InlineKeyboardButton("π GMGN", url=f"https://gmgn.ai/bsc/token/{mint}")8 unmodified lines]else:keyboard = [[InlineKeyboardButton("π Check CA on π", url=f"https://x.com/search?q={mint}&f=live")],[InlineKeyboardButton("π Pump.fun", url=f"https://pump.fun/{mint}"),InlineKeyboardButton("π GMGN", url=f"https://gmgn.ai/sol/token/{mint}")187 unmodified linescard = f"""{badge}ββββββββββββββββββββπͺ <b>{name}</b> (<code>${symbol}</code>)π <b>CA:</b> <code>{mint}</code>π <b>METRICS & BONDING</b>β π° <b>Market Cap:</b> <code>${mc:,.0f}</code> <i>({multiplier}x)</i>12345672 unmodified lines79808182838485868788899091929394959697984 unmodified lines1031041051061071081098 unmodified lines118119120121122123124187 unmodified lines312313314315316317318319import htmlimport refrom telegram import InlineKeyboardButton, InlineKeyboardMarkup, CopyTextButtonALLOWED_TAGS = {"b", "strong", "i", "em", "u", "ins", "s", "strike", "del", "code", "pre", "blockquote", "tg-spoiler"}72 unmodified lines"""Build Telegram inline keyboard with quick action buttons.Supports Solana, BSC, and Robinhood Chain tokens.Includes native 1-click Copy Contract Address button."""chain_lower = (chain or "").lower()is_robinhood = (chain_lower == "robinhood" or "rh" in chain_lower)is_bsc = mint.startswith("0x") and not is_robinhoodcopy_row = [InlineKeyboardButton("π Copy CA", copy_text=CopyTextButton(text=mint)),InlineKeyboardButton("π Check CA on π", url=f"https://x.com/search?q={mint}&f=live")]if is_robinhood:keyboard = [copy_row,[InlineKeyboardButton("π¦ DexScreener", url=f"https://dexscreener.com/robinhood/{mint}"),InlineKeyboardButton("π RobinScreener", url=f"https://robinscreener.io/token/{mint}")4 unmodified lines]elif is_bsc:keyboard = [copy_row,[InlineKeyboardButton("π₯ PancakeSwap", url=f"https://pancakeswap.finance/swap?outputCurrency={mint}"),InlineKeyboardButton("π GMGN", url=f"https://gmgn.ai/bsc/token/{mint}")8 unmodified lines]else:keyboard = [copy_row,[InlineKeyboardButton("π Pump.fun", url=f"https://pump.fun/{mint}"),InlineKeyboardButton("π GMGN", url=f"https://gmgn.ai/sol/token/{mint}")187 unmodified linescard = f"""{badge}ββββββββββββββββββββπͺ <b>{name}</b> (<code>${symbol}</code>)π <b>Contract Address (Tap to copy):</b><code>{mint}</code>π <b>METRICS & BONDING</b>β π° <b>Market Cap:</b> <code>${mc:,.0f}</code> <i>({multiplier}x)</i>
251 unmodified lines252253254255256257258251 unmodified linesf"π― <b>EARLY SNIPER RADAR SCAN COMPLETE</b>","ββββββββββββββββββββ",f"πͺ <b>{token['name']}</b> (<code>${token['symbol']}</code>)",f"π <b>CA:</b> <code>{token['address']}</code>",f"π <b>Network:</b> {chain_emoji} <b>{chain_name}</b>",f"π‘ <b>Sniper Filter:</b> <code>Sub-${max_mc:,.0f} MarketCap Entry</code>",f"π° <b>Current MarketCap:</b> <code>${token['current_mc']:,.0f}</code>" if token['current_mc'] > 0 else f"π° <b>Total Supply:</b> <code>{token['total_supply']:,.0f}</code>",251 unmodified lines252253254255256257258259251 unmodified linesf"π― <b>EARLY SNIPER RADAR SCAN COMPLETE</b>","ββββββββββββββββββββ",f"πͺ <b>{token['name']}</b> (<code>${token['symbol']}</code>)",f"π <b>Contract Address (Tap to copy):</b>",f"<code>{token['address']}</code>",f"π <b>Network:</b> {chain_emoji} <b>{chain_name}</b>",f"π‘ <b>Sniper Filter:</b> <code>Sub-${max_mc:,.0f} MarketCap Entry</code>",f"π° <b>Current MarketCap:</b> <code>${token['current_mc']:,.0f}</code>" if token['current_mc'] > 0 else f"π° <b>Total Supply:</b> <code>{token['total_supply']:,.0f}</code>",
1015 unmodified lines101610171018101910201021102210231015 unmodified linesassert "0x006b030115b7d488927576147dc01bfd1dea600d" in wallets, "Dawg BSC sniper must be tracked"print(f" Successfully verified {len(wallets)} tracked smart money sniper wallets!")print("\n" + "="*60)print(" ALL 38 MULTI-CHAIN TESTS (INCLUDING SUB-$20K SCANNER & ARCHITECTURE) PASSED WITH 100% SUCCESS!")print("="*60)if __name__ == "__main__":1015 unmodified lines101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441015 unmodified linesassert "0x006b030115b7d488927576147dc01bfd1dea600d" in wallets, "Dawg BSC sniper must be tracked"print(f" Successfully verified {len(wallets)} tracked smart money sniper wallets!")# Test 39: 1-Click Contract Address Copy & Dedicated Tap-to-Copy Blockprint("\n[TEST 39] Testing 1-Click Contract Address Copy & Dedicated Tap-to-Copy Block...")test_sol_ca = "4vRRbUAtLarwSFjuEKzci2C6pa1773qW9tVuFBqwpump"test_bsc_ca = "0x7d0443cddfc8e11af105f4fe44dd28c630237777"test_rh_ca = "0x008df4b3e857d06c4603aeb11f267ccd32ce2005"for ca, ch in [(test_sol_ca, "sol"), (test_bsc_ca, "bsc"), (test_rh_ca, "robinhood")]:kb = get_token_keyboard(ca, chain=ch)copy_btns = [b for row in kb.inline_keyboard for b in row if hasattr(b, "copy_text") and b.copy_text]assert len(copy_btns) >= 1, f"Missing 1-click Copy CA button for {ch}"assert copy_btns[0].copy_text.text == ca, f"Copy button text must match contract address {ca}"assert "Copy CA" in copy_btns[0].textmock_token = {"mint": test_sol_ca, "name": "GtA6", "symbol": "GTA6", "market_cap": 25000}mock_sig = {"type": "CLUSTER", "buys": []}card_html = format_telegram_card(mock_token, mock_sig)assert "Contract Address (Tap to copy):" in card_html, "Missing dedicated tap-to-copy label"assert f"<code>{test_sol_ca}</code>" in card_html, "CA must be isolated in <code> block on its own line"print(" 1-Click Copy CA buttons and isolated tap-to-copy blocks verified across all chains!")print("\n" + "="*60)print(" ALL 39 MULTI-CHAIN TESTS (INCLUDING 1-CLICK CA COPY) PASSED WITH 100% SUCCESS!")print("="*60)if __name__ == "__main__":
card_formatter.py+12-11
early_buyer_scanner.py+2-1
test_suite.py+22-1