@arbiwallet/contracts 1.0.106 → 1.0.108

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
@@ -125,6 +125,51 @@ export interface GetTopupFeeResponse {
125
125
  amountToCard: string;
126
126
  }
127
127
 
128
+ export interface QuoteTopupByTargetRequest {
129
+ accountId: number;
130
+ cardId: number;
131
+ targetAmount: string;
132
+ targetCurrency: string;
133
+ cardCryptoCurrency: string;
134
+ }
135
+
136
+ export interface QuoteTopupByTargetResponse {
137
+ targetAmount: string;
138
+ targetCurrency: string;
139
+ inputUsdt: string;
140
+ feeUsdt: string;
141
+ requiredDebitUsdt: string;
142
+ amountToCard: string;
143
+ cardCurrency: string;
144
+ cardCryptoCurrency: string;
145
+ }
146
+
147
+ export interface ExecuteTopupWithLedgerRequest {
148
+ accountId: number;
149
+ cardId: number;
150
+ inputUsdt: string;
151
+ cardCryptoCurrency: string;
152
+ otpCode: string;
153
+ idempotencySeed: string;
154
+ skipBalanceCheck: boolean;
155
+ previewOnly: boolean;
156
+ }
157
+
158
+ export interface ExecuteTopupWithLedgerResponse {
159
+ status: string;
160
+ flow: string;
161
+ cardId: number;
162
+ targetCardAmount: string;
163
+ targetCardCurrency: string;
164
+ actualCardAmount: string;
165
+ actualCardCurrency: string;
166
+ inputAmount: string;
167
+ feeAmount: string;
168
+ requiredDebitAmount: string;
169
+ cardCryptoCurrency: string;
170
+ message: string;
171
+ }
172
+
128
173
  export interface ListCardsRequest {
129
174
  accountId: number;
130
175
  }
