@arbiwallet/contracts 1.0.214 → 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.
- package/gen/exchange_core.ts +76 -23
- package/gen/user.ts +25 -0
- package/package.json +1 -1
- package/proto/exchange_core.proto +65 -51
- package/proto/user.proto +16 -0
package/gen/exchange_core.ts
CHANGED
|
@@ -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,51 @@ export interface GetTransactionsResponse {
|
|
|
274
258
|
summary: GetTransactionsSummaryItem[];
|
|
275
259
|
}
|
|
276
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
|
+
|
|
277
306
|
export const EXCHANGE_CORE_PACKAGE_NAME = "exchange_core";
|
|
278
307
|
|
|
279
308
|
wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
|
|
@@ -295,11 +324,19 @@ export interface ExchangeCoreServiceClient {
|
|
|
295
324
|
|
|
296
325
|
cancelExchangeDeal(request: CancelExchangeDealRequest): Observable<CancelExchangeDealResponse>;
|
|
297
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
|
+
|
|
298
337
|
getExchangeDealStatesByCalculationIds(
|
|
299
338
|
request: GetExchangeDealStatesByCalculationIdsRequest,
|
|
300
339
|
): Observable<GetExchangeDealStatesByCalculationIdsResponse>;
|
|
301
|
-
|
|
302
|
-
getTransactions(request: GetTransactionsRequest): Observable<GetTransactionsResponse>;
|
|
303
340
|
}
|
|
304
341
|
|
|
305
342
|
/**
|
|
@@ -329,16 +366,30 @@ export interface ExchangeCoreServiceController {
|
|
|
329
366
|
request: CancelExchangeDealRequest,
|
|
330
367
|
): Promise<CancelExchangeDealResponse> | Observable<CancelExchangeDealResponse> | CancelExchangeDealResponse;
|
|
331
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
|
+
|
|
332
387
|
getExchangeDealStatesByCalculationIds(
|
|
333
388
|
request: GetExchangeDealStatesByCalculationIdsRequest,
|
|
334
389
|
):
|
|
335
390
|
| Promise<GetExchangeDealStatesByCalculationIdsResponse>
|
|
336
391
|
| Observable<GetExchangeDealStatesByCalculationIdsResponse>
|
|
337
392
|
| GetExchangeDealStatesByCalculationIdsResponse;
|
|
338
|
-
|
|
339
|
-
getTransactions(
|
|
340
|
-
request: GetTransactionsRequest,
|
|
341
|
-
): Promise<GetTransactionsResponse> | Observable<GetTransactionsResponse> | GetTransactionsResponse;
|
|
342
393
|
}
|
|
343
394
|
|
|
344
395
|
export function ExchangeCoreServiceControllerMethods() {
|
|
@@ -349,8 +400,10 @@ export function ExchangeCoreServiceControllerMethods() {
|
|
|
349
400
|
"updateExchangeDeal",
|
|
350
401
|
"completeExchangeDeal",
|
|
351
402
|
"cancelExchangeDeal",
|
|
352
|
-
"getExchangeDealStatesByCalculationIds",
|
|
353
403
|
"getTransactions",
|
|
404
|
+
"getExchangePaymentRefsByCalculationIds",
|
|
405
|
+
"getExchangeDealRefsByCalculationIds",
|
|
406
|
+
"getExchangeDealStatesByCalculationIds",
|
|
354
407
|
];
|
|
355
408
|
for (const method of grpcMethods) {
|
|
356
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.
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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;
|
|
@@ -283,35 +266,6 @@ message CancelExchangeDealResponse {
|
|
|
283
266
|
optional string error = 3;
|
|
284
267
|
}
|
|
285
268
|
|
|
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
269
|
|
|
316
270
|
message GetTransactionsRequest {
|
|
317
271
|
ActorContext actor = 1;
|
|
@@ -369,3 +323,63 @@ message GetTransactionsResponse {
|
|
|
369
323
|
repeated GetTransactionsItem results = 4;
|
|
370
324
|
repeated GetTransactionsSummaryItem summary = 5;
|
|
371
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;
|