Protocol developers should utilize these interfaces to send cross-chain messages and initiate cross-chain reads via the Metalayer.
dispatch
function on the
MetalayerRouter contract. This function takes in the destination domain, recipient address, reads, write call data, and a boolean indicating whether or not
to wait for finality on the source chainbefore relaying the message.
quoteGasPayment
function is used to calculate the amount of gas that will be paid for the message. This function takes in the destination domain and the gas limit, and returns the amount of gas that is needed to relay the message.
This gas payment covers the cost of relaying the message as well as the gas cost of the message delivery on the destination chain. It also works for relaying messsages to chains with a different gas token than the token on your local chain. The mayment should be included in the value that is sent to the dispatch
function.
IMetalayerRecipient
interface. The MetalayerRouter
on the destination chain will call the handle
function on the recipient contract in order to deliver the message.