@arbiwallet/contracts 1.0.203 → 1.0.204

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.
@@ -0,0 +1,203 @@
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: exchange_core.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { wrappers } from "protobufjs";
10
+ import { Observable } from "rxjs";
11
+ import { Struct } from "./google/protobuf/struct";
12
+
13
+ export const protobufPackage = "exchange_core";
14
+
15
+ export interface CreateExchangeOrderRequest {
16
+ inputAmount: number;
17
+ outputAmount: number;
18
+ inputCurrency: string;
19
+ outputCurrency: string;
20
+ withdrawType: string;
21
+ customer: string;
22
+ receiveBank?: string | undefined;
23
+ }
24
+
25
+ export interface CreateExchangeOrderResponse {
26
+ success: boolean;
27
+ statusCode: number;
28
+ orderId?: string | undefined;
29
+ message?: string | undefined;
30
+ warning?: string | undefined;
31
+ error?: string | undefined;
32
+ errors: string[];
33
+ }
34
+
35
+ export interface CreateExchangePaymentRequest {
36
+ managerUserId?: string | undefined;
37
+ managerId?: string | undefined;
38
+ calculationId?: string | undefined;
39
+ agentId: number;
40
+ amount?: number | undefined;
41
+ customerId?: string | undefined;
42
+ cryptoNetwork?: string | undefined;
43
+ customerSource?: string | undefined;
44
+ customerReferrer?: string | undefined;
45
+ }
46
+
47
+ export interface CreateExchangePaymentResult {
48
+ paymentId: string;
49
+ paymentUuid: string;
50
+ amount: number;
51
+ status: number;
52
+ agent: string;
53
+ walletId?: string | undefined;
54
+ cryptoNetwork?: string | undefined;
55
+ cryptoAddress?: string | undefined;
56
+ arbiLink?: string | undefined;
57
+ paymentLink?: string | undefined;
58
+ }
59
+
60
+ export interface CreateExchangePaymentResponse {
61
+ ok: boolean;
62
+ result?: CreateExchangePaymentResult | undefined;
63
+ error?: string | undefined;
64
+ validationErrors?: { [key: string]: any } | undefined;
65
+ }
66
+
67
+ export interface HandlePaymentWebhookRequest {
68
+ jsonPayload: string;
69
+ }
70
+
71
+ export interface HandlePaymentWebhookResponse {
72
+ ok: boolean;
73
+ status: string;
74
+ }
75
+
76
+ export interface GetExchangePaymentsRequest {
77
+ page?: number | undefined;
78
+ limit?: number | undefined;
79
+ }
80
+
81
+ export interface GetExchangePaymentsItem {
82
+ paymentId: string;
83
+ paymentUuid: string;
84
+ amount: number;
85
+ status: number;
86
+ paymentAgentStatus?: string | undefined;
87
+ paymentLink?: string | undefined;
88
+ qrLink?: string | undefined;
89
+ cryptoAddress?: string | undefined;
90
+ }
91
+
92
+ export interface GetExchangePaymentsResponse {
93
+ payments: GetExchangePaymentsItem[];
94
+ page: number;
95
+ limit: number;
96
+ total: number;
97
+ totalPages: number;
98
+ }
99
+
100
+ export interface CreateExchangeDealRequest {
101
+ managerUserId?: string | undefined;
102
+ managerId?: string | undefined;
103
+ calculationId?: string | undefined;
104
+ paymentId?: string | undefined;
105
+ methodId: string;
106
+ inputWalletId: string;
107
+ outputWalletId: string;
108
+ inputAmount?: number | undefined;
109
+ outputAmount?: number | undefined;
110
+ factOutputAmount?: number | undefined;
111
+ inputCurrencyId?: string | undefined;
112
+ outputCurrencyId?: string | undefined;
113
+ customerId?: string | undefined;
114
+ expensesForCourier?: number | undefined;
115
+ includeInTotalCalculation?: boolean | undefined;
116
+ oneCurrencyExchange?: boolean | undefined;
117
+ receivedFromDealer?: boolean | undefined;
118
+ receivedFromDealerWalletId?: string | undefined;
119
+ customerDocName?: string | undefined;
120
+ customerDocNationality?: string | undefined;
121
+ customerDocNumber?: string | undefined;
122
+ customerSource?: string | undefined;
123
+ customerReferrer?: string | undefined;
124
+ receipts: number[];
125
+ }
126
+
127
+ export interface CreateExchangeDealResult {
128
+ exchangeId: string;
129
+ customerId: string;
130
+ inputAmount: number;
131
+ inputCurrencyId: string;
132
+ outputAmount: number;
133
+ outputCurrencyId: string;
134
+ status: string;
135
+ }
136
+
137
+ export interface CreateExchangeDealResponse {
138
+ ok: boolean;
139
+ result?: CreateExchangeDealResult | undefined;
140
+ error?: string | undefined;
141
+ validationErrors?: { [key: string]: any } | undefined;
142
+ }
143
+
144
+ export const EXCHANGE_CORE_PACKAGE_NAME = "exchange_core";
145
+
146
+ wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
147
+
148
+ export interface ExchangeCoreServiceClient {
149
+ createExchangeOrder(request: CreateExchangeOrderRequest): Observable<CreateExchangeOrderResponse>;
150
+
151
+ createExchangePayment(request: CreateExchangePaymentRequest): Observable<CreateExchangePaymentResponse>;
152
+
153
+ handlePaymentWebhook(request: HandlePaymentWebhookRequest): Observable<HandlePaymentWebhookResponse>;
154
+
155
+ getExchangePayments(request: GetExchangePaymentsRequest): Observable<GetExchangePaymentsResponse>;
156
+
157
+ createExchangeDeal(request: CreateExchangeDealRequest): Observable<CreateExchangeDealResponse>;
158
+ }
159
+
160
+ export interface ExchangeCoreServiceController {
161
+ createExchangeOrder(
162
+ request: CreateExchangeOrderRequest,
163
+ ): Promise<CreateExchangeOrderResponse> | Observable<CreateExchangeOrderResponse> | CreateExchangeOrderResponse;
164
+
165
+ createExchangePayment(
166
+ request: CreateExchangePaymentRequest,
167
+ ): Promise<CreateExchangePaymentResponse> | Observable<CreateExchangePaymentResponse> | CreateExchangePaymentResponse;
168
+
169
+ handlePaymentWebhook(
170
+ request: HandlePaymentWebhookRequest,
171
+ ): Promise<HandlePaymentWebhookResponse> | Observable<HandlePaymentWebhookResponse> | HandlePaymentWebhookResponse;
172
+
173
+ getExchangePayments(
174
+ request: GetExchangePaymentsRequest,
175
+ ): Promise<GetExchangePaymentsResponse> | Observable<GetExchangePaymentsResponse> | GetExchangePaymentsResponse;
176
+
177
+ createExchangeDeal(
178
+ request: CreateExchangeDealRequest,
179
+ ): Promise<CreateExchangeDealResponse> | Observable<CreateExchangeDealResponse> | CreateExchangeDealResponse;
180
+ }
181
+
182
+ export function ExchangeCoreServiceControllerMethods() {
183
+ return function (constructor: Function) {
184
+ const grpcMethods: string[] = [
185
+ "createExchangeOrder",
186
+ "createExchangePayment",
187
+ "handlePaymentWebhook",
188
+ "getExchangePayments",
189
+ "createExchangeDeal",
190
+ ];
191
+ for (const method of grpcMethods) {
192
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
193
+ GrpcMethod("ExchangeCoreService", method)(constructor.prototype[method], method, descriptor);
194
+ }
195
+ const grpcStreamMethods: string[] = [];
196
+ for (const method of grpcStreamMethods) {
197
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
198
+ GrpcStreamMethod("ExchangeCoreService", method)(constructor.prototype[method], method, descriptor);
199
+ }
200
+ };
201
+ }
202
+
203
+ export const EXCHANGE_CORE_SERVICE_NAME = "ExchangeCoreService";
@@ -72,20 +72,16 @@ export interface ExchangeCalculation {
72
72
  }
