axelar_gateway::message_ticketMessageTicketsource_iddestination_chaindestination_addresspayloadversionnewdestroyuse std::ascii;
use std::option;
use std::vector;
MessageTicketThis hot potato object is created to capture all the information about a remote contract call. In can then be submitted to the gateway to send the Message. It is advised that modules return this Message ticket to be submitted by the frontend, so that when the gateway package is upgraded, the app doesn’t need to upgrade as well, ensuring forward compatibility. The version is captured to ensure that future packages can restrict which messages they can send, and to ensure that no future messages are sent from earlier versions.
public struct MessageTicket
source_id: address
destination_chain: std::ascii::String
destination_address: std::ascii::String
payload: vector<u8>
version: u64
source_idpublic fun source_id(self: &axelar_gateway::message_ticket::MessageTicket): address
public fun source_id(self: &MessageTicket): address {
self.source_id
}
destination_chainpublic fun destination_chain(self: &axelar_gateway::message_ticket::MessageTicket): std::ascii::String
public fun destination_chain(self: &MessageTicket): String {
self.destination_chain
}
destination_addresspublic fun destination_address(self: &axelar_gateway::message_ticket::MessageTicket): std::ascii::String
public fun destination_address(self: &MessageTicket): String {
self.destination_address
}
payloadpublic fun payload(self: &axelar_gateway::message_ticket::MessageTicket): vector<u8>
public fun payload(self: &MessageTicket): vector<u8> {
self.payload
}
versionpublic fun version(self: &axelar_gateway::message_ticket::MessageTicket): u64
public fun version(self: &MessageTicket): u64 {
self.version
}
newpublic(package) fun new(source_id: address, destination_chain: std::ascii::String, destination_address: std::ascii::String, payload: vector<u8>, version: u64): axelar_gateway::message_ticket::MessageTicket
public(package) fun new(
source_id: address,
destination_chain: String,
destination_address: String,
payload: vector<u8>,
version: u64,
): MessageTicket {
MessageTicket {
source_id,
destination_chain,
destination_address,
payload,
version,
}
}
destroypublic(package) fun destroy(self: axelar_gateway::message_ticket::MessageTicket): (address, std::ascii::String, std::ascii::String, vector<u8>, u64)
public(package) fun destroy(self: MessageTicket): (address, String, String, vector<u8>, u64) {
let MessageTicket {
source_id,
destination_chain,
destination_address,
payload,
version,
} = self;
(source_id, destination_chain, destination_address, payload, version)
}