forked from bisq-network/bisq
/
pb.proto
1891 lines (1620 loc) · 51 KB
/
pb.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
package io.bisq.protobuffer;
//
// Protobuffer v3 definitions of network messages and persisted objects.
//
option java_package = "io.bisq.generated.protobuffer";
option java_outer_classname = "PB";
///////////////////////////////////////////////////////////////////////////////////////////
// Network messages
///////////////////////////////////////////////////////////////////////////////////////////
// Those are messages sent over wire
message NetworkEnvelope {
int32 message_version = 1;
oneof message {
PreliminaryGetDataRequest preliminary_get_data_request = 2;
GetDataResponse get_data_response = 3;
GetUpdatedDataRequest get_updated_data_request = 4;
GetPeersRequest get_peers_request = 5;
GetPeersResponse get_peers_response = 6;
Ping ping = 7;
Pong pong = 8;
OfferAvailabilityRequest offer_availability_request = 9;
OfferAvailabilityResponse offer_availability_response = 10;
RefreshOfferMessage refresh_offer_message = 11;
AddDataMessage add_data_message = 12;
RemoveDataMessage remove_data_message = 13;
RemoveMailboxDataMessage remove_mailbox_data_message = 14;
CloseConnectionMessage close_connection_message = 15;
PrefixedSealedAndSignedMessage prefixed_sealed_and_signed_message = 16;
PayDepositRequest pay_deposit_request = 17;
PublishDepositTxRequest publish_deposit_tx_request = 18;
DepositTxPublishedMessage deposit_tx_published_message = 19;
CounterCurrencyTransferStartedMessage counter_currency_transfer_started_message = 20;
PayoutTxPublishedMessage payout_tx_published_message = 21;
OpenNewDisputeMessage open_new_dispute_message = 22;
PeerOpenedDisputeMessage peer_opened_dispute_message = 23;
DisputeCommunicationMessage dispute_communication_message = 24;
DisputeResultMessage dispute_result_message = 25;
PeerPublishedDisputePayoutTxMessage peer_published_dispute_payout_tx_message = 26;
PrivateNotificationMessage private_notification_message = 27;
GetBlocksRequest get_blocks_request = 28;
GetBlocksResponse get_blocks_response = 29;
NewBlockBroadcastMessage new_block_broadcast_message = 30;
AddPersistableNetworkPayloadMessage add_persistable_network_payload_message = 31;
AckMessage ack_message = 32;
RepublishGovernanceDataRequest republish_governance_data_request = 33;
NewDaoStateHashMessage new_dao_state_hash_message = 34;
GetDaoStateHashesRequest get_dao_state_hashes_request = 35;
GetDaoStateHashesResponse get_dao_state_hashes_response = 36;
NewProposalStateHashMessage new_proposal_state_hash_message = 37;
GetProposalStateHashesRequest get_proposal_state_hashes_request = 38;
GetProposalStateHashesResponse get_proposal_state_hashes_response = 39;
NewBlindVoteStateHashMessage new_blind_vote_state_hash_message = 40;
GetBlindVoteStateHashesRequest get_blind_vote_state_hashes_request = 41;
GetBlindVoteStateHashesResponse get_blind_vote_state_hashes_response = 42;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Implementations of NetworkEnvelope
///////////////////////////////////////////////////////////////////////////////////////////
// get data
message PreliminaryGetDataRequest {
int32 nonce = 21;
repeated bytes excluded_keys = 2;
repeated int32 supported_capabilities = 3;
}
message GetDataResponse {
int32 request_nonce = 1;
bool is_get_updated_data_response = 2;
repeated StorageEntryWrapper data_set = 3;
repeated int32 supported_capabilities = 4;
repeated PersistableNetworkPayload persistable_network_payload_items = 5;
}
message GetUpdatedDataRequest {
NodeAddress sender_node_address = 1;
int32 nonce = 2;
repeated bytes excluded_keys = 3;
}
// peers
message GetPeersRequest {
NodeAddress sender_node_address = 1;
int32 nonce = 2;
repeated int32 supported_capabilities = 3;
repeated Peer reported_peers = 4;
}
message GetPeersResponse {
int32 request_nonce = 1;
repeated Peer reported_peers = 2;
repeated int32 supported_capabilities = 3;
}
message Ping {
int32 nonce = 1;
int32 last_round_trip_time = 2;
}
message Pong {
int32 request_nonce = 1;
}
// offer
message OfferAvailabilityRequest {
string offer_id = 1;
PubKeyRing pub_key_ring = 2;
int64 takers_trade_price = 3;
repeated int32 supported_capabilities = 4;
string uid = 5;
}
message OfferAvailabilityResponse {
string offer_id = 1;
AvailabilityResult availability_result = 2;
repeated int32 supported_capabilities = 3;
string uid = 4;
NodeAddress arbitrator = 5;
}
message RefreshOfferMessage {
bytes hash_of_data_and_seq_nr = 1;
bytes signature = 2;
bytes hash_of_payload = 3;
int32 sequence_number = 4;
}
// storage
message AddDataMessage {
StorageEntryWrapper entry = 1;
}
message RemoveDataMessage {
ProtectedStorageEntry protected_storage_entry = 1;
}
message RemoveMailboxDataMessage {
ProtectedMailboxStorageEntry protected_storage_entry = 1;
}
message AddPersistableNetworkPayloadMessage {
PersistableNetworkPayload payload = 1;
}
// misc
message CloseConnectionMessage {
string reason = 1;
}
message AckMessage {
string uid = 1;
NodeAddress sender_node_address = 2;
string source_type = 3; // enum name. e.g. TradeMessage, DisputeMessage,...
string source_msg_class_name = 4;
string source_uid = 5; // uid of source (TradeMessage)
string source_id = 6; // id of source (tradeId, disputeId)
bool success = 7; // true if source message was processed successfully
string error_message = 8; // optional error message if source message processing failed
}
message PrefixedSealedAndSignedMessage {
NodeAddress node_address = 1;
SealedAndSigned sealed_and_signed = 2;
bytes address_prefix_hash = 3;
string uid = 4;
}
// trade
message PayDepositRequest {
string trade_id = 1;
NodeAddress sender_node_address = 2;
int64 trade_amount = 3;
int64 trade_price = 4;
int64 tx_fee = 5;
int64 taker_fee = 6;
bool is_currency_for_taker_fee_btc = 7;
repeated RawTransactionInput raw_transaction_inputs = 8;
int64 change_output_value = 9;
string change_output_address = 10;
bytes taker_multi_sig_pub_key = 11;
string taker_payout_address_string = 12;
PubKeyRing taker_pub_key_ring = 13;
PaymentAccountPayload taker_payment_account_payload = 14;
string taker_account_id = 15;
string taker_fee_tx_id = 16;
repeated NodeAddress accepted_arbitrator_node_addresses = 17;
repeated NodeAddress accepted_mediator_node_addresses = 18;
NodeAddress arbitrator_node_address = 19;
NodeAddress mediator_node_address = 20;
string uid = 21;
bytes account_age_witness_signature_of_offer_id = 22;
int64 current_date = 23;
}
message PublishDepositTxRequest {
string trade_id = 1;
PaymentAccountPayload maker_payment_account_payload = 2;
string maker_account_id = 3;
string maker_contract_as_json = 4;
string maker_contract_signature = 5;
string maker_payout_address_string = 6;
bytes prepared_deposit_tx = 7;
repeated RawTransactionInput maker_inputs = 8;
bytes maker_multi_sig_pub_key = 9;
NodeAddress sender_node_address = 10;
string uid = 11;
bytes account_age_witness_signature_of_prepared_deposit_tx = 12;
int64 current_date = 13;
}
message DepositTxPublishedMessage {
string trade_id = 1;
bytes deposit_tx = 2;
NodeAddress sender_node_address = 3;
string uid = 4;
}
message CounterCurrencyTransferStartedMessage {
string trade_id = 1;
string buyer_payout_address = 2;
NodeAddress sender_node_address = 3;
bytes buyer_signature = 4;
string counter_currency_tx_id = 5;
string uid = 6;
}
message FinalizePayoutTxRequest {
string trade_id = 1;
bytes seller_signature = 2;
string seller_payout_address = 3;
NodeAddress sender_node_address = 4;
string uid = 5;
}
message PayoutTxPublishedMessage {
string trade_id = 1;
bytes payout_tx = 2;
NodeAddress sender_node_address = 3;
string uid = 4;
}
// dispute
message OpenNewDisputeMessage {
Dispute dispute = 1;
NodeAddress sender_node_address = 2;
string uid = 3;
}
message PeerOpenedDisputeMessage {
Dispute dispute = 1;
NodeAddress sender_node_address = 2;
string uid = 3;
}
message DisputeCommunicationMessage {
int64 date = 1;
string trade_id = 2;
int32 trader_id = 3;
bool sender_is_trader = 4;
string message = 5;
repeated Attachment attachments = 6;
bool arrived = 7;
bool stored_in_mailbox = 8;
bool is_system_message = 9;
NodeAddress sender_node_address = 10;
string uid = 11;
string send_message_error = 12;
bool acknowledged = 13;
string ack_error = 14;
}
message DisputeResultMessage {
string uid = 1;
DisputeResult dispute_result = 2;
NodeAddress sender_node_address = 3;
}
message PeerPublishedDisputePayoutTxMessage {
string uid = 1;
bytes transaction = 2;
string trade_id = 3;
NodeAddress sender_node_address = 4;
}
message PrivateNotificationMessage {
string uid = 1;
NodeAddress sender_node_address = 2;
PrivateNotificationPayload private_notification_payload = 3;
}
// DAO
message GetBlocksRequest {
int32 from_block_height = 1;
int32 nonce = 2;
}
message GetBlocksResponse {
// Because of the way how PB implements inheritence we need to use the super class as type
repeated BaseBlock raw_blocks = 1;
int32 request_nonce = 2;
}
message NewBlockBroadcastMessage {
// Because of the way how PB implements inheritence we need to use the super class as type
BaseBlock raw_block = 1;
}
message RepublishGovernanceDataRequest {
}
message NewDaoStateHashMessage {
DaoStateHash state_hash = 1;
}
message NewProposalStateHashMessage {
ProposalStateHash state_hash = 1;
}
message NewBlindVoteStateHashMessage {
BlindVoteStateHash state_hash = 1;
}
message GetDaoStateHashesRequest {
int32 height = 1;
int32 nonce = 2;
}
message GetProposalStateHashesRequest {
int32 height = 1;
int32 nonce = 2;
}
message GetBlindVoteStateHashesRequest {
int32 height = 1;
int32 nonce = 2;
}
message GetDaoStateHashesResponse {
repeated DaoStateHash state_hashes = 1;
int32 request_nonce = 2;
}
message GetProposalStateHashesResponse {
repeated ProposalStateHash state_hashes = 1;
int32 request_nonce = 2;
}
message GetBlindVoteStateHashesResponse {
repeated BlindVoteStateHash state_hashes = 1;
int32 request_nonce = 2;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Payload
///////////////////////////////////////////////////////////////////////////////////////////
// core
message NodeAddress {
string host_name = 1;
int32 port = 2;
}
message Peer {
NodeAddress node_address = 1;
int64 date = 2;
repeated int32 supported_capabilities = 3;
}
message PubKeyRing {
bytes signature_pub_key_bytes = 1;
bytes encryption_pub_key_bytes = 2;
string pgp_pub_key_as_pem = 3;
}
message SealedAndSigned {
bytes encrypted_secret_key = 1;
bytes encrypted_payload_with_hmac = 2;
bytes signature = 3;
bytes sig_public_key_bytes = 4;
}
// storage
message StoragePayload {
oneof message {
Alert alert = 1;
Arbitrator arbitrator = 2;
Mediator mediator = 3;
Filter filter = 4;
// not used anymore from v0.6 on. But leave it for receiving TradeStatistics objects from older
// versions and convert it to TradeStatistics2 objects.
TradeStatistics trade_statistics = 5;
MailboxStoragePayload mailbox_storage_payload = 6;
OfferPayload offer_payload = 7;
TempProposalPayload temp_proposal_payload = 8;
}
}
message PersistableNetworkPayload {
oneof message {
AccountAgeWitness account_age_witness = 1;
TradeStatistics2 trade_statistics2 = 2;
ProposalPayload proposal_payload = 3;
BlindVotePayload blind_vote_payload = 4;
}
}
message ProtectedStorageEntry {
StoragePayload storagePayload = 1;
bytes owner_pub_key_bytes = 2;
int32 sequence_number = 3;
bytes signature = 4;
int64 creation_time_stamp = 5;
}
// mailbox
message StorageEntryWrapper {
oneof message {
ProtectedStorageEntry protected_storage_entry = 1;
ProtectedMailboxStorageEntry protected_mailbox_storage_entry = 2;
}
}
message ProtectedMailboxStorageEntry {
ProtectedStorageEntry entry = 1;
bytes receivers_pub_key_bytes = 2;
}
message DataAndSeqNrPair {
StoragePayload payload = 1;
int32 sequence_number = 2;
}
// misc
message PrivateNotificationPayload {
string message = 1;
string signature_as_base64 = 2;
bytes sig_public_key_bytes = 3;
}
message PaymentAccountFilter {
string payment_method_id = 1;
string get_method_name = 2;
string value = 3;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Storage payload
///////////////////////////////////////////////////////////////////////////////////////////
message Alert {
string message = 1;
string version = 2;
bool is_update_info = 3;
string signature_as_base64 = 4;
bytes owner_pub_key_bytes = 5;
map<string, string> extra_data = 6;
}
message Arbitrator {
NodeAddress node_address = 1;
repeated string language_codes = 2;
int64 registration_date = 3;
string registration_signature = 4;
bytes registration_pub_key = 5;
PubKeyRing pub_key_ring = 6;
bytes btc_pub_key = 7;
string btc_address = 8;
string email_address = 9;
string info = 10;
map<string, string> extra_data = 11;
}
message Mediator {
NodeAddress node_address = 1;
repeated string language_codes = 2;
int64 registration_date = 3;
string registration_signature = 4;
bytes registration_pub_key = 5;
PubKeyRing pub_key_ring = 6;
string email_address = 7;
string info = 8;
map<string, string> extra_data = 9;
}
message Filter {
repeated string banned_node_address = 1;
repeated string banned_offer_ids = 2;
repeated PaymentAccountFilter banned_payment_accounts = 3;
string signature_as_base64 = 4;
bytes owner_pub_key_bytes = 5;
map<string, string> extra_data = 6;
repeated string banned_currencies = 7;
repeated string banned_payment_methods = 8;
repeated string arbitrators = 9;
repeated string seed_nodes = 10;
repeated string price_relay_nodes = 11;
bool prevent_public_btc_network = 12;
repeated string btc_nodes = 13;
bool disable_dao = 14;
string disable_dao_below_version = 15;
string disable_trade_below_version = 16;
}
// not used anymore from v0.6 on. But leave it for receiving TradeStatistics objects from older
// versions and convert it to TradeStatistics2 objects.
message TradeStatistics {
string base_currency = 1;
string counter_currency = 2;
OfferPayload.Direction direction = 3;
int64 trade_price = 4;
int64 trade_amount = 5;
int64 trade_date = 6;
string payment_method_id = 7;
int64 offer_date = 8;
bool offer_use_market_based_price = 9;
double offer_market_price_margin = 10;
int64 offer_amount = 11;
int64 offer_min_amount = 12;
string offer_id = 13;
string deposit_tx_id = 14;
bytes signature_pub_key_bytes = 15;
map<string, string> extra_data = 16;
}
message TradeStatistics2 {
string base_currency = 1;
string counter_currency = 2;
OfferPayload.Direction direction = 3;
int64 trade_price = 4;
int64 trade_amount = 5;
int64 trade_date = 6;
string payment_method_id = 7;
int64 offer_date = 8;
bool offer_use_market_based_price = 9;
double offer_market_price_margin = 10;
int64 offer_amount = 11;
int64 offer_min_amount = 12;
string offer_id = 13;
string deposit_tx_id = 14;
bytes hash = 15;
map<string, string> extra_data = 16;
}
message MailboxStoragePayload {
PrefixedSealedAndSignedMessage prefixed_sealed_and_signed_message = 1;
bytes sender_pub_key_for_add_operation_bytes = 2;
bytes owner_pub_key_bytes = 3;
map<string, string> extra_data = 4;
}
message OfferPayload {
enum Direction {
PB_ERROR = 0;
BUY = 1;
SELL = 2;
}
string id = 1;
int64 date = 2;
NodeAddress owner_node_address = 3;
PubKeyRing pub_key_ring = 4;
Direction direction = 5;
int64 price = 6;
double market_price_margin = 7;
bool use_market_based_price = 8;
int64 amount = 9;
int64 min_amount = 10;
string base_currency_code = 11;
string counter_currency_code = 12;
repeated NodeAddress arbitrator_node_addresses = 13;
repeated NodeAddress mediator_node_addresses = 14;
string payment_method_id = 15;
string maker_payment_account_id = 16;
string offer_fee_payment_tx_id = 17;
string country_code = 18;
repeated string accepted_country_codes = 19;
string bank_id = 20;
repeated string accepted_bank_ids = 21;
string version_nr = 22;
int64 block_height_at_offer_creation = 23;
int64 tx_fee = 24;
int64 maker_fee = 25;
bool is_currency_for_maker_fee_btc = 26;
int64 buyer_security_deposit = 27;
int64 seller_security_deposit = 28;
int64 max_trade_limit = 29;
int64 max_trade_period = 30;
bool use_auto_close = 31;
bool use_re_open_after_auto_close = 32;
int64 lower_close_price = 33;
int64 upper_close_price = 34;
bool is_private_offer = 35;
string hash_of_challenge = 36;
map<string, string> extra_data = 37;
int32 protocol_version = 38;
}
message AccountAgeWitness {
bytes hash = 1;
int64 date = 2;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Dispute payload
///////////////////////////////////////////////////////////////////////////////////////////
message Dispute {
string trade_id = 1;
string id = 2;
int32 trader_id = 3;
bool dispute_opener_is_buyer = 4;
bool dispute_opener_is_maker = 5;
int64 opening_date = 6;
PubKeyRing trader_pub_key_ring = 7;
int64 trade_date = 8;
Contract contract = 9;
bytes contract_hash = 10;
bytes deposit_tx_serialized = 11;
bytes payout_tx_serialized = 12;
string deposit_tx_id = 13;
string payout_tx_id = 14;
string contract_as_json = 15;
string maker_contract_signature = 16;
string taker_contract_signature = 17;
PubKeyRing arbitrator_pub_key_ring = 18;
bool is_support_ticket = 19;
repeated DisputeCommunicationMessage dispute_communication_messages = 20;
bool is_closed = 21;
DisputeResult dispute_result = 22;
string dispute_payout_tx_id = 23;
}
message Attachment {
string file_name = 1;
bytes bytes = 2;
}
message DisputeResult {
enum Winner {
PB_ERROR_WINNER = 0;
BUYER = 1;
SELLER = 2;
}
enum Reason {
PB_ERROR_REASON = 0;
OTHER = 1;
BUG = 2;
USABILITY = 3;
SCAM = 4;
PROTOCOL_VIOLATION = 5;
NO_REPLY = 6;
BANK_PROBLEMS = 7;
}
string trade_id = 1;
int32 trader_id = 2;
Winner winner = 3;
int32 reason_ordinal = 4;
bool tamper_proof_evidence = 5;
bool id_verification = 6;
bool screen_cast = 7;
string summary_notes = 8;
DisputeCommunicationMessage dispute_communication_message = 9;
bytes arbitrator_signature = 10;
int64 buyer_payout_amount = 11;
int64 seller_payout_amount = 12;
bytes arbitrator_pub_key = 13;
int64 close_date = 14;
bool is_loser_publisher = 15;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Trade payload
///////////////////////////////////////////////////////////////////////////////////////////
message Contract {
OfferPayload offer_payload = 1;
int64 trade_amount = 2;
int64 trade_price = 3;
string taker_fee_tx_id = 4;
NodeAddress arbitrator_node_address = 5;
bool is_buyer_maker_and_seller_taker = 6;
string maker_account_id = 7;
string taker_account_id = 8;
PaymentAccountPayload maker_payment_account_payload = 9;
PaymentAccountPayload taker_payment_account_payload = 10;
PubKeyRing maker_pub_key_ring = 11;
PubKeyRing taker_pub_key_ring = 12;
NodeAddress buyer_node_address = 13;
NodeAddress seller_node_address = 14;
string maker_payout_address_string = 15;
string taker_payout_address_string = 16;
bytes maker_multi_sig_pub_key = 17;
bytes taker_multi_sig_pub_key = 18;
NodeAddress mediator_node_address = 19;
}
message RawTransactionInput {
int64 index = 1;
bytes parent_transaction = 2;
int64 value = 3;
}
enum AvailabilityResult {
PB_ERROR = 0;
UNKNOWN_FAILURE = 1;
AVAILABLE = 2;
OFFER_TAKEN = 3;
PRICE_OUT_OF_TOLERANCE = 4;
MARKET_PRICE_NOT_AVAILABLE = 5;
NO_ARBITRATORS = 6;
NO_MEDIATORS = 7;
USER_IGNORED = 8;
}
///////////////////////////////////////////////////////////////////////////////////////////
// PaymentAccount payload
///////////////////////////////////////////////////////////////////////////////////////////
message PaymentAccountPayload {
string id = 1;
string payment_method_id = 2;
int64 max_trade_period = 3; // not used anymore but we need to keep it in PB for backward compatibility
oneof message {
AliPayAccountPayload ali_pay_account_payload = 4;
ChaseQuickPayAccountPayload chase_quick_pay_account_payload = 5;
ClearXchangeAccountPayload clear_xchange_account_payload = 6;
CountryBasedPaymentAccountPayload country_based_payment_account_payload = 7;
CryptoCurrencyAccountPayload crypto_currency_account_payload = 8;
FasterPaymentsAccountPayload faster_payments_account_payload = 9;
InteracETransferAccountPayload interac_e_transfer_account_payload = 10;
OKPayAccountPayload o_k_pay_account_payload = 11; // Deprecated, not used anymore
PerfectMoneyAccountPayload perfect_money_account_payload = 12;
SwishAccountPayload swish_account_payload = 13;
USPostalMoneyOrderAccountPayload u_s_postal_money_order_account_payload = 14;
UpholdAccountPayload uphold_account_payload = 16;
CashAppAccountPayload cash_app_account_payload = 17; // Deprecated, not used anymore
MoneyBeamAccountPayload money_beam_account_payload = 18;
VenmoAccountPayload venmo_account_payload = 19; // Deprecated, not used anymore
PopmoneyAccountPayload popmoney_account_payload = 20;
RevolutAccountPayload revolut_account_payload = 21;
WeChatPayAccountPayload we_chat_pay_account_payload = 22;
MoneyGramAccountPayload money_gram_account_payload = 23;
HalCashAccountPayload hal_cash_account_payload = 24;
PromptPayAccountPayload prompt_pay_account_payload = 25;
AdvancedCashAccountPayload advanced_cash_account_payload = 26;
InstantCryptoCurrencyAccountPayload instant_crypto_currency_account_payload = 27;
}
map<string, string> exclude_from_json_data = 15;
}
message AliPayAccountPayload {
string account_nr = 1;
}
message WeChatPayAccountPayload {
string account_nr = 1;
}
message ChaseQuickPayAccountPayload {
string email = 1;
string holder_name = 2;
}
message ClearXchangeAccountPayload {
string holder_name = 1;
string email_or_mobile_nr = 2;
}
message CountryBasedPaymentAccountPayload {
string countryCode = 1;
oneof message {
BankAccountPayload bank_account_payload = 2;
CashDepositAccountPayload cash_deposit_account_payload = 3;
SepaAccountPayload sepa_account_payload = 4;
WesternUnionAccountPayload western_union_account_payload = 5;
SepaInstantAccountPayload sepa_instant_account_payload = 6;
F2FAccountPayload f2f_account_payload = 7;
}
}
message BankAccountPayload {
string holder_name = 1;
string bank_name = 2;
string bank_id = 3;
string branch_id = 4;
string account_nr = 5;
string account_type = 6;
string holder_tax_id = 7;
string email = 8; // not used anymore but keep for backward compatibility
oneof message {
NationalBankAccountPayload national_bank_account_payload = 9;
SameBankAccountPayload same_bank_accont_payload = 10;
SpecificBanksAccountPayload specific_banks_account_payload = 11;
}
string national_account_id = 12;
}
message NationalBankAccountPayload {
}
message SameBankAccountPayload {
}
message SpecificBanksAccountPayload {
repeated string accepted_banks = 1;
}
message CashDepositAccountPayload {
string holder_name = 1;
string holder_email = 2;
string bank_name = 3;
string bank_id = 4;
string branch_id = 5;
string account_nr = 6;
string account_type = 7;
string requirements = 8;
string holder_tax_id = 9;
string national_account_id = 10;
}
message MoneyGramAccountPayload {
string holder_name = 1;
string country_code = 2;
string state = 3;
string email = 4;
}
message HalCashAccountPayload {
string mobile_nr = 1;
}
message WesternUnionAccountPayload {
string holder_name = 1;
string city = 2;
string state = 3;
string email = 4;
}
message SepaAccountPayload {
string holder_name = 1;
string iban = 2;
string bic = 3;
string email = 4; // not used anymore but keep for backward compatibility
repeated string accepted_country_codes = 5;
}
message SepaInstantAccountPayload {
string holder_name = 1;
string iban = 2;
string bic = 3;
repeated string accepted_country_codes = 4;
}
message CryptoCurrencyAccountPayload {
string address = 1;
}
message InstantCryptoCurrencyAccountPayload {
string address = 1;
}
message FasterPaymentsAccountPayload {
string sort_code = 1;
string account_nr = 2;
string email = 3; // not used anymore but keep for backward compatibility
}
message InteracETransferAccountPayload {
string email = 1;
string holder_name = 2;
string question = 3;
string answer = 4;
}
// Deprecated, not used anymore
message OKPayAccountPayload {
string account_nr = 1;
}
message UpholdAccountPayload {
string account_id = 1;
}
// Deprecated, not used anymore
message CashAppAccountPayload {
string cash_tag = 1;
}
message MoneyBeamAccountPayload {
string account_id = 1;
}
// Deprecated, not used anymore
message VenmoAccountPayload {
string venmo_user_name = 1;
string holder_name = 2;
}
message PopmoneyAccountPayload {
string account_id = 1;
string holder_name = 2;
}
message RevolutAccountPayload {
string account_id = 1;
}
message PerfectMoneyAccountPayload {
string account_nr = 1;
}
message SwishAccountPayload {
string mobile_nr = 1;
string holder_name = 2;
}
message USPostalMoneyOrderAccountPayload {
string postal_address = 1;
string holder_name = 2;
}
message F2FAccountPayload {
string contact = 1;
string city = 2;
string extra_info = 3;
}
message PromptPayAccountPayload {
string prompt_pay_id = 1;
}
message AdvancedCashAccountPayload {
string account_nr = 1;
}
///////////////////////////////////////////////////////////////////////////////////////////
// PersistableEnvelope
///////////////////////////////////////////////////////////////////////////////////////////
// Those are persisted to disc
message PersistableEnvelope {
oneof message {
SequenceNumberMap sequence_number_map = 1;
PersistedEntryMap persisted_entry_map = 2; // deprecated. Not used anymore.
PeerList peer_list = 3;
AddressEntryList address_entry_list = 4;
NavigationPath navigation_path = 5;
TradableList tradable_list = 6;
TradeStatisticsList trade_statistics_list = 7; // deprecated Was used in pre v0.6.0 version. Not used anymore.
DisputeList dispute_list = 8;
PreferencesPayload preferences_payload = 9;
UserPayload user_payload = 10;
PaymentAccountList payment_account_list = 11;
// deprecated
// BsqState bsq_state = 12; // not used but as other non-dao data have a higher index number we leave it to make clear that we cannot change following indexes
AccountAgeWitnessStore account_age_witness_store = 13;
TradeStatistics2Store trade_statistics2_store = 14;
// we need to keep id 15 here otherwise the reading of the old data structure would not work anymore.
// can be removed after most people have updated as the reading of the PersistableNetworkPayloadList
// is not mandatory.