@arbiwallet/contracts 1.0.56 → 1.0.58

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/card.ts CHANGED
@@ -64,6 +64,21 @@ export interface CreateCardRequest {
64
64
  autoTopAmount: string;
65
65
  autoTopupLimit: string;
66
66
  cardBalanceThreshold: string;
67
+ requiredAmount: string;
68
+ kycRequired: boolean;
69
+ kycApplicantJson: string;
70
+ kycResourcesJson: string;
71
+ kycVerifiedResources: KycVerifiedResource[];
72
+ }
73
+
74
+ export interface KycVerifiedResource {
75
+ imageId: string;
76
+ idDocType: string;
77
+ fileName: string;
78
+ fileType: string;
79
+ contentType: string;
80
+ contentLength: number;
81
+ fileData: Uint8Array;
67
82
  }
68
83
 
69
84
  export interface CreateCardsBatchRequest {
@@ -110,6 +125,34 @@ export interface GetTopupFeeResponse {
110
125
  amountToCard: string;
111
126
  }
112
127
 
128
+ export interface GetTopupDepositAddressRequest {
129
+ accountId: number;
130
+ cardId: number;
131
+ invoiceCurrency: string;
132
+ }
133
+
134
+ export interface GetTopupDepositAddressResponse {
135
+ cardId: number;
136
+ invoiceId: string;
137
+ address: string;
138
+ invoiceCurrency: string;
139
+ status: string;
140
+ }
141
+
142
+ export interface GetTopupInvoiceRequest {
143
+ accountId: number;
144
+ invoiceId: string;
145
+ }
146
+
147
+ export interface GetTopupInvoiceResponse {
148
+ invoiceId: string;
149
+ status: string;
150
+ address: string;
151
+ invoiceCurrency: string;
152
+ amount: string;
153
+ txHash: string;
154
+ }
155
+
113
156
  export interface UpdateAutoTopupRequest {
114
157
  accountId: number;
115
158
  cardId: number;
@@ -353,6 +396,10 @@ export interface CardServiceClient {
353
396
 
354
397
  getTopupFee(request: GetTopupFeeRequest): Observable<GetTopupFeeResponse>;
355
398
 
399
+ getTopupDepositAddress(request: GetTopupDepositAddressRequest): Observable<GetTopupDepositAddressResponse>;
400
+
401
+ getTopupInvoice(request: GetTopupInvoiceRequest): Observable<GetTopupInvoiceResponse>;
402
+
356
403
  updateAutoTopup(request: UpdateAutoTopupRequest): Observable<AutoTopupResponse>;
357
404
 
358
405
  getAutoTopup(request: GetAutoTopupRequest): Observable<AutoTopupResponse>;
@@ -407,6 +454,17 @@ export interface CardServiceController {
407
454
  request: GetTopupFeeRequest,
408
455
  ): Promise<GetTopupFeeResponse> | Observable<GetTopupFeeResponse> | GetTopupFeeResponse;
409
456
 
457
+ getTopupDepositAddress(
458
+ request: GetTopupDepositAddressRequest,
459
+ ):
460
+ | Promise<GetTopupDepositAddressResponse>
461
+ | Observable<GetTopupDepositAddressResponse>
462
+ | GetTopupDepositAddressResponse;
463
+
464
+ getTopupInvoice(
465
+ request: GetTopupInvoiceRequest,
466
+ ): Promise<GetTopupInvoiceResponse> | Observable<GetTopupInvoiceResponse> | GetTopupInvoiceResponse;
467
+
410
468
  updateAutoTopup(
411
469
  request: UpdateAutoTopupRequest,
412
470
  ): Promise<AutoTopupResponse> | Observable<AutoTopupResponse> | AutoTopupResponse;
@@ -477,6 +535,8 @@ export function CardServiceControllerMethods() {
477
535
  "createCardsBatch",
478
536
  "topupCard",
479
537
  "getTopupFee",
538
+ "getTopupDepositAddress",
539
+ "getTopupInvoice",
480
540
  "updateAutoTopup",
481
541
  "getAutoTopup",
482
542
  "listCards",
package/gen/user.ts CHANGED
@@ -105,6 +105,15 @@ export interface ResolveUserForTransferResponse {
105
105
  id: number;
106
106
  }
107
107
 
108
+ export interface GetCrmSessionRequest {
109
+ forceRefresh: boolean;
110
+ }
111
+
112
+ export interface GetCrmSessionResponse {
113
+ sessionId: string;
114
+ expiresAtUnix: number;
115
+ }
116
+
108
117
  export interface UserBalance {
109
118
  asset: string;
110
119
  network: string;
@@ -138,6 +147,10 @@ export interface UserServiceClient {
138
147
  /** Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода. */
139
148
 
140
149
  resolveUserForTransfer(request: ResolveUserForTransferRequest): Observable<ResolveUserForTransferResponse>;
150
+
151
+ /** CRM Arbi Exchange: логин сервисным аккаунтом (env), OTP из TOTP-секрета; session_id для X-Session-ID. */
152
+
153
+ getCrmSession(request: GetCrmSessionRequest): Observable<GetCrmSessionResponse>;
141
154
  }
142
155
 
143
156
  export interface UserServiceController {
@@ -157,11 +170,24 @@ export interface UserServiceController {
157
170
  | Promise<ResolveUserForTransferResponse>
158
171
  | Observable<ResolveUserForTransferResponse>
159
172
  | ResolveUserForTransferResponse;
173
+
174
+ /** CRM Arbi Exchange: логин сервисным аккаунтом (env), OTP из TOTP-секрета; session_id для X-Session-ID. */
175
+
176
+ getCrmSession(
177
+ request: GetCrmSessionRequest,
178
+ ): Promise<GetCrmSessionResponse> | Observable<GetCrmSessionResponse> | GetCrmSessionResponse;
160
179
  }
161
180
 
162
181
  export function UserServiceControllerMethods() {
163
182
  return function (constructor: Function) {
164
- const grpcMethods: string[] = ["getUser", "updateUser", "updateUserStatus", "listUsers", "resolveUserForTransfer"];
183
+ const grpcMethods: string[] = [
184
+ "getUser",
185
+ "updateUser",
186
+ "updateUserStatus",
187
+ "listUsers",
188
+ "resolveUserForTransfer",
189
+ "getCrmSession",
190
+ ];
165
191
  for (const method of grpcMethods) {
166
192
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
167
193
  GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
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.56",
4
+ "version": "1.0.58",
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/card.proto CHANGED
@@ -12,6 +12,8 @@ service CardService {
12
12
  rpc CreateCardsBatch(CreateCardsBatchRequest) returns (CreateCardsBatchResponse);
13
13
  rpc TopupCard(TopupCardRequest) returns (TopupCardResponse);
14
14
  rpc GetTopupFee(GetTopupFeeRequest) returns (GetTopupFeeResponse);
15
+ rpc GetTopupDepositAddress(GetTopupDepositAddressRequest) returns (GetTopupDepositAddressResponse);
16
+ rpc GetTopupInvoice(GetTopupInvoiceRequest) returns (GetTopupInvoiceResponse);
15
17
  rpc UpdateAutoTopup(UpdateAutoTopupRequest) returns (AutoTopupResponse);
16
18
  rpc GetAutoTopup(GetAutoTopupRequest) returns (AutoTopupResponse);
17
19
 
@@ -89,6 +91,21 @@ message CreateCardRequest {
89
91
  string auto_top_amount = 13;
90
92
  string auto_topup_limit = 14;
91
93
  string card_balance_threshold = 15;
94
+ string required_amount = 16;
95
+ bool kyc_required = 17;
96
+ string kyc_applicant_json = 18;
97
+ string kyc_resources_json = 19;
98
+ repeated KycVerifiedResource kyc_verified_resources = 20;
99
+ }
100
+
101
+ message KycVerifiedResource {
102
+ string image_id = 1;
103
+ string id_doc_type = 2;
104
+ string file_name = 3;
105
+ string file_type = 4;
106
+ string content_type = 5;
107
+ int64 content_length = 6;
108
+ bytes file_data = 7;
92
109
  }
93
110
 
94
111
  message CreateCardsBatchRequest {
@@ -135,6 +152,34 @@ message GetTopupFeeResponse {
135
152
  string amount_to_card = 7;
136
153
  }
137
154
 
155
+ message GetTopupDepositAddressRequest {
156
+ int64 account_id = 1;
157
+ int64 card_id = 2;
158
+ string invoice_currency = 3;
159
+ }
160
+
161
+ message GetTopupDepositAddressResponse {
162
+ int64 card_id = 1;
163
+ string invoice_id = 2;
164
+ string address = 3;
165
+ string invoice_currency = 4;
166
+ string status = 5;
167
+ }
168
+
169
+ message GetTopupInvoiceRequest {
170
+ int64 account_id = 1;
171
+ string invoice_id = 2;
172
+ }
173
+
174
+ message GetTopupInvoiceResponse {
175
+ string invoice_id = 1;
176
+ string status = 2;
177
+ string address = 3;
178
+ string invoice_currency = 4;
179
+ string amount = 5;
180
+ string tx_hash = 6;
181
+ }
182
+
138
183
  message UpdateAutoTopupRequest {
139
184
  int64 account_id = 1;
140
185
  int64 card_id = 2;
package/proto/user.proto CHANGED
@@ -8,6 +8,8 @@ service UserService {
8
8
  rpc ListUsers (ListUsersRequest) returns (ListUsersResponse);
9
9
  // Ровно одно из полей: user_id, email, phone, telegram_username → id получателя для внутреннего перевода.
10
10
  rpc ResolveUserForTransfer (ResolveUserForTransferRequest) returns (ResolveUserForTransferResponse);
11
+ // CRM Arbi Exchange: логин сервисным аккаунтом (env), OTP из TOTP-секрета; session_id для X-Session-ID.
12
+ rpc GetCrmSession (GetCrmSessionRequest) returns (GetCrmSessionResponse);
11
13
  }
12
14
 
13
15
  enum UserStatus {
@@ -101,6 +103,15 @@ message ResolveUserForTransferResponse {
101
103
  int32 id = 1;
102
104
  }
103
105
 
106
+ message GetCrmSessionRequest {
107
+ bool force_refresh = 1;
108
+ }
109
+
110
+ message GetCrmSessionResponse {
111
+ string session_id = 1;
112
+ int64 expires_at_unix = 2;
113
+ }
114
+
104
115
  message UserBalance {
105
116
  string asset = 1;
106
117
  string network = 2;