# CCIP v1.6.2 IRouterClient API Reference
Source: https://docs.chain.link/ccip/v1/evm/api-reference/v1.6.2/i-router-client
Last Updated: 2025-10-06

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

> **NOTE: Integrate Chainlink CCIP v1.6.2 into your project**
>
> ### npm
>
> 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.6.2
> ```
>
> ### yarn
>
> 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.6.2
> ```
>
> ### foundry
>
> In your [Foundry](https://book.getfoundry.sh/) project, for easier integration, if you want to avoid installing the dependencies that are only used by the `chainlink-ccip` package, you can use either [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/) to install the `chainlink-ccip` package:
>
> - Using `npm`:
>
>   ```shell
>   npm install @chainlink/contracts-ccip@1.6.2
>   ```
> - Using `yarn`:
>
>   ```shell
>   yarn add @chainlink/contracts-ccip@1.6.2
>   ```
>
> Then, add the following remappings to your `remappings.txt` or `foundry.toml` file:
>
> ```
> "@chainlink/contracts-ccip/contracts/=node_modules/@chainlink/contracts-ccip/contracts/",
> "@chainlink/contracts/=node_modules/@chainlink/contracts/",
> "@openzeppelin/contracts@4.8.3/=node_modules/@openzeppelin/contracts-4.8.3/",
> "@openzeppelin/contracts@5.0.2/=node_modules/@openzeppelin/contracts-5.0.2/"
> ```
>
> Alternatively, if you prefer to use only [`forge install`](https://getfoundry.sh/forge/reference/install/), install the `chainlink-ccip` package along with its dependencies:
>
> ```shell
> forge install \
>   smartcontractkit/chainlink-ccip@0e3e0fc5c0f70f0d50dca66b139142ddf3009294 \
>   smartcontractkit/chainlink-evm@86aa5a1d34b20eda8d18fe6eb0e4882948e545ba  \
>   openzeppelin/openzeppelin-contracts@0a25c1940ca220686588c4af3ec526f725fe2582 \
>   openzeppelin/openzeppelin-contracts@dbb6104ce834628e473d2173bbc9d47f81a9eec3
> ```
>
> Then set the remappings as follows:
>
> ```
> "@chainlink/contracts-ccip/contracts/=lib/chainlink-ccip/chains/evm/contracts/",
> "@chainlink/contracts/=lib/chainlink-evm/contracts/",
> "@openzeppelin/contracts@4.8.3/=lib/openzeppelin-contracts/contracts/",
> "@openzeppelin/contracts@5.0.2/=lib/openzeppelin-contracts/contracts/"
> ```

## 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-ccip/tree/contracts-ccip-v1.6.2/chains/evm/contracts/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/v1/evm/api-reference/v1.6.2/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/v1/evm/concepts/best-practices#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/v1/evm/api-reference/v1.6.2/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);
```

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

**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. |