@arbiwallet/contracts 1.0.38 → 1.0.40

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
@@ -361,6 +361,10 @@ export interface InternalTransferRequest {
361
361
  /** Десятичная строка; списание с available отправителя. */
362
362
  amount: string;
363
363
  idempotencyKey: string;
364
+ /** Как задан получатель на стороне Gateway: user_id | uid | email | phone | telegram */
365
+ recipientKind: string;
366
+ /** Введённое пользователем значение */
367
+ recipientValue: string;
364
368
  }
365
369
 
366
370
  export interface InternalTransferResponse {
@@ -0,0 +1,159 @@
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: withdrawal.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "withdrawal.v1";
12
+
13
+ export interface CreateWithdrawalRequest {
14
+ userId: string;
15
+ network: string;
16
+ asset: string;
17
+ amount: string;
18
+ toAddress: string;
19
+ idempotencyKey?: string | undefined;
20
+ }
21
+
22
+ export interface GetWithdrawalRequest {
23
+ userId: string;
24
+ withdrawRequestId: string;
25
+ }
26
+
27
+ export interface ListWithdrawalsRequest {
28
+ userId?: string | undefined;
29
+ status?: string | undefined;
30
+ network?: string | undefined;
31
+ from?: string | undefined;
32
+ to?: string | undefined;
33
+ take?: number | undefined;
34
+ }
35
+
36
+ export interface ListWithdrawalsResponse {
37
+ items: Withdrawal[];
38
+ }
39
+
40
+ export interface GetMonthlyWithdrawalLimitRequest {
41
+ userId: string;
42
+ }
43
+
44
+ export interface MonthlyWithdrawalLimit {
45
+ userId: string;
46
+ monthlyLimitUsdt: string;
47
+ minWithdrawalUsdt: string;
48
+ usedThisMonthUsdt: string;
49
+ remainingThisMonthUsdt: string;
50
+ monthStartUtc: string;
51
+ monthEndExclusiveUtc: string;
52
+ }
53
+
54
+ export interface AdminSetMonthlyWithdrawalLimitRequest {
55
+ adminApiKey: string;
56
+ userId: string;
57
+ monthlyLimitUsdt: string;
58
+ }
59
+
60
+ export interface AdminSetMonthlyWithdrawalLimitResponse {
61
+ userId: string;
62
+ monthlyLimitUsdt: string;
63
+ }
64
+
65
+ export interface AdminRejectWithdrawalRequest {
66
+ adminApiKey: string;
67
+ withdrawRequestId: string;
68
+ }
69
+
70
+ export interface Withdrawal {
71
+ withdrawRequestId: string;
72
+ userId: string;
73
+ network: string;
74
+ asset: string;
75
+ amount: string;
76
+ toAddress: string;
77
+ status: string;
78
+ serviceFee: string;
79
+ networkFee: string;
80
+ createdAt: string;
81
+ transactionId?: string | undefined;
82
+ referenceId?: string | undefined;
83
+ custodyTxId?: string | undefined;
84
+ txHash?: string | undefined;
85
+ amlScore?: number | undefined;
86
+ amlReason?: string | undefined;
87
+ amlDecision?: string | undefined;
88
+ errorCode?: string | undefined;
89
+ errorMessage?: string | undefined;
90
+ finalizedAt?: string | undefined;
91
+ refundedAt?: string | undefined;
92
+ }
93
+
94
+ export const WITHDRAWAL_V1_PACKAGE_NAME = "withdrawal.v1";
95
+
96
+ export interface WithdrawalServiceClient {
97
+ createWithdrawal(request: CreateWithdrawalRequest): Observable<Withdrawal>;
98
+
99
+ getWithdrawal(request: GetWithdrawalRequest): Observable<Withdrawal>;
100
+
101
+ listWithdrawals(request: ListWithdrawalsRequest): Observable<ListWithdrawalsResponse>;
102
+
103
+ getMonthlyWithdrawalLimit(request: GetMonthlyWithdrawalLimitRequest): Observable<MonthlyWithdrawalLimit>;
104
+
105
+ adminSetMonthlyWithdrawalLimit(
106
+ request: AdminSetMonthlyWithdrawalLimitRequest,
107
+ ): Observable<AdminSetMonthlyWithdrawalLimitResponse>;
108
+
109
+ adminRejectWithdrawal(request: AdminRejectWithdrawalRequest): Observable<Withdrawal>;
110
+ }
111
+
112
+ export interface WithdrawalServiceController {
113
+ createWithdrawal(request: CreateWithdrawalRequest): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
114
+
115
+ getWithdrawal(request: GetWithdrawalRequest): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
116
+
117
+ listWithdrawals(
118
+ request: ListWithdrawalsRequest,
119
+ ): Promise<ListWithdrawalsResponse> | Observable<ListWithdrawalsResponse> | ListWithdrawalsResponse;
120
+
121
+ getMonthlyWithdrawalLimit(
122
+ request: GetMonthlyWithdrawalLimitRequest,
123
+ ): Promise<MonthlyWithdrawalLimit> | Observable<MonthlyWithdrawalLimit> | MonthlyWithdrawalLimit;
124
+
125
+ adminSetMonthlyWithdrawalLimit(
126
+ request: AdminSetMonthlyWithdrawalLimitRequest,
127
+ ):
128
+ | Promise<AdminSetMonthlyWithdrawalLimitResponse>
129
+ | Observable<AdminSetMonthlyWithdrawalLimitResponse>
130
+ | AdminSetMonthlyWithdrawalLimitResponse;
131
+
132
+ adminRejectWithdrawal(
133
+ request: AdminRejectWithdrawalRequest,
134
+ ): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
135
+ }
136
+
137
+ export function WithdrawalServiceControllerMethods() {
138
+ return function (constructor: Function) {
139
+ const grpcMethods: string[] = [
140
+ "createWithdrawal",
141
+ "getWithdrawal",
142
+ "listWithdrawals",
143
+ "getMonthlyWithdrawalLimit",
144
+ "adminSetMonthlyWithdrawalLimit",
145
+ "adminRejectWithdrawal",
146
+ ];
147
+ for (const method of grpcMethods) {
148
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
149
+ GrpcMethod("WithdrawalService", method)(constructor.prototype[method], method, descriptor);
150
+ }
151
+ const grpcStreamMethods: string[] = [];
152
+ for (const method of grpcStreamMethods) {
153
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
154
+ GrpcStreamMethod("WithdrawalService", method)(constructor.prototype[method], method, descriptor);
155
+ }
156
+ };
157
+ }
158
+
159
+ export const WITHDRAWAL_SERVICE_NAME = "WithdrawalService";
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.38",
4
+ "version": "1.0.40",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -330,6 +330,10 @@ message InternalTransferRequest {
330
330
  string network = 4;
331
331
  string amount = 5; // Десятичная строка; списание с available отправителя.
332
332
  string idempotency_key = 6;
333
+ // Как задан получатель на стороне Gateway: user_id | uid | email | phone | telegram
334
+ string recipient_kind = 7;
335
+ // Введённое пользователем значение
336
+ string recipient_value = 8;
333
337
  }
334
338
 
335
339
  message InternalTransferResponse {
@@ -0,0 +1,98 @@
1
+ syntax = "proto3";
2
+
3
+ // Микросервис заявок на вывод (USDT TRON/BSC). Клиент: Wallet Gateway по gRPC.
4
+ package withdrawal.v1;
5
+
6
+ option csharp_namespace = "Withdrawal.V1";
7
+ option java_multiple_files = true;
8
+ option java_package = "com.arbiwallet.withdrawal.v1";
9
+
10
+ service WithdrawalService {
11
+ rpc CreateWithdrawal(CreateWithdrawalRequest) returns (Withdrawal);
12
+ rpc GetWithdrawal(GetWithdrawalRequest) returns (Withdrawal);
13
+ rpc ListWithdrawals(ListWithdrawalsRequest) returns (ListWithdrawalsResponse);
14
+ rpc GetMonthlyWithdrawalLimit(GetMonthlyWithdrawalLimitRequest) returns (MonthlyWithdrawalLimit);
15
+ rpc AdminSetMonthlyWithdrawalLimit(AdminSetMonthlyWithdrawalLimitRequest) returns (AdminSetMonthlyWithdrawalLimitResponse);
16
+ rpc AdminRejectWithdrawal(AdminRejectWithdrawalRequest) returns (Withdrawal);
17
+ }
18
+
19
+ message CreateWithdrawalRequest {
20
+ string user_id = 1;
21
+ string network = 2;
22
+ string asset = 3;
23
+ string amount = 4;
24
+ string to_address = 5;
25
+ optional string idempotency_key = 6;
26
+ }
27
+
28
+ message GetWithdrawalRequest {
29
+ string user_id = 1;
30
+ string withdraw_request_id = 2;
31
+ }
32
+
33
+ message ListWithdrawalsRequest {
34
+ optional string user_id = 1;
35
+ optional string status = 2;
36
+ optional string network = 3;
37
+ optional string from = 4;
38
+ optional string to = 5;
39
+ optional int32 take = 6;
40
+ }
41
+
42
+ message ListWithdrawalsResponse {
43
+ repeated Withdrawal items = 1;
44
+ }
45
+
46
+ message GetMonthlyWithdrawalLimitRequest {
47
+ string user_id = 1;
48
+ }
49
+
50
+ message MonthlyWithdrawalLimit {
51
+ string user_id = 1;
52
+ string monthly_limit_usdt = 2;
53
+ string min_withdrawal_usdt = 3;
54
+ string used_this_month_usdt = 4;
55
+ string remaining_this_month_usdt = 5;
56
+ string month_start_utc = 6;
57
+ string month_end_exclusive_utc = 7;
58
+ }
59
+
60
+ message AdminSetMonthlyWithdrawalLimitRequest {
61
+ string admin_api_key = 1;
62
+ string user_id = 2;
63
+ string monthly_limit_usdt = 3;
64
+ }
65
+
66
+ message AdminSetMonthlyWithdrawalLimitResponse {
67
+ string user_id = 1;
68
+ string monthly_limit_usdt = 2;
69
+ }
70
+
71
+ message AdminRejectWithdrawalRequest {
72
+ string admin_api_key = 1;
73
+ string withdraw_request_id = 2;
74
+ }
75
+
76
+ message Withdrawal {
77
+ string withdraw_request_id = 1;
78
+ string user_id = 2;
79
+ string network = 3;
80
+ string asset = 4;
81
+ string amount = 5;
82
+ string to_address = 6;
83
+ string status = 7;
84
+ string service_fee = 8;
85
+ string network_fee = 9;
86
+ string created_at = 10;
87
+ optional string transaction_id = 11;
88
+ optional string reference_id = 12;
89
+ optional string custody_tx_id = 13;
90
+ optional string tx_hash = 14;
91
+ optional int32 aml_score = 15;
92
+ optional string aml_reason = 16;
93
+ optional string aml_decision = 17;
94
+ optional string error_code = 18;
95
+ optional string error_message = 19;
96
+ optional string finalized_at = 20;
97
+ optional string refunded_at = 21;
98
+ }