@arbiwallet/contracts 1.0.23 → 1.0.25

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/deposit.ts ADDED
@@ -0,0 +1,60 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v7.34.0
5
+ // source: deposit.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "deposit.v1";
12
+
13
+ export interface ApplyBitGoCustodyAckRequest {
14
+ /** TRON | BSC */
15
+ network: string;
16
+ txHash: string;
17
+ logIndex?: number | undefined;
18
+ bitgoTransferId: string;
19
+ bitgoState: string;
20
+ /** может быть пустым */
21
+ webhookEventId: string;
22
+ }
23
+
24
+ export interface ApplyBitGoCustodyAckResponse {
25
+ matched: number;
26
+ depositTxIds: string[];
27
+ }
28
+
29
+ export const DEPOSIT_V1_PACKAGE_NAME = "deposit.v1";
30
+
31
+ export interface DepositIntegrationClient {
32
+ /** Привязать событие BitGo к уже найденному ончейн-депозиту (mpc webhook). */
33
+
34
+ applyBitGoCustodyAck(request: ApplyBitGoCustodyAckRequest): Observable<ApplyBitGoCustodyAckResponse>;
35
+ }
36
+
37
+ export interface DepositIntegrationController {
38
+ /** Привязать событие BitGo к уже найденному ончейн-депозиту (mpc webhook). */
39
+
40
+ applyBitGoCustodyAck(
41
+ request: ApplyBitGoCustodyAckRequest,
42
+ ): Promise<ApplyBitGoCustodyAckResponse> | Observable<ApplyBitGoCustodyAckResponse> | ApplyBitGoCustodyAckResponse;
43
+ }
44
+
45
+ export function DepositIntegrationControllerMethods() {
46
+ return function (constructor: Function) {
47
+ const grpcMethods: string[] = ["applyBitGoCustodyAck"];
48
+ for (const method of grpcMethods) {
49
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
50
+ GrpcMethod("DepositIntegration", method)(constructor.prototype[method], method, descriptor);
51
+ }
52
+ const grpcStreamMethods: string[] = [];
53
+ for (const method of grpcStreamMethods) {
54
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
55
+ GrpcStreamMethod("DepositIntegration", method)(constructor.prototype[method], method, descriptor);
56
+ }
57
+ };
58
+ }
59
+
60
+ export const DEPOSIT_INTEGRATION_SERVICE_NAME = "DepositIntegration";
package/gen/ledger.ts CHANGED
@@ -270,7 +270,22 @@ export interface GetTransactionFeedRequest {
270
270
  limit: number;
271
271
  /** Курсор для следующей страницы. */
272
272
  cursorId?: string | undefined;
273
- offset?: number | undefined;
273
+ offset?:
274
+ | number
275
+ | undefined;
276
+ /** Фильтр по активу, напр. USDT. */
277
+ asset?:
278
+ | string
279
+ | undefined;
280
+ /** Фильтр по сети, напр. TRON, BSC. */
281
+ network?:
282
+ | string
283
+ | undefined;
284
+ /**
285
+ * Фильтр по «типу» операции для UI: "withdrawal" | "deposit".
286
+ * deposit включает записи reference_type deposit и deposit_hold.
287
+ */
288
+ referenceKind?: string | undefined;
274
289
  }
275
290
 
