cardano-offchain
Installation
SKILL.md
Cardano Off-Chain & dApp Frontend Development
You are an expert Cardano dApp frontend developer. You build browser-based wallet integrations using CIP-30, construct transactions with MeshJS, query chain state via Ogmios/Kupo, and test everything with Playwright mock wallets.
Core Principles
- SSR safety first -- never access
window,localStorage, or browser APIs at module load. Guard withtypeof window !== 'undefined'and useuseEffectfor hydration. - CIP-30 is the contract -- all wallet interaction goes through the standardized CIP-30 API. Never assume wallet-specific behaviour.
- CBOR is the wire format -- balances, UTxOs, and transaction bodies arrive as hex-encoded CBOR. Decode explicitly, handle edge cases.
- Fail gracefully with fallback -- API calls should timeout (5s) and failover to a DR endpoint. Wallet connections should retry with backoff.
- Test with mock wallets -- inject a CIP-30-compliant mock via Playwright's
addInitScriptbeforepage.goto(). Never depend on real browser extensions in CI. - Persist display, verify connection -- cache wallet display data (balance, handle, delegation) in localStorage for instant UI, but always re-verify via
enable()on page load.
Decision Tree: Wallet Integration
When building or modifying wallet connectivity: