@arbiwallet/contracts 1.0.60 → 1.0.63

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/payout.ts CHANGED
@@ -18,96 +18,45 @@ export interface ParsePromptPayQrRequest {
18
18
 
19
19
  export interface ParsePromptPayQrResponse {
20
20
  scanId: number;
21
- quoteId: string;
22
- status: string;
23
- payloadJson: string;
24
- }
25
-
26
- export interface ConfirmPayoutPaymentRequest {
27
- scanId: number;
28
- quoteId: string;
29
- userId: string;
30
- }
31
-
32
- export interface ConfirmPayoutPaymentResponse {
33
- payoutId: number;
34
- status: string;
35
- payloadJson: string;
36
- }
37
-
38
- export interface HandlePayoutWebhookRequest {
39
- payloadJson: string;
40
- }
41
-
42
- export interface HandlePayoutWebhookResponse {
43
- ok: boolean;
44
- }
45
-
46
- export interface ParseMusePayPromptPayQrTestRequest {
47
- qrString: string;
48
- userId: string;
49
- amount: number;
50
- }
51
-
52
- export interface ParseMusePayPromptPayQrTestResponse {
53
- scanId: number;
54
- quoteId: string;
55
- status: string;
56
- payloadJson: string;
57
21
  inputAmountToPay: string;
58
22
  inputCurrencyToPay: string;
59
23
  convertedAmountToPay: string;
60
24
  convertedCurrencyToPay: string;
25
+ feePercent: number;
26
+ feeOnConverted: string;
27
+ convertedAmountWithFee: string;
61
28
  }
62
29
 
63
- export interface ParseMusePayPromptPayQrRequest {
64
- qrString: string;
65
- userId: string;
66
- amount: number;
67
- }
68
-
69
- export interface ParseMusePayPromptPayQrResponse {
70
- scanId: number;
71
- quoteId: string;
72
- status: string;
73
- payloadJson: string;
74
- inputAmountToPay: string;
75
- inputCurrencyToPay: string;
76
- convertedAmountToPay: string;
77
- convertedCurrencyToPay: string;
78
- }
79
-
80
- export interface ConfirmMusePayPayoutPaymentRequest {
30
+ export interface ConfirmPayoutPaymentRequest {
81
31
  scanId: number;
82
- quoteId: string;
83
32
  userId: string;
84
33
  }
85
34
 
86
- export interface ConfirmMusePayPayoutPaymentResponse {
35
+ export interface ConfirmPayoutPaymentResponse {
87
36
  payoutId: number;
88
37
  status: string;
89
- payloadJson: string;
90
38
  }
91
39
 
92
- export interface HandleMusePayWebhookRequest {
40
+ export interface HandlePayoutWebhookRequest {
93
41
  rawBody: Uint8Array;
94
42
  }
95
43
 
96
- export interface HandleMusePayWebhookResponse {
97
- payoutId: number;
98
- status: string;
99
- handled: boolean;
44
+ export interface HandlePayoutWebhookResponse {
45
+ ok: boolean;
100
46
  }
101
47
 
102
48
  export interface GetPayoutRequest {
103
49
  payoutId: number;
104
- userId: string;
105
50
  }
106
51
 
107
52
  export interface GetPayoutResponse {
108
53
  payoutId: number;
54
+ scanId: number;
109
55
  status: string;
110
- payloadJson: string;
56
+ finalConvertedAmount?: string | undefined;
57
+ finalConvertedCurrency?: string | undefined;
58
+ createdAt: string;
59
+ completedAt?: string | undefined;
111
60
  }
112
61
 
113
62
  export const PAYOUT_V1_PACKAGE_NAME = "payout.v1";
@@ -119,18 +68,6 @@ export interface PayoutServiceClient {
119
68
 
120
69
  handlePayoutWebhook(request: HandlePayoutWebhookRequest): Observable<HandlePayoutWebhookResponse>;
121
70
 
122
- parseMusePayPromptPayQrTest(
123
- request: ParseMusePayPromptPayQrTestRequest,
124
- ): Observable<ParseMusePayPromptPayQrTestResponse>;
125
-
126
- parseMusePayPromptPayQr(request: ParseMusePayPromptPayQrRequest): Observable<ParseMusePayPromptPayQrResponse>;
127
-
128
- confirmMusePayPayoutPayment(
129
- request: ConfirmMusePayPayoutPaymentRequest,
130
- ): Observable<ConfirmMusePayPayoutPaymentResponse>;
131
-
132
- handleMusePayWebhook(request: HandleMusePayWebhookRequest): Observable<HandleMusePayWebhookResponse>;
133
-
134
71
  getPayout(request: GetPayoutRequest): Observable<GetPayoutResponse>;
135
72
  }
136
73
 
@@ -147,46 +84,12 @@ export interface PayoutServiceController {
147
84
  request: HandlePayoutWebhookRequest,
148
85
  ): Promise<HandlePayoutWebhookResponse> | Observable<HandlePayoutWebhookResponse> | HandlePayoutWebhookResponse;
149
86
 
150
- parseMusePayPromptPayQrTest(
151
- request: ParseMusePayPromptPayQrTestRequest,
152
- ):
153
- | Promise<ParseMusePayPromptPayQrTestResponse>
154
- | Observable<ParseMusePayPromptPayQrTestResponse>
155
- | ParseMusePayPromptPayQrTestResponse;
156
-
157
- parseMusePayPromptPayQr(
158
- request: ParseMusePayPromptPayQrRequest,
159
- ):
160
- | Promise<ParseMusePayPromptPayQrResponse>
161
- | Observable<ParseMusePayPromptPayQrResponse>
162
- | ParseMusePayPromptPayQrResponse;
163
-
164
- confirmMusePayPayoutPayment(
165
- request: ConfirmMusePayPayoutPaymentRequest,
166
- ):
167
- | Promise<ConfirmMusePayPayoutPaymentResponse>
168
- | Observable<ConfirmMusePayPayoutPaymentResponse>
169
- | ConfirmMusePayPayoutPaymentResponse;
170
-
171
- handleMusePayWebhook(
172
- request: HandleMusePayWebhookRequest,
173
- ): Promise<HandleMusePayWebhookResponse> | Observable<HandleMusePayWebhookResponse> | HandleMusePayWebhookResponse;
174
-
175
87
  getPayout(request: GetPayoutRequest): Promise<GetPayoutResponse> | Observable<GetPayoutResponse> | GetPayoutResponse;
176
88
  }
177
89
 
178
90
  export function PayoutServiceControllerMethods() {
179
91
  return function (constructor: Function) {
180
- const grpcMethods: string[] = [
181
- "parsePromptPayQr",
182
- "confirmPayoutPayment",
183
- "handlePayoutWebhook",
184
- "parseMusePayPromptPayQrTest",
185
- "parseMusePayPromptPayQr",
186
- "confirmMusePayPayoutPayment",
187
- "handleMusePayWebhook",
188
- "getPayout",
189
- ];
92
+ const grpcMethods: string[] = ["parsePromptPayQr", "confirmPayoutPayment", "handlePayoutWebhook", "getPayout"];
190
93
  for (const method of grpcMethods) {
191
94
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
192
95
  GrpcMethod("PayoutService", method)(constructor.prototype[method], method, descriptor);
package/gen/user.ts CHANGED
@@ -134,6 +134,9 @@ export interface SubmitWalletCrmExchangeOrderRequest {
134
134
  outputCurrency: number;
135
135
  withdrawType: number;
136
136
  receiveBank?: number | undefined;
137
+ exchangeRateDisplay?: number | undefined;
138
+ sendCurrencyShort?: string | undefined;
139
+ receiveCurrencyShort?: string | undefined;
137
140
  }
138
141
 
139
142
  export interface SubmitWalletCrmExchangeOrderResponse {
@@ -142,6 +145,23 @@ export interface SubmitWalletCrmExchangeOrderResponse {
142
145
  message?: string | undefined;
143
146
  }
144
147
 
148
+ export interface ListWalletExchangeRecentPairsRequest {
149
+ walletUserId: number;
150
+ /** По умолчанию 20, максимум обрезается на сервисе. */
151
+ limit: number;
152
+ }
153
+
154
+ export interface WalletExchangeRecentPairItem {
155
+ sendCurrencyShort: string;
156
+ receiveCurrencyShort: string;
157
+ lastInputAmount: number;
158
+ lastSubmittedAtUnixMs: number;
159
+ }
160
+
161
+ export interface ListWalletExchangeRecentPairsResponse {
162
+ pairs: WalletExchangeRecentPairItem[];
163
+ }
164
+
145
165
  export interface UserBalance {
146
166
  asset: string;
147
167
  network: string;
@@ -189,6 +209,12 @@ export interface UserServiceClient {
189
209
  submitWalletCrmExchangeOrder(
190
210
  request: SubmitWalletCrmExchangeOrderRequest,
191
211
  ): Observable<SubmitWalletCrmExchangeOrderResponse>;
212
+
213
+ /** Уникальные валютные пары из последних заявок на обмен (по БД user-service), без дубликатов пар. */
214
+
215
+ listWalletExchangeRecentPairs(
216
+ request: ListWalletExchangeRecentPairsRequest,
217
+ ): Observable<ListWalletExchangeRecentPairsResponse>;
192
218
  }
193
219
 
194
220
  export interface UserServiceController {
@@ -229,6 +255,15 @@ export interface UserServiceController {
229
255
  | Promise<SubmitWalletCrmExchangeOrderResponse>
230
256
  | Observable<SubmitWalletCrmExchangeOrderResponse>
231
257
  | SubmitWalletCrmExchangeOrderResponse;
258
+
259
+ /** Уникальные валютные пары из последних заявок на обмен (по БД user-service), без дубликатов пар. */
260
+
261
+ listWalletExchangeRecentPairs(
262
+ request: ListWalletExchangeRecentPairsRequest,
263
+ ):
264
+ | Promise<ListWalletExchangeRecentPairsResponse>
265
+ | Observable<ListWalletExchangeRecentPairsResponse>
266
+ | ListWalletExchangeRecentPairsResponse;
232
267
  }
233
268
 
234
269
  export function UserServiceControllerMethods() {
@@ -242,6 +277,7 @@ export function UserServiceControllerMethods() {
242
277
  "getCrmSession",
243
278
  "crmExchangeHttp",
244
279
  "submitWalletCrmExchangeOrder",
280
+ "listWalletExchangeRecentPairs",
245
281
  ];
246
282
  for (const method of grpcMethods) {
247
283
  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.60",
4
+ "version": "1.0.63",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
@@ -10,10 +10,6 @@ service PayoutService {
10
10
  rpc ParsePromptPayQr(ParsePromptPayQrRequest) returns (ParsePromptPayQrResponse);
11
11
  rpc ConfirmPayoutPayment(ConfirmPayoutPaymentRequest) returns (ConfirmPayoutPaymentResponse);
12
12
  rpc HandlePayoutWebhook(HandlePayoutWebhookRequest) returns (HandlePayoutWebhookResponse);
13
- rpc ParseMusePayPromptPayQrTest(ParseMusePayPromptPayQrTestRequest) returns (ParseMusePayPromptPayQrTestResponse);
14
- rpc ParseMusePayPromptPayQr(ParseMusePayPromptPayQrRequest) returns (ParseMusePayPromptPayQrResponse);
15
- rpc ConfirmMusePayPayoutPayment(ConfirmMusePayPayoutPaymentRequest) returns (ConfirmMusePayPayoutPaymentResponse);
16
- rpc HandleMusePayWebhook(HandleMusePayWebhookRequest) returns (HandleMusePayWebhookResponse);
17
13
  rpc GetPayout(GetPayoutRequest) returns (GetPayoutResponse);
18
14
  }
19
15
 
@@ -25,94 +21,43 @@ message ParsePromptPayQrRequest {
25
21
 
26
22
  message ParsePromptPayQrResponse {
27
23
  int64 scan_id = 1;
28
- string quote_id = 2;
29
- string status = 3;
30
- string payload_json = 4;
24
+ string input_amount_to_pay = 2;
25
+ string input_currency_to_pay = 3;
26
+ string converted_amount_to_pay = 4;
27
+ string converted_currency_to_pay = 5;
28
+ double fee_percent = 6;
29
+ string fee_on_converted = 7;
30
+ string converted_amount_with_fee = 8;
31
31
  }
32
32
 
33
33
  message ConfirmPayoutPaymentRequest {
34
34
  int64 scan_id = 1;
35
- string quote_id = 2;
36
35
  string user_id = 3;
37
36
  }
38
37
 
39
38
  message ConfirmPayoutPaymentResponse {
40
39
  int64 payout_id = 1;
41
40
  string status = 2;
42
- string payload_json = 3;
43
41
  }
44
42
 
45
43
  message HandlePayoutWebhookRequest {
46
- string payload_json = 1;
44
+ bytes rawBody = 1;
47
45
  }
48
46
 
49
47
  message HandlePayoutWebhookResponse {
50
48
  bool ok = 1;
51
49
  }
52
50
 
53
- message ParseMusePayPromptPayQrTestRequest {
54
- string qr_string = 1;
55
- string user_id = 2;
56
- double amount = 3;
57
- }
58
-
59
- message ParseMusePayPromptPayQrTestResponse {
60
- int64 scan_id = 1;
61
- string quote_id = 2;
62
- string status = 3;
63
- string payload_json = 4;
64
- string input_amount_to_pay = 5;
65
- string input_currency_to_pay = 6;
66
- string converted_amount_to_pay = 7;
67
- string converted_currency_to_pay = 8;
68
- }
69
-
70
- message ParseMusePayPromptPayQrRequest {
71
- string qr_string = 1;
72
- string user_id = 2;
73
- double amount = 3;
74
- }
75
-
76
- message ParseMusePayPromptPayQrResponse {
77
- int64 scan_id = 1;
78
- string quote_id = 2;
79
- string status = 3;
80
- string payload_json = 4;
81
- string input_amount_to_pay = 5;
82
- string input_currency_to_pay = 6;
83
- string converted_amount_to_pay = 7;
84
- string converted_currency_to_pay = 8;
85
- }
86
-
87
- message ConfirmMusePayPayoutPaymentRequest {
88
- int64 scan_id = 1;
89
- string quote_id = 2;
90
- string user_id = 3;
91
- }
92
-
93
- message ConfirmMusePayPayoutPaymentResponse {
94
- int64 payout_id = 1;
95
- string status = 2;
96
- string payload_json = 3;
97
- }
98
-
99
- message HandleMusePayWebhookRequest {
100
- bytes rawBody = 1;
101
- }
102
-
103
- message HandleMusePayWebhookResponse {
104
- int64 payout_id = 1;
105
- string status = 2;
106
- bool handled = 3;
107
- }
108
-
109
51
  message GetPayoutRequest {
110
52
  int64 payout_id = 1;
111
- string user_id = 2;
112
53
  }
113
54
 
114
55
  message GetPayoutResponse {
115
56
  int64 payout_id = 1;
116
- string status = 2;
117
- string payload_json = 3;
57
+ int64 scan_id = 2;
58
+ string status = 3;
59
+ optional string final_converted_amount = 4;
60
+ optional string final_converted_currency = 5;
61
+ string created_at = 6;
62
+ optional string completed_at = 7;
118
63
  }
package/proto/user.proto CHANGED
@@ -14,6 +14,8 @@ service UserService {
14
14
  rpc CrmExchangeHttp (CrmExchangeHttpRequest) returns (CrmExchangeHttpResponse);
15
15
  // Создание/получение CRM-клиента по wallet_user_id и создание заявки на обмен (два шага к CRM внутри сервиса).
16
16
  rpc SubmitWalletCrmExchangeOrder (SubmitWalletCrmExchangeOrderRequest) returns (SubmitWalletCrmExchangeOrderResponse);
17
+ // Уникальные валютные пары из последних заявок на обмен (по БД user-service), без дубликатов пар.
18
+ rpc ListWalletExchangeRecentPairs (ListWalletExchangeRecentPairsRequest) returns (ListWalletExchangeRecentPairsResponse);
17
19
  }
18
20
 
19
21
  enum UserStatus {
@@ -136,6 +138,9 @@ message SubmitWalletCrmExchangeOrderRequest {
136
138
  int32 output_currency = 5;
137
139
  int32 withdraw_type = 6;
138
140
  optional int32 receive_bank = 7;
141
+ optional double exchange_rate_display = 8;
142
+ optional string send_currency_short = 9;
143
+ optional string receive_currency_short = 10;
139
144
  }
140
145
 
141
146
  message SubmitWalletCrmExchangeOrderResponse {
@@ -144,6 +149,23 @@ message SubmitWalletCrmExchangeOrderResponse {
144
149
  optional string message = 3;
145
150
  }
146
151
 
152
+ message ListWalletExchangeRecentPairsRequest {
153
+ int32 wallet_user_id = 1;
154
+ // По умолчанию 20, максимум обрезается на сервисе.
155
+ int32 limit = 2;
156
+ }
157
+
158
+ message WalletExchangeRecentPairItem {
159
+ string send_currency_short = 1;
160
+ string receive_currency_short = 2;
161
+ double last_input_amount = 3;
162
+ int64 last_submitted_at_unix_ms = 4;
163
+ }
164
+
165
+ message ListWalletExchangeRecentPairsResponse {
166
+ repeated WalletExchangeRecentPairItem pairs = 1;
167
+ }
168
+
147
169
  message UserBalance {
148
170
  string asset = 1;
149
171
  string network = 2;