openbazaar-go/pb/protos at master · OpenBazaar/openbazaar-go
pseudomuto/protoc-gen-doc: Documentation generator plugin for Google Protocol Buffers
git clone https://github.com/OpenBazaar/openbazaar-go.git /tmp/src/openbazaar-go
bash tc.sh --gen-proto-doc /tmp/src/openbazaar-go/pb/protos /tmp/output.md
Top
Field Type Label Description
inputIndex uint32
signature bytes
Field Type Label Description
identity bytes IPFS public key
bitcoin bytes Bitcoin public key
Field Type Label Description
variantCombo uint32 repeated
productID string
surcharge int64
quantity int64 Not saved with listing
Field Type Label Description
transactionID string
Field Type Label Description
shipper string
trackingNumber string
Field Type Label Description
orderID string OrderID which has its funds released to the vendor
Name Number Description
PHYSICAL_GOOD 0
DIGITAL_GOOD 1
SERVICE 2
CROWD_FUND 3
CRYPTOCURRENCY 4
Name Number Description
FIXED_PRICE 0
MARKET_PRICE 2
Name Number Description
LOCAL_PICKUP 0
FIXED_PRICE 1
Name Number Description
ADDRESS_REQUEST 0
DIRECT 1
MODERATED 2
Name Number Description
LISTING 0
ORDER 1
ORDER_CONFIRMATION 2
ORDER_FULFILLMENT 3
ORDER_COMPLETION 4
DISPUTE 5
DISPUTE_RESOLUTION 6
REFUND 7
Top
Name Number Description
POST 0
COMMENT 1
REPOST 2
Top
Field Type Label Description
cids string repeated
Field Type Label Description
senderPubkey bytes
serializedData bytes
signature bytes
Name Number Description
MESSAGE 0
TYPING 1
READ 2
Name Number Description
PING 0
CHAT 1
FOLLOW 2
UNFOLLOW 3
ORDER 4
ORDER_REJECT 5
ORDER_CANCEL 6
ORDER_CONFIRMATION 7
ORDER_FULFILLMENT 8
ORDER_COMPLETION 9
DISPUTE_OPEN 10
DISPUTE_UPDATE 11
DISPUTE_CLOSE 12
REFUND 13
OFFLINE_ACK 14
OFFLINE_RELAY 15
MODERATOR_ADD 16
MODERATOR_REMOVE 17
STORE 18
BLOCK 19
VENDOR_FINALIZED_PAYMENT 20
ORDER_PAYMENT 21
ERROR 500
ORDER_PROCESSING_FAILURE 501
Top
Name Number Description
NA 0
AFGHANISTAN 1
ALAND_ISLANDS 2
ALBANIA 3
ALGERIA 4
AMERICAN_SAMOA 5
ANDORRA 6
ANGOLA 7
ANGUILLA 8
ANTIGUA 9
ARGENTINA 10
ARMENIA 11
ARUBA 12
AUSTRALIA 13
AUSTRIA 14
AZERBAIJAN 15
BAHAMAS 16
BAHRAIN 17
BANGLADESH 18
BARBADOS 19
BELARUS 20
BELGIUM 21
BELIZE 22
BENIN 23
BERMUDA 24
BHUTAN 25
BOLIVIA 26
BONAIRE_SINT_EUSTATIUS_SABA 27
BOSNIA 28
BOTSWANA 29
BOUVET_ISLAND 30
BRAZIL 31
BRITISH_INDIAN_OCEAN_TERRITORY 32
BRUNEI_DARUSSALAM 33
BULGARIA 34
BURKINA_FASO 35
BURUNDI 36
CABO_VERDE 37
CAMBODIA 38
CAMEROON 39
CANADA 40
CAYMAN_ISLANDS 41
CENTRAL_AFRICAN_REPUBLIC 42
CHAD 43
CHILE 44
CHINA 45
CHRISTMAS_ISLAND 46
COCOS_ISLANDS 47
COLOMBIA 48
COMOROS 49
CONGO_REPUBLIC 50
CONGO 51
COOK_ISLANDS 52
COSTA_RICA 53
COTE_DIVOIRE 54
CROATIA 55
CUBA 56
CURACAO 57
CYPRUS 58
CZECH_REPUBLIC 59
DENMARK 60
DJIBOUTI 61
DOMINICA 62
DOMINICAN_REPUBLIC 63
ECUADOR 64
EGYPT 65
EL_SALVADOR 66
EQUATORIAL_GUINEA 67
ERITREA 68
ESTONIA 69
ETHIOPIA 70
FALKLAND_ISLANDS 71
FAROE_ISLANDS 72
FIJI 73
FINLAND 74
FRANCE 75
FRENCH_GUIANA 76
FRENCH_POLYNESIA 77
FRENCH_SOUTHERN_TERRITORIES 78
GABON 79
GAMBIA 80
GEORGIA 81
GERMANY 82
GHANA 83
GIBRALTAR 84
GREECE 85
GREENLAND 86
GRENADA 87
GUADELOUPE 88
GUAM 89
GUATEMALA 90
GUERNSEY 91
GUINEA 92
GUINEA_BISSAU 93
GUYANA 94
HAITI 95
HEARD_ISLAND 96
HOLY_SEE 97
HONDURAS 98
HONG_KONG 99
HUNGARY 100
ICELAND 101
INDIA 102
INDONESIA 103
IRAN 104
IRAQ 105
IRELAND 106
ISLE_OF_MAN 107
ISRAEL 108
ITALY 109
JAMAICA 110
JAPAN 111
JERSEY 112
JORDAN 113
KAZAKHSTAN 114
KENYA 115
KIRIBATI 116
NORTH_KOREA 117
SOUTH_KOREA 118
KUWAIT 119
KYRGYZSTAN 120
LAO 121
LATVIA 122
LEBANON 123
LESOTHO 124
LIBERIA 125
LIBYA 126
LIECHTENSTEIN 127
LITHUANIA 128
LUXEMBOURG 129
MACAO 130
MACEDONIA 131
MADAGASCAR 132
MALAWI 133
MALAYSIA 134
MALDIVES 135
MALI 136
MALTA 137
MARSHALL_ISLANDS 138
MARTINIQUE 139
MAURITANIA 140
MAURITIUS 141
MAYOTTE 142
MEXICO 143
MICRONESIA 144
MOLDOVA 145
MONACO 146
MONGOLIA 147
MONTENEGRO 148
MONTSERRAT 149
MOROCCO 150
MOZAMBIQUE 151
MYANMAR 152
NAMIBIA 153
NAURU 154
NEPAL 155
NETHERLANDS 156
NEW_CALEDONIA 157
NEW_ZEALAND 158
NICARAGUA 159
NIGER 160
NIGERIA 161
NIUE 162
NORFOLK_ISLAND 163
NORTHERN_MARIANA_ISLANDS 164
NORWAY 165
OMAN 166
PAKISTAN 167
PALAU 168
PANAMA 169
PAPUA_NEW_GUINEA 170
PARAGUAY 171
PERU 172
PHILIPPINES 173
PITCAIRN 174
POLAND 175
PORTUGAL 176
PUERTO_RICO 177
QATAR 178
REUNION 179
ROMANIA 180
RUSSIA 181
RWANDA 182
SAINT_BARTHELEMY 183
SAINT_HELENA 184
SAINT_KITTS 185
SAINT_LUCIA 186
SAINT_MARTIN 187
SAINT_PIERRE 188
SAINT_VINCENT 189
SAMOA 190
SAN_MARINO 191
SAO_TOME 192
SAUDI_ARABIA 193
SENEGAL 194
SERBIA 195
SEYCHELLES 196
SIERRA_LEONE 197
SINGAPORE 198
SINT_MAARTEN 199
SUCRE 200
SLOVAKIA 201
SLOVENIA 202
SOLOMON_ISLANDS 203
SOMALIA 204
SOUTH_AFRICA 205
SOUTH_SUDAN 206
SPAIN 207
SRI_LANKA 208
SUDAN 209
SURINAME 210
SVALBARD 211
ESWATINI 212
SWAZILAND 212
SWEDEN 213
SWITZERLAND 214
SYRIAN_ARAB_REPUBLIC 215
TAIWAN 216
TAJIKISTAN 217
TANZANIA 218
THAILAND 219
TIMOR_LESTE 220
TOGO 221
TOKELAU 222
TONGA 223
TRINIDAD 224
TUNISIA 225
TURKEY 226
TURKMENISTAN 227
TURKS_AND_CAICOS_ISLANDS 228
TUVALU 229
UGANDA 230
UKRAINE 231
UNITED_ARAB_EMIRATES 232
UNITED_KINGDOM 233
UNITED_STATES 234
URUGUAY 235
UZBEKISTAN 236
VANUATU 237
VENEZUELA 238
VIETNAM 239
VIRGIN_ISLANDS_BRITISH 240
VIRGIN_ISLANDS_US 241
WALLIS_AND_FUTUNA 242
WESTERN_SAHARA 243
YEMEN 244
ZAMBIA 245
ZIMBABWE 246
UNITED_STATES_MINOR_ISLANDS 247
ALL 500
AFRICA 501
ASIA 502
CENTRAL_AMERICA 503
EUROPE 504
MIDDLE_EAST 505
NORTH_AMERICA 506
SOUTH_AMERICA 507
OCEANIA 508
Top
Top
Field Type Label Description
currencyCode string
amount uint64 Bitcoins must be in satoshi
Name Number Description
FIXED 0
PERCENTAGE 1
FIXED_PLUS_PERCENTAGE 2
Top
Name Number Description
PENDING 0 Order has been funded and sent to the vendor but vendor has not yet responded
AWAITING_PAYMENT 1 Waiting for the buyer to fund the payment address
AWAITING_PICKUP 2 Waiting for the customer to pick up the order (customer pickup option only)
AWAITING_FULFILLMENT 3 Order has been fully funded and we're waiting for the vendor to fulfill
PARTIALLY_FULFILLED 4 Vendor has fulfilled part of the order
FULFILLED 5 Vendor has fulfilled the order
COMPLETED 6 Buyer has completed the order and left a review
CANCELED 7 Buyer canceled the order (offline order only)
DECLINED 8 Vendor declined to confirm the order (offline order only)
REFUNDED 9 Vendor refunded the order
DISPUTED 10 Contract is under active dispute
DECIDED 11 The moderator has resolved the dispute and we are waiting for the winning party to accept the payout.
RESOLVED 12 The winning party has accepted the dispute and it is now complete. After the buyer leaves a review the state should be set to COMPLETE.
PAYMENT_FINALIZED 13 Escrow has been released after waiting the timeout period. After the buyer leaves a review the state should be set to COMPLETE.
PROCESSING_ERROR 14 We screwed up and produced a order which didn't validate. This state is only used for offline orders. If a processing error occurred with an open connection between buyer and vendor the vendor just rejects the order on the spot neither party commits the order to the database.
Top
.proto Type Notes C++ Type Java Type Python Type
doubledouble double float
floatfloat float float
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long
uint32Uses variable-length encoding. uint32 int int/long
uint64Uses variable-length encoding. uint64 long int/long
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long
sfixed32Always four bytes. int32 int int
sfixed64Always eight bytes. int64 long int/long
boolbool boolean boolean
stringA string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode
bytesMay contain any arbitrary sequence of bytes. string ByteString str
.
├── api.proto
├── contracts.proto
├── countrycodes.proto
├── message.proto
├── moderator.proto
├── orders.proto
├── posts.proto
└── profile.proto
0 directories, 8 files
syntax = "proto3";
option go_package = "pb";
import "countrycodes.proto";
import "message.proto";
import "google/protobuf/timestamp.proto";
message RicardianContract {
repeated Listing vendorListings = 1;
Order buyerOrder = 2;
OrderConfirmation vendorOrderConfirmation = 3;
repeated OrderFulfillment vendorOrderFulfillment = 4;
OrderCompletion buyerOrderCompletion = 5;
Dispute dispute = 6;
DisputeResolution disputeResolution = 7;
DisputeAcceptance disputeAcceptance = 8;
Refund refund = 9;
repeated Signature signatures = 10;
repeated string errors = 11;
}
message Listing {
string slug = 1;
ID vendorID = 2;
Metadata metadata = 3;
Item item = 4;
repeated ShippingOption shippingOptions = 5;
repeated Tax taxes = 6;
repeated Coupon coupons = 7;
repeated string moderators = 8;
string termsAndConditions = 9;
string refundPolicy = 10;
message Metadata {
uint32 version = 1;
ContractType contractType = 2;
Format format = 3;
google.protobuf.Timestamp expiry = 4;
repeated string acceptedCurrencies = 5;
string pricingCurrency = 6;
string language = 7;
uint32 escrowTimeoutHours = 8;
string coinType = 9;
uint32 coinDivisibility = 10;
float priceModifier = 11;
enum ContractType {
PHYSICAL_GOOD = 0;
DIGITAL_GOOD = 1;
SERVICE = 2;
CROWD_FUND = 3;
CRYPTOCURRENCY = 4;
}
enum Format {
FIXED_PRICE = 0;
MARKET_PRICE = 2;
}
}
message Item {
string title = 1;
string description = 2;
string processingTime = 3;
uint64 price = 4;
bool nsfw = 5;
repeated string tags = 6;
repeated Image images = 7;
repeated string categories = 8;
float grams = 9;
string condition = 10;
repeated Option options = 11;
repeated Sku skus = 12;
message Option {
string name = 1;
string description = 2;
repeated Variant variants = 3;
message Variant {
string name = 1;
Image image = 2;
}
}
message Sku {
repeated uint32 variantCombo = 1;
string productID = 2;
int64 surcharge = 3;
int64 quantity = 4; // Not saved with listing
}
message Image {
string filename = 1;
string original = 2;
string large = 3;
string medium = 4;
string small = 5;
string tiny = 6;
}
}
message ShippingOption {
string name = 1;
ShippingType type = 2;
repeated CountryCode regions = 3;
repeated Service services = 5;
enum ShippingType {
LOCAL_PICKUP = 0;
FIXED_PRICE = 1;
}
message Service {
string name = 1;
uint64 price = 2;
string estimatedDelivery = 3;
uint64 additionalItemPrice = 4;
}
}
message Tax {
string taxType = 1;
repeated CountryCode taxRegions = 2;
bool taxShipping = 3;
float percentage = 4;
}
message Coupon {
string title = 1;
oneof code {
string hash = 2;
string discountCode = 3;
}
oneof discount {
float percentDiscount = 5;
uint64 priceDiscount = 6;
}
}
}
message Order {
string refundAddress = 1;
uint64 refundFee = 2;
Shipping shipping = 3;
ID buyerID = 4;
google.protobuf.Timestamp timestamp = 5;
repeated Item items = 6;
Payment payment = 7;
repeated bytes ratingKeys = 8;
string alternateContactInfo = 9;
uint32 version = 10;
message Shipping {
string shipTo = 1;
string address = 2;
string city = 3;
string state = 4;
string postalCode = 5;
CountryCode country = 6;
string addressNotes = 7;
}
message Item {
string listingHash = 1;
uint32 quantity = 2; // order version < 2 used with listing version < 3
uint64 quantity64 = 8; // order version >= 2 used with listing version >= 3
repeated Option options = 3;
ShippingOption shippingOption = 4;
string memo = 5;
repeated string couponCodes = 6;
string paymentAddress = 7;
message Option {
string name = 1;
string value = 2;
}
message ShippingOption {
string name = 1;
string service = 2;
}
}
message Payment {
Method method = 1;
string moderator = 2;
uint64 amount = 3; // Satoshis
string chaincode = 4; // Hex encoded
string address = 5; // B58check encoded
string redeemScript = 6; // Hex encoded
bytes moderatorKey = 7;
string coin = 8;
enum Method {
ADDRESS_REQUEST = 0;
DIRECT = 1;
MODERATED = 2;
}
}
}
message OrderConfirmation {
string orderID = 1;
google.protobuf.Timestamp timestamp = 2;
// Direct payments only
string paymentAddress = 3;
uint64 requestedAmount = 4;
repeated RatingSignature ratingSignatures = 5;
}
message OrderReject {
string orderID = 1;
google.protobuf.Timestamp timestamp = 2;
repeated BitcoinSignature sigs = 3;
}
message RatingSignature {
TransactionMetadata metadata = 1;
bytes signature = 2;
message TransactionMetadata {
string listingSlug = 1;
bytes ratingKey = 2;
bytes moderatorKey = 3; // Only if moderated
string listingTitle = 4;
Image thumbnail = 5;
message Image {
string tiny = 1;
string small = 2;
string medium = 3;
string large = 4;
string original = 5;
}
}
}
message BitcoinSignature {
uint32 inputIndex = 1;
bytes signature = 2;
}
message OrderFulfillment {
string orderId = 1;
string slug = 2;
google.protobuf.Timestamp timestamp = 3;
// Physical goods only
repeated PhysicalDelivery physicalDelivery = 4;
//Digital goods only
repeated DigitalDelivery digitalDelivery = 5;
// Moderated payments only
Payout payout = 6;
RatingSignature ratingSignature = 7;
string note = 8;
// Cryptocurrencies only
repeated CryptocurrencyDelivery cryptocurrencyDelivery = 9;
message PhysicalDelivery {
string shipper = 1;
string trackingNumber = 2;
}
message DigitalDelivery {
string url = 1;
string password = 2;
}
message CryptocurrencyDelivery {
string transactionID = 1;
}
message Payout {
repeated BitcoinSignature sigs = 1;
string payoutAddress = 2;
uint64 payoutFeePerByte = 3;
}
}
message OrderCompletion {
string orderId = 1;
google.protobuf.Timestamp timestamp = 2;
repeated BitcoinSignature payoutSigs = 3;
repeated Rating ratings = 4;
}
message OrderProcessingFailure {
string orderID = 1;
Message.MessageType attemptedMessageType = 2;
RicardianContract contract = 3;
}
message Rating {
RatingData ratingData = 1;
bytes signature = 2;
message RatingData {
bytes ratingKey = 1;
ID vendorID = 2;
RatingSignature vendorSig = 3;
ID buyerID = 4; // optional
string buyerName = 5; // optional
bytes buyerSig = 6; // optional
bytes moderatorSig = 7; // only if a dispute was won
google.protobuf.Timestamp timestamp = 8;
uint32 overall = 9;
uint32 quality = 10;
uint32 description = 11;
uint32 deliverySpeed = 12;
uint32 customerService = 13;
string review = 14;
}
}
message Dispute {
google.protobuf.Timestamp timestamp = 1;
string claim = 2;
string payoutAddress = 3;
repeated Outpoint outpoints = 4;
bytes serializedContract = 5;
}
message DisputeResolution {
google.protobuf.Timestamp timestamp = 1;
string orderId = 2;
string proposedBy = 3;
string resolution = 4;
Payout payout = 5;
repeated bytes moderatorRatingSigs = 6; // Used in ratings
message Payout {
repeated BitcoinSignature sigs = 1;
repeated Outpoint inputs = 2;
Output buyerOutput = 3;
Output vendorOutput = 4;
Output moderatorOutput = 5;
message Output {
oneof scriptOrAddress {
string script = 1;
string address = 3;
}
uint64 amount = 2;
}
}
}
message DisputeAcceptance {
google.protobuf.Timestamp timestamp = 1;
string closedBy = 2;
}
message Outpoint {
string hash = 1; // Hex encoded
uint32 index = 2;
uint64 value = 3;
}
message Refund {
string orderID = 1;
google.protobuf.Timestamp timestamp = 2;
repeated BitcoinSignature sigs = 3;
TransactionInfo refundTransaction = 4;
string memo = 5;
message TransactionInfo {
string txid = 1;
uint64 value = 2;
}
}
message VendorFinalizedPayment {
string orderID = 1; // OrderID which has its funds released to the vendor
}
message ID {
string peerID = 1;
string handle = 2;
Pubkeys pubkeys = 3;
bytes bitcoinSig = 4; // Bitcoin signature covering peerID
message Pubkeys {
bytes identity = 1; // IPFS public key
bytes bitcoin = 2; // Bitcoin public key
}
}
message Signature {
Section section = 1;
bytes signatureBytes = 2;
enum Section {
LISTING = 0;
ORDER = 1;
ORDER_CONFIRMATION = 2;
ORDER_FULFILLMENT = 3;
ORDER_COMPLETION = 4;
DISPUTE = 5;
DISPUTE_RESOLUTION = 6;
REFUND = 7;
}
}
message SignedListing {
Listing listing = 1;
string hash = 2;
bytes signature = 3;
}
syntax = "proto3";
option go_package = "pb";
import "google/protobuf/timestamp.proto";
import "contracts.proto";
message Post {
string slug = 1;
ID vendorID = 2;
string status = 3;
string longForm = 4;
repeated Image images = 5;
repeated string tags = 6;
repeated string channels = 7;
PostType postType = 8;
string reference = 9;
google.protobuf.Timestamp timestamp = 10;
message Image {
string filename = 1;
string original = 2;
string large = 3;
string medium = 4;
string small = 5;
string tiny = 6;
}
enum PostType {
POST = 0;
COMMENT = 1;
REPOST = 2;
}
}
message SignedPost {
Post post = 1;
string hash = 2;
bytes signature = 3;
}
syntax = "proto3";
option go_package = "pb";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
message Message {
MessageType messageType = 1;
google.protobuf.Any payload = 2;
int32 requestId = 3; // optional
bool isResponse = 4; // optional
enum MessageType {
PING = 0;
CHAT = 1;
FOLLOW = 2;
UNFOLLOW = 3;
ORDER = 4;
ORDER_REJECT = 5;
ORDER_CANCEL = 6;
ORDER_CONFIRMATION = 7;
ORDER_FULFILLMENT = 8;
ORDER_COMPLETION = 9;
DISPUTE_OPEN = 10;
DISPUTE_UPDATE = 11;
DISPUTE_CLOSE = 12;
REFUND = 13;
OFFLINE_ACK = 14;
OFFLINE_RELAY = 15;
MODERATOR_ADD = 16;
MODERATOR_REMOVE = 17;
STORE = 18;
BLOCK = 19;
VENDOR_FINALIZED_PAYMENT = 20;
ORDER_PAYMENT = 21;
ERROR = 500;
ORDER_PROCESSING_FAILURE = 501;
}
}
message Envelope {
Message message = 1;
bytes pubkey = 2;
bytes signature = 3;
}
message Chat {
string messageId = 1;
string subject = 2;
string message = 3;
google.protobuf.Timestamp timestamp = 4;
Flag flag = 5;
enum Flag {
MESSAGE = 0;
TYPING = 1;
READ = 2;
}
}
message SignedData {
bytes senderPubkey = 1;
bytes serializedData = 2;
bytes signature = 3;
message Command {
string peerID = 1;
Message.MessageType type = 2;
google.protobuf.Timestamp timestamp = 3;
}
}
message CidList {
repeated string cids = 1;
}
message Block {
bytes rawData = 1;
string cid = 2;
}
message Error {
uint32 code = 1;
string errorMessage = 2;
string orderID = 3;
}
message OrderPaymentTxn {
string coin = 1;
string orderID = 2;
string transactionID = 3;
bool withInput = 4;
}
syntax = "proto3";
option go_package = "pb";
enum CountryCode {
option allow_alias = true;
NA = 0;
AFGHANISTAN = 1;
ALAND_ISLANDS = 2;
ALBANIA = 3;
ALGERIA = 4;
AMERICAN_SAMOA = 5;
ANDORRA = 6;
ANGOLA = 7;
ANGUILLA = 8;
ANTIGUA = 9;
ARGENTINA = 10;
ARMENIA = 11;
ARUBA = 12;
AUSTRALIA = 13;
AUSTRIA = 14;
AZERBAIJAN = 15;
BAHAMAS = 16;
BAHRAIN = 17;
BANGLADESH = 18;
BARBADOS = 19;
BELARUS = 20;
BELGIUM = 21;
BELIZE = 22;
BENIN = 23;
BERMUDA = 24;
BHUTAN = 25;
BOLIVIA = 26;
BONAIRE_SINT_EUSTATIUS_SABA = 27;
BOSNIA = 28;
BOTSWANA = 29;
BOUVET_ISLAND = 30;
BRAZIL = 31;
BRITISH_INDIAN_OCEAN_TERRITORY = 32;
BRUNEI_DARUSSALAM = 33;
BULGARIA = 34;
BURKINA_FASO = 35;
BURUNDI = 36;
CABO_VERDE = 37;
CAMBODIA = 38;
CAMEROON = 39;
CANADA = 40;
CAYMAN_ISLANDS = 41;
CENTRAL_AFRICAN_REPUBLIC = 42;
CHAD = 43;
CHILE = 44;
CHINA = 45;
CHRISTMAS_ISLAND = 46;
COCOS_ISLANDS = 47;
COLOMBIA = 48;
COMOROS = 49;
CONGO_REPUBLIC = 50;
CONGO = 51;
COOK_ISLANDS = 52;
COSTA_RICA = 53;
COTE_DIVOIRE = 54;
CROATIA = 55;
CUBA = 56;
CURACAO = 57;
CYPRUS = 58;
CZECH_REPUBLIC = 59;
DENMARK = 60;
DJIBOUTI = 61;
DOMINICA = 62;
DOMINICAN_REPUBLIC = 63;
ECUADOR = 64;
EGYPT = 65;
EL_SALVADOR = 66;
EQUATORIAL_GUINEA = 67;
ERITREA = 68;
ESTONIA = 69;
ETHIOPIA = 70;
FALKLAND_ISLANDS = 71;
FAROE_ISLANDS = 72;
FIJI = 73;
FINLAND = 74;
FRANCE = 75;
FRENCH_GUIANA = 76;
FRENCH_POLYNESIA = 77;
FRENCH_SOUTHERN_TERRITORIES = 78;
GABON = 79;
GAMBIA = 80;
GEORGIA = 81;
GERMANY = 82;
GHANA = 83;
GIBRALTAR = 84;
GREECE = 85;
GREENLAND = 86;
GRENADA = 87;
GUADELOUPE = 88;
GUAM = 89;
GUATEMALA = 90;
GUERNSEY = 91;
GUINEA = 92;
GUINEA_BISSAU = 93;
GUYANA = 94;
HAITI = 95;
HEARD_ISLAND = 96;
HOLY_SEE = 97;
HONDURAS = 98;
HONG_KONG = 99;
HUNGARY = 100;
ICELAND = 101;
INDIA = 102;
INDONESIA = 103;
IRAN = 104;
IRAQ = 105;
IRELAND = 106;
ISLE_OF_MAN = 107;
ISRAEL = 108;
ITALY = 109;
JAMAICA = 110;
JAPAN = 111;
JERSEY = 112;
JORDAN = 113;
KAZAKHSTAN = 114;
KENYA = 115;
KIRIBATI = 116;
NORTH_KOREA = 117;
SOUTH_KOREA = 118;
KUWAIT = 119;
KYRGYZSTAN = 120;
LAO = 121;
LATVIA = 122;
LEBANON = 123;
LESOTHO = 124;
LIBERIA = 125;
LIBYA = 126;
LIECHTENSTEIN = 127;
LITHUANIA = 128;
LUXEMBOURG = 129;
MACAO = 130;
MACEDONIA = 131;
MADAGASCAR = 132;
MALAWI = 133;
MALAYSIA = 134;
MALDIVES = 135;
MALI = 136;
MALTA = 137;
MARSHALL_ISLANDS = 138;
MARTINIQUE = 139;
MAURITANIA = 140;
MAURITIUS = 141;
MAYOTTE = 142;
MEXICO = 143;
MICRONESIA = 144;
MOLDOVA = 145;
MONACO = 146;
MONGOLIA = 147;
MONTENEGRO = 148;
MONTSERRAT = 149;
MOROCCO = 150;
MOZAMBIQUE = 151;
MYANMAR = 152;
NAMIBIA = 153;
NAURU = 154;
NEPAL = 155;
NETHERLANDS = 156;
NEW_CALEDONIA = 157;
NEW_ZEALAND = 158;
NICARAGUA = 159;
NIGER = 160;
NIGERIA = 161;
NIUE = 162;
NORFOLK_ISLAND = 163;
NORTHERN_MARIANA_ISLANDS = 164;
NORWAY = 165;
OMAN = 166;
PAKISTAN = 167;
PALAU = 168;
PANAMA = 169;
PAPUA_NEW_GUINEA = 170;
PARAGUAY = 171;
PERU = 172;
PHILIPPINES = 173;
PITCAIRN = 174;
POLAND = 175;
PORTUGAL = 176;
PUERTO_RICO = 177;
QATAR = 178;
REUNION = 179;
ROMANIA = 180;
RUSSIA = 181;
RWANDA = 182;
SAINT_BARTHELEMY = 183;
SAINT_HELENA = 184;
SAINT_KITTS = 185;
SAINT_LUCIA = 186;
SAINT_MARTIN = 187;
SAINT_PIERRE = 188;
SAINT_VINCENT = 189;
SAMOA = 190;
SAN_MARINO = 191;
SAO_TOME = 192;
SAUDI_ARABIA = 193;
SENEGAL = 194;
SERBIA = 195;
SEYCHELLES = 196;
SIERRA_LEONE = 197;
SINGAPORE = 198;
SINT_MAARTEN = 199;
SUCRE = 200;
SLOVAKIA = 201;
SLOVENIA = 202;
SOLOMON_ISLANDS = 203;
SOMALIA = 204;
SOUTH_AFRICA = 205;
SOUTH_SUDAN = 206;
SPAIN = 207;
SRI_LANKA = 208;
SUDAN = 209;
SURINAME = 210;
SVALBARD = 211;
ESWATINI = 212;
SWAZILAND = 212;
SWEDEN = 213;
SWITZERLAND = 214;
SYRIAN_ARAB_REPUBLIC = 215;
TAIWAN = 216;
TAJIKISTAN = 217;
TANZANIA = 218;
THAILAND = 219;
TIMOR_LESTE = 220;
TOGO = 221;
TOKELAU = 222;
TONGA = 223;
TRINIDAD = 224;
TUNISIA = 225;
TURKEY = 226;
TURKMENISTAN = 227;
TURKS_AND_CAICOS_ISLANDS = 228;
TUVALU = 229;
UGANDA = 230;
UKRAINE = 231;
UNITED_ARAB_EMIRATES = 232;
UNITED_KINGDOM = 233;
UNITED_STATES = 234;
URUGUAY = 235;
UZBEKISTAN = 236;
VANUATU = 237;
VENEZUELA = 238;
VIETNAM = 239;
VIRGIN_ISLANDS_BRITISH = 240;
VIRGIN_ISLANDS_US = 241;
WALLIS_AND_FUTUNA = 242;
WESTERN_SAHARA = 243;
YEMEN = 244;
ZAMBIA = 245;
ZIMBABWE = 246;
UNITED_STATES_MINOR_ISLANDS = 247;
ALL = 500;
AFRICA = 501;
ASIA = 502;
CENTRAL_AMERICA = 503;
EUROPE = 504;
MIDDLE_EAST = 505;
NORTH_AMERICA = 506;
SOUTH_AMERICA = 507;
OCEANIA = 508;
}
syntax = "proto3";
option go_package = "pb";
import "google/protobuf/timestamp.proto";
import "moderator.proto";
message Profile {
string peerID = 1;
string handle = 2;
string name = 3;
string location = 4;
string about = 5;
string shortDescription = 6;
bool nsfw = 7;
bool vendor = 8;
bool moderator = 9;
Moderator moderatorInfo = 10;
Contact contactInfo = 11;
Colors colors = 12;
// The following data is added to the profile
// automatically by the server and may be omitted
// when setting the profile via API.
Image avatarHashes = 13;
Image headerHashes = 14;
Stats stats = 15;
string bitcoinPubkey = 16;
google.protobuf.Timestamp lastModified = 17;
repeated string currencies = 18;
message Contact {
string website = 1;
string email = 2;
string phoneNumber = 3;
repeated SocialAccount social = 4;
}
message SocialAccount {
string type = 1;
string username = 2;
string proof = 3;
}
message Image {
string tiny = 1;
string small = 2;
string medium = 3;
string large = 4;
string original = 5;
}
message Colors {
string primary = 1;
string secondary = 2;
string text = 3;
string highlight = 4;
string highlightText = 5;
}
message Stats {
uint32 followerCount = 1;
uint32 followingCount = 2;
uint32 listingCount = 3;
uint32 ratingCount = 4;
uint32 postCount = 5;
float averageRating = 6;
}
}
syntax = "proto3";
option go_package = "pb";
import "contracts.proto";
message Moderator {
string description = 1;
string termsAndConditions = 2;
repeated string languages = 3;
repeated string acceptedCurrencies = 4;
Fee fee = 5;
message Fee {
Price fixedFee = 1;
float percentage = 2;
FeeType feeType = 3;
enum FeeType {
FIXED = 0;
PERCENTAGE = 1;
FIXED_PLUS_PERCENTAGE = 2;
}
}
message Price {
string currencyCode = 1;
uint64 amount = 2; // Bitcoins must be in satoshi
}
}
message DisputeUpdate {
string orderId = 1;
string payoutAddress = 2;
repeated Outpoint outpoints = 3;
bytes serializedContract = 4;
}
syntax = "proto3";
option go_package = "pb";
enum OrderState {
// Order has been funded and sent to the vendor but vendor has not yet responded
PENDING = 0;
// Waiting for the buyer to fund the payment address
AWAITING_PAYMENT = 1;
// Waiting for the customer to pick up the order (customer pickup option only)
AWAITING_PICKUP = 2;
// Order has been fully funded and we're waiting for the vendor to fulfill
AWAITING_FULFILLMENT = 3;
// Vendor has fulfilled part of the order
PARTIALLY_FULFILLED = 4;
// Vendor has fulfilled the order
FULFILLED = 5;
// Buyer has completed the order and left a review
COMPLETED = 6;
// Buyer canceled the order (offline order only)
CANCELED = 7;
// Vendor declined to confirm the order (offline order only)
DECLINED = 8;
// Vendor refunded the order
REFUNDED = 9;
// Contract is under active dispute
DISPUTED = 10;
// The moderator has resolved the dispute and we are waiting for the winning party to
// accept the payout.
DECIDED = 11;
// The winning party has accepted the dispute and it is now complete. After the buyer
// leaves a review the state should be set to COMPLETE.
RESOLVED = 12;
// Escrow has been released after waiting the timeout period. After the buyer
// leaves a review the state should be set to COMPLETE.
PAYMENT_FINALIZED = 13;
// We screwed up and produced a order which didn't validate. This state is only used for offline orders. If a processing
// error occurred with an open connection between buyer and vendor the vendor just rejects the order on the spot neither party
// commits the order to the database.
PROCESSING_ERROR = 14;
}
syntax = "proto3";
option go_package = "pb";
import "contracts.proto";
import "orders.proto";
import "profile.proto";
import "google/protobuf/timestamp.proto";
// This schema is used for the /ob/listing api call structure
// We use protobuf for this instead of a basic struct because
// the listing object is in protobuf and we can't mix types. Also
// we want to avoid putting fields in the contract that are only
// used by the api.
message Coupon {
string hash = 1;
string code = 2;
}
message OrderRespApi {
RicardianContract contract = 1;
OrderState state = 2;
bool read = 3;
bool funded = 4;
uint64 unreadChatMessages = 5;
repeated TransactionRecord paymentAddressTransactions = 6;
TransactionRecord refundAddressTransaction = 7;
}
message CaseRespApi {
google.protobuf.Timestamp timestamp = 1;
RicardianContract buyerContract = 2;
RicardianContract vendorContract = 3;
repeated string buyerContractValidationErrors = 4;
repeated string vendorContractValidationErrors = 5;
OrderState state = 6;
bool read = 7;
bool buyerOpened = 8;
string claim = 9;
uint64 unreadChatMessages = 10;
DisputeResolution resolution = 11;
}
message TransactionRecord {
string txid = 1;
int64 value = 2;
uint32 confirmations = 3;
uint32 height = 4;
google.protobuf.Timestamp timestamp = 5;
}
message PeerAndProfile {
string peerId = 1;
Profile profile = 2;
}
message PeerAndProfileWithID {
string id = 1;
string peerId = 2;
Profile profile = 3;
}
message RatingWithID {
string id = 1;
string ratingId = 2;
Rating rating = 3;
}