@arbiwallet/contracts 1.0.284 → 1.0.286
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/referral.ts +90 -5
- package/gen/user.ts +24 -5
- package/package.json +1 -1
- package/proto/referral.proto +51 -2
- package/proto/user.proto +9 -2
package/gen/referral.ts
CHANGED
|
@@ -110,8 +110,14 @@ export interface AdminReferralProfileByUserIdResponse {
|
|
|
110
110
|
profileId: string;
|
|
111
111
|
userId: number;
|
|
112
112
|
refCode: string;
|
|
113
|
-
referrerUserId?:
|
|
114
|
-
|
|
113
|
+
referrerUserId?:
|
|
114
|
+
| number
|
|
115
|
+
| undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Строковый тип для admin-flow, чтобы избежать тихого enum-default в gRPC loader.
|
|
118
|
+
* Нормализуется сервисом в ReferralBonusType (PROFIT/VOLUME).
|
|
119
|
+
*/
|
|
120
|
+
bonusType: string;
|
|
115
121
|
refPercent: string;
|
|
116
122
|
status: ReferralProfileStatus;
|
|
117
123
|
createdAt: string;
|
|
@@ -126,11 +132,24 @@ export interface AdminUpdateReferralProfileByUserIdRequest {
|
|
|
126
132
|
* Разрешено только если у профиля еще нет реферера.
|
|
127
133
|
* Если текущий реферер уже задан, сервис возвращает ошибку REFERRER_ALREADY_SET.
|
|
128
134
|
*/
|
|
129
|
-
referrerUserId?:
|
|
130
|
-
|
|
135
|
+
referrerUserId?:
|
|
136
|
+
| number
|
|
137
|
+
| undefined;
|
|
138
|
+
/**
|
|
139
|
+
* Строковый тип для admin-flow, чтобы избежать тихого enum-default в gRPC loader.
|
|
140
|
+
* Допустимые значения: PROFIT | VOLUME | REFERRAL_BONUS_TYPE_PROFIT | REFERRAL_BONUS_TYPE_VOLUME.
|
|
141
|
+
*/
|
|
142
|
+
bonusType?: string | undefined;
|
|
131
143
|
refPercent?: string | undefined;
|
|
132
144
|
refCode?: string | undefined;
|
|
133
|
-
changedBy?:
|
|
145
|
+
changedBy?:
|
|
146
|
+
| string
|
|
147
|
+
| undefined;
|
|
148
|
+
/**
|
|
149
|
+
* true — в этом запросе нужно выполнить изменение referrer_user_id;
|
|
150
|
+
* false/отсутствует — referrer_user_id игнорируется.
|
|
151
|
+
*/
|
|
152
|
+
referrerChanged?: boolean | undefined;
|
|
134
153
|
}
|
|
135
154
|
|
|
136
155
|
export interface GetUserReferralMetricsRequest {
|
|
@@ -271,6 +290,28 @@ export interface ConfirmPayoutRequest {
|
|
|
271
290
|
confirmedByManagerId?: string | undefined;
|
|
272
291
|
}
|
|
273
292
|
|
|
293
|
+
export interface UpdatePayoutRequest {
|
|
294
|
+
payoutId: number;
|
|
295
|
+
amount?: string | undefined;
|
|
296
|
+
currency?: string | undefined;
|
|
297
|
+
paymentMethod?: string | undefined;
|
|
298
|
+
outputCurrency?: string | undefined;
|
|
299
|
+
comment?: string | undefined;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface CancelPayoutRequest {
|
|
303
|
+
payoutId: number;
|
|
304
|
+
reason?: string | undefined;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export interface DeletePayoutRequest {
|
|
308
|
+
payoutId: number;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface DeletePayoutResponse {
|
|
312
|
+
deleted: boolean;
|
|
313
|
+
}
|
|
314
|
+
|
|
274
315
|
export interface ReferralPayoutResponse {
|
|
275
316
|
id: number;
|
|
276
317
|
profileId: number;
|
|
@@ -298,6 +339,22 @@ export interface ListPayoutsResponse {
|
|
|
298
339
|
limit: number;
|
|
299
340
|
}
|
|
300
341
|
|
|
342
|
+
export interface RecreateBonusesRequest {
|
|
343
|
+
walletUserId: string;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface RecreateBonusesBalanceItem {
|
|
347
|
+
currency: string;
|
|
348
|
+
amount: string;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface RecreateBonusesResponse {
|
|
352
|
+
success: boolean;
|
|
353
|
+
commissionsCount: number;
|
|
354
|
+
payoutsCount: number;
|
|
355
|
+
balances: RecreateBonusesBalanceItem[];
|
|
356
|
+
}
|
|
357
|
+
|
|
301
358
|
export interface AdminRecalculateExchangeRequest {
|
|
302
359
|
exchangeId: string;
|
|
303
360
|
dryRun: boolean;
|
|
@@ -360,6 +417,14 @@ export interface ReferralServiceClient {
|
|
|
360
417
|
|
|
361
418
|
confirmPayout(request: ConfirmPayoutRequest): Observable<ReferralPayoutResponse>;
|
|
362
419
|
|
|
420
|
+
updatePayout(request: UpdatePayoutRequest): Observable<ReferralPayoutResponse>;
|
|
421
|
+
|
|
422
|
+
cancelPayout(request: CancelPayoutRequest): Observable<ReferralPayoutResponse>;
|
|
423
|
+
|
|
424
|
+
deletePayout(request: DeletePayoutRequest): Observable<DeletePayoutResponse>;
|
|
425
|
+
|
|
426
|
+
recreateBonuses(request: RecreateBonusesRequest): Observable<RecreateBonusesResponse>;
|
|
427
|
+
|
|
363
428
|
listPayouts(request: ListPayoutsRequest): Observable<ListPayoutsResponse>;
|
|
364
429
|
|
|
365
430
|
adminRecalculateExchange(request: AdminRecalculateExchangeRequest): Observable<AdminRecalculateExchangeResponse>;
|
|
@@ -460,6 +525,22 @@ export interface ReferralServiceController {
|
|
|
460
525
|
request: ConfirmPayoutRequest,
|
|
461
526
|
): Promise<ReferralPayoutResponse> | Observable<ReferralPayoutResponse> | ReferralPayoutResponse;
|
|
462
527
|
|
|
528
|
+
updatePayout(
|
|
529
|
+
request: UpdatePayoutRequest,
|
|
530
|
+
): Promise<ReferralPayoutResponse> | Observable<ReferralPayoutResponse> | ReferralPayoutResponse;
|
|
531
|
+
|
|
532
|
+
cancelPayout(
|
|
533
|
+
request: CancelPayoutRequest,
|
|
534
|
+
): Promise<ReferralPayoutResponse> | Observable<ReferralPayoutResponse> | ReferralPayoutResponse;
|
|
535
|
+
|
|
536
|
+
deletePayout(
|
|
537
|
+
request: DeletePayoutRequest,
|
|
538
|
+
): Promise<DeletePayoutResponse> | Observable<DeletePayoutResponse> | DeletePayoutResponse;
|
|
539
|
+
|
|
540
|
+
recreateBonuses(
|
|
541
|
+
request: RecreateBonusesRequest,
|
|
542
|
+
): Promise<RecreateBonusesResponse> | Observable<RecreateBonusesResponse> | RecreateBonusesResponse;
|
|
543
|
+
|
|
463
544
|
listPayouts(
|
|
464
545
|
request: ListPayoutsRequest,
|
|
465
546
|
): Promise<ListPayoutsResponse> | Observable<ListPayoutsResponse> | ListPayoutsResponse;
|
|
@@ -491,6 +572,10 @@ export function ReferralServiceControllerMethods() {
|
|
|
491
572
|
"listCommissions",
|
|
492
573
|
"createPayout",
|
|
493
574
|
"confirmPayout",
|
|
575
|
+
"updatePayout",
|
|
576
|
+
"cancelPayout",
|
|
577
|
+
"deletePayout",
|
|
578
|
+
"recreateBonuses",
|
|
494
579
|
"listPayouts",
|
|
495
580
|
"adminRecalculateExchange",
|
|
496
581
|
];
|
package/gen/user.ts
CHANGED
|
@@ -120,8 +120,14 @@ export interface AdminUserForUpdateResponse {
|
|
|
120
120
|
whatsapp?: string | undefined;
|
|
121
121
|
advChannel?: string | undefined;
|
|
122
122
|
refCode?: string | undefined;
|
|
123
|
-
referrerUserId?:
|
|
124
|
-
|
|
123
|
+
referrerUserId?:
|
|
124
|
+
| number
|
|
125
|
+
| undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Строковый тип для admin-flow, чтобы избежать тихого enum-default при межсервисном проксировании.
|
|
128
|
+
* Допустимые значения: PROFIT | VOLUME | REFERRAL_BONUS_TYPE_PROFIT | REFERRAL_BONUS_TYPE_VOLUME.
|
|
129
|
+
*/
|
|
130
|
+
bonusType?: string | undefined;
|
|
125
131
|
refPercent?:
|
|
126
132
|
| number
|
|
127
133
|
| undefined;
|
|
@@ -153,8 +159,14 @@ export interface AdminUpdateUserProfileRequest {
|
|
|
153
159
|
* Разрешено только если у пользователя еще нет реферера.
|
|
154
160
|
* Если текущий реферер уже задан, сервис возвращает ошибку REFERRER_ALREADY_SET.
|
|
155
161
|
*/
|
|
156
|
-
referrerUserId?:
|
|
157
|
-
|
|
162
|
+
referrerUserId?:
|
|
163
|
+
| number
|
|
164
|
+
| undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Строковый тип для admin-flow, чтобы избежать тихого enum-default при межсервисном проксировании.
|
|
167
|
+
* Допустимые значения: PROFIT | VOLUME | REFERRAL_BONUS_TYPE_PROFIT | REFERRAL_BONUS_TYPE_VOLUME.
|
|
168
|
+
*/
|
|
169
|
+
bonusType?: string | undefined;
|
|
158
170
|
refPercent?: number | undefined;
|
|
159
171
|
isPartner?: boolean | undefined;
|
|
160
172
|
attention?: string | undefined;
|
|
@@ -162,7 +174,14 @@ export interface AdminUpdateUserProfileRequest {
|
|
|
162
174
|
comment?: string | undefined;
|
|
163
175
|
instagram?: string | undefined;
|
|
164
176
|
facebook?: string | undefined;
|
|
165
|
-
facebookUrl?:
|
|
177
|
+
facebookUrl?:
|
|
178
|
+
| string
|
|
179
|
+
| undefined;
|
|
180
|
+
/**
|
|
181
|
+
* true — в этом запросе нужно выполнить изменение referrer_user_id;
|
|
182
|
+
* false/отсутствует — referrer_user_id игнорируется и не должен вызывать REFERRER_ALREADY_SET.
|
|
183
|
+
*/
|
|
184
|
+
referrerChanged?: boolean | undefined;
|
|
166
185
|
}
|
|
167
186
|
|
|
168
187
|
export interface UpdateUserRequest {
|
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.286",
|
|
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/referral.proto
CHANGED
|
@@ -23,6 +23,10 @@ service ReferralService {
|
|
|
23
23
|
rpc ListCommissions(ListCommissionsRequest) returns (ListCommissionsResponse);
|
|
24
24
|
rpc CreatePayout(CreatePayoutRequest) returns (ReferralPayoutResponse);
|
|
25
25
|
rpc ConfirmPayout(ConfirmPayoutRequest) returns (ReferralPayoutResponse);
|
|
26
|
+
rpc UpdatePayout(UpdatePayoutRequest) returns (ReferralPayoutResponse);
|
|
27
|
+
rpc CancelPayout(CancelPayoutRequest) returns (ReferralPayoutResponse);
|
|
28
|
+
rpc DeletePayout(DeletePayoutRequest) returns (DeletePayoutResponse);
|
|
29
|
+
rpc RecreateBonuses(RecreateBonusesRequest) returns (RecreateBonusesResponse);
|
|
26
30
|
rpc ListPayouts(ListPayoutsRequest) returns (ListPayoutsResponse);
|
|
27
31
|
rpc AdminRecalculateExchange(AdminRecalculateExchangeRequest) returns (AdminRecalculateExchangeResponse);
|
|
28
32
|
}
|
|
@@ -124,7 +128,9 @@ message AdminReferralProfileByUserIdResponse {
|
|
|
124
128
|
int32 user_id = 2;
|
|
125
129
|
string ref_code = 3;
|
|
126
130
|
optional int32 referrer_user_id = 4;
|
|
127
|
-
|
|
131
|
+
// Строковый тип для admin-flow, чтобы избежать тихого enum-default в gRPC loader.
|
|
132
|
+
// Нормализуется сервисом в ReferralBonusType (PROFIT/VOLUME).
|
|
133
|
+
string bonus_type = 5;
|
|
128
134
|
string ref_percent = 6;
|
|
129
135
|
ReferralProfileStatus status = 7;
|
|
130
136
|
string created_at = 8;
|
|
@@ -138,10 +144,15 @@ message AdminUpdateReferralProfileByUserIdRequest {
|
|
|
138
144
|
// Разрешено только если у профиля еще нет реферера.
|
|
139
145
|
// Если текущий реферер уже задан, сервис возвращает ошибку REFERRER_ALREADY_SET.
|
|
140
146
|
optional int32 referrer_user_id = 2;
|
|
141
|
-
|
|
147
|
+
// Строковый тип для admin-flow, чтобы избежать тихого enum-default в gRPC loader.
|
|
148
|
+
// Допустимые значения: PROFIT | VOLUME | REFERRAL_BONUS_TYPE_PROFIT | REFERRAL_BONUS_TYPE_VOLUME.
|
|
149
|
+
optional string bonus_type = 3;
|
|
142
150
|
optional string ref_percent = 4;
|
|
143
151
|
optional string ref_code = 5;
|
|
144
152
|
optional string changed_by = 6;
|
|
153
|
+
// true — в этом запросе нужно выполнить изменение referrer_user_id;
|
|
154
|
+
// false/отсутствует — referrer_user_id игнорируется.
|
|
155
|
+
optional bool referrer_changed = 7;
|
|
145
156
|
}
|
|
146
157
|
|
|
147
158
|
message GetUserReferralMetricsRequest {
|
|
@@ -282,6 +293,28 @@ message ConfirmPayoutRequest {
|
|
|
282
293
|
optional string confirmed_by_manager_id = 2;
|
|
283
294
|
}
|
|
284
295
|
|
|
296
|
+
message UpdatePayoutRequest {
|
|
297
|
+
int64 payout_id = 1;
|
|
298
|
+
optional string amount = 2;
|
|
299
|
+
optional string currency = 3;
|
|
300
|
+
optional string payment_method = 4;
|
|
301
|
+
optional string output_currency = 5;
|
|
302
|
+
optional string comment = 6;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
message CancelPayoutRequest {
|
|
306
|
+
int64 payout_id = 1;
|
|
307
|
+
optional string reason = 2;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
message DeletePayoutRequest {
|
|
311
|
+
int64 payout_id = 1;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
message DeletePayoutResponse {
|
|
315
|
+
bool deleted = 1;
|
|
316
|
+
}
|
|
317
|
+
|
|
285
318
|
message ReferralPayoutResponse {
|
|
286
319
|
int64 id = 1;
|
|
287
320
|
int64 profile_id = 2;
|
|
@@ -309,6 +342,22 @@ message ListPayoutsResponse {
|
|
|
309
342
|
int32 limit = 4;
|
|
310
343
|
}
|
|
311
344
|
|
|
345
|
+
message RecreateBonusesRequest {
|
|
346
|
+
string wallet_user_id = 1;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
message RecreateBonusesBalanceItem {
|
|
350
|
+
string currency = 1;
|
|
351
|
+
string amount = 2;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
message RecreateBonusesResponse {
|
|
355
|
+
bool success = 1;
|
|
356
|
+
int32 commissions_count = 2;
|
|
357
|
+
int32 payouts_count = 3;
|
|
358
|
+
repeated RecreateBonusesBalanceItem balances = 4;
|
|
359
|
+
}
|
|
360
|
+
|
|
312
361
|
message AdminRecalculateExchangeRequest {
|
|
313
362
|
string exchange_id = 1;
|
|
314
363
|
bool dry_run = 2;
|
package/proto/user.proto
CHANGED
|
@@ -165,7 +165,9 @@ message AdminUserForUpdateResponse {
|
|
|
165
165
|
optional string adv_channel = 10;
|
|
166
166
|
optional string ref_code = 11;
|
|
167
167
|
optional int32 referrer_user_id = 12;
|
|
168
|
-
|
|
168
|
+
// Строковый тип для admin-flow, чтобы избежать тихого enum-default при межсервисном проксировании.
|
|
169
|
+
// Допустимые значения: PROFIT | VOLUME | REFERRAL_BONUS_TYPE_PROFIT | REFERRAL_BONUS_TYPE_VOLUME.
|
|
170
|
+
optional string bonus_type = 13;
|
|
169
171
|
optional double ref_percent = 14;
|
|
170
172
|
// true, если в рамках AdminUpdateUserProfile был установлен referrer_user_id.
|
|
171
173
|
bool referrer_changed = 15;
|
|
@@ -192,7 +194,9 @@ message AdminUpdateUserProfileRequest {
|
|
|
192
194
|
// Разрешено только если у пользователя еще нет реферера.
|
|
193
195
|
// Если текущий реферер уже задан, сервис возвращает ошибку REFERRER_ALREADY_SET.
|
|
194
196
|
optional int32 referrer_user_id = 11;
|
|
195
|
-
|
|
197
|
+
// Строковый тип для admin-flow, чтобы избежать тихого enum-default при межсервисном проксировании.
|
|
198
|
+
// Допустимые значения: PROFIT | VOLUME | REFERRAL_BONUS_TYPE_PROFIT | REFERRAL_BONUS_TYPE_VOLUME.
|
|
199
|
+
optional string bonus_type = 12;
|
|
196
200
|
optional double ref_percent = 13;
|
|
197
201
|
optional bool is_partner = 14;
|
|
198
202
|
optional string attention = 15;
|
|
@@ -201,6 +205,9 @@ message AdminUpdateUserProfileRequest {
|
|
|
201
205
|
optional string instagram = 18;
|
|
202
206
|
optional string facebook = 19;
|
|
203
207
|
optional string facebook_url = 20;
|
|
208
|
+
// true — в этом запросе нужно выполнить изменение referrer_user_id;
|
|
209
|
+
// false/отсутствует — referrer_user_id игнорируется и не должен вызывать REFERRER_ALREADY_SET.
|
|
210
|
+
optional bool referrer_changed = 21;
|
|
204
211
|
}
|
|
205
212
|
|
|
206
213
|
message UpdateUserRequest {
|