@arbiwallet/contracts 1.0.31 → 1.0.32

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/ledger.ts CHANGED
@@ -252,6 +252,19 @@ export interface GetBalancesResponse {
252
252
  balances: BalanceRow[];
253
253
  }
254
254
 
255
+ export interface GetBalancesBatchRequest {
256
+ userIds: string[];
257
+ }
258
+
259
+ export interface UserBalancesRow {
260
+ userId: string;
261
+ balances: BalanceRow[];
262
+ }
263
+
264
+ export interface GetBalancesBatchResponse {
265
+ users: UserBalancesRow[];
266
+ }
267
+
255
268
  export interface TransactionFeedItem {
256
269
  id: string;
257
270
  /** Тип события ленты (строка, см. TransactionFeedType в реализации). */
@@ -372,6 +385,10 @@ export interface LedgerServiceClient {
372
385
 
373
386
  getBalances(request: GetBalancesRequest): Observable<GetBalancesResponse>;
374
387
 
388
+ /** Балансовые позиции сразу для массива пользователей. */
389
+
390
+ getBalancesBatch(request: GetBalancesBatchRequest): Observable<GetBalancesBatchResponse>;
391
+
375
392
  /** Постраничная лента операций пользователя (история для UI); курсор и offset — на усмотрение сервера. */
376
393
 
377
394
  getTransactionFeed(request: GetTransactionFeedRequest): Observable<GetTransactionFeedResponse>;
@@ -460,6 +477,12 @@ export interface LedgerServiceController {
460
477
  request: GetBalancesRequest,
461
478
  ): Promise<GetBalancesResponse> | Observable<GetBalancesResponse> | GetBalancesResponse;
462
479
 
480
+ /** Балансовые позиции сразу для массива пользователей. */
481
+
482
+ getBalancesBatch(
483
+ request: GetBalancesBatchRequest,
484
+ ): Promise<GetBalancesBatchResponse> | Observable<GetBalancesBatchResponse> | GetBalancesBatchResponse;
485
+
463
486
  /** Постраничная лента операций пользователя (история для UI); курсор и offset — на усмотрение сервера. */
464
487
 
465
488
  getTransactionFeed(
@@ -488,6 +511,7 @@ export function LedgerServiceControllerMethods() {
488
511
  "updateWithdrawalStatus",
489
512
  "getBalance",
490
513
  "getBalances",
514
+ "getBalancesBatch",
491
515
  "getTransactionFeed",
492
516
  "internalTransfer",
493
517
  ];
package/gen/user.ts CHANGED
@@ -48,6 +48,7 @@ export interface UserResponse {
48
48
  avatar?: string | undefined;
49
49
  createdAt: string;
50
50
  updatedAt: string;
51
+ balances: UserBalance[];
51
52
  }
52
53
 
53
54
  export interface UpdateUserRequest {
@@ -91,6 +92,14 @@ export interface ResolveUserForTransferResponse {
91
92
  id: number;
92
93
  }
93
94
 
95
+ export interface UserBalance {
96
+ asset: string;
97
+ network: string;
98
+ available: string;
99
+ reserved: string;
100
+ total: string;
101
+ }
102
+
94
103
  export const USER_PACKAGE_NAME = "user";
95
104
 
96
105
  export interface UserServiceClient {
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.31",
4
+ "version": "1.0.32",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -33,6 +33,8 @@ service LedgerService {
33
33
  rpc GetBalance(GetBalanceRequest) returns (GetBalanceResponse);
34
34
  // Все балансовые позиции пользователя по всем активам и сетям.
35
35
  rpc GetBalances(GetBalancesRequest) returns (GetBalancesResponse);
36
+ // Балансовые позиции сразу для массива пользователей.
37
+ rpc GetBalancesBatch(GetBalancesBatchRequest) returns (GetBalancesBatchResponse);
36
38
  // Постраничная лента операций пользователя (история для UI); курсор и offset — на усмотрение сервера.
37
39
  rpc GetTransactionFeed(GetTransactionFeedRequest) returns (GetTransactionFeedResponse);
38
40
  // Внутренний перевод между пользователями приложения (только ledger, без сетевой комиссии).
@@ -237,6 +239,19 @@ message GetBalancesResponse {
237
239
  repeated BalanceRow balances = 1;
238
240
  }
239
241
 
242
+ message GetBalancesBatchRequest {
243
+ repeated string user_ids = 1;
244
+ }
245
+
246
+ message UserBalancesRow {
247
+ string user_id = 1;
248
+ repeated BalanceRow balances = 2;
249
+ }
250
+
251
+ message GetBalancesBatchResponse {
252
+ repeated UserBalancesRow users = 1;
253
+ }
254
+
240
255
  message TransactionFeedItem {
241
256
  string id = 1;
242
257
  string type = 2; // Тип события ленты (строка, см. TransactionFeedType в реализации).
package/proto/user.proto CHANGED
@@ -34,6 +34,7 @@ message UserResponse {
34
34
  optional string avatar = 10;
35
35
  string created_at = 11;
36
36
  string updated_at = 12;
37
+ repeated UserBalance balances = 15;
37
38
  }
38
39
 
39
40
  message UpdateUserRequest {
@@ -87,3 +88,11 @@ message ResolveUserForTransferRequest {
87
88
  message ResolveUserForTransferResponse {
88
89
  int32 id = 1;
89
90
  }
91
+
92
+ message UserBalance {
93
+ string asset = 1;
94
+ string network = 2;
95
+ string available = 3;
96
+ string reserved = 4;
97
+ string total = 5;
98
+ }