The Playground
What the Playground is
The Valdium Playground is an in-browser IDE for writing, deploying, and interacting with Valdium smart contracts without installing anything. It lives at playground.valdium.xyz and ships three starter templates, a connect-wallet button, and a live testnet endpoint. You can take an idea from blank file to deployed contract in under a minute — and you can do it from a phone if you have to.
It exists because the gap between "interested in Valdium" and "ran your first transaction" used to be a CLI install, a Node version check, a keystore unlock, and a faucet visit. The Playground compresses that into one tab.
What's inside
- Editor. Monaco — the same editor that powers VS Code. Full JavaScript syntax, autocomplete on the Valdium contract intrinsics, and inline error markers from the type checker.
- Templates. Three starters: an ERC-20-shaped fungible token, a simple counter, and a multisig wallet. Pick one, modify, deploy.
- Compile button. Runs the contract through the type checker and the SES lockdown analyzer before letting you deploy. Errors land in the bottom panel with line numbers.
- Deploy panel. Connects via the Valdium Wallet browser extension, sends the deploy transaction, and shows you the address as soon as the block lands.
- Interact panel. Reads and writes against any deployed contract. Function signatures are inferred from the source you typed, so you don't paste an ABI.
Walk-through: deploy a counter
Open the Playground, pick the Counter template, and you'll see:
export class Counter {
#count = 0;
increment() {
this.#count += 1;
return this.#count;
}
get() {
return this.#count;
}
}That's a complete Valdium contract. The class is the contract; private fields are persistent state; public methods are callable from transactions or RPC. There's no separate language, no compiler artifacts to ship around, no separate ABI file. Click Compile — the bottom panel should say OK · 0 errors. Click Deploy — the wallet pops up with the deploy tx, you sign, the deploy lands within ~2 seconds, and the deployed address shows up in the right panel.
Now switch to the Interact tab. Click increment(), sign the tx in the wallet, watch the panel show returned: 1. Click again — returned: 2. Click get() — no wallet prompt this time, because get() is a read; the result comes back instantly.
Sharing and persistence
Each Playground session has a shareable URL of the form playground.valdium.xyz/s/<id>. Click Share and the current editor contents plus the deployed-contract addresses are packed into a snapshot and stored on the Valdium IPFS gateway. Anyone with the link gets the exact same editor state — useful for bug reports, tutorials, and "look at this contract I deployed."
Snapshots are read-only when opened by someone else; they get a Fork button instead. Forking gives them a fresh editable session with the same starting code.
What it can't do
The Playground is a thin tool by design. It is the right place for:
- Learning the contract API.
- Prototyping a single contract end-to-end.
- Sharing reproducible examples with collaborators.
It is the wrong place for:
- Production deploys. Use the CLI and a hardware-backed key.
- Test suites. Use the testing framework locally.
- Multi-contract systems. The Playground holds one file; real systems need a project structure.
Limits and quotas
The Playground talks to a dedicated, rate-limited RPC. Free-tier limits are 60 deploys per IP per hour and 600 reads per IP per minute — generous for human use, restrictive enough to keep bots from soaking it up. Heavy users can connect their own RPC endpoint from the settings menu.