@arbiwallet/contracts 1.0.58 → 1.0.60
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/user.ts +55 -0
- package/package.json +1 -1
- package/proto/user.proto +32 -0
package/gen/user.ts
CHANGED
|
@@ -114,6 +114,34 @@ export interface GetCrmSessionResponse {
|
|
|
114
114
|
expiresAtUnix: number;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
export interface CrmExchangeHttpRequest {
|
|
118
|
+
method: string;
|
|
119
|
+
path: string;
|
|
120
|
+
queryString?: string | undefined;
|
|
121
|
+
jsonBody?: string | undefined;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface CrmExchangeHttpResponse {
|
|
125
|
+
httpStatus: number;
|
|
126
|
+
bodyJson: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface SubmitWalletCrmExchangeOrderRequest {
|
|
130
|
+
walletUserId: number;
|
|
131
|
+
inputAmount: number;
|
|
132
|
+
outputAmount: number;
|
|
133
|
+
inputCurrency: number;
|
|
134
|
+
outputCurrency: number;
|
|
135
|
+
withdrawType: number;
|
|
136
|
+
receiveBank?: number | undefined;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface SubmitWalletCrmExchangeOrderResponse {
|
|
140
|
+
success: boolean;
|
|
141
|
+
orderId?: number | undefined;
|
|
142
|
+
message?: string | undefined;
|
|
143
|
+
}
|
|
144
|
+
|
|
117
145
|
export interface UserBalance {
|
|
118
146
|
asset: string;
|
|
119
147
|
network: string;
|
|
@@ -151,6 +179,16 @@ export interface UserServiceClient {
|
|
|
151
179
|
/** CRM Arbi Exchange: логин сервисным аккаунтом (env), OTP из TOTP-секрета; session_id для X-Session-ID. */
|
|
152
180
|
|
|
153
181
|
getCrmSession(request: GetCrmSessionRequest): Observable<GetCrmSessionResponse>;
|
|
182
|
+
|
|
183
|
+
/** HTTP к CRM Exchange: сессия и X-Session-ID только внутри user-service. */
|
|
184
|
+
|
|
185
|
+
crmExchangeHttp(request: CrmExchangeHttpRequest): Observable<CrmExchangeHttpResponse>;
|
|
186
|
+
|
|
187
|
+
/** Создание/получение CRM-клиента по wallet_user_id и создание заявки на обмен (два шага к CRM внутри сервиса). */
|
|
188
|
+
|
|
189
|
+
submitWalletCrmExchangeOrder(
|
|
190
|
+
request: SubmitWalletCrmExchangeOrderRequest,
|
|
191
|
+
): Observable<SubmitWalletCrmExchangeOrderResponse>;
|
|
154
192
|
}
|
|
155
193
|
|
|
156
194
|
export interface UserServiceController {
|
|
@@ -176,6 +214,21 @@ export interface UserServiceController {
|
|
|
176
214
|
getCrmSession(
|
|
177
215
|
request: GetCrmSessionRequest,
|
|
178
216
|
): Promise<GetCrmSessionResponse> | Observable<GetCrmSessionResponse> | GetCrmSessionResponse;
|
|
217
|
+
|
|
218
|
+
/** HTTP к CRM Exchange: сессия и X-Session-ID только внутри user-service. */
|
|
219
|
+
|
|
220
|
+
crmExchangeHttp(
|
|
221
|
+
request: CrmExchangeHttpRequest,
|
|
222
|
+
): Promise<CrmExchangeHttpResponse> | Observable<CrmExchangeHttpResponse> | CrmExchangeHttpResponse;
|
|
223
|
+
|
|
224
|
+
/** Создание/получение CRM-клиента по wallet_user_id и создание заявки на обмен (два шага к CRM внутри сервиса). */
|
|
225
|
+
|
|
226
|
+
submitWalletCrmExchangeOrder(
|
|
227
|
+
request: SubmitWalletCrmExchangeOrderRequest,
|
|
228
|
+
):
|
|
229
|
+
| Promise<SubmitWalletCrmExchangeOrderResponse>
|
|
230
|
+
| Observable<SubmitWalletCrmExchangeOrderResponse>
|
|
231
|
+
| SubmitWalletCrmExchangeOrderResponse;
|
|
179
232
|
}
|
|
180
233
|
|
|
181
234
|
export function UserServiceControllerMethods() {
|
|
@@ -187,6 +240,8 @@ export function UserServiceControllerMethods() {
|
|
|
187
240
|
"listUsers",
|
|
188
241
|
"resolveUserForTransfer",
|
|
189
242
|
"getCrmSession",
|
|
243
|
+
"crmExchangeHttp",
|
|
244
|
+
"submitWalletCrmExchangeOrder",
|
|
190
245
|
];
|
|
191
246
|
for (const method of grpcMethods) {
|
|
192
247
|
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.60",
|
|
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/user.proto
CHANGED
|
@@ -10,6 +10,10 @@ service UserService {
|
|
|
10
10
|
rpc ResolveUserForTransfer (ResolveUserForTransferRequest) returns (ResolveUserForTransferResponse);
|
|
11
11
|
// CRM Arbi Exchange: логин сервисным аккаунтом (env), OTP из TOTP-секрета; session_id для X-Session-ID.
|
|
12
12
|
rpc GetCrmSession (GetCrmSessionRequest) returns (GetCrmSessionResponse);
|
|
13
|
+
// HTTP к CRM Exchange: сессия и X-Session-ID только внутри user-service.
|
|
14
|
+
rpc CrmExchangeHttp (CrmExchangeHttpRequest) returns (CrmExchangeHttpResponse);
|
|
15
|
+
// Создание/получение CRM-клиента по wallet_user_id и создание заявки на обмен (два шага к CRM внутри сервиса).
|
|
16
|
+
rpc SubmitWalletCrmExchangeOrder (SubmitWalletCrmExchangeOrderRequest) returns (SubmitWalletCrmExchangeOrderResponse);
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
enum UserStatus {
|
|
@@ -112,6 +116,34 @@ message GetCrmSessionResponse {
|
|
|
112
116
|
int64 expires_at_unix = 2;
|
|
113
117
|
}
|
|
114
118
|
|
|
119
|
+
message CrmExchangeHttpRequest {
|
|
120
|
+
string method = 1;
|
|
121
|
+
string path = 2;
|
|
122
|
+
optional string query_string = 3;
|
|
123
|
+
optional string json_body = 4;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
message CrmExchangeHttpResponse {
|
|
127
|
+
int32 http_status = 1;
|
|
128
|
+
string body_json = 2;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
message SubmitWalletCrmExchangeOrderRequest {
|
|
132
|
+
int32 wallet_user_id = 1;
|
|
133
|
+
double input_amount = 2;
|
|
134
|
+
double output_amount = 3;
|
|
135
|
+
int32 input_currency = 4;
|
|
136
|
+
int32 output_currency = 5;
|
|
137
|
+
int32 withdraw_type = 6;
|
|
138
|
+
optional int32 receive_bank = 7;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
message SubmitWalletCrmExchangeOrderResponse {
|
|
142
|
+
bool success = 1;
|
|
143
|
+
optional int32 order_id = 2;
|
|
144
|
+
optional string message = 3;
|
|
145
|
+
}
|
|
146
|
+
|
|
115
147
|
message UserBalance {
|
|
116
148
|
string asset = 1;
|
|
117
149
|
string network = 2;
|