978 lines
33 KiB
Go
978 lines
33 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.10
|
|
// protoc v6.33.1
|
|
// source: api/proto/message_router.proto
|
|
|
|
package router
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
// RouteMessageRequest routes an MPC message
|
|
type RouteMessageRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
FromParty string `protobuf:"bytes,2,opt,name=from_party,json=fromParty,proto3" json:"from_party,omitempty"`
|
|
ToParties []string `protobuf:"bytes,3,rep,name=to_parties,json=toParties,proto3" json:"to_parties,omitempty"` // Empty for broadcast
|
|
RoundNumber int32 `protobuf:"varint,4,opt,name=round_number,json=roundNumber,proto3" json:"round_number,omitempty"`
|
|
MessageType string `protobuf:"bytes,5,opt,name=message_type,json=messageType,proto3" json:"message_type,omitempty"`
|
|
Payload []byte `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"` // Encrypted MPC message
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *RouteMessageRequest) Reset() {
|
|
*x = RouteMessageRequest{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *RouteMessageRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*RouteMessageRequest) ProtoMessage() {}
|
|
|
|
func (x *RouteMessageRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use RouteMessageRequest.ProtoReflect.Descriptor instead.
|
|
func (*RouteMessageRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *RouteMessageRequest) GetSessionId() string {
|
|
if x != nil {
|
|
return x.SessionId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *RouteMessageRequest) GetFromParty() string {
|
|
if x != nil {
|
|
return x.FromParty
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *RouteMessageRequest) GetToParties() []string {
|
|
if x != nil {
|
|
return x.ToParties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *RouteMessageRequest) GetRoundNumber() int32 {
|
|
if x != nil {
|
|
return x.RoundNumber
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *RouteMessageRequest) GetMessageType() string {
|
|
if x != nil {
|
|
return x.MessageType
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *RouteMessageRequest) GetPayload() []byte {
|
|
if x != nil {
|
|
return x.Payload
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// RouteMessageResponse confirms message routing
|
|
type RouteMessageResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
|
MessageId string `protobuf:"bytes,2,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *RouteMessageResponse) Reset() {
|
|
*x = RouteMessageResponse{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *RouteMessageResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*RouteMessageResponse) ProtoMessage() {}
|
|
|
|
func (x *RouteMessageResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use RouteMessageResponse.ProtoReflect.Descriptor instead.
|
|
func (*RouteMessageResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
func (x *RouteMessageResponse) GetSuccess() bool {
|
|
if x != nil {
|
|
return x.Success
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *RouteMessageResponse) GetMessageId() string {
|
|
if x != nil {
|
|
return x.MessageId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// SubscribeMessagesRequest subscribes to messages for a party
|
|
type SubscribeMessagesRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
PartyId string `protobuf:"bytes,2,opt,name=party_id,json=partyId,proto3" json:"party_id,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SubscribeMessagesRequest) Reset() {
|
|
*x = SubscribeMessagesRequest{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[2]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SubscribeMessagesRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SubscribeMessagesRequest) ProtoMessage() {}
|
|
|
|
func (x *SubscribeMessagesRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[2]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SubscribeMessagesRequest.ProtoReflect.Descriptor instead.
|
|
func (*SubscribeMessagesRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{2}
|
|
}
|
|
|
|
func (x *SubscribeMessagesRequest) GetSessionId() string {
|
|
if x != nil {
|
|
return x.SessionId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SubscribeMessagesRequest) GetPartyId() string {
|
|
if x != nil {
|
|
return x.PartyId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// MPCMessage represents an MPC protocol message
|
|
type MPCMessage struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
|
|
SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
FromParty string `protobuf:"bytes,3,opt,name=from_party,json=fromParty,proto3" json:"from_party,omitempty"`
|
|
IsBroadcast bool `protobuf:"varint,4,opt,name=is_broadcast,json=isBroadcast,proto3" json:"is_broadcast,omitempty"`
|
|
RoundNumber int32 `protobuf:"varint,5,opt,name=round_number,json=roundNumber,proto3" json:"round_number,omitempty"`
|
|
MessageType string `protobuf:"bytes,6,opt,name=message_type,json=messageType,proto3" json:"message_type,omitempty"`
|
|
Payload []byte `protobuf:"bytes,7,opt,name=payload,proto3" json:"payload,omitempty"`
|
|
CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Unix timestamp milliseconds
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *MPCMessage) Reset() {
|
|
*x = MPCMessage{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[3]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *MPCMessage) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*MPCMessage) ProtoMessage() {}
|
|
|
|
func (x *MPCMessage) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[3]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use MPCMessage.ProtoReflect.Descriptor instead.
|
|
func (*MPCMessage) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{3}
|
|
}
|
|
|
|
func (x *MPCMessage) GetMessageId() string {
|
|
if x != nil {
|
|
return x.MessageId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *MPCMessage) GetSessionId() string {
|
|
if x != nil {
|
|
return x.SessionId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *MPCMessage) GetFromParty() string {
|
|
if x != nil {
|
|
return x.FromParty
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *MPCMessage) GetIsBroadcast() bool {
|
|
if x != nil {
|
|
return x.IsBroadcast
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *MPCMessage) GetRoundNumber() int32 {
|
|
if x != nil {
|
|
return x.RoundNumber
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *MPCMessage) GetMessageType() string {
|
|
if x != nil {
|
|
return x.MessageType
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *MPCMessage) GetPayload() []byte {
|
|
if x != nil {
|
|
return x.Payload
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *MPCMessage) GetCreatedAt() int64 {
|
|
if x != nil {
|
|
return x.CreatedAt
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// GetPendingMessagesRequest retrieves pending messages
|
|
type GetPendingMessagesRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
PartyId string `protobuf:"bytes,2,opt,name=party_id,json=partyId,proto3" json:"party_id,omitempty"`
|
|
AfterTimestamp int64 `protobuf:"varint,3,opt,name=after_timestamp,json=afterTimestamp,proto3" json:"after_timestamp,omitempty"` // Get messages after this timestamp
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *GetPendingMessagesRequest) Reset() {
|
|
*x = GetPendingMessagesRequest{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[4]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *GetPendingMessagesRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*GetPendingMessagesRequest) ProtoMessage() {}
|
|
|
|
func (x *GetPendingMessagesRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[4]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use GetPendingMessagesRequest.ProtoReflect.Descriptor instead.
|
|
func (*GetPendingMessagesRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{4}
|
|
}
|
|
|
|
func (x *GetPendingMessagesRequest) GetSessionId() string {
|
|
if x != nil {
|
|
return x.SessionId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *GetPendingMessagesRequest) GetPartyId() string {
|
|
if x != nil {
|
|
return x.PartyId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *GetPendingMessagesRequest) GetAfterTimestamp() int64 {
|
|
if x != nil {
|
|
return x.AfterTimestamp
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// GetPendingMessagesResponse contains pending messages
|
|
type GetPendingMessagesResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Messages []*MPCMessage `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *GetPendingMessagesResponse) Reset() {
|
|
*x = GetPendingMessagesResponse{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[5]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *GetPendingMessagesResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*GetPendingMessagesResponse) ProtoMessage() {}
|
|
|
|
func (x *GetPendingMessagesResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[5]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use GetPendingMessagesResponse.ProtoReflect.Descriptor instead.
|
|
func (*GetPendingMessagesResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{5}
|
|
}
|
|
|
|
func (x *GetPendingMessagesResponse) GetMessages() []*MPCMessage {
|
|
if x != nil {
|
|
return x.Messages
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// RegisterPartyRequest registers a party with the router
|
|
type RegisterPartyRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
PartyId string `protobuf:"bytes,1,opt,name=party_id,json=partyId,proto3" json:"party_id,omitempty"` // Unique party identifier
|
|
PartyRole string `protobuf:"bytes,2,opt,name=party_role,json=partyRole,proto3" json:"party_role,omitempty"` // persistent, delegate, or temporary
|
|
Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` // Party software version
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *RegisterPartyRequest) Reset() {
|
|
*x = RegisterPartyRequest{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[6]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *RegisterPartyRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*RegisterPartyRequest) ProtoMessage() {}
|
|
|
|
func (x *RegisterPartyRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[6]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use RegisterPartyRequest.ProtoReflect.Descriptor instead.
|
|
func (*RegisterPartyRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{6}
|
|
}
|
|
|
|
func (x *RegisterPartyRequest) GetPartyId() string {
|
|
if x != nil {
|
|
return x.PartyId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *RegisterPartyRequest) GetPartyRole() string {
|
|
if x != nil {
|
|
return x.PartyRole
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *RegisterPartyRequest) GetVersion() string {
|
|
if x != nil {
|
|
return x.Version
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// RegisterPartyResponse confirms party registration
|
|
type RegisterPartyResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
|
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
|
RegisteredAt int64 `protobuf:"varint,3,opt,name=registered_at,json=registeredAt,proto3" json:"registered_at,omitempty"` // Unix timestamp milliseconds
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *RegisterPartyResponse) Reset() {
|
|
*x = RegisterPartyResponse{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[7]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *RegisterPartyResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*RegisterPartyResponse) ProtoMessage() {}
|
|
|
|
func (x *RegisterPartyResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[7]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use RegisterPartyResponse.ProtoReflect.Descriptor instead.
|
|
func (*RegisterPartyResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{7}
|
|
}
|
|
|
|
func (x *RegisterPartyResponse) GetSuccess() bool {
|
|
if x != nil {
|
|
return x.Success
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *RegisterPartyResponse) GetMessage() string {
|
|
if x != nil {
|
|
return x.Message
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *RegisterPartyResponse) GetRegisteredAt() int64 {
|
|
if x != nil {
|
|
return x.RegisteredAt
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// SubscribeSessionEventsRequest subscribes to session events
|
|
type SubscribeSessionEventsRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
PartyId string `protobuf:"bytes,1,opt,name=party_id,json=partyId,proto3" json:"party_id,omitempty"` // Party ID subscribing to events
|
|
EventTypes []string `protobuf:"bytes,2,rep,name=event_types,json=eventTypes,proto3" json:"event_types,omitempty"` // Event types to subscribe (empty = all)
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SubscribeSessionEventsRequest) Reset() {
|
|
*x = SubscribeSessionEventsRequest{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[8]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SubscribeSessionEventsRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SubscribeSessionEventsRequest) ProtoMessage() {}
|
|
|
|
func (x *SubscribeSessionEventsRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[8]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SubscribeSessionEventsRequest.ProtoReflect.Descriptor instead.
|
|
func (*SubscribeSessionEventsRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{8}
|
|
}
|
|
|
|
func (x *SubscribeSessionEventsRequest) GetPartyId() string {
|
|
if x != nil {
|
|
return x.PartyId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SubscribeSessionEventsRequest) GetEventTypes() []string {
|
|
if x != nil {
|
|
return x.EventTypes
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// SessionEvent represents a session lifecycle event
|
|
type SessionEvent struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
EventId string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
|
|
EventType string `protobuf:"bytes,2,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` // session_created, session_started, etc.
|
|
SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
|
|
ThresholdN int32 `protobuf:"varint,4,opt,name=threshold_n,json=thresholdN,proto3" json:"threshold_n,omitempty"`
|
|
ThresholdT int32 `protobuf:"varint,5,opt,name=threshold_t,json=thresholdT,proto3" json:"threshold_t,omitempty"`
|
|
SelectedParties []string `protobuf:"bytes,6,rep,name=selected_parties,json=selectedParties,proto3" json:"selected_parties,omitempty"` // PartyIDs selected for this session
|
|
JoinTokens map[string]string `protobuf:"bytes,7,rep,name=join_tokens,json=joinTokens,proto3" json:"join_tokens,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // PartyID -> JoinToken mapping
|
|
MessageHash []byte `protobuf:"bytes,8,opt,name=message_hash,json=messageHash,proto3" json:"message_hash,omitempty"` // For sign sessions
|
|
CreatedAt int64 `protobuf:"varint,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Unix timestamp milliseconds
|
|
ExpiresAt int64 `protobuf:"varint,10,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` // Unix timestamp milliseconds
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SessionEvent) Reset() {
|
|
*x = SessionEvent{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[9]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SessionEvent) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SessionEvent) ProtoMessage() {}
|
|
|
|
func (x *SessionEvent) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[9]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SessionEvent.ProtoReflect.Descriptor instead.
|
|
func (*SessionEvent) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{9}
|
|
}
|
|
|
|
func (x *SessionEvent) GetEventId() string {
|
|
if x != nil {
|
|
return x.EventId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SessionEvent) GetEventType() string {
|
|
if x != nil {
|
|
return x.EventType
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SessionEvent) GetSessionId() string {
|
|
if x != nil {
|
|
return x.SessionId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SessionEvent) GetThresholdN() int32 {
|
|
if x != nil {
|
|
return x.ThresholdN
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *SessionEvent) GetThresholdT() int32 {
|
|
if x != nil {
|
|
return x.ThresholdT
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *SessionEvent) GetSelectedParties() []string {
|
|
if x != nil {
|
|
return x.SelectedParties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *SessionEvent) GetJoinTokens() map[string]string {
|
|
if x != nil {
|
|
return x.JoinTokens
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *SessionEvent) GetMessageHash() []byte {
|
|
if x != nil {
|
|
return x.MessageHash
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (x *SessionEvent) GetCreatedAt() int64 {
|
|
if x != nil {
|
|
return x.CreatedAt
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (x *SessionEvent) GetExpiresAt() int64 {
|
|
if x != nil {
|
|
return x.ExpiresAt
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// PublishSessionEventRequest publishes a session event
|
|
type PublishSessionEventRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Event *SessionEvent `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *PublishSessionEventRequest) Reset() {
|
|
*x = PublishSessionEventRequest{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[10]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *PublishSessionEventRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*PublishSessionEventRequest) ProtoMessage() {}
|
|
|
|
func (x *PublishSessionEventRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[10]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use PublishSessionEventRequest.ProtoReflect.Descriptor instead.
|
|
func (*PublishSessionEventRequest) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{10}
|
|
}
|
|
|
|
func (x *PublishSessionEventRequest) GetEvent() *SessionEvent {
|
|
if x != nil {
|
|
return x.Event
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// PublishSessionEventResponse confirms event publication
|
|
type PublishSessionEventResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
|
SubscriberCount int32 `protobuf:"varint,2,opt,name=subscriber_count,json=subscriberCount,proto3" json:"subscriber_count,omitempty"` // Number of parties that received the event
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *PublishSessionEventResponse) Reset() {
|
|
*x = PublishSessionEventResponse{}
|
|
mi := &file_api_proto_message_router_proto_msgTypes[11]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *PublishSessionEventResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*PublishSessionEventResponse) ProtoMessage() {}
|
|
|
|
func (x *PublishSessionEventResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_api_proto_message_router_proto_msgTypes[11]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use PublishSessionEventResponse.ProtoReflect.Descriptor instead.
|
|
func (*PublishSessionEventResponse) Descriptor() ([]byte, []int) {
|
|
return file_api_proto_message_router_proto_rawDescGZIP(), []int{11}
|
|
}
|
|
|
|
func (x *PublishSessionEventResponse) GetSuccess() bool {
|
|
if x != nil {
|
|
return x.Success
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (x *PublishSessionEventResponse) GetSubscriberCount() int32 {
|
|
if x != nil {
|
|
return x.SubscriberCount
|
|
}
|
|
return 0
|
|
}
|
|
|
|
var File_api_proto_message_router_proto protoreflect.FileDescriptor
|
|
|
|
const file_api_proto_message_router_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\x1eapi/proto/message_router.proto\x12\rmpc.router.v1\"\xd2\x01\n" +
|
|
"\x13RouteMessageRequest\x12\x1d\n" +
|
|
"\n" +
|
|
"session_id\x18\x01 \x01(\tR\tsessionId\x12\x1d\n" +
|
|
"\n" +
|
|
"from_party\x18\x02 \x01(\tR\tfromParty\x12\x1d\n" +
|
|
"\n" +
|
|
"to_parties\x18\x03 \x03(\tR\ttoParties\x12!\n" +
|
|
"\fround_number\x18\x04 \x01(\x05R\vroundNumber\x12!\n" +
|
|
"\fmessage_type\x18\x05 \x01(\tR\vmessageType\x12\x18\n" +
|
|
"\apayload\x18\x06 \x01(\fR\apayload\"O\n" +
|
|
"\x14RouteMessageResponse\x12\x18\n" +
|
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x1d\n" +
|
|
"\n" +
|
|
"message_id\x18\x02 \x01(\tR\tmessageId\"T\n" +
|
|
"\x18SubscribeMessagesRequest\x12\x1d\n" +
|
|
"\n" +
|
|
"session_id\x18\x01 \x01(\tR\tsessionId\x12\x19\n" +
|
|
"\bparty_id\x18\x02 \x01(\tR\apartyId\"\x8b\x02\n" +
|
|
"\n" +
|
|
"MPCMessage\x12\x1d\n" +
|
|
"\n" +
|
|
"message_id\x18\x01 \x01(\tR\tmessageId\x12\x1d\n" +
|
|
"\n" +
|
|
"session_id\x18\x02 \x01(\tR\tsessionId\x12\x1d\n" +
|
|
"\n" +
|
|
"from_party\x18\x03 \x01(\tR\tfromParty\x12!\n" +
|
|
"\fis_broadcast\x18\x04 \x01(\bR\visBroadcast\x12!\n" +
|
|
"\fround_number\x18\x05 \x01(\x05R\vroundNumber\x12!\n" +
|
|
"\fmessage_type\x18\x06 \x01(\tR\vmessageType\x12\x18\n" +
|
|
"\apayload\x18\a \x01(\fR\apayload\x12\x1d\n" +
|
|
"\n" +
|
|
"created_at\x18\b \x01(\x03R\tcreatedAt\"~\n" +
|
|
"\x19GetPendingMessagesRequest\x12\x1d\n" +
|
|
"\n" +
|
|
"session_id\x18\x01 \x01(\tR\tsessionId\x12\x19\n" +
|
|
"\bparty_id\x18\x02 \x01(\tR\apartyId\x12'\n" +
|
|
"\x0fafter_timestamp\x18\x03 \x01(\x03R\x0eafterTimestamp\"S\n" +
|
|
"\x1aGetPendingMessagesResponse\x125\n" +
|
|
"\bmessages\x18\x01 \x03(\v2\x19.mpc.router.v1.MPCMessageR\bmessages\"j\n" +
|
|
"\x14RegisterPartyRequest\x12\x19\n" +
|
|
"\bparty_id\x18\x01 \x01(\tR\apartyId\x12\x1d\n" +
|
|
"\n" +
|
|
"party_role\x18\x02 \x01(\tR\tpartyRole\x12\x18\n" +
|
|
"\aversion\x18\x03 \x01(\tR\aversion\"p\n" +
|
|
"\x15RegisterPartyResponse\x12\x18\n" +
|
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
|
|
"\amessage\x18\x02 \x01(\tR\amessage\x12#\n" +
|
|
"\rregistered_at\x18\x03 \x01(\x03R\fregisteredAt\"[\n" +
|
|
"\x1dSubscribeSessionEventsRequest\x12\x19\n" +
|
|
"\bparty_id\x18\x01 \x01(\tR\apartyId\x12\x1f\n" +
|
|
"\vevent_types\x18\x02 \x03(\tR\n" +
|
|
"eventTypes\"\xc2\x03\n" +
|
|
"\fSessionEvent\x12\x19\n" +
|
|
"\bevent_id\x18\x01 \x01(\tR\aeventId\x12\x1d\n" +
|
|
"\n" +
|
|
"event_type\x18\x02 \x01(\tR\teventType\x12\x1d\n" +
|
|
"\n" +
|
|
"session_id\x18\x03 \x01(\tR\tsessionId\x12\x1f\n" +
|
|
"\vthreshold_n\x18\x04 \x01(\x05R\n" +
|
|
"thresholdN\x12\x1f\n" +
|
|
"\vthreshold_t\x18\x05 \x01(\x05R\n" +
|
|
"thresholdT\x12)\n" +
|
|
"\x10selected_parties\x18\x06 \x03(\tR\x0fselectedParties\x12L\n" +
|
|
"\vjoin_tokens\x18\a \x03(\v2+.mpc.router.v1.SessionEvent.JoinTokensEntryR\n" +
|
|
"joinTokens\x12!\n" +
|
|
"\fmessage_hash\x18\b \x01(\fR\vmessageHash\x12\x1d\n" +
|
|
"\n" +
|
|
"created_at\x18\t \x01(\x03R\tcreatedAt\x12\x1d\n" +
|
|
"\n" +
|
|
"expires_at\x18\n" +
|
|
" \x01(\x03R\texpiresAt\x1a=\n" +
|
|
"\x0fJoinTokensEntry\x12\x10\n" +
|
|
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
|
|
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"O\n" +
|
|
"\x1aPublishSessionEventRequest\x121\n" +
|
|
"\x05event\x18\x01 \x01(\v2\x1b.mpc.router.v1.SessionEventR\x05event\"b\n" +
|
|
"\x1bPublishSessionEventResponse\x12\x18\n" +
|
|
"\asuccess\x18\x01 \x01(\bR\asuccess\x12)\n" +
|
|
"\x10subscriber_count\x18\x02 \x01(\x05R\x0fsubscriberCount2\xdf\x04\n" +
|
|
"\rMessageRouter\x12W\n" +
|
|
"\fRouteMessage\x12\".mpc.router.v1.RouteMessageRequest\x1a#.mpc.router.v1.RouteMessageResponse\x12Y\n" +
|
|
"\x11SubscribeMessages\x12'.mpc.router.v1.SubscribeMessagesRequest\x1a\x19.mpc.router.v1.MPCMessage0\x01\x12i\n" +
|
|
"\x12GetPendingMessages\x12(.mpc.router.v1.GetPendingMessagesRequest\x1a).mpc.router.v1.GetPendingMessagesResponse\x12Z\n" +
|
|
"\rRegisterParty\x12#.mpc.router.v1.RegisterPartyRequest\x1a$.mpc.router.v1.RegisterPartyResponse\x12e\n" +
|
|
"\x16SubscribeSessionEvents\x12,.mpc.router.v1.SubscribeSessionEventsRequest\x1a\x1b.mpc.router.v1.SessionEvent0\x01\x12l\n" +
|
|
"\x13PublishSessionEvent\x12).mpc.router.v1.PublishSessionEventRequest\x1a*.mpc.router.v1.PublishSessionEventResponseB;Z9github.com/rwadurian/mpc-system/api/grpc/router/v1;routerb\x06proto3"
|
|
|
|
var (
|
|
file_api_proto_message_router_proto_rawDescOnce sync.Once
|
|
file_api_proto_message_router_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_api_proto_message_router_proto_rawDescGZIP() []byte {
|
|
file_api_proto_message_router_proto_rawDescOnce.Do(func() {
|
|
file_api_proto_message_router_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_message_router_proto_rawDesc), len(file_api_proto_message_router_proto_rawDesc)))
|
|
})
|
|
return file_api_proto_message_router_proto_rawDescData
|
|
}
|
|
|
|
var file_api_proto_message_router_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
|
var file_api_proto_message_router_proto_goTypes = []any{
|
|
(*RouteMessageRequest)(nil), // 0: mpc.router.v1.RouteMessageRequest
|
|
(*RouteMessageResponse)(nil), // 1: mpc.router.v1.RouteMessageResponse
|
|
(*SubscribeMessagesRequest)(nil), // 2: mpc.router.v1.SubscribeMessagesRequest
|
|
(*MPCMessage)(nil), // 3: mpc.router.v1.MPCMessage
|
|
(*GetPendingMessagesRequest)(nil), // 4: mpc.router.v1.GetPendingMessagesRequest
|
|
(*GetPendingMessagesResponse)(nil), // 5: mpc.router.v1.GetPendingMessagesResponse
|
|
(*RegisterPartyRequest)(nil), // 6: mpc.router.v1.RegisterPartyRequest
|
|
(*RegisterPartyResponse)(nil), // 7: mpc.router.v1.RegisterPartyResponse
|
|
(*SubscribeSessionEventsRequest)(nil), // 8: mpc.router.v1.SubscribeSessionEventsRequest
|
|
(*SessionEvent)(nil), // 9: mpc.router.v1.SessionEvent
|
|
(*PublishSessionEventRequest)(nil), // 10: mpc.router.v1.PublishSessionEventRequest
|
|
(*PublishSessionEventResponse)(nil), // 11: mpc.router.v1.PublishSessionEventResponse
|
|
nil, // 12: mpc.router.v1.SessionEvent.JoinTokensEntry
|
|
}
|
|
var file_api_proto_message_router_proto_depIdxs = []int32{
|
|
3, // 0: mpc.router.v1.GetPendingMessagesResponse.messages:type_name -> mpc.router.v1.MPCMessage
|
|
12, // 1: mpc.router.v1.SessionEvent.join_tokens:type_name -> mpc.router.v1.SessionEvent.JoinTokensEntry
|
|
9, // 2: mpc.router.v1.PublishSessionEventRequest.event:type_name -> mpc.router.v1.SessionEvent
|
|
0, // 3: mpc.router.v1.MessageRouter.RouteMessage:input_type -> mpc.router.v1.RouteMessageRequest
|
|
2, // 4: mpc.router.v1.MessageRouter.SubscribeMessages:input_type -> mpc.router.v1.SubscribeMessagesRequest
|
|
4, // 5: mpc.router.v1.MessageRouter.GetPendingMessages:input_type -> mpc.router.v1.GetPendingMessagesRequest
|
|
6, // 6: mpc.router.v1.MessageRouter.RegisterParty:input_type -> mpc.router.v1.RegisterPartyRequest
|
|
8, // 7: mpc.router.v1.MessageRouter.SubscribeSessionEvents:input_type -> mpc.router.v1.SubscribeSessionEventsRequest
|
|
10, // 8: mpc.router.v1.MessageRouter.PublishSessionEvent:input_type -> mpc.router.v1.PublishSessionEventRequest
|
|
1, // 9: mpc.router.v1.MessageRouter.RouteMessage:output_type -> mpc.router.v1.RouteMessageResponse
|
|
3, // 10: mpc.router.v1.MessageRouter.SubscribeMessages:output_type -> mpc.router.v1.MPCMessage
|
|
5, // 11: mpc.router.v1.MessageRouter.GetPendingMessages:output_type -> mpc.router.v1.GetPendingMessagesResponse
|
|
7, // 12: mpc.router.v1.MessageRouter.RegisterParty:output_type -> mpc.router.v1.RegisterPartyResponse
|
|
9, // 13: mpc.router.v1.MessageRouter.SubscribeSessionEvents:output_type -> mpc.router.v1.SessionEvent
|
|
11, // 14: mpc.router.v1.MessageRouter.PublishSessionEvent:output_type -> mpc.router.v1.PublishSessionEventResponse
|
|
9, // [9:15] is the sub-list for method output_type
|
|
3, // [3:9] is the sub-list for method input_type
|
|
3, // [3:3] is the sub-list for extension type_name
|
|
3, // [3:3] is the sub-list for extension extendee
|
|
0, // [0:3] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_api_proto_message_router_proto_init() }
|
|
func file_api_proto_message_router_proto_init() {
|
|
if File_api_proto_message_router_proto != nil {
|
|
return
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_message_router_proto_rawDesc), len(file_api_proto_message_router_proto_rawDesc)),
|
|
NumEnums: 0,
|
|
NumMessages: 13,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_api_proto_message_router_proto_goTypes,
|
|
DependencyIndexes: file_api_proto_message_router_proto_depIdxs,
|
|
MessageInfos: file_api_proto_message_router_proto_msgTypes,
|
|
}.Build()
|
|
File_api_proto_message_router_proto = out.File
|
|
file_api_proto_message_router_proto_goTypes = nil
|
|
file_api_proto_message_router_proto_depIdxs = nil
|
|
}
|