@arbiwallet/contracts 1.0.97 → 1.0.99
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/deposit.ts +78 -1
- package/gen/user.ts +64 -0
- package/package.json +1 -1
- package/proto/deposit.proto +48 -1
- package/proto/user.proto +34 -0
package/gen/deposit.ts
CHANGED
|
@@ -26,12 +26,69 @@ export interface ApplyBitGoCustodyAckResponse {
|
|
|
26
26
|
depositTxIds: string[];
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
export interface CreatePaymentDillDepositRequest {
|
|
30
|
+
userId: string;
|
|
31
|
+
/** USDT to credit (major units), e.g. "100.50" */
|
|
32
|
+
amount: string;
|
|
33
|
+
/** Pay-in: RUB (SBP) | USDT (crypto) */
|
|
34
|
+
paymentCurrency: string;
|
|
35
|
+
/** Зачисление в Ledger (по умолчанию USDT) */
|
|
36
|
+
creditAsset?:
|
|
37
|
+
| string
|
|
38
|
+
| undefined;
|
|
39
|
+
/** Сеть баланса в Ledger (по умолчанию TRON) */
|
|
40
|
+
creditNetwork?: string | undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface CreatePaymentDillDepositResponse {
|
|
44
|
+
depositId: string;
|
|
45
|
+
status: string;
|
|
46
|
+
paymentUrl?: string | undefined;
|
|
47
|
+
cryptoWallet?: string | undefined;
|
|
48
|
+
qrLink?: string | undefined;
|
|
49
|
+
redirectUrl?: string | undefined;
|
|
50
|
+
providerTransactionId?:
|
|
51
|
+
| string
|
|
52
|
+
| undefined;
|
|
53
|
+
/** Pay-in amount in minor units (from payment microservice) */
|
|
54
|
+
amountMinor?:
|
|
55
|
+
| string
|
|
56
|
+
| undefined;
|
|
57
|
+
/** Pay-in currency (RUB | USDT) */
|
|
58
|
+
paymentCurrency?:
|
|
59
|
+
| string
|
|
60
|
+
| undefined;
|
|
61
|
+
/** USDT to credit (requested / quoted output) */
|
|
62
|
+
creditAmount?: string | undefined;
|
|
63
|
+
requestedCreditAmount?: string | undefined;
|
|
64
|
+
creditAsset?: string | undefined;
|
|
65
|
+
creditNetwork?: string | undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface HandlePaymentDillDepositWebhookRequest {
|
|
69
|
+
jsonPayload: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface HandlePaymentDillDepositWebhookResponse {
|
|
73
|
+
ok: boolean;
|
|
74
|
+
depositId: string;
|
|
75
|
+
status: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
29
78
|
export const DEPOSIT_V1_PACKAGE_NAME = "deposit.v1";
|
|
30
79
|
|
|
31
80
|
export interface DepositIntegrationClient {
|
|
32
81
|
/** Привязать событие BitGo к уже найденному ончейн-депозиту (mpc webhook). */
|
|
33
82
|
|
|
34
83
|
applyBitGoCustodyAck(request: ApplyBitGoCustodyAckRequest): Observable<ApplyBitGoCustodyAckResponse>;
|
|
84
|
+
|
|
85
|
+
/** Пополнение через payment microservice (ARBIPAY): RUB SBP / USDT. */
|
|
86
|
+
|
|
87
|
+
createPaymentDillDeposit(request: CreatePaymentDillDepositRequest): Observable<CreatePaymentDillDepositResponse>;
|
|
88
|
+
|
|
89
|
+
handlePaymentDillDepositWebhook(
|
|
90
|
+
request: HandlePaymentDillDepositWebhookRequest,
|
|
91
|
+
): Observable<HandlePaymentDillDepositWebhookResponse>;
|
|
35
92
|
}
|
|
36
93
|
|
|
37
94
|
export interface DepositIntegrationController {
|
|
@@ -40,11 +97,31 @@ export interface DepositIntegrationController {
|
|
|
40
97
|
applyBitGoCustodyAck(
|
|
41
98
|
request: ApplyBitGoCustodyAckRequest,
|
|
42
99
|
): Promise<ApplyBitGoCustodyAckResponse> | Observable<ApplyBitGoCustodyAckResponse> | ApplyBitGoCustodyAckResponse;
|
|
100
|
+
|
|
101
|
+
/** Пополнение через payment microservice (ARBIPAY): RUB SBP / USDT. */
|
|
102
|
+
|
|
103
|
+
createPaymentDillDeposit(
|
|
104
|
+
request: CreatePaymentDillDepositRequest,
|
|
105
|
+
):
|
|
106
|
+
| Promise<CreatePaymentDillDepositResponse>
|
|
107
|
+
| Observable<CreatePaymentDillDepositResponse>
|
|
108
|
+
| CreatePaymentDillDepositResponse;
|
|
109
|
+
|
|
110
|
+
handlePaymentDillDepositWebhook(
|
|
111
|
+
request: HandlePaymentDillDepositWebhookRequest,
|
|
112
|
+
):
|
|
113
|
+
| Promise<HandlePaymentDillDepositWebhookResponse>
|
|
114
|
+
| Observable<HandlePaymentDillDepositWebhookResponse>
|
|
115
|
+
| HandlePaymentDillDepositWebhookResponse;
|
|
43
116
|
}
|
|
44
117
|
|
|
45
118
|
export function DepositIntegrationControllerMethods() {
|
|
46
119
|
return function (constructor: Function) {
|
|
47
|
-
const grpcMethods: string[] = [
|
|
120
|
+
const grpcMethods: string[] = [
|
|
121
|
+
"applyBitGoCustodyAck",
|
|
122
|
+
"createPaymentDillDeposit",
|
|
123
|
+
"handlePaymentDillDepositWebhook",
|
|
124
|
+
];
|
|
48
125
|
for (const method of grpcMethods) {
|
|
49
126
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
50
127
|
GrpcMethod("DepositIntegration", method)(constructor.prototype[method], method, descriptor);
|
package/gen/user.ts
CHANGED
|
@@ -48,7 +48,9 @@ export interface UserResponse {
|
|
|
48
48
|
id: number;
|
|
49
49
|
uid: number;
|
|
50
50
|
email?: string | undefined;
|
|
51
|
+
emailVerified: boolean;
|
|
51
52
|
phone?: string | undefined;
|
|
53
|
+
phoneVerified: boolean;
|
|
52
54
|
telegramId?: string | undefined;
|
|
53
55
|
telegramUsername?: string | undefined;
|
|
54
56
|
appleSub?: string | undefined;
|
|
@@ -260,6 +262,32 @@ export interface GetReferralLinkByTelegramIdResponse {
|
|
|
260
262
|
refCode: string;
|
|
261
263
|
}
|
|
262
264
|
|
|
265
|
+
export interface RequestChangeEmailCodeRequest {
|
|
266
|
+
userId: number;
|
|
267
|
+
email: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface VerifyChangeEmailCodeRequest {
|
|
271
|
+
userId: number;
|
|
272
|
+
email: string;
|
|
273
|
+
code: string;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export interface RequestChangePhoneCodeRequest {
|
|
277
|
+
userId: number;
|
|
278
|
+
phone: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface VerifyChangePhoneCodeRequest {
|
|
282
|
+
userId: number;
|
|
283
|
+
phone: string;
|
|
284
|
+
code: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface ContactChangeMessageResponse {
|
|
288
|
+
message: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
263
291
|
export interface UserBalance {
|
|
264
292
|
asset: string;
|
|
265
293
|
network: string;
|
|
@@ -349,6 +377,18 @@ export interface UserServiceClient {
|
|
|
349
377
|
getReferralLinkByTelegramId(
|
|
350
378
|
request: GetReferralLinkByTelegramIdRequest,
|
|
351
379
|
): Observable<GetReferralLinkByTelegramIdResponse>;
|
|
380
|
+
|
|
381
|
+
/** Смена email: отправка кода на новый адрес (RabbitMQ → notification). */
|
|
382
|
+
|
|
383
|
+
requestChangeEmailCode(request: RequestChangeEmailCodeRequest): Observable<ContactChangeMessageResponse>;
|
|
384
|
+
|
|
385
|
+
verifyChangeEmailCode(request: VerifyChangeEmailCodeRequest): Observable<UserResponse>;
|
|
386
|
+
|
|
387
|
+
/** Смена phone: отправка SMS-кода через Twilio. */
|
|
388
|
+
|
|
389
|
+
requestChangePhoneCode(request: RequestChangePhoneCodeRequest): Observable<ContactChangeMessageResponse>;
|
|
390
|
+
|
|
391
|
+
verifyChangePhoneCode(request: VerifyChangePhoneCodeRequest): Observable<UserResponse>;
|
|
352
392
|
}
|
|
353
393
|
|
|
354
394
|
export interface UserServiceController {
|
|
@@ -469,6 +509,26 @@ export interface UserServiceController {
|
|
|
469
509
|
| Promise<GetReferralLinkByTelegramIdResponse>
|
|
470
510
|
| Observable<GetReferralLinkByTelegramIdResponse>
|
|
471
511
|
| GetReferralLinkByTelegramIdResponse;
|
|
512
|
+
|
|
513
|
+
/** Смена email: отправка кода на новый адрес (RabbitMQ → notification). */
|
|
514
|
+
|
|
515
|
+
requestChangeEmailCode(
|
|
516
|
+
request: RequestChangeEmailCodeRequest,
|
|
517
|
+
): Promise<ContactChangeMessageResponse> | Observable<ContactChangeMessageResponse> | ContactChangeMessageResponse;
|
|
518
|
+
|
|
519
|
+
verifyChangeEmailCode(
|
|
520
|
+
request: VerifyChangeEmailCodeRequest,
|
|
521
|
+
): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
|
|
522
|
+
|
|
523
|
+
/** Смена phone: отправка SMS-кода через Twilio. */
|
|
524
|
+
|
|
525
|
+
requestChangePhoneCode(
|
|
526
|
+
request: RequestChangePhoneCodeRequest,
|
|
527
|
+
): Promise<ContactChangeMessageResponse> | Observable<ContactChangeMessageResponse> | ContactChangeMessageResponse;
|
|
528
|
+
|
|
529
|
+
verifyChangePhoneCode(
|
|
530
|
+
request: VerifyChangePhoneCodeRequest,
|
|
531
|
+
): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
|
|
472
532
|
}
|
|
473
533
|
|
|
474
534
|
export function UserServiceControllerMethods() {
|
|
@@ -492,6 +552,10 @@ export function UserServiceControllerMethods() {
|
|
|
492
552
|
"ensureTelegramUser",
|
|
493
553
|
"updateLanguageByTelegramId",
|
|
494
554
|
"getReferralLinkByTelegramId",
|
|
555
|
+
"requestChangeEmailCode",
|
|
556
|
+
"verifyChangeEmailCode",
|
|
557
|
+
"requestChangePhoneCode",
|
|
558
|
+
"verifyChangePhoneCode",
|
|
495
559
|
];
|
|
496
560
|
for (const method of grpcMethods) {
|
|
497
561
|
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.99",
|
|
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/deposit.proto
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
|
-
// Внутренний gRPC deposit_service (ончейн-депозиты,
|
|
3
|
+
// Внутренний gRPC deposit_service (ончейн-депозиты, payment-dill-deposit, BitGo ack).
|
|
4
4
|
package deposit.v1;
|
|
5
5
|
|
|
6
6
|
option csharp_namespace = "Deposit.V1";
|
|
@@ -10,6 +10,12 @@ option java_package = "com.arbiwallet.deposit.v1";
|
|
|
10
10
|
service DepositIntegration {
|
|
11
11
|
// Привязать событие BitGo к уже найденному ончейн-депозиту (mpc webhook).
|
|
12
12
|
rpc ApplyBitGoCustodyAck(ApplyBitGoCustodyAckRequest) returns (ApplyBitGoCustodyAckResponse);
|
|
13
|
+
|
|
14
|
+
// Пополнение через payment microservice (ARBIPAY): RUB SBP / USDT.
|
|
15
|
+
rpc CreatePaymentDillDeposit(CreatePaymentDillDepositRequest) returns (CreatePaymentDillDepositResponse);
|
|
16
|
+
|
|
17
|
+
rpc HandlePaymentDillDepositWebhook(HandlePaymentDillDepositWebhookRequest)
|
|
18
|
+
returns (HandlePaymentDillDepositWebhookResponse);
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
message ApplyBitGoCustodyAckRequest {
|
|
@@ -25,3 +31,44 @@ message ApplyBitGoCustodyAckResponse {
|
|
|
25
31
|
int32 matched = 1;
|
|
26
32
|
repeated string deposit_tx_ids = 2;
|
|
27
33
|
}
|
|
34
|
+
|
|
35
|
+
message CreatePaymentDillDepositRequest {
|
|
36
|
+
string user_id = 1;
|
|
37
|
+
/** USDT to credit (major units), e.g. "100.50" */
|
|
38
|
+
string amount = 2;
|
|
39
|
+
/** Pay-in: RUB (SBP) | USDT (crypto) */
|
|
40
|
+
string payment_currency = 3;
|
|
41
|
+
/** Зачисление в Ledger (по умолчанию USDT) */
|
|
42
|
+
optional string credit_asset = 4;
|
|
43
|
+
/** Сеть баланса в Ledger (по умолчанию TRON) */
|
|
44
|
+
optional string credit_network = 5;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message CreatePaymentDillDepositResponse {
|
|
48
|
+
string deposit_id = 1;
|
|
49
|
+
string status = 2;
|
|
50
|
+
optional string payment_url = 3;
|
|
51
|
+
optional string crypto_wallet = 4;
|
|
52
|
+
optional string qr_link = 5;
|
|
53
|
+
optional string redirect_url = 6;
|
|
54
|
+
optional string provider_transaction_id = 7;
|
|
55
|
+
/** Pay-in amount in minor units (from payment microservice) */
|
|
56
|
+
optional string amount_minor = 8;
|
|
57
|
+
/** Pay-in currency (RUB | USDT) */
|
|
58
|
+
optional string payment_currency = 9;
|
|
59
|
+
/** USDT to credit (requested / quoted output) */
|
|
60
|
+
optional string credit_amount = 10;
|
|
61
|
+
optional string requested_credit_amount = 13;
|
|
62
|
+
optional string credit_asset = 11;
|
|
63
|
+
optional string credit_network = 12;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message HandlePaymentDillDepositWebhookRequest {
|
|
67
|
+
string json_payload = 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message HandlePaymentDillDepositWebhookResponse {
|
|
71
|
+
bool ok = 1;
|
|
72
|
+
string deposit_id = 2;
|
|
73
|
+
string status = 3;
|
|
74
|
+
}
|
package/proto/user.proto
CHANGED
|
@@ -32,6 +32,12 @@ service UserService {
|
|
|
32
32
|
rpc UpdateLanguageByTelegramId (UpdateLanguageByTelegramIdRequest) returns (TelegramUserLanguageResponse);
|
|
33
33
|
// Реферальная ссылка MONETA: CRM customer по telegram_id → ref_code → https://arbi.exchange/contacts/qr?code=…
|
|
34
34
|
rpc GetReferralLinkByTelegramId (GetReferralLinkByTelegramIdRequest) returns (GetReferralLinkByTelegramIdResponse);
|
|
35
|
+
// Смена email: отправка кода на новый адрес (RabbitMQ → notification).
|
|
36
|
+
rpc RequestChangeEmailCode (RequestChangeEmailCodeRequest) returns (ContactChangeMessageResponse);
|
|
37
|
+
rpc VerifyChangeEmailCode (VerifyChangeEmailCodeRequest) returns (UserResponse);
|
|
38
|
+
// Смена phone: отправка SMS-кода через Twilio.
|
|
39
|
+
rpc RequestChangePhoneCode (RequestChangePhoneCodeRequest) returns (ContactChangeMessageResponse);
|
|
40
|
+
rpc VerifyChangePhoneCode (VerifyChangePhoneCodeRequest) returns (UserResponse);
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
enum UserStatus {
|
|
@@ -57,7 +63,9 @@ message UserResponse {
|
|
|
57
63
|
int32 id = 1;
|
|
58
64
|
int32 uid = 13;
|
|
59
65
|
optional string email = 2;
|
|
66
|
+
bool email_verified = 18;
|
|
60
67
|
optional string phone = 3;
|
|
68
|
+
bool phone_verified = 19;
|
|
61
69
|
optional string telegram_id = 4;
|
|
62
70
|
optional string telegram_username = 5;
|
|
63
71
|
optional string apple_sub = 6;
|
|
@@ -278,6 +286,32 @@ message GetReferralLinkByTelegramIdResponse {
|
|
|
278
286
|
string ref_code = 2;
|
|
279
287
|
}
|
|
280
288
|
|
|
289
|
+
message RequestChangeEmailCodeRequest {
|
|
290
|
+
int32 user_id = 1;
|
|
291
|
+
string email = 2;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
message VerifyChangeEmailCodeRequest {
|
|
295
|
+
int32 user_id = 1;
|
|
296
|
+
string email = 2;
|
|
297
|
+
string code = 3;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
message RequestChangePhoneCodeRequest {
|
|
301
|
+
int32 user_id = 1;
|
|
302
|
+
string phone = 2;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
message VerifyChangePhoneCodeRequest {
|
|
306
|
+
int32 user_id = 1;
|
|
307
|
+
string phone = 2;
|
|
308
|
+
string code = 3;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
message ContactChangeMessageResponse {
|
|
312
|
+
string message = 1;
|
|
313
|
+
}
|
|
314
|
+
|
|
281
315
|
message UserBalance {
|
|
282
316
|
string asset = 1;
|
|
283
317
|
string network = 2;
|