invoke_contract
Simulate a Soroban contract function call over RPC to get the result and resource costs (CPU, memory, min fee) without needing signing for read-only calls.
Instructions
Simulates a Soroban contract function call via RPC. Returns the function result AND simulated resource cost (CPU instructions, memory, min fee). For read-only calls no signing is needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Arguments to pass to the function. Supported types: number, string, boolean, or objects with {type: "address"|"bytes", value: string} | |
| network | No | Network to invoke on | testnet |
| contract_id | Yes | Contract ID (56-character string starting with C) | |
| function_name | Yes | Name of the contract function to call | |
| source_account | No | Source account public key for simulation (not required for read-only calls). Defaults to a zero-balance account for simulation. |