Skip to main content
Version: 1.16.1

Function: getMessageVersion()

getMessageVersion(message: CCIPMessage<"1.6.0" | "2.0.0">): "1.6.0" | "2.0.0"

Defined in: requests.ts:290

Get the CCIP protocol version of a decoded 1.6+ message (one with a header).

Parameters​

ParameterTypeDescription
messageCCIPMessage<"1.6.0" | "2.0.0">Decoded message with a header (destChainSelector).

Returns​

"1.6.0" | "2.0.0"

2.0.0 for a 2.0 message, else 1.6.0.

Remarks​

The message shape gives the version, not the emitting contract: one contract can emit messages of more than one version. For example, a Solana 2.0 Router keeps its 1.6 entrypoint (ccip_send, event CCIPMessageSent) next to the 2.0 one (ccip_send_v2, event CCIPMessageSentV2), on the same program address. Only 2.0 messages carry offRampAddress.