From 5d5d5758af9e327d23a69f81e415d578e09cd154 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Fri, 18 Oct 2024 10:54:03 -0700 Subject: [PATCH] Update to new proto format --- .github/workflows/nightly.yml | 6 +- dev/{gen_protos => gen-protos} | 2 +- dev/generate | 2 +- pkg/api/publish_test.go | 31 +- pkg/api/query_test.go | 11 +- pkg/api/service.go | 21 +- pkg/api/subscribeWorker.go | 15 +- pkg/envelopes/client.go | 25 +- pkg/envelopes/envelopes_test.go | 28 +- pkg/envelopes/originator.go | 8 +- pkg/envelopes/payer.go | 8 +- pkg/envelopes/unsignedOriginator.go | 16 +- pkg/indexer/storer/identityUpdate.go | 20 +- pkg/indexer/storer/identityUpdate_test.go | 4 +- pkg/mlsvalidate/service.go | 4 +- .../xmtpv4/envelopes/envelopes.swagger.json | 44 + .../message_api/message_api.swagger.json | 188 +-- .../xmtpv4/payer_api/payer_api.swagger.json | 507 +++++++ pkg/proto/xmtpv4/envelopes/envelopes.pb.go | 727 ++++++++++ .../xmtpv4/message_api/message_api.pb.go | 1178 ++++------------- .../xmtpv4/message_api/message_api.pb.gw.go | 42 +- .../xmtpv4/message_api/message_api_grpc.pb.go | 38 +- pkg/proto/xmtpv4/payer_api/payer_api.pb.go | 224 ++++ pkg/proto/xmtpv4/payer_api/payer_api.pb.gw.go | 163 +++ .../xmtpv4/payer_api/payer_api_grpc.pb.go | 113 ++ pkg/registrant/registrant.go | 12 +- pkg/registrant/registrant_test.go | 6 +- pkg/server/server_test.go | 49 +- pkg/sync/syncWorker.go | 7 +- pkg/testutils/envelopes/envelopes.go | 30 +- pkg/utils/envelope.go | 14 +- 31 files changed, 2342 insertions(+), 1201 deletions(-) rename dev/{gen_protos => gen-protos} (89%) create mode 100644 pkg/proto/openapi/xmtpv4/envelopes/envelopes.swagger.json create mode 100644 pkg/proto/openapi/xmtpv4/payer_api/payer_api.swagger.json create mode 100644 pkg/proto/xmtpv4/envelopes/envelopes.pb.go create mode 100644 pkg/proto/xmtpv4/payer_api/payer_api.pb.go create mode 100644 pkg/proto/xmtpv4/payer_api/payer_api.pb.gw.go create mode 100644 pkg/proto/xmtpv4/payer_api/payer_api_grpc.pb.go diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2197d4ca..8906e21e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,7 +1,7 @@ name: Nightly Automation on: schedule: - - cron: '0 10 * * *' + - cron: "0 10 * * *" workflow_dispatch: jobs: nightly-protos: @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-go@v5 - uses: bufbuild/buf-setup-action@v1.40.1 - name: Generate Protos - run: dev/gen_protos + run: dev/gen-protos - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: @@ -26,4 +26,4 @@ jobs: Auto-generated by [create-pull-request][1] [1]: https://github.com/peter-evans/create-pull-request - branch: nightly-proto \ No newline at end of file + branch: nightly-proto diff --git a/dev/gen_protos b/dev/gen-protos similarity index 89% rename from dev/gen_protos rename to dev/gen-protos index b8745e86..ecb06997 100755 --- a/dev/gen_protos +++ b/dev/gen-protos @@ -1,7 +1,7 @@ #!/usr/bin/env bash rm -rf pkg/proto/**/*.pb.go pkg/proto/**/*.pb.gw.go pkg/proto/**/*.swagger.json -if ! buf generate https://github.com/xmtp/proto.git#subdir=proto,branch=main; then +if ! buf generate https://github.com/xmtp/proto.git#subdir=proto,branch=nm/payer-api; then echo "Failed to generate protobuf definitions" exit 1 fi \ No newline at end of file diff --git a/dev/generate b/dev/generate index eb85f658..5f7b60eb 100755 --- a/dev/generate +++ b/dev/generate @@ -2,7 +2,7 @@ set -euo pipefail -./dev/gen_protos +./dev/gen-protos sqlc generate go generate ./... rm -rf pkg/mocks/* diff --git a/pkg/api/publish_test.go b/pkg/api/publish_test.go index d3cd3020..df085642 100644 --- a/pkg/api/publish_test.go +++ b/pkg/api/publish_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/xmtp/xmtpd/pkg/db/queries" + "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" apiTestUtils "github.com/xmtp/xmtpd/pkg/testutils/api" envelopeTestUtils "github.com/xmtp/xmtpd/pkg/testutils/envelopes" @@ -20,16 +21,16 @@ func TestPublishEnvelope(t *testing.T) { payerEnvelope := envelopeTestUtils.CreatePayerEnvelope(t) - resp, err := api.PublishEnvelopes( + resp, err := api.PublishPayerEnvelopes( context.Background(), - &message_api.PublishEnvelopesRequest{ - PayerEnvelopes: []*message_api.PayerEnvelope{payerEnvelope}, + &message_api.PublishPayerEnvelopesRequest{ + PayerEnvelopes: []*envelopes.PayerEnvelope{payerEnvelope}, }, ) require.NoError(t, err) require.NotNil(t, resp) - unsignedEnv := &message_api.UnsignedOriginatorEnvelope{} + unsignedEnv := &envelopes.UnsignedOriginatorEnvelope{} require.NoError( t, proto.Unmarshal( @@ -37,7 +38,7 @@ func TestPublishEnvelope(t *testing.T) { unsignedEnv, ), ) - clientEnv := &message_api.ClientEnvelope{} + clientEnv := &envelopes.ClientEnvelope{} require.NoError( t, proto.Unmarshal(unsignedEnv.GetPayerEnvelope().GetUnsignedClientEnvelope(), clientEnv), @@ -56,7 +57,7 @@ func TestPublishEnvelope(t *testing.T) { return false } - originatorEnv := &message_api.OriginatorEnvelope{} + originatorEnv := &envelopes.OriginatorEnvelope{} require.NoError(t, proto.Unmarshal(envs[0].OriginatorEnvelope, originatorEnv)) return proto.Equal(originatorEnv, resp.GetOriginatorEnvelopes()[0]) }, 500*time.Millisecond, 50*time.Millisecond) @@ -68,10 +69,10 @@ func TestUnmarshalErrorOnPublish(t *testing.T) { envelope := envelopeTestUtils.CreatePayerEnvelope(t) envelope.UnsignedClientEnvelope = []byte("invalidbytes") - _, err := api.PublishEnvelopes( + _, err := api.PublishPayerEnvelopes( context.Background(), - &message_api.PublishEnvelopesRequest{ - PayerEnvelopes: []*message_api.PayerEnvelope{envelope}, + &message_api.PublishPayerEnvelopesRequest{ + PayerEnvelopes: []*envelopes.PayerEnvelope{envelope}, }, ) require.ErrorContains(t, err, "invalid wire-format data") @@ -83,10 +84,10 @@ func TestMismatchingOriginatorOnPublish(t *testing.T) { clientEnv := envelopeTestUtils.CreateClientEnvelope() clientEnv.Aad.TargetOriginator = 2 - _, err := api.PublishEnvelopes( + _, err := api.PublishPayerEnvelopes( context.Background(), - &message_api.PublishEnvelopesRequest{ - PayerEnvelopes: []*message_api.PayerEnvelope{ + &message_api.PublishPayerEnvelopesRequest{ + PayerEnvelopes: []*envelopes.PayerEnvelope{ envelopeTestUtils.CreatePayerEnvelope(t, clientEnv), }, }, @@ -100,10 +101,10 @@ func TestMissingTopicOnPublish(t *testing.T) { clientEnv := envelopeTestUtils.CreateClientEnvelope() clientEnv.Aad.TargetTopic = nil - _, err := api.PublishEnvelopes( + _, err := api.PublishPayerEnvelopes( context.Background(), - &message_api.PublishEnvelopesRequest{ - PayerEnvelopes: []*message_api.PayerEnvelope{ + &message_api.PublishPayerEnvelopesRequest{ + PayerEnvelopes: []*envelopes.PayerEnvelope{ envelopeTestUtils.CreatePayerEnvelope(t, clientEnv), }, }, diff --git a/pkg/api/query_test.go b/pkg/api/query_test.go index d42b5557..54eb6957 100644 --- a/pkg/api/query_test.go +++ b/pkg/api/query_test.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/xmtp/xmtpd/pkg/db" "github.com/xmtp/xmtpd/pkg/db/queries" + "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" "github.com/xmtp/xmtpd/pkg/testutils" apiTestUtils "github.com/xmtp/xmtpd/pkg/testutils/api" @@ -145,7 +146,7 @@ func TestQueryEnvelopesFromLastSeen(t *testing.T) { context.Background(), &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ - LastSeen: &message_api.VectorClock{NodeIdToSequenceId: map[uint32]uint64{1: 2}}, + LastSeen: &envelopes.VectorClock{NodeIdToSequenceId: map[uint32]uint64{1: 2}}, }, Limit: 0, }, @@ -164,7 +165,7 @@ func TestQueryTopicFromLastSeen(t *testing.T) { &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ Topics: []db.Topic{db.Topic("topicA")}, - LastSeen: &message_api.VectorClock{ + LastSeen: &envelopes.VectorClock{ NodeIdToSequenceId: map[uint32]uint64{1: 2, 2: 1}, }, }, @@ -185,7 +186,7 @@ func TestQueryMultipleTopicsFromLastSeen(t *testing.T) { &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ Topics: []db.Topic{db.Topic("topicA"), db.Topic("topicB")}, - LastSeen: &message_api.VectorClock{ + LastSeen: &envelopes.VectorClock{ NodeIdToSequenceId: map[uint32]uint64{1: 2, 2: 1}, }, }, @@ -206,7 +207,7 @@ func TestQueryMultipleOriginatorsFromLastSeen(t *testing.T) { &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ OriginatorNodeIds: []uint32{1, 2}, - LastSeen: &message_api.VectorClock{ + LastSeen: &envelopes.VectorClock{ NodeIdToSequenceId: map[uint32]uint64{1: 1, 2: 1}, }, }, @@ -257,7 +258,7 @@ func checkRowsMatchProtos( t *testing.T, allRows []queries.InsertGatewayEnvelopeParams, matchingIndices []int, - protos []*message_api.OriginatorEnvelope, + protos []*envelopes.OriginatorEnvelope, ) { require.Len(t, protos, len(matchingIndices)) for i, p := range protos { diff --git a/pkg/api/service.go b/pkg/api/service.go index cdadac17..3acb523d 100644 --- a/pkg/api/service.go +++ b/pkg/api/service.go @@ -10,6 +10,7 @@ import ( "github.com/xmtp/xmtpd/pkg/db/queries" "github.com/xmtp/xmtpd/pkg/envelopes" "github.com/xmtp/xmtpd/pkg/proto/identity/associations" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" "github.com/xmtp/xmtpd/pkg/registrant" "github.com/xmtp/xmtpd/pkg/utils" @@ -131,9 +132,9 @@ func (s *Service) QueryEnvelopes( return nil, status.Errorf(codes.Internal, "could not select envelopes: %v", err) } - envs := make([]*message_api.OriginatorEnvelope, 0, len(rows)) + envs := make([]*envelopesProto.OriginatorEnvelope, 0, len(rows)) for _, row := range rows { - originatorEnv := &message_api.OriginatorEnvelope{} + originatorEnv := &envelopesProto.OriginatorEnvelope{} err := proto.Unmarshal(row.OriginatorEnvelope, originatorEnv) if err != nil { // We expect to have already validated the envelope when it was inserted @@ -213,10 +214,10 @@ func (s *Service) queryReqToDBParams( return ¶ms, nil } -func (s *Service) PublishEnvelopes( +func (s *Service) PublishPayerEnvelopes( ctx context.Context, - req *message_api.PublishEnvelopesRequest, -) (*message_api.PublishEnvelopesResponse, error) { + req *message_api.PublishPayerEnvelopesRequest, +) (*message_api.PublishPayerEnvelopesResponse, error) { if len(req.GetPayerEnvelopes()) == 0 { return nil, status.Errorf(codes.InvalidArgument, "missing payer envelope") } @@ -231,7 +232,7 @@ func (s *Service) PublishEnvelopes( return nil, err } if didPublish { - return &message_api.PublishEnvelopesResponse{}, nil + return &message_api.PublishPayerEnvelopesResponse{}, nil } // TODO(rich): Properly support batch publishing @@ -257,8 +258,8 @@ func (s *Service) PublishEnvelopes( return nil, status.Errorf(codes.Internal, "could not sign envelope: %v", err) } - return &message_api.PublishEnvelopesResponse{ - OriginatorEnvelopes: []*message_api.OriginatorEnvelope{originatorEnv}, + return &message_api.PublishPayerEnvelopesResponse{ + OriginatorEnvelopes: []*envelopesProto.OriginatorEnvelope{originatorEnv}, }, nil } @@ -266,7 +267,7 @@ func (s *Service) maybePublishToBlockchain( ctx context.Context, clientEnv *envelopes.ClientEnvelope, ) (didPublish bool, err error) { - payload, ok := clientEnv.Payload().(*message_api.ClientEnvelope_IdentityUpdate) + payload, ok := clientEnv.Payload().(*envelopesProto.ClientEnvelope_IdentityUpdate) if ok && payload.IdentityUpdate != nil { if err = s.publishIdentityUpdate(ctx, payload.IdentityUpdate); err != nil { s.log.Error("could not publish identity update", zap.Error(err)) @@ -340,7 +341,7 @@ func (s *Service) GetInboxIds( } func (s *Service) validatePayerEnvelope( - rawEnv *message_api.PayerEnvelope, + rawEnv *envelopesProto.PayerEnvelope, ) (*envelopes.PayerEnvelope, error) { payerEnv, err := envelopes.NewPayerEnvelope(rawEnv) if err != nil { diff --git a/pkg/api/subscribeWorker.go b/pkg/api/subscribeWorker.go index a3802fd5..9956a3bf 100644 --- a/pkg/api/subscribeWorker.go +++ b/pkg/api/subscribeWorker.go @@ -9,6 +9,7 @@ import ( "github.com/xmtp/xmtpd/pkg/db" "github.com/xmtp/xmtpd/pkg/db/queries" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" "go.uber.org/zap" "google.golang.org/protobuf/proto" @@ -22,7 +23,7 @@ const ( type listener struct { ctx context.Context - ch chan<- []*message_api.OriginatorEnvelope + ch chan<- []*envelopesProto.OriginatorEnvelope closed bool topics map[string]struct{} originators map[uint32]struct{} @@ -32,7 +33,7 @@ type listener struct { func newListener( ctx context.Context, query *message_api.EnvelopesQuery, - ch chan<- []*message_api.OriginatorEnvelope, + ch chan<- []*envelopesProto.OriginatorEnvelope, ) *listener { l := &listener{ ctx: ctx, @@ -206,7 +207,7 @@ func (s *subscribeWorker) start() { } func (s *subscribeWorker) dispatch(row *queries.GatewayEnvelope) { - env := &message_api.OriginatorEnvelope{} + env := &envelopesProto.OriginatorEnvelope{} err := proto.Unmarshal(row.OriginatorEnvelope, env) if err != nil { s.log.Error("Failed to unmarshal envelope", zap.Error(err)) @@ -222,7 +223,7 @@ func (s *subscribeWorker) dispatch(row *queries.GatewayEnvelope) { func (s *subscribeWorker) dispatchToListeners( listeners *listenerSet, - env *message_api.OriginatorEnvelope, + env *envelopesProto.OriginatorEnvelope, ) { if listeners == nil { return @@ -239,7 +240,7 @@ func (s *subscribeWorker) dispatchToListeners( s.closeListener(l) default: select { - case l.ch <- []*message_api.OriginatorEnvelope{env}: + case l.ch <- []*envelopesProto.OriginatorEnvelope{env}: default: s.log.Info("Channel full, removing listener", zap.Any("listener", l.ch)) s.closeListener(l) @@ -268,8 +269,8 @@ func (s *subscribeWorker) closeListener(l *listener) { func (s *subscribeWorker) listen( ctx context.Context, query *message_api.EnvelopesQuery, -) <-chan []*message_api.OriginatorEnvelope { - ch := make(chan []*message_api.OriginatorEnvelope, subscriptionBufferSize) +) <-chan []*envelopesProto.OriginatorEnvelope { + ch := make(chan []*envelopesProto.OriginatorEnvelope, subscriptionBufferSize) l := newListener(ctx, query, ch) if l.isGlobal { diff --git a/pkg/envelopes/client.go b/pkg/envelopes/client.go index 997619ec..80178598 100644 --- a/pkg/envelopes/client.go +++ b/pkg/envelopes/client.go @@ -3,17 +3,18 @@ package envelopes import ( "errors" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/topic" + "github.com/xmtp/xmtpd/pkg/utils" "google.golang.org/protobuf/proto" ) type ClientEnvelope struct { - proto *message_api.ClientEnvelope + proto *envelopesProto.ClientEnvelope targetTopic topic.Topic } -func NewClientEnvelope(proto *message_api.ClientEnvelope) (*ClientEnvelope, error) { +func NewClientEnvelope(proto *envelopesProto.ClientEnvelope) (*ClientEnvelope, error) { if proto == nil { return nil, errors.New("proto is nil") } @@ -35,11 +36,11 @@ func NewClientEnvelope(proto *message_api.ClientEnvelope) (*ClientEnvelope, erro } func NewClientEnvelopeFromBytes(bytes []byte) (*ClientEnvelope, error) { - var message message_api.ClientEnvelope - if err := proto.Unmarshal(bytes, &message); err != nil { + message, err := utils.UnmarshalClientEnvelope(bytes) + if err != nil { return nil, err } - return NewClientEnvelope(&message) + return NewClientEnvelope(message) } func (c *ClientEnvelope) Bytes() ([]byte, error) { @@ -58,11 +59,11 @@ func (c *ClientEnvelope) Payload() interface{} { return c.proto.Payload } -func (c *ClientEnvelope) Aad() *message_api.AuthenticatedData { +func (c *ClientEnvelope) Aad() *envelopesProto.AuthenticatedData { return c.proto.Aad } -func (c *ClientEnvelope) Proto() *message_api.ClientEnvelope { +func (c *ClientEnvelope) Proto() *envelopesProto.ClientEnvelope { return c.proto } @@ -72,13 +73,13 @@ func (c *ClientEnvelope) TopicMatchesPayload() bool { payload := c.proto.Payload switch payload.(type) { - case *message_api.ClientEnvelope_WelcomeMessage: + case *envelopesProto.ClientEnvelope_WelcomeMessage: return targetTopicKind == topic.TOPIC_KIND_WELCOME_MESSAGES_V1 - case *message_api.ClientEnvelope_GroupMessage: + case *envelopesProto.ClientEnvelope_GroupMessage: return targetTopicKind == topic.TOPIC_KIND_GROUP_MESSAGES_V1 - case *message_api.ClientEnvelope_IdentityUpdate: + case *envelopesProto.ClientEnvelope_IdentityUpdate: return targetTopicKind == topic.TOPIC_KIND_IDENTITY_UPDATES_V1 - case *message_api.ClientEnvelope_UploadKeyPackage: + case *envelopesProto.ClientEnvelope_UploadKeyPackage: return targetTopicKind == topic.TOPIC_KIND_KEY_PACKAGES_V1 default: return false diff --git a/pkg/envelopes/envelopes_test.go b/pkg/envelopes/envelopes_test.go index 51f059b5..19bf6409 100644 --- a/pkg/envelopes/envelopes_test.go +++ b/pkg/envelopes/envelopes_test.go @@ -6,7 +6,7 @@ import ( ethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/require" "github.com/xmtp/xmtpd/pkg/proto/identity/associations" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/testutils" envelopeTestUtils "github.com/xmtp/xmtpd/pkg/testutils/envelopes" "github.com/xmtp/xmtpd/pkg/topic" @@ -71,7 +71,7 @@ func TestInvalidOriginatorEnvelope(t *testing.T) { _, err := NewOriginatorEnvelope(nil) require.Error(t, err) - empty := &message_api.OriginatorEnvelope{} + empty := &envelopesProto.OriginatorEnvelope{} _, err = NewOriginatorEnvelope(empty) require.Error(t, err) } @@ -80,7 +80,7 @@ func TestInvalidUnsignedOriginatorEnvelope(t *testing.T) { _, err := NewUnsignedOriginatorEnvelope(nil) require.Error(t, err) - empty := &message_api.UnsignedOriginatorEnvelope{} + empty := &envelopesProto.UnsignedOriginatorEnvelope{} _, err = NewUnsignedOriginatorEnvelope(empty) require.Error(t, err) } @@ -89,7 +89,7 @@ func TestInvalidPayerEnvelope(t *testing.T) { _, err := NewPayerEnvelope(nil) require.Error(t, err) - empty := &message_api.PayerEnvelope{} + empty := &envelopesProto.PayerEnvelope{} _, err = NewPayerEnvelope(empty) require.Error(t, err) } @@ -98,38 +98,38 @@ func TestInvalidClientEnvelope(t *testing.T) { _, err := NewClientEnvelope(nil) require.Error(t, err) - empty := &message_api.ClientEnvelope{} + empty := &envelopesProto.ClientEnvelope{} _, err = NewClientEnvelope(empty) require.Error(t, err) } -func buildAad(topic *topic.Topic) *message_api.AuthenticatedData { - return &message_api.AuthenticatedData{ +func buildAad(topic *topic.Topic) *envelopesProto.AuthenticatedData { + return &envelopesProto.AuthenticatedData{ TargetOriginator: 1, TargetTopic: topic.Bytes(), - LastSeen: &message_api.VectorClock{}, + LastSeen: &envelopesProto.VectorClock{}, } } func TestPayloadType(t *testing.T) { // Group Message envelope with matching topic - clientEnvelope, err := NewClientEnvelope(&message_api.ClientEnvelope{ - Payload: &message_api.ClientEnvelope_GroupMessage{}, + clientEnvelope, err := NewClientEnvelope(&envelopesProto.ClientEnvelope{ + Payload: &envelopesProto.ClientEnvelope_GroupMessage{}, Aad: buildAad(topic.NewTopic(topic.TOPIC_KIND_GROUP_MESSAGES_V1, []byte{1, 2, 3})), }) require.NoError(t, err) require.True(t, clientEnvelope.TopicMatchesPayload()) - clientEnvelope, err = NewClientEnvelope(&message_api.ClientEnvelope{ - Payload: &message_api.ClientEnvelope_UploadKeyPackage{}, + clientEnvelope, err = NewClientEnvelope(&envelopesProto.ClientEnvelope{ + Payload: &envelopesProto.ClientEnvelope_UploadKeyPackage{}, Aad: buildAad(topic.NewTopic(topic.TOPIC_KIND_KEY_PACKAGES_V1, []byte{1, 2, 3})), }) require.NoError(t, err) require.True(t, clientEnvelope.TopicMatchesPayload()) // Mismatched topic and payload - clientEnvelope, err = NewClientEnvelope(&message_api.ClientEnvelope{ - Payload: &message_api.ClientEnvelope_GroupMessage{}, + clientEnvelope, err = NewClientEnvelope(&envelopesProto.ClientEnvelope{ + Payload: &envelopesProto.ClientEnvelope_GroupMessage{}, Aad: buildAad(topic.NewTopic(topic.TOPIC_KIND_KEY_PACKAGES_V1, []byte{1, 2, 3})), }) require.NoError(t, err) diff --git a/pkg/envelopes/originator.go b/pkg/envelopes/originator.go index 2995915c..62e2effe 100644 --- a/pkg/envelopes/originator.go +++ b/pkg/envelopes/originator.go @@ -3,16 +3,16 @@ package envelopes import ( "errors" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "google.golang.org/protobuf/proto" ) type OriginatorEnvelope struct { - proto *message_api.OriginatorEnvelope + proto *envelopesProto.OriginatorEnvelope UnsignedOriginatorEnvelope UnsignedOriginatorEnvelope } -func NewOriginatorEnvelope(proto *message_api.OriginatorEnvelope) (*OriginatorEnvelope, error) { +func NewOriginatorEnvelope(proto *envelopesProto.OriginatorEnvelope) (*OriginatorEnvelope, error) { if proto == nil { return nil, errors.New("proto is nil") } @@ -36,6 +36,6 @@ func (o *OriginatorEnvelope) Bytes() ([]byte, error) { return bytes, nil } -func (o *OriginatorEnvelope) Proto() *message_api.OriginatorEnvelope { +func (o *OriginatorEnvelope) Proto() *envelopesProto.OriginatorEnvelope { return o.proto } diff --git a/pkg/envelopes/payer.go b/pkg/envelopes/payer.go index 81b10bdd..c7ea76f3 100644 --- a/pkg/envelopes/payer.go +++ b/pkg/envelopes/payer.go @@ -5,17 +5,17 @@ import ( "github.com/ethereum/go-ethereum/common" ethcrypto "github.com/ethereum/go-ethereum/crypto" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/utils" "google.golang.org/protobuf/proto" ) type PayerEnvelope struct { - proto *message_api.PayerEnvelope + proto *envelopesProto.PayerEnvelope ClientEnvelope ClientEnvelope } -func NewPayerEnvelope(proto *message_api.PayerEnvelope) (*PayerEnvelope, error) { +func NewPayerEnvelope(proto *envelopesProto.PayerEnvelope) (*PayerEnvelope, error) { if proto == nil { return nil, errors.New("proto is nil") } @@ -27,7 +27,7 @@ func NewPayerEnvelope(proto *message_api.PayerEnvelope) (*PayerEnvelope, error) return &PayerEnvelope{proto: proto, ClientEnvelope: *clientEnv}, nil } -func (p *PayerEnvelope) Proto() *message_api.PayerEnvelope { +func (p *PayerEnvelope) Proto() *envelopesProto.PayerEnvelope { return p.proto } diff --git a/pkg/envelopes/unsignedOriginator.go b/pkg/envelopes/unsignedOriginator.go index 2200a33e..9d00a199 100644 --- a/pkg/envelopes/unsignedOriginator.go +++ b/pkg/envelopes/unsignedOriginator.go @@ -3,19 +3,19 @@ package envelopes import ( "errors" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" - "google.golang.org/protobuf/proto" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" + "github.com/xmtp/xmtpd/pkg/utils" ) type UnsignedOriginatorEnvelope struct { - proto *message_api.UnsignedOriginatorEnvelope + proto *envelopesProto.UnsignedOriginatorEnvelope PayerEnvelope PayerEnvelope } // Construct an UnsignedOriginatorEnvelope and perform validations on any child fields. // Does not verify signatures func NewUnsignedOriginatorEnvelope( - proto *message_api.UnsignedOriginatorEnvelope, + proto *envelopesProto.UnsignedOriginatorEnvelope, ) (*UnsignedOriginatorEnvelope, error) { if proto == nil { return nil, errors.New("proto is nil") @@ -45,13 +45,13 @@ func (u *UnsignedOriginatorEnvelope) OriginatorNs() int64 { } func NewUnsignedOriginatorEnvelopeFromBytes(bytes []byte) (*UnsignedOriginatorEnvelope, error) { - var message message_api.UnsignedOriginatorEnvelope - if err := proto.Unmarshal(bytes, &message); err != nil { + message, err := utils.UnmarshalUnsignedEnvelope(bytes) + if err != nil { return nil, err } - return NewUnsignedOriginatorEnvelope(&message) + return NewUnsignedOriginatorEnvelope(message) } -func (u *UnsignedOriginatorEnvelope) Proto() *message_api.UnsignedOriginatorEnvelope { +func (u *UnsignedOriginatorEnvelope) Proto() *envelopesProto.UnsignedOriginatorEnvelope { return u.proto } diff --git a/pkg/indexer/storer/identityUpdate.go b/pkg/indexer/storer/identityUpdate.go index 8b79d97a..26e7798a 100644 --- a/pkg/indexer/storer/identityUpdate.go +++ b/pkg/indexer/storer/identityUpdate.go @@ -13,7 +13,7 @@ import ( "github.com/xmtp/xmtpd/pkg/db/queries" "github.com/xmtp/xmtpd/pkg/mlsvalidate" "github.com/xmtp/xmtpd/pkg/proto/identity/associations" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/topic" "github.com/xmtp/xmtpd/pkg/utils" "go.uber.org/zap" @@ -214,7 +214,7 @@ func BuildInboxTopic(inboxId [32]byte) string { func buildOriginatorEnvelope( sequenceId uint64, update []byte, -) (*message_api.UnsignedOriginatorEnvelope, error) { +) (*envelopesProto.UnsignedOriginatorEnvelope, error) { clientEnv, err := buildClientEnvelope(update) if err != nil { return nil, err @@ -225,39 +225,39 @@ func buildOriginatorEnvelope( return nil, err } - return &message_api.UnsignedOriginatorEnvelope{ + return &envelopesProto.UnsignedOriginatorEnvelope{ OriginatorNodeId: IDENTITY_UPDATE_ORIGINATOR_ID, OriginatorSequenceId: sequenceId, OriginatorNs: time.Now().UnixNano(), - PayerEnvelope: &message_api.PayerEnvelope{ + PayerEnvelope: &envelopesProto.PayerEnvelope{ UnsignedClientEnvelope: clientEnvelopeBytes, }, }, nil } -func buildClientEnvelope(update []byte) (*message_api.ClientEnvelope, error) { +func buildClientEnvelope(update []byte) (*envelopesProto.ClientEnvelope, error) { var identityUpdate associations.IdentityUpdate if err := proto.Unmarshal(update, &identityUpdate); err != nil { return nil, err } - return &message_api.ClientEnvelope{ + return &envelopesProto.ClientEnvelope{ Aad: nil, - Payload: &message_api.ClientEnvelope_IdentityUpdate{ + Payload: &envelopesProto.ClientEnvelope_IdentityUpdate{ IdentityUpdate: &identityUpdate, }, }, nil } func buildSignedOriginatorEnvelope( - originatorEnvelope *message_api.UnsignedOriginatorEnvelope, -) (*message_api.OriginatorEnvelope, error) { + originatorEnvelope *envelopesProto.UnsignedOriginatorEnvelope, +) (*envelopesProto.OriginatorEnvelope, error) { envelopeBytes, err := proto.Marshal(originatorEnvelope) if err != nil { return nil, err } - return &message_api.OriginatorEnvelope{ + return &envelopesProto.OriginatorEnvelope{ UnsignedOriginatorEnvelope: envelopeBytes, }, nil } diff --git a/pkg/indexer/storer/identityUpdate_test.go b/pkg/indexer/storer/identityUpdate_test.go index aa44df0e..bcd261c5 100644 --- a/pkg/indexer/storer/identityUpdate_test.go +++ b/pkg/indexer/storer/identityUpdate_test.go @@ -13,7 +13,7 @@ import ( "github.com/xmtp/xmtpd/pkg/mlsvalidate" mlsvalidateMock "github.com/xmtp/xmtpd/pkg/mocks/mlsvalidate" "github.com/xmtp/xmtpd/pkg/proto/identity/associations" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + envelopesProto "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/testutils" "github.com/xmtp/xmtpd/pkg/utils" "google.golang.org/protobuf/proto" @@ -91,7 +91,7 @@ func TestStoreIdentityUpdate(t *testing.T) { require.Equal(t, len(envelopes), 1) firstEnvelope := envelopes[0] - deserializedEnvelope := message_api.OriginatorEnvelope{} + deserializedEnvelope := envelopesProto.OriginatorEnvelope{} require.NoError(t, proto.Unmarshal(firstEnvelope.OriginatorEnvelope, &deserializedEnvelope)) require.Greater(t, len(deserializedEnvelope.UnsignedOriginatorEnvelope), 0) diff --git a/pkg/mlsvalidate/service.go b/pkg/mlsvalidate/service.go index f0372a7b..6bba2b19 100644 --- a/pkg/mlsvalidate/service.go +++ b/pkg/mlsvalidate/service.go @@ -9,7 +9,7 @@ import ( associations "github.com/xmtp/xmtpd/pkg/proto/identity/associations" mlsv1 "github.com/xmtp/xmtpd/pkg/proto/mls/api/v1" svc "github.com/xmtp/xmtpd/pkg/proto/mls_validation/v1" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/utils" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -90,7 +90,7 @@ func (s *MLSValidationServiceImpl) GetAssociationStateFromEnvelopes( return nil, err } - payload, ok := clientEnvelope.GetPayload().(*message_api.ClientEnvelope_IdentityUpdate) + payload, ok := clientEnvelope.GetPayload().(*envelopes.ClientEnvelope_IdentityUpdate) if !ok || payload.IdentityUpdate == nil { return nil, fmt.Errorf("identity update is nil") } diff --git a/pkg/proto/openapi/xmtpv4/envelopes/envelopes.swagger.json b/pkg/proto/openapi/xmtpv4/envelopes/envelopes.swagger.json new file mode 100644 index 00000000..880598a8 --- /dev/null +++ b/pkg/proto/openapi/xmtpv4/envelopes/envelopes.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "xmtpv4/envelopes/envelopes.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/pkg/proto/openapi/xmtpv4/message_api/message_api.swagger.json b/pkg/proto/openapi/xmtpv4/message_api/message_api.swagger.json index c630fe0b..8dc5107d 100644 --- a/pkg/proto/openapi/xmtpv4/message_api/message_api.swagger.json +++ b/pkg/proto/openapi/xmtpv4/message_api/message_api.swagger.json @@ -24,7 +24,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/xmtpxmtpv4GetInboxIdsResponse" + "$ref": "#/definitions/xmtpv4message_apiGetInboxIdsResponse" } }, "default": { @@ -40,7 +40,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/xmtpxmtpv4GetInboxIdsRequest" + "$ref": "#/definitions/xmtpv4message_apiGetInboxIdsRequest" } } ], @@ -49,15 +49,15 @@ ] } }, - "/mls/v2/publish-envelopes": { + "/mls/v2/publish-payer-envelopes": { "post": { "summary": "Publish envelope", - "operationId": "ReplicationApi_PublishEnvelopes", + "operationId": "ReplicationApi_PublishPayerEnvelopes", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/xmtpv4PublishEnvelopesResponse" + "$ref": "#/definitions/message_apiPublishPayerEnvelopesResponse" } }, "default": { @@ -73,7 +73,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/xmtpv4PublishEnvelopesRequest" + "$ref": "#/definitions/message_apiPublishPayerEnvelopesRequest" } } ], @@ -90,7 +90,7 @@ "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/xmtpv4QueryEnvelopesResponse" + "$ref": "#/definitions/message_apiQueryEnvelopesResponse" } }, "default": { @@ -106,7 +106,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/xmtpv4QueryEnvelopesRequest" + "$ref": "#/definitions/message_apiQueryEnvelopesRequest" } } ], @@ -126,13 +126,13 @@ "type": "object", "properties": { "result": { - "$ref": "#/definitions/xmtpv4SubscribeEnvelopesResponse" + "$ref": "#/definitions/message_apiSubscribeEnvelopesResponse" }, "error": { "$ref": "#/definitions/rpcStatus" } }, - "title": "Stream result of xmtpv4SubscribeEnvelopesResponse" + "title": "Stream result of message_apiSubscribeEnvelopesResponse" } }, "default": { @@ -148,7 +148,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/xmtpv4SubscribeEnvelopesRequest" + "$ref": "#/definitions/message_apiSubscribeEnvelopesRequest" } } ], @@ -170,35 +170,7 @@ }, "title": "RecoverableEcdsaSignature for EIP-191 and V2 signatures" }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "xmtpv4BlockchainProof": { + "envelopesBlockchainProof": { "type": "object", "properties": { "blockNumber": { @@ -212,32 +184,7 @@ }, "title": "An alternative to a signature for blockchain payloads" }, - "xmtpv4EnvelopesQuery": { - "type": "object", - "properties": { - "topics": { - "type": "array", - "items": { - "type": "string", - "format": "byte" - }, - "title": "Client queries" - }, - "originatorNodeIds": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - }, - "title": "Node queries" - }, - "lastSeen": { - "$ref": "#/definitions/xmtpv4VectorClock" - } - }, - "title": "Query for envelopes, shared by query and subscribe endpoints\nEither topics or originator_node_ids may be set, but not both" - }, - "xmtpv4OriginatorEnvelope": { + "envelopesOriginatorEnvelope": { "type": "object", "properties": { "unsignedOriginatorEnvelope": { @@ -249,12 +196,12 @@ "$ref": "#/definitions/associationsRecoverableEcdsaSignature" }, "blockchainProof": { - "$ref": "#/definitions/xmtpv4BlockchainProof" + "$ref": "#/definitions/envelopesBlockchainProof" } }, "title": "Signed originator envelope" }, - "xmtpv4PayerEnvelope": { + "envelopesPayerEnvelope": { "type": "object", "properties": { "unsignedClientEnvelope": { @@ -268,35 +215,73 @@ }, "title": "Wraps client envelope with payer signature" }, - "xmtpv4PublishEnvelopesRequest": { + "envelopesVectorClock": { + "type": "object", + "properties": { + "nodeIdToSequenceId": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "uint64" + } + } + }, + "description": "The last seen entry per originator. Originators that have not been seen are omitted.\nEntries MUST be sorted in ascending order, so that smaller node ID's appear first." + }, + "message_apiEnvelopesQuery": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + }, + "title": "Client queries" + }, + "originatorNodeIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + }, + "title": "Node queries" + }, + "lastSeen": { + "$ref": "#/definitions/envelopesVectorClock" + } + }, + "title": "Query for envelopes, shared by query and subscribe endpoints\nEither topics or originator_node_ids may be set, but not both" + }, + "message_apiPublishPayerEnvelopesRequest": { "type": "object", "properties": { "payerEnvelopes": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/xmtpv4PayerEnvelope" + "$ref": "#/definitions/envelopesPayerEnvelope" } } } }, - "xmtpv4PublishEnvelopesResponse": { + "message_apiPublishPayerEnvelopesResponse": { "type": "object", "properties": { "originatorEnvelopes": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/xmtpv4OriginatorEnvelope" + "$ref": "#/definitions/envelopesOriginatorEnvelope" } } } }, - "xmtpv4QueryEnvelopesRequest": { + "message_apiQueryEnvelopesRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/xmtpv4EnvelopesQuery" + "$ref": "#/definitions/message_apiEnvelopesQuery" }, "limit": { "type": "integer", @@ -305,68 +290,83 @@ }, "title": "Query envelopes request" }, - "xmtpv4QueryEnvelopesResponse": { + "message_apiQueryEnvelopesResponse": { "type": "object", "properties": { "envelopes": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/xmtpv4OriginatorEnvelope" + "$ref": "#/definitions/envelopesOriginatorEnvelope" } } }, "title": "Query envelopes response" }, - "xmtpv4SubscribeEnvelopesRequest": { + "message_apiSubscribeEnvelopesRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/xmtpv4EnvelopesQuery" + "$ref": "#/definitions/message_apiEnvelopesQuery" } }, "title": "Batch subscribe to envelopes" }, - "xmtpv4SubscribeEnvelopesResponse": { + "message_apiSubscribeEnvelopesResponse": { "type": "object", "properties": { "envelopes": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/xmtpv4OriginatorEnvelope" + "$ref": "#/definitions/envelopesOriginatorEnvelope" } } }, "title": "Streamed response for batch subscribe - can be multiple envelopes at once" }, - "xmtpv4VectorClock": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { "type": "object", "properties": { - "nodeIdToSequenceId": { - "type": "object", - "additionalProperties": { - "type": "string", - "format": "uint64" + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" } } - }, - "description": "The last seen entry per originator. Originators that have not been seen are omitted.\nEntries MUST be sorted in ascending order, so that smaller node ID's appear first." + } }, - "xmtpxmtpv4GetInboxIdsRequest": { + "xmtpv4message_apiGetInboxIdsRequest": { "type": "object", "properties": { "requests": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/xmtpxmtpv4GetInboxIdsRequestRequest" + "$ref": "#/definitions/xmtpv4message_apiGetInboxIdsRequestRequest" } } }, "title": "Request to retrieve the XIDs for the given addresses" }, - "xmtpxmtpv4GetInboxIdsRequestRequest": { + "xmtpv4message_apiGetInboxIdsRequestRequest": { "type": "object", "properties": { "address": { @@ -375,20 +375,20 @@ }, "title": "A single request for a given address" }, - "xmtpxmtpv4GetInboxIdsResponse": { + "xmtpv4message_apiGetInboxIdsResponse": { "type": "object", "properties": { "responses": { "type": "array", "items": { "type": "object", - "$ref": "#/definitions/xmtpxmtpv4GetInboxIdsResponseResponse" + "$ref": "#/definitions/xmtpv4message_apiGetInboxIdsResponseResponse" } } }, "title": "Response with the XIDs for the requested addresses" }, - "xmtpxmtpv4GetInboxIdsResponseResponse": { + "xmtpv4message_apiGetInboxIdsResponseResponse": { "type": "object", "properties": { "address": { diff --git a/pkg/proto/openapi/xmtpv4/payer_api/payer_api.swagger.json b/pkg/proto/openapi/xmtpv4/payer_api/payer_api.swagger.json new file mode 100644 index 00000000..23947208 --- /dev/null +++ b/pkg/proto/openapi/xmtpv4/payer_api/payer_api.swagger.json @@ -0,0 +1,507 @@ +{ + "swagger": "2.0", + "info": { + "title": "xmtpv4/payer_api/payer_api.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "PayerApi" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/mls/v2/payer/publish-client-envelopes": { + "post": { + "summary": "Publish envelope", + "operationId": "PayerApi_PublishClientEnvelopes", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/payer_apiPublishClientEnvelopesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/payer_apiPublishClientEnvelopesRequest" + } + } + ], + "tags": [ + "PayerApi" + ] + } + } + }, + "definitions": { + "SignatureECDSACompact": { + "type": "object", + "properties": { + "bytes": { + "type": "string", + "format": "byte", + "title": "compact representation [ R || S ], 64 bytes" + }, + "recovery": { + "type": "integer", + "format": "int64", + "title": "recovery bit" + } + }, + "title": "ECDSA signature bytes and the recovery bit" + }, + "SignatureWalletECDSACompact": { + "type": "object", + "properties": { + "bytes": { + "type": "string", + "format": "byte", + "title": "compact representation [ R || S ], 64 bytes" + }, + "recovery": { + "type": "integer", + "format": "int64", + "title": "recovery bit" + } + }, + "description": "ECDSA signature bytes and the recovery bit\nproduced by xmtp-js::PublicKey.signWithWallet function, i.e.\nEIP-191 signature of a \"Create Identity\" message with the key embedded.\nUsed to sign identity keys." + }, + "associationsAddAssociation": { + "type": "object", + "properties": { + "newMemberIdentifier": { + "$ref": "#/definitions/associationsMemberIdentifier" + }, + "existingMemberSignature": { + "$ref": "#/definitions/identityassociationsSignature" + }, + "newMemberSignature": { + "$ref": "#/definitions/identityassociationsSignature" + } + }, + "description": "Adds a new member for an XID - either an addressable member such as a\nwallet, or an installation acting on behalf of an address.\nA key-pair that has been associated with one role MUST not be permitted to be\nassociated with a different role." + }, + "associationsChangeRecoveryAddress": { + "type": "object", + "properties": { + "newRecoveryAddress": { + "type": "string" + }, + "existingRecoveryAddressSignature": { + "$ref": "#/definitions/identityassociationsSignature" + } + }, + "description": "Changes the recovery address for an XID. The recovery address is not required\nto be a member of the XID. In addition to being able to add members, the\nrecovery address can also revoke members." + }, + "associationsCreateInbox": { + "type": "object", + "properties": { + "initialAddress": { + "type": "string" + }, + "nonce": { + "type": "string", + "format": "uint64" + }, + "initialAddressSignature": { + "$ref": "#/definitions/identityassociationsSignature", + "title": "Must be an addressable member" + } + }, + "description": "The first entry of any XID log. The XID must be deterministically derivable\nfrom the address and nonce.\nThe recovery address defaults to the initial associated_address unless\nthere is a subsequent ChangeRecoveryAddress in the log." + }, + "associationsIdentityAction": { + "type": "object", + "properties": { + "createInbox": { + "$ref": "#/definitions/associationsCreateInbox" + }, + "add": { + "$ref": "#/definitions/associationsAddAssociation" + }, + "revoke": { + "$ref": "#/definitions/associationsRevokeAssociation" + }, + "changeRecoveryAddress": { + "$ref": "#/definitions/associationsChangeRecoveryAddress" + } + }, + "title": "A single identity operation" + }, + "associationsIdentityUpdate": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/associationsIdentityAction" + } + }, + "clientTimestampNs": { + "type": "string", + "format": "uint64" + }, + "inboxId": { + "type": "string" + } + }, + "description": "One or more identity actions that were signed together.\nExample: [CreateXid, AddAssociation, ChangeRecoveryAddress]\n1. The batched signature text is created by concatenating the signature text\n of each association together with a separator, '\\n\\n\\n'.\n2. The user signs this concatenated result.\n3. The resulting signature is added to each association proto where relevant.\n The same signature may be used for multiple associations in the array." + }, + "associationsLegacyDelegatedSignature": { + "type": "object", + "properties": { + "delegatedKey": { + "$ref": "#/definitions/message_contentsSignedPublicKey" + }, + "signature": { + "$ref": "#/definitions/associationsRecoverableEcdsaSignature" + } + }, + "description": "An existing address on xmtpv2 may have already signed a legacy identity key\nof type SignedPublicKey via the 'Create Identity' signature.\nFor migration to xmtpv3, the legacy key is permitted to sign on behalf of the\naddress to create a matching xmtpv3 installation key.\nThis signature type can ONLY be used for CreateXid and AddAssociation\npayloads, and can only be used once in xmtpv3." + }, + "associationsMemberIdentifier": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "installationPublicKey": { + "type": "string", + "format": "byte" + } + }, + "title": "The identifier for a member of an XID" + }, + "associationsRecoverableEcdsaSignature": { + "type": "object", + "properties": { + "bytes": { + "type": "string", + "format": "byte", + "title": "65-bytes [ R || S || V ], with recovery id as the last byte" + } + }, + "title": "RecoverableEcdsaSignature for EIP-191 and V2 signatures" + }, + "associationsRecoverableEd25519Signature": { + "type": "object", + "properties": { + "bytes": { + "type": "string", + "format": "byte", + "title": "64 bytes [R(32 bytes) || S(32 bytes)]" + }, + "publicKey": { + "type": "string", + "format": "byte", + "title": "32 bytes" + } + }, + "title": "EdDSA signature for 25519" + }, + "associationsRevokeAssociation": { + "type": "object", + "properties": { + "memberToRevoke": { + "$ref": "#/definitions/associationsMemberIdentifier" + }, + "recoveryAddressSignature": { + "$ref": "#/definitions/identityassociationsSignature" + } + }, + "description": "Revokes a member from an XID. The recovery address must sign the revocation." + }, + "associationsSmartContractWalletSignature": { + "type": "object", + "properties": { + "accountId": { + "type": "string", + "title": "CAIP-10 string\nhttps://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-10.md" + }, + "blockNumber": { + "type": "string", + "format": "uint64", + "title": "Specify the block number to verify the signature against" + }, + "signature": { + "type": "string", + "format": "byte", + "title": "The actual signature bytes" + } + }, + "title": "Smart Contract Wallet signature" + }, + "envelopesAuthenticatedData": { + "type": "object", + "properties": { + "targetOriginator": { + "type": "integer", + "format": "int64" + }, + "targetTopic": { + "type": "string", + "format": "byte" + }, + "lastSeen": { + "$ref": "#/definitions/envelopesVectorClock" + } + }, + "description": "Data visible to the server that has been authenticated by the client." + }, + "envelopesBlockchainProof": { + "type": "object", + "properties": { + "blockNumber": { + "type": "string", + "format": "uint64" + }, + "publisherNodeId": { + "type": "integer", + "format": "int64" + } + }, + "title": "An alternative to a signature for blockchain payloads" + }, + "envelopesClientEnvelope": { + "type": "object", + "properties": { + "aad": { + "$ref": "#/definitions/envelopesAuthenticatedData" + }, + "groupMessage": { + "$ref": "#/definitions/v1GroupMessageInput" + }, + "welcomeMessage": { + "$ref": "#/definitions/v1WelcomeMessageInput" + }, + "uploadKeyPackage": { + "$ref": "#/definitions/v1UploadKeyPackageRequest" + }, + "identityUpdate": { + "$ref": "#/definitions/associationsIdentityUpdate" + } + } + }, + "envelopesOriginatorEnvelope": { + "type": "object", + "properties": { + "unsignedOriginatorEnvelope": { + "type": "string", + "format": "byte", + "title": "Protobuf serialized" + }, + "originatorSignature": { + "$ref": "#/definitions/associationsRecoverableEcdsaSignature" + }, + "blockchainProof": { + "$ref": "#/definitions/envelopesBlockchainProof" + } + }, + "title": "Signed originator envelope" + }, + "envelopesVectorClock": { + "type": "object", + "properties": { + "nodeIdToSequenceId": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "uint64" + } + } + }, + "description": "The last seen entry per originator. Originators that have not been seen are omitted.\nEntries MUST be sorted in ascending order, so that smaller node ID's appear first." + }, + "identityassociationsSignature": { + "type": "object", + "properties": { + "erc191": { + "$ref": "#/definitions/associationsRecoverableEcdsaSignature" + }, + "erc6492": { + "$ref": "#/definitions/associationsSmartContractWalletSignature" + }, + "installationKey": { + "$ref": "#/definitions/associationsRecoverableEd25519Signature" + }, + "delegatedErc191": { + "$ref": "#/definitions/associationsLegacyDelegatedSignature" + } + }, + "title": "A wrapper for all possible signature types" + }, + "message_contentsSignedPublicKey": { + "type": "object", + "properties": { + "keyBytes": { + "type": "string", + "format": "byte", + "title": "embeds an UnsignedPublicKey" + }, + "signature": { + "$ref": "#/definitions/xmtpmessage_contentsSignature", + "title": "signs key_bytes" + } + }, + "title": "SignedPublicKey" + }, + "payer_apiPublishClientEnvelopesRequest": { + "type": "object", + "properties": { + "envelopes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/envelopesClientEnvelope" + } + } + } + }, + "payer_apiPublishClientEnvelopesResponse": { + "type": "object", + "properties": { + "originatorEnvelopes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/envelopesOriginatorEnvelope" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1GroupMessageInput": { + "type": "object", + "properties": { + "v1": { + "$ref": "#/definitions/v1GroupMessageInputV1" + } + }, + "title": "Input type for a group message" + }, + "v1GroupMessageInputV1": { + "type": "object", + "properties": { + "data": { + "type": "string", + "format": "byte", + "title": "Serialized MlsProtocolMessage" + }, + "senderHmac": { + "type": "string", + "format": "byte" + } + }, + "title": "Version 1 of the GroupMessageInput payload format" + }, + "v1KeyPackageUpload": { + "type": "object", + "properties": { + "keyPackageTlsSerialized": { + "type": "string", + "format": "byte", + "description": "The owner's wallet address would be extracted from the identity\ncredential in the key package, and all signatures would be validated." + } + }, + "description": "This would be a serialized MLS key package that the node would\n parse, validate, and then store.", + "title": "A wrapper around the Key Package bytes" + }, + "v1UploadKeyPackageRequest": { + "type": "object", + "properties": { + "keyPackage": { + "$ref": "#/definitions/v1KeyPackageUpload", + "title": "An individual key package upload request" + }, + "isInboxIdCredential": { + "type": "boolean" + } + }, + "title": "Upload a new key packages" + }, + "v1WelcomeMessageInput": { + "type": "object", + "properties": { + "v1": { + "$ref": "#/definitions/v1WelcomeMessageInputV1" + } + }, + "title": "Input type for a welcome message" + }, + "v1WelcomeMessageInputV1": { + "type": "object", + "properties": { + "installationKey": { + "type": "string", + "format": "byte" + }, + "data": { + "type": "string", + "format": "byte" + }, + "hpkePublicKey": { + "type": "string", + "format": "byte" + } + }, + "title": "Version 1 of the WelcomeMessageInput format" + }, + "xmtpmessage_contentsSignature": { + "type": "object", + "properties": { + "ecdsaCompact": { + "$ref": "#/definitions/SignatureECDSACompact" + }, + "walletEcdsaCompact": { + "$ref": "#/definitions/SignatureWalletECDSACompact" + } + }, + "description": "Signature represents a generalized public key signature,\ndefined as a union to support cryptographic algorithm agility." + } + } +} diff --git a/pkg/proto/xmtpv4/envelopes/envelopes.pb.go b/pkg/proto/xmtpv4/envelopes/envelopes.pb.go new file mode 100644 index 00000000..87fd2ca1 --- /dev/null +++ b/pkg/proto/xmtpv4/envelopes/envelopes.pb.go @@ -0,0 +1,727 @@ +// Message API for XMTP V4 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc (unknown) +// source: xmtpv4/envelopes/envelopes.proto + +package envelopes + +import ( + associations "github.com/xmtp/xmtpd/pkg/proto/identity/associations" + v1 "github.com/xmtp/xmtpd/pkg/proto/mls/api/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +// The last seen entry per originator. Originators that have not been seen are omitted. +// Entries MUST be sorted in ascending order, so that smaller node ID's appear first. +type VectorClock struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeIdToSequenceId map[uint32]uint64 `protobuf:"bytes,1,rep,name=node_id_to_sequence_id,json=nodeIdToSequenceId,proto3" json:"node_id_to_sequence_id,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *VectorClock) Reset() { + *x = VectorClock{} + mi := &file_xmtpv4_envelopes_envelopes_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VectorClock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VectorClock) ProtoMessage() {} + +func (x *VectorClock) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_envelopes_envelopes_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 VectorClock.ProtoReflect.Descriptor instead. +func (*VectorClock) Descriptor() ([]byte, []int) { + return file_xmtpv4_envelopes_envelopes_proto_rawDescGZIP(), []int{0} +} + +func (x *VectorClock) GetNodeIdToSequenceId() map[uint32]uint64 { + if x != nil { + return x.NodeIdToSequenceId + } + return nil +} + +// Data visible to the server that has been authenticated by the client. +type AuthenticatedData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetOriginator uint32 `protobuf:"varint,1,opt,name=target_originator,json=targetOriginator,proto3" json:"target_originator,omitempty"` + TargetTopic []byte `protobuf:"bytes,2,opt,name=target_topic,json=targetTopic,proto3" json:"target_topic,omitempty"` + LastSeen *VectorClock `protobuf:"bytes,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` +} + +func (x *AuthenticatedData) Reset() { + *x = AuthenticatedData{} + mi := &file_xmtpv4_envelopes_envelopes_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AuthenticatedData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthenticatedData) ProtoMessage() {} + +func (x *AuthenticatedData) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_envelopes_envelopes_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 AuthenticatedData.ProtoReflect.Descriptor instead. +func (*AuthenticatedData) Descriptor() ([]byte, []int) { + return file_xmtpv4_envelopes_envelopes_proto_rawDescGZIP(), []int{1} +} + +func (x *AuthenticatedData) GetTargetOriginator() uint32 { + if x != nil { + return x.TargetOriginator + } + return 0 +} + +func (x *AuthenticatedData) GetTargetTopic() []byte { + if x != nil { + return x.TargetTopic + } + return nil +} + +func (x *AuthenticatedData) GetLastSeen() *VectorClock { + if x != nil { + return x.LastSeen + } + return nil +} + +type ClientEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Aad *AuthenticatedData `protobuf:"bytes,1,opt,name=aad,proto3" json:"aad,omitempty"` + // Types that are assignable to Payload: + // + // *ClientEnvelope_GroupMessage + // *ClientEnvelope_WelcomeMessage + // *ClientEnvelope_UploadKeyPackage + // *ClientEnvelope_IdentityUpdate + Payload isClientEnvelope_Payload `protobuf_oneof:"payload"` +} + +func (x *ClientEnvelope) Reset() { + *x = ClientEnvelope{} + mi := &file_xmtpv4_envelopes_envelopes_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientEnvelope) ProtoMessage() {} + +func (x *ClientEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_envelopes_envelopes_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 ClientEnvelope.ProtoReflect.Descriptor instead. +func (*ClientEnvelope) Descriptor() ([]byte, []int) { + return file_xmtpv4_envelopes_envelopes_proto_rawDescGZIP(), []int{2} +} + +func (x *ClientEnvelope) GetAad() *AuthenticatedData { + if x != nil { + return x.Aad + } + return nil +} + +func (m *ClientEnvelope) GetPayload() isClientEnvelope_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *ClientEnvelope) GetGroupMessage() *v1.GroupMessageInput { + if x, ok := x.GetPayload().(*ClientEnvelope_GroupMessage); ok { + return x.GroupMessage + } + return nil +} + +func (x *ClientEnvelope) GetWelcomeMessage() *v1.WelcomeMessageInput { + if x, ok := x.GetPayload().(*ClientEnvelope_WelcomeMessage); ok { + return x.WelcomeMessage + } + return nil +} + +func (x *ClientEnvelope) GetUploadKeyPackage() *v1.UploadKeyPackageRequest { + if x, ok := x.GetPayload().(*ClientEnvelope_UploadKeyPackage); ok { + return x.UploadKeyPackage + } + return nil +} + +func (x *ClientEnvelope) GetIdentityUpdate() *associations.IdentityUpdate { + if x, ok := x.GetPayload().(*ClientEnvelope_IdentityUpdate); ok { + return x.IdentityUpdate + } + return nil +} + +type isClientEnvelope_Payload interface { + isClientEnvelope_Payload() +} + +type ClientEnvelope_GroupMessage struct { + GroupMessage *v1.GroupMessageInput `protobuf:"bytes,2,opt,name=group_message,json=groupMessage,proto3,oneof"` +} + +type ClientEnvelope_WelcomeMessage struct { + WelcomeMessage *v1.WelcomeMessageInput `protobuf:"bytes,3,opt,name=welcome_message,json=welcomeMessage,proto3,oneof"` +} + +type ClientEnvelope_UploadKeyPackage struct { + UploadKeyPackage *v1.UploadKeyPackageRequest `protobuf:"bytes,4,opt,name=upload_key_package,json=uploadKeyPackage,proto3,oneof"` +} + +type ClientEnvelope_IdentityUpdate struct { + IdentityUpdate *associations.IdentityUpdate `protobuf:"bytes,5,opt,name=identity_update,json=identityUpdate,proto3,oneof"` +} + +func (*ClientEnvelope_GroupMessage) isClientEnvelope_Payload() {} + +func (*ClientEnvelope_WelcomeMessage) isClientEnvelope_Payload() {} + +func (*ClientEnvelope_UploadKeyPackage) isClientEnvelope_Payload() {} + +func (*ClientEnvelope_IdentityUpdate) isClientEnvelope_Payload() {} + +// Wraps client envelope with payer signature +type PayerEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UnsignedClientEnvelope []byte `protobuf:"bytes,1,opt,name=unsigned_client_envelope,json=unsignedClientEnvelope,proto3" json:"unsigned_client_envelope,omitempty"` // Protobuf serialized + PayerSignature *associations.RecoverableEcdsaSignature `protobuf:"bytes,2,opt,name=payer_signature,json=payerSignature,proto3" json:"payer_signature,omitempty"` +} + +func (x *PayerEnvelope) Reset() { + *x = PayerEnvelope{} + mi := &file_xmtpv4_envelopes_envelopes_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PayerEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayerEnvelope) ProtoMessage() {} + +func (x *PayerEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_envelopes_envelopes_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 PayerEnvelope.ProtoReflect.Descriptor instead. +func (*PayerEnvelope) Descriptor() ([]byte, []int) { + return file_xmtpv4_envelopes_envelopes_proto_rawDescGZIP(), []int{3} +} + +func (x *PayerEnvelope) GetUnsignedClientEnvelope() []byte { + if x != nil { + return x.UnsignedClientEnvelope + } + return nil +} + +func (x *PayerEnvelope) GetPayerSignature() *associations.RecoverableEcdsaSignature { + if x != nil { + return x.PayerSignature + } + return nil +} + +// For blockchain envelopes, the originator_sid is set by the smart contract, +// but the originator_ns is set by the publishing node +type UnsignedOriginatorEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OriginatorNodeId uint32 `protobuf:"varint,1,opt,name=originator_node_id,json=originatorNodeId,proto3" json:"originator_node_id,omitempty"` + OriginatorSequenceId uint64 `protobuf:"varint,2,opt,name=originator_sequence_id,json=originatorSequenceId,proto3" json:"originator_sequence_id,omitempty"` + OriginatorNs int64 `protobuf:"varint,3,opt,name=originator_ns,json=originatorNs,proto3" json:"originator_ns,omitempty"` + PayerEnvelope *PayerEnvelope `protobuf:"bytes,4,opt,name=payer_envelope,json=payerEnvelope,proto3" json:"payer_envelope,omitempty"` +} + +func (x *UnsignedOriginatorEnvelope) Reset() { + *x = UnsignedOriginatorEnvelope{} + mi := &file_xmtpv4_envelopes_envelopes_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UnsignedOriginatorEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnsignedOriginatorEnvelope) ProtoMessage() {} + +func (x *UnsignedOriginatorEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_envelopes_envelopes_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 UnsignedOriginatorEnvelope.ProtoReflect.Descriptor instead. +func (*UnsignedOriginatorEnvelope) Descriptor() ([]byte, []int) { + return file_xmtpv4_envelopes_envelopes_proto_rawDescGZIP(), []int{4} +} + +func (x *UnsignedOriginatorEnvelope) GetOriginatorNodeId() uint32 { + if x != nil { + return x.OriginatorNodeId + } + return 0 +} + +func (x *UnsignedOriginatorEnvelope) GetOriginatorSequenceId() uint64 { + if x != nil { + return x.OriginatorSequenceId + } + return 0 +} + +func (x *UnsignedOriginatorEnvelope) GetOriginatorNs() int64 { + if x != nil { + return x.OriginatorNs + } + return 0 +} + +func (x *UnsignedOriginatorEnvelope) GetPayerEnvelope() *PayerEnvelope { + if x != nil { + return x.PayerEnvelope + } + return nil +} + +// An alternative to a signature for blockchain payloads +type BlockchainProof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockNumber uint64 `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` + PublisherNodeId uint32 `protobuf:"varint,2,opt,name=publisher_node_id,json=publisherNodeId,proto3" json:"publisher_node_id,omitempty"` +} + +func (x *BlockchainProof) Reset() { + *x = BlockchainProof{} + mi := &file_xmtpv4_envelopes_envelopes_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlockchainProof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockchainProof) ProtoMessage() {} + +func (x *BlockchainProof) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_envelopes_envelopes_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 BlockchainProof.ProtoReflect.Descriptor instead. +func (*BlockchainProof) Descriptor() ([]byte, []int) { + return file_xmtpv4_envelopes_envelopes_proto_rawDescGZIP(), []int{5} +} + +func (x *BlockchainProof) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +func (x *BlockchainProof) GetPublisherNodeId() uint32 { + if x != nil { + return x.PublisherNodeId + } + return 0 +} + +// Signed originator envelope +type OriginatorEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UnsignedOriginatorEnvelope []byte `protobuf:"bytes,1,opt,name=unsigned_originator_envelope,json=unsignedOriginatorEnvelope,proto3" json:"unsigned_originator_envelope,omitempty"` // Protobuf serialized + // Types that are assignable to Proof: + // + // *OriginatorEnvelope_OriginatorSignature + // *OriginatorEnvelope_BlockchainProof + Proof isOriginatorEnvelope_Proof `protobuf_oneof:"proof"` +} + +func (x *OriginatorEnvelope) Reset() { + *x = OriginatorEnvelope{} + mi := &file_xmtpv4_envelopes_envelopes_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OriginatorEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OriginatorEnvelope) ProtoMessage() {} + +func (x *OriginatorEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_envelopes_envelopes_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 OriginatorEnvelope.ProtoReflect.Descriptor instead. +func (*OriginatorEnvelope) Descriptor() ([]byte, []int) { + return file_xmtpv4_envelopes_envelopes_proto_rawDescGZIP(), []int{6} +} + +func (x *OriginatorEnvelope) GetUnsignedOriginatorEnvelope() []byte { + if x != nil { + return x.UnsignedOriginatorEnvelope + } + return nil +} + +func (m *OriginatorEnvelope) GetProof() isOriginatorEnvelope_Proof { + if m != nil { + return m.Proof + } + return nil +} + +func (x *OriginatorEnvelope) GetOriginatorSignature() *associations.RecoverableEcdsaSignature { + if x, ok := x.GetProof().(*OriginatorEnvelope_OriginatorSignature); ok { + return x.OriginatorSignature + } + return nil +} + +func (x *OriginatorEnvelope) GetBlockchainProof() *BlockchainProof { + if x, ok := x.GetProof().(*OriginatorEnvelope_BlockchainProof); ok { + return x.BlockchainProof + } + return nil +} + +type isOriginatorEnvelope_Proof interface { + isOriginatorEnvelope_Proof() +} + +type OriginatorEnvelope_OriginatorSignature struct { + OriginatorSignature *associations.RecoverableEcdsaSignature `protobuf:"bytes,2,opt,name=originator_signature,json=originatorSignature,proto3,oneof"` +} + +type OriginatorEnvelope_BlockchainProof struct { + BlockchainProof *BlockchainProof `protobuf:"bytes,3,opt,name=blockchain_proof,json=blockchainProof,proto3,oneof"` +} + +func (*OriginatorEnvelope_OriginatorSignature) isOriginatorEnvelope_Proof() {} + +func (*OriginatorEnvelope_BlockchainProof) isOriginatorEnvelope_Proof() {} + +var File_xmtpv4_envelopes_envelopes_proto protoreflect.FileDescriptor + +var file_xmtpv4_envelopes_envelopes_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x65, 0x73, 0x2f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x1a, 0x27, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x2f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x25, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x61, 0x73, 0x73, + 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x6d, 0x6c, 0x73, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xc4, 0x01, 0x0a, 0x0b, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x6e, 0x0a, 0x16, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x65, + 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x3a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x71, 0x75, + 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x6e, 0x6f, 0x64, + 0x65, 0x49, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x1a, + 0x45, 0x0a, 0x17, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x63, 0x65, 0x49, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa4, 0x01, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x68, 0x65, + 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x11, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x3f, 0x0a, 0x09, + 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x22, 0xa4, 0x03, + 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x12, 0x3a, 0x0a, 0x03, 0x61, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x03, 0x61, 0x61, 0x64, 0x12, 0x49, 0x0a, 0x0d, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x4f, 0x0a, 0x0f, 0x77, 0x65, 0x6c, 0x63, 0x6f, + 0x6d, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x58, 0x0a, 0x12, 0x75, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, + 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x10, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x12, 0x55, 0x0a, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x61, 0x73, 0x73, 0x6f, + 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x16, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x12, 0x5e, 0x0a, 0x0f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x62, + 0x6c, 0x65, 0x45, 0x63, 0x64, 0x73, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x22, 0xf2, 0x01, 0x0a, 0x1a, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, + 0x2c, 0x0a, 0x12, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x34, 0x0a, + 0x16, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x65, 0x71, 0x75, + 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x65, + 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, + 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x60, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x11, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, + 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0xa0, 0x02, 0x0a, 0x12, 0x4f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x40, + 0x0a, 0x1c, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x12, 0x6a, 0x0a, 0x14, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x61, + 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x63, 0x64, 0x73, 0x61, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x6f, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x53, 0x0a, 0x10, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x48, 0x00, + 0x52, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x42, 0x07, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0xd3, 0x01, 0x0a, 0x19, 0x63, + 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, + 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x42, 0x0e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, + 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x78, 0x6d, 0x74, 0x70, + 0x76, 0x34, 0x2f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0xa2, 0x02, 0x03, 0x58, + 0x58, 0x45, 0xaa, 0x02, 0x15, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, + 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0xca, 0x02, 0x15, 0x58, 0x6d, 0x74, + 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x5c, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x65, 0x73, 0xe2, 0x02, 0x21, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, + 0x5c, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x58, + 0x6d, 0x74, 0x70, 0x76, 0x34, 0x3a, 0x3a, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_xmtpv4_envelopes_envelopes_proto_rawDescOnce sync.Once + file_xmtpv4_envelopes_envelopes_proto_rawDescData = file_xmtpv4_envelopes_envelopes_proto_rawDesc +) + +func file_xmtpv4_envelopes_envelopes_proto_rawDescGZIP() []byte { + file_xmtpv4_envelopes_envelopes_proto_rawDescOnce.Do(func() { + file_xmtpv4_envelopes_envelopes_proto_rawDescData = protoimpl.X.CompressGZIP(file_xmtpv4_envelopes_envelopes_proto_rawDescData) + }) + return file_xmtpv4_envelopes_envelopes_proto_rawDescData +} + +var file_xmtpv4_envelopes_envelopes_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_xmtpv4_envelopes_envelopes_proto_goTypes = []any{ + (*VectorClock)(nil), // 0: xmtp.xmtpv4.envelopes.VectorClock + (*AuthenticatedData)(nil), // 1: xmtp.xmtpv4.envelopes.AuthenticatedData + (*ClientEnvelope)(nil), // 2: xmtp.xmtpv4.envelopes.ClientEnvelope + (*PayerEnvelope)(nil), // 3: xmtp.xmtpv4.envelopes.PayerEnvelope + (*UnsignedOriginatorEnvelope)(nil), // 4: xmtp.xmtpv4.envelopes.UnsignedOriginatorEnvelope + (*BlockchainProof)(nil), // 5: xmtp.xmtpv4.envelopes.BlockchainProof + (*OriginatorEnvelope)(nil), // 6: xmtp.xmtpv4.envelopes.OriginatorEnvelope + nil, // 7: xmtp.xmtpv4.envelopes.VectorClock.NodeIdToSequenceIdEntry + (*v1.GroupMessageInput)(nil), // 8: xmtp.mls.api.v1.GroupMessageInput + (*v1.WelcomeMessageInput)(nil), // 9: xmtp.mls.api.v1.WelcomeMessageInput + (*v1.UploadKeyPackageRequest)(nil), // 10: xmtp.mls.api.v1.UploadKeyPackageRequest + (*associations.IdentityUpdate)(nil), // 11: xmtp.identity.associations.IdentityUpdate + (*associations.RecoverableEcdsaSignature)(nil), // 12: xmtp.identity.associations.RecoverableEcdsaSignature +} +var file_xmtpv4_envelopes_envelopes_proto_depIdxs = []int32{ + 7, // 0: xmtp.xmtpv4.envelopes.VectorClock.node_id_to_sequence_id:type_name -> xmtp.xmtpv4.envelopes.VectorClock.NodeIdToSequenceIdEntry + 0, // 1: xmtp.xmtpv4.envelopes.AuthenticatedData.last_seen:type_name -> xmtp.xmtpv4.envelopes.VectorClock + 1, // 2: xmtp.xmtpv4.envelopes.ClientEnvelope.aad:type_name -> xmtp.xmtpv4.envelopes.AuthenticatedData + 8, // 3: xmtp.xmtpv4.envelopes.ClientEnvelope.group_message:type_name -> xmtp.mls.api.v1.GroupMessageInput + 9, // 4: xmtp.xmtpv4.envelopes.ClientEnvelope.welcome_message:type_name -> xmtp.mls.api.v1.WelcomeMessageInput + 10, // 5: xmtp.xmtpv4.envelopes.ClientEnvelope.upload_key_package:type_name -> xmtp.mls.api.v1.UploadKeyPackageRequest + 11, // 6: xmtp.xmtpv4.envelopes.ClientEnvelope.identity_update:type_name -> xmtp.identity.associations.IdentityUpdate + 12, // 7: xmtp.xmtpv4.envelopes.PayerEnvelope.payer_signature:type_name -> xmtp.identity.associations.RecoverableEcdsaSignature + 3, // 8: xmtp.xmtpv4.envelopes.UnsignedOriginatorEnvelope.payer_envelope:type_name -> xmtp.xmtpv4.envelopes.PayerEnvelope + 12, // 9: xmtp.xmtpv4.envelopes.OriginatorEnvelope.originator_signature:type_name -> xmtp.identity.associations.RecoverableEcdsaSignature + 5, // 10: xmtp.xmtpv4.envelopes.OriginatorEnvelope.blockchain_proof:type_name -> xmtp.xmtpv4.envelopes.BlockchainProof + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_xmtpv4_envelopes_envelopes_proto_init() } +func file_xmtpv4_envelopes_envelopes_proto_init() { + if File_xmtpv4_envelopes_envelopes_proto != nil { + return + } + file_xmtpv4_envelopes_envelopes_proto_msgTypes[2].OneofWrappers = []any{ + (*ClientEnvelope_GroupMessage)(nil), + (*ClientEnvelope_WelcomeMessage)(nil), + (*ClientEnvelope_UploadKeyPackage)(nil), + (*ClientEnvelope_IdentityUpdate)(nil), + } + file_xmtpv4_envelopes_envelopes_proto_msgTypes[6].OneofWrappers = []any{ + (*OriginatorEnvelope_OriginatorSignature)(nil), + (*OriginatorEnvelope_BlockchainProof)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_xmtpv4_envelopes_envelopes_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_xmtpv4_envelopes_envelopes_proto_goTypes, + DependencyIndexes: file_xmtpv4_envelopes_envelopes_proto_depIdxs, + MessageInfos: file_xmtpv4_envelopes_envelopes_proto_msgTypes, + }.Build() + File_xmtpv4_envelopes_envelopes_proto = out.File + file_xmtpv4_envelopes_envelopes_proto_rawDesc = nil + file_xmtpv4_envelopes_envelopes_proto_goTypes = nil + file_xmtpv4_envelopes_envelopes_proto_depIdxs = nil +} diff --git a/pkg/proto/xmtpv4/message_api/message_api.pb.go b/pkg/proto/xmtpv4/message_api/message_api.pb.go index 9e4ce21e..3306873c 100644 --- a/pkg/proto/xmtpv4/message_api/message_api.pb.go +++ b/pkg/proto/xmtpv4/message_api/message_api.pb.go @@ -9,8 +9,7 @@ package message_api import ( - associations "github.com/xmtp/xmtpd/pkg/proto/identity/associations" - v1 "github.com/xmtp/xmtpd/pkg/proto/mls/api/v1" + envelopes "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -81,538 +80,19 @@ func (Misbehavior) EnumDescriptor() ([]byte, []int) { return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{0} } -// The last seen entry per originator. Originators that have not been seen are omitted. -// Entries MUST be sorted in ascending order, so that smaller node ID's appear first. -type VectorClock struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NodeIdToSequenceId map[uint32]uint64 `protobuf:"bytes,1,rep,name=node_id_to_sequence_id,json=nodeIdToSequenceId,proto3" json:"node_id_to_sequence_id,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` -} - -func (x *VectorClock) Reset() { - *x = VectorClock{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VectorClock) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VectorClock) ProtoMessage() {} - -func (x *VectorClock) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_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 VectorClock.ProtoReflect.Descriptor instead. -func (*VectorClock) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{0} -} - -func (x *VectorClock) GetNodeIdToSequenceId() map[uint32]uint64 { - if x != nil { - return x.NodeIdToSequenceId - } - return nil -} - -// Data visible to the server that has been authenticated by the client. -type AuthenticatedData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TargetOriginator uint32 `protobuf:"varint,1,opt,name=target_originator,json=targetOriginator,proto3" json:"target_originator,omitempty"` - TargetTopic []byte `protobuf:"bytes,2,opt,name=target_topic,json=targetTopic,proto3" json:"target_topic,omitempty"` - LastSeen *VectorClock `protobuf:"bytes,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` -} - -func (x *AuthenticatedData) Reset() { - *x = AuthenticatedData{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AuthenticatedData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthenticatedData) ProtoMessage() {} - -func (x *AuthenticatedData) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_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 AuthenticatedData.ProtoReflect.Descriptor instead. -func (*AuthenticatedData) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{1} -} - -func (x *AuthenticatedData) GetTargetOriginator() uint32 { - if x != nil { - return x.TargetOriginator - } - return 0 -} - -func (x *AuthenticatedData) GetTargetTopic() []byte { - if x != nil { - return x.TargetTopic - } - return nil -} - -func (x *AuthenticatedData) GetLastSeen() *VectorClock { - if x != nil { - return x.LastSeen - } - return nil -} - -type ClientEnvelope struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Payload: - // - // *ClientEnvelope_GroupMessage - // *ClientEnvelope_WelcomeMessage - // *ClientEnvelope_RegisterInstallation - // *ClientEnvelope_UploadKeyPackage - // *ClientEnvelope_RevokeInstallation - // *ClientEnvelope_IdentityUpdate - Payload isClientEnvelope_Payload `protobuf_oneof:"payload"` - Aad *AuthenticatedData `protobuf:"bytes,6,opt,name=aad,proto3" json:"aad,omitempty"` -} - -func (x *ClientEnvelope) Reset() { - *x = ClientEnvelope{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClientEnvelope) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientEnvelope) ProtoMessage() {} - -func (x *ClientEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_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 ClientEnvelope.ProtoReflect.Descriptor instead. -func (*ClientEnvelope) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{2} -} - -func (m *ClientEnvelope) GetPayload() isClientEnvelope_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (x *ClientEnvelope) GetGroupMessage() *v1.GroupMessageInput { - if x, ok := x.GetPayload().(*ClientEnvelope_GroupMessage); ok { - return x.GroupMessage - } - return nil -} - -func (x *ClientEnvelope) GetWelcomeMessage() *v1.WelcomeMessageInput { - if x, ok := x.GetPayload().(*ClientEnvelope_WelcomeMessage); ok { - return x.WelcomeMessage - } - return nil -} - -func (x *ClientEnvelope) GetRegisterInstallation() *v1.RegisterInstallationRequest { - if x, ok := x.GetPayload().(*ClientEnvelope_RegisterInstallation); ok { - return x.RegisterInstallation - } - return nil -} - -func (x *ClientEnvelope) GetUploadKeyPackage() *v1.UploadKeyPackageRequest { - if x, ok := x.GetPayload().(*ClientEnvelope_UploadKeyPackage); ok { - return x.UploadKeyPackage - } - return nil -} - -func (x *ClientEnvelope) GetRevokeInstallation() *v1.RevokeInstallationRequest { - if x, ok := x.GetPayload().(*ClientEnvelope_RevokeInstallation); ok { - return x.RevokeInstallation - } - return nil -} - -func (x *ClientEnvelope) GetIdentityUpdate() *associations.IdentityUpdate { - if x, ok := x.GetPayload().(*ClientEnvelope_IdentityUpdate); ok { - return x.IdentityUpdate - } - return nil -} - -func (x *ClientEnvelope) GetAad() *AuthenticatedData { - if x != nil { - return x.Aad - } - return nil -} - -type isClientEnvelope_Payload interface { - isClientEnvelope_Payload() -} - -type ClientEnvelope_GroupMessage struct { - GroupMessage *v1.GroupMessageInput `protobuf:"bytes,1,opt,name=group_message,json=groupMessage,proto3,oneof"` -} - -type ClientEnvelope_WelcomeMessage struct { - WelcomeMessage *v1.WelcomeMessageInput `protobuf:"bytes,2,opt,name=welcome_message,json=welcomeMessage,proto3,oneof"` -} - -type ClientEnvelope_RegisterInstallation struct { - RegisterInstallation *v1.RegisterInstallationRequest `protobuf:"bytes,3,opt,name=register_installation,json=registerInstallation,proto3,oneof"` -} - -type ClientEnvelope_UploadKeyPackage struct { - UploadKeyPackage *v1.UploadKeyPackageRequest `protobuf:"bytes,4,opt,name=upload_key_package,json=uploadKeyPackage,proto3,oneof"` -} - -type ClientEnvelope_RevokeInstallation struct { - RevokeInstallation *v1.RevokeInstallationRequest `protobuf:"bytes,5,opt,name=revoke_installation,json=revokeInstallation,proto3,oneof"` -} - -type ClientEnvelope_IdentityUpdate struct { - IdentityUpdate *associations.IdentityUpdate `protobuf:"bytes,7,opt,name=identity_update,json=identityUpdate,proto3,oneof"` -} - -func (*ClientEnvelope_GroupMessage) isClientEnvelope_Payload() {} - -func (*ClientEnvelope_WelcomeMessage) isClientEnvelope_Payload() {} - -func (*ClientEnvelope_RegisterInstallation) isClientEnvelope_Payload() {} - -func (*ClientEnvelope_UploadKeyPackage) isClientEnvelope_Payload() {} - -func (*ClientEnvelope_RevokeInstallation) isClientEnvelope_Payload() {} - -func (*ClientEnvelope_IdentityUpdate) isClientEnvelope_Payload() {} - -// Wraps client envelope with payer signature -type PayerEnvelope struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UnsignedClientEnvelope []byte `protobuf:"bytes,1,opt,name=unsigned_client_envelope,json=unsignedClientEnvelope,proto3" json:"unsigned_client_envelope,omitempty"` // Protobuf serialized - PayerSignature *associations.RecoverableEcdsaSignature `protobuf:"bytes,2,opt,name=payer_signature,json=payerSignature,proto3" json:"payer_signature,omitempty"` -} - -func (x *PayerEnvelope) Reset() { - *x = PayerEnvelope{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PayerEnvelope) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PayerEnvelope) ProtoMessage() {} - -func (x *PayerEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_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 PayerEnvelope.ProtoReflect.Descriptor instead. -func (*PayerEnvelope) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{3} -} - -func (x *PayerEnvelope) GetUnsignedClientEnvelope() []byte { - if x != nil { - return x.UnsignedClientEnvelope - } - return nil -} - -func (x *PayerEnvelope) GetPayerSignature() *associations.RecoverableEcdsaSignature { - if x != nil { - return x.PayerSignature - } - return nil -} - -// For blockchain envelopes, the originator_sid is set by the smart contract, -// but the originator_ns is set by the publishing node -type UnsignedOriginatorEnvelope struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OriginatorNodeId uint32 `protobuf:"varint,1,opt,name=originator_node_id,json=originatorNodeId,proto3" json:"originator_node_id,omitempty"` - OriginatorSequenceId uint64 `protobuf:"varint,2,opt,name=originator_sequence_id,json=originatorSequenceId,proto3" json:"originator_sequence_id,omitempty"` - OriginatorNs int64 `protobuf:"varint,3,opt,name=originator_ns,json=originatorNs,proto3" json:"originator_ns,omitempty"` - PayerEnvelope *PayerEnvelope `protobuf:"bytes,4,opt,name=payer_envelope,json=payerEnvelope,proto3" json:"payer_envelope,omitempty"` -} - -func (x *UnsignedOriginatorEnvelope) Reset() { - *x = UnsignedOriginatorEnvelope{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UnsignedOriginatorEnvelope) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UnsignedOriginatorEnvelope) ProtoMessage() {} - -func (x *UnsignedOriginatorEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_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 UnsignedOriginatorEnvelope.ProtoReflect.Descriptor instead. -func (*UnsignedOriginatorEnvelope) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{4} -} - -func (x *UnsignedOriginatorEnvelope) GetOriginatorNodeId() uint32 { - if x != nil { - return x.OriginatorNodeId - } - return 0 -} - -func (x *UnsignedOriginatorEnvelope) GetOriginatorSequenceId() uint64 { - if x != nil { - return x.OriginatorSequenceId - } - return 0 -} - -func (x *UnsignedOriginatorEnvelope) GetOriginatorNs() int64 { - if x != nil { - return x.OriginatorNs - } - return 0 -} - -func (x *UnsignedOriginatorEnvelope) GetPayerEnvelope() *PayerEnvelope { - if x != nil { - return x.PayerEnvelope - } - return nil -} - -// An alternative to a signature for blockchain payloads -type BlockchainProof struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BlockNumber uint64 `protobuf:"varint,1,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - PublisherNodeId uint32 `protobuf:"varint,2,opt,name=publisher_node_id,json=publisherNodeId,proto3" json:"publisher_node_id,omitempty"` -} - -func (x *BlockchainProof) Reset() { - *x = BlockchainProof{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BlockchainProof) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockchainProof) ProtoMessage() {} - -func (x *BlockchainProof) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_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 BlockchainProof.ProtoReflect.Descriptor instead. -func (*BlockchainProof) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{5} -} - -func (x *BlockchainProof) GetBlockNumber() uint64 { - if x != nil { - return x.BlockNumber - } - return 0 -} - -func (x *BlockchainProof) GetPublisherNodeId() uint32 { - if x != nil { - return x.PublisherNodeId - } - return 0 -} - -// Signed originator envelope -type OriginatorEnvelope struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UnsignedOriginatorEnvelope []byte `protobuf:"bytes,1,opt,name=unsigned_originator_envelope,json=unsignedOriginatorEnvelope,proto3" json:"unsigned_originator_envelope,omitempty"` // Protobuf serialized - // Types that are assignable to Proof: - // - // *OriginatorEnvelope_OriginatorSignature - // *OriginatorEnvelope_BlockchainProof - Proof isOriginatorEnvelope_Proof `protobuf_oneof:"proof"` -} - -func (x *OriginatorEnvelope) Reset() { - *x = OriginatorEnvelope{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *OriginatorEnvelope) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OriginatorEnvelope) ProtoMessage() {} - -func (x *OriginatorEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_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 OriginatorEnvelope.ProtoReflect.Descriptor instead. -func (*OriginatorEnvelope) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{6} -} - -func (x *OriginatorEnvelope) GetUnsignedOriginatorEnvelope() []byte { - if x != nil { - return x.UnsignedOriginatorEnvelope - } - return nil -} - -func (m *OriginatorEnvelope) GetProof() isOriginatorEnvelope_Proof { - if m != nil { - return m.Proof - } - return nil -} - -func (x *OriginatorEnvelope) GetOriginatorSignature() *associations.RecoverableEcdsaSignature { - if x, ok := x.GetProof().(*OriginatorEnvelope_OriginatorSignature); ok { - return x.OriginatorSignature - } - return nil -} - -func (x *OriginatorEnvelope) GetBlockchainProof() *BlockchainProof { - if x, ok := x.GetProof().(*OriginatorEnvelope_BlockchainProof); ok { - return x.BlockchainProof - } - return nil -} - -type isOriginatorEnvelope_Proof interface { - isOriginatorEnvelope_Proof() -} - -type OriginatorEnvelope_OriginatorSignature struct { - OriginatorSignature *associations.RecoverableEcdsaSignature `protobuf:"bytes,2,opt,name=originator_signature,json=originatorSignature,proto3,oneof"` -} - -type OriginatorEnvelope_BlockchainProof struct { - BlockchainProof *BlockchainProof `protobuf:"bytes,3,opt,name=blockchain_proof,json=blockchainProof,proto3,oneof"` -} - -func (*OriginatorEnvelope_OriginatorSignature) isOriginatorEnvelope_Proof() {} - -func (*OriginatorEnvelope_BlockchainProof) isOriginatorEnvelope_Proof() {} - // Reports node misbehavior, submittable by nodes or by clients type MisbehaviorReport struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Type Misbehavior `protobuf:"varint,1,opt,name=type,proto3,enum=xmtp.xmtpv4.Misbehavior" json:"type,omitempty"` - Envelopes []*OriginatorEnvelope `protobuf:"bytes,2,rep,name=envelopes,proto3" json:"envelopes,omitempty"` + Type Misbehavior `protobuf:"varint,1,opt,name=type,proto3,enum=xmtp.xmtpv4.message_api.Misbehavior" json:"type,omitempty"` + Envelopes []*envelopes.OriginatorEnvelope `protobuf:"bytes,2,rep,name=envelopes,proto3" json:"envelopes,omitempty"` } func (x *MisbehaviorReport) Reset() { *x = MisbehaviorReport{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[7] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -624,7 +104,7 @@ func (x *MisbehaviorReport) String() string { func (*MisbehaviorReport) ProtoMessage() {} func (x *MisbehaviorReport) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[7] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -637,7 +117,7 @@ func (x *MisbehaviorReport) ProtoReflect() protoreflect.Message { // Deprecated: Use MisbehaviorReport.ProtoReflect.Descriptor instead. func (*MisbehaviorReport) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{7} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{0} } func (x *MisbehaviorReport) GetType() Misbehavior { @@ -647,7 +127,7 @@ func (x *MisbehaviorReport) GetType() Misbehavior { return Misbehavior_MISBEHAVIOR_UNSPECIFIED } -func (x *MisbehaviorReport) GetEnvelopes() []*OriginatorEnvelope { +func (x *MisbehaviorReport) GetEnvelopes() []*envelopes.OriginatorEnvelope { if x != nil { return x.Envelopes } @@ -664,13 +144,13 @@ type EnvelopesQuery struct { // Client queries Topics [][]byte `protobuf:"bytes,1,rep,name=topics,proto3" json:"topics,omitempty"` // Node queries - OriginatorNodeIds []uint32 `protobuf:"varint,2,rep,packed,name=originator_node_ids,json=originatorNodeIds,proto3" json:"originator_node_ids,omitempty"` - LastSeen *VectorClock `protobuf:"bytes,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` + OriginatorNodeIds []uint32 `protobuf:"varint,2,rep,packed,name=originator_node_ids,json=originatorNodeIds,proto3" json:"originator_node_ids,omitempty"` + LastSeen *envelopes.VectorClock `protobuf:"bytes,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` } func (x *EnvelopesQuery) Reset() { *x = EnvelopesQuery{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[8] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -682,7 +162,7 @@ func (x *EnvelopesQuery) String() string { func (*EnvelopesQuery) ProtoMessage() {} func (x *EnvelopesQuery) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[8] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -695,7 +175,7 @@ func (x *EnvelopesQuery) ProtoReflect() protoreflect.Message { // Deprecated: Use EnvelopesQuery.ProtoReflect.Descriptor instead. func (*EnvelopesQuery) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{8} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{1} } func (x *EnvelopesQuery) GetTopics() [][]byte { @@ -712,7 +192,7 @@ func (x *EnvelopesQuery) GetOriginatorNodeIds() []uint32 { return nil } -func (x *EnvelopesQuery) GetLastSeen() *VectorClock { +func (x *EnvelopesQuery) GetLastSeen() *envelopes.VectorClock { if x != nil { return x.LastSeen } @@ -730,7 +210,7 @@ type SubscribeEnvelopesRequest struct { func (x *SubscribeEnvelopesRequest) Reset() { *x = SubscribeEnvelopesRequest{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[9] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -742,7 +222,7 @@ func (x *SubscribeEnvelopesRequest) String() string { func (*SubscribeEnvelopesRequest) ProtoMessage() {} func (x *SubscribeEnvelopesRequest) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[9] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -755,7 +235,7 @@ func (x *SubscribeEnvelopesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeEnvelopesRequest.ProtoReflect.Descriptor instead. func (*SubscribeEnvelopesRequest) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{9} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{2} } func (x *SubscribeEnvelopesRequest) GetQuery() *EnvelopesQuery { @@ -771,12 +251,12 @@ type SubscribeEnvelopesResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Envelopes []*OriginatorEnvelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` + Envelopes []*envelopes.OriginatorEnvelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` } func (x *SubscribeEnvelopesResponse) Reset() { *x = SubscribeEnvelopesResponse{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[10] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -788,7 +268,7 @@ func (x *SubscribeEnvelopesResponse) String() string { func (*SubscribeEnvelopesResponse) ProtoMessage() {} func (x *SubscribeEnvelopesResponse) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[10] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -801,10 +281,10 @@ func (x *SubscribeEnvelopesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeEnvelopesResponse.ProtoReflect.Descriptor instead. func (*SubscribeEnvelopesResponse) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{10} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{3} } -func (x *SubscribeEnvelopesResponse) GetEnvelopes() []*OriginatorEnvelope { +func (x *SubscribeEnvelopesResponse) GetEnvelopes() []*envelopes.OriginatorEnvelope { if x != nil { return x.Envelopes } @@ -823,7 +303,7 @@ type QueryEnvelopesRequest struct { func (x *QueryEnvelopesRequest) Reset() { *x = QueryEnvelopesRequest{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[11] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -835,7 +315,7 @@ func (x *QueryEnvelopesRequest) String() string { func (*QueryEnvelopesRequest) ProtoMessage() {} func (x *QueryEnvelopesRequest) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[11] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -848,7 +328,7 @@ func (x *QueryEnvelopesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryEnvelopesRequest.ProtoReflect.Descriptor instead. func (*QueryEnvelopesRequest) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{11} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{4} } func (x *QueryEnvelopesRequest) GetQuery() *EnvelopesQuery { @@ -871,12 +351,12 @@ type QueryEnvelopesResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Envelopes []*OriginatorEnvelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` + Envelopes []*envelopes.OriginatorEnvelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` } func (x *QueryEnvelopesResponse) Reset() { *x = QueryEnvelopesResponse{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[12] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -888,7 +368,7 @@ func (x *QueryEnvelopesResponse) String() string { func (*QueryEnvelopesResponse) ProtoMessage() {} func (x *QueryEnvelopesResponse) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[12] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -901,39 +381,39 @@ func (x *QueryEnvelopesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryEnvelopesResponse.ProtoReflect.Descriptor instead. func (*QueryEnvelopesResponse) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{12} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{5} } -func (x *QueryEnvelopesResponse) GetEnvelopes() []*OriginatorEnvelope { +func (x *QueryEnvelopesResponse) GetEnvelopes() []*envelopes.OriginatorEnvelope { if x != nil { return x.Envelopes } return nil } -type PublishEnvelopesRequest struct { +type PublishPayerEnvelopesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PayerEnvelopes []*PayerEnvelope `protobuf:"bytes,1,rep,name=payer_envelopes,json=payerEnvelopes,proto3" json:"payer_envelopes,omitempty"` + PayerEnvelopes []*envelopes.PayerEnvelope `protobuf:"bytes,1,rep,name=payer_envelopes,json=payerEnvelopes,proto3" json:"payer_envelopes,omitempty"` } -func (x *PublishEnvelopesRequest) Reset() { - *x = PublishEnvelopesRequest{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[13] +func (x *PublishPayerEnvelopesRequest) Reset() { + *x = PublishPayerEnvelopesRequest{} + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PublishEnvelopesRequest) String() string { +func (x *PublishPayerEnvelopesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PublishEnvelopesRequest) ProtoMessage() {} +func (*PublishPayerEnvelopesRequest) ProtoMessage() {} -func (x *PublishEnvelopesRequest) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[13] +func (x *PublishPayerEnvelopesRequest) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -944,41 +424,41 @@ func (x *PublishEnvelopesRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PublishEnvelopesRequest.ProtoReflect.Descriptor instead. -func (*PublishEnvelopesRequest) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{13} +// Deprecated: Use PublishPayerEnvelopesRequest.ProtoReflect.Descriptor instead. +func (*PublishPayerEnvelopesRequest) Descriptor() ([]byte, []int) { + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{6} } -func (x *PublishEnvelopesRequest) GetPayerEnvelopes() []*PayerEnvelope { +func (x *PublishPayerEnvelopesRequest) GetPayerEnvelopes() []*envelopes.PayerEnvelope { if x != nil { return x.PayerEnvelopes } return nil } -type PublishEnvelopesResponse struct { +type PublishPayerEnvelopesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OriginatorEnvelopes []*OriginatorEnvelope `protobuf:"bytes,1,rep,name=originator_envelopes,json=originatorEnvelopes,proto3" json:"originator_envelopes,omitempty"` + OriginatorEnvelopes []*envelopes.OriginatorEnvelope `protobuf:"bytes,1,rep,name=originator_envelopes,json=originatorEnvelopes,proto3" json:"originator_envelopes,omitempty"` } -func (x *PublishEnvelopesResponse) Reset() { - *x = PublishEnvelopesResponse{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[14] +func (x *PublishPayerEnvelopesResponse) Reset() { + *x = PublishPayerEnvelopesResponse{} + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *PublishEnvelopesResponse) String() string { +func (x *PublishPayerEnvelopesResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PublishEnvelopesResponse) ProtoMessage() {} +func (*PublishPayerEnvelopesResponse) ProtoMessage() {} -func (x *PublishEnvelopesResponse) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[14] +func (x *PublishPayerEnvelopesResponse) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -989,12 +469,12 @@ func (x *PublishEnvelopesResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PublishEnvelopesResponse.ProtoReflect.Descriptor instead. -func (*PublishEnvelopesResponse) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{14} +// Deprecated: Use PublishPayerEnvelopesResponse.ProtoReflect.Descriptor instead. +func (*PublishPayerEnvelopesResponse) Descriptor() ([]byte, []int) { + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{7} } -func (x *PublishEnvelopesResponse) GetOriginatorEnvelopes() []*OriginatorEnvelope { +func (x *PublishPayerEnvelopesResponse) GetOriginatorEnvelopes() []*envelopes.OriginatorEnvelope { if x != nil { return x.OriginatorEnvelopes } @@ -1012,7 +492,7 @@ type GetInboxIdsRequest struct { func (x *GetInboxIdsRequest) Reset() { *x = GetInboxIdsRequest{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[15] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1024,7 +504,7 @@ func (x *GetInboxIdsRequest) String() string { func (*GetInboxIdsRequest) ProtoMessage() {} func (x *GetInboxIdsRequest) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[15] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1037,7 +517,7 @@ func (x *GetInboxIdsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInboxIdsRequest.ProtoReflect.Descriptor instead. func (*GetInboxIdsRequest) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{15} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{8} } func (x *GetInboxIdsRequest) GetRequests() []*GetInboxIdsRequest_Request { @@ -1058,7 +538,7 @@ type GetInboxIdsResponse struct { func (x *GetInboxIdsResponse) Reset() { *x = GetInboxIdsResponse{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[16] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1070,7 +550,7 @@ func (x *GetInboxIdsResponse) String() string { func (*GetInboxIdsResponse) ProtoMessage() {} func (x *GetInboxIdsResponse) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[16] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1083,7 +563,7 @@ func (x *GetInboxIdsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInboxIdsResponse.ProtoReflect.Descriptor instead. func (*GetInboxIdsResponse) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{16} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{9} } func (x *GetInboxIdsResponse) GetResponses() []*GetInboxIdsResponse_Response { @@ -1104,7 +584,7 @@ type GetInboxIdsRequest_Request struct { func (x *GetInboxIdsRequest_Request) Reset() { *x = GetInboxIdsRequest_Request{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[18] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1116,7 +596,7 @@ func (x *GetInboxIdsRequest_Request) String() string { func (*GetInboxIdsRequest_Request) ProtoMessage() {} func (x *GetInboxIdsRequest_Request) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[18] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1129,7 +609,7 @@ func (x *GetInboxIdsRequest_Request) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInboxIdsRequest_Request.ProtoReflect.Descriptor instead. func (*GetInboxIdsRequest_Request) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{15, 0} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{8, 0} } func (x *GetInboxIdsRequest_Request) GetAddress() string { @@ -1151,7 +631,7 @@ type GetInboxIdsResponse_Response struct { func (x *GetInboxIdsResponse_Response) Reset() { *x = GetInboxIdsResponse_Response{} - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[19] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1163,7 +643,7 @@ func (x *GetInboxIdsResponse_Response) String() string { func (*GetInboxIdsResponse_Response) ProtoMessage() {} func (x *GetInboxIdsResponse_Response) ProtoReflect() protoreflect.Message { - mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[19] + mi := &file_xmtpv4_message_api_message_api_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1176,7 +656,7 @@ func (x *GetInboxIdsResponse_Response) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInboxIdsResponse_Response.ProtoReflect.Descriptor instead. func (*GetInboxIdsResponse_Response) Descriptor() ([]byte, []int) { - return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{16, 0} + return file_xmtpv4_message_api_message_api_proto_rawDescGZIP(), []int{9, 0} } func (x *GetInboxIdsResponse_Response) GetAddress() string { @@ -1198,255 +678,162 @@ var File_xmtpv4_message_api_message_api_proto protoreflect.FileDescriptor var file_xmtpv4_message_api_message_api_proto_rawDesc = []byte{ 0x0a, 0x24, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x76, 0x34, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x27, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2f, 0x61, 0x73, 0x73, 0x6f, - 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x2f, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x14, 0x6d, 0x6c, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6c, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x01, 0x0a, 0x0b, 0x56, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x64, 0x0a, 0x16, 0x6e, 0x6f, 0x64, 0x65, 0x5f, - 0x69, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x49, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x6e, 0x6f, 0x64, 0x65, 0x49, - 0x64, 0x54, 0x6f, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x1a, 0x45, 0x0a, - 0x17, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x49, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9a, 0x01, 0x0a, 0x11, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, - 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x56, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, - 0x6e, 0x22, 0xde, 0x04, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x49, 0x0a, 0x0d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, - 0x00, 0x52, 0x0c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x4f, 0x0a, 0x0f, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x6c, 0x63, 0x6f, - 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x00, - 0x52, 0x0e, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x63, 0x0a, 0x15, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, - 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x12, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, - 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x75, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, - 0x5d, 0x0a, 0x13, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x2e, 0x6d, 0x6c, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x12, 0x72, 0x65, 0x76, 0x6f, - 0x6b, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x55, - 0x0a, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x69, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x03, 0x61, 0x61, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, - 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x52, 0x03, 0x61, 0x61, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x16, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x5e, - 0x0a, 0x0f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x69, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, - 0x45, 0x63, 0x64, 0x73, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0e, - 0x70, 0x61, 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe8, - 0x01, 0x0a, 0x1a, 0x55, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x2c, 0x0a, - 0x12, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x6f, 0x64, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, - 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, - 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x73, 0x12, 0x41, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, - 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x50, 0x61, 0x79, - 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x65, - 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x60, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x0a, 0x0c, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, - 0x2a, 0x0a, 0x11, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x64, - 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x96, 0x02, 0x0a, 0x12, - 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, - 0x70, 0x65, 0x12, 0x40, 0x0a, 0x1c, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x6a, 0x0a, 0x14, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x2e, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x63, 0x64, 0x73, 0x61, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x00, 0x52, 0x13, 0x6f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x12, 0x49, 0x0a, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x48, 0x00, 0x52, 0x0f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x07, 0x0a, 0x05, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x80, 0x01, 0x0a, 0x11, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, - 0x76, 0x69, 0x6f, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, - 0x6f, 0x72, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x76, 0x34, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x78, + 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2f, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x96, 0x01, 0x0a, 0x11, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, + 0x34, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x69, + 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x47, 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, + 0x2e, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, + 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x0e, 0x45, 0x6e, 0x76, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x74, + 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x6f, 0x70, + 0x69, 0x63, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, + 0x72, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, + 0x52, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x6f, 0x64, 0x65, + 0x49, 0x64, 0x73, 0x12, 0x3f, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x56, + 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, + 0x53, 0x65, 0x65, 0x6e, 0x22, 0x5a, 0x0a, 0x19, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3d, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, + 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x22, 0x65, 0x0a, 0x1a, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, + 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x0e, 0x45, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, - 0x70, 0x69, 0x63, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, - 0x63, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, - 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x49, - 0x64, 0x73, 0x12, 0x35, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x76, 0x34, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x08, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x22, 0x4e, 0x0a, 0x19, 0x53, 0x75, 0x62, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x6c, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x3d, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x61, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x47, 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, + 0x2e, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, + 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x1c, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0f, 0x70, 0x61, 0x79, 0x65, + 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, + 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x7d, 0x0a, 0x1d, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x14, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x4f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x65, 0x52, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, + 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, + 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, + 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x23, + 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, + 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x09, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, + 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, + 0x1a, 0x51, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x08, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x69, 0x6e, 0x62, 0x6f, + 0x78, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x69, 0x6e, 0x62, 0x6f, 0x78, + 0x5f, 0x69, 0x64, 0x2a, 0xce, 0x01, 0x0a, 0x0b, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, + 0x69, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, + 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x20, 0x0a, 0x1c, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, 0x5f, + 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, + 0x10, 0x01, 0x12, 0x2b, 0x0a, 0x27, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, + 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x4f, + 0x52, 0x49, 0x47, 0x49, 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x44, 0x10, 0x02, 0x12, + 0x28, 0x0a, 0x24, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, 0x5f, 0x44, + 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, 0x41, + 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x44, 0x10, 0x03, 0x12, 0x29, 0x0a, 0x25, 0x4d, 0x49, 0x53, + 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, 0x5f, 0x43, 0x59, 0x43, 0x4c, 0x49, 0x43, 0x41, + 0x4c, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x49, + 0x4e, 0x47, 0x10, 0x04, 0x32, 0x94, 0x05, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x70, 0x69, 0x12, 0xa7, 0x01, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x32, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x76, 0x34, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x5b, 0x0a, 0x1a, 0x53, 0x75, 0x62, - 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, - 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, 0x6e, 0x76, - 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, 0x60, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, - 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x31, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x45, 0x6e, 0x76, - 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x57, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, - 0x73, 0x22, 0x5e, 0x0a, 0x17, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0f, - 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x76, 0x34, 0x2e, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, - 0x65, 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, - 0x73, 0x22, 0x6e, 0x0a, 0x18, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, - 0x14, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x65, 0x6e, 0x76, 0x65, - 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x6d, - 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x13, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, - 0x73, 0x22, 0x7e, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, - 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, - 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x1a, 0x23, 0x0a, 0x07, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x09, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, - 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x1a, 0x51, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x08, 0x69, 0x6e, 0x62, 0x6f, - 0x78, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x69, 0x6e, - 0x62, 0x6f, 0x78, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x69, 0x6e, 0x62, - 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x2a, 0xce, 0x01, 0x0a, 0x0b, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, - 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, - 0x56, 0x49, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, - 0x52, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x4e, 0x4f, - 0x44, 0x45, 0x10, 0x01, 0x12, 0x2b, 0x0a, 0x27, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, - 0x49, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x4f, 0x52, 0x44, 0x45, 0x52, - 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x44, 0x10, - 0x02, 0x12, 0x28, 0x0a, 0x24, 0x4d, 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, - 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x4f, 0x52, 0x49, 0x47, 0x49, - 0x4e, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x53, 0x49, 0x44, 0x10, 0x03, 0x12, 0x29, 0x0a, 0x25, 0x4d, - 0x49, 0x53, 0x42, 0x45, 0x48, 0x41, 0x56, 0x49, 0x4f, 0x52, 0x5f, 0x43, 0x59, 0x43, 0x4c, 0x49, - 0x43, 0x41, 0x4c, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x4f, 0x52, 0x44, 0x45, - 0x52, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x32, 0x9d, 0x04, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x70, 0x69, 0x12, 0x8f, 0x01, 0x0a, 0x12, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, - 0x12, 0x26, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, - 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, - 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, - 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, - 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x30, 0x01, 0x12, 0x7d, 0x0a, 0x0e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x22, 0x2e, - 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x23, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, - 0x2a, 0x22, 0x17, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2d, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x10, 0x50, - 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, - 0x24, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, - 0x70, 0x76, 0x34, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, - 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2d, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, - 0x65, 0x73, 0x12, 0x72, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, - 0x73, 0x12, 0x1f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, - 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, - 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, - 0x15, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x69, 0x6e, 0x62, - 0x6f, 0x78, 0x2d, 0x69, 0x64, 0x73, 0x42, 0xa3, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, - 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x42, 0x0f, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, - 0x6d, 0x74, 0x70, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x78, - 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, - 0x69, 0xa2, 0x02, 0x03, 0x58, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x58, - 0x6d, 0x74, 0x70, 0x76, 0x34, 0xca, 0x02, 0x0b, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, - 0x70, 0x76, 0x34, 0xe2, 0x02, 0x17, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, - 0x34, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, - 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, + 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x2d, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x30, + 0x01, 0x12, 0x95, 0x01, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, + 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2e, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x76, 0x34, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, + 0x76, 0x34, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, + 0x22, 0x17, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2d, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x15, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, + 0x34, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x50, 0x61, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x78, 0x6d, 0x74, + 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x50, 0x61, 0x79, 0x65, + 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, + 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2d, 0x70, + 0x61, 0x79, 0x65, 0x72, 0x2d, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x8a, + 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x73, 0x12, 0x2b, + 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, + 0x78, 0x49, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x78, 0x6d, + 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x49, 0x64, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x67, 0x65, + 0x74, 0x2d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2d, 0x69, 0x64, 0x73, 0x42, 0xdc, 0x01, 0x0a, 0x1b, + 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x42, 0x0f, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, + 0x78, 0x6d, 0x74, 0x70, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x61, + 0x70, 0x69, 0xa2, 0x02, 0x03, 0x58, 0x58, 0x4d, 0xaa, 0x02, 0x16, 0x58, 0x6d, 0x74, 0x70, 0x2e, + 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, + 0x69, 0xca, 0x02, 0x16, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x5c, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0xe2, 0x02, 0x22, 0x58, 0x6d, 0x74, + 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x5c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x41, 0x70, 0x69, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x18, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x3a, 0x3a, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1462,75 +849,50 @@ func file_xmtpv4_message_api_message_api_proto_rawDescGZIP() []byte { } var file_xmtpv4_message_api_message_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_xmtpv4_message_api_message_api_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_xmtpv4_message_api_message_api_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_xmtpv4_message_api_message_api_proto_goTypes = []any{ - (Misbehavior)(0), // 0: xmtp.xmtpv4.Misbehavior - (*VectorClock)(nil), // 1: xmtp.xmtpv4.VectorClock - (*AuthenticatedData)(nil), // 2: xmtp.xmtpv4.AuthenticatedData - (*ClientEnvelope)(nil), // 3: xmtp.xmtpv4.ClientEnvelope - (*PayerEnvelope)(nil), // 4: xmtp.xmtpv4.PayerEnvelope - (*UnsignedOriginatorEnvelope)(nil), // 5: xmtp.xmtpv4.UnsignedOriginatorEnvelope - (*BlockchainProof)(nil), // 6: xmtp.xmtpv4.BlockchainProof - (*OriginatorEnvelope)(nil), // 7: xmtp.xmtpv4.OriginatorEnvelope - (*MisbehaviorReport)(nil), // 8: xmtp.xmtpv4.MisbehaviorReport - (*EnvelopesQuery)(nil), // 9: xmtp.xmtpv4.EnvelopesQuery - (*SubscribeEnvelopesRequest)(nil), // 10: xmtp.xmtpv4.SubscribeEnvelopesRequest - (*SubscribeEnvelopesResponse)(nil), // 11: xmtp.xmtpv4.SubscribeEnvelopesResponse - (*QueryEnvelopesRequest)(nil), // 12: xmtp.xmtpv4.QueryEnvelopesRequest - (*QueryEnvelopesResponse)(nil), // 13: xmtp.xmtpv4.QueryEnvelopesResponse - (*PublishEnvelopesRequest)(nil), // 14: xmtp.xmtpv4.PublishEnvelopesRequest - (*PublishEnvelopesResponse)(nil), // 15: xmtp.xmtpv4.PublishEnvelopesResponse - (*GetInboxIdsRequest)(nil), // 16: xmtp.xmtpv4.GetInboxIdsRequest - (*GetInboxIdsResponse)(nil), // 17: xmtp.xmtpv4.GetInboxIdsResponse - nil, // 18: xmtp.xmtpv4.VectorClock.NodeIdToSequenceIdEntry - (*GetInboxIdsRequest_Request)(nil), // 19: xmtp.xmtpv4.GetInboxIdsRequest.Request - (*GetInboxIdsResponse_Response)(nil), // 20: xmtp.xmtpv4.GetInboxIdsResponse.Response - (*v1.GroupMessageInput)(nil), // 21: xmtp.mls.api.v1.GroupMessageInput - (*v1.WelcomeMessageInput)(nil), // 22: xmtp.mls.api.v1.WelcomeMessageInput - (*v1.RegisterInstallationRequest)(nil), // 23: xmtp.mls.api.v1.RegisterInstallationRequest - (*v1.UploadKeyPackageRequest)(nil), // 24: xmtp.mls.api.v1.UploadKeyPackageRequest - (*v1.RevokeInstallationRequest)(nil), // 25: xmtp.mls.api.v1.RevokeInstallationRequest - (*associations.IdentityUpdate)(nil), // 26: xmtp.identity.associations.IdentityUpdate - (*associations.RecoverableEcdsaSignature)(nil), // 27: xmtp.identity.associations.RecoverableEcdsaSignature + (Misbehavior)(0), // 0: xmtp.xmtpv4.message_api.Misbehavior + (*MisbehaviorReport)(nil), // 1: xmtp.xmtpv4.message_api.MisbehaviorReport + (*EnvelopesQuery)(nil), // 2: xmtp.xmtpv4.message_api.EnvelopesQuery + (*SubscribeEnvelopesRequest)(nil), // 3: xmtp.xmtpv4.message_api.SubscribeEnvelopesRequest + (*SubscribeEnvelopesResponse)(nil), // 4: xmtp.xmtpv4.message_api.SubscribeEnvelopesResponse + (*QueryEnvelopesRequest)(nil), // 5: xmtp.xmtpv4.message_api.QueryEnvelopesRequest + (*QueryEnvelopesResponse)(nil), // 6: xmtp.xmtpv4.message_api.QueryEnvelopesResponse + (*PublishPayerEnvelopesRequest)(nil), // 7: xmtp.xmtpv4.message_api.PublishPayerEnvelopesRequest + (*PublishPayerEnvelopesResponse)(nil), // 8: xmtp.xmtpv4.message_api.PublishPayerEnvelopesResponse + (*GetInboxIdsRequest)(nil), // 9: xmtp.xmtpv4.message_api.GetInboxIdsRequest + (*GetInboxIdsResponse)(nil), // 10: xmtp.xmtpv4.message_api.GetInboxIdsResponse + (*GetInboxIdsRequest_Request)(nil), // 11: xmtp.xmtpv4.message_api.GetInboxIdsRequest.Request + (*GetInboxIdsResponse_Response)(nil), // 12: xmtp.xmtpv4.message_api.GetInboxIdsResponse.Response + (*envelopes.OriginatorEnvelope)(nil), // 13: xmtp.xmtpv4.envelopes.OriginatorEnvelope + (*envelopes.VectorClock)(nil), // 14: xmtp.xmtpv4.envelopes.VectorClock + (*envelopes.PayerEnvelope)(nil), // 15: xmtp.xmtpv4.envelopes.PayerEnvelope } var file_xmtpv4_message_api_message_api_proto_depIdxs = []int32{ - 18, // 0: xmtp.xmtpv4.VectorClock.node_id_to_sequence_id:type_name -> xmtp.xmtpv4.VectorClock.NodeIdToSequenceIdEntry - 1, // 1: xmtp.xmtpv4.AuthenticatedData.last_seen:type_name -> xmtp.xmtpv4.VectorClock - 21, // 2: xmtp.xmtpv4.ClientEnvelope.group_message:type_name -> xmtp.mls.api.v1.GroupMessageInput - 22, // 3: xmtp.xmtpv4.ClientEnvelope.welcome_message:type_name -> xmtp.mls.api.v1.WelcomeMessageInput - 23, // 4: xmtp.xmtpv4.ClientEnvelope.register_installation:type_name -> xmtp.mls.api.v1.RegisterInstallationRequest - 24, // 5: xmtp.xmtpv4.ClientEnvelope.upload_key_package:type_name -> xmtp.mls.api.v1.UploadKeyPackageRequest - 25, // 6: xmtp.xmtpv4.ClientEnvelope.revoke_installation:type_name -> xmtp.mls.api.v1.RevokeInstallationRequest - 26, // 7: xmtp.xmtpv4.ClientEnvelope.identity_update:type_name -> xmtp.identity.associations.IdentityUpdate - 2, // 8: xmtp.xmtpv4.ClientEnvelope.aad:type_name -> xmtp.xmtpv4.AuthenticatedData - 27, // 9: xmtp.xmtpv4.PayerEnvelope.payer_signature:type_name -> xmtp.identity.associations.RecoverableEcdsaSignature - 4, // 10: xmtp.xmtpv4.UnsignedOriginatorEnvelope.payer_envelope:type_name -> xmtp.xmtpv4.PayerEnvelope - 27, // 11: xmtp.xmtpv4.OriginatorEnvelope.originator_signature:type_name -> xmtp.identity.associations.RecoverableEcdsaSignature - 6, // 12: xmtp.xmtpv4.OriginatorEnvelope.blockchain_proof:type_name -> xmtp.xmtpv4.BlockchainProof - 0, // 13: xmtp.xmtpv4.MisbehaviorReport.type:type_name -> xmtp.xmtpv4.Misbehavior - 7, // 14: xmtp.xmtpv4.MisbehaviorReport.envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope - 1, // 15: xmtp.xmtpv4.EnvelopesQuery.last_seen:type_name -> xmtp.xmtpv4.VectorClock - 9, // 16: xmtp.xmtpv4.SubscribeEnvelopesRequest.query:type_name -> xmtp.xmtpv4.EnvelopesQuery - 7, // 17: xmtp.xmtpv4.SubscribeEnvelopesResponse.envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope - 9, // 18: xmtp.xmtpv4.QueryEnvelopesRequest.query:type_name -> xmtp.xmtpv4.EnvelopesQuery - 7, // 19: xmtp.xmtpv4.QueryEnvelopesResponse.envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope - 4, // 20: xmtp.xmtpv4.PublishEnvelopesRequest.payer_envelopes:type_name -> xmtp.xmtpv4.PayerEnvelope - 7, // 21: xmtp.xmtpv4.PublishEnvelopesResponse.originator_envelopes:type_name -> xmtp.xmtpv4.OriginatorEnvelope - 19, // 22: xmtp.xmtpv4.GetInboxIdsRequest.requests:type_name -> xmtp.xmtpv4.GetInboxIdsRequest.Request - 20, // 23: xmtp.xmtpv4.GetInboxIdsResponse.responses:type_name -> xmtp.xmtpv4.GetInboxIdsResponse.Response - 10, // 24: xmtp.xmtpv4.ReplicationApi.SubscribeEnvelopes:input_type -> xmtp.xmtpv4.SubscribeEnvelopesRequest - 12, // 25: xmtp.xmtpv4.ReplicationApi.QueryEnvelopes:input_type -> xmtp.xmtpv4.QueryEnvelopesRequest - 14, // 26: xmtp.xmtpv4.ReplicationApi.PublishEnvelopes:input_type -> xmtp.xmtpv4.PublishEnvelopesRequest - 16, // 27: xmtp.xmtpv4.ReplicationApi.GetInboxIds:input_type -> xmtp.xmtpv4.GetInboxIdsRequest - 11, // 28: xmtp.xmtpv4.ReplicationApi.SubscribeEnvelopes:output_type -> xmtp.xmtpv4.SubscribeEnvelopesResponse - 13, // 29: xmtp.xmtpv4.ReplicationApi.QueryEnvelopes:output_type -> xmtp.xmtpv4.QueryEnvelopesResponse - 15, // 30: xmtp.xmtpv4.ReplicationApi.PublishEnvelopes:output_type -> xmtp.xmtpv4.PublishEnvelopesResponse - 17, // 31: xmtp.xmtpv4.ReplicationApi.GetInboxIds:output_type -> xmtp.xmtpv4.GetInboxIdsResponse - 28, // [28:32] is the sub-list for method output_type - 24, // [24:28] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 0, // 0: xmtp.xmtpv4.message_api.MisbehaviorReport.type:type_name -> xmtp.xmtpv4.message_api.Misbehavior + 13, // 1: xmtp.xmtpv4.message_api.MisbehaviorReport.envelopes:type_name -> xmtp.xmtpv4.envelopes.OriginatorEnvelope + 14, // 2: xmtp.xmtpv4.message_api.EnvelopesQuery.last_seen:type_name -> xmtp.xmtpv4.envelopes.VectorClock + 2, // 3: xmtp.xmtpv4.message_api.SubscribeEnvelopesRequest.query:type_name -> xmtp.xmtpv4.message_api.EnvelopesQuery + 13, // 4: xmtp.xmtpv4.message_api.SubscribeEnvelopesResponse.envelopes:type_name -> xmtp.xmtpv4.envelopes.OriginatorEnvelope + 2, // 5: xmtp.xmtpv4.message_api.QueryEnvelopesRequest.query:type_name -> xmtp.xmtpv4.message_api.EnvelopesQuery + 13, // 6: xmtp.xmtpv4.message_api.QueryEnvelopesResponse.envelopes:type_name -> xmtp.xmtpv4.envelopes.OriginatorEnvelope + 15, // 7: xmtp.xmtpv4.message_api.PublishPayerEnvelopesRequest.payer_envelopes:type_name -> xmtp.xmtpv4.envelopes.PayerEnvelope + 13, // 8: xmtp.xmtpv4.message_api.PublishPayerEnvelopesResponse.originator_envelopes:type_name -> xmtp.xmtpv4.envelopes.OriginatorEnvelope + 11, // 9: xmtp.xmtpv4.message_api.GetInboxIdsRequest.requests:type_name -> xmtp.xmtpv4.message_api.GetInboxIdsRequest.Request + 12, // 10: xmtp.xmtpv4.message_api.GetInboxIdsResponse.responses:type_name -> xmtp.xmtpv4.message_api.GetInboxIdsResponse.Response + 3, // 11: xmtp.xmtpv4.message_api.ReplicationApi.SubscribeEnvelopes:input_type -> xmtp.xmtpv4.message_api.SubscribeEnvelopesRequest + 5, // 12: xmtp.xmtpv4.message_api.ReplicationApi.QueryEnvelopes:input_type -> xmtp.xmtpv4.message_api.QueryEnvelopesRequest + 7, // 13: xmtp.xmtpv4.message_api.ReplicationApi.PublishPayerEnvelopes:input_type -> xmtp.xmtpv4.message_api.PublishPayerEnvelopesRequest + 9, // 14: xmtp.xmtpv4.message_api.ReplicationApi.GetInboxIds:input_type -> xmtp.xmtpv4.message_api.GetInboxIdsRequest + 4, // 15: xmtp.xmtpv4.message_api.ReplicationApi.SubscribeEnvelopes:output_type -> xmtp.xmtpv4.message_api.SubscribeEnvelopesResponse + 6, // 16: xmtp.xmtpv4.message_api.ReplicationApi.QueryEnvelopes:output_type -> xmtp.xmtpv4.message_api.QueryEnvelopesResponse + 8, // 17: xmtp.xmtpv4.message_api.ReplicationApi.PublishPayerEnvelopes:output_type -> xmtp.xmtpv4.message_api.PublishPayerEnvelopesResponse + 10, // 18: xmtp.xmtpv4.message_api.ReplicationApi.GetInboxIds:output_type -> xmtp.xmtpv4.message_api.GetInboxIdsResponse + 15, // [15:19] is the sub-list for method output_type + 11, // [11:15] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_xmtpv4_message_api_message_api_proto_init() } @@ -1538,26 +900,14 @@ func file_xmtpv4_message_api_message_api_proto_init() { if File_xmtpv4_message_api_message_api_proto != nil { return } - file_xmtpv4_message_api_message_api_proto_msgTypes[2].OneofWrappers = []any{ - (*ClientEnvelope_GroupMessage)(nil), - (*ClientEnvelope_WelcomeMessage)(nil), - (*ClientEnvelope_RegisterInstallation)(nil), - (*ClientEnvelope_UploadKeyPackage)(nil), - (*ClientEnvelope_RevokeInstallation)(nil), - (*ClientEnvelope_IdentityUpdate)(nil), - } - file_xmtpv4_message_api_message_api_proto_msgTypes[6].OneofWrappers = []any{ - (*OriginatorEnvelope_OriginatorSignature)(nil), - (*OriginatorEnvelope_BlockchainProof)(nil), - } - file_xmtpv4_message_api_message_api_proto_msgTypes[19].OneofWrappers = []any{} + file_xmtpv4_message_api_message_api_proto_msgTypes[11].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_xmtpv4_message_api_message_api_proto_rawDesc, NumEnums: 1, - NumMessages: 20, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/proto/xmtpv4/message_api/message_api.pb.gw.go b/pkg/proto/xmtpv4/message_api/message_api.pb.gw.go index d13a4214..4fecd3bc 100644 --- a/pkg/proto/xmtpv4/message_api/message_api.pb.gw.go +++ b/pkg/proto/xmtpv4/message_api/message_api.pb.gw.go @@ -78,28 +78,28 @@ func local_request_ReplicationApi_QueryEnvelopes_0(ctx context.Context, marshale } -func request_ReplicationApi_PublishEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, client ReplicationApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PublishEnvelopesRequest +func request_ReplicationApi_PublishPayerEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, client ReplicationApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PublishPayerEnvelopesRequest var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.PublishEnvelopes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.PublishPayerEnvelopes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ReplicationApi_PublishEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, server ReplicationApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PublishEnvelopesRequest +func local_request_ReplicationApi_PublishPayerEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, server ReplicationApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PublishPayerEnvelopesRequest var metadata runtime.ServerMetadata if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.PublishEnvelopes(ctx, &protoReq) + msg, err := server.PublishPayerEnvelopes(ctx, &protoReq) return msg, metadata, err } @@ -151,7 +151,7 @@ func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/QueryEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/query-envelopes")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.message_api.ReplicationApi/QueryEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/query-envelopes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -168,7 +168,7 @@ func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.Serve }) - mux.Handle("POST", pattern_ReplicationApi_PublishEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_ReplicationApi_PublishPayerEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -176,12 +176,12 @@ func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/PublishEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/publish-envelopes")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.message_api.ReplicationApi/PublishPayerEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/publish-payer-envelopes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ReplicationApi_PublishEnvelopes_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_ReplicationApi_PublishPayerEnvelopes_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -189,7 +189,7 @@ func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.Serve return } - forward_ReplicationApi_PublishEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ReplicationApi_PublishPayerEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -201,7 +201,7 @@ func RegisterReplicationApiHandlerServer(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/GetInboxIds", runtime.WithHTTPPathPattern("/mls/v2/get-inbox-ids")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.message_api.ReplicationApi/GetInboxIds", runtime.WithHTTPPathPattern("/mls/v2/get-inbox-ids")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -265,7 +265,7 @@ func RegisterReplicationApiHandlerClient(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/SubscribeEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/subscribe-envelopes")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.message_api.ReplicationApi/SubscribeEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/subscribe-envelopes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -287,7 +287,7 @@ func RegisterReplicationApiHandlerClient(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/QueryEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/query-envelopes")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.message_api.ReplicationApi/QueryEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/query-envelopes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -303,25 +303,25 @@ func RegisterReplicationApiHandlerClient(ctx context.Context, mux *runtime.Serve }) - mux.Handle("POST", pattern_ReplicationApi_PublishEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_ReplicationApi_PublishPayerEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/PublishEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/publish-envelopes")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.message_api.ReplicationApi/PublishPayerEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/publish-payer-envelopes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ReplicationApi_PublishEnvelopes_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_ReplicationApi_PublishPayerEnvelopes_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ReplicationApi_PublishEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ReplicationApi_PublishPayerEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -331,7 +331,7 @@ func RegisterReplicationApiHandlerClient(ctx context.Context, mux *runtime.Serve inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.ReplicationApi/GetInboxIds", runtime.WithHTTPPathPattern("/mls/v2/get-inbox-ids")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.message_api.ReplicationApi/GetInboxIds", runtime.WithHTTPPathPattern("/mls/v2/get-inbox-ids")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -355,7 +355,7 @@ var ( pattern_ReplicationApi_QueryEnvelopes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "query-envelopes"}, "")) - pattern_ReplicationApi_PublishEnvelopes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "publish-envelopes"}, "")) + pattern_ReplicationApi_PublishPayerEnvelopes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "publish-payer-envelopes"}, "")) pattern_ReplicationApi_GetInboxIds_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mls", "v2", "get-inbox-ids"}, "")) ) @@ -365,7 +365,7 @@ var ( forward_ReplicationApi_QueryEnvelopes_0 = runtime.ForwardResponseMessage - forward_ReplicationApi_PublishEnvelopes_0 = runtime.ForwardResponseMessage + forward_ReplicationApi_PublishPayerEnvelopes_0 = runtime.ForwardResponseMessage forward_ReplicationApi_GetInboxIds_0 = runtime.ForwardResponseMessage ) diff --git a/pkg/proto/xmtpv4/message_api/message_api_grpc.pb.go b/pkg/proto/xmtpv4/message_api/message_api_grpc.pb.go index 456f22d8..5b4e3316 100644 --- a/pkg/proto/xmtpv4/message_api/message_api_grpc.pb.go +++ b/pkg/proto/xmtpv4/message_api/message_api_grpc.pb.go @@ -21,10 +21,10 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ReplicationApi_SubscribeEnvelopes_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/SubscribeEnvelopes" - ReplicationApi_QueryEnvelopes_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/QueryEnvelopes" - ReplicationApi_PublishEnvelopes_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/PublishEnvelopes" - ReplicationApi_GetInboxIds_FullMethodName = "/xmtp.xmtpv4.ReplicationApi/GetInboxIds" + ReplicationApi_SubscribeEnvelopes_FullMethodName = "/xmtp.xmtpv4.message_api.ReplicationApi/SubscribeEnvelopes" + ReplicationApi_QueryEnvelopes_FullMethodName = "/xmtp.xmtpv4.message_api.ReplicationApi/QueryEnvelopes" + ReplicationApi_PublishPayerEnvelopes_FullMethodName = "/xmtp.xmtpv4.message_api.ReplicationApi/PublishPayerEnvelopes" + ReplicationApi_GetInboxIds_FullMethodName = "/xmtp.xmtpv4.message_api.ReplicationApi/GetInboxIds" ) // ReplicationApiClient is the client API for ReplicationApi service. @@ -36,7 +36,7 @@ type ReplicationApiClient interface { // Query envelopes QueryEnvelopes(ctx context.Context, in *QueryEnvelopesRequest, opts ...grpc.CallOption) (*QueryEnvelopesResponse, error) // Publish envelope - PublishEnvelopes(ctx context.Context, in *PublishEnvelopesRequest, opts ...grpc.CallOption) (*PublishEnvelopesResponse, error) + PublishPayerEnvelopes(ctx context.Context, in *PublishPayerEnvelopesRequest, opts ...grpc.CallOption) (*PublishPayerEnvelopesResponse, error) // Get inbox ids GetInboxIds(ctx context.Context, in *GetInboxIdsRequest, opts ...grpc.CallOption) (*GetInboxIdsResponse, error) } @@ -90,9 +90,9 @@ func (c *replicationApiClient) QueryEnvelopes(ctx context.Context, in *QueryEnve return out, nil } -func (c *replicationApiClient) PublishEnvelopes(ctx context.Context, in *PublishEnvelopesRequest, opts ...grpc.CallOption) (*PublishEnvelopesResponse, error) { - out := new(PublishEnvelopesResponse) - err := c.cc.Invoke(ctx, ReplicationApi_PublishEnvelopes_FullMethodName, in, out, opts...) +func (c *replicationApiClient) PublishPayerEnvelopes(ctx context.Context, in *PublishPayerEnvelopesRequest, opts ...grpc.CallOption) (*PublishPayerEnvelopesResponse, error) { + out := new(PublishPayerEnvelopesResponse) + err := c.cc.Invoke(ctx, ReplicationApi_PublishPayerEnvelopes_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -117,7 +117,7 @@ type ReplicationApiServer interface { // Query envelopes QueryEnvelopes(context.Context, *QueryEnvelopesRequest) (*QueryEnvelopesResponse, error) // Publish envelope - PublishEnvelopes(context.Context, *PublishEnvelopesRequest) (*PublishEnvelopesResponse, error) + PublishPayerEnvelopes(context.Context, *PublishPayerEnvelopesRequest) (*PublishPayerEnvelopesResponse, error) // Get inbox ids GetInboxIds(context.Context, *GetInboxIdsRequest) (*GetInboxIdsResponse, error) mustEmbedUnimplementedReplicationApiServer() @@ -133,8 +133,8 @@ func (UnimplementedReplicationApiServer) SubscribeEnvelopes(*SubscribeEnvelopesR func (UnimplementedReplicationApiServer) QueryEnvelopes(context.Context, *QueryEnvelopesRequest) (*QueryEnvelopesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryEnvelopes not implemented") } -func (UnimplementedReplicationApiServer) PublishEnvelopes(context.Context, *PublishEnvelopesRequest) (*PublishEnvelopesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PublishEnvelopes not implemented") +func (UnimplementedReplicationApiServer) PublishPayerEnvelopes(context.Context, *PublishPayerEnvelopesRequest) (*PublishPayerEnvelopesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PublishPayerEnvelopes not implemented") } func (UnimplementedReplicationApiServer) GetInboxIds(context.Context, *GetInboxIdsRequest) (*GetInboxIdsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInboxIds not implemented") @@ -191,20 +191,20 @@ func _ReplicationApi_QueryEnvelopes_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } -func _ReplicationApi_PublishEnvelopes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PublishEnvelopesRequest) +func _ReplicationApi_PublishPayerEnvelopes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PublishPayerEnvelopesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ReplicationApiServer).PublishEnvelopes(ctx, in) + return srv.(ReplicationApiServer).PublishPayerEnvelopes(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ReplicationApi_PublishEnvelopes_FullMethodName, + FullMethod: ReplicationApi_PublishPayerEnvelopes_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReplicationApiServer).PublishEnvelopes(ctx, req.(*PublishEnvelopesRequest)) + return srv.(ReplicationApiServer).PublishPayerEnvelopes(ctx, req.(*PublishPayerEnvelopesRequest)) } return interceptor(ctx, in, info, handler) } @@ -231,7 +231,7 @@ func _ReplicationApi_GetInboxIds_Handler(srv interface{}, ctx context.Context, d // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ReplicationApi_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "xmtp.xmtpv4.ReplicationApi", + ServiceName: "xmtp.xmtpv4.message_api.ReplicationApi", HandlerType: (*ReplicationApiServer)(nil), Methods: []grpc.MethodDesc{ { @@ -239,8 +239,8 @@ var ReplicationApi_ServiceDesc = grpc.ServiceDesc{ Handler: _ReplicationApi_QueryEnvelopes_Handler, }, { - MethodName: "PublishEnvelopes", - Handler: _ReplicationApi_PublishEnvelopes_Handler, + MethodName: "PublishPayerEnvelopes", + Handler: _ReplicationApi_PublishPayerEnvelopes_Handler, }, { MethodName: "GetInboxIds", diff --git a/pkg/proto/xmtpv4/payer_api/payer_api.pb.go b/pkg/proto/xmtpv4/payer_api/payer_api.pb.go new file mode 100644 index 00000000..a8abd215 --- /dev/null +++ b/pkg/proto/xmtpv4/payer_api/payer_api.pb.go @@ -0,0 +1,224 @@ +// Payer API + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc (unknown) +// source: xmtpv4/payer_api/payer_api.proto + +package payer_api + +import ( + envelopes "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +type PublishClientEnvelopesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Envelopes []*envelopes.ClientEnvelope `protobuf:"bytes,1,rep,name=envelopes,proto3" json:"envelopes,omitempty"` +} + +func (x *PublishClientEnvelopesRequest) Reset() { + *x = PublishClientEnvelopesRequest{} + mi := &file_xmtpv4_payer_api_payer_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PublishClientEnvelopesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublishClientEnvelopesRequest) ProtoMessage() {} + +func (x *PublishClientEnvelopesRequest) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_payer_api_payer_api_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 PublishClientEnvelopesRequest.ProtoReflect.Descriptor instead. +func (*PublishClientEnvelopesRequest) Descriptor() ([]byte, []int) { + return file_xmtpv4_payer_api_payer_api_proto_rawDescGZIP(), []int{0} +} + +func (x *PublishClientEnvelopesRequest) GetEnvelopes() []*envelopes.ClientEnvelope { + if x != nil { + return x.Envelopes + } + return nil +} + +type PublishClientEnvelopesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OriginatorEnvelopes []*envelopes.OriginatorEnvelope `protobuf:"bytes,1,rep,name=originator_envelopes,json=originatorEnvelopes,proto3" json:"originator_envelopes,omitempty"` +} + +func (x *PublishClientEnvelopesResponse) Reset() { + *x = PublishClientEnvelopesResponse{} + mi := &file_xmtpv4_payer_api_payer_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PublishClientEnvelopesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublishClientEnvelopesResponse) ProtoMessage() {} + +func (x *PublishClientEnvelopesResponse) ProtoReflect() protoreflect.Message { + mi := &file_xmtpv4_payer_api_payer_api_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 PublishClientEnvelopesResponse.ProtoReflect.Descriptor instead. +func (*PublishClientEnvelopesResponse) Descriptor() ([]byte, []int) { + return file_xmtpv4_payer_api_payer_api_proto_rawDescGZIP(), []int{1} +} + +func (x *PublishClientEnvelopesResponse) GetOriginatorEnvelopes() []*envelopes.OriginatorEnvelope { + if x != nil { + return x.OriginatorEnvelopes + } + return nil +} + +var File_xmtpv4_payer_api_payer_api_proto protoreflect.FileDescriptor + +var file_xmtpv4_payer_api_payer_api_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x61, + 0x70, 0x69, 0x2f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x15, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, + 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x64, 0x0a, 0x1d, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x09, 0x65, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x22, + 0x7e, 0x0a, 0x1e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5c, 0x0a, 0x14, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x65, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x13, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x32, + 0xc5, 0x01, 0x0a, 0x08, 0x50, 0x61, 0x79, 0x65, 0x72, 0x41, 0x70, 0x69, 0x12, 0xb8, 0x01, 0x0a, + 0x16, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x34, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, + 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x2e, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x70, 0x61, 0x79, 0x65, + 0x72, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, + 0x26, 0x2f, 0x6d, 0x6c, 0x73, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x2f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x73, 0x42, 0xce, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, + 0x78, 0x6d, 0x74, 0x70, 0x2e, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x70, 0x61, 0x79, 0x65, + 0x72, 0x5f, 0x61, 0x70, 0x69, 0x42, 0x0d, 0x50, 0x61, 0x79, 0x65, 0x72, 0x41, 0x70, 0x69, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x64, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x78, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2f, 0x70, + 0x61, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0xa2, 0x02, 0x03, 0x58, 0x58, 0x50, 0xaa, 0x02, + 0x14, 0x58, 0x6d, 0x74, 0x70, 0x2e, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x2e, 0x50, 0x61, 0x79, + 0x65, 0x72, 0x41, 0x70, 0x69, 0xca, 0x02, 0x14, 0x58, 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, + 0x70, 0x76, 0x34, 0x5c, 0x50, 0x61, 0x79, 0x65, 0x72, 0x41, 0x70, 0x69, 0xe2, 0x02, 0x20, 0x58, + 0x6d, 0x74, 0x70, 0x5c, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x5c, 0x50, 0x61, 0x79, 0x65, 0x72, + 0x41, 0x70, 0x69, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x16, 0x58, 0x6d, 0x74, 0x70, 0x3a, 0x3a, 0x58, 0x6d, 0x74, 0x70, 0x76, 0x34, 0x3a, 0x3a, + 0x50, 0x61, 0x79, 0x65, 0x72, 0x41, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_xmtpv4_payer_api_payer_api_proto_rawDescOnce sync.Once + file_xmtpv4_payer_api_payer_api_proto_rawDescData = file_xmtpv4_payer_api_payer_api_proto_rawDesc +) + +func file_xmtpv4_payer_api_payer_api_proto_rawDescGZIP() []byte { + file_xmtpv4_payer_api_payer_api_proto_rawDescOnce.Do(func() { + file_xmtpv4_payer_api_payer_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_xmtpv4_payer_api_payer_api_proto_rawDescData) + }) + return file_xmtpv4_payer_api_payer_api_proto_rawDescData +} + +var file_xmtpv4_payer_api_payer_api_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_xmtpv4_payer_api_payer_api_proto_goTypes = []any{ + (*PublishClientEnvelopesRequest)(nil), // 0: xmtp.xmtpv4.payer_api.PublishClientEnvelopesRequest + (*PublishClientEnvelopesResponse)(nil), // 1: xmtp.xmtpv4.payer_api.PublishClientEnvelopesResponse + (*envelopes.ClientEnvelope)(nil), // 2: xmtp.xmtpv4.envelopes.ClientEnvelope + (*envelopes.OriginatorEnvelope)(nil), // 3: xmtp.xmtpv4.envelopes.OriginatorEnvelope +} +var file_xmtpv4_payer_api_payer_api_proto_depIdxs = []int32{ + 2, // 0: xmtp.xmtpv4.payer_api.PublishClientEnvelopesRequest.envelopes:type_name -> xmtp.xmtpv4.envelopes.ClientEnvelope + 3, // 1: xmtp.xmtpv4.payer_api.PublishClientEnvelopesResponse.originator_envelopes:type_name -> xmtp.xmtpv4.envelopes.OriginatorEnvelope + 0, // 2: xmtp.xmtpv4.payer_api.PayerApi.PublishClientEnvelopes:input_type -> xmtp.xmtpv4.payer_api.PublishClientEnvelopesRequest + 1, // 3: xmtp.xmtpv4.payer_api.PayerApi.PublishClientEnvelopes:output_type -> xmtp.xmtpv4.payer_api.PublishClientEnvelopesResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_xmtpv4_payer_api_payer_api_proto_init() } +func file_xmtpv4_payer_api_payer_api_proto_init() { + if File_xmtpv4_payer_api_payer_api_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_xmtpv4_payer_api_payer_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_xmtpv4_payer_api_payer_api_proto_goTypes, + DependencyIndexes: file_xmtpv4_payer_api_payer_api_proto_depIdxs, + MessageInfos: file_xmtpv4_payer_api_payer_api_proto_msgTypes, + }.Build() + File_xmtpv4_payer_api_payer_api_proto = out.File + file_xmtpv4_payer_api_payer_api_proto_rawDesc = nil + file_xmtpv4_payer_api_payer_api_proto_goTypes = nil + file_xmtpv4_payer_api_payer_api_proto_depIdxs = nil +} diff --git a/pkg/proto/xmtpv4/payer_api/payer_api.pb.gw.go b/pkg/proto/xmtpv4/payer_api/payer_api.pb.gw.go new file mode 100644 index 00000000..cc4f2add --- /dev/null +++ b/pkg/proto/xmtpv4/payer_api/payer_api.pb.gw.go @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: xmtpv4/payer_api/payer_api.proto + +/* +Package payer_api is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package payer_api + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_PayerApi_PublishClientEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, client PayerApiClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PublishClientEnvelopesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.PublishClientEnvelopes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PayerApi_PublishClientEnvelopes_0(ctx context.Context, marshaler runtime.Marshaler, server PayerApiServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PublishClientEnvelopesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.PublishClientEnvelopes(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterPayerApiHandlerServer registers the http handlers for service PayerApi to "mux". +// UnaryRPC :call PayerApiServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPayerApiHandlerFromEndpoint instead. +func RegisterPayerApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PayerApiServer) error { + + mux.Handle("POST", pattern_PayerApi_PublishClientEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/xmtp.xmtpv4.payer_api.PayerApi/PublishClientEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/payer/publish-client-envelopes")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PayerApi_PublishClientEnvelopes_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_PayerApi_PublishClientEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterPayerApiHandlerFromEndpoint is same as RegisterPayerApiHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterPayerApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterPayerApiHandler(ctx, mux, conn) +} + +// RegisterPayerApiHandler registers the http handlers for service PayerApi to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterPayerApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterPayerApiHandlerClient(ctx, mux, NewPayerApiClient(conn)) +} + +// RegisterPayerApiHandlerClient registers the http handlers for service PayerApi +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PayerApiClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PayerApiClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "PayerApiClient" to call the correct interceptors. +func RegisterPayerApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PayerApiClient) error { + + mux.Handle("POST", pattern_PayerApi_PublishClientEnvelopes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/xmtp.xmtpv4.payer_api.PayerApi/PublishClientEnvelopes", runtime.WithHTTPPathPattern("/mls/v2/payer/publish-client-envelopes")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PayerApi_PublishClientEnvelopes_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_PayerApi_PublishClientEnvelopes_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_PayerApi_PublishClientEnvelopes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mls", "v2", "payer", "publish-client-envelopes"}, "")) +) + +var ( + forward_PayerApi_PublishClientEnvelopes_0 = runtime.ForwardResponseMessage +) diff --git a/pkg/proto/xmtpv4/payer_api/payer_api_grpc.pb.go b/pkg/proto/xmtpv4/payer_api/payer_api_grpc.pb.go new file mode 100644 index 00000000..dbc2c76f --- /dev/null +++ b/pkg/proto/xmtpv4/payer_api/payer_api_grpc.pb.go @@ -0,0 +1,113 @@ +// Payer API + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: xmtpv4/payer_api/payer_api.proto + +package payer_api + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + PayerApi_PublishClientEnvelopes_FullMethodName = "/xmtp.xmtpv4.payer_api.PayerApi/PublishClientEnvelopes" +) + +// PayerApiClient is the client API for PayerApi service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PayerApiClient interface { + // Publish envelope + PublishClientEnvelopes(ctx context.Context, in *PublishClientEnvelopesRequest, opts ...grpc.CallOption) (*PublishClientEnvelopesResponse, error) +} + +type payerApiClient struct { + cc grpc.ClientConnInterface +} + +func NewPayerApiClient(cc grpc.ClientConnInterface) PayerApiClient { + return &payerApiClient{cc} +} + +func (c *payerApiClient) PublishClientEnvelopes(ctx context.Context, in *PublishClientEnvelopesRequest, opts ...grpc.CallOption) (*PublishClientEnvelopesResponse, error) { + out := new(PublishClientEnvelopesResponse) + err := c.cc.Invoke(ctx, PayerApi_PublishClientEnvelopes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PayerApiServer is the server API for PayerApi service. +// All implementations must embed UnimplementedPayerApiServer +// for forward compatibility +type PayerApiServer interface { + // Publish envelope + PublishClientEnvelopes(context.Context, *PublishClientEnvelopesRequest) (*PublishClientEnvelopesResponse, error) + mustEmbedUnimplementedPayerApiServer() +} + +// UnimplementedPayerApiServer must be embedded to have forward compatible implementations. +type UnimplementedPayerApiServer struct { +} + +func (UnimplementedPayerApiServer) PublishClientEnvelopes(context.Context, *PublishClientEnvelopesRequest) (*PublishClientEnvelopesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PublishClientEnvelopes not implemented") +} +func (UnimplementedPayerApiServer) mustEmbedUnimplementedPayerApiServer() {} + +// UnsafePayerApiServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PayerApiServer will +// result in compilation errors. +type UnsafePayerApiServer interface { + mustEmbedUnimplementedPayerApiServer() +} + +func RegisterPayerApiServer(s grpc.ServiceRegistrar, srv PayerApiServer) { + s.RegisterService(&PayerApi_ServiceDesc, srv) +} + +func _PayerApi_PublishClientEnvelopes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PublishClientEnvelopesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PayerApiServer).PublishClientEnvelopes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PayerApi_PublishClientEnvelopes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PayerApiServer).PublishClientEnvelopes(ctx, req.(*PublishClientEnvelopesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// PayerApi_ServiceDesc is the grpc.ServiceDesc for PayerApi service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PayerApi_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "xmtp.xmtpv4.payer_api.PayerApi", + HandlerType: (*PayerApiServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PublishClientEnvelopes", + Handler: _PayerApi_PublishClientEnvelopes_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "xmtpv4/payer_api/payer_api.proto", +} diff --git a/pkg/registrant/registrant.go b/pkg/registrant/registrant.go index 5c3dae25..eb6f13a3 100644 --- a/pkg/registrant/registrant.go +++ b/pkg/registrant/registrant.go @@ -13,7 +13,7 @@ import ( "github.com/xmtp/xmtpd/pkg/authn" "github.com/xmtp/xmtpd/pkg/db/queries" "github.com/xmtp/xmtpd/pkg/proto/identity/associations" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/registry" "github.com/xmtp/xmtpd/pkg/utils" "google.golang.org/protobuf/proto" @@ -70,12 +70,12 @@ func (r *Registrant) TokenFactory() *authn.TokenFactory { func (r *Registrant) SignStagedEnvelope( stagedEnv queries.StagedOriginatorEnvelope, -) (*message_api.OriginatorEnvelope, error) { - payerEnv := &message_api.PayerEnvelope{} +) (*envelopes.OriginatorEnvelope, error) { + payerEnv := &envelopes.PayerEnvelope{} if err := proto.Unmarshal(stagedEnv.PayerEnvelope, payerEnv); err != nil { return nil, fmt.Errorf("Could not unmarshal payer envelope: %v", err) } - unsignedEnv := message_api.UnsignedOriginatorEnvelope{ + unsignedEnv := envelopes.UnsignedOriginatorEnvelope{ OriginatorNodeId: r.record.NodeID, OriginatorSequenceId: uint64(stagedEnv.ID), OriginatorNs: stagedEnv.OriginatorTime.UnixNano(), @@ -91,9 +91,9 @@ func (r *Registrant) SignStagedEnvelope( return nil, err } - signedEnv := message_api.OriginatorEnvelope{ + signedEnv := envelopes.OriginatorEnvelope{ UnsignedOriginatorEnvelope: unsignedBytes, - Proof: &message_api.OriginatorEnvelope_OriginatorSignature{ + Proof: &envelopes.OriginatorEnvelope_OriginatorSignature{ OriginatorSignature: &associations.RecoverableEcdsaSignature{ Bytes: sig, }, diff --git a/pkg/registrant/registrant_test.go b/pkg/registrant/registrant_test.go index 12232d59..76cd88a5 100644 --- a/pkg/registrant/registrant_test.go +++ b/pkg/registrant/registrant_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/xmtp/xmtpd/pkg/db/queries" mocks "github.com/xmtp/xmtpd/pkg/mocks/registry" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/registrant" "github.com/xmtp/xmtpd/pkg/registry" "github.com/xmtp/xmtpd/pkg/testutils" @@ -247,7 +247,7 @@ func TestSignStagedEnvelopeSuccess(t *testing.T) { deps, r, cleanup := setupWithRegistrant(t) defer cleanup() payerBytes, err := proto.Marshal( - &message_api.PayerEnvelope{UnsignedClientEnvelope: []byte{3}}, + &envelopes.PayerEnvelope{UnsignedClientEnvelope: []byte{3}}, ) require.NoError(t, err) @@ -270,7 +270,7 @@ func TestSignStagedEnvelopeSuccess(t *testing.T) { require.NoError(t, err) require.True(t, signingKey.Equal(&deps.privKey1.PublicKey)) - unsignedEnv := &message_api.UnsignedOriginatorEnvelope{} + unsignedEnv := &envelopes.UnsignedOriginatorEnvelope{} require.NoError(t, proto.Unmarshal(env.GetUnsignedOriginatorEnvelope(), unsignedEnv)) require.Equal(t, unsignedEnv.GetOriginatorNodeId(), uint32(1)) require.Equal(t, unsignedEnv.GetOriginatorSequenceId(), uint64(50)) diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index aede83f7..14f8ba46 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -14,6 +14,7 @@ import ( "github.com/xmtp/xmtpd/pkg/config" "github.com/xmtp/xmtpd/pkg/mocks/blockchain" mocks "github.com/xmtp/xmtpd/pkg/mocks/registry" + "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" r "github.com/xmtp/xmtpd/pkg/registry" s "github.com/xmtp/xmtpd/pkg/server" @@ -98,27 +99,33 @@ func TestCreateServer(t *testing.T) { targetTopic := topic.NewTopic(topic.TOPIC_KIND_GROUP_MESSAGES_V1, []byte{1, 2, 3}). Bytes() - p1, err := client1.PublishEnvelopes(ctx, &message_api.PublishEnvelopesRequest{ - PayerEnvelopes: []*message_api.PayerEnvelope{envelopeTestUtils.CreatePayerEnvelope( - t, - envelopeTestUtils.CreateClientEnvelope(&message_api.AuthenticatedData{ - TargetOriginator: server1NodeID, - TargetTopic: targetTopic, - LastSeen: &message_api.VectorClock{}, - }), - )}, - }) + p1, err := client1.PublishPayerEnvelopes( + ctx, + &message_api.PublishPayerEnvelopesRequest{ + PayerEnvelopes: []*envelopes.PayerEnvelope{envelopeTestUtils.CreatePayerEnvelope( + t, + envelopeTestUtils.CreateClientEnvelope(&envelopes.AuthenticatedData{ + TargetOriginator: server1NodeID, + TargetTopic: targetTopic, + LastSeen: &envelopes.VectorClock{}, + }), + )}, + }, + ) require.NoError(t, err) - p2, err := client2.PublishEnvelopes(ctx, &message_api.PublishEnvelopesRequest{ - PayerEnvelopes: []*message_api.PayerEnvelope{envelopeTestUtils.CreatePayerEnvelope( - t, - envelopeTestUtils.CreateClientEnvelope(&message_api.AuthenticatedData{ - TargetOriginator: server2NodeID, - TargetTopic: targetTopic, - LastSeen: &message_api.VectorClock{}, - }), - )}, - }) + p2, err := client2.PublishPayerEnvelopes( + ctx, + &message_api.PublishPayerEnvelopesRequest{ + PayerEnvelopes: []*envelopes.PayerEnvelope{envelopeTestUtils.CreatePayerEnvelope( + t, + envelopeTestUtils.CreateClientEnvelope(&envelopes.AuthenticatedData{ + TargetOriginator: server2NodeID, + TargetTopic: targetTopic, + LastSeen: &envelopes.VectorClock{}, + }), + )}, + }, + ) utils.Unused(p2) require.NoError(t, err) @@ -148,7 +155,7 @@ func TestCreateServer(t *testing.T) { q2, err := client2.QueryEnvelopes(ctx, &message_api.QueryEnvelopesRequest{ Query: &message_api.EnvelopesQuery{ OriginatorNodeIds: []uint32{server1NodeID}, - LastSeen: &message_api.VectorClock{}, + LastSeen: &envelopes.VectorClock{}, }, Limit: 10, }) diff --git a/pkg/sync/syncWorker.go b/pkg/sync/syncWorker.go index f0754efd..f16be134 100644 --- a/pkg/sync/syncWorker.go +++ b/pkg/sync/syncWorker.go @@ -9,6 +9,7 @@ import ( "github.com/xmtp/xmtpd/pkg/db/queries" clientInterceptors "github.com/xmtp/xmtpd/pkg/interceptors/client" + "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" "github.com/xmtp/xmtpd/pkg/registrant" "github.com/xmtp/xmtpd/pkg/registry" @@ -167,7 +168,7 @@ func (s *syncWorker) listenToStream( } } -func (s *syncWorker) insertEnvelope(env *message_api.OriginatorEnvelope) { +func (s *syncWorker) insertEnvelope(env *envelopes.OriginatorEnvelope) { s.log.Debug("Replication server received envelope", zap.Any("envelope", env)) // TODO(nm) Validation logic - share code with API service and publish worker originatorBytes, err := proto.Marshal(env) @@ -176,7 +177,7 @@ func (s *syncWorker) insertEnvelope(env *message_api.OriginatorEnvelope) { return } - unsignedEnvelope := &message_api.UnsignedOriginatorEnvelope{} + unsignedEnvelope := &envelopes.UnsignedOriginatorEnvelope{} err = proto.Unmarshal(env.GetUnsignedOriginatorEnvelope(), unsignedEnvelope) if err != nil { s.log.Error( @@ -186,7 +187,7 @@ func (s *syncWorker) insertEnvelope(env *message_api.OriginatorEnvelope) { return } - clientEnvelope := &message_api.ClientEnvelope{} + clientEnvelope := &envelopes.ClientEnvelope{} err = proto.Unmarshal( unsignedEnvelope.GetPayerEnvelope().GetUnsignedClientEnvelope(), clientEnvelope, diff --git a/pkg/testutils/envelopes/envelopes.go b/pkg/testutils/envelopes/envelopes.go index 138c08cc..9e96fdeb 100644 --- a/pkg/testutils/envelopes/envelopes.go +++ b/pkg/testutils/envelopes/envelopes.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" "github.com/xmtp/xmtpd/pkg/proto/identity/associations" - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + envelopes "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "github.com/xmtp/xmtpd/pkg/topic" "google.golang.org/protobuf/proto" ) @@ -13,8 +13,8 @@ import ( func UnmarshalUnsignedOriginatorEnvelope( t *testing.T, bytes []byte, -) *message_api.UnsignedOriginatorEnvelope { - unsignedOriginatorEnvelope := &message_api.UnsignedOriginatorEnvelope{} +) *envelopes.UnsignedOriginatorEnvelope { + unsignedOriginatorEnvelope := &envelopes.UnsignedOriginatorEnvelope{} err := proto.Unmarshal( bytes, unsignedOriginatorEnvelope, @@ -23,32 +23,32 @@ func UnmarshalUnsignedOriginatorEnvelope( return unsignedOriginatorEnvelope } -func CreateClientEnvelope(aad ...*message_api.AuthenticatedData) *message_api.ClientEnvelope { +func CreateClientEnvelope(aad ...*envelopes.AuthenticatedData) *envelopes.ClientEnvelope { if len(aad) == 0 { - aad = append(aad, &message_api.AuthenticatedData{ + aad = append(aad, &envelopes.AuthenticatedData{ TargetOriginator: 1, TargetTopic: topic.NewTopic(topic.TOPIC_KIND_GROUP_MESSAGES_V1, []byte{1, 2, 3}). Bytes(), - LastSeen: &message_api.VectorClock{}, + LastSeen: &envelopes.VectorClock{}, }) } - return &message_api.ClientEnvelope{ - Payload: &message_api.ClientEnvelope_GroupMessage{}, + return &envelopes.ClientEnvelope{ + Payload: &envelopes.ClientEnvelope_GroupMessage{}, Aad: aad[0], } } func CreatePayerEnvelope( t *testing.T, - clientEnv ...*message_api.ClientEnvelope, -) *message_api.PayerEnvelope { + clientEnv ...*envelopes.ClientEnvelope, +) *envelopes.PayerEnvelope { if len(clientEnv) == 0 { clientEnv = append(clientEnv, CreateClientEnvelope()) } clientEnvBytes, err := proto.Marshal(clientEnv[0]) require.NoError(t, err) - return &message_api.PayerEnvelope{ + return &envelopes.PayerEnvelope{ UnsignedClientEnvelope: clientEnvBytes, PayerSignature: &associations.RecoverableEcdsaSignature{}, } @@ -58,13 +58,13 @@ func CreateOriginatorEnvelope( t *testing.T, originatorNodeID uint32, originatorSequenceID uint64, - payerEnv ...*message_api.PayerEnvelope, -) *message_api.OriginatorEnvelope { + payerEnv ...*envelopes.PayerEnvelope, +) *envelopes.OriginatorEnvelope { if len(payerEnv) == 0 { payerEnv = append(payerEnv, CreatePayerEnvelope(t)) } - unsignedEnv := &message_api.UnsignedOriginatorEnvelope{ + unsignedEnv := &envelopes.UnsignedOriginatorEnvelope{ OriginatorNodeId: originatorNodeID, OriginatorSequenceId: originatorSequenceID, OriginatorNs: 0, @@ -74,7 +74,7 @@ func CreateOriginatorEnvelope( unsignedBytes, err := proto.Marshal(unsignedEnv) require.NoError(t, err) - return &message_api.OriginatorEnvelope{ + return &envelopes.OriginatorEnvelope{ UnsignedOriginatorEnvelope: unsignedBytes, Proof: nil, } diff --git a/pkg/utils/envelope.go b/pkg/utils/envelope.go index f00389fc..2845cace 100644 --- a/pkg/utils/envelope.go +++ b/pkg/utils/envelope.go @@ -1,12 +1,12 @@ package utils import ( - "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/message_api" + "github.com/xmtp/xmtpd/pkg/proto/xmtpv4/envelopes" "google.golang.org/protobuf/proto" ) -func UnmarshalOriginatorEnvelope(envelope []byte) (*message_api.OriginatorEnvelope, error) { - originatorEnvelope := &message_api.OriginatorEnvelope{} +func UnmarshalOriginatorEnvelope(envelope []byte) (*envelopes.OriginatorEnvelope, error) { + originatorEnvelope := &envelopes.OriginatorEnvelope{} err := proto.Unmarshal(envelope, originatorEnvelope) if err != nil { return nil, err @@ -16,8 +16,8 @@ func UnmarshalOriginatorEnvelope(envelope []byte) (*message_api.OriginatorEnvelo func UnmarshalUnsignedEnvelope( unsignedEnvelopeBytes []byte, -) (*message_api.UnsignedOriginatorEnvelope, error) { - unsignedEnvelope := &message_api.UnsignedOriginatorEnvelope{} +) (*envelopes.UnsignedOriginatorEnvelope, error) { + unsignedEnvelope := &envelopes.UnsignedOriginatorEnvelope{} err := proto.Unmarshal(unsignedEnvelopeBytes, unsignedEnvelope) if err != nil { return nil, err @@ -25,8 +25,8 @@ func UnmarshalUnsignedEnvelope( return unsignedEnvelope, nil } -func UnmarshalClientEnvelope(envelope []byte) (*message_api.ClientEnvelope, error) { - clientEnvelope := &message_api.ClientEnvelope{} +func UnmarshalClientEnvelope(envelope []byte) (*envelopes.ClientEnvelope, error) { + clientEnvelope := &envelopes.ClientEnvelope{} err := proto.Unmarshal(envelope, clientEnvelope) if err != nil { return nil, err