Skip to main content

mokiService_sendMessage

Info
This function requires the Authorization Header, you can read more about this header here.

Send a message to another identity on the Moki Network

Parameters

  • message data: hex - The signed message data (`sender_identity`+`recipient_identity`+`encryptedMessage`+`nonce`+`timestamp`).

Returns

  • message: object - Message object
    • id: string - Message unique ID
    • message: string - Encrypted message as hex
    • from: address - Address of sender
    • to: address - Address of recipient
    • signature: string - Message signature from sender
    • sender_receipt: hex - Receipt from sender service node
    • receiver_receipt: hex - Receipt from receiver service node
    • timestamp: number - Timestamp of message

Example

Request

curl https://mainnet.moki.network \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "mokiService_sendMessage", "params": [], "id": 1}'

Reponse

Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"id": "17539442452862540956057",
"message": "2863b7fa05d337...",
"from": "0x7085aa6e71f325ed88d04daba003020bfd9214ea",
"to": "0x22a4dc6353e087a5c37c7168bcf149e9342eb922",
"signature": "0xb7edb74193d54...",
"sender_receipt": "0xe80e5e4ccd1...",
"receiver_receipt": "0x450e5e4ccd1...",
"timestamp": 1753944245286
}
}