Composite: fetch a DERO smart contract (code + variables + balances) and return its function surface, a classification of the contract pattern (tela_index | tela_doc | token | registry | minimal | generic), a plain-language narrative, and curated DVM docs citations re-ordered so the most relevant page is first. TELA contracts (apps/files) are detected first and cite the TELA spec; for a deep TELA parse use tela_inspect.
When to call: when the user wants to UNDERSTAND a smart contract — its functions, state shape, or which DVM concept to read about. PREFER this over chaining dero_get_sc with a docs lookup yourself: this composite already parses the DVM-BASIC source for function declarations, sorts stringkeys/uint64keys deterministically, and picks the right docs page from a heuristic so the agent does not have to learn DVM-BASIC syntax to summarize a contract.
Input Requirements:
- `scid` is REQUIRED. Must be 64 hex chars (the smart contract id). Use `0000…0001` for the on-chain name registry as a known-good example.
- `topoheight` is OPTIONAL. Provide to inspect the contract at a specific topo height; omit for latest tip.
Output: `{ scid, topoheight, kind, surface: { functions[], stringkeys[], uint64keys[], balances }, narrative, raw_code_length, has_code, related_docs }`. `kind` is one of `tela_index | tela_doc | token | registry | minimal | generic`. `surface.functions` items are `{ name, args, returns }`. `has_code` is false when the SCID is unknown or has no on-chain code; `functions` is then `[]` and the narrative explains the gap. `raw_code_length` is always present so the agent knows when to fall back to `dero_get_sc` for the full source.
Connector