@arbiwallet/contracts 1.0.47 → 1.0.48

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/withdrawal.ts CHANGED
@@ -43,6 +43,12 @@ export interface GetMonthlyWithdrawalLimitRequest {
43
43
 
44
44
  export interface GetWithdrawalLimitsRequest {
45
45
  userId: string;
46
+ /** Для `min_withdrawal_amount` по выбранной паре; по умолчанию USDT + TRON. */
47
+ asset?:
48
+ | string
49
+ | undefined;
50
+ /** "TRON" | "BSC" — enum ChainNetwork */
51
+ network?: string | undefined;
46
52
  }
47
53
 
48
54
  export interface WithdrawalLimits {
@@ -60,6 +66,34 @@ export interface WithdrawalLimits {
60
66
  dayEndExclusiveUtc: string;
61
67
  monthStartUtc: string;
62
68
  monthEndExclusiveUtc: string;
69
+ payoutConfigRows: PayoutConfigRow[];
70
+ }
71
+
72
+ export interface PayoutConfigRow {
73
+ asset: string;
74
+ network: string;
75
+ minOnChain: string;
76
+ serviceFee: string;
77
+ networkFee: string;
78
+ }
79
+
80
+ export interface AdminUpsertPayoutConfigRequest {
81
+ adminApiKey: string;
82
+ asset: string;
83
+ network: string;
84
+ minOnChain: string;
85
+ serviceFee: string;
86
+ networkFee: string;
87
+ /** true по умолчанию */
88
+ isActive: boolean;
89
+ }
90
+
91
+ export interface ListPayoutConfigsRequest {
92
+ adminApiKey: string;
93
+ }
94
+
95
+ export interface ListPayoutConfigsResponse {
96
+ rows: PayoutConfigRow[];
63
97
  }
64
98
 
65
99
  export interface MonthlyWithdrawalLimit {
@@ -130,7 +164,11 @@ export interface Withdrawal {
130
164
  errorCode?: string | undefined;
131
165
  errorMessage?: string | undefined;
132
166
  finalizedAt?: string | undefined;
133
- refundedAt?: string | undefined;
167
+ refundedAt?:
168
+ | string
169
+ | undefined;
170
+ /** Счётчик списания: on-chain (amount) + service_fee + network_fee. */
171
+ grossDebit?: string | undefined;
134
172
  }
135
173
 
136
174
  export const WITHDRAWAL_V1_PACKAGE_NAME = "withdrawal.v1";
@@ -155,6 +193,10 @@ export interface WithdrawalServiceClient {
155
193
  ): Observable<AdminSetUserWithdrawalLimitsResponse>;
156
194
 
157
195
  adminRejectWithdrawal(request: AdminRejectWithdrawalRequest): Observable<Withdrawal>;
196
+
197
+ adminUpsertPayoutConfig(request: AdminUpsertPayoutConfigRequest): Observable<PayoutConfigRow>;
198
+
199
+ listPayoutConfigs(request: ListPayoutConfigsRequest): Observable<ListPayoutConfigsResponse>;
158
200
  }
159
201
 
160
202
  export interface WithdrawalServiceController {
@@ -191,6 +233,14 @@ export interface WithdrawalServiceController {
191
233
  adminRejectWithdrawal(
192
234
  request: AdminRejectWithdrawalRequest,
193
235
  ): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
236
+
237
+ adminUpsertPayoutConfig(
238
+ request: AdminUpsertPayoutConfigRequest,
239
+ ): Promise<PayoutConfigRow> | Observable<PayoutConfigRow> | PayoutConfigRow;
240
+
241
+ listPayoutConfigs(
242
+ request: ListPayoutConfigsRequest,
243
+ ): Promise<ListPayoutConfigsResponse> | Observable<ListPayoutConfigsResponse> | ListPayoutConfigsResponse;
194
244
  }
195
245
 
196
246
  export function WithdrawalServiceControllerMethods() {
@@ -204,6 +254,8 @@ export function WithdrawalServiceControllerMethods() {
204
254
  "adminSetMonthlyWithdrawalLimit",
205
255
  "adminSetUserWithdrawalLimits",
206
256
  "adminRejectWithdrawal",
257
+ "adminUpsertPayoutConfig",
258
+ "listPayoutConfigs",
207
259
  ];
208
260
  for (const method of grpcMethods) {
209
261
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
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.47",
4
+ "version": "1.0.48",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -16,6 +16,8 @@ service WithdrawalService {
16
16
  rpc AdminSetMonthlyWithdrawalLimit(AdminSetMonthlyWithdrawalLimitRequest) returns (AdminSetMonthlyWithdrawalLimitResponse);
17
17
  rpc AdminSetUserWithdrawalLimits(AdminSetUserWithdrawalLimitsRequest) returns (AdminSetUserWithdrawalLimitsResponse);
18
18
  rpc AdminRejectWithdrawal(AdminRejectWithdrawalRequest) returns (Withdrawal);
19
+ rpc AdminUpsertPayoutConfig(AdminUpsertPayoutConfigRequest) returns (PayoutConfigRow);
20
+ rpc ListPayoutConfigs(ListPayoutConfigsRequest) returns (ListPayoutConfigsResponse);
19
21
  }
20
22
 
21
23
  message CreateWithdrawalRequest {
@@ -51,6 +53,9 @@ message GetMonthlyWithdrawalLimitRequest {
51
53
 
52
54
  message GetWithdrawalLimitsRequest {
53
55
  string user_id = 1;
56
+ // Для `min_withdrawal_amount` по выбранной паре; по умолчанию USDT + TRON.
57
+ optional string asset = 2;
58
+ optional string network = 3; // "TRON" | "BSC" — enum ChainNetwork
54
59
  }
55
60
 
56
61
  message WithdrawalLimits {
@@ -68,6 +73,33 @@ message WithdrawalLimits {
68
73
  string day_end_exclusive_utc = 12;
69
74
  string month_start_utc = 13;
70
75
  string month_end_exclusive_utc = 14;
76
+ repeated PayoutConfigRow payout_config_rows = 15;
77
+ }
78
+
79
+ message PayoutConfigRow {
80
+ string asset = 1;
81
+ string network = 2;
82
+ string min_on_chain = 3;
83
+ string service_fee = 4;
84
+ string network_fee = 5;
85
+ }
86
+
87
+ message AdminUpsertPayoutConfigRequest {
88
+ string admin_api_key = 1;
89
+ string asset = 2;
90
+ string network = 3;
91
+ string min_on_chain = 4;
92
+ string service_fee = 5;
93
+ string network_fee = 6;
94
+ bool is_active = 7; // true по умолчанию
95
+ }
96
+
97
+ message ListPayoutConfigsRequest {
98
+ string admin_api_key = 1;
99
+ }
100
+
101
+ message ListPayoutConfigsResponse {
102
+ repeated PayoutConfigRow rows = 1;
71
103
  }
72
104
 
73
105
  message MonthlyWithdrawalLimit {
@@ -139,4 +171,6 @@ message Withdrawal {
139
171
  optional string error_message = 19;
140
172
  optional string finalized_at = 20;
141
173
  optional string refunded_at = 21;
174
+ // Счётчик списания: on-chain (amount) + service_fee + network_fee.
175
+ optional string gross_debit = 22;
142
176
  }