You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
5.0 KiB
125 lines
5.0 KiB
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>Solana PoWH3D dApp</title> |
|
<link rel="stylesheet" href="styles.css"> |
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> |
|
<script defer src="https://analytics.temple-os.com/script.js" data-website-id="92b291cb-15b7-423b-863a-129d4688aaf3"></script> |
|
<script src="https://unpkg.com/@solana/web3.js@1.95.3/lib/index.iife.min.js"></script> |
|
<script src="solana.js" defer></script> |
|
<style> |
|
.dapp-container { max-width: 1100px; margin: 2rem auto; padding: 1rem; } |
|
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; } |
|
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 1rem; box-shadow: 0 2px 6px rgba(0,0,0,0.04); } |
|
.card h3 { margin: 0 0 0.5rem 0; } |
|
.row { display: flex; gap: 0.5rem; align-items: center; margin: 0.5rem 0; } |
|
.row label { min-width: 180px; color: #374151; font-weight: 500; } |
|
.row input, .row select { flex: 1; padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 6px; } |
|
.btn { background: #4f46e5; border: none; color: #fff; padding: 0.6rem 1rem; border-radius: 8px; cursor: pointer; } |
|
.btn.secondary { background: #10b981; } |
|
.btn.danger { background: #ef4444; } |
|
.btn:disabled { opacity: 0.5; cursor: not-allowed; } |
|
.muted { color: #6b7280; font-size: 0.9rem; } |
|
code.inline { background: #f3f4f6; padding: 0.1rem 0.3rem; border-radius: 4px; } |
|
.log { background: #0b1020; color: #d1d5db; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; padding: 0.75rem; border-radius: 8px; height: 220px; overflow: auto; } |
|
.ok { color: #10b981; } |
|
.warn { color: #f59e0b; } |
|
.err { color: #ef4444; } |
|
</style> |
|
</head> |
|
<body> |
|
<nav class="navbar"> |
|
<div class="nav-container"> |
|
<div class="nav-logo"><h2>Solana PoWH3D dApp</h2></div> |
|
<ul class="nav-menu"> |
|
<li><a href="/">Home</a></li> |
|
<li><a href="/solana.html">Solana dApp</a></li> |
|
</ul> |
|
</div> |
|
</nav> |
|
|
|
<div class="dapp-container"> |
|
<div class="card"> |
|
<div class="row"> |
|
<button id="connectBtn" class="btn">Connect Phantom</button> |
|
<div id="walletInfo" class="muted">Not connected</div> |
|
</div> |
|
<div class="grid"> |
|
<div class="card"> |
|
<h3>Configuration</h3> |
|
<div class="row"> |
|
<label>Cluster</label> |
|
<select id="cluster"> |
|
<option value="https://api.devnet.solana.com">Devnet</option> |
|
<option value="https://api.mainnet-beta.solana.com">Mainnet</option> |
|
</select> |
|
</div> |
|
<div class="row"> |
|
<label>Program ID</label> |
|
<input id="programId" value="9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM" /> |
|
</div> |
|
<div class="row"> |
|
<label>Mint (Token)</label> |
|
<input id="mint" placeholder="Paste the mint address here" /> |
|
</div> |
|
<div class="row"> |
|
<label>Referrer (optional)</label> |
|
<input id="referrer" placeholder="Referrer wallet address" /> |
|
</div> |
|
<div class="row"> |
|
<label>Derived Powh PDA</label> |
|
<input id="powhPda" readonly /> |
|
</div> |
|
<div class="row"> |
|
<label>Derived User PDA</label> |
|
<input id="userPda" readonly /> |
|
</div> |
|
</div> |
|
|
|
<div class="card"> |
|
<h3>Register</h3> |
|
<p class="muted">Creates your on-chain user account and your token account (ATA) if missing.</p> |
|
<button id="registerBtn" class="btn">Register User</button> |
|
</div> |
|
|
|
<div class="card"> |
|
<h3>Buy</h3> |
|
<div class="row"> |
|
<label>SOL amount</label> |
|
<input id="buyAmount" type="number" step="0.001" value="0.1" /> |
|
</div> |
|
<button id="buyBtn" class="btn secondary">Buy Tokens</button> |
|
</div> |
|
|
|
<div class="card"> |
|
<h3>Sell</h3> |
|
<div class="row"> |
|
<label>Tokens to sell (raw, 9dp)</label> |
|
<input id="sellAmount" type="number" step="1" value="100000000" /> |
|
</div> |
|
<button id="sellBtn" class="btn danger">Sell Tokens</button> |
|
</div> |
|
|
|
<div class="card"> |
|
<h3>Withdraw</h3> |
|
<p class="muted">Claims your accumulated dividends and referral rewards.</p> |
|
<button id="withdrawBtn" class="btn">Withdraw Dividends</button> |
|
</div> |
|
|
|
<div class="card"> |
|
<h3>Status</h3> |
|
<div class="row"><label>Wallet</label><input id="walletAddr" readonly /></div> |
|
<div class="row"><label>ATA</label><input id="ataAddr" readonly /></div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<div class="card"> |
|
<h3>Logs</h3> |
|
<div id="log" class="log"></div> |
|
</div> |
|
</div> |
|
</body> |
|
</html> |