> For the complete documentation index, see [llms.txt](https://contracts.synapseprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://contracts.synapseprotocol.com/messaging/interfaces/imessagebus.md).

# IMessageBus

## Methods

### estimateFee

```solidity
function estimateFee(uint256 _dstChainId, bytes _options) external nonpayable returns (uint256)
```

Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit

#### Parameters

| Name         | Type    | Description                                                                                                                |
| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| \_dstChainId | uint256 | undefined                                                                                                                  |
| \_options    | bytes   | Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with. |

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### executeMessage

```solidity
function executeMessage(uint256 _srcChainId, bytes _srcAddress, address _dstAddress, uint256 _gasLimit, uint256 _nonce, bytes _message, bytes32 _messageId) external nonpayable
```

Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain

#### Parameters

| Name         | Type    | Description                                                                                                             |
| ------------ | ------- | ----------------------------------------------------------------------------------------------------------------------- |
| \_srcChainId | uint256 | Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains |
| \_srcAddress | bytes   | Originating bytes address of the message sender on the srcChain                                                         |
| \_dstAddress | address | Destination address that the arbitrary message will be passed to                                                        |
| \_gasLimit   | uint256 | Gas limit to be passed alongside the message, depending on the fee paid on srcChain                                     |
| \_nonce      | uint256 | Nonce from origin chain                                                                                                 |
| \_message    | bytes   | Arbitrary message payload to pass to the destination chain receiver                                                     |
| \_messageId  | bytes32 | MessageId for uniqueness of messages (alongisde nonce)                                                                  |

### sendMessage

```solidity
function sendMessage(bytes32 _receiver, uint256 _dstChainId, bytes _message, bytes _options) external payable
```

Sends a message to a receiving contract address on another chain. Sender must make sure that the message is unique and not a duplicate message.

#### Parameters

| Name         | Type    | Description                                                                               |
| ------------ | ------- | ----------------------------------------------------------------------------------------- |
| \_receiver   | bytes32 | The bytes32 address of the destination contract to be called                              |
| \_dstChainId | uint256 | The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains |
| \_message    | bytes   | The arbitrary payload to pass to the destination chain receiver                           |
| \_options    | bytes   | Versioned struct used to instruct relayer on how to proceed with gas limits               |

### withdrawFee

```solidity
function withdrawFee(address _account) external nonpayable
```

Withdraws message fee in the form of native gas token.

#### Parameters

| Name      | Type    | Description                    |
| --------- | ------- | ------------------------------ |
| \_account | address | The address receiving the fee. |


---

# 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://contracts.synapseprotocol.com/messaging/interfaces/imessagebus.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.
