@arbiwallet/contracts 1.0.214 → 1.0.216

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.
@@ -201,22 +201,6 @@ export interface CancelExchangeDealResponse {
201
201
  error?: string | undefined;
202
202
  }
203
203
 
204
- export interface GetExchangeDealStatesByCalculationIdsRequest {
205
- calculationIds: string[];
206
- }
207
-
208
- export interface ExchangeDealStateByCalculation {
209
- calculationId: string;
210
- dealId?: string | undefined;
211
- status: ExchangeDealStatus;
212
- allowedActions: ExchangeDealAction[];
213
- }
214
-
215
- export interface GetExchangeDealStatesByCalculationIdsResponse {
216
- items: ExchangeDealStateByCalculation[];
217
- notFoundCalculationIds: string[];
218
- }
219
-
220
204
  export interface GetTransactionsRequest {
221
205
  actor: ActorContext | undefined;
222
206
  startDate?: string | undefined;
@@ -274,6 +258,71 @@ export interface GetTransactionsResponse {
274
258
  summary: GetTransactionsSummaryItem[];
275
259
  }
276
260
 
261
+ export interface GetExchangeDealHistoryStatisticsRequest {
262
+ dateFrom?: string | undefined;
263
+ dateTo?: string | undefined;
264
+ amountFrom?: number | undefined;
265
+ amountTo?: number | undefined;
266
+ inputCurrency?: string | undefined;
267
+ outputCurrency?:
268
+ | string
269
+ | undefined;
270
+ /** no_payment | with_payment | with_exchange | completed */
271
+ status?: string | undefined;
272
+ search?: string | undefined;
273
+ page?: number | undefined;
274
+ pageSize?: number | undefined;
275
+ }
276
+
277
+ export interface GetExchangeDealHistoryStatisticsResponse {
278
+ items: ExchangeDealStateByCalculation[];
279
+ }
280
+
281
+ export interface GetExchangePaymentRefsByCalculationIdsRequest {
282
+ calculationIds: string[];
283
+ }
284
+
285
+ export interface ExchangePaymentRefByCalculation {
286
+ calculationId: string;
287
+ paymentUuid: string;
288
+ }
289
+
290
+ export interface GetExchangePaymentRefsByCalculationIdsResponse {
291
+ items: ExchangePaymentRefByCalculation[];
292
+ notFoundCalculationIds: string[];
293
+ }
294
+
295
+ export interface GetExchangeDealRefsByCalculationIdsRequest {
296
+ calculationIds: string[];
297
+ }
298
+
299
+ export interface ExchangeDealRefByCalculation {
300
+ calculationId: string;
301
+ exchangeId: string;
302
+ status: boolean;
303
+ }
304
+
305
+ export interface GetExchangeDealRefsByCalculationIdsResponse {
306
+ items: ExchangeDealRefByCalculation[];
307
+ notFoundCalculationIds: string[];
308
+ }
309
+
310
+ export interface GetExchangeDealStatesByCalculationIdsRequest {
311
+ calculationIds: string[];
312
+ }
313
+
314
+ export interface ExchangeDealStateByCalculation {
315
+ calculationId: string;
316
+ dealId?: string | undefined;
317
+ status: ExchangeDealStatus;
318
+ allowedActions: ExchangeDealAction[];
319
+ }
320
+
321
+ export interface GetExchangeDealStatesByCalculationIdsResponse {
322
+ items: ExchangeDealStateByCalculation[];
323
+ notFoundCalculationIds: string[];
324
+ }
325
+
277
326
  export const EXCHANGE_CORE_PACKAGE_NAME = "exchange_core";
278
327
 
279
328
  wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
@@ -295,11 +344,23 @@ export interface ExchangeCoreServiceClient {
295
344
 
296
345
  cancelExchangeDeal(request: CancelExchangeDealRequest): Observable<CancelExchangeDealResponse>;
297
346
 
347
+ getTransactions(request: GetTransactionsRequest): Observable<GetTransactionsResponse>;
348
+
349
+ getExchangeDealHistoryStatistics(
350
+ request: GetExchangeDealHistoryStatisticsRequest,
351
+ ): Observable<GetExchangeDealHistoryStatisticsResponse>;
352
+
353
+ getExchangePaymentRefsByCalculationIds(
354
+ request: GetExchangePaymentRefsByCalculationIdsRequest,
355
+ ): Observable<GetExchangePaymentRefsByCalculationIdsResponse>;
356
+
357
+ getExchangeDealRefsByCalculationIds(
358
+ request: GetExchangeDealRefsByCalculationIdsRequest,
359
+ ): Observable<GetExchangeDealRefsByCalculationIdsResponse>;
360
+
298
361
  getExchangeDealStatesByCalculationIds(
299
362
  request: GetExchangeDealStatesByCalculationIdsRequest,
300
363
  ): Observable<GetExchangeDealStatesByCalculationIdsResponse>;
301
-
302
- getTransactions(request: GetTransactionsRequest): Observable<GetTransactionsResponse>;
303
364
  }
304
365
 
305
366
  /**
@@ -329,16 +390,37 @@ export interface ExchangeCoreServiceController {
329
390
  request: CancelExchangeDealRequest,
330
391
  ): Promise<CancelExchangeDealResponse> | Observable<CancelExchangeDealResponse> | CancelExchangeDealResponse;
331
392
 
393
+ getTransactions(
394
+ request: GetTransactionsRequest,
395
+ ): Promise<GetTransactionsResponse> | Observable<GetTransactionsResponse> | GetTransactionsResponse;
396
+
397
+ getExchangeDealHistoryStatistics(
398
+ request: GetExchangeDealHistoryStatisticsRequest,
399
+ ):
400
+ | Promise<GetExchangeDealHistoryStatisticsResponse>
401
+ | Observable<GetExchangeDealHistoryStatisticsResponse>
402
+ | GetExchangeDealHistoryStatisticsResponse;
403
+
404
+ getExchangePaymentRefsByCalculationIds(
405
+ request: GetExchangePaymentRefsByCalculationIdsRequest,
406
+ ):
407
+ | Promise<GetExchangePaymentRefsByCalculationIdsResponse>
408
+ | Observable<GetExchangePaymentRefsByCalculationIdsResponse>
409
+ | GetExchangePaymentRefsByCalculationIdsResponse;
410
+
411
+ getExchangeDealRefsByCalculationIds(
412
+ request: GetExchangeDealRefsByCalculationIdsRequest,
413
+ ):
414
+ | Promise<GetExchangeDealRefsByCalculationIdsResponse>
415
+ | Observable<GetExchangeDealRefsByCalculationIdsResponse>
416
+ | GetExchangeDealRefsByCalculationIdsResponse;
417
+
332
418
  getExchangeDealStatesByCalculationIds(
333
419
  request: GetExchangeDealStatesByCalculationIdsRequest,
334
420
  ):
335
421
  | Promise<GetExchangeDealStatesByCalculationIdsResponse>
336
422
  | Observable<GetExchangeDealStatesByCalculationIdsResponse>
337
423
  | GetExchangeDealStatesByCalculationIdsResponse;
338
-
339
- getTransactions(
340
- request: GetTransactionsRequest,
341
- ): Promise<GetTransactionsResponse> | Observable<GetTransactionsResponse> | GetTransactionsResponse;
342
424
  }
343
425
 
344
426
  export function ExchangeCoreServiceControllerMethods() {
@@ -349,8 +431,11 @@ export function ExchangeCoreServiceControllerMethods() {
349
431
  "updateExchangeDeal",
350
432
  "completeExchangeDeal",
351
433
  "cancelExchangeDeal",
352
- "getExchangeDealStatesByCalculationIds",
353
434
  "getTransactions",
435
+ "getExchangeDealHistoryStatistics",
436
+ "getExchangePaymentRefsByCalculationIds",
437
+ "getExchangeDealRefsByCalculationIds",
438
+ "getExchangeDealStatesByCalculationIds",
354
439
  ];
355
440
  for (const method of grpcMethods) {
356
441
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/gen/user.ts CHANGED
@@ -100,6 +100,20 @@ export interface ListUsersResponse {
100
100
  limit: number;
101
101
  }
102
102
 
103
+ export interface GetUserFullNamesByIdsRequest {
104
+ userIds: number[];
105
+ }
106
+
107
+ export interface UserFullNameById {
108
+ userId: number;
109
+ fullName?: string | undefined;
110
+ }
111
+
112
+ export interface GetUserFullNamesByIdsResponse {
113
+ items: UserFullNameById[];
114
+ notFoundUserIds: number[];
115
+ }
116
+
103
117
  export interface ResolveUserForTransferRequest {
104
118
  userId?: number | undefined;
105
119
  email?: string | undefined;
@@ -362,6 +376,10 @@ export interface UserServiceClient {
362
376
 
363
377
  listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
364
378
 
379
+ /** Батч-резолв полных имен пользователей по их id (для enrichment в других сервисах). */
380
+
381
+ getUserFullNamesByIds(request: GetUserFullNamesByIdsRequest): Observable<GetUserFullNamesByIdsResponse>;
382
+
365
383
  /** Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода. */
366
384
 
367
385
  resolveUserForTransfer(request: ResolveUserForTransferRequest): Observable<ResolveUserForTransferResponse>;
@@ -454,6 +472,12 @@ export interface UserServiceController {
454
472
 
455
473
  listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
456
474
 
475
+ /** Батч-резолв полных имен пользователей по их id (для enrichment в других сервисах). */
476
+
477
+ getUserFullNamesByIds(
478
+ request: GetUserFullNamesByIdsRequest,
479
+ ): Promise<GetUserFullNamesByIdsResponse> | Observable<GetUserFullNamesByIdsResponse> | GetUserFullNamesByIdsResponse;
480
+
457
481
  /** Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода. */
458
482
 
459
483
  resolveUserForTransfer(
@@ -610,6 +634,7 @@ export function UserServiceControllerMethods() {
610
634
  "updateUser",
611
635
  "updateUserStatus",
612
636
  "listUsers",
637
+ "getUserFullNamesByIds",
613
638
  "resolveUserForTransfer",
614
639
  "getCrmSession",
615
640
  "crmExchangeHttp",
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.214",
4
+ "version": "1.0.216",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -18,31 +18,16 @@ service ExchangeCoreService {
18
18
  rpc UpdateExchangeDeal(UpdateExchangeDealRequest) returns (UpdateExchangeDealResponse);
19
19
  rpc CompleteExchangeDeal(CompleteExchangeDealRequest) returns (CompleteExchangeDealResponse);
20
20
  rpc CancelExchangeDeal(CancelExchangeDealRequest) returns (CancelExchangeDealResponse);
21
-
22
- rpc GetExchangeDealStatesByCalculationIds(GetExchangeDealStatesByCalculationIdsRequest) returns (GetExchangeDealStatesByCalculationIdsResponse);
23
21
 
24
22
  rpc GetTransactions(GetTransactionsRequest) returns (GetTransactionsResponse);
25
- }
26
23
 
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
- // }
24
+ rpc GetExchangeDealHistoryStatistics(GetExchangeDealHistoryStatisticsRequest) returns (GetExchangeDealHistoryStatisticsResponse);
36
25
 
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
- // }
26
+
27
+ rpc GetExchangePaymentRefsByCalculationIds(GetExchangePaymentRefsByCalculationIdsRequest) returns (GetExchangePaymentRefsByCalculationIdsResponse);
28
+ rpc GetExchangeDealRefsByCalculationIds(GetExchangeDealRefsByCalculationIdsRequest) returns (GetExchangeDealRefsByCalculationIdsResponse);
29
+ rpc GetExchangeDealStatesByCalculationIds(GetExchangeDealStatesByCalculationIdsRequest) returns (GetExchangeDealStatesByCalculationIdsResponse);
30
+ }
46
31
 
47
32
  // message CreateExchangePaymentRequest {
48
33
  // optional string manager_user_id = 1;
@@ -283,35 +268,6 @@ message CancelExchangeDealResponse {
283
268
  optional string error = 3;
284
269
  }
285
270
 
286
- message GetExchangeDealStatesByCalculationIdsRequest {
287
- repeated string calculation_ids = 1;
288
- }
289
-
290
- enum ExchangeDealStatus {
291
- EXCHANGE_DEAL_STATUS_UNSPECIFIED = 0;
292
- EXCHANGE_DEAL_STATUS_NO_DEAL = 1;
293
- EXCHANGE_DEAL_STATUS_IN_PROGRESS = 2;
294
- EXCHANGE_DEAL_STATUS_COMPLETED = 3;
295
- EXCHANGE_DEAL_STATUS_CANCELLED = 4;
296
- }
297
-
298
- enum ExchangeDealAction {
299
- EXCHANGE_DEAL_ACTION_UNSPECIFIED = 0;
300
- EXCHANGE_DEAL_ACTION_CREATE_DEAL = 1;
301
- EXCHANGE_DEAL_ACTION_OPEN_DEAL = 2;
302
- }
303
-
304
- message ExchangeDealStateByCalculation {
305
- string calculation_id = 1;
306
- optional string deal_id = 2;
307
- ExchangeDealStatus status = 3;
308
- repeated ExchangeDealAction allowed_actions = 4;
309
- }
310
-
311
- message GetExchangeDealStatesByCalculationIdsResponse {
312
- repeated ExchangeDealStateByCalculation items = 1;
313
- repeated string not_found_calculation_ids = 2;
314
- }
315
271
 
316
272
  message GetTransactionsRequest {
317
273
  ActorContext actor = 1;
@@ -369,3 +325,80 @@ message GetTransactionsResponse {
369
325
  repeated GetTransactionsItem results = 4;
370
326
  repeated GetTransactionsSummaryItem summary = 5;
371
327
  }
328
+
329
+ message GetExchangeDealHistoryStatisticsRequest {
330
+ optional string date_from = 1;
331
+ optional string date_to = 2;
332
+ optional double amount_from = 3;
333
+ optional double amount_to = 4;
334
+ optional string input_currency = 5;
335
+ optional string output_currency = 6;
336
+ optional string status = 7; // no_payment | with_payment | with_exchange | completed
337
+ optional string search = 8;
338
+ optional int32 page = 9;
339
+ optional int32 page_size = 10;
340
+ }
341
+
342
+ message GetExchangeDealHistoryStatisticsResponse {
343
+ repeated ExchangeDealStateByCalculation items = 1;
344
+ }
345
+
346
+ message GetExchangePaymentRefsByCalculationIdsRequest {
347
+ repeated string calculation_ids = 1;
348
+ }
349
+
350
+ message ExchangePaymentRefByCalculation {
351
+ string calculation_id = 1;
352
+ string payment_uuid = 2;
353
+ }
354
+
355
+ message GetExchangePaymentRefsByCalculationIdsResponse {
356
+ repeated ExchangePaymentRefByCalculation items = 1;
357
+ repeated string not_found_calculation_ids = 2;
358
+ }
359
+
360
+ message GetExchangeDealRefsByCalculationIdsRequest {
361
+ repeated string calculation_ids = 1;
362
+ }
363
+
364
+ message ExchangeDealRefByCalculation {
365
+ string calculation_id = 1;
366
+ string exchange_id = 2;
367
+ bool status = 3;
368
+ }
369
+
370
+ message GetExchangeDealRefsByCalculationIdsResponse {
371
+ repeated ExchangeDealRefByCalculation items = 1;
372
+ repeated string not_found_calculation_ids = 2;
373
+ }
374
+
375
+
376
+ message GetExchangeDealStatesByCalculationIdsRequest {
377
+ repeated string calculation_ids = 1;
378
+ }
379
+
380
+ enum ExchangeDealStatus {
381
+ EXCHANGE_DEAL_STATUS_UNSPECIFIED = 0;
382
+ EXCHANGE_DEAL_STATUS_NO_DEAL = 1;
383
+ EXCHANGE_DEAL_STATUS_IN_PROGRESS = 2;
384
+ EXCHANGE_DEAL_STATUS_COMPLETED = 3;
385
+ EXCHANGE_DEAL_STATUS_CANCELLED = 4;
386
+ }
387
+
388
+ enum ExchangeDealAction {
389
+ EXCHANGE_DEAL_ACTION_UNSPECIFIED = 0;
390
+ EXCHANGE_DEAL_ACTION_CREATE_DEAL = 1;
391
+ EXCHANGE_DEAL_ACTION_OPEN_DEAL = 2;
392
+ }
393
+
394
+ message ExchangeDealStateByCalculation {
395
+ string calculation_id = 1;
396
+ optional string deal_id = 2;
397
+ ExchangeDealStatus status = 3;
398
+ repeated ExchangeDealAction allowed_actions = 4;
399
+ }
400
+
401
+ message GetExchangeDealStatesByCalculationIdsResponse {
402
+ repeated ExchangeDealStateByCalculation items = 1;
403
+ repeated string not_found_calculation_ids = 2;
404
+ }
package/proto/user.proto CHANGED
@@ -6,6 +6,8 @@ service UserService {
6
6
  rpc UpdateUser (UpdateUserRequest) returns (UserResponse);
7
7
  rpc UpdateUserStatus (UpdateUserStatusRequest) returns (UserResponse);
8
8
  rpc ListUsers (ListUsersRequest) returns (ListUsersResponse);
9
+ // Батч-резолв полных имен пользователей по их id (для enrichment в других сервисах).
10
+ rpc GetUserFullNamesByIds (GetUserFullNamesByIdsRequest) returns (GetUserFullNamesByIdsResponse);
9
11
  // Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода.
10
12
  rpc ResolveUserForTransfer (ResolveUserForTransferRequest) returns (ResolveUserForTransferResponse);
11
13
  // CRM Arbi Exchange: логин сервисным аккаунтом (env), OTP из TOTP-секрета; session_id для X-Session-ID.
@@ -130,6 +132,20 @@ message ListUsersResponse {
130
132
  int32 limit = 4;
131
133
  }
132
134
 
135
+ message GetUserFullNamesByIdsRequest {
136
+ repeated int32 user_ids = 1;
137
+ }
138
+
139
+ message UserFullNameById {
140
+ int32 user_id = 1;
141
+ optional string full_name = 2;
142
+ }
143
+
144
+ message GetUserFullNamesByIdsResponse {
145
+ repeated UserFullNameById items = 1;
146
+ repeated int32 not_found_user_ids = 2;
147
+ }
148
+
133
149
  message ResolveUserForTransferRequest {
134
150
  optional int32 user_id = 1;
135
151
  optional string email = 2;