@arbiwallet/contracts 1.0.211 → 1.0.213

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,94 +28,29 @@ export enum ExchangeDealAction {
28
28
  UNRECOGNIZED = -1,
29
29
  }
30
30
 
31
- export interface CreateExchangeOrderRequest {
32
- inputAmount: number;
33
- outputAmount: number;
34
- inputCurrency: string;
35
- outputCurrency: string;
36
- withdrawType: string;
37
- customer: string;
38
- receiveBank?: string | undefined;
39
- }
40
-
41
- export interface CreateExchangeOrderResponse {
42
- success: boolean;
43
- statusCode: number;
44
- orderId?: string | undefined;
45
- message?: string | undefined;
46
- warning?: string | undefined;
47
- error?: string | undefined;
48
- errors: string[];
49
- }
50
-
51
- export interface CreateExchangePaymentRequest {
52
- managerUserId?: string | undefined;
53
- managerId?: string | undefined;
54
- calculationId?: string | undefined;
55
- agentId: number;
56
- amount?: number | undefined;
57
- customerId?: string | undefined;
58
- cryptoNetwork?: string | undefined;
59
- customerSource?: string | undefined;
60
- customerReferrer?: string | undefined;
61
- }
62
-
63
- export interface CreateExchangePaymentResult {
64
- paymentId: string;
65
- paymentUuid: string;
66
- amount: number;
67
- status: number;
68
- agent: string;
69
- walletId?: string | undefined;
70
- cryptoNetwork?: string | undefined;
71
- cryptoAddress?: string | undefined;
72
- arbiLink?: string | undefined;
73
- paymentLink?: string | undefined;
74
- }
75
-
76
- export interface CreateExchangePaymentResponse {
77
- ok: boolean;
78
- result?: CreateExchangePaymentResult | undefined;
79
- error?: string | undefined;
80
- validationErrors?: { [key: string]: any } | undefined;
81
- }
82
-
83
- export interface HandlePaymentWebhookRequest {
84
- jsonPayload: string;
85
- }
86
-
87
- export interface HandlePaymentWebhookResponse {
88
- ok: boolean;
89
- status: string;
90
- }
91
-
92
- export interface GetExchangePaymentsRequest {
93
- page?: number | undefined;
94
- limit?: number | undefined;
95
- }
96
-
97
- export interface GetExchangePaymentsItem {
98
- paymentId: string;
99
- paymentUuid: string;
100
- amount: number;
101
- status: number;
102
- paymentAgentStatus?: string | undefined;
103
- paymentLink?: string | undefined;
104
- qrLink?: string | undefined;
105
- cryptoAddress?: string | undefined;
106
- }
107
-
108
- export interface GetExchangePaymentsResponse {
109
- payments: GetExchangePaymentsItem[];
110
- page: number;
111
- limit: number;
112
- total: number;
113
- totalPages: number;
31
+ export interface ActorContext {
32
+ /** users.CustomUser.id */
33
+ userId: string;
34
+ /** exchanges_manager.id (если есть) */
35
+ managerId?:
36
+ | string
37
+ | undefined;
38
+ /** request.user.is_superuser */
39
+ isSuperuser: boolean;
40
+ /** имена Django-групп из старого проекта */
41
+ groupNames: string[];
42
+ /** офисы менеджера (для office-based checks) */
43
+ officeIds: string[];
44
+ /** для аудита/трассировки (по желанию) */
45
+ requestId?:
46
+ | string
47
+ | undefined;
48
+ /** тип клиента (опционально) */
49
+ clientType?: string | undefined;
114
50
  }
115
51
 
116
52
  export interface CreateExchangeDealRequest {
117
- managerUserId: string;
118
- managerId?: string | undefined;
53
+ actor: ActorContext | undefined;
119
54
  calculationId?: string | undefined;
120
55
  paymentId?: string | undefined;
121
56
  methodId: string;
@@ -158,32 +93,33 @@ export interface CreateExchangeDealResponse {
158
93
  }
159
94
 
160
95
  export interface GetExchangeDealsRequest {
96
+ actor: ActorContext | undefined;
161
97
  fromDate?: string | undefined;
162
98
  toDate?: string | undefined;
163
- manager?: number | undefined;
164
- customer?: number | undefined;
99
+ managerId?: string | undefined;
100
+ customerId?: string | undefined;
165
101
  page?: number | undefined;
166
102
  pageSize?: number | undefined;
167
103
  ordering?: string | undefined;
168
104
  }
169
105
 
170
106
  export interface GetExchangeDealsManager {
171
- id: number;
107
+ id: string;
172
108
  email: string;
173
109
  }
174
110
 
175
111
  export interface GetExchangeDealsItem {
176
- id: number;
177
- customerId: number;
178
- paymentId?: number | undefined;
112
+ id: string;
113
+ customerId: string;
114
+ paymentId?: string | undefined;
179
115
  inputAmount: number;
180
- inputCurrencyId: number;
116
+ inputCurrencyId: string;
181
117
  outputAmount: number;
182
- outputCurrencyId: number;
118
+ outputCurrencyId: string;
183
119
  factOutputAmount: number;
184
120
  status: boolean;
185
121
  exchangeStatusName: string;
186
- calculationSourceId?: number | undefined;
122
+ calculationSourceId?: string | undefined;
187
123
  manager?: GetExchangeDealsManager | undefined;
188
124
  createdAt: string;
189
125
  }
@@ -196,19 +132,20 @@ export interface GetExchangeDealsResponse {
196
132
  }
197
133
 
198
134
  export interface UpdateExchangeDealRequest {
199
- id: number;
200
- customerId?: number | undefined;
135
+ actor: ActorContext | undefined;
136
+ id: string;
137
+ customerId?: string | undefined;
201
138
  inputAmount?: number | undefined;
202
- inputCurrencyId?: number | undefined;
203
- inputWalletId?: number | undefined;
204
- methodId?: number | undefined;
205
- outputCurrencyId?: number | undefined;
139
+ inputCurrencyId?: string | undefined;
140
+ inputWalletId?: string | undefined;
141
+ methodId?: string | undefined;
142
+ outputCurrencyId?: string | undefined;
206
143
  outputAmount?: number | undefined;
207
144
  factOutputAmount?: number | undefined;
208
- outputWalletId?: number | undefined;
209
- exchangeStatusId?: number | undefined;
145
+ outputWalletId?: string | undefined;
146
+ exchangeStatusId?: string | undefined;
210
147
  payed?: boolean | undefined;
211
- managerPersonId?: number | undefined;
148
+ managerPersonId?: string | undefined;
212
149
  exchangeRate1Iter?: number | undefined;
213
150
  exchangeRate2Iter?: number | undefined;
214
151
  usdtRate?: number | undefined;
@@ -217,19 +154,19 @@ export interface UpdateExchangeDealRequest {
217
154
  customerDocName?: string | undefined;
218
155
  customerDocNationality?: string | undefined;
219
156
  customerDocNumber?: string | undefined;
220
- priorityManagerId?: number | undefined;
221
- priorityOutcomeWalletId?: number | undefined;
157
+ priorityManagerId?: string | undefined;
158
+ priorityOutcomeWalletId?: string | undefined;
222
159
  }
223
160
 
224
161
  export interface UpdateExchangeDealResult {
225
- id: number;
226
- customerId: number;
162
+ id: string;
163
+ customerId: string;
227
164
  inputAmount: number;
228
- inputCurrencyId: number;
165
+ inputCurrencyId: string;
229
166
  outputAmount: number;
230
- outputCurrencyId: number;
167
+ outputCurrencyId: string;
231
168
  factOutputAmount: number;
232
- exchangeStatusId: number;
169
+ exchangeStatusId: string;
233
170
  payed: boolean;
234
171
  includeInTotalCalculation: boolean;
235
172
  }
@@ -242,7 +179,8 @@ export interface UpdateExchangeDealResponse {
242
179
  }
243
180
 
244
181
  export interface CompleteExchangeDealRequest {
245
- id: number;
182
+ actor: ActorContext | undefined;
183
+ id: string;
246
184
  }
247
185
 
248
186
  export interface CompleteExchangeDealResponse {
@@ -252,7 +190,8 @@ export interface CompleteExchangeDealResponse {
252
190
  }
253
191
 
254
192
  export interface CancelExchangeDealRequest {
255
- id: number;
193
+ actor: ActorContext | undefined;
194
+ id: string;
256
195
  }
257
196
 
258
197
  export interface CancelExchangeDealResponse {
@@ -267,7 +206,7 @@ export interface GetExchangeDealStatesByCalculationIdsRequest {
267
206
 
268
207
  export interface ExchangeDealStateByCalculation {
269
208
  calculationId: string;
270
- dealId?: number | undefined;
209
+ dealId?: string | undefined;
271
210
  status: ExchangeDealStatus;
272
211
  allowedActions: ExchangeDealAction[];
273
212
  }
@@ -278,15 +217,16 @@ export interface GetExchangeDealStatesByCalculationIdsResponse {
278
217
  }
279
218
 
280
219
  export interface GetTransactionsRequest {
220
+ actor: ActorContext | undefined;
281
221
  startDate?: string | undefined;
282
222
  endDate?: string | undefined;
283
- userId?: number | undefined;
284
- currencyId?: number | undefined;
285
- walletId?: number | undefined;
223
+ userId?: string | undefined;
224
+ currencyId?: string | undefined;
225
+ walletId?: string | undefined;
286
226
  type?: number | undefined;
287
227
  accountType?: number | undefined;
288
- categoryId?: number | undefined;
289
- businessUnitId?: number | undefined;
228
+ categoryId?: string | undefined;
229
+ businessUnitId?: string | undefined;
290
230
  search?: string | undefined;
291
231
  page?: number | undefined;
292
232
  pageSize?: number | undefined;
@@ -299,28 +239,28 @@ export interface GetTransactionsSummaryItem {
299
239
  }
300
240
 
301
241
  export interface GetTransactionsItem {
302
- id: number;
242
+ id: string;
303
243
  transactionDatetime: string;
304
244
  createdAt: string;
305
245
  amount: number;
306
246
  currency?: string | undefined;
307
247
  usdtAmount?: number | undefined;
308
248
  status: boolean;
309
- walletId?: number | undefined;
249
+ walletId?: string | undefined;
310
250
  walletName?: string | undefined;
311
- moveWalletId?: number | undefined;
251
+ moveWalletId?: string | undefined;
312
252
  moveWalletName?: string | undefined;
313
253
  type: number;
314
254
  typeName?: string | undefined;
315
- categoryId?: number | undefined;
255
+ categoryId?: string | undefined;
316
256
  categoryName?: string | undefined;
317
- businessUnitId?: number | undefined;
257
+ businessUnitId?: string | undefined;
318
258
  businessUnitName?: string | undefined;
319
259
  name: string;
320
260
  comment?: string | undefined;
321
- exchangeId?: number | undefined;
261
+ exchangeId?: string | undefined;
322
262
  exchangeUrl?: string | undefined;
323
- userId?: number | undefined;
263
+ userId?: string | undefined;
324
264
  username?: string | undefined;
325
265
  accountType: number;
326
266
  }
@@ -12,6 +12,23 @@ import { Struct } from "./google/protobuf/struct";
12
12
 
13
13
  export const protobufPackage = "exchange_rates";
14
14
 
15
+ export enum ExchangeCalculationDealStatus {
16
+ EXCHANGE_CALCULATION_DEAL_STATUS_UNSPECIFIED = 0,
17
+ EXCHANGE_CALCULATION_DEAL_STATUS_NO_DEAL = 1,
18
+ EXCHANGE_CALCULATION_DEAL_STATUS_WITH_PAYMENT = 2,
19
+ EXCHANGE_CALCULATION_DEAL_STATUS_IN_PROGRESS = 3,
20
+ EXCHANGE_CALCULATION_DEAL_STATUS_COMPLETED = 4,
21
+ EXCHANGE_CALCULATION_DEAL_STATUS_CANCELLED = 5,
22
+ UNRECOGNIZED = -1,
23
+ }
24
+
25
+ export enum ExchangeCalculationAllowedAction {
26
+ EXCHANGE_CALCULATION_ALLOWED_ACTION_UNSPECIFIED = 0,
27
+ EXCHANGE_CALCULATION_ALLOWED_ACTION_CREATE_DEAL = 1,
28
+ EXCHANGE_CALCULATION_ALLOWED_ACTION_OPEN_DEAL = 2,
29
+ UNRECOGNIZED = -1,
30
+ }
31
+
15
32
  export interface CurrencySetting {
16
33
  id: string;
17
34
  shortName: string;
@@ -317,8 +334,12 @@ export interface ExchangeCalculationHistoryItem {
317
334
  exchangeCompleted?:
318
335
  | boolean
319
336
  | undefined;
320
- /** no_payment | with_payment | with_exchange | completed */
337
+ /** legacy: no_payment | with_payment | with_exchange | completed */
321
338
  status: string;
339
+ dealStatus: ExchangeCalculationDealStatus;
340
+ allowedActions: ExchangeCalculationAllowedAction[];
341
+ canCreateDeal: boolean;
342
+ canOpenDeal: boolean;
322
343
  }
323
344
 
324
345
  export interface GetExchangeCalculationHistoryResponse {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arbiwallet/contracts",
3
3
  "descriptions": "Generate and manage smart contracts for ArbiWallet",
4
- "version": "1.0.211",
4
+ "version": "1.0.213",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -24,95 +24,104 @@ service ExchangeCoreService {
24
24
  rpc GetTransactions(GetTransactionsRequest) returns (GetTransactionsResponse);
25
25
  }
26
26
 
27
- message CreateExchangeOrderRequest {
28
- double input_amount = 1;
29
- double output_amount = 2;
30
- string input_currency = 3;
31
- string output_currency = 4;
32
- string withdraw_type = 5;
33
- string customer = 6;
34
- optional string receive_bank = 7;
35
- }
36
-
37
- message CreateExchangeOrderResponse {
38
- bool success = 1;
39
- int32 status_code = 2;
40
- optional string order_id = 3;
41
- optional string message = 4;
42
- optional string warning = 5;
43
- optional string error = 6;
44
- repeated string errors = 7;
45
- }
46
-
47
- message CreateExchangePaymentRequest {
48
- optional string manager_user_id = 1;
49
- optional string manager_id = 2;
50
-
51
- optional string calculation_id = 3;
52
- int32 agent_id = 4;
53
- optional double amount = 5;
54
- optional string customer_id = 6;
55
- optional string crypto_network = 7;
56
- optional string customer_source = 8;
57
- optional string customer_referrer = 9;
58
- }
59
-
60
- message CreateExchangePaymentResult {
61
- string payment_id = 1;
62
- string payment_uuid = 2;
63
- double amount = 3;
64
- int32 status = 4;
65
- string agent = 5;
66
- optional string wallet_id = 6;
67
- optional string crypto_network = 7;
68
- optional string crypto_address = 8;
69
- optional string arbi_link = 9;
70
- optional string payment_link = 10;
71
- }
72
-
73
- message CreateExchangePaymentResponse {
74
- bool ok = 1;
75
- optional CreateExchangePaymentResult result = 2;
76
- optional string error = 3;
77
- optional google.protobuf.Struct validationErrors = 4;
78
- }
79
-
80
- message HandlePaymentWebhookRequest {
81
- string json_payload = 1;
82
- }
83
-
84
- message HandlePaymentWebhookResponse {
85
- bool ok = 1;
86
- string status = 2;
87
- }
88
-
89
- message GetExchangePaymentsRequest {
90
- optional int32 page = 1;
91
- optional int32 limit = 2;
92
- }
93
-
94
- message GetExchangePaymentsItem {
95
- string payment_id = 1;
96
- string payment_uuid = 2;
97
- double amount = 3;
98
- int32 status = 4;
99
- optional string payment_agent_status = 5;
100
- optional string payment_link = 6;
101
- optional string qr_link = 7;
102
- optional string crypto_address = 8;
103
- }
104
-
105
- message GetExchangePaymentsResponse {
106
- repeated GetExchangePaymentsItem payments = 1;
107
- int32 page = 2;
108
- int32 limit = 3;
109
- int32 total = 4;
110
- int32 total_pages = 5;
27
+ // message CreateExchangeOrderRequest {
28
+ // double input_amount = 1;
29
+ // double output_amount = 2;
30
+ // string input_currency = 3;
31
+ // string output_currency = 4;
32
+ // string withdraw_type = 5;
33
+ // string customer_id = 6;
34
+ // optional string receive_bank = 7;
35
+ // }
36
+
37
+ // message CreateExchangeOrderResponse {
38
+ // bool success = 1;
39
+ // int32 status_code = 2;
40
+ // optional string order_id = 3;
41
+ // optional string message = 4;
42
+ // optional string warning = 5;
43
+ // optional string error = 6;
44
+ // repeated string errors = 7;
45
+ // }
46
+
47
+ // message CreateExchangePaymentRequest {
48
+ // optional string manager_user_id = 1;
49
+ // optional string manager_id = 2;
50
+
51
+ // optional string calculation_id = 3;
52
+ // int32 agent_id = 4;
53
+ // optional double amount = 5;
54
+ // optional string customer_id = 6;
55
+ // optional string crypto_network = 7;
56
+ // optional string customer_source = 8;
57
+ // optional string customer_referrer = 9;
58
+ // }
59
+
60
+ // message CreateExchangePaymentResult {
61
+ // string payment_id = 1;
62
+ // string payment_uuid = 2;
63
+ // double amount = 3;
64
+ // int32 status = 4;
65
+ // string agent = 5;
66
+ // optional string wallet_id = 6;
67
+ // optional string crypto_network = 7;
68
+ // optional string crypto_address = 8;
69
+ // optional string arbi_link = 9;
70
+ // optional string payment_link = 10;
71
+ // }
72
+
73
+ // message CreateExchangePaymentResponse {
74
+ // bool ok = 1;
75
+ // optional CreateExchangePaymentResult result = 2;
76
+ // optional string error = 3;
77
+ // optional google.protobuf.Struct validationErrors = 4;
78
+ // }
79
+
80
+ // message HandlePaymentWebhookRequest {
81
+ // string json_payload = 1;
82
+ // }
83
+
84
+ // message HandlePaymentWebhookResponse {
85
+ // bool ok = 1;
86
+ // string status = 2;
87
+ // }
88
+
89
+ // message GetExchangePaymentsRequest {
90
+ // optional int32 page = 1;
91
+ // optional int32 limit = 2;
92
+ // }
93
+
94
+ // message GetExchangePaymentsItem {
95
+ // string payment_id = 1;
96
+ // string payment_uuid = 2;
97
+ // double amount = 3;
98
+ // int32 status = 4;
99
+ // optional string payment_agent_status = 5;
100
+ // optional string payment_link = 6;
101
+ // optional string qr_link = 7;
102
+ // optional string crypto_address = 8;
103
+ // }
104
+
105
+ // message GetExchangePaymentsResponse {
106
+ // repeated GetExchangePaymentsItem payments = 1;
107
+ // int32 page = 2;
108
+ // int32 limit = 3;
109
+ // int32 total = 4;
110
+ // int32 total_pages = 5;
111
+ // }
112
+
113
+ message ActorContext {
114
+ string user_id = 1; // users.CustomUser.id
115
+ optional string manager_id = 2; // exchanges_manager.id (если есть)
116
+ bool is_superuser = 3; // request.user.is_superuser
117
+ repeated string group_names = 4; // имена Django-групп из старого проекта
118
+ repeated string office_ids = 5; // офисы менеджера (для office-based checks)
119
+ optional string request_id = 6; // для аудита/трассировки (по желанию)
120
+ optional string client_type = 7; // тип клиента (опционально)
111
121
  }
112
122
 
113
123
  message CreateExchangeDealRequest {
114
- string manager_user_id = 1;
115
- optional string manager_id = 2;
124
+ ActorContext actor = 1;
116
125
 
117
126
  optional string calculation_id = 3;
118
127
  optional string payment_id = 4;
@@ -164,32 +173,33 @@ message CreateExchangeDealResponse {
164
173
  }
165
174
 
166
175
  message GetExchangeDealsRequest {
167
- optional string from_date = 1;
168
- optional string to_date = 2;
169
- optional int32 manager = 3;
170
- optional int32 customer = 4;
171
- optional int32 page = 5;
172
- optional int32 page_size = 6;
173
- optional string ordering = 7;
176
+ ActorContext actor = 1;
177
+ optional string from_date = 2;
178
+ optional string to_date = 3;
179
+ optional string manager_id = 4;
180
+ optional string customer_id = 5;
181
+ optional int32 page = 6;
182
+ optional int32 page_size = 7;
183
+ optional string ordering = 8;
174
184
  }
175
185
 
176
186
  message GetExchangeDealsManager {
177
- int32 id = 1;
187
+ string id = 1;
178
188
  string email = 2;
179
189
  }
180
190
 
181
191
  message GetExchangeDealsItem {
182
- int32 id = 1;
183
- int32 customer_id = 2;
184
- optional int32 payment_id = 3;
192
+ string id = 1;
193
+ string customer_id = 2;
194
+ optional string payment_id = 3;
185
195
  double input_amount = 4;
186
- int32 input_currency_id = 5;
196
+ string input_currency_id = 5;
187
197
  double output_amount = 6;
188
- int32 output_currency_id = 7;
198
+ string output_currency_id = 7;
189
199
  double fact_output_amount = 8;
190
200
  bool status = 9;
191
201
  string exchange_status_name = 10;
192
- optional int32 calculation_source_id = 11;
202
+ optional string calculation_source_id = 11;
193
203
  optional GetExchangeDealsManager manager = 12;
194
204
  string created_at = 13;
195
205
  }
@@ -202,42 +212,43 @@ message GetExchangeDealsResponse {
202
212
  }
203
213
 
204
214
  message UpdateExchangeDealRequest {
205
- int32 id = 1;
206
-
207
- optional int32 customer_id = 2;
208
- optional double input_amount = 3;
209
- optional int32 input_currency_id = 4;
210
- optional int32 input_wallet_id = 5;
211
- optional int32 method_id = 6;
212
- optional int32 output_currency_id = 7;
213
- optional double output_amount = 8;
214
- optional double fact_output_amount = 9;
215
- optional int32 output_wallet_id = 10;
216
- optional int32 exchange_status_id = 11;
217
- optional bool payed = 12;
218
- optional int32 manager_person_id = 13;
219
- optional double exchange_rate_1_iter = 14;
220
- optional double exchange_rate_2_iter = 15;
221
- optional double usdt_rate = 16;
222
- optional bool include_in_total_calculation = 17;
223
-
224
- repeated double receipts = 18;
225
- optional string customer_doc_name = 19;
226
- optional string customer_doc_nationality = 20;
227
- optional string customer_doc_number = 21;
228
- optional int32 priority_manager_id = 22;
229
- optional int32 priority_outcome_wallet_id = 23;
215
+ ActorContext actor = 1;
216
+ string id = 2;
217
+
218
+ optional string customer_id = 3;
219
+ optional double input_amount = 4;
220
+ optional string input_currency_id = 5;
221
+ optional string input_wallet_id = 6;
222
+ optional string method_id = 7;
223
+ optional string output_currency_id = 8;
224
+ optional double output_amount = 9;
225
+ optional double fact_output_amount = 10;
226
+ optional string output_wallet_id = 11;
227
+ optional string exchange_status_id = 12;
228
+ optional bool payed = 13;
229
+ optional string manager_person_id = 14;
230
+ optional double exchange_rate_1_iter = 15;
231
+ optional double exchange_rate_2_iter = 16;
232
+ optional double usdt_rate = 17;
233
+ optional bool include_in_total_calculation = 18;
234
+
235
+ repeated double receipts = 19;
236
+ optional string customer_doc_name = 20;
237
+ optional string customer_doc_nationality = 21;
238
+ optional string customer_doc_number = 22;
239
+ optional string priority_manager_id = 23;
240
+ optional string priority_outcome_wallet_id = 24;
230
241
  }
231
242
 
232
243
  message UpdateExchangeDealResult {
233
- int32 id = 1;
234
- int32 customer_id = 2;
244
+ string id = 1;
245
+ string customer_id = 2;
235
246
  double input_amount = 3;
236
- int32 input_currency_id = 4;
247
+ string input_currency_id = 4;
237
248
  double output_amount = 5;
238
- int32 output_currency_id = 6;
249
+ string output_currency_id = 6;
239
250
  double fact_output_amount = 7;
240
- int32 exchange_status_id = 8;
251
+ string exchange_status_id = 8;
241
252
  bool payed = 9;
242
253
  bool include_in_total_calculation = 10;
243
254
  }
@@ -250,7 +261,8 @@ message UpdateExchangeDealResponse {
250
261
  }
251
262
 
252
263
  message CompleteExchangeDealRequest {
253
- int32 id = 1;
264
+ ActorContext actor = 1;
265
+ string id = 2;
254
266
  }
255
267
 
256
268
  message CompleteExchangeDealResponse {
@@ -260,7 +272,8 @@ message CompleteExchangeDealResponse {
260
272
  }
261
273
 
262
274
  message CancelExchangeDealRequest {
263
- int32 id = 1;
275
+ ActorContext actor = 1;
276
+ string id = 2;
264
277
  }
265
278
 
266
279
  message CancelExchangeDealResponse {
@@ -289,7 +302,7 @@ enum ExchangeDealAction {
289
302
 
290
303
  message ExchangeDealStateByCalculation {
291
304
  string calculation_id = 1;
292
- optional int32 deal_id = 2;
305
+ optional string deal_id = 2;
293
306
  ExchangeDealStatus status = 3;
294
307
  repeated ExchangeDealAction allowed_actions = 4;
295
308
  }
@@ -300,18 +313,19 @@ message GetExchangeDealStatesByCalculationIdsResponse {
300
313
  }
301
314
 
302
315
  message GetTransactionsRequest {
303
- optional string start_date = 1;
304
- optional string end_date = 2;
305
- optional int32 user_id = 3;
306
- optional int32 currency_id = 4;
307
- optional int32 wallet_id = 5;
308
- optional int32 type = 6;
309
- optional int32 account_type = 7;
310
- optional int32 category_id = 8;
311
- optional int32 business_unit_id = 9;
312
- optional string search = 10;
313
- optional int32 page = 11;
314
- optional int32 page_size = 12;
316
+ ActorContext actor = 1;
317
+ optional string start_date = 2;
318
+ optional string end_date = 3;
319
+ optional string user_id = 4;
320
+ optional string currency_id = 5;
321
+ optional string wallet_id = 6;
322
+ optional int32 type = 7;
323
+ optional int32 account_type = 8;
324
+ optional string category_id = 9;
325
+ optional string business_unit_id = 10;
326
+ optional string search = 11;
327
+ optional int32 page = 12;
328
+ optional int32 page_size = 13;
315
329
  }
316
330
 
317
331
  message GetTransactionsSummaryItem {
@@ -321,28 +335,28 @@ message GetTransactionsSummaryItem {
321
335
  }
322
336
 
323
337
  message GetTransactionsItem {
324
- int32 id = 1;
338
+ string id = 1;
325
339
  string transaction_datetime = 2;
326
340
  string created_at = 3;
327
341
  double amount = 4;
328
342
  optional string currency = 5;
329
343
  optional double usdt_amount = 6;
330
344
  bool status = 7;
331
- optional int32 wallet_id = 8;
345
+ optional string wallet_id = 8;
332
346
  optional string wallet_name = 9;
333
- optional int32 move_wallet_id = 10;
347
+ optional string move_wallet_id = 10;
334
348
  optional string move_wallet_name = 11;
335
349
  int32 type = 12;
336
350
  optional string type_name = 13;
337
- optional int32 category_id = 14;
351
+ optional string category_id = 14;
338
352
  optional string category_name = 15;
339
- optional int32 business_unit_id = 16;
353
+ optional string business_unit_id = 16;
340
354
  optional string business_unit_name = 17;
341
355
  string name = 18;
342
356
  optional string comment = 19;
343
- optional int32 exchange_id = 20;
357
+ optional string exchange_id = 20;
344
358
  optional string exchange_url = 21;
345
- optional int32 user_id = 22;
359
+ optional string user_id = 22;
346
360
  optional string username = 23;
347
361
  int32 account_type = 24;
348
362
  }
@@ -313,6 +313,21 @@ message ExchangeCalculationHistoryPagination {
313
313
  bool has_previous = 6;
314
314
  }
315
315
 
316
+ enum ExchangeCalculationDealStatus {
317
+ EXCHANGE_CALCULATION_DEAL_STATUS_UNSPECIFIED = 0;
318
+ EXCHANGE_CALCULATION_DEAL_STATUS_NO_DEAL = 1;
319
+ EXCHANGE_CALCULATION_DEAL_STATUS_WITH_PAYMENT = 2;
320
+ EXCHANGE_CALCULATION_DEAL_STATUS_IN_PROGRESS = 3;
321
+ EXCHANGE_CALCULATION_DEAL_STATUS_COMPLETED = 4;
322
+ EXCHANGE_CALCULATION_DEAL_STATUS_CANCELLED = 5;
323
+ }
324
+
325
+ enum ExchangeCalculationAllowedAction {
326
+ EXCHANGE_CALCULATION_ALLOWED_ACTION_UNSPECIFIED = 0;
327
+ EXCHANGE_CALCULATION_ALLOWED_ACTION_CREATE_DEAL = 1;
328
+ EXCHANGE_CALCULATION_ALLOWED_ACTION_OPEN_DEAL = 2;
329
+ }
330
+
316
331
  message ExchangeCalculationHistoryItem {
317
332
  string id = 1;
318
333
  string created_at = 2;
@@ -332,7 +347,11 @@ message ExchangeCalculationHistoryItem {
332
347
  optional string exchange_id = 14;
333
348
  optional bool exchange_completed = 15;
334
349
 
335
- string status = 16; // no_payment | with_payment | with_exchange | completed
350
+ string status = 16; // legacy: no_payment | with_payment | with_exchange | completed
351
+ ExchangeCalculationDealStatus deal_status = 17;
352
+ repeated ExchangeCalculationAllowedAction allowed_actions = 18;
353
+ bool can_create_deal = 19;
354
+ bool can_open_deal = 20;
336
355
  }
337
356
 
338
357
  message GetExchangeCalculationHistoryResponse {