Function std::message::send_message
pub fn send_message(recipient: b256, msg_data: Bytes, coins: u64)
Expand description
Sends a message msg_data
to recipient
with a coins
amount of the base asset.
Additional Information
Use send_typed_message
instead of send_message
if the message needs to be indexed.
Arguments
recipient
: [b256] - The address of the message recipient.msg_data
: [Bytes] - Arbitrary length message data.coins
: [u64] - Amount of base asset to send.
Examples
use std::{message::send_message, bytes::Bytes};
fn foo() {
let recipient = 0xee45573606c96c98ba970ff7cf9511f1b8b25e6bcd52ced30b89df1e4a9c4323;
let mut bytes = Bytes::new();
bytes.push(5u8);
send_message(recipient, bytes, 50);
}