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

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

<Aside type="note" title="Integrate Chainlink CCIP v1.5.0 into your project">
  <Tabs sharedStore="ccip-v1-5-0-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.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.0
      ```
    </Fragment>

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

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

To send messages through CCIP, users must interact with the [`IRouterClient`](https://github.com/smartcontractkit/ccip/tree/release/contracts-ccip-1.5.0/contracts/src/v0.8/ccip/interfaces/IRouterClient.sol) interface.
After you import `IRouterClient.sol`, you can initialize a router client instance:

```solidity
import {IRouterClient} from "@chainlink/contracts-ccip/src/v0.8/ccip/interfaces/IRouterClient.sol";
...
IRouterClient router;
constructor(address _router) {
     router = IRouterClient(_router);
 }
```

## Errors

### UnsupportedDestinationChain

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

### InsufficientFeeTokenAmount

```solidity
error InsufficientFeeTokenAmount()
```

### InvalidMsgValue

```solidity
error InvalidMsgValue()
```

## Functions

### isChainSupported

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

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

#### Parameters

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| chainSelector | uint64 | The chain to check. |

#### Return Values

| Name      | Type | Description                           |
| --------- | ---- | ------------------------------------- |
| supported | bool | is true if supported or false if not. |

### getSupportedTokens

> **NOTE: Deprecation Notice**
>
> This function is deprecated and will be deactivated in future versions. We recommend avoiding its use at this time. An
> alternative method will be provided in an upcoming release.

```solidity
function getSupportedTokens(uint64 chainSelector) external view returns (address[] tokens)
```

Gets a list of all supported tokens which can be sent or received
to or from a given chain ID.

#### Parameters

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| chainSelector | uint64 | The chainSelector. |

#### Return Values

| Name   | Type       | Description                            |
| ------ | ---------- | -------------------------------------- |
| tokens | address\[] | The addresses of all supported tokens. |

### getFee

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

*returns 0 fees on invalid message.*

#### Parameters

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

#### Return Values

| Name | Type    | Description                                                                                  |
| ---- | ------- | -------------------------------------------------------------------------------------------- |
| fee  | uint256 | returns guaranteed execution fee for the specified message delivery to the destination chain |

### ccipSend

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

Request a message to be sent to the destination chain.

> **CAUTION**
>
> If the `msg.value` exceeds the required fee from `getFee`, the overpayment is accepted with no refund.

#### Parameters

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

#### Return Values

| Name | Type    | Description              |
| ---- | ------- | ------------------------ |
| \[0] | bytes32 | messageId The message ID |