API Version: v1.6.0

CCIP v1.6.0 Aptos Messages API Reference

Messages

This section details the data structures used for sending and receiving CCIP messages on Aptos.

Any2AptosTokenAmount

The Any2AptosTokenAmount struct represents a specific token and amount being delivered to the Aptos chain as part of a cross-chain message.

// As defined in ccip::client
struct Any2AptosTokenAmount has store, drop, copy {
    token: address,
    amount: u64
}

Parameters

FieldTypeDescription
tokenaddressThe address of the token on Aptos.
amountu64The number of tokens transferred, represented in the token's smallest unit (e.g., Octas for APT-based tokens).

Where it's used:

  • As part of the dest_token_amounts vector in the Any2AptosMessage struct when receiving a message on Aptos.

Aptos2AnyMessage

(Conceptual)

This isn't a formal struct but represents the parameters passed to the onramp::ccip_send entry function to initiate a cross-chain message from Aptos.

Parameters

FieldTypeDescription
receivervector<u8>The destination address in its native byte format (e.g., 20 bytes for EVM addresses, 32 for Aptos).
datavector<u8>The arbitrary data payload to be processed by the receiver on the destination chain.
token_addressesvector<address>A vector of Aptos token type addresses to transfer.
token_amountsvector<u64>A vector of amounts for each corresponding token, in the token's smallest denomination.
token_store_addressesvector<address>A vector of Fungible Asset store addresses from which tokens are withdrawn. Use 0x0 to default to the primary store of the sender's account.
fee_tokenaddressThe type address of the token used to pay CCIP fees. Use 0xa if paying with native APT.
fee_token_storeaddressThe Fungible Asset store address for the fee token. Use 0x0 to default to the primary store.
extra_argsvector<u8>Serialized byte vector containing additional arguments for the destination chain, such as gas limits.

Any2AptosMessage

// As defined in ccip::client
struct Any2AptosMessage has store, drop, copy {
    message_id: vector<u8>,
    source_chain_selector: u64,
    sender: vector<u8>,
    data: vector<u8>,
    dest_token_amounts: vector<Any2AptosTokenAmount>
}

Parameters

FieldTypeDescription
message_idvector<u8>The unique 32-byte identifier for this cross-chain message.
source_chain_selectoru64The unique identifier of the blockchain where the message originated.
sendervector<u8>The sender's address on the source blockchain, in its native byte format.
datavector<u8>The arbitrary data payload sent from the source chain for your module to process.
dest_token_amountsvector<Any2AptosTokenAmount>A list of tokens and their amounts that were bridged and are being delivered to the receiver module on Aptos.

Aptos2AnyRampMessage

// As defined in the OnRamp module
struct Aptos2AnyRampMessage has store, drop, copy {
    header: RampMessageHeader,
    sender: address,
    data: vector<u8>,
    receiver: vector<u8>,
    extra_args: vector<u8>,
    fee_token: address,
    fee_token_amount: u64,
    fee_value_juels: u256,
    token_amounts: vector<Aptos2AnyTokenTransfer>
}

Parameters

FieldTypeDescription
headerRampMessageHeaderMetadata about the message: message_id, source_chain_selector, dest_chain_selector, sequence_number, and nonce.
senderaddressThe sender's 32-byte Aptos account address on the source chain.
datavector<u8>The arbitrary payload data.
receivervector<u8>The destination address in its native byte format.
extra_argsvector<u8>The serialized "extra arguments" relevant to the destination, such as gas limits.
fee_tokenaddressThe type address of the token used to pay CCIP fees.
fee_token_amountu64The amount of the fee_token (in its native denomination) that was charged.
fee_value_juelsu256The total fee value converted to LINK Juels (1e18 decimals) for standardized value reporting.
token_amountsvector<Aptos2AnyTokenTransfer>A list of tokens locked or burned on Aptos as part of the message.

Extra Args

Tags

ConstantValue (Hex)Purpose
EVM_EXTRA_ARGS_V2_TAG0x181dcf10Denotes GenericExtraArgsV2 for Aptos → EVM or Aptos → Aptos messages.
SVM_EXTRA_ARGS_V1_TAG0x1f3b3abaDenotes SVMExtraArgsV1 for Aptos → SVM messages.

GenericExtraArgsV2

// Conceptual representation of data to be encoded
struct GenericExtraArgsV2 {
    gas_limit: u256,
    allow_out_of_order_execution: bool,
}

Parameters

FieldTypeDescription
gas_limitu256The gas limit for calling the receiver on the destination chain. For EVM, this is the gas for ccipReceive. For Aptos, it's the gas for your ccip_receive function.
allow_out_of_order_executionboolIf true, the message can be processed by the CCIP network in a different order than it was sent. It is recommended to set this to true.

SVMExtraArgsV1

// Conceptual representation of data to be encoded
struct SVMExtraArgsV1 {
    compute_units: u32,
    account_is_writable_bitmap: u64,
    allow_out_of_order_execution: bool,
    token_receiver: [u8; 32],
    accounts: vector<vector<u8>>,
}

Parameters

FieldTypeDescription
compute_unitsu32The number of compute units allocated to the SVM program.
account_is_writable_bitmapu64Bitmap indicating which accounts are writable during program execution.
allow_out_of_order_executionboolIf true, allows the message to be processed out of order by the CCIP network.
token_receiver[u8; 32]A 32-byte Solana address that will receive any bridged tokens. If input is shorter than 32 bytes, it will be zero-padded on the left.
accountsvector<vector<u8>>A list of serialized SVM accounts passed to the program.

Get the latest Chainlink content straight to your inbox.