forked from hyperledger-iroha/iroha-dco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
responses.proto
91 lines (76 loc) · 2.19 KB
/
responses.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
syntax = "proto3";
package iroha.protocol;
import "block.proto";
import "primitive.proto";
// *** WSV data structure *** //
message Asset {
string asset_id = 1;
string domain_id = 2;
uint32 precision = 3;
}
message Account {
string account_id = 1;
string domain_id = 2;
uint32 quorum = 3;
string json_data = 4;
}
message AccountAsset {
string asset_id = 1;
string account_id = 2;
Amount balance = 3;
}
// *** Responses *** //
message AccountAssetResponse {
AccountAsset account_asset = 1;
}
message AccountDetailResponse {
string detail = 1;
}
message AccountResponse {
Account account = 1;
repeated string account_roles = 2;
}
message AssetResponse {
Asset asset = 1;
}
message RolesResponse {
repeated string roles = 1;
}
message RolePermissionsResponse {
repeated string permissions = 1;
}
message ErrorResponse {
enum Reason {
STATELESS_INVALID = 0;
STATEFUL_INVALID = 1;
NO_ACCOUNT = 2; // when requested account does not exist
NO_ACCOUNT_ASSETS = 3; // when requested account asset does not exist
NO_ACCOUNT_DETAIL = 4; // when requested account detail does not exist
NO_SIGNATORIES = 5; // when requested signatories does not exist
NOT_SUPPORTED = 6; // when unidentified request was received
WRONG_FORMAT = 7; // when json format wrong
NO_ASSET = 8; // when requested asset does not exist
NO_ROLES = 9; // when there are no roles defined in the system
}
Reason reason = 1;
}
message SignatoriesResponse {
repeated bytes keys = 1;
}
message TransactionsResponse {
repeated Transaction transactions = 1;
}
message QueryResponse {
oneof response {
AccountAssetResponse account_assets_response = 1;
AccountDetailResponse account_detail_response = 2;
AccountResponse account_response = 3;
ErrorResponse error_response = 4;
SignatoriesResponse signatories_response = 5;
TransactionsResponse transactions_response = 6;
AssetResponse asset_response = 7;
RolesResponse roles_response = 8;
RolePermissionsResponse role_permissions_response = 9;
}
bytes query_hash = 10;
}