@arbiwallet/contracts 1.0.10 → 1.0.12
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/kyc.ts +144 -0
- package/package.json +1 -1
- package/proto/kyc.proto +92 -0
package/gen/kyc.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
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: kyc.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "kyc";
|
|
12
|
+
|
|
13
|
+
export enum KycStatus {
|
|
14
|
+
KYC_STATUS_UNSPECIFIED = 0,
|
|
15
|
+
KYC_STATUS_NOT_STARTED = 1,
|
|
16
|
+
KYC_STATUS_IN_PROGRESS = 2,
|
|
17
|
+
KYC_STATUS_PENDING_REVIEW = 3,
|
|
18
|
+
KYC_STATUS_APPROVED = 4,
|
|
19
|
+
KYC_STATUS_RETRY_REQUIRED = 5,
|
|
20
|
+
KYC_STATUS_REJECTED = 6,
|
|
21
|
+
UNRECOGNIZED = -1,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface StartVerificationRequest {
|
|
25
|
+
userId: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface StartVerificationResponse {
|
|
29
|
+
accessToken: string;
|
|
30
|
+
expiresInSec: number;
|
|
31
|
+
applicantId: string;
|
|
32
|
+
kycStatus: KycStatus;
|
|
33
|
+
userId: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface RefreshAccessTokenRequest {
|
|
37
|
+
userId: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface RefreshAccessTokenResponse {
|
|
41
|
+
accessToken: string;
|
|
42
|
+
expiresInSec: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GetVerificationStatusRequest {
|
|
46
|
+
userId: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface GetVerificationStatusResponse {
|
|
50
|
+
userId: string;
|
|
51
|
+
applicantId: string;
|
|
52
|
+
kycStatus: KycStatus;
|
|
53
|
+
reviewAnswer: string;
|
|
54
|
+
rejectionLabels: string[];
|
|
55
|
+
moderationComment: string;
|
|
56
|
+
createdAtMs: number;
|
|
57
|
+
updatedAtMs: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface WebhookReviewResultMessage {
|
|
61
|
+
reviewAnswer: string;
|
|
62
|
+
rejectLabels: string[];
|
|
63
|
+
reviewRejectType: string;
|
|
64
|
+
moderationComment: string;
|
|
65
|
+
clientComment: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface SumsubWebhookPayload {
|
|
69
|
+
applicantId: string;
|
|
70
|
+
externalUserId: string;
|
|
71
|
+
webhookType: string;
|
|
72
|
+
correlationId: string;
|
|
73
|
+
reviewStatus: string;
|
|
74
|
+
reviewResult: WebhookReviewResultMessage | undefined;
|
|
75
|
+
createdAtMs: number;
|
|
76
|
+
inspectionId: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface SumsubWebhookVerification {
|
|
80
|
+
payloadDigest: string;
|
|
81
|
+
payloadDigestAlg: string;
|
|
82
|
+
rawBody: Uint8Array;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface ApplySumsubWebhookRequest {
|
|
86
|
+
payload: SumsubWebhookPayload | undefined;
|
|
87
|
+
verification: SumsubWebhookVerification | undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface ApplySumsubWebhookResponse {
|
|
91
|
+
ok: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const KYC_PACKAGE_NAME = "kyc";
|
|
95
|
+
|
|
96
|
+
export interface KycVerificationClient {
|
|
97
|
+
startVerification(request: StartVerificationRequest): Observable<StartVerificationResponse>;
|
|
98
|
+
|
|
99
|
+
refreshAccessToken(request: RefreshAccessTokenRequest): Observable<RefreshAccessTokenResponse>;
|
|
100
|
+
|
|
101
|
+
getVerificationStatus(request: GetVerificationStatusRequest): Observable<GetVerificationStatusResponse>;
|
|
102
|
+
|
|
103
|
+
applySumsubWebhook(request: ApplySumsubWebhookRequest): Observable<ApplySumsubWebhookResponse>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface KycVerificationController {
|
|
107
|
+
startVerification(
|
|
108
|
+
request: StartVerificationRequest,
|
|
109
|
+
): Promise<StartVerificationResponse> | Observable<StartVerificationResponse> | StartVerificationResponse;
|
|
110
|
+
|
|
111
|
+
refreshAccessToken(
|
|
112
|
+
request: RefreshAccessTokenRequest,
|
|
113
|
+
): Promise<RefreshAccessTokenResponse> | Observable<RefreshAccessTokenResponse> | RefreshAccessTokenResponse;
|
|
114
|
+
|
|
115
|
+
getVerificationStatus(
|
|
116
|
+
request: GetVerificationStatusRequest,
|
|
117
|
+
): Promise<GetVerificationStatusResponse> | Observable<GetVerificationStatusResponse> | GetVerificationStatusResponse;
|
|
118
|
+
|
|
119
|
+
applySumsubWebhook(
|
|
120
|
+
request: ApplySumsubWebhookRequest,
|
|
121
|
+
): Promise<ApplySumsubWebhookResponse> | Observable<ApplySumsubWebhookResponse> | ApplySumsubWebhookResponse;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function KycVerificationControllerMethods() {
|
|
125
|
+
return function (constructor: Function) {
|
|
126
|
+
const grpcMethods: string[] = [
|
|
127
|
+
"startVerification",
|
|
128
|
+
"refreshAccessToken",
|
|
129
|
+
"getVerificationStatus",
|
|
130
|
+
"applySumsubWebhook",
|
|
131
|
+
];
|
|
132
|
+
for (const method of grpcMethods) {
|
|
133
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
134
|
+
GrpcMethod("KycVerification", method)(constructor.prototype[method], method, descriptor);
|
|
135
|
+
}
|
|
136
|
+
const grpcStreamMethods: string[] = [];
|
|
137
|
+
for (const method of grpcStreamMethods) {
|
|
138
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
139
|
+
GrpcStreamMethod("KycVerification", method)(constructor.prototype[method], method, descriptor);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const KYC_VERIFICATION_SERVICE_NAME = "KycVerification";
|
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.12",
|
|
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/kyc.proto
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package kyc;
|
|
4
|
+
|
|
5
|
+
service KycVerification {
|
|
6
|
+
rpc StartVerification (StartVerificationRequest) returns (StartVerificationResponse);
|
|
7
|
+
rpc RefreshAccessToken (RefreshAccessTokenRequest) returns (RefreshAccessTokenResponse);
|
|
8
|
+
rpc GetVerificationStatus (GetVerificationStatusRequest) returns (GetVerificationStatusResponse);
|
|
9
|
+
rpc ApplySumsubWebhook (ApplySumsubWebhookRequest) returns (ApplySumsubWebhookResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
enum KycStatus {
|
|
13
|
+
KYC_STATUS_UNSPECIFIED = 0;
|
|
14
|
+
KYC_STATUS_NOT_STARTED = 1;
|
|
15
|
+
KYC_STATUS_IN_PROGRESS = 2;
|
|
16
|
+
KYC_STATUS_PENDING_REVIEW = 3;
|
|
17
|
+
KYC_STATUS_APPROVED = 4;
|
|
18
|
+
KYC_STATUS_RETRY_REQUIRED = 5;
|
|
19
|
+
KYC_STATUS_REJECTED = 6;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message StartVerificationRequest {
|
|
23
|
+
string user_id = 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message StartVerificationResponse {
|
|
27
|
+
string access_token = 1;
|
|
28
|
+
int32 expires_in_sec = 2;
|
|
29
|
+
string applicant_id = 3;
|
|
30
|
+
KycStatus kyc_status = 4;
|
|
31
|
+
string user_id = 5;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message RefreshAccessTokenRequest {
|
|
35
|
+
string user_id = 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message RefreshAccessTokenResponse {
|
|
39
|
+
string access_token = 1;
|
|
40
|
+
int32 expires_in_sec = 2;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message GetVerificationStatusRequest {
|
|
44
|
+
string user_id = 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message GetVerificationStatusResponse {
|
|
48
|
+
string user_id = 1;
|
|
49
|
+
reserved 2;
|
|
50
|
+
reserved "external_user_id";
|
|
51
|
+
string applicant_id = 3;
|
|
52
|
+
KycStatus kyc_status = 4;
|
|
53
|
+
string review_answer = 5;
|
|
54
|
+
repeated string rejection_labels = 6;
|
|
55
|
+
string moderation_comment = 7;
|
|
56
|
+
int64 created_at_ms = 8;
|
|
57
|
+
int64 updated_at_ms = 9;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message WebhookReviewResultMessage {
|
|
61
|
+
string review_answer = 1;
|
|
62
|
+
repeated string reject_labels = 2;
|
|
63
|
+
string review_reject_type = 3;
|
|
64
|
+
string moderation_comment = 4;
|
|
65
|
+
string client_comment = 5;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message SumsubWebhookPayload {
|
|
69
|
+
string applicant_id = 1;
|
|
70
|
+
string external_user_id = 2;
|
|
71
|
+
string webhook_type = 3;
|
|
72
|
+
string correlation_id = 4;
|
|
73
|
+
string review_status = 5;
|
|
74
|
+
WebhookReviewResultMessage review_result = 6;
|
|
75
|
+
int64 created_at_ms = 7;
|
|
76
|
+
string inspection_id = 8;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message SumsubWebhookVerification {
|
|
80
|
+
string payload_digest = 1;
|
|
81
|
+
string payload_digest_alg = 2;
|
|
82
|
+
bytes raw_body = 3;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message ApplySumsubWebhookRequest {
|
|
86
|
+
SumsubWebhookPayload payload = 1;
|
|
87
|
+
SumsubWebhookVerification verification = 2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message ApplySumsubWebhookResponse {
|
|
91
|
+
bool ok = 1;
|
|
92
|
+
}
|