@arbiwallet/contracts 1.0.46 → 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/ledger.ts +8 -2
- package/gen/withdrawal.ts +53 -1
- package/package.json +1 -1
- package/proto/ledger.proto +5 -1
- package/proto/withdrawal.proto +34 -0
package/gen/ledger.ts
CHANGED
|
@@ -163,7 +163,7 @@ export interface RegisterWithdrawalResponse {
|
|
|
163
163
|
withdrawalId: string;
|
|
164
164
|
/** Текущий статус (enum строкой, см. реализацию). */
|
|
165
165
|
status: string;
|
|
166
|
-
/**
|
|
166
|
+
/** Устар.; первая строка ленты — после ReserveFunds (WITHDRAWAL_RESERVED). */
|
|
167
167
|
transactionFeedItemId?: string | undefined;
|
|
168
168
|
}
|
|
169
169
|
|
|
@@ -182,6 +182,8 @@ export interface ReserveFundsResponse {
|
|
|
182
182
|
available: string;
|
|
183
183
|
reserved: string;
|
|
184
184
|
total: string;
|
|
185
|
+
/** id строки ленты (WITHDRAWAL_RESERVED), после RegisterWithdrawal без WITHDRAWAL_CREATED. */
|
|
186
|
+
transactionFeedItemId?: string | undefined;
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
export interface ReleaseFundsRequest {
|
|
@@ -327,7 +329,11 @@ export interface GetTransactionFeedRequest {
|
|
|
327
329
|
* Фильтр по «типу» операции для UI: "withdrawal" | "deposit" | "internal_transfer".
|
|
328
330
|
* deposit включает записи reference_type deposit и deposit_hold.
|
|
329
331
|
*/
|
|
330
|
-
referenceKind?:
|
|
332
|
+
referenceKind?:
|
|
333
|
+
| string
|
|
334
|
+
| undefined;
|
|
335
|
+
/** true: все события по выводу (RESERVED, WITHDRAWAL_STATUS, FINALIZED, …). По умолчанию — одна строка на вывод (последнее событие). */
|
|
336
|
+
expandWithdrawalTimeline?: boolean | undefined;
|
|
331
337
|
}
|
|
332
338
|
|
|
333
339
|
export interface GetTransactionFeedResponse {
|
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?:
|
|
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.
|
|
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
|
},
|
package/proto/ledger.proto
CHANGED
|
@@ -150,7 +150,7 @@ message RegisterWithdrawalRequest {
|
|
|
150
150
|
message RegisterWithdrawalResponse {
|
|
151
151
|
string withdrawal_id = 1; // Внутренний id вывода в ledger.
|
|
152
152
|
string status = 2; // Текущий статус (enum строкой, см. реализацию).
|
|
153
|
-
optional string transaction_feed_item_id = 3; //
|
|
153
|
+
optional string transaction_feed_item_id = 3; // Устар.; первая строка ленты — после ReserveFunds (WITHDRAWAL_RESERVED).
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
message ReserveFundsRequest {
|
|
@@ -167,6 +167,8 @@ message ReserveFundsResponse {
|
|
|
167
167
|
string available = 2;
|
|
168
168
|
string reserved = 3;
|
|
169
169
|
string total = 4;
|
|
170
|
+
// id строки ленты (WITHDRAWAL_RESERVED), после RegisterWithdrawal без WITHDRAWAL_CREATED.
|
|
171
|
+
optional string transaction_feed_item_id = 5;
|
|
170
172
|
}
|
|
171
173
|
|
|
172
174
|
message ReleaseFundsRequest {
|
|
@@ -284,6 +286,8 @@ message GetTransactionFeedRequest {
|
|
|
284
286
|
// Фильтр по «типу» операции для UI: "withdrawal" | "deposit" | "internal_transfer".
|
|
285
287
|
// deposit включает записи reference_type deposit и deposit_hold.
|
|
286
288
|
optional string reference_kind = 7;
|
|
289
|
+
// true: все события по выводу (RESERVED, WITHDRAWAL_STATUS, FINALIZED, …). По умолчанию — одна строка на вывод (последнее событие).
|
|
290
|
+
optional bool expand_withdrawal_timeline = 8;
|
|
287
291
|
}
|
|
288
292
|
|
|
289
293
|
message GetTransactionFeedResponse {
|
package/proto/withdrawal.proto
CHANGED
|
@@ -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
|
}
|