JSON RPC sendMessage
#11
Closed
jac18281828
started this conversation in
Ideas and Features
Replies: 4 comments 2 replies
-
small nit: I believe in xmtp-mls, we are moving to |
Beta Was this translation helpful? Give feedback.
2 replies
-
Working example here: https://github.com/xmtp/xps-conversation-producer |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This discussion is about establishing a new method in the messaging workflow called
sendMessage
. This method will forward a signed payload to the xps-contractMessageSender
.related to: xmtp/xps-contract#14
Documentation for JSON RPC Endpoint:
sendMessage
Overview
The
sendMessage
method is used to send a message within a specified conversation. It is an external function that is part of a larger system managing communications between users or entities. This method requires two parameters: a unique identifier for the conversation (conversationId
) and the message content (payload
).JSON RPC Endpoint Specification
Method Name
sendMessage
Request Parameters
conversationId
: A unique identifier for the conversation. This is a 32-byte string, typically in hexadecimal format.payload
: The content of the message. This is a variable-length byte array that can hold any form of data, such as text, images, or other binary formats.sigV
: The signature VsigR
: The signature RsigS
: The signature SRequest Format
jsonrpc
: Specifies the version of the JSON RPC protocol being used. Always "2.0".method
: The name of the method being called. Here it is "sendMessage".params
: A structured value holding the parameters necessary for the method. It contains:conversationId
: The unique identifier for the conversation.payload
: The message content in bytes.V
: The signature VR
: The signature RS
: The signature Sid
: A unique identifier established by the client that must be number or string. Used for correlating the response with the request.Response Format
The response will typically include the result of the operation or an error if the operation was unsuccessful.
Success Response
result
: Contains data related to the success of the operation. The nature of this data can vary based on the implementation.Error Response
error
: An object containing details about the error.code
: A numeric error code.message
: A human-readable string describing the error.Example Usage
Request
Response
Notes
conversationId
is valid and exists in the system.payload
should be properly encoded (e.g., base64) if it contains binary data.Beta Was this translation helpful? Give feedback.
All reactions