@@ -344,6 +389,10 @@ export interface CardServiceClient {
344
389
 
345
390
  getTopupFee(request: GetTopupFeeRequest): Observable<GetTopupFeeResponse>;
346
391
 
392
+ quoteTopupByTarget(request: QuoteTopupByTargetRequest): Observable<QuoteTopupByTargetResponse>;
393
+
394
+ executeTopupWithLedger(request: ExecuteTopupWithLedgerRequest): Observable<ExecuteTopupWithLedgerResponse>;
395
+
347
396
  listCards(request: ListCardsRequest): Observable<ListCardsResponse>;
348
397
 
349
398
  listCardsPaginated(request: ListCardsPaginatedRequest): Observable<ListCardsPaginatedResponse>;
@@ -394,6 +443,17 @@ export interface CardServiceController {
394
443
  request: GetTopupFeeRequest,
395
444
  ): Promise<GetTopupFeeResponse> | Observable<GetTopupFeeResponse> | GetTopupFeeResponse;
396
445
 
446
+ quoteTopupByTarget(
447
+ request: QuoteTopupByTargetRequest,
448
+ ): Promise<QuoteTopupByTargetResponse> | Observable<QuoteTopupByTargetResponse> | QuoteTopupByTargetResponse;
449
+
450
+ executeTopupWithLedger(
451
+ request: ExecuteTopupWithLedgerRequest,
452
+ ):
453
+ | Promise<ExecuteTopupWithLedgerResponse>
454
+ | Observable<ExecuteTopupWithLedgerResponse>
455
+ | ExecuteTopupWithLedgerResponse;
456
+
397
457
  listCards(request: ListCardsRequest): Promise<ListCardsResponse> | Observable<ListCardsResponse> | ListCardsResponse;
398
458
 
399
459
  listCardsPaginated(
@@ -456,6 +516,8 @@ export function CardServiceControllerMethods() {
456
516
  "createCardsBatch",
457
517
  "topupCard",
458
518
  "getTopupFee",
519
+ "quoteTopupByTarget",
520
+ "executeTopupWithLedger",
459
521
  "listCards",
460
522
  "listCardsPaginated",
461
523
  "getCard",
@@ -0,0 +1,131 @@
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: crm_auth.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "crm_auth";
12
+
13
+ export enum CrmManagerStatus {
14
+ CRM_MANAGER_STATUS_UNSPECIFIED = 0,
15
+ CRM_MANAGER_STATUS_ACTIVE = 1,
16
+ CRM_MANAGER_STATUS_DISABLED = 2,
17
+ UNRECOGNIZED = -1,
18
+ }
19
+
20
+ export interface CrmLoginRequest {
21
+ email: string;
22
+ otp: string;
23
+ userAgent: string;
24
+ ipAddress: string;
25
+ }
26
+
27
+ export interface CrmRefreshSessionRequest {
28
+ refreshToken: string;
29
+ userAgent: string;
30
+ ipAddress: string;
31
+ }
32
+
33
+ export interface CrmRevokeSessionRequest {
34
+ refreshToken: string;
35
+ }
36
+
37
+ export interface CrmRevokeSessionResponse {
38
+ success: boolean;
39
+ sessionId: string;
40
+ managerId: string;
41
+ reason: string;
42
+ }
43
+
44
+ export interface CrmValidateAccessRequest {
45
+ authorization: string;
46
+ }
47
+
48
+ export interface CrmValidateAccessResponse {
49
+ allowed: boolean;
50
+ managerId: string;
51
+ reason: string;
52
+ }
53
+
54
+ export interface CrmGetMeRequest {
55
+ accessToken: string;
56
+ }
57
+
58
+ export interface CrmManagerResponse {
59
+ id: string;
60
+ email: string;
61
+ username: string;
62
+ firstName: string;
63
+ lastName: string;
64
+ displayName: string;
65
+ avatarUrl: string;
66
+ status: CrmManagerStatus;
67
+ createdAtUnixMs: number;
68
+ }
69
+
70
+ export interface CrmAuthSessionResponse {
71
+ success: boolean;
72
+ accessToken: string;
73
+ accessExpiresAtUnixMs: number;
74
+ refreshToken: string;
75
+ refreshExpiresAtUnixMs: number;
76
+ sessionId: string;
77
+ managerId: string;
78
+ reason: string;
79
+ manager: CrmManagerResponse | undefined;
80
+ }
81
+
82
+ export const CRM_AUTH_PACKAGE_NAME = "crm_auth";
83
+
84
+ export interface CrmAuthServiceClient {
85
+ login(request: CrmLoginRequest): Observable<CrmAuthSessionResponse>;
86
+
87
+ refreshSession(request: CrmRefreshSessionRequest): Observable<CrmAuthSessionResponse>;
88
+
89
+ revokeSession(request: CrmRevokeSessionRequest): Observable<CrmRevokeSessionResponse>;
90
+
91
+ validateAccess(request: CrmValidateAccessRequest): Observable<CrmValidateAccessResponse>;
92
+
93
+ getMe(request: CrmGetMeRequest): Observable<CrmManagerResponse>;
94
+ }
95
+
96
+ export interface CrmAuthServiceController {
97
+ login(
98
+ request: CrmLoginRequest,
99
+ ): Promise<CrmAuthSessionResponse> | Observable<CrmAuthSessionResponse> | CrmAuthSessionResponse;
100
+
101
+ refreshSession(
102
+ request: CrmRefreshSessionRequest,
103
+ ): Promise<CrmAuthSessionResponse> | Observable<CrmAuthSessionResponse> | CrmAuthSessionResponse;
104
+
105
+ revokeSession(
106
+ request: CrmRevokeSessionRequest,
107
+ ): Promise<CrmRevokeSessionResponse> | Observable<CrmRevokeSessionResponse> | CrmRevokeSessionResponse;
108
+
109
+ validateAccess(
110
+ request: CrmValidateAccessRequest,
111
+ ): Promise<CrmValidateAccessResponse> | Observable<CrmValidateAccessResponse> | CrmValidateAccessResponse;
112
+
113
+ getMe(request: CrmGetMeRequest): Promise<CrmManagerResponse> | Observable<CrmManagerResponse> | CrmManagerResponse;
114
+ }
115
+
116
+ export function CrmAuthServiceControllerMethods() {
117
+ return function (constructor: Function) {
118
+ const grpcMethods: string[] = ["login", "refreshSession", "revokeSession", "validateAccess", "getMe"];
119
+ for (const method of grpcMethods) {
120
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
121
+ GrpcMethod("CrmAuthService", method)(constructor.prototype[method], method, descriptor);
122
+ }
123
+ const grpcStreamMethods: string[] = [];
124
+ for (const method of grpcStreamMethods) {
125
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
126
+ GrpcStreamMethod("CrmAuthService", method)(constructor.prototype[method], method, descriptor);
127
+ }
128
+ };
129
+ }
130
+
131
+ export const CRM_AUTH_SERVICE_NAME = "CrmAuthService";
package/gen/deposit.ts CHANGED
@@ -37,7 +37,15 @@ export interface CreatePaymentDillDepositRequest {
37
37
  | string
38
38
  | undefined;
39
39
  /** Сеть баланса в Ledger (по умолчанию TRON) */
40
- creditNetwork?: string | undefined;
40
+ creditNetwork?:
41
+ | string
42
+ | undefined;
43
+ /** WALLET_TOPUP | CARD_TOPUP */
44
+ purpose?:
45
+ | string
46
+ | undefined;
47
+ /** JSON payload for downstream orchestration (e.g. card top-up). */
48
+ purposePayloadJson?: string | undefined;
41
49
  }
42
50
 
43
51
  export interface CreatePaymentDillDepositResponse {
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.106",
4
+ "version": "1.0.108",
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 QuoteTopupByTarget(QuoteTopupByTargetRequest) returns (QuoteTopupByTargetResponse);
16
+ rpc ExecuteTopupWithLedger(ExecuteTopupWithLedgerRequest) returns (ExecuteTopupWithLedgerResponse);
15
17
 
16
18
  rpc ListCards(ListCardsRequest) returns (ListCardsResponse);
17
19
  rpc ListCardsPaginated(ListCardsPaginatedRequest) returns (ListCardsPaginatedResponse);
@@ -148,6 +150,51 @@ message GetTopupFeeResponse {
148
150
  string amount_to_card = 7;
149
151
  }
150
152
 
153
+ message QuoteTopupByTargetRequest {
154
+ int64 account_id = 1;
155
+ int64 card_id = 2;
156
+ string target_amount = 3;
157
+ string target_currency = 4;
158
+ string card_crypto_currency = 5;
159
+ }
160
+
161
+ message QuoteTopupByTargetResponse {
162
+ string target_amount = 1;
163
+ string target_currency = 2;
164
+ string input_usdt = 3;
165
+ string fee_usdt = 4;
166
+ string required_debit_usdt = 5;
167
+ string amount_to_card = 6;
168
+ string card_currency = 7;
169
+ string card_crypto_currency = 8;
170
+ }
171
+
172
+ message ExecuteTopupWithLedgerRequest {
173
+ int64 account_id = 1;
174
+ int64 card_id = 2;
175
+ string input_usdt = 3;
176
+ string card_crypto_currency = 4;
177
+ string otp_code = 5;
178
+ string idempotency_seed = 6;
179
+ bool skip_balance_check = 7;
180
+ bool preview_only = 8;
181
+ }
182
+
183
+ message ExecuteTopupWithLedgerResponse {
184
+ string status = 1;
185
+ string flow = 2;
186
+ int64 card_id = 3;
187
+ string target_card_amount = 4;
188
+ string target_card_currency = 5;
189
+ string actual_card_amount = 6;
190
+ string actual_card_currency = 7;
191
+ string input_amount = 8;
192
+ string fee_amount = 9;
193
+ string required_debit_amount = 10;
194
+ string card_crypto_currency = 11;
195
+ string message = 12;
196
+ }
197
+
151
198
 
152
199
  message ListCardsRequest {
153
200
  int64 account_id = 1;
@@ -0,0 +1,78 @@
1
+ syntax = "proto3";
2
+ package crm_auth;
3
+
4
+ service CrmAuthService {
5
+ rpc Login (CrmLoginRequest) returns (CrmAuthSessionResponse);
6
+ rpc RefreshSession (CrmRefreshSessionRequest) returns (CrmAuthSessionResponse);
7
+ rpc RevokeSession (CrmRevokeSessionRequest) returns (CrmRevokeSessionResponse);
8
+ rpc ValidateAccess (CrmValidateAccessRequest) returns (CrmValidateAccessResponse);
9
+ rpc GetMe (CrmGetMeRequest) returns (CrmManagerResponse);
10
+ }
11
+
12
+ enum CrmManagerStatus {
13
+ CRM_MANAGER_STATUS_UNSPECIFIED = 0;
14
+ CRM_MANAGER_STATUS_ACTIVE = 1;
15
+ CRM_MANAGER_STATUS_DISABLED = 2;
16
+ }
17
+
18
+ message CrmLoginRequest {
19
+ string email = 1;
20
+ string otp = 2;
21
+ string user_agent = 3;
22
+ string ip_address = 4;
23
+ }
24
+
25
+ message CrmRefreshSessionRequest {
26
+ string refresh_token = 1;
27
+ string user_agent = 2;
28
+ string ip_address = 3;
29
+ }
30
+
31
+ message CrmRevokeSessionRequest {
32
+ string refresh_token = 1;
33
+ }
34
+
35
+ message CrmRevokeSessionResponse {
36
+ bool success = 1;
37
+ string session_id = 2;
38
+ string manager_id = 3;
39
+ string reason = 4;
40
+ }
41
+
42
+ message CrmValidateAccessRequest {
43
+ string authorization = 1;
44
+ }
45
+
46
+ message CrmValidateAccessResponse {
47
+ bool allowed = 1;
48
+ string manager_id = 2;
49
+ string reason = 3;
50
+ }
51
+
52
+ message CrmGetMeRequest {
53
+ string access_token = 1;
54
+ }
55
+
56
+ message CrmManagerResponse {
57
+ string id = 1;
58
+ string email = 2;
59
+ string username = 3;
60
+ string first_name = 4;
61
+ string last_name = 5;
62
+ string display_name = 6;
63
+ string avatar_url = 7;
64
+ CrmManagerStatus status = 8;
65
+ int64 created_at_unix_ms = 9;
66
+ }
67
+
68
+ message CrmAuthSessionResponse {
69
+ bool success = 1;
70
+ string access_token = 2;
71
+ int64 access_expires_at_unix_ms = 3;
72
+ string refresh_token = 4;
73
+ int64 refresh_expires_at_unix_ms = 5;
74
+ string session_id = 6;
75
+ string manager_id = 7;
76
+ string reason = 8;
77
+ CrmManagerResponse manager = 9;
78
+ }
@@ -42,6 +42,10 @@ message CreatePaymentDillDepositRequest {
42
42
  optional string credit_asset = 4;
43
43
  /** Сеть баланса в Ledger (по умолчанию TRON) */
44
44
  optional string credit_network = 5;
45
+ /** WALLET_TOPUP | CARD_TOPUP */
46
+ optional string purpose = 6;
47
+ /** JSON payload for downstream orchestration (e.g. card top-up). */
48
+ optional string purpose_payload_json = 7;
45
49
  }
46
50
 
47
51
  message CreatePaymentDillDepositResponse {