feat(rwallet): auto-load EncryptID wallet or demo EOA on page load

Instead of showing an empty form, rWallet now automatically detects and
loads the user's EncryptID wallet address, or Vitalik.eth as a demo if
not logged in. URL ?address= param still takes priority.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-11 21:58:13 -07:00
parent 8efe18280c
commit 9f177147df
1 changed files with 11 additions and 0 deletions

View File

@ -141,6 +141,17 @@ class FolkWalletViewer extends HTMLElement {
const params = new URLSearchParams(window.location.search);
this.address = params.get("address") || "";
this.checkAuthState();
// Auto-load: use session wallet, or fall back to demo EOA
if (!this.address) {
if (this.passKeyEOA) {
this.address = this.passKeyEOA;
} else {
// Demo EOA — Vitalik.eth
this.address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
}
}
this.render();
if (this.address) this.detectChains();
}