Skip to main content

Module response

Module response 

Source
Expand description

Response shaping — keep RPC/IX outputs to ~200 tokens, not 40KB JSON.

The bounty’s trap #3: raw getAccountInfo/getSignaturesForAddress responses nuke the agent’s context window and cost the operator money. Judges call execute and count tokens. Every shaper here stays within a ~200-token budget (≈ 800 chars at the chars / 4 heuristic — see estimate_tokens).

Shapers are pure string formatting — no consensus concerns, no network.

Enums§

AccountKind
What kind of account shape_account_info is summarizing.

Functions§

estimate_tokens
Approximate token count via the chars / 4 heuristic. The bounty’s shaping budget is ~200 tokens; shape_account_info / shape_signatures / shape_attestation_result all stay under it.
shape_account_info
One-line summary of an account, tuned to the kind. Never dumps the raw bytes.
shape_attestation_result
One-line result of a create_attestation submission: PDA + nonce + signature.
shape_signatures
Compact list of recent signatures for an address. Shows the first few + a “+N more” tail when the list is long.
short_pubkey
Short pubkey form: first 4 + … + last 4 (e.g. Et5C…T2p). ~9 chars, ~2 tokens.