Get the ABI (or a subset) of a known contract
getContractAbiRetrieve specific ABI fragments for registered smart contracts to use in transactions or calls, with filters for method names, fragment types, and state mutability.
Instructions
Return the ABI of a contract registered in the server, with optional filters to keep the payload small. Always prefer the most specific filters: pass methodNames: ["balanceOf", "transfer"] to get just those fragments, or stateMutability: "view" to list read-only methods. When called with no filters on a large ABI the server returns only the list of function names and asks you to refine the query (the full ABI would be tens of KB). Use the returned fragments directly in callContract / buildContractTransaction together with the same name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Contract name from listKnownContracts (e.g. "b3tr", "x2EarnApps", "stargateNft", "erc20") | |
| methodNames | No | When provided, only fragments whose name is in this list are returned. | |
| fragmentType | No | Restrict to a single fragment kind. Default returns only functions. | function |
| stateMutability | No | Filter function fragments by mutability. Use "view" or "pure" for read-only methods. | all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| error | No | ||
| network | Yes |