OutMessageV1 Structure
TheOutMessageV1
structure contains all the fields needed for cross-chain messages:
Field Usage Guide
shardsKey: Developer ID. It is recommended to set it from the tacHeader. tvmTarget: The recipient address on the TON network in base64 format starting with “EQ”. tvmPayload: A custom payload to be executed on the TON side. Currently not supported — must be empty. tvmProtocolFee: The protocol fee you must pay. For roundTrip messages, this fee is already covered on the TON side, so set this field to 0. tvmExecutorFee: The fee you offer to the executor on the TON side (in TAC tokens). For roundTrip messages, the fee is already locked on TON, so set this field to 0. tvmValidExecutors: A list of executors you trust to execute the message on the TON side. For roundTrip messages, this must be an empty array; the trusted executors are already defined in the initial TON message. For direct messages, you can get trusted executors usingsettings.getTrustedTVMExecutors()
or use an empty array for default executors.
toBridge: List of ERC20 tokens you want to bridge to the TON network and transfer to tvmTarget.
toBridgeNFT: List of NFTs you want to bridge to the TON network and transfer to tvmTarget.
Round-Trip Messages (TON → TAC → TON)
For messages responding back to TON users, fees are paid upfront on TON:You can retrieve the list of default trusted executors by calling settings.getTrustedTVMExecutors() on the Settings contract.Key Points:
- User pays all fees upfront on TON
- RoundTrip response messages must set
tvmProtocolFee: 0
andtvmExecutorFee: 0
- Use same
shardsKey
from incoming header - Set
tvmValidExecutors
to empty array - executors already defined in original TON message
Direct TAC → TON Messages
For messages initiated directly from TAC (not in response), your contract pays the fees:Fee Estimation Challenge: Currently, there is no official library to calculate the exact executor fee, so it is recommended to:
- Overestimate slightly, or
- Use tacSDK for better fee estimation