feat: runnable code & sandbox embeds for EVM examples#32
Conversation
Close the "static vs interactive" gap with Solana's docs (roadmap P0.2) by making the EVM example pages runnable. - RunSnippet: click-to-run read-only JSON-RPC straight against Sei's public RPC (CORS-open, no proxy), with hex->decimal decoding. Wired into the viem and ethers quickstarts as "Try It Live". - SandboxEmbed: click-to-load iframe wrapper for external sandboxes. Tier 2 (CodeSandbox) on the viem/ethers quickstarts for editable, anonymously-runnable viem/ethers TypeScript; Tier 3 (Remix) on deploy-verify/erc20/erc721 to compile + deploy Solidity to Sei testnet, paired with AddSeiButton. Surfaces use theme-agnostic translucent styles (Mintlify does not apply dark:bg-* to custom-snippet divs). No npm imports; all declarations live inside the component per Mintlify's runtime rules. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
PR SummaryLow Risk Overview Two new Mintlify snippets drive the UX: viem and ethers quickstarts gain Try It Live RPC buttons plus Edit and run CodeSandbox embeds. deploy-verify, erc20, and erc721 gain Remix sections with preloaded contracts (Counter, OpenZeppelin DemoToken / DemoNFT), wallet setup via existing Reviewed by Cursor Bugbot for commit aeaec89. Bugbot is set up for automated code reviews on this repo. Configure here. |
What is the purpose of the change?
Adds new interactive content — runnable code on the EVM example pages. This closes the biggest gap from the Sei-vs-Solana docs review (roadmap P0.2, "make code runnable"): Sei's examples were copy-paste only, while Solana lets developers run code in the browser.
Describe the changes to the documentation
Two new self-contained Mintlify snippets, wired into five existing EVM example pages. Target audience: EVM developers evaluating or building on Sei who want to try calls and deploy contracts without leaving the docs.
snippets/run-snippet.jsx— Tier 1: read-only "Run" buttonsaccess-control-allow-origin: *, so no proxy is needed. Hex results auto-decode to decimal; copy + request-timing included.eth_blockNumber,eth_chainId,eth_getBalance).snippets/sandbox-embed.jsx— Tier 2 & 3: click-to-load editor embedsAddSeiButtonfor adding Sei testnet to a wallet.srcis deferred until the reader clicks, so pages pay nothing on load.Notes
mint dev+ headless Chrome: all five pages return HTTP 200, every component mounts, zero page errors, iframes deferred. Tier 1 click→fetch→decode confirmed live against mainnet; Tier 2 confirmed to execute anonymously in an incognito context (real testnet RPC calls); Tier 3 Remix confirmed to load the preloaded contract and frame inside Mintlify with no CSP/X-Frame refusal.dark:bg-*/dark:border-*to custom-snippet container<div>s (onlydark:text-*works).cgtx45,qs82lw) were created anonymously via the Define API and should be re-created under a Sei-owned CodeSandbox account for durability/branding. Tier-2 for the python quickstart (web3.py can't run in CodeSandbox's JS-only browser bundler) and a multicall example were intentionally deferred.🤖 Generated with Claude Code