@arbiwallet/contracts 1.0.59 → 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 CHANGED
@@ -126,6 +126,22 @@ export interface CrmExchangeHttpResponse {
126
126
  bodyJson: string;
127
127
  }
128
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
+
129
145
  export interface UserBalance {
130
146
  asset: string;
131
147
  network: string;
@@ -167,6 +183,12 @@ export interface UserServiceClient {
167
183
  /** HTTP к CRM Exchange: сессия и X-Session-ID только внутри user-service. */
168
184
 
169
185
  crmExchangeHttp(request: CrmExchangeHttpRequest): Observable<CrmExchangeHttpResponse>;
186
+
187
+ /** Создание/получение CRM-клиента по wallet_user_id и создание заявки на обмен (два шага к CRM внутри сервиса). */
188
+
189
+ submitWalletCrmExchangeOrder(
190
+ request: SubmitWalletCrmExchangeOrderRequest,
191
+ ): Observable<SubmitWalletCrmExchangeOrderResponse>;
170
192
  }
171
193
 
172
194
  export interface UserServiceController {
@@ -198,6 +220,15 @@ export interface UserServiceController {
198
220
  crmExchangeHttp(
199
221
  request: CrmExchangeHttpRequest,
200
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;
201
232
  }
202
233
 
203
234
  export function UserServiceControllerMethods() {
@@ -210,6 +241,7 @@ export function UserServiceControllerMethods() {
210
241
  "resolveUserForTransfer",
211
242
  "getCrmSession",
212
243
  "crmExchangeHttp",
244
+ "submitWalletCrmExchangeOrder",
213
245
  ];
214
246
  for (const method of grpcMethods) {
215
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.59",
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
@@ -12,6 +12,8 @@ service UserService {
12
12
  rpc GetCrmSession (GetCrmSessionRequest) returns (GetCrmSessionResponse);
13
13
  // HTTP к CRM Exchange: сессия и X-Session-ID только внутри user-service.
14
14
  rpc CrmExchangeHttp (CrmExchangeHttpRequest) returns (CrmExchangeHttpResponse);
15
+ // Создание/получение CRM-клиента по wallet_user_id и создание заявки на обмен (два шага к CRM внутри сервиса).
16
+ rpc SubmitWalletCrmExchangeOrder (SubmitWalletCrmExchangeOrderRequest) returns (SubmitWalletCrmExchangeOrderResponse);
15
17
  }
16
18
 
17
19
  enum UserStatus {
@@ -126,6 +128,22 @@ message CrmExchangeHttpResponse {
126
128
  string body_json = 2;
127
129
  }
128
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
+
129
147
  message UserBalance {
130
148
  string asset = 1;
131
149
  string network = 2;