API Version: v1.5.1

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

Git Source

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

NameTypeDescription
destinationChainSelectoruint64The destination chain ID
messageClient.EVM2AnyMessageThe cross-chain CCIP message including data and/or tokens

Returns

NameTypeDescription
messageIdbytes32The 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

NameTypeDescription
destinationChainSelectoruint64The destination chainSelector
messageClient.EVM2AnyMessageThe cross-chain CCIP message including data and/or tokens

Returns

NameTypeDescription
feeuint256Returns 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

NameTypeDescription
destChainSelectoruint64The chain to check.

Returns

NameTypeDescription
supportedboolis true if it is supported, false if not.

Get the latest Chainlink content straight to your inbox.