@arbiwallet/contracts 1.0.213 → 1.0.215

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.
@@ -62,6 +62,7 @@ export interface CreateExchangeDealRequest {
62
62
  inputCurrencyId?: string | undefined;
63
63
  outputCurrencyId?: string | undefined;
64
64
  customerId?: string | undefined;
65
+ managerPersonId?: string | undefined;
65
66
  expensesForCourier?: number | undefined;
66
67
  includeInTotalCalculation?: boolean | undefined;
67
68
  oneCurrencyExchange?: boolean | undefined;
@@ -200,22 +201,6 @@ export interface CancelExchangeDealResponse {
200
201
  error?: string | undefined;
201
202
  }
202
203
 
203
- export interface GetExchangeDealStatesByCalculationIdsRequest {
204
- calculationIds: string[];
205
- }
206
-
207
- export interface ExchangeDealStateByCalculation {
208
- calculationId: string;
209
- dealId?: string | undefined;
210
- status: ExchangeDealStatus;
211
- allowedActions: ExchangeDealAction[];
212
- }
213
-
214
- export interface GetExchangeDealStatesByCalculationIdsResponse {
215
- items: ExchangeDealStateByCalculation[];
216
- notFoundCalculationIds: string[];
217
- }
218
-
219
204
  export interface GetTransactionsRequest {
220
205
  actor: ActorContext | undefined;
221
206
  startDate?: string | undefined;
@@ -273,6 +258,51 @@ export interface GetTransactionsResponse {
273
258
  summary: GetTransactionsSummaryItem[];
274
259
  }
275
260
 
261
+ export interface GetExchangePaymentRefsByCalculationIdsRequest {
262
+ calculationIds: string[];
263
+ }
264
+
265
+ export interface ExchangePaymentRefByCalculation {
266
+ calculationId: string;
267
+ paymentUuid: string;
268
+ }
269
+
270
+ export interface GetExchangePaymentRefsByCalculationIdsResponse {
271
+ items: ExchangePaymentRefByCalculation[];
272
+ notFoundCalculationIds: string[];
273
+ }
274
+
275
+ export interface GetExchangeDealRefsByCalculationIdsRequest {
276
+ calculationIds: string[];
277
+ }
278
+
279
+ export interface ExchangeDealRefByCalculation {
280
+ calculationId: string;
281
+ exchangeId: string;
282
+ status: boolean;
283
+ }
284
+
285
+ export interface GetExchangeDealRefsByCalculationIdsResponse {
286
+ items: ExchangeDealRefByCalculation[];
287
+ notFoundCalculationIds: string[];
288
+ }
289
+
290
+ export interface GetExchangeDealStatesByCalculationIdsRequest {
291
+ calculationIds: string[];
292
+ }
293
+
294
+ export interface ExchangeDealStateByCalculation {
295
+ calculationId: string;
296
+ dealId?: string | undefined;
297
+ status: ExchangeDealStatus;
298
+ allowedActions: ExchangeDealAction[];
299
+ }
300
+
301
+ export interface GetExchangeDealStatesByCalculationIdsResponse {
302
+ items: ExchangeDealStateByCalculation[];
303
+ notFoundCalculationIds: string[];
304
+ }
305
+
276
306
  export const EXCHANGE_CORE_PACKAGE_NAME = "exchange_core";
277
307
 
278
308
  wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
@@ -294,11 +324,19 @@ export interface ExchangeCoreServiceClient {
294
324
 
295
325
  cancelExchangeDeal(request: CancelExchangeDealRequest): Observable<CancelExchangeDealResponse>;
296
326
 
327
+ getTransactions(request: GetTransactionsRequest): Observable<GetTransactionsResponse>;
328
+
329
+ getExchangePaymentRefsByCalculationIds(
330
+ request: GetExchangePaymentRefsByCalculationIdsRequest,
331
+ ): Observable<GetExchangePaymentRefsByCalculationIdsResponse>;
332
+
333
+ getExchangeDealRefsByCalculationIds(
334
+ request: GetExchangeDealRefsByCalculationIdsRequest,
335
+ ): Observable<GetExchangeDealRefsByCalculationIdsResponse>;
336
+
297
337
  getExchangeDealStatesByCalculationIds(
298
338
  request: GetExchangeDealStatesByCalculationIdsRequest,
299
339
  ): Observable<GetExchangeDealStatesByCalculationIdsResponse>;
300
-
301
- getTransactions(request: GetTransactionsRequest): Observable<GetTransactionsResponse>;
302
340
  }
303
341
 
304
342
  /**
@@ -328,16 +366,30 @@ export interface ExchangeCoreServiceController {
328
366
  request: CancelExchangeDealRequest,
329
367
  ): Promise<CancelExchangeDealResponse> | Observable<CancelExchangeDealResponse> | CancelExchangeDealResponse;
330
368
 
369
+ getTransactions(
370
+ request: GetTransactionsRequest,
371
+ ): Promise<GetTransactionsResponse> | Observable<GetTransactionsResponse> | GetTransactionsResponse;
372
+
373
+ getExchangePaymentRefsByCalculationIds(
374
+ request: GetExchangePaymentRefsByCalculationIdsRequest,
375
+ ):
376
+ | Promise<GetExchangePaymentRefsByCalculationIdsResponse>
377
+ | Observable<GetExchangePaymentRefsByCalculationIdsResponse>
378
+ | GetExchangePaymentRefsByCalculationIdsResponse;
379
+
380
+ getExchangeDealRefsByCalculationIds(
381
+ request: GetExchangeDealRefsByCalculationIdsRequest,
382
+ ):
383
+ | Promise<GetExchangeDealRefsByCalculationIdsResponse>
384
+ | Observable<GetExchangeDealRefsByCalculationIdsResponse>
385
+ | GetExchangeDealRefsByCalculationIdsResponse;
386
+
331
387
  getExchangeDealStatesByCalculationIds(
332
388
  request: GetExchangeDealStatesByCalculationIdsRequest,
333
389
  ):
334
390
  | Promise<GetExchangeDealStatesByCalculationIdsResponse>
335
391
  | Observable<GetExchangeDealStatesByCalculationIdsResponse>
336
392
  | GetExchangeDealStatesByCalculationIdsResponse;
337
-
338
- getTransactions(
339
- request: GetTransactionsRequest,
340
- ): Promise<GetTransactionsResponse> | Observable<GetTransactionsResponse> | GetTransactionsResponse;
341
393
  }
342
394
 
343
395
  export function ExchangeCoreServiceControllerMethods() {
@@ -348,8 +400,10 @@ export function ExchangeCoreServiceControllerMethods() {
348
400
  "updateExchangeDeal",
349
401
  "completeExchangeDeal",
350
402
  "cancelExchangeDeal",
351
- "getExchangeDealStatesByCalculationIds",
352
403
  "getTransactions",
404
+ "getExchangePaymentRefsByCalculationIds",
405
+ "getExchangeDealRefsByCalculationIds",
406
+ "getExchangeDealStatesByCalculationIds",
353
407
  ];
354
408
  for (const method of grpcMethods) {
355
409
  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.213",
4
+ "version": "1.0.215",
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,14 @@ 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
- // }
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
- // }
24
+
25
+ rpc GetExchangePaymentRefsByCalculationIds(GetExchangePaymentRefsByCalculationIdsRequest) returns (GetExchangePaymentRefsByCalculationIdsResponse);
26
+ rpc GetExchangeDealRefsByCalculationIds(GetExchangeDealRefsByCalculationIdsRequest) returns (GetExchangeDealRefsByCalculationIdsResponse);
27
+ rpc GetExchangeDealStatesByCalculationIds(GetExchangeDealStatesByCalculationIdsRequest) returns (GetExchangeDealStatesByCalculationIdsResponse);
28
+ }
46
29
 
47
30
  // message CreateExchangePaymentRequest {
48
31
  // optional string manager_user_id = 1;
@@ -138,19 +121,20 @@ message CreateExchangeDealRequest {
138
121
  optional string output_currency_id = 12;
139
122
 
140
123
  optional string customer_id = 13;
124
+ optional string manager_person_id = 14;
141
125
 
142
- optional double expenses_for_courier = 14;
143
- optional bool include_in_total_calculation = 15;
144
- optional bool one_currency_exchange = 16;
145
- optional bool received_from_dealer = 17;
146
- optional string received_from_dealer_wallet_id = 18;
126
+ optional double expenses_for_courier = 15;
127
+ optional bool include_in_total_calculation = 16;
128
+ optional bool one_currency_exchange = 17;
129
+ optional bool received_from_dealer = 18;
130
+ optional string received_from_dealer_wallet_id = 19;
147
131
 
148
- optional string customer_doc_name = 19;
149
- optional string customer_doc_nationality = 20;
150
- optional string customer_doc_number = 21;
132
+ optional string customer_doc_name = 20;
133
+ optional string customer_doc_nationality = 21;
134
+ optional string customer_doc_number = 22;
151
135
 
152
- optional string customer_source = 22;
153
- optional string customer_referrer = 23;
136
+ optional string customer_source = 23;
137
+ optional string customer_referrer = 24;
154
138
 
155
139
  repeated double receipts = 25;
156
140
  }
@@ -282,35 +266,6 @@ message CancelExchangeDealResponse {
282
266
  optional string error = 3;
283
267
  }
284
268
 
285
- message GetExchangeDealStatesByCalculationIdsRequest {
286
- repeated string calculation_ids = 1;
287
- }
288
-
289
- enum ExchangeDealStatus {
290
- EXCHANGE_DEAL_STATUS_UNSPECIFIED = 0;
291
- EXCHANGE_DEAL_STATUS_NO_DEAL = 1;
292
- EXCHANGE_DEAL_STATUS_IN_PROGRESS = 2;
293
- EXCHANGE_DEAL_STATUS_COMPLETED = 3;
294
- EXCHANGE_DEAL_STATUS_CANCELLED = 4;
295
- }
296
-
297
- enum ExchangeDealAction {
298
- EXCHANGE_DEAL_ACTION_UNSPECIFIED = 0;
299
- EXCHANGE_DEAL_ACTION_CREATE_DEAL = 1;
300
- EXCHANGE_DEAL_ACTION_OPEN_DEAL = 2;
301
- }
302
-
303
- message ExchangeDealStateByCalculation {
304
- string calculation_id = 1;
305
- optional string deal_id = 2;
306
- ExchangeDealStatus status = 3;
307
- repeated ExchangeDealAction allowed_actions = 4;
308
- }
309
-
310
- message GetExchangeDealStatesByCalculationIdsResponse {
311
- repeated ExchangeDealStateByCalculation items = 1;
312
- repeated string not_found_calculation_ids = 2;
313
- }
314
269
 
315
270
  message GetTransactionsRequest {
316
271
  ActorContext actor = 1;
@@ -368,3 +323,63 @@ message GetTransactionsResponse {
368
323
  repeated GetTransactionsItem results = 4;
369
324
  repeated GetTransactionsSummaryItem summary = 5;
370
325
  }
326
+
327
+ message GetExchangePaymentRefsByCalculationIdsRequest {
328
+ repeated string calculation_ids = 1;
329
+ }
330
+
331
+ message ExchangePaymentRefByCalculation {
332
+ string calculation_id = 1;
333
+ string payment_uuid = 2;
334
+ }
335
+
336
+ message GetExchangePaymentRefsByCalculationIdsResponse {
337
+ repeated ExchangePaymentRefByCalculation items = 1;
338
+ repeated string not_found_calculation_ids = 2;
339
+ }
340
+
341
+ message GetExchangeDealRefsByCalculationIdsRequest {
342
+ repeated string calculation_ids = 1;
343
+ }
344
+
345
+ message ExchangeDealRefByCalculation {
346
+ string calculation_id = 1;
347
+ string exchange_id = 2;
348
+ bool status = 3;
349
+ }
350
+
351
+ message GetExchangeDealRefsByCalculationIdsResponse {
352
+ repeated ExchangeDealRefByCalculation items = 1;
353
+ repeated string not_found_calculation_ids = 2;
354
+ }
355
+
356
+
357
+ message GetExchangeDealStatesByCalculationIdsRequest {
358
+ repeated string calculation_ids = 1;
359
+ }
360
+
361
+ enum ExchangeDealStatus {
362
+ EXCHANGE_DEAL_STATUS_UNSPECIFIED = 0;
363
+ EXCHANGE_DEAL_STATUS_NO_DEAL = 1;
364
+ EXCHANGE_DEAL_STATUS_IN_PROGRESS = 2;
365
+ EXCHANGE_DEAL_STATUS_COMPLETED = 3;
366
+ EXCHANGE_DEAL_STATUS_CANCELLED = 4;
367
+ }
368
+
369
+ enum ExchangeDealAction {
370
+ EXCHANGE_DEAL_ACTION_UNSPECIFIED = 0;
371
+ EXCHANGE_DEAL_ACTION_CREATE_DEAL = 1;
372
+ EXCHANGE_DEAL_ACTION_OPEN_DEAL = 2;
373
+ }
374
+
375
+ message ExchangeDealStateByCalculation {
376
+ string calculation_id = 1;
377
+ optional string deal_id = 2;
378
+ ExchangeDealStatus status = 3;
379
+ repeated ExchangeDealAction allowed_actions = 4;
380
+ }
381
+
382
+ message GetExchangeDealStatesByCalculationIdsResponse {
383
+ repeated ExchangeDealStateByCalculation items = 1;
384
+ repeated string not_found_calculation_ids = 2;
385
+ }
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;