> For the complete documentation index, see [llms.txt](https://circular-protocol.gitbook.io/standard-apis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://circular-protocol.gitbook.io/standard-apis/api-docs/dart/callcontract.md).

# callContract()

Method Signature

```dart
Future<Map<String, dynamic>> callContract(String blockchain, String from, String project, String request);
```

**Parameters**

| Name         | Type   | Description                                                                                                                 |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| `blockchain` | String | Blockchain address in hex                                                                                                   |
| `from`       | String | User's wallet address in hex                                                                                                |
| `project`    | String | Smart Contract's address in hex                                                                                             |
| `request`    | String | Requested function in string format (include the parenthesis and the semicolumn e.g. CRC\_Contract.\_\_GetContractName();). |

**Example**

```dart
import 'package:circular_api/circular_api.dart';

void main() {
    final circular = CircularAPI();

    final blockchain = "0x8a20baa40c45dc5055aeb26197c203e576ef389d9acb171bd62da11dc5ad72b2";
    final address = "0x248ea24763f3aeb2590114257b0b95ebc8fc40e287574aa25379bb24c6d661ec";
    final contractAddress = "0x77796a30a3f0744ca73975547a24f939a1b93e121b3b7f50663c92d38d437d86"
    final request = "CRC_Contract.__GetContractName();";
  
    final wallet = await circular.callContract(blockchain, address, contractAddress, request);
}
```

**Result**

The result will be an object of type Map\<String, dynamic>

{% tabs %}
{% tab title="200" %}

```json
{
    "Result": 200,
    "Response": "7b20225f506572666f726d616e636522203a2022487970657220436f646520457865637574696f6e2054696d653a20313130307573222c200a0a225f436f6e736f6c655f4f757470757422203a202235343635373337343230373336643631373237343230363336663665373437323631363337343061227d",
    "Node": "7bb5bd50729d6857942701d5673ea70ca1625f883230d8543970a452d1abe1c4"
}
```

Remember to convert the response from Hex to String if you want to get the result in plain text.
{% endtab %}

{% tab title="117" %}
Wrong function call. Remember to pass the request in Hex format as shown in the body section or to verify that the smart contract address is the right one.

```json
{
    "Result": 117,
    "Response": "4552524f523a57726f6e672046756e6374696f6e2043616c6c3a200a",
    "Node": "7bb5bd50729d6857942701d5673ea70ca1625f883230d8543970a452d1abe1c4"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://circular-protocol.gitbook.io/standard-apis/api-docs/dart/callcontract.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
