Skip to main content

mokiService_getInbox

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

Fetch a list of messages in the users inbox

Parameters

  • inboxFilter: object [Required] - Filter object for inbox data
    • limit: number - Defaults to 20
    • after: messageId - Fetch messages after given MessageID
    • before: messageId - Fetch messages before given MessageID

Returns

  • payload: object [Required] - Payload as an object
    • address: address - Address of inbox owner
    • data: array - Array of messages from inbox
      • 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
    • end: boolean - True if results reaches the end of the search

Example

Request

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

Reponse

Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x22a4dc6353e087A5c37c7168bCF149e9342eB922",
"data": [
{
"message": "0e93eee849d168...",
"from": "0xd980f6b9ba3223711989639664ffb26c75ecc50b",
"to": "0x22a4dc6353e087a5c37c7168bcf149e9342eb922",
"signature": "0xb7edb74193d54...",
"sender_receipt": "0xe80e5e4ccd1...",
"receiver_receipt": "0x450e5e4ccd1...",
"timestamp": 1753944225115,
"id": "17539442251150027127416"
},
{
"message": "2863b7fa05d337...",
"from": "0x7085aa6e71f325ed88d04daba003020bfd9214ea",
"to": "0x22a4dc6353e087a5c37c7168bcf149e9342eb922",
"signature": "0xb7edb74193d54...",
"sender_receipt": "0xe80e5e4ccd1...",
"receiver_receipt": "0x450e5e4ccd1...",
"timestamp": 1753944245286,
"id": "17539442452862540956057"
}
],
"end": true
}
]
}