@arbiwallet/contracts 1.0.97 → 1.0.98
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/package.json +1 -1
- package/proto/deposit.proto +48 -1
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/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.98",
|
|
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
|
+
}
|