# CCIP v1.5.1 IRouterClient API Reference
Source: https://docs.chain.link/ccip/api-reference/evm/v1.5.1/i-router-client

> For the complete documentation index, see [llms.txt](/llms.txt).

<Aside type="note" title="Integrate Chainlink CCIP v1.5.1 into your project">
  <Tabs sharedStore="ccip-v1-5-1-package" client:visible>
    <Fragment slot="tab.1">npm</Fragment>
    <Fragment slot="tab.2">yarn</Fragment>
    <Fragment slot="tab.3">foundry</Fragment>

    <Fragment slot="panel.1">
      If you use [NPM](https://www.npmjs.com/), install the [@chainlink/contracts-ccip NPM package](https://www.npmjs.com/package/@chainlink/contracts-ccip):

      ```shell
      npm install @chainlink/contracts-ccip@1.5.1-beta.0
      ```
    </Fragment>

    <Fragment slot="panel.2">
      If you use [Yarn](https://yarnpkg.com/), install the [@chainlink/contracts-ccip NPM package](https://www.npmjs.com/package/@chainlink/contracts-ccip):

      ```shell
      yarn add @chainlink/contracts-ccip@1.5.1-beta.0
      ```
    </Fragment>

    <Fragment slot="panel.3">
      If you use [Foundry](https://book.getfoundry.sh/), install the package:

      ```shell
      forge install smartcontractkit/ccip@5e7b2096586bc32c6e975fc13f4c411eb687f833
      ```
    </Fragment>
  </Tabs>
</Aside>

## IRouterClient

The IRouterClient interface provides the core functionality for sending cross-chain messages through CCIP (Chainlink Cross-Chain Interoperability Protocol).

[Git Source](https://github.com/smartcontractkit/chainlink/blob/contracts-v1.3.0/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol)

## Errors

### InsufficientFeeTokenAmount

Thrown when the provided fee token amount is insufficient for the message delivery.

```solidity
error InsufficientFeeTokenAmount();
```

### InvalidMsgValue

Thrown when the provided msg.value is invalid for the operation.

```solidity
error InvalidMsgValue();
```

### UnsupportedDestinationChain

Thrown when attempting to send a message to an unsupported destination chain.

```solidity
error UnsupportedDestinationChain(uint64 destChainSelector);
```

## Functions

### ccipSend

Sends a message to the destination chain through CCIP.

```solidity
function ccipSend(
  uint64 destinationChainSelector,
  Client.EVM2AnyMessage calldata message
) external payable returns (bytes32);
```

> \*\*NOTE\*\*
>
>
>
> Request a message to be sent to the destination chain.
>
> - Note: If msg.value is larger than the required fee (from getFee), the overpayment is accepted with no refund
> - The function will revert with an appropriate reason if the message is invalid

**Parameters**

| Name                       | Type                                                                            | Description                                               |
| -------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------- |
| `destinationChainSelector` | `uint64`                                                                        | The destination chain ID                                  |
| `message`                  | [`Client.EVM2AnyMessage`](/ccip/api-reference/evm/v1.5.1/client#evm2anymessage) | The cross-chain CCIP message including data and/or tokens |

**Returns**

| Name        | Type      | Description    |
| ----------- | --------- | -------------- |
| `messageId` | `bytes32` | The message ID |

### getFee

Gets the fee required for sending a CCIP message to the destination chain.

```solidity
function getFee(
  uint64 destinationChainSelector,
  Client.EVM2AnyMessage memory message
) external view returns (uint256 fee);
```

> \*\*NOTE\*\*
>
>
>
> Calculates the execution fee for message delivery to the destination chain. The fee is denominated in the feeToken specified in the message.
>
> The function will revert with an appropriate reason if the message is invalid.
>
> **Important Note for Hedera**: When using HBAR or WHBAR as fee tokens on Hedera, `getFee()` returns a value with 8 decimals that must be scaled by 10^10 before using it with `ccipSend()`. This scaling is only required for off-chain applications. See the [Chain-Specific Considerations](/ccip/concepts/best-practices/evm#chain-specific-considerations) section in the Best Practices guide for more details.

**Parameters**

| Name                       | Type                                                                            | Description                                               |
| -------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------- |
| `destinationChainSelector` | `uint64`                                                                        | The destination chainSelector                             |
| `message`                  | [`Client.EVM2AnyMessage`](/ccip/api-reference/evm/v1.5.1/client#evm2anymessage) | The cross-chain CCIP message including data and/or tokens |

**Returns**

| Name  | Type      | Description                                                                                                                |
| ----- | --------- | -------------------------------------------------------------------------------------------------------------------------- |
| `fee` | `uint256` | Returns execution fee for the message delivery to destination chain, denominated in the feeToken specified in the message. |

### isChainSupported

Checks if the given chain ID is supported for sending/receiving.

```solidity
function isChainSupported(uint64 destChainSelector) external view returns (bool supported);
```

<Aside>Checks if the given chain ID is supported for sending/receiving.</Aside>

**Parameters**

| Name                | Type     | Description         |
| ------------------- | -------- | ------------------- |
| `destChainSelector` | `uint64` | The chain to check. |

**Returns**

| Name        | Type   | Description                               |
| ----------- | ------ | ----------------------------------------- |
| `supported` | `bool` | is true if it is supported, false if not. |