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
Field | Type | Description |
---|---|---|
token | address | The address of the token on Aptos. |
amount | u64 | The 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 theAny2AptosMessage
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
Field | Type | Description |
---|---|---|
receiver | vector<u8> | The destination address in its native byte format (e.g., 20 bytes for EVM addresses, 32 for Aptos). |
data | vector<u8> | The arbitrary data payload to be processed by the receiver on the destination chain. |
token_addresses | vector<address> | A vector of Aptos token type addresses to transfer. |
token_amounts | vector<u64> | A vector of amounts for each corresponding token, in the token's smallest denomination. |
token_store_addresses | vector<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_token | address | The type address of the token used to pay CCIP fees. Use 0xa if paying with native APT. |
fee_token_store | address | The Fungible Asset store address for the fee token. Use 0x0 to default to the primary store. |
extra_args | vector<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
Field | Type | Description |
---|---|---|
message_id | vector<u8> | The unique 32-byte identifier for this cross-chain message. |
source_chain_selector | u64 | The unique identifier of the blockchain where the message originated. |
sender | vector<u8> | The sender's address on the source blockchain, in its native byte format. |
data | vector<u8> | The arbitrary data payload sent from the source chain for your module to process. |
dest_token_amounts | vector<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
Field | Type | Description |
---|---|---|
header | RampMessageHeader | Metadata about the message: message_id , source_chain_selector , dest_chain_selector , sequence_number , and nonce . |
sender | address | The sender's 32-byte Aptos account address on the source chain. |
data | vector<u8> | The arbitrary payload data. |
receiver | vector<u8> | The destination address in its native byte format. |
extra_args | vector<u8> | The serialized "extra arguments" relevant to the destination, such as gas limits. |
fee_token | address | The type address of the token used to pay CCIP fees. |
fee_token_amount | u64 | The amount of the fee_token (in its native denomination) that was charged. |
fee_value_juels | u256 | The total fee value converted to LINK Juels (1e18 decimals) for standardized value reporting. |
token_amounts | vector<Aptos2AnyTokenTransfer> | A list of tokens locked or burned on Aptos as part of the message. |
Extra Args
Tags
Constant | Value (Hex) | Purpose |
---|---|---|
EVM_EXTRA_ARGS_V2_TAG | 0x181dcf10 | Denotes GenericExtraArgsV2 for Aptos → EVM or Aptos → Aptos messages. |
SVM_EXTRA_ARGS_V1_TAG | 0x1f3b3aba | Denotes 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
Field | Type | Description |
---|---|---|
gas_limit | u256 | The 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_execution | bool | If 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
Field | Type | Description |
---|---|---|
compute_units | u32 | The number of compute units allocated to the SVM program. |
account_is_writable_bitmap | u64 | Bitmap indicating which accounts are writable during program execution. |
allow_out_of_order_execution | bool | If 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. |
accounts | vector<vector<u8>> | A list of serialized SVM accounts passed to the program. |