API Version: v1.5.1

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.

Git Source

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

NameTypeDescription
messageIdbytes32Message ID corresponding to ccipSend on source
sourceChainSelectoruint64Identifier of the source chain
senderbytesSender address (use abi.decode if from EVM chain)
databytesCustom payload from the original message
destTokenAmountsEVMTokenAmount[]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

NameTypeDescription
receiverbytesEncoded receiver address for destination EVM chains
databytesCustom payload to send
tokenAmountsEVMTokenAmount[]Tokens and amounts to transfer
feeTokenaddressToken used for fees (address(0) for native tokens)
extraArgsbytesAdditional arguments encoded with _argsToBytes

EVMExtraArgsV1

Structure for V1 extra arguments in cross-chain messages.

struct EVMExtraArgsV1 {
  uint256 gasLimit;
}

Properties

NameTypeDescription
gasLimituint256Gas limit for execution on destination chain

EVMExtraArgsV2

Structure for V2 extra arguments in cross-chain messages.

struct EVMExtraArgsV2 {
  uint256 gasLimit;
  bool allowOutOfOrderExecution;
}

Properties

NameTypeDescription
gasLimituint256Gas limit for execution on destination chain
allowOutOfOrderExecutionboolWhether messages can be executed in any order

EVMTokenAmount

Structure representing token amounts in CCIP messages.

struct EVMTokenAmount {
  address token;
  uint256 amount;
}

Properties

NameTypeDescription
tokenaddressToken address on the local chain
amountuint256Amount 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

NameTypeDescription
extraArgsEVMExtraArgsV1The V1 extra arguments to encode

Returns

TypeDescription
bytesThe 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

NameTypeDescription
extraArgsEVMExtraArgsV2The V2 extra arguments to encode

Returns

TypeDescription
bytesThe encoded extra arguments with tag

Get the latest Chainlink content straight to your inbox.