-
Notifications
You must be signed in to change notification settings - Fork 1
/
proxy.proto
198 lines (160 loc) · 4.63 KB
/
proxy.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
syntax = "proto3";
package server.proto;
import "token.proto";
import "alias.proto";
import "transfer.proto";
import "account.proto";
import "member.proto";
import "transaction.proto";
import "google/api/annotations.proto";
message GetMemberRequest {
}
message GetMemberResponse {
string member_id = 1;
repeated io.token.proto.common.alias.Alias aliases = 2;
}
message GetTokenRequest {
string token_id = 1;
}
message GetTokenResponse {
io.token.proto.common.token.Token token = 1;
}
message CreateTransferRequest {
string token_id = 1;
}
message CreateTransferResponse {
io.token.proto.common.transfer.Transfer transfer = 1;
}
message RequestTransferTokenRequest {
double amount = 1;
string currency = 2;
string description = 3;
io.token.proto.common.account.BankAccount destination = 4;
string ref_id = 5;
string callback_url = 6;
string bank_id = 7; // Optional, specify the bank id if you want to bypass the bank selection page
}
message RequestTransferTokenResponse {
string token_request_id = 1;
}
message GenerateTokenRequestUrlRequest {
string request_id = 1;
string state = 2;
string csrf_token = 3;
}
message GenerateTokenRequestUrlResponse {
string url = 1;
}
message ParseTokenRequestCallbackRequest {
string url = 1;
string csrf_token = 2;
}
message ParseTokenRequestCallbackResponse {
string token_id = 1;
string state = 2;
}
message RequestAccessTokenRequest {
string callback_url = 1;
string bank_id = 2; // Optional, specify the bank id if you want to bypass the bank selection page
}
message RequestAccessTokenResponse {
string token_request_id = 1;
}
message GetAccountsRequest {
}
message GetAccountsResponse {
repeated io.token.proto.common.account.Account accounts = 1;
}
message GetAccountRequest {
string account_id = 1;
}
message GetAccountResponse {
io.token.proto.common.account.Account account = 1;
}
message GetBalanceRequest {
string account_id = 1;
}
message GetBalanceResponse {
io.token.proto.common.transaction.Balance balance = 1;
}
message GetTransactionsRequest {
string account_id = 1;
int32 limit = 2;
string offset = 3;
}
message GetTransactionsResponse {
repeated io.token.proto.common.transaction.Transaction transactions = 1;
string offset = 2;
}
message GetTransactionRequest {
string account_id = 1;
string transaction_id = 2;
}
message GetTransactionResponse {
io.token.proto.common.transaction.Transaction transaction = 1;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// Proxy Service.
//
service ProxyService {
rpc GetMember (GetMemberRequest) returns (GetMemberResponse) {
option (google.api.http) = {
get: "/member"
};
}
rpc GetToken (GetTokenRequest) returns (GetTokenResponse) {
option (google.api.http) = {
get: "/tokens/{token_id}"
};
}
rpc CreateTransfer (CreateTransferRequest) returns (CreateTransferResponse) {
option (google.api.http) = {
post: "/transfers"
};
}
rpc RequestTransferToken (RequestTransferTokenRequest) returns (RequestTransferTokenResponse) {
option (google.api.http) = {
post: "/transfer-token-requests"
};
}
rpc GenerateTokenRequestUrl (GenerateTokenRequestUrlRequest) returns (GenerateTokenRequestUrlResponse) {
option (google.api.http) = {
get: "/token-request-url?requestId={request_id}&state={state}&csrfToken={csrf_token}"
};
}
rpc ParseTokenRequestCallback (ParseTokenRequestCallbackRequest) returns (ParseTokenRequestCallbackResponse) {
option (google.api.http) = {
get: "/parse-token-request-callback?url={url}&csrfToken={csrf_token}"
};
}
rpc RequestAccessToken (RequestAccessTokenRequest) returns (RequestAccessTokenResponse) {
option (google.api.http) = {
post: "/access-token-requests"
};
}
rpc GetAccounts (GetAccountsRequest) returns (GetAccountsResponse) {
option (google.api.http) = {
get: "/accounts"
};
}
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse) {
option (google.api.http) = {
get: "/accounts/{account_id}"
};
}
rpc GetBalance (GetBalanceRequest) returns (GetBalanceResponse) {
option (google.api.http) = {
get: "/accounts/{account_id}/balance"
};
}
rpc GetTransaction (GetTransactionRequest) returns (GetTransactionResponse) {
option (google.api.http) = {
get: "/accounts/{account_id}/transactions/{transaction_id}"
};
}
rpc GetTransactions (GetTransactionsRequest) returns (GetTransactionsResponse) {
option (google.api.http) = {
get: "/accounts/{account_id}/transactions?offset={offset}&limit={limit}"
};
}
}