diff --git a/cmixproto/generate.sh b/cmixproto/generate.sh deleted file mode 100644 index 06e52ef847ad9a007c2ed67b9a3c9fce9cc68230..0000000000000000000000000000000000000000 --- a/cmixproto/generate.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -protoc --go_out=. types.proto diff --git a/cmixproto/types.pb.go b/cmixproto/types.pb.go deleted file mode 100644 index 09d39016be586b5a912cc95d5f3cf5b3047120f7..0000000000000000000000000000000000000000 --- a/cmixproto/types.pb.go +++ /dev/null @@ -1,554 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: types.proto - -package cmixproto - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Type int32 - -const ( - // Used as a wildcard for listeners to listen to all existing types. - // Think of it as "No type in particular" - Type_NO_TYPE Type = 0 - // See proto buf documentation below - Type_TEXT_MESSAGE Type = 1 - // See proto buf - Type_CHANNEL_MESSAGE Type = 2 - // Nickname request and response messages - Type_NICKNAME_REQUEST Type = 6 - Type_NICKNAME_RESPONSE Type = 7 - // Second field is the key data itself. This should be 2048 bits long - // (according to the message length that our prime allows) and is - // base64-encoded. - Type_UDB_PUSH_KEY Type = 10 - // The push key response message is a string. If the key push was a - // success, the UDB should respond with a message that starts with "PUSHKEY - // COMPLETE", followed by the fingerprint of the key that was pushed. - // If the response doesn't begin with "PUSHKEY COMPLETE", the message is - // an error message and should be shown to the user. - Type_UDB_PUSH_KEY_RESPONSE Type = 11 - // The get key message includes a single string field with the key - // fingerprint of the key that needs gettin'. This is the same fingerprint - // you would have pushed. - Type_UDB_GET_KEY Type = 12 - // The get key response message is a string. The first space-separated - // field should always be "GETKEY". The second field is the fingerprint of - // the key. The third field is "NOTFOUND" if the UDB didn't find the key, - // or the key itself, encoded in base64, otherwise. - Type_UDB_GET_KEY_RESPONSE Type = 13 - // To wit: The first argument in the list of space-separated fields is - // the type of the registration. Currently the only allowed type is - // "EMAIL". The second argument is the value of the type you're registering - // with. In all currently acceptable registration types, this would be an - // email address. If you could register with your phone, it would be your - // phone number, and so on. Then, the key fingerprint of the user's key is - // the third argument. To register successfully, you must have already - // pushed the key with that fingerprint. - Type_UDB_REGISTER Type = 14 - // The registration response is just a string. It will be either an error - // message to show to the user, or the message "REGISTRATION COMPLETE" if - // registration was successful. - Type_UDB_REGISTER_RESPONSE Type = 15 - // The search message is just another space separated list. The first field - // will contain the type of registered user you're searching for, namely - // "EMAIL". The second field with contain the value of that type that - // you're searching for. - Type_UDB_SEARCH Type = 16 - // The search response is a list of fields. The first is always "SEARCH". - // The second is always the value that the user searched for. The third is - // "FOUND" or "NOTFOUND" depending on whether the UDB found the user. If - // the user was FOUND, the last field will contain their key fingerprint, - // which you can use with GET_KEY to get the keys you need to talk with - // that user. Otherwise, this fourth field won't exist. - Type_UDB_SEARCH_RESPONSE Type = 17 - // To get a message of this type, call the methods in the wallet. - // TODO expose these methods over the API - Type_PAYMENT_TRANSACTION Type = 20 - // See proto buf - Type_PAYMENT_RESPONSE Type = 21 - // See proto buf - Type_PAYMENT_INVOICE Type = 22 - // This message type includes only the message hash of the original - // invoice message. Since there are no fields to delimit, it's not a - // proto buffer. When the payee gets a receipt back, they know that the - // other person probably paid them, and to check the next published - // blockchain for the images of their coins to make sure. - // The wallet sends this message after receiving a PAYMENT_RESPONSE - // indicating success. - Type_PAYMENT_RECEIPT Type = 23 - // End to End Rekey message types - // Trigger a rekey, this message is used locally in client only - Type_REKEY_TRIGGER Type = 30 - // Rekey confirmation message. Sent by partner to confirm completion of a rekey - Type_REKEY_CONFIRM Type = 31 - // This message type is a single fixed-length hash of the invoice - // that the client just received. The client can look up this hash in the - // inbound transaction list to display the most recently received invoice - // in the UI. - Type_PAYMENT_INVOICE_UI Type = 9000 - // This message type is a single fixed-length hash of the original invoice - // that this client sent to the paying client. The UI can look up the - // corresponding transaction in the list of completed transactions and - // display payment success on the UI. The wallet sends this message - // locally after receiving a PAYMENT_RECEIPT message. - Type_PAYMENT_RECEIPT_UI Type = 9001 -) - -var Type_name = map[int32]string{ - 0: "NO_TYPE", - 1: "TEXT_MESSAGE", - 2: "CHANNEL_MESSAGE", - 6: "NICKNAME_REQUEST", - 7: "NICKNAME_RESPONSE", - 10: "UDB_PUSH_KEY", - 11: "UDB_PUSH_KEY_RESPONSE", - 12: "UDB_GET_KEY", - 13: "UDB_GET_KEY_RESPONSE", - 14: "UDB_REGISTER", - 15: "UDB_REGISTER_RESPONSE", - 16: "UDB_SEARCH", - 17: "UDB_SEARCH_RESPONSE", - 20: "PAYMENT_TRANSACTION", - 21: "PAYMENT_RESPONSE", - 22: "PAYMENT_INVOICE", - 23: "PAYMENT_RECEIPT", - 30: "REKEY_TRIGGER", - 31: "REKEY_CONFIRM", - 9000: "PAYMENT_INVOICE_UI", - 9001: "PAYMENT_RECEIPT_UI", -} - -var Type_value = map[string]int32{ - "NO_TYPE": 0, - "TEXT_MESSAGE": 1, - "CHANNEL_MESSAGE": 2, - "NICKNAME_REQUEST": 6, - "NICKNAME_RESPONSE": 7, - "UDB_PUSH_KEY": 10, - "UDB_PUSH_KEY_RESPONSE": 11, - "UDB_GET_KEY": 12, - "UDB_GET_KEY_RESPONSE": 13, - "UDB_REGISTER": 14, - "UDB_REGISTER_RESPONSE": 15, - "UDB_SEARCH": 16, - "UDB_SEARCH_RESPONSE": 17, - "PAYMENT_TRANSACTION": 20, - "PAYMENT_RESPONSE": 21, - "PAYMENT_INVOICE": 22, - "PAYMENT_RECEIPT": 23, - "REKEY_TRIGGER": 30, - "REKEY_CONFIRM": 31, - "PAYMENT_INVOICE_UI": 9000, - "PAYMENT_RECEIPT_UI": 9001, -} - -func (x Type) String() string { - return proto.EnumName(Type_name, int32(x)) -} - -func (Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{0} -} - -// Use this enumeration to get specific transactions from specific transaction -// lists from the wallet -type TransactionListTag int32 - -const ( - // Transactions in this list are invoices this user made to another user - // Most importantly, they include the preimage that this user wants fulfilled, - // but the image of this preimage is what the client will send in the invoice. - // Transactions enter this list when this user invoices another user. - TransactionListTag_OUTBOUND_REQUESTS TransactionListTag = 0 - // Transactions in this list are invoices that this user received from - // other users. Most importantly, this includes the image that this user - // will fund. - TransactionListTag_INBOUND_REQUESTS TransactionListTag = 1 - // Transactions in this list are currently processing on a payment bot. - // Transactions move from INBOUND_REQUESTS to PENDING_TRANSACTIONS after - // a Pay() call. - TransactionListTag_PENDING_TRANSACTIONS TransactionListTag = 2 - // Transactions in this list are completed transactions that increased - // the value of this user's wallet. NOTE: They correspond to transactions - // originally in the OUTBOUND_REQUESTS list that went through. - TransactionListTag_COMPLETED_INBOUND_PAYMENTS TransactionListTag = 3 - // Transactions in this list are completed transactions that decreased - // the value of this user's wallet. NOTE: They correspond to transactions - // originally in the INBOUND_REQUESTS list that went through. - TransactionListTag_COMPLETED_OUTBOUND_PAYMENTS TransactionListTag = 4 -) - -var TransactionListTag_name = map[int32]string{ - 0: "OUTBOUND_REQUESTS", - 1: "INBOUND_REQUESTS", - 2: "PENDING_TRANSACTIONS", - 3: "COMPLETED_INBOUND_PAYMENTS", - 4: "COMPLETED_OUTBOUND_PAYMENTS", -} - -var TransactionListTag_value = map[string]int32{ - "OUTBOUND_REQUESTS": 0, - "INBOUND_REQUESTS": 1, - "PENDING_TRANSACTIONS": 2, - "COMPLETED_INBOUND_PAYMENTS": 3, - "COMPLETED_OUTBOUND_PAYMENTS": 4, -} - -func (x TransactionListTag) String() string { - return proto.EnumName(TransactionListTag_name, int32(x)) -} - -func (TransactionListTag) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{1} -} - -// Use this enumeration to request different sort orders of transaction lists -// when getting all IDs in a transaction list -type TransactionListOrder int32 - -const ( - // Most recently initiated transaction first - TransactionListOrder_TIMESTAMP_DESCENDING TransactionListOrder = 0 - // Stalest transaction first - TransactionListOrder_TIMESTAMP_ASCENDING TransactionListOrder = 1 - // Biggest transaction first - TransactionListOrder_VALUE_DESCENDING TransactionListOrder = 2 - // Smallest transaction first - TransactionListOrder_VALUE_ASCENDING TransactionListOrder = 3 -) - -var TransactionListOrder_name = map[int32]string{ - 0: "TIMESTAMP_DESCENDING", - 1: "TIMESTAMP_ASCENDING", - 2: "VALUE_DESCENDING", - 3: "VALUE_ASCENDING", -} - -var TransactionListOrder_value = map[string]int32{ - "TIMESTAMP_DESCENDING": 0, - "TIMESTAMP_ASCENDING": 1, - "VALUE_DESCENDING": 2, - "VALUE_ASCENDING": 3, -} - -func (x TransactionListOrder) String() string { - return proto.EnumName(TransactionListOrder_name, int32(x)) -} - -func (TransactionListOrder) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{2} -} - -// Is Type.TEXT_MESSAGE -// Used for conveying simple text messages between users -type TextMessage struct { - // Terminal text foreground color. Used by the console UI - Color int32 `protobuf:"zigzag32,2,opt,name=color,proto3" json:"color,omitempty"` - // The message text itself. Varies in length - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - // Timestamp (Unix time in seconds) - // You can use this to display the time when the other user sent the message - // TODO Done this when all messages have timestamps - Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TextMessage) Reset() { *m = TextMessage{} } -func (m *TextMessage) String() string { return proto.CompactTextString(m) } -func (*TextMessage) ProtoMessage() {} -func (*TextMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{0} -} - -func (m *TextMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TextMessage.Unmarshal(m, b) -} -func (m *TextMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TextMessage.Marshal(b, m, deterministic) -} -func (m *TextMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_TextMessage.Merge(m, src) -} -func (m *TextMessage) XXX_Size() int { - return xxx_messageInfo_TextMessage.Size(m) -} -func (m *TextMessage) XXX_DiscardUnknown() { - xxx_messageInfo_TextMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_TextMessage proto.InternalMessageInfo - -func (m *TextMessage) GetColor() int32 { - if m != nil { - return m.Color - } - return 0 -} - -func (m *TextMessage) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func (m *TextMessage) GetTime() int64 { - if m != nil { - return m.Time - } - return 0 -} - -// Is Type.CHANNEL_MESSAGE -// This is the type of all messages that come from the channelbot. -type ChannelMessage struct { - // This is the original speaker of the channel message, who sent the - // message to the channel bot. - SpeakerID []byte `protobuf:"bytes,3,opt,name=speakerID,proto3" json:"speakerID,omitempty"` - // This is a serialized parse message under the hood. When writing a - // listener for a channel message on a client, you need to unpack the - // serialized parse message and rebroadcast it through the listeners. - Message []byte `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChannelMessage) Reset() { *m = ChannelMessage{} } -func (m *ChannelMessage) String() string { return proto.CompactTextString(m) } -func (*ChannelMessage) ProtoMessage() {} -func (*ChannelMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{1} -} - -func (m *ChannelMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChannelMessage.Unmarshal(m, b) -} -func (m *ChannelMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChannelMessage.Marshal(b, m, deterministic) -} -func (m *ChannelMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChannelMessage.Merge(m, src) -} -func (m *ChannelMessage) XXX_Size() int { - return xxx_messageInfo_ChannelMessage.Size(m) -} -func (m *ChannelMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ChannelMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_ChannelMessage proto.InternalMessageInfo - -func (m *ChannelMessage) GetSpeakerID() []byte { - if m != nil { - return m.SpeakerID - } - return nil -} - -func (m *ChannelMessage) GetMessage() []byte { - if m != nil { - return m.Message - } - return nil -} - -// Is Type.PAYMENT_RESPONSE -type PaymentResponse struct { - // Indicates whether the payment succeeded or failed - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - // Response message from the payment bot. You should display this to the - // user. - Response string `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` - // TODO Is it correct to use the whole hash? - // This is the hash of the payment message that the payment bot received. - // The client uses it to remove the correct pending transaction from the - // list of pending transactions. - ID []byte `protobuf:"bytes,3,opt,name=ID,proto3" json:"ID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PaymentResponse) Reset() { *m = PaymentResponse{} } -func (m *PaymentResponse) String() string { return proto.CompactTextString(m) } -func (*PaymentResponse) ProtoMessage() {} -func (*PaymentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{2} -} - -func (m *PaymentResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PaymentResponse.Unmarshal(m, b) -} -func (m *PaymentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PaymentResponse.Marshal(b, m, deterministic) -} -func (m *PaymentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PaymentResponse.Merge(m, src) -} -func (m *PaymentResponse) XXX_Size() int { - return xxx_messageInfo_PaymentResponse.Size(m) -} -func (m *PaymentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PaymentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PaymentResponse proto.InternalMessageInfo - -func (m *PaymentResponse) GetSuccess() bool { - if m != nil { - return m.Success - } - return false -} - -func (m *PaymentResponse) GetResponse() string { - if m != nil { - return m.Response - } - return "" -} - -func (m *PaymentResponse) GetID() []byte { - if m != nil { - return m.ID - } - return nil -} - -// Is Type.PAYMENT_INVOICE -type PaymentInvoice struct { - // Timestamp (Unix time in seconds) - // Not currently used but could be useful for the user to verify the - // correctness of an invoice. - Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` - // This is a single compound coin that the invoicer wants to be funded. The - // payer should send a message to the payment bot to fund this compound, if - // they wish to pay the payee. - CreatedCoin []byte `protobuf:"bytes,2,opt,name=createdCoin,proto3" json:"createdCoin,omitempty"` - // The payee should fill this out to describe what the payment is for or - // about. - Memo string `protobuf:"bytes,3,opt,name=memo,proto3" json:"memo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PaymentInvoice) Reset() { *m = PaymentInvoice{} } -func (m *PaymentInvoice) String() string { return proto.CompactTextString(m) } -func (*PaymentInvoice) ProtoMessage() {} -func (*PaymentInvoice) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{3} -} - -func (m *PaymentInvoice) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PaymentInvoice.Unmarshal(m, b) -} -func (m *PaymentInvoice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PaymentInvoice.Marshal(b, m, deterministic) -} -func (m *PaymentInvoice) XXX_Merge(src proto.Message) { - xxx_messageInfo_PaymentInvoice.Merge(m, src) -} -func (m *PaymentInvoice) XXX_Size() int { - return xxx_messageInfo_PaymentInvoice.Size(m) -} -func (m *PaymentInvoice) XXX_DiscardUnknown() { - xxx_messageInfo_PaymentInvoice.DiscardUnknown(m) -} - -var xxx_messageInfo_PaymentInvoice proto.InternalMessageInfo - -func (m *PaymentInvoice) GetTime() int64 { - if m != nil { - return m.Time - } - return 0 -} - -func (m *PaymentInvoice) GetCreatedCoin() []byte { - if m != nil { - return m.CreatedCoin - } - return nil -} - -func (m *PaymentInvoice) GetMemo() string { - if m != nil { - return m.Memo - } - return "" -} - -func init() { - proto.RegisterEnum("parse.Type", Type_name, Type_value) - proto.RegisterEnum("parse.TransactionListTag", TransactionListTag_name, TransactionListTag_value) - proto.RegisterEnum("parse.TransactionListOrder", TransactionListOrder_name, TransactionListOrder_value) - proto.RegisterType((*TextMessage)(nil), "parse.TextMessage") - proto.RegisterType((*ChannelMessage)(nil), "parse.ChannelMessage") - proto.RegisterType((*PaymentResponse)(nil), "parse.PaymentResponse") - proto.RegisterType((*PaymentInvoice)(nil), "parse.PaymentInvoice") -} - -func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } - -var fileDescriptor_d938547f84707355 = []byte{ - // 622 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x54, 0xdb, 0x72, 0xda, 0x3a, - 0x14, 0x8d, 0x81, 0x5c, 0xd8, 0x10, 0x10, 0x0a, 0x39, 0xe1, 0xe4, 0x9c, 0x49, 0x18, 0x9e, 0x98, - 0x3c, 0xf4, 0xa5, 0x5f, 0xe0, 0x18, 0x05, 0x34, 0xc1, 0xb2, 0x23, 0xc9, 0x69, 0x93, 0x17, 0x8f, - 0xeb, 0x68, 0x52, 0xa6, 0xc1, 0x66, 0x6c, 0xb7, 0x93, 0xfc, 0x4b, 0x3f, 0xa0, 0xfd, 0x91, 0x7e, - 0x57, 0x47, 0x06, 0x5f, 0x26, 0x4f, 0x68, 0xaf, 0xb5, 0xb4, 0xb4, 0xd7, 0xde, 0x83, 0xa1, 0x93, - 0xbd, 0x6d, 0x54, 0xfa, 0x61, 0x93, 0xc4, 0x59, 0x8c, 0xf7, 0x37, 0x41, 0x92, 0xaa, 0xc9, 0x1d, - 0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e7, 0xe7, 0x7b, 0x14, - 0xfd, 0xba, 0xa9, 0x13, 0x3b, 0x4f, 0x4d, 0xfc, 0xbe, 0xb9, 0xfa, 0x69, 0x00, 0x96, 0x49, 0x10, - 0xa5, 0x41, 0x98, 0xad, 0xe2, 0x68, 0xb9, 0x4a, 0x33, 0x19, 0x3c, 0xeb, 0x65, 0x38, 0x9e, 0xbc, - 0x76, 0x3c, 0x36, 0x2b, 0x56, 0x24, 0xd0, 0x9e, 0x4e, 0x41, 0xd9, 0x3b, 0xd4, 0xd0, 0x43, 0x76, - 0x09, 0x9b, 0x51, 0x36, 0xaf, 0x87, 0x16, 0xa8, 0x81, 0x2f, 0xe0, 0xdc, 0x72, 0x6c, 0x77, 0x49, - 0x24, 0x99, 0xf9, 0xc5, 0xcd, 0x5d, 0x23, 0x02, 0x35, 0xf1, 0x25, 0xfc, 0x57, 0xf1, 0xe5, 0x83, - 0xa5, 0xa0, 0x75, 0x95, 0xc1, 0xf0, 0x5d, 0x77, 0x4e, 0xf2, 0xa4, 0xf4, 0x9f, 0x75, 0x28, 0xa9, - 0x4d, 0x84, 0x34, 0x6d, 0xd7, 0x9f, 0x11, 0x61, 0x6d, 0xdf, 0x47, 0x7b, 0x7a, 0x03, 0x15, 0x63, - 0x96, 0x84, 0xa1, 0x7b, 0xbf, 0x37, 0x97, 0x1e, 0xa9, 0xcb, 0x1b, 0x7a, 0xd8, 0x5b, 0xb4, 0x92, - 0x36, 0xaf, 0x3b, 0x8f, 0xed, 0x70, 0xbd, 0x7a, 0xcd, 0xbf, 0x21, 0x5f, 0x0e, 0xf2, 0x9f, 0x8f, - 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xff, 0xd7, 0x16, 0x59, 0x04, 0x00, 0x00, -} diff --git a/cmixproto/types.proto b/cmixproto/types.proto deleted file mode 100644 index 2596d9be24d0dd00ec98fa4b1545af7cf8d89578..0000000000000000000000000000000000000000 --- a/cmixproto/types.proto +++ /dev/null @@ -1,244 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// Copyright © 2018 Privategrity Corporation / -// / -// All rights reserved. / -//////////////////////////////////////////////////////////////////////////////// - -// Call ./generate.sh to generate the protocol buffer code - -syntax = "proto3"; - -package parse; -option go_package = "cmixproto"; - -enum Type { - // Used as a wildcard for listeners to listen to all existing types. - // Think of it as "No type in particular" - NO_TYPE = 0; - - // See proto buf documentation below - TEXT_MESSAGE = 1; - // See proto buf - CHANNEL_MESSAGE = 2; - - // Nickname request and response messages - NICKNAME_REQUEST = 6; - NICKNAME_RESPONSE = 7; - - // None of the UDB message types are proto bufs because I haven't had time - // to migrate UDB fully to the new systems yet. - - // I was considering migrating these types to proto bufs to make them more - // compact for transmission, but you would have to compress them to even - // have a chance of fitting the whole key in one Cmix message. In any case, - // I don't think the benefit is there for the time investment. - - // The prefixes of the UDB response messages are made redundant by the - // message types in this very enumeration, so at some point we can remove - // them from the UDB code that generates the responses. - - // The push key message includes two string fields, separated by a space. - - // First field is the key fingerprint, which the UDB uses as an key into - // the map of, uhh, the keys. This can be any string that doesn't have a - // space in it. - - // Second field is the key data itself. This should be 2048 bits long - // (according to the message length that our prime allows) and is - // base64-encoded. - UDB_PUSH_KEY = 10; - // The push key response message is a string. If the key push was a - // success, the UDB should respond with a message that starts with "PUSHKEY - // COMPLETE", followed by the fingerprint of the key that was pushed. - // If the response doesn't begin with "PUSHKEY COMPLETE", the message is - // an error message and should be shown to the user. - UDB_PUSH_KEY_RESPONSE = 11; - // The get key message includes a single string field with the key - // fingerprint of the key that needs gettin'. This is the same fingerprint - // you would have pushed. - UDB_GET_KEY = 12; - // The get key response message is a string. The first space-separated - // field should always be "GETKEY". The second field is the fingerprint of - // the key. The third field is "NOTFOUND" if the UDB didn't find the key, - // or the key itself, encoded in base64, otherwise. - UDB_GET_KEY_RESPONSE = 13; - // The register message is unchanged from the OG UDB code, except that - // the REGISTER command in front has been replaced with the type string - // corresponding to this entry in the enumeration. - - // To wit: The first argument in the list of space-separated fields is - // the type of the registration. Currently the only allowed type is - // "EMAIL". The second argument is the value of the type you're registering - // with. In all currently acceptable registration types, this would be an - // email address. If you could register with your phone, it would be your - // phone number, and so on. Then, the key fingerprint of the user's key is - // the third argument. To register successfully, you must have already - // pushed the key with that fingerprint. - UDB_REGISTER = 14; - // The registration response is just a string. It will be either an error - // message to show to the user, or the message "REGISTRATION COMPLETE" if - // registration was successful. - UDB_REGISTER_RESPONSE = 15; - // The search message is just another space separated list. The first field - // will contain the type of registered user you're searching for, namely - // "EMAIL". The second field with contain the value of that type that - // you're searching for. - UDB_SEARCH = 16; - // The search response is a list of fields. The first is always "SEARCH". - // The second is always the value that the user searched for. The third is - // "FOUND" or "NOTFOUND" depending on whether the UDB found the user. If - // the user was FOUND, the last field will contain their key fingerprint, - // which you can use with GET_KEY to get the keys you need to talk with - // that user. Otherwise, this fourth field won't exist. - UDB_SEARCH_RESPONSE = 17; - - // The client sends payment transaction messages to the payment bot to - // fund compound coins with seed coins. In the current implementation, - // there's one compound that gets funded that's from the payee. This comes - // across in a PAYMENT_INVOICE. And there's a second compound that contains - // the change from the seeds that the payer is using to fund the invoice. - // The rest are the seeds that are the source of the payment. - - // All of the seeds and compounds are in an ordered list, and they get - // categorized and processed on the payment bot. - - // To get a message of this type, call the methods in the wallet. - // TODO expose these methods over the API - PAYMENT_TRANSACTION = 20; - // See proto buf - PAYMENT_RESPONSE = 21; - // See proto buf - PAYMENT_INVOICE = 22; - // This message type includes only the message hash of the original - // invoice message. Since there are no fields to delimit, it's not a - // proto buffer. When the payee gets a receipt back, they know that the - // other person probably paid them, and to check the next published - // blockchain for the images of their coins to make sure. - // The wallet sends this message after receiving a PAYMENT_RESPONSE - // indicating success. - PAYMENT_RECEIPT = 23; - - // End to End Rekey message types - // Trigger a rekey, this message is used locally in client only - REKEY_TRIGGER = 30; - // Rekey confirmation message. Sent by partner to confirm completion of a rekey - REKEY_CONFIRM = 31; - - // These are specialized messages that convey the information that - // the UI needs to know once the wallet's finished updating. They shouldn't - // go over the network. Types 9000-9999 are reserved for messages like this. - - // This message type is a single fixed-length hash of the invoice - // that the client just received. The client can look up this hash in the - // inbound transaction list to display the most recently received invoice - // in the UI. - PAYMENT_INVOICE_UI = 9000; - // This message type is a single fixed-length hash of the original invoice - // that this client sent to the paying client. The UI can look up the - // corresponding transaction in the list of completed transactions and - // display payment success on the UI. The wallet sends this message - // locally after receiving a PAYMENT_RECEIPT message. - PAYMENT_RECEIPT_UI = 9001; -} - -// Use this enumeration to get specific transactions from specific transaction -// lists from the wallet -enum TransactionListTag { - - // Transactions in this list are invoices this user made to another user - // Most importantly, they include the preimage that this user wants fulfilled, - // but the image of this preimage is what the client will send in the invoice. - // Transactions enter this list when this user invoices another user. - OUTBOUND_REQUESTS = 0; - - // Transactions in this list are invoices that this user received from - // other users. Most importantly, this includes the image that this user - // will fund. - INBOUND_REQUESTS = 1; - - // Transactions in this list are currently processing on a payment bot. - // Transactions move from INBOUND_REQUESTS to PENDING_TRANSACTIONS after - // a Pay() call. - PENDING_TRANSACTIONS = 2; - - // Transactions in this list are completed transactions that increased - // the value of this user's wallet. NOTE: They correspond to transactions - // originally in the OUTBOUND_REQUESTS list that went through. - COMPLETED_INBOUND_PAYMENTS = 3; - - // Transactions in this list are completed transactions that decreased - // the value of this user's wallet. NOTE: They correspond to transactions - // originally in the INBOUND_REQUESTS list that went through. - COMPLETED_OUTBOUND_PAYMENTS = 4; -} - -// Use this enumeration to request different sort orders of transaction lists -// when getting all IDs in a transaction list -enum TransactionListOrder { - // Most recently initiated transaction first - TIMESTAMP_DESCENDING = 0; - // Stalest transaction first - TIMESTAMP_ASCENDING = 1; - // Biggest transaction first - VALUE_DESCENDING = 2; - // Smallest transaction first - VALUE_ASCENDING = 3; -} - -// Text message types - -// Is Type.TEXT_MESSAGE -// Used for conveying simple text messages between users -message TextMessage { - // Terminal text foreground color. Used by the console UI - sint32 color = 2; - // The message text itself. Varies in length - string message = 3; - // Timestamp (Unix time in seconds) - // You can use this to display the time when the other user sent the message - // TODO Remove this when all messages have timestamps - int64 time = 4; -} - -// Is Type.CHANNEL_MESSAGE -// This is the type of all messages that come from the channelbot. -message ChannelMessage { - // This is the original speaker of the channel message, who sent the - // message to the channel bot. - bytes speakerID = 3; - // This is a serialized parse message under the hood. When writing a - // listener for a channel message on a client, you need to unpack the - // serialized parse message and rebroadcast it through the listeners. - bytes message = 4; -} - -// Payment message types - -// Is Type.PAYMENT_RESPONSE -message PaymentResponse { - // Indicates whether the payment succeeded or failed - bool success = 1; - // Response message from the payment bot. You should display this to the - // user. - string response = 2; - // TODO Is it correct to use the whole hash? - // This is the hash of the payment message that the payment bot received. - // The client uses it to remove the correct pending transaction from the - // list of pending transactions. - bytes ID = 3; -} - -// Is Type.PAYMENT_INVOICE -message PaymentInvoice { - // Timestamp (Unix time in seconds) - // Not currently used but could be useful for the user to verify the - // correctness of an invoice. - int64 time = 1; - // This is a single compound coin that the invoicer wants to be funded. The - // payer should send a message to the payment bot to fund this compound, if - // they wish to pay the payee. - bytes createdCoin = 2; - // The payee should fill this out to describe what the payment is for or - // about. - string memo = 3; -}