CCIP v1.5.1 IRouterClient API Reference
IRouterClient
The IRouterClient interface provides the core functionality for sending cross-chain messages through CCIP (Chainlink Cross-Chain Interoperability Protocol).
Errors
InsufficientFeeTokenAmount
Thrown when the provided fee token amount is insufficient for the message delivery.
error InsufficientFeeTokenAmount();
InvalidMsgValue
Thrown when the provided msg.value is invalid for the operation.
error InvalidMsgValue();
UnsupportedDestinationChain
Thrown when attempting to send a message to an unsupported destination chain.
error UnsupportedDestinationChain(uint64 destChainSelector);
Functions
ccipSend
Sends a message to the destination chain through CCIP.
function ccipSend(
uint64 destinationChainSelector,
Client.EVM2AnyMessage calldata message
) external payable returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
destinationChainSelector | uint64 | The destination chain ID |
message | 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.
function getFee(
uint64 destinationChainSelector,
Client.EVM2AnyMessage memory message
) external view returns (uint256 fee);
Parameters
Name | Type | Description |
---|---|---|
destinationChainSelector | uint64 | The destination chainSelector |
message | 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.
function isChainSupported(uint64 destChainSelector) external view returns (bool supported);
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. |