- wallets.js: WalletManager state management with chain validation - verifier.js: WalletVerifier EIP-712 signing via window.ethereum - stream.js: WalletStreamManager with BroadcastChannel leader election, backoff + jitter - AGENTS.md: updated with coding guidelines
44 lines
1.8 KiB
HTML
44 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Wallet Verifier Test Harness</title>
|
|
<style>
|
|
body { font-family: sans-serif; padding: 40px; background: #1a1a1a; color: #fff; }
|
|
button { padding: 12px 24px; font-size: 16px; cursor: pointer; background: #3b82f6; color: white; border: none; border-radius: 6px; }
|
|
button:hover { background: #2563eb; }
|
|
#log { margin-top: 20px; padding: 15px; background: #2a2a2a; border-radius: 6px; white-space: pre-wrap; font-family: monospace; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2>Dione Multi-Wallet Verifier Test</h2>
|
|
<button id="connectBtn">⚡ Connect & Verify Wallet</button>
|
|
<div id="log">Click the button to start initialization...</div>
|
|
|
|
<script type="module">
|
|
import { WalletManager } from './wallets.js';
|
|
import { WalletVerifier } from './verifier.js';
|
|
|
|
const wm = new WalletManager();
|
|
wm.loadWallets();
|
|
const verifier = new WalletVerifier(wm);
|
|
|
|
const logDiv = document.getElementById('log');
|
|
|
|
document.getElementById('connectBtn').addEventListener('click', async () => {
|
|
logDiv.innerText = "Triggering wallet connection...\nCheck your extension popup!";
|
|
try {
|
|
const result = await verifier.triggerWalletVerification('base', 'My Dev Wallet');
|
|
if (result.success) {
|
|
logDiv.style.color = '#4ade80';
|
|
logDiv.innerText = `🎉 SUCCESS!\n\nVerified Wallet:\n${JSON.stringify(result.wallet, null, 2)}\n\nFull LocalStorage State:\n${localStorage.getItem('cbbtc_tracked_wallets')}`;
|
|
}
|
|
} catch (error) {
|
|
logDiv.style.color = '#f87171';
|
|
logDiv.innerText = `❌ ERROR CAUGHT:\n${error.message}`;
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|