@arbiwallet/contracts 1.0.119 → 1.0.121

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/card.ts CHANGED
@@ -207,7 +207,6 @@ export interface ScanGiftCardQrRequest {
207
207
  accountId: number;
208
208
  uid: number;
209
209
  bin: string;
210
- cardHolderName: string;
211
210
  }
212
211
 
213
212
  export interface ScanGiftCardQrResponse {
@@ -308,6 +307,18 @@ export interface GetCardTransactionsResponse {
308
307
  edge: Edge | undefined;
309
308
  }
310
309
 
310
+ export interface SyncRecentUserCardHistoryRequest {
311
+ accountId: number;
312
+ size: number;
313
+ cooldownSeconds: number;
314
+ }
315
+
316
+ export interface SyncRecentUserCardHistoryResponse {
317
+ syncedCards: number;
318
+ skippedCards: number;
319
+ failedCards: number;
320
+ }
321
+
311
322
  export interface GetCardAuthTransactionsRequest {
312
323
  accountId: number;
313
324
  cardId: number;
@@ -422,6 +433,20 @@ export interface GetRegionsResponse {
422
433
  regions: string[];
423
434
  }
424
435
 
436
+ export interface HandleBincentricWebhookRequest {
437
+ rawBody: Uint8Array;
438
+ webhookTimestamp: string;
439
+ webhookSignature: string;
440
+ }
441
+
442
+ export interface HandleBincentricWebhookResponse {
443
+ ok: boolean;
444
+ handled: boolean;
445
+ eventType: string;
446
+ cardId: number;
447
+ reason: string;
448
+ }
449
+
425
450
  export const CARD_V1_PACKAGE_NAME = "card.v1";
426
451
 
427
452
  export interface CardServiceClient {
@@ -453,6 +478,8 @@ export interface CardServiceClient {
453
478
 
454
479
  getCardTransactions(request: GetCardTransactionsRequest): Observable<GetCardTransactionsResponse>;
455
480
 
481
+ syncRecentUserCardHistory(request: SyncRecentUserCardHistoryRequest): Observable<SyncRecentUserCardHistoryResponse>;
482
+
456
483
  getCardAuthTransactions(request: GetCardAuthTransactionsRequest): Observable<GetCardAuthTransactionsResponse>;
457
484
 
458
485
  getCard3DsCodes(request: GetCard3dsCodesRequest): Observable<GetCard3dsCodesResponse>;
@@ -474,6 +501,8 @@ export interface CardServiceClient {
474
501
  getAreaCodes(request: GetAreaCodesRequest): Observable<GetAreaCodesResponse>;
475
502
 
476
503
  getRegions(request: GetRegionsRequest): Observable<GetRegionsResponse>;
504
+
505
+ handleBincentricWebhook(request: HandleBincentricWebhookRequest): Observable<HandleBincentricWebhookResponse>;
477
506
  }
478
507
 
479
508
  export interface CardServiceController {
@@ -531,6 +560,13 @@ export interface CardServiceController {
531
560
  request: GetCardTransactionsRequest,
532
561
  ): Promise<GetCardTransactionsResponse> | Observable<GetCardTransactionsResponse> | GetCardTransactionsResponse;
533
562
 
563
+ syncRecentUserCardHistory(
564
+ request: SyncRecentUserCardHistoryRequest,
565
+ ):
566
+ | Promise<SyncRecentUserCardHistoryResponse>
567
+ | Observable<SyncRecentUserCardHistoryResponse>
568
+ | SyncRecentUserCardHistoryResponse;
569
+
534
570
  getCardAuthTransactions(
535
571
  request: GetCardAuthTransactionsRequest,
536
572
  ):
@@ -567,6 +603,13 @@ export interface CardServiceController {
567
603
  getRegions(
568
604
  request: GetRegionsRequest,
569
605
  ): Promise<GetRegionsResponse> | Observable<GetRegionsResponse> | GetRegionsResponse;
606
+
607
+ handleBincentricWebhook(
608
+ request: HandleBincentricWebhookRequest,
609
+ ):
610
+ | Promise<HandleBincentricWebhookResponse>
611
+ | Observable<HandleBincentricWebhookResponse>
612
+ | HandleBincentricWebhookResponse;
570
613
  }
571
614
 
572
615
  export function CardServiceControllerMethods() {
@@ -586,6 +629,7 @@ export function CardServiceControllerMethods() {
586
629
  "getCard",
587
630
  "getCardBalance",
588
631
  "getCardTransactions",
632
+ "syncRecentUserCardHistory",
589
633
  "getCardAuthTransactions",
590
634
  "getCard3DsCodes",
591
635
  "updateCardStatus",
@@ -597,6 +641,7 @@ export function CardServiceControllerMethods() {
597
641
  "getBinsExists",
598
642
  "getAreaCodes",
599
643
  "getRegions",
644
+ "handleBincentricWebhook",
600
645
  ];
601
646
  for (const method of grpcMethods) {
602
647
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/gen/ledger.ts CHANGED
@@ -349,6 +349,7 @@ export interface GetTransactionFeedRequest {
349
349
  | undefined;
350
350
  /** true: все события по выводу (RESERVED, WITHDRAWAL_STATUS, FINALIZED, …). По умолчанию — одна строка на вывод (последнее событие). */
351
351
  expandWithdrawalTimeline?: boolean | undefined;
352
+ referenceId?: string | undefined;
352
353
  }
353
354
 
354
355
  export interface GetTransactionFeedResponse {
@@ -360,6 +361,20 @@ export interface GetTransactionFeedResponse {
360
361
  totalReturned: number;
361
362
  }
362
363
 
364
+ export interface AppendTransactionFeedItemRequest {
365
+ userId: string;
366
+ type: string;
367
+ asset: string;
368
+ network: string;
369
+ amount?: string | undefined;
370
+ referenceType?: string | undefined;
371
+ referenceId?: string | undefined;
372
+ title?: string | undefined;
373
+ metadataJson?: string | undefined;
374
+ idempotencyKey: string;
375
+ createdAt?: string | undefined;
376
+ }
377
+
363
378
  export interface ListTransactionsRequest {
364
379
  page?: number | undefined;
365
380
  limit?: number | undefined;
@@ -473,6 +488,10 @@ export interface LedgerServiceClient {
473
488
 
474
489
  getTransactionFeed(request: GetTransactionFeedRequest): Observable<GetTransactionFeedResponse>;
475
490
 
491
+ /** Идемпотентное добавление внешнего события в UI-ленту (например card provider events). */
492
+
493
+ appendTransactionFeedItem(request: AppendTransactionFeedItemRequest): Observable<TransactionFeedItem>;
494
+
476
495
  /** Админский список всех транзакций с пагинацией/фильтрами/поиском. */
477
496
 
478
497
  listTransactions(request: ListTransactionsRequest): Observable<ListTransactionsResponse>;
@@ -579,6 +598,12 @@ export interface LedgerServiceController {
579
598
  request: GetTransactionFeedRequest,
580
599
  ): Promise<GetTransactionFeedResponse> | Observable<GetTransactionFeedResponse> | GetTransactionFeedResponse;
581
600
 
601
+ /** Идемпотентное добавление внешнего события в UI-ленту (например card provider events). */
602
+
603
+ appendTransactionFeedItem(
604
+ request: AppendTransactionFeedItemRequest,
605
+ ): Promise<TransactionFeedItem> | Observable<TransactionFeedItem> | TransactionFeedItem;
606
+
582
607
  /** Админский список всех транзакций с пагинацией/фильтрами/поиском. */
583
608
 
584
609
  listTransactions(
@@ -610,6 +635,7 @@ export function LedgerServiceControllerMethods() {
610
635
  "getBalancesBatch",
611
636
  "getFxRatesUsd",
612
637
  "getTransactionFeed",
638
+ "appendTransactionFeedItem",
613
639
  "listTransactions",
614
640
  "internalTransfer",
615
641
  ];
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.119",
4
+ "version": "1.0.121",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
package/proto/card.proto CHANGED
@@ -23,6 +23,7 @@ service CardService {
23
23
  rpc GetCardBalance(GetCardBalanceRequest) returns (GetCardBalanceResponse);
24
24
 
25
25
  rpc GetCardTransactions(GetCardTransactionsRequest) returns (GetCardTransactionsResponse);
26
+ rpc SyncRecentUserCardHistory(SyncRecentUserCardHistoryRequest) returns (SyncRecentUserCardHistoryResponse);
26
27
  rpc GetCardAuthTransactions(GetCardAuthTransactionsRequest) returns (GetCardAuthTransactionsResponse);
27
28
  rpc GetCard3dsCodes(GetCard3dsCodesRequest) returns (GetCard3dsCodesResponse);
28
29
 
@@ -36,6 +37,8 @@ service CardService {
36
37
  rpc GetBinsExists(GetBinsExistsRequest) returns (GetBinsExistsResponse);
37
38
  rpc GetAreaCodes(GetAreaCodesRequest) returns (GetAreaCodesResponse);
38
39
  rpc GetRegions(GetRegionsRequest) returns (GetRegionsResponse);
40
+
41
+ rpc HandleBincentricWebhook(HandleBincentricWebhookRequest) returns (HandleBincentricWebhookResponse);
39
42
  }
40
43
 
41
44
  enum CardStatus {
@@ -235,7 +238,6 @@ message ScanGiftCardQrRequest {
235
238
  int64 account_id = 1;
236
239
  int64 uid = 2;
237
240
  string bin = 3;
238
- string card_holder_name = 4;
239
241
  }
240
242
 
241
243
  message ScanGiftCardQrResponse {
@@ -336,6 +338,18 @@ message GetCardTransactionsResponse {
336
338
  Edge edge = 2;
337
339
  }
338
340
 
341
+ message SyncRecentUserCardHistoryRequest {
342
+ int64 account_id = 1;
343
+ int32 size = 2;
344
+ int32 cooldown_seconds = 3;
345
+ }
346
+
347
+ message SyncRecentUserCardHistoryResponse {
348
+ int32 synced_cards = 1;
349
+ int32 skipped_cards = 2;
350
+ int32 failed_cards = 3;
351
+ }
352
+
339
353
  message GetCardAuthTransactionsRequest {
340
354
  int64 account_id = 1;
341
355
  int64 card_id = 2;
@@ -449,3 +463,17 @@ message GetAreaCodesResponse {
449
463
  message GetRegionsResponse {
450
464
  repeated string regions = 1;
451
465
  }
466
+
467
+ message HandleBincentricWebhookRequest {
468
+ bytes raw_body = 1;
469
+ string webhook_timestamp = 2;
470
+ string webhook_signature = 3;
471
+ }
472
+
473
+ message HandleBincentricWebhookResponse {
474
+ bool ok = 1;
475
+ bool handled = 2;
476
+ string event_type = 3;
477
+ int64 card_id = 4;
478
+ string reason = 5;
479
+ }
@@ -39,6 +39,8 @@ service LedgerService {
39
39
  rpc GetFxRatesUsd(GetFxRatesUsdRequest) returns (GetFxRatesUsdResponse);
40
40
  // Постраничная лента операций пользователя (история для UI); курсор и offset — на усмотрение сервера.
41
41
  rpc GetTransactionFeed(GetTransactionFeedRequest) returns (GetTransactionFeedResponse);
42
+ // Идемпотентное добавление внешнего события в UI-ленту (например card provider events).
43
+ rpc AppendTransactionFeedItem(AppendTransactionFeedItemRequest) returns (TransactionFeedItem);
42
44
  // Админский список всех транзакций с пагинацией/фильтрами/поиском.
43
45
  rpc ListTransactions(ListTransactionsRequest) returns (ListTransactionsResponse);
44
46
  // Внутренний перевод между пользователями приложения (только ledger, без сетевой комиссии).
@@ -304,6 +306,7 @@ message GetTransactionFeedRequest {
304
306
  optional string reference_kind = 7;
305
307
  // true: все события по выводу (RESERVED, WITHDRAWAL_STATUS, FINALIZED, …). По умолчанию — одна строка на вывод (последнее событие).
306
308
  optional bool expand_withdrawal_timeline = 8;
309
+ optional string reference_id = 9;
307
310
  }
308
311
 
309
312
  message GetTransactionFeedResponse {
@@ -312,6 +315,20 @@ message GetTransactionFeedResponse {
312
315
  int32 total_returned = 3; // Число элементов в этом ответе.
313
316
  }
314
317
 
318
+ message AppendTransactionFeedItemRequest {
319
+ string user_id = 1;
320
+ string type = 2;
321
+ string asset = 3;
322
+ string network = 4;
323
+ optional string amount = 5;
324
+ optional string reference_type = 6;
325
+ optional string reference_id = 7;
326
+ optional string title = 8;
327
+ optional string metadata_json = 9;
328
+ string idempotency_key = 10;
329
+ optional string created_at = 11;
330
+ }
331
+
315
332
  enum TransactionSortBy {
316
333
  TRANSACTION_SORT_BY_CREATED_AT = 0;
317
334
  TRANSACTION_SORT_BY_TYPE = 1;