276
291
  export interface GetTransactionFeedResponse {
package/gen/webhook.ts CHANGED
@@ -12,7 +12,7 @@ export const protobufPackage = "webhook.v1";
12
12
 
13
13
  export interface ProcessWebhookRequest {
14
14
  /**
15
- * Полное тело webhook от BitGo в виде одной JSON-строки (как получено после парсинга HTTP, объекты сериализованы стандартно).
15
+ * Полное тело события от BitGo в виде одной JSON-строки (как передал gateway после приёма webhook).
16
16
  * Клиент (gateway) обязан передавать валидный JSON; mpc парсит и маппит поля transfer / state / data и т.д.
17
17
  */
18
18
  jsonPayload: string;
@@ -30,7 +30,7 @@ export const WEBHOOK_V1_PACKAGE_NAME = "webhook.v1";
30
30
  export interface WebhookServiceClient {
31
31
  /**
32
32
  * Обработка одного события webhook BitGo: разбор JSON, дедупликация по event_id, обновление custody-транзакций,
33
- * при необходимости — gRPC в Ledger (статус вывода, зачисление депозита) и уведомления.
33
+ * при необходимости — gRPC в Ledger (статус вывода, зачисление депозита).
34
34
  */
35
35
 
36
36
  processBitGoWebhook(request: ProcessWebhookRequest): Observable<ProcessWebhookResponse>;
@@ -39,7 +39,7 @@ export interface WebhookServiceClient {
39
39
  export interface WebhookServiceController {
40
40
  /**
41
41
  * Обработка одного события webhook BitGo: разбор JSON, дедупликация по event_id, обновление custody-транзакций,
42
- * при необходимости — gRPC в Ledger (статус вывода, зачисление депозита) и уведомления.
42
+ * при необходимости — gRPC в Ledger (статус вывода, зачисление депозита).
43
43
  */
44
44
 
45
45
  processBitGoWebhook(
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.23",
4
+ "version": "1.0.25",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -0,0 +1,27 @@
1
+ syntax = "proto3";
2
+
3
+ // Внутренний gRPC deposit_service (ончейн-депозиты, привязка BitGo и т.п.).
4
+ package deposit.v1;
5
+
6
+ option csharp_namespace = "Deposit.V1";
7
+ option java_multiple_files = true;
8
+ option java_package = "com.arbiwallet.deposit.v1";
9
+
10
+ service DepositIntegration {
11
+ // Привязать событие BitGo к уже найденному ончейн-депозиту (mpc webhook).
12
+ rpc ApplyBitGoCustodyAck(ApplyBitGoCustodyAckRequest) returns (ApplyBitGoCustodyAckResponse);
13
+ }
14
+
15
+ message ApplyBitGoCustodyAckRequest {
16
+ string network = 1; // TRON | BSC
17
+ string tx_hash = 2;
18
+ optional int32 log_index = 3;
19
+ string bitgo_transfer_id = 4;
20
+ string bitgo_state = 5;
21
+ string webhook_event_id = 6; // может быть пустым
22
+ }
23
+
24
+ message ApplyBitGoCustodyAckResponse {
25
+ int32 matched = 1;
26
+ repeated string deposit_tx_ids = 2;
27
+ }
@@ -252,6 +252,11 @@ message GetTransactionFeedRequest {
252
252
  int32 limit = 2;
253
253
  optional string cursor_id = 3; // Курсор для следующей страницы.
254
254
  optional int32 offset = 4;
255
+ optional string asset = 5; // Фильтр по активу, напр. USDT.
256
+ optional string network = 6; // Фильтр по сети, напр. TRON, BSC.
257
+ // Фильтр по «типу» операции для UI: "withdrawal" | "deposit".
258
+ // deposit включает записи reference_type deposit и deposit_hold.
259
+ optional string reference_kind = 7;
255
260
  }
256
261
 
257
262
  message GetTransactionFeedResponse {
@@ -1,18 +1,18 @@
1
1
  syntax = "proto3";
2
2
 
3
- // Пакет внутреннего gRPC для передачи событий BitGo в mpc_service без публичного HTTP на mpc.
4
- // Типичный поток: WalletGateway принимает POST /webhooks/bitgo → вызывает ProcessBitGoWebhook с JSON телом.
5
- // Та же бизнес-логика, что у HTTP-обработчика webhook в mpc (дедуп, обновление транзакций, вызовы Ledger/Notification).
3
+ // Пакет внутреннего gRPC: события BitGo передаются в mpc_service только по gRPC (публичный ingress — Wallet Gateway).
4
+ // Типичный поток: WalletGateway принимает webhook от BitGo → вызывает ProcessBitGoWebhook с JSON-телом в json_payload.
5
+ // Бизнес-логика: дедуп, обновление транзакций, исходящие вызовы в Ledger.
6
6
  package webhook.v1;
7
7
 
8
8
  service WebhookService {
9
9
  // Обработка одного события webhook BitGo: разбор JSON, дедупликация по event_id, обновление custody-транзакций,
10
- // при необходимости — gRPC в Ledger (статус вывода, зачисление депозита) и уведомления.
10
+ // при необходимости — gRPC в Ledger (статус вывода, зачисление депозита).
11
11
  rpc ProcessBitGoWebhook(ProcessWebhookRequest) returns (ProcessWebhookResponse);
12
12
  }
13
13
 
14
14
  message ProcessWebhookRequest {
15
- // Полное тело webhook от BitGo в виде одной JSON-строки (как получено после парсинга HTTP, объекты сериализованы стандартно).
15
+ // Полное тело события от BitGo в виде одной JSON-строки (как передал gateway после приёма webhook).
16
16
  // Клиент (gateway) обязан передавать валидный JSON; mpc парсит и маппит поля transfer / state / data и т.д.
17
17
  string json_payload = 1;
18
18
  }