73
73
 
74
74
  export interface GetExchangeCalculationResponse {
75
- ok: boolean;
76
- calculation?: ExchangeCalculation | undefined;
77
- error?: string | undefined;
78
- validationErrors?: { [key: string]: any } | undefined;
75
+ exist: boolean;
76
+ result?: ExchangeCalculation | undefined;
79
77
  }
80
78
 
81
79
  export interface GetExchangeRatesRequest {
82
80
  }
83
81
 
84
82
  export interface GetExchangeRatesResponse {
85
- ok: boolean;
83
+ exist: boolean;
86
84
  result?: string | undefined;
87
- error?: string | undefined;
88
- validationErrors?: { [key: string]: any } | undefined;
89
85
  }
90
86
 
91
87
  export const EXCHANGE_RATES_PACKAGE_NAME = "exchange_rates";
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.203",
4
+ "version": "1.0.204",
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,158 @@
1
+ syntax = "proto3";
2
+
3
+ package exchange_core;
4
+
5
+ import "google/protobuf/struct.proto";
6
+
7
+ option csharp_namespace = "ExchangeCore";
8
+ option java_multiple_files = true;
9
+ option java_package = "com.arbiwallet.exchange.core";
10
+
11
+ service ExchangeCoreService {
12
+ rpc CreateExchangeOrder(CreateExchangeOrderRequest) returns (CreateExchangeOrderResponse);
13
+
14
+ rpc CreateExchangePayment(CreateExchangePaymentRequest) returns (CreateExchangePaymentResponse);
15
+ rpc HandlePaymentWebhook(HandlePaymentWebhookRequest) returns (HandlePaymentWebhookResponse);
16
+ rpc GetExchangePayments(GetExchangePaymentsRequest) returns (GetExchangePaymentsResponse);
17
+
18
+ rpc CreateExchangeDeal(CreateExchangeDealRequest) returns (CreateExchangeDealResponse);
19
+ }
20
+
21
+ message CreateExchangeOrderRequest {
22
+ double input_amount = 1;
23
+ double output_amount = 2;
24
+ string input_currency = 3;
25
+ string output_currency = 4;
26
+ string withdraw_type = 5;
27
+ string customer = 6;
28
+ optional string receive_bank = 7;
29
+ }
30
+
31
+ message CreateExchangeOrderResponse {
32
+ bool success = 1;
33
+ int32 status_code = 2;
34
+ optional string order_id = 3;
35
+ optional string message = 4;
36
+ optional string warning = 5;
37
+ optional string error = 6;
38
+ repeated string errors = 7;
39
+ }
40
+
41
+ message CreateExchangePaymentRequest {
42
+ optional string manager_user_id = 1;
43
+ optional string manager_id = 2;
44
+
45
+ optional string calculation_id = 3;
46
+ int32 agent_id = 4;
47
+ optional double amount = 5;
48
+ optional string customer_id = 6;
49
+ optional string crypto_network = 7;
50
+ optional string customer_source = 8;
51
+ optional string customer_referrer = 9;
52
+ }
53
+
54
+ message CreateExchangePaymentResult {
55
+ string payment_id = 1;
56
+ string payment_uuid = 2;
57
+ double amount = 3;
58
+ int32 status = 4;
59
+ string agent = 5;
60
+ optional string wallet_id = 6;
61
+ optional string crypto_network = 7;
62
+ optional string crypto_address = 8;
63
+ optional string arbi_link = 9;
64
+ optional string payment_link = 10;
65
+ }
66
+
67
+ message CreateExchangePaymentResponse {
68
+ bool ok = 1;
69
+ optional CreateExchangePaymentResult result = 2;
70
+ optional string error = 3;
71
+ optional google.protobuf.Struct validationErrors = 4;
72
+ }
73
+
74
+ message HandlePaymentWebhookRequest {
75
+ string json_payload = 1;
76
+ }
77
+
78
+ message HandlePaymentWebhookResponse {
79
+ bool ok = 1;
80
+ string status = 2;
81
+ }
82
+
83
+ message GetExchangePaymentsRequest {
84
+ optional int32 page = 1;
85
+ optional int32 limit = 2;
86
+ }
87
+
88
+ message GetExchangePaymentsItem {
89
+ string payment_id = 1;
90
+ string payment_uuid = 2;
91
+ double amount = 3;
92
+ int32 status = 4;
93
+ optional string payment_agent_status = 5;
94
+ optional string payment_link = 6;
95
+ optional string qr_link = 7;
96
+ optional string crypto_address = 8;
97
+ }
98
+
99
+ message GetExchangePaymentsResponse {
100
+ repeated GetExchangePaymentsItem payments = 1;
101
+ int32 page = 2;
102
+ int32 limit = 3;
103
+ int32 total = 4;
104
+ int32 total_pages = 5;
105
+ }
106
+
107
+ message CreateExchangeDealRequest {
108
+ optional string manager_user_id = 1;
109
+ optional string manager_id = 2;
110
+
111
+ optional string calculation_id = 3;
112
+ optional string payment_id = 4;
113
+
114
+ string method_id = 5;
115
+ string input_wallet_id = 6;
116
+ string output_wallet_id = 7;
117
+
118
+ optional double input_amount = 8;
119
+ optional double output_amount = 9;
120
+ optional double fact_output_amount = 10;
121
+
122
+ optional string input_currency_id = 11;
123
+ optional string output_currency_id = 12;
124
+
125
+ optional string customer_id = 13;
126
+
127
+ optional double expenses_for_courier = 14;
128
+ optional bool include_in_total_calculation = 15;
129
+ optional bool one_currency_exchange = 16;
130
+ optional bool received_from_dealer = 17;
131
+ optional string received_from_dealer_wallet_id = 18;
132
+
133
+ optional string customer_doc_name = 19;
134
+ optional string customer_doc_nationality = 20;
135
+ optional string customer_doc_number = 21;
136
+
137
+ optional string customer_source = 22;
138
+ optional string customer_referrer = 23;
139
+
140
+ repeated double receipts = 25;
141
+ }
142
+
143
+ message CreateExchangeDealResult {
144
+ string exchange_id = 1;
145
+ string customer_id = 2;
146
+ double input_amount = 3;
147
+ string input_currency_id = 4;
148
+ double output_amount = 5;
149
+ string output_currency_id = 6;
150
+ string status = 7;
151
+ }
152
+
153
+ message CreateExchangeDealResponse {
154
+ bool ok = 1;
155
+ optional CreateExchangeDealResult result = 2;
156
+ optional string error = 3;
157
+ optional google.protobuf.Struct validationErrors = 4;
158
+ }
@@ -75,17 +75,13 @@ message ExchangeCalculation {
75
75
  }
76
76
 
77
77
  message GetExchangeCalculationResponse {
78
- bool ok = 1;
79
- optional ExchangeCalculation calculation = 2;
80
- optional string error = 3;
81
- optional google.protobuf.Struct validationErrors = 4;
78
+ bool exist = 1;
79
+ optional ExchangeCalculation result = 2;
82
80
  }
83
81
 
84
82
  message GetExchangeRatesRequest {}
85
83
 
86
84
  message GetExchangeRatesResponse {
87
- bool ok = 1;
85
+ bool exist = 1;
88
86
  optional string result = 2;
89
- optional string error = 3;
90
- optional google.protobuf.Struct validationErrors = 4;
91
87
  }