@arbiwallet/contracts 1.0.39 → 1.0.41
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 +220 -0
- package/package.json +1 -1
- package/proto/withdrawal.proto +142 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
|
+
// protoc v7.34.0
|
|
5
|
+
// source: withdrawal.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "withdrawal.v1";
|
|
12
|
+
|
|
13
|
+
export interface CreateWithdrawalRequest {
|
|
14
|
+
userId: string;
|
|
15
|
+
network: string;
|
|
16
|
+
asset: string;
|
|
17
|
+
amount: string;
|
|
18
|
+
toAddress: string;
|
|
19
|
+
idempotencyKey?: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface GetWithdrawalRequest {
|
|
23
|
+
userId: string;
|
|
24
|
+
withdrawRequestId: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ListWithdrawalsRequest {
|
|
28
|
+
userId?: string | undefined;
|
|
29
|
+
status?: string | undefined;
|
|
30
|
+
network?: string | undefined;
|
|
31
|
+
from?: string | undefined;
|
|
32
|
+
to?: string | undefined;
|
|
33
|
+
take?: number | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ListWithdrawalsResponse {
|
|
37
|
+
items: Withdrawal[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface GetMonthlyWithdrawalLimitRequest {
|
|
41
|
+
userId: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface GetWithdrawalLimitsRequest {
|
|
45
|
+
userId: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface WithdrawalLimits {
|
|
49
|
+
userId: string;
|
|
50
|
+
minWithdrawalAmount: string;
|
|
51
|
+
dailyLimit: string;
|
|
52
|
+
monthlyLimit: string;
|
|
53
|
+
dailyUsed: string;
|
|
54
|
+
dailyRemaining: string;
|
|
55
|
+
monthlyUsed: string;
|
|
56
|
+
monthlyRemaining: string;
|
|
57
|
+
kycTier: string;
|
|
58
|
+
isCustomLimit: boolean;
|
|
59
|
+
dayStartUtc: string;
|
|
60
|
+
dayEndExclusiveUtc: string;
|
|
61
|
+
monthStartUtc: string;
|
|
62
|
+
monthEndExclusiveUtc: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface MonthlyWithdrawalLimit {
|
|
66
|
+
userId: string;
|
|
67
|
+
monthlyLimitUsdt: string;
|
|
68
|
+
minWithdrawalUsdt: string;
|
|
69
|
+
usedThisMonthUsdt: string;
|
|
70
|
+
remainingThisMonthUsdt: string;
|
|
71
|
+
monthStartUtc: string;
|
|
72
|
+
monthEndExclusiveUtc: string;
|
|
73
|
+
dailyLimitUsdt?: string | undefined;
|
|
74
|
+
usedThisDayUsdt?: string | undefined;
|
|
75
|
+
remainingThisDayUsdt?: string | undefined;
|
|
76
|
+
dayStartUtc?: string | undefined;
|
|
77
|
+
dayEndExclusiveUtc?: string | undefined;
|
|
78
|
+
kycTier?: string | undefined;
|
|
79
|
+
isCustomLimit?: boolean | undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface AdminSetMonthlyWithdrawalLimitRequest {
|
|
83
|
+
adminApiKey: string;
|
|
84
|
+
userId: string;
|
|
85
|
+
monthlyLimitUsdt: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface AdminSetMonthlyWithdrawalLimitResponse {
|
|
89
|
+
userId: string;
|
|
90
|
+
monthlyLimitUsdt: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface AdminSetUserWithdrawalLimitsRequest {
|
|
94
|
+
adminApiKey: string;
|
|
95
|
+
userId: string;
|
|
96
|
+
customDailyLimitUsdt?: string | undefined;
|
|
97
|
+
customMonthlyLimitUsdt?: string | undefined;
|
|
98
|
+
clearCustomLimits: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface AdminSetUserWithdrawalLimitsResponse {
|
|
102
|
+
userId: string;
|
|
103
|
+
customDailyLimitUsdt?: string | undefined;
|
|
104
|
+
customMonthlyLimitUsdt?: string | undefined;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface AdminRejectWithdrawalRequest {
|
|
108
|
+
adminApiKey: string;
|
|
109
|
+
withdrawRequestId: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface Withdrawal {
|
|
113
|
+
withdrawRequestId: string;
|
|
114
|
+
userId: string;
|
|
115
|
+
network: string;
|
|
116
|
+
asset: string;
|
|
117
|
+
amount: string;
|
|
118
|
+
toAddress: string;
|
|
119
|
+
status: string;
|
|
120
|
+
serviceFee: string;
|
|
121
|
+
networkFee: string;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
transactionId?: string | undefined;
|
|
124
|
+
referenceId?: string | undefined;
|
|
125
|
+
custodyTxId?: string | undefined;
|
|
126
|
+
txHash?: string | undefined;
|
|
127
|
+
amlScore?: number | undefined;
|
|
128
|
+
amlReason?: string | undefined;
|
|
129
|
+
amlDecision?: string | undefined;
|
|
130
|
+
errorCode?: string | undefined;
|
|
131
|
+
errorMessage?: string | undefined;
|
|
132
|
+
finalizedAt?: string | undefined;
|
|
133
|
+
refundedAt?: string | undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export const WITHDRAWAL_V1_PACKAGE_NAME = "withdrawal.v1";
|
|
137
|
+
|
|
138
|
+
export interface WithdrawalServiceClient {
|
|
139
|
+
createWithdrawal(request: CreateWithdrawalRequest): Observable<Withdrawal>;
|
|
140
|
+
|
|
141
|
+
getWithdrawal(request: GetWithdrawalRequest): Observable<Withdrawal>;
|
|
142
|
+
|
|
143
|
+
listWithdrawals(request: ListWithdrawalsRequest): Observable<ListWithdrawalsResponse>;
|
|
144
|
+
|
|
145
|
+
getMonthlyWithdrawalLimit(request: GetMonthlyWithdrawalLimitRequest): Observable<MonthlyWithdrawalLimit>;
|
|
146
|
+
|
|
147
|
+
getWithdrawalLimits(request: GetWithdrawalLimitsRequest): Observable<WithdrawalLimits>;
|
|
148
|
+
|
|
149
|
+
adminSetMonthlyWithdrawalLimit(
|
|
150
|
+
request: AdminSetMonthlyWithdrawalLimitRequest,
|
|
151
|
+
): Observable<AdminSetMonthlyWithdrawalLimitResponse>;
|
|
152
|
+
|
|
153
|
+
adminSetUserWithdrawalLimits(
|
|
154
|
+
request: AdminSetUserWithdrawalLimitsRequest,
|
|
155
|
+
): Observable<AdminSetUserWithdrawalLimitsResponse>;
|
|
156
|
+
|
|
157
|
+
adminRejectWithdrawal(request: AdminRejectWithdrawalRequest): Observable<Withdrawal>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface WithdrawalServiceController {
|
|
161
|
+
createWithdrawal(request: CreateWithdrawalRequest): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
|
|
162
|
+
|
|
163
|
+
getWithdrawal(request: GetWithdrawalRequest): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
|
|
164
|
+
|
|
165
|
+
listWithdrawals(
|
|
166
|
+
request: ListWithdrawalsRequest,
|
|
167
|
+
): Promise<ListWithdrawalsResponse> | Observable<ListWithdrawalsResponse> | ListWithdrawalsResponse;
|
|
168
|
+
|
|
169
|
+
getMonthlyWithdrawalLimit(
|
|
170
|
+
request: GetMonthlyWithdrawalLimitRequest,
|
|
171
|
+
): Promise<MonthlyWithdrawalLimit> | Observable<MonthlyWithdrawalLimit> | MonthlyWithdrawalLimit;
|
|
172
|
+
|
|
173
|
+
getWithdrawalLimits(
|
|
174
|
+
request: GetWithdrawalLimitsRequest,
|
|
175
|
+
): Promise<WithdrawalLimits> | Observable<WithdrawalLimits> | WithdrawalLimits;
|
|
176
|
+
|
|
177
|
+
adminSetMonthlyWithdrawalLimit(
|
|
178
|
+
request: AdminSetMonthlyWithdrawalLimitRequest,
|
|
179
|
+
):
|
|
180
|
+
| Promise<AdminSetMonthlyWithdrawalLimitResponse>
|
|
181
|
+
| Observable<AdminSetMonthlyWithdrawalLimitResponse>
|
|
182
|
+
| AdminSetMonthlyWithdrawalLimitResponse;
|
|
183
|
+
|
|
184
|
+
adminSetUserWithdrawalLimits(
|
|
185
|
+
request: AdminSetUserWithdrawalLimitsRequest,
|
|
186
|
+
):
|
|
187
|
+
| Promise<AdminSetUserWithdrawalLimitsResponse>
|
|
188
|
+
| Observable<AdminSetUserWithdrawalLimitsResponse>
|
|
189
|
+
| AdminSetUserWithdrawalLimitsResponse;
|
|
190
|
+
|
|
191
|
+
adminRejectWithdrawal(
|
|
192
|
+
request: AdminRejectWithdrawalRequest,
|
|
193
|
+
): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function WithdrawalServiceControllerMethods() {
|
|
197
|
+
return function (constructor: Function) {
|
|
198
|
+
const grpcMethods: string[] = [
|
|
199
|
+
"createWithdrawal",
|
|
200
|
+
"getWithdrawal",
|
|
201
|
+
"listWithdrawals",
|
|
202
|
+
"getMonthlyWithdrawalLimit",
|
|
203
|
+
"getWithdrawalLimits",
|
|
204
|
+
"adminSetMonthlyWithdrawalLimit",
|
|
205
|
+
"adminSetUserWithdrawalLimits",
|
|
206
|
+
"adminRejectWithdrawal",
|
|
207
|
+
];
|
|
208
|
+
for (const method of grpcMethods) {
|
|
209
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
210
|
+
GrpcMethod("WithdrawalService", method)(constructor.prototype[method], method, descriptor);
|
|
211
|
+
}
|
|
212
|
+
const grpcStreamMethods: string[] = [];
|
|
213
|
+
for (const method of grpcStreamMethods) {
|
|
214
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
215
|
+
GrpcStreamMethod("WithdrawalService", method)(constructor.prototype[method], method, descriptor);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export const WITHDRAWAL_SERVICE_NAME = "WithdrawalService";
|
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.41",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
7
|
},
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
// Микросервис заявок на вывод (USDT TRON/BSC). Клиент: Wallet Gateway по gRPC.
|
|
4
|
+
package withdrawal.v1;
|
|
5
|
+
|
|
6
|
+
option csharp_namespace = "Withdrawal.V1";
|
|
7
|
+
option java_multiple_files = true;
|
|
8
|
+
option java_package = "com.arbiwallet.withdrawal.v1";
|
|
9
|
+
|
|
10
|
+
service WithdrawalService {
|
|
11
|
+
rpc CreateWithdrawal(CreateWithdrawalRequest) returns (Withdrawal);
|
|
12
|
+
rpc GetWithdrawal(GetWithdrawalRequest) returns (Withdrawal);
|
|
13
|
+
rpc ListWithdrawals(ListWithdrawalsRequest) returns (ListWithdrawalsResponse);
|
|
14
|
+
rpc GetMonthlyWithdrawalLimit(GetMonthlyWithdrawalLimitRequest) returns (MonthlyWithdrawalLimit);
|
|
15
|
+
rpc GetWithdrawalLimits(GetWithdrawalLimitsRequest) returns (WithdrawalLimits);
|
|
16
|
+
rpc AdminSetMonthlyWithdrawalLimit(AdminSetMonthlyWithdrawalLimitRequest) returns (AdminSetMonthlyWithdrawalLimitResponse);
|
|
17
|
+
rpc AdminSetUserWithdrawalLimits(AdminSetUserWithdrawalLimitsRequest) returns (AdminSetUserWithdrawalLimitsResponse);
|
|
18
|
+
rpc AdminRejectWithdrawal(AdminRejectWithdrawalRequest) returns (Withdrawal);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message CreateWithdrawalRequest {
|
|
22
|
+
string user_id = 1;
|
|
23
|
+
string network = 2;
|
|
24
|
+
string asset = 3;
|
|
25
|
+
string amount = 4;
|
|
26
|
+
string to_address = 5;
|
|
27
|
+
optional string idempotency_key = 6;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message GetWithdrawalRequest {
|
|
31
|
+
string user_id = 1;
|
|
32
|
+
string withdraw_request_id = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message ListWithdrawalsRequest {
|
|
36
|
+
optional string user_id = 1;
|
|
37
|
+
optional string status = 2;
|
|
38
|
+
optional string network = 3;
|
|
39
|
+
optional string from = 4;
|
|
40
|
+
optional string to = 5;
|
|
41
|
+
optional int32 take = 6;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message ListWithdrawalsResponse {
|
|
45
|
+
repeated Withdrawal items = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message GetMonthlyWithdrawalLimitRequest {
|
|
49
|
+
string user_id = 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message GetWithdrawalLimitsRequest {
|
|
53
|
+
string user_id = 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message WithdrawalLimits {
|
|
57
|
+
string user_id = 1;
|
|
58
|
+
string min_withdrawal_amount = 2;
|
|
59
|
+
string daily_limit = 3;
|
|
60
|
+
string monthly_limit = 4;
|
|
61
|
+
string daily_used = 5;
|
|
62
|
+
string daily_remaining = 6;
|
|
63
|
+
string monthly_used = 7;
|
|
64
|
+
string monthly_remaining = 8;
|
|
65
|
+
string kyc_tier = 9;
|
|
66
|
+
bool is_custom_limit = 10;
|
|
67
|
+
string day_start_utc = 11;
|
|
68
|
+
string day_end_exclusive_utc = 12;
|
|
69
|
+
string month_start_utc = 13;
|
|
70
|
+
string month_end_exclusive_utc = 14;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message MonthlyWithdrawalLimit {
|
|
74
|
+
string user_id = 1;
|
|
75
|
+
string monthly_limit_usdt = 2;
|
|
76
|
+
string min_withdrawal_usdt = 3;
|
|
77
|
+
string used_this_month_usdt = 4;
|
|
78
|
+
string remaining_this_month_usdt = 5;
|
|
79
|
+
string month_start_utc = 6;
|
|
80
|
+
string month_end_exclusive_utc = 7;
|
|
81
|
+
optional string daily_limit_usdt = 8;
|
|
82
|
+
optional string used_this_day_usdt = 9;
|
|
83
|
+
optional string remaining_this_day_usdt = 10;
|
|
84
|
+
optional string day_start_utc = 11;
|
|
85
|
+
optional string day_end_exclusive_utc = 12;
|
|
86
|
+
optional string kyc_tier = 13;
|
|
87
|
+
optional bool is_custom_limit = 14;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message AdminSetMonthlyWithdrawalLimitRequest {
|
|
91
|
+
string admin_api_key = 1;
|
|
92
|
+
string user_id = 2;
|
|
93
|
+
string monthly_limit_usdt = 3;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message AdminSetMonthlyWithdrawalLimitResponse {
|
|
97
|
+
string user_id = 1;
|
|
98
|
+
string monthly_limit_usdt = 2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message AdminSetUserWithdrawalLimitsRequest {
|
|
102
|
+
string admin_api_key = 1;
|
|
103
|
+
string user_id = 2;
|
|
104
|
+
optional string custom_daily_limit_usdt = 3;
|
|
105
|
+
optional string custom_monthly_limit_usdt = 4;
|
|
106
|
+
bool clear_custom_limits = 5;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message AdminSetUserWithdrawalLimitsResponse {
|
|
110
|
+
string user_id = 1;
|
|
111
|
+
optional string custom_daily_limit_usdt = 2;
|
|
112
|
+
optional string custom_monthly_limit_usdt = 3;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message AdminRejectWithdrawalRequest {
|
|
116
|
+
string admin_api_key = 1;
|
|
117
|
+
string withdraw_request_id = 2;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message Withdrawal {
|
|
121
|
+
string withdraw_request_id = 1;
|
|
122
|
+
string user_id = 2;
|
|
123
|
+
string network = 3;
|
|
124
|
+
string asset = 4;
|
|
125
|
+
string amount = 5;
|
|
126
|
+
string to_address = 6;
|
|
127
|
+
string status = 7;
|
|
128
|
+
string service_fee = 8;
|
|
129
|
+
string network_fee = 9;
|
|
130
|
+
string created_at = 10;
|
|
131
|
+
optional string transaction_id = 11;
|
|
132
|
+
optional string reference_id = 12;
|
|
133
|
+
optional string custody_tx_id = 13;
|
|
134
|
+
optional string tx_hash = 14;
|
|
135
|
+
optional int32 aml_score = 15;
|
|
136
|
+
optional string aml_reason = 16;
|
|
137
|
+
optional string aml_decision = 17;
|
|
138
|
+
optional string error_code = 18;
|
|
139
|
+
optional string error_message = 19;
|
|
140
|
+
optional string finalized_at = 20;
|
|
141
|
+
optional string refunded_at = 21;
|
|
142
|
+
}
|