CCIP v1.5.1 Client Library API Reference
Client
A library that provides core data structures and utilities for building and handling cross-chain messages in CCIP.
Structs
Any2EVMMessage
Structure representing a message received from any chain to an EVM chain.
struct Any2EVMMessage {
bytes32 messageId;
uint64 sourceChainSelector;
bytes sender;
bytes data;
EVMTokenAmount[] destTokenAmounts;
}
Properties
Name | Type | Description |
---|---|---|
messageId | bytes32 | Message ID corresponding to ccipSend on source |
sourceChainSelector | uint64 | Identifier of the source chain |
sender | bytes | Sender address (use abi.decode if from EVM chain) |
data | bytes | Custom payload from the original message |
destTokenAmounts | EVMTokenAmount[] | Token amounts in destination chain representation |
EVM2AnyMessage
Structure for sending a message from an EVM chain to any supported chain.
struct EVM2AnyMessage {
bytes receiver;
bytes data;
EVMTokenAmount[] tokenAmounts;
address feeToken;
bytes extraArgs;
}
Properties
Name | Type | Description |
---|---|---|
receiver | bytes | Encoded receiver address for destination EVM chains |
data | bytes | Custom payload to send |
tokenAmounts | EVMTokenAmount[] | Tokens and amounts to transfer |
feeToken | address | Token used for fees (address(0) for native tokens) |
extraArgs | bytes | Additional arguments encoded with _argsToBytes |
EVMExtraArgsV1
Structure for V1 extra arguments in cross-chain messages.
struct EVMExtraArgsV1 {
uint256 gasLimit;
}
Properties
Name | Type | Description |
---|---|---|
gasLimit | uint256 | Gas limit for execution on destination chain |
EVMExtraArgsV2
Structure for V2 extra arguments in cross-chain messages.
struct EVMExtraArgsV2 {
uint256 gasLimit;
bool allowOutOfOrderExecution;
}
Properties
Name | Type | Description |
---|---|---|
gasLimit | uint256 | Gas limit for execution on destination chain |
allowOutOfOrderExecution | bool | Whether messages can be executed in any order |
EVMTokenAmount
Structure representing token amounts in CCIP messages.
struct EVMTokenAmount {
address token;
uint256 amount;
}
Properties
Name | Type | Description |
---|---|---|
token | address | Token address on the local chain |
amount | uint256 | Amount of tokens to transfer |
State Variables
EVM_EXTRA_ARGS_V1_TAG
bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9;
EVM_EXTRA_ARGS_V2_TAG
bytes4 public constant EVM_EXTRA_ARGS_V2_TAG = 0x181dcf10;
Functions
_argsToBytes (V1)
Encodes EVMExtraArgsV1 into bytes for message transmission.
function _argsToBytes(EVMExtraArgsV1 memory extraArgs) internal pure returns (bytes memory bts);
Parameters
Name | Type | Description |
---|---|---|
extraArgs | EVMExtraArgsV1 | The V1 extra arguments to encode |
Returns
Type | Description |
---|---|
bytes | The encoded extra arguments with tag |
_argsToBytes (V2)
Encodes EVMExtraArgsV2 into bytes for message transmission.
function _argsToBytes(EVMExtraArgsV2 memory extraArgs) internal pure returns (bytes memory bts);
Parameters
Name | Type | Description |
---|---|---|
extraArgs | EVMExtraArgsV2 | The V2 extra arguments to encode |
Returns
Type | Description |
---|---|
bytes | The encoded extra arguments with tag |