@arbiwallet/contracts 1.0.47 → 1.0.49
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 +71 -1
- package/package.json +1 -1
- package/proto/withdrawal.proto +42 -0
package/gen/withdrawal.ts
CHANGED
|
@@ -43,6 +43,19 @@ 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;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface GetPayoutPricingRequest {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface GetPayoutPricingResponse {
|
|
58
|
+
rows: PayoutConfigRow[];
|
|
46
59
|
}
|
|
47
60
|
|
|
48
61
|
export interface WithdrawalLimits {
|
|
@@ -60,6 +73,34 @@ export interface WithdrawalLimits {
|
|
|
60
73
|
dayEndExclusiveUtc: string;
|
|
61
74
|
monthStartUtc: string;
|
|
62
75
|
monthEndExclusiveUtc: string;
|
|
76
|
+
payoutConfigRows: PayoutConfigRow[];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface PayoutConfigRow {
|
|
80
|
+
asset: string;
|
|
81
|
+
network: string;
|
|
82
|
+
minOnChain: string;
|
|
83
|
+
serviceFee: string;
|
|
84
|
+
networkFee: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface AdminUpsertPayoutConfigRequest {
|
|
88
|
+
adminApiKey: string;
|
|
89
|
+
asset: string;
|
|
90
|
+
network: string;
|
|
91
|
+
minOnChain: string;
|
|
92
|
+
serviceFee: string;
|
|
93
|
+
networkFee: string;
|
|
94
|
+
/** true по умолчанию */
|
|
95
|
+
isActive: boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface ListPayoutConfigsRequest {
|
|
99
|
+
adminApiKey: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ListPayoutConfigsResponse {
|
|
103
|
+
rows: PayoutConfigRow[];
|
|
63
104
|
}
|
|
64
105
|
|
|
65
106
|
export interface MonthlyWithdrawalLimit {
|
|
@@ -130,7 +171,11 @@ export interface Withdrawal {
|
|
|
130
171
|
errorCode?: string | undefined;
|
|
131
172
|
errorMessage?: string | undefined;
|
|
132
173
|
finalizedAt?: string | undefined;
|
|
133
|
-
refundedAt?:
|
|
174
|
+
refundedAt?:
|
|
175
|
+
| string
|
|
176
|
+
| undefined;
|
|
177
|
+
/** Счётчик списания: on-chain (amount) + service_fee + network_fee. */
|
|
178
|
+
grossDebit?: string | undefined;
|
|
134
179
|
}
|
|
135
180
|
|
|
136
181
|
export const WITHDRAWAL_V1_PACKAGE_NAME = "withdrawal.v1";
|
|
@@ -146,6 +191,10 @@ export interface WithdrawalServiceClient {
|
|
|
146
191
|
|
|
147
192
|
getWithdrawalLimits(request: GetWithdrawalLimitsRequest): Observable<WithdrawalLimits>;
|
|
148
193
|
|
|
194
|
+
/** Один ответ для фронта: мин. on-chain сумма + комиссии по каждой паре asset/network (без user-лимитов). */
|
|
195
|
+
|
|
196
|
+
getPayoutPricing(request: GetPayoutPricingRequest): Observable<GetPayoutPricingResponse>;
|
|
197
|
+
|
|
149
198
|
adminSetMonthlyWithdrawalLimit(
|
|
150
199
|
request: AdminSetMonthlyWithdrawalLimitRequest,
|
|
151
200
|
): Observable<AdminSetMonthlyWithdrawalLimitResponse>;
|
|
@@ -155,6 +204,10 @@ export interface WithdrawalServiceClient {
|
|
|
155
204
|
): Observable<AdminSetUserWithdrawalLimitsResponse>;
|
|
156
205
|
|
|
157
206
|
adminRejectWithdrawal(request: AdminRejectWithdrawalRequest): Observable<Withdrawal>;
|
|
207
|
+
|
|
208
|
+
adminUpsertPayoutConfig(request: AdminUpsertPayoutConfigRequest): Observable<PayoutConfigRow>;
|
|
209
|
+
|
|
210
|
+
listPayoutConfigs(request: ListPayoutConfigsRequest): Observable<ListPayoutConfigsResponse>;
|
|
158
211
|
}
|
|
159
212
|
|
|
160
213
|
export interface WithdrawalServiceController {
|
|
@@ -174,6 +227,12 @@ export interface WithdrawalServiceController {
|
|
|
174
227
|
request: GetWithdrawalLimitsRequest,
|
|
175
228
|
): Promise<WithdrawalLimits> | Observable<WithdrawalLimits> | WithdrawalLimits;
|
|
176
229
|
|
|
230
|
+
/** Один ответ для фронта: мин. on-chain сумма + комиссии по каждой паре asset/network (без user-лимитов). */
|
|
231
|
+
|
|
232
|
+
getPayoutPricing(
|
|
233
|
+
request: GetPayoutPricingRequest,
|
|
234
|
+
): Promise<GetPayoutPricingResponse> | Observable<GetPayoutPricingResponse> | GetPayoutPricingResponse;
|
|
235
|
+
|
|
177
236
|
adminSetMonthlyWithdrawalLimit(
|
|
178
237
|
request: AdminSetMonthlyWithdrawalLimitRequest,
|
|
179
238
|
):
|
|
@@ -191,6 +250,14 @@ export interface WithdrawalServiceController {
|
|
|
191
250
|
adminRejectWithdrawal(
|
|
192
251
|
request: AdminRejectWithdrawalRequest,
|
|
193
252
|
): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
|
|
253
|
+
|
|
254
|
+
adminUpsertPayoutConfig(
|
|
255
|
+
request: AdminUpsertPayoutConfigRequest,
|
|
256
|
+
): Promise<PayoutConfigRow> | Observable<PayoutConfigRow> | PayoutConfigRow;
|
|
257
|
+
|
|
258
|
+
listPayoutConfigs(
|
|
259
|
+
request: ListPayoutConfigsRequest,
|
|
260
|
+
): Promise<ListPayoutConfigsResponse> | Observable<ListPayoutConfigsResponse> | ListPayoutConfigsResponse;
|
|
194
261
|
}
|
|
195
262
|
|
|
196
263
|
export function WithdrawalServiceControllerMethods() {
|
|
@@ -201,9 +268,12 @@ export function WithdrawalServiceControllerMethods() {
|
|
|
201
268
|
"listWithdrawals",
|
|
202
269
|
"getMonthlyWithdrawalLimit",
|
|
203
270
|
"getWithdrawalLimits",
|
|
271
|
+
"getPayoutPricing",
|
|
204
272
|
"adminSetMonthlyWithdrawalLimit",
|
|
205
273
|
"adminSetUserWithdrawalLimits",
|
|
206
274
|
"adminRejectWithdrawal",
|
|
275
|
+
"adminUpsertPayoutConfig",
|
|
276
|
+
"listPayoutConfigs",
|
|
207
277
|
];
|
|
208
278
|
for (const method of grpcMethods) {
|
|
209
279
|
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.
|
|
4
|
+
"version": "1.0.49",
|
|
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/withdrawal.proto
CHANGED
|
@@ -13,9 +13,13 @@ service WithdrawalService {
|
|
|
13
13
|
rpc ListWithdrawals(ListWithdrawalsRequest) returns (ListWithdrawalsResponse);
|
|
14
14
|
rpc GetMonthlyWithdrawalLimit(GetMonthlyWithdrawalLimitRequest) returns (MonthlyWithdrawalLimit);
|
|
15
15
|
rpc GetWithdrawalLimits(GetWithdrawalLimitsRequest) returns (WithdrawalLimits);
|
|
16
|
+
// Один ответ для фронта: мин. on-chain сумма + комиссии по каждой паре asset/network (без user-лимитов).
|
|
17
|
+
rpc GetPayoutPricing(GetPayoutPricingRequest) returns (GetPayoutPricingResponse);
|
|
16
18
|
rpc AdminSetMonthlyWithdrawalLimit(AdminSetMonthlyWithdrawalLimitRequest) returns (AdminSetMonthlyWithdrawalLimitResponse);
|
|
17
19
|
rpc AdminSetUserWithdrawalLimits(AdminSetUserWithdrawalLimitsRequest) returns (AdminSetUserWithdrawalLimitsResponse);
|
|
18
20
|
rpc AdminRejectWithdrawal(AdminRejectWithdrawalRequest) returns (Withdrawal);
|
|
21
|
+
rpc AdminUpsertPayoutConfig(AdminUpsertPayoutConfigRequest) returns (PayoutConfigRow);
|
|
22
|
+
rpc ListPayoutConfigs(ListPayoutConfigsRequest) returns (ListPayoutConfigsResponse);
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
message CreateWithdrawalRequest {
|
|
@@ -51,6 +55,15 @@ message GetMonthlyWithdrawalLimitRequest {
|
|
|
51
55
|
|
|
52
56
|
message GetWithdrawalLimitsRequest {
|
|
53
57
|
string user_id = 1;
|
|
58
|
+
// Для `min_withdrawal_amount` по выбранной паре; по умолчанию USDT + TRON.
|
|
59
|
+
optional string asset = 2;
|
|
60
|
+
optional string network = 3; // "TRON" | "BSC" — enum ChainNetwork
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message GetPayoutPricingRequest {}
|
|
64
|
+
|
|
65
|
+
message GetPayoutPricingResponse {
|
|
66
|
+
repeated PayoutConfigRow rows = 1;
|
|
54
67
|
}
|
|
55
68
|
|
|
56
69
|
message WithdrawalLimits {
|
|
@@ -68,6 +81,33 @@ message WithdrawalLimits {
|
|
|
68
81
|
string day_end_exclusive_utc = 12;
|
|
69
82
|
string month_start_utc = 13;
|
|
70
83
|
string month_end_exclusive_utc = 14;
|
|
84
|
+
repeated PayoutConfigRow payout_config_rows = 15;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message PayoutConfigRow {
|
|
88
|
+
string asset = 1;
|
|
89
|
+
string network = 2;
|
|
90
|
+
string min_on_chain = 3;
|
|
91
|
+
string service_fee = 4;
|
|
92
|
+
string network_fee = 5;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
message AdminUpsertPayoutConfigRequest {
|
|
96
|
+
string admin_api_key = 1;
|
|
97
|
+
string asset = 2;
|
|
98
|
+
string network = 3;
|
|
99
|
+
string min_on_chain = 4;
|
|
100
|
+
string service_fee = 5;
|
|
101
|
+
string network_fee = 6;
|
|
102
|
+
bool is_active = 7; // true по умолчанию
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message ListPayoutConfigsRequest {
|
|
106
|
+
string admin_api_key = 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message ListPayoutConfigsResponse {
|
|
110
|
+
repeated PayoutConfigRow rows = 1;
|
|
71
111
|
}
|
|
72
112
|
|
|
73
113
|
message MonthlyWithdrawalLimit {
|
|
@@ -139,4 +179,6 @@ message Withdrawal {
|
|
|
139
179
|
optional string error_message = 19;
|
|
140
180
|
optional string finalized_at = 20;
|
|
141
181
|
optional string refunded_at = 21;
|
|
182
|
+
// Счётчик списания: on-chain (amount) + service_fee + network_fee.
|
|
183
|
+
optional string gross_debit = 22;
|
|
142
184
|
}
|