@arbiwallet/contracts 1.0.111 → 1.0.112
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 +19 -0
- package/gen/crm_gift_card.ts +99 -0
- package/package.json +1 -1
- package/proto/card.proto +13 -0
- package/proto/crm_gift_card.proto +54 -0
package/gen/card.ts
CHANGED
|
@@ -203,6 +203,18 @@ export interface ExecuteCreateWithLedgerResponse {
|
|
|
203
203
|
sufficientBalance: boolean;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
export interface ScanGiftCardQrRequest {
|
|
207
|
+
accountId: number;
|
|
208
|
+
uid: number;
|
|
209
|
+
bin: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface ScanGiftCardQrResponse {
|
|
213
|
+
success: boolean;
|
|
214
|
+
requiredAmount: string;
|
|
215
|
+
cardId: number;
|
|
216
|
+
}
|
|
217
|
+
|
|
206
218
|
export interface ListCardsRequest {
|
|
207
219
|
accountId: number;
|
|
208
220
|
}
|
|
@@ -428,6 +440,8 @@ export interface CardServiceClient {
|
|
|
428
440
|
|
|
429
441
|
executeCreateWithLedger(request: ExecuteCreateWithLedgerRequest): Observable<ExecuteCreateWithLedgerResponse>;
|
|
430
442
|
|
|
443
|
+
scanGiftCardQr(request: ScanGiftCardQrRequest): Observable<ScanGiftCardQrResponse>;
|
|
444
|
+
|
|
431
445
|
listCards(request: ListCardsRequest): Observable<ListCardsResponse>;
|
|
432
446
|
|
|
433
447
|
listCardsPaginated(request: ListCardsPaginatedRequest): Observable<ListCardsPaginatedResponse>;
|
|
@@ -496,6 +510,10 @@ export interface CardServiceController {
|
|
|
496
510
|
| Observable<ExecuteCreateWithLedgerResponse>
|
|
497
511
|
| ExecuteCreateWithLedgerResponse;
|
|
498
512
|
|
|
513
|
+
scanGiftCardQr(
|
|
514
|
+
request: ScanGiftCardQrRequest,
|
|
515
|
+
): Promise<ScanGiftCardQrResponse> | Observable<ScanGiftCardQrResponse> | ScanGiftCardQrResponse;
|
|
516
|
+
|
|
499
517
|
listCards(request: ListCardsRequest): Promise<ListCardsResponse> | Observable<ListCardsResponse> | ListCardsResponse;
|
|
500
518
|
|
|
501
519
|
listCardsPaginated(
|
|
@@ -561,6 +579,7 @@ export function CardServiceControllerMethods() {
|
|
|
561
579
|
"quoteTopupByTarget",
|
|
562
580
|
"executeTopupWithLedger",
|
|
563
581
|
"executeCreateWithLedger",
|
|
582
|
+
"scanGiftCardQr",
|
|
564
583
|
"listCards",
|
|
565
584
|
"listCardsPaginated",
|
|
566
585
|
"getCard",
|
|
@@ -0,0 +1,99 @@
|
|
|
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_gift_card.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "crm_gift_card";
|
|
12
|
+
|
|
13
|
+
export interface ScanGiftCardQrRequest {
|
|
14
|
+
qrPayload: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ScanGiftCardQrResponse {
|
|
18
|
+
success: boolean;
|
|
19
|
+
status: string;
|
|
20
|
+
error: string;
|
|
21
|
+
scanId: string;
|
|
22
|
+
userId: number;
|
|
23
|
+
uid: number;
|
|
24
|
+
cardBin: string;
|
|
25
|
+
cardId: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface GetGiftCardStatsRequest {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface GetGiftCardStatsResponse {
|
|
32
|
+
sumGiftedSpends: string;
|
|
33
|
+
countGifted: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ListGiftCardScansRequest {
|
|
37
|
+
page: number;
|
|
38
|
+
limit: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GiftCardScanItem {
|
|
42
|
+
id: string;
|
|
43
|
+
userId: number;
|
|
44
|
+
uid: number;
|
|
45
|
+
cardBin: string;
|
|
46
|
+
status: string;
|
|
47
|
+
error: string;
|
|
48
|
+
createdAtUnixMs: number;
|
|
49
|
+
finalizedAtUnixMs: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ListGiftCardScansResponse {
|
|
53
|
+
items: GiftCardScanItem[];
|
|
54
|
+
total: number;
|
|
55
|
+
page: number;
|
|
56
|
+
limit: number;
|
|
57
|
+
pages: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const CRM_GIFT_CARD_PACKAGE_NAME = "crm_gift_card";
|
|
61
|
+
|
|
62
|
+
export interface CrmGiftCardServiceClient {
|
|
63
|
+
scanGiftCardQr(request: ScanGiftCardQrRequest): Observable<ScanGiftCardQrResponse>;
|
|
64
|
+
|
|
65
|
+
getGiftCardStats(request: GetGiftCardStatsRequest): Observable<GetGiftCardStatsResponse>;
|
|
66
|
+
|
|
67
|
+
listGiftCardScans(request: ListGiftCardScansRequest): Observable<ListGiftCardScansResponse>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface CrmGiftCardServiceController {
|
|
71
|
+
scanGiftCardQr(
|
|
72
|
+
request: ScanGiftCardQrRequest,
|
|
73
|
+
): Promise<ScanGiftCardQrResponse> | Observable<ScanGiftCardQrResponse> | ScanGiftCardQrResponse;
|
|
74
|
+
|
|
75
|
+
getGiftCardStats(
|
|
76
|
+
request: GetGiftCardStatsRequest,
|
|
77
|
+
): Promise<GetGiftCardStatsResponse> | Observable<GetGiftCardStatsResponse> | GetGiftCardStatsResponse;
|
|
78
|
+
|
|
79
|
+
listGiftCardScans(
|
|
80
|
+
request: ListGiftCardScansRequest,
|
|
81
|
+
): Promise<ListGiftCardScansResponse> | Observable<ListGiftCardScansResponse> | ListGiftCardScansResponse;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function CrmGiftCardServiceControllerMethods() {
|
|
85
|
+
return function (constructor: Function) {
|
|
86
|
+
const grpcMethods: string[] = ["scanGiftCardQr", "getGiftCardStats", "listGiftCardScans"];
|
|
87
|
+
for (const method of grpcMethods) {
|
|
88
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
89
|
+
GrpcMethod("CrmGiftCardService", method)(constructor.prototype[method], method, descriptor);
|
|
90
|
+
}
|
|
91
|
+
const grpcStreamMethods: string[] = [];
|
|
92
|
+
for (const method of grpcStreamMethods) {
|
|
93
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
94
|
+
GrpcStreamMethod("CrmGiftCardService", method)(constructor.prototype[method], method, descriptor);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const CRM_GIFT_CARD_SERVICE_NAME = "CrmGiftCardService";
|
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.
|
|
4
|
+
"version": "1.0.112",
|
|
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
|
@@ -15,6 +15,7 @@ service CardService {
|
|
|
15
15
|
rpc QuoteTopupByTarget(QuoteTopupByTargetRequest) returns (QuoteTopupByTargetResponse);
|
|
16
16
|
rpc ExecuteTopupWithLedger(ExecuteTopupWithLedgerRequest) returns (ExecuteTopupWithLedgerResponse);
|
|
17
17
|
rpc ExecuteCreateWithLedger(ExecuteCreateWithLedgerRequest) returns (ExecuteCreateWithLedgerResponse);
|
|
18
|
+
rpc ScanGiftCardQr(ScanGiftCardQrRequest) returns (ScanGiftCardQrResponse);
|
|
18
19
|
|
|
19
20
|
rpc ListCards(ListCardsRequest) returns (ListCardsResponse);
|
|
20
21
|
rpc ListCardsPaginated(ListCardsPaginatedRequest) returns (ListCardsPaginatedResponse);
|
|
@@ -230,6 +231,18 @@ message ExecuteCreateWithLedgerResponse {
|
|
|
230
231
|
}
|
|
231
232
|
|
|
232
233
|
|
|
234
|
+
message ScanGiftCardQrRequest {
|
|
235
|
+
int64 account_id = 1;
|
|
236
|
+
int64 uid = 2;
|
|
237
|
+
string bin = 3;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
message ScanGiftCardQrResponse {
|
|
241
|
+
bool success = 1;
|
|
242
|
+
string required_amount = 2;
|
|
243
|
+
int64 card_id = 3;
|
|
244
|
+
}
|
|
245
|
+
|
|
233
246
|
message ListCardsRequest {
|
|
234
247
|
int64 account_id = 1;
|
|
235
248
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package crm_gift_card;
|
|
3
|
+
|
|
4
|
+
service CrmGiftCardService {
|
|
5
|
+
rpc ScanGiftCardQr (ScanGiftCardQrRequest) returns (ScanGiftCardQrResponse);
|
|
6
|
+
rpc GetGiftCardStats (GetGiftCardStatsRequest) returns (GetGiftCardStatsResponse);
|
|
7
|
+
rpc ListGiftCardScans (ListGiftCardScansRequest) returns (ListGiftCardScansResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message ScanGiftCardQrRequest {
|
|
11
|
+
string qr_payload = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message ScanGiftCardQrResponse {
|
|
15
|
+
bool success = 1;
|
|
16
|
+
string status = 2;
|
|
17
|
+
string error = 3;
|
|
18
|
+
string scan_id = 4;
|
|
19
|
+
int64 user_id = 5;
|
|
20
|
+
int64 uid = 6;
|
|
21
|
+
string card_bin = 7;
|
|
22
|
+
int64 card_id = 8;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message GetGiftCardStatsRequest {}
|
|
26
|
+
|
|
27
|
+
message GetGiftCardStatsResponse {
|
|
28
|
+
string sum_gifted_spends = 1;
|
|
29
|
+
int64 count_gifted = 2;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message ListGiftCardScansRequest {
|
|
33
|
+
int32 page = 1;
|
|
34
|
+
int32 limit = 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message GiftCardScanItem {
|
|
38
|
+
string id = 1;
|
|
39
|
+
int64 user_id = 2;
|
|
40
|
+
int64 uid = 3;
|
|
41
|
+
string card_bin = 4;
|
|
42
|
+
string status = 5;
|
|
43
|
+
string error = 6;
|
|
44
|
+
int64 created_at_unix_ms = 7;
|
|
45
|
+
int64 finalized_at_unix_ms = 8;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message ListGiftCardScansResponse {
|
|
49
|
+
repeated GiftCardScanItem items = 1;
|
|
50
|
+
int32 total = 2;
|
|
51
|
+
int32 page = 3;
|
|
52
|
+
int32 limit = 4;
|
|
53
|
+
int32 pages = 5;
|
|
54
|
+
}
|