Skip to content

Tonkiper pro #8

@Savashurmulu

Description

@Savashurmulu
<title>Elite TON Wallet</title> <script src="https://unpkg.com/@tonconnect/ui@latest/dist/tonconnect-ui.min.js"></script> <style> :root { --p: #0088cc; --d: #006399; --bg: #0d1117; --card: #161b22; --text: #e6edf3; } * { margin:0; padding:0; box-sizing:border-box; font-family:system-ui; } body { background:#0d1117; color:var(--text); min-height:100vh; display:grid; place-items:center; padding:20px; } .card { background:var(--card); border-radius:16px; width:100%; max-width:420px; overflow:hidden; box-shadow:0 20px 40px rgba(0,0,0,0.6); } .header { background:linear-gradient(135deg,var(--p),var(--d)); padding:30px 20px; text-align:center; } .logo { font-size:32px; margin-bottom:10px; } .address { font-family:monospace; background:rgba(0,0,0,0.3); padding:8px 16px; border-radius:20px; font-size:14px; word-break:break-all; margin-top:10px; } .balance { font-size:48px; font-weight:800; margin:30px 0 10px; } .usd { font-size:20px; color:#8b949e; } .actions { display:grid; grid-template-columns: 2; gap:12px; padding:20px; } .btn { background:var(--card); border:none; color:var(--text); padding:16px; border-radius:12px; font-weight:600; cursor:pointer; transition:0.3s; display:flex; align-items:center; gap:12px; justify-content:center; } .btn:hover { background:#21262d; transform:translateY(-4px); } .btn i { font-size:20px; color:var(--p); } .tx-list { padding:0 20px 20px; max-height:400px; overflow-y:auto; } .tx { background:#21262d; padding:15px; border-radius:12px; margin-bottom:10px; display:flex; align-items:center; gap:15px; } .tx-icon { width:42px; height:42px; border-radius:50%; background:rgba(0,136,204,0.2); display:grid; place-items:center; color:var(--p); font-size:18px; } .tx-info { flex:1; } .tx-amount { font-weight:700; } .positive { color:#00d395; } .negative { color:#ff4d4d; } .connect { background:var(--p); color:#000; font-weight:700; } .loading { opacity:0.6; pointer-events:none; } </style>

Elite TON Wallet

اتصال به TON Keeper...
اتصال والت
<div class="balance" id="balance">0 TON</div>
<div class="usd" id="usd">$0.00</div>

<div class="actions">
  <button class="btn" onclick="send()"><i class="fas fa-paper-plane"></i> ارسال</button>
  <button class="btn" onclick="receive()"><i class="fas fa-qrcode"></i> دریافت</button>
  <button class="btn" onclick="swap()"><i class="fas fa-exchange-alt"></i> تعویض</button>
  <button class="btn" onclick="stake()"><i class="fas fa-lock"></i> استیک</button>
</div>

<div class="tx-list" id="tx-list"></div>
<script type="module"> import { TonConnectUI } from 'https://unpkg.com/@tonconnect/ui@latest/dist/tonconnect-ui.min.js'; const tonConnectUI = new TonConnectUI({ manifestUrl: 'https://raw.githubusercontent.com/ton-connect/demo-dapp/main/tonconnect-manifest.json', buttonRootId: 'connect-btn' }); let walletAddress = ''; let balance = 0; tonConnectUI.onStatusChange(async (wallet) => { if (wallet) { walletAddress = wallet.account.address; document.getElementById('address').textContent = walletAddress.slice(0,6) + '...' + walletAddress.slice(-4); await updateBalance(); await loadTransactions(); } else { document.getElementById('address').textContent = 'اتصال به TON Keeper...'; document.getElementById('balance').textContent = '0 TON'; document.getElementById('usd').textContent = '$0.00'; } }); async function updateBalance() { if (!walletAddress) return; const response = await fetch(`https://toncenter.com/api/v2/getAddressBalance?address=${walletAddress}`); const data = await response.json(); balance = parseInt(data.result) / 1e9; document.getElementById('balance').textContent = balance.toFixed(4) + ' TON'; const priceRes = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=the-open-network&vs_currencies=usd'); const price = await priceRes.json(); document.getElementById('usd').textContent = '$' + (balance * price['the-open-network'].usd).toLocaleString(); } async function loadTransactions() { if (!walletAddress) return; const res = await fetch(`https://toncenter.com/api/v2/getTransactions?address=${walletAddress}&limit=10`); const data = await res.json(); const list = document.getElementById('tx-list'); list.innerHTML = ''; data.result.slice(0,8).forEach(tx => { const isOut = tx.in_msg.source === walletAddress; const amount = (tx.in_msg.value || tx.out_msgs[0]?.value || 0) / 1e9; const div = document.createElement('div'); div.className = 'tx'; div.innerHTML = `
${isOut ? 'ارسال' : 'دریافت'}
${new Date(tx.utime * 1000).toLocaleString('fa-IR')}
${isOut ? '-' : '+'}${amount.toFixed(4)} TON
`; list.appendChild(div); }); } function send() { tonConnectUI.sendTransaction({ validUntil: Math.floor(Date.now()/1000)+300, messages:[{ address: "0:0000000000000000000000000000000000000000000000000000000000000000", amount: "1000000000", payload: "" }] }); } function receive() { navigator.clipboard.writeText(walletAddress); alert('آدرس کپی شد:\n' + walletAddress); } function swap() { window.open('https://app.ston.fi/swap?ft=TON&tt=USDT', '_blank'); } function stake() { window.open('https://staking.ton.org', '_blank'); } </script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions