@pulsar.money/atlas-sdk 0.1.2 → 0.2.1
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/dist/modules/profiles/dto/update-profile.dto.d.ts +0 -2
- package/dist/modules/profiles/dto/update-profile.dto.js +5 -13
- package/dist/modules/profiles/dto/update-profile.dto.js.map +1 -1
- package/dist/modules/profiles/profiles.controller.d.ts +3 -0
- package/dist/modules/profiles/profiles.controller.js +35 -1
- package/dist/modules/profiles/profiles.controller.js.map +1 -1
- package/dist/modules/profiles/profiles.service.d.ts +5 -2
- package/dist/modules/profiles/profiles.service.js +45 -6
- package/dist/modules/profiles/profiles.service.js.map +1 -1
- package/dist/modules/profiles/profiles.types.d.ts +62 -0
- package/dist/modules/profiles/profiles.types.js +7 -0
- package/dist/modules/profiles/profiles.types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -15,18 +15,6 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
15
15
|
class UpdateProfileDto {
|
|
16
16
|
}
|
|
17
17
|
exports.UpdateProfileDto = UpdateProfileDto;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, swagger_1.ApiPropertyOptional)({ description: "The user's first name" }),
|
|
20
|
-
(0, class_validator_1.IsString)(),
|
|
21
|
-
(0, class_validator_1.IsOptional)(),
|
|
22
|
-
__metadata("design:type", String)
|
|
23
|
-
], UpdateProfileDto.prototype, "firstName", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, swagger_1.ApiPropertyOptional)({ description: "The user's surname" }),
|
|
26
|
-
(0, class_validator_1.IsString)(),
|
|
27
|
-
(0, class_validator_1.IsOptional)(),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], UpdateProfileDto.prototype, "lastName", void 0);
|
|
30
18
|
__decorate([
|
|
31
19
|
(0, swagger_1.ApiPropertyOptional)({ description: "The user's username" }),
|
|
32
20
|
(0, class_validator_1.IsString)(),
|
|
@@ -34,7 +22,11 @@ __decorate([
|
|
|
34
22
|
__metadata("design:type", String)
|
|
35
23
|
], UpdateProfileDto.prototype, "username", void 0);
|
|
36
24
|
__decorate([
|
|
37
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
25
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
26
|
+
type: "string",
|
|
27
|
+
format: "binary",
|
|
28
|
+
description: "The user's profile image",
|
|
29
|
+
}),
|
|
38
30
|
__metadata("design:type", Object)
|
|
39
31
|
], UpdateProfileDto.prototype, "profileImage", void 0);
|
|
40
32
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-profile.dto.js","sourceRoot":"","sources":["../../../../src/modules/profiles/dto/update-profile.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AACvD,6CAAsD;AAEtD,MAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"update-profile.dto.js","sourceRoot":"","sources":["../../../../src/modules/profiles/dto/update-profile.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AACvD,6CAAsD;AAEtD,MAAa,gBAAgB;CAiB5B;AAjBD,4CAiBC;AAbC;IAHC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;IAC3D,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;kDACK;AAOlB;IALC,IAAA,6BAAmB,EAAC;QACnB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE,0BAA0B;KACxC,CAAC;;sDACiB;AAKnB;IAHC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;IACtD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6CACA"}
|
|
@@ -4,6 +4,7 @@ import { LinkAddressDto } from "./dto/link-address.dto";
|
|
|
4
4
|
import { UpdateProfileDto } from "./dto/update-profile.dto";
|
|
5
5
|
import { VerifyEmailDto } from "./dto/verify-email.dto";
|
|
6
6
|
import { ResendVerificationDto } from "./dto/resend-verification.dto";
|
|
7
|
+
import { KycDataForm } from "./profiles.types";
|
|
7
8
|
export declare class ProfilesController {
|
|
8
9
|
private readonly profilesService;
|
|
9
10
|
constructor(profilesService: ProfilesService);
|
|
@@ -14,4 +15,6 @@ export declare class ProfilesController {
|
|
|
14
15
|
updateUserProfile(updateData: UpdateProfileDto, profileImage: Express.Multer.File, address: string): Promise<import("./profiles.types").UserProfile>;
|
|
15
16
|
checkUsername(username: string): Promise<boolean>;
|
|
16
17
|
unlinkAddress(address: string): Promise<void>;
|
|
18
|
+
startKyc(address: string, input: KycDataForm): Promise<import("./profiles.types").KycApplicant>;
|
|
19
|
+
createWorkflowRun(address: string): Promise<import("./profiles.types").OnfidoWorkflowRunResponse>;
|
|
17
20
|
}
|
|
@@ -36,7 +36,11 @@ let ProfilesController = class ProfilesController {
|
|
|
36
36
|
return await this.profilesService.resendVerificationCode(address, input.email);
|
|
37
37
|
}
|
|
38
38
|
async getUserProfile(address) {
|
|
39
|
-
return await this.profilesService.getUserProfile(address
|
|
39
|
+
return await this.profilesService.getUserProfile(address, {
|
|
40
|
+
includeKyc: true,
|
|
41
|
+
includePublicProfile: true,
|
|
42
|
+
includeUnverified: true,
|
|
43
|
+
});
|
|
40
44
|
}
|
|
41
45
|
async updateUserProfile(updateData, profileImage, address) {
|
|
42
46
|
return await this.profilesService.updateUserProfile(address, updateData, profileImage);
|
|
@@ -47,6 +51,12 @@ let ProfilesController = class ProfilesController {
|
|
|
47
51
|
async unlinkAddress(address) {
|
|
48
52
|
return await this.profilesService.unlinkAddress(address);
|
|
49
53
|
}
|
|
54
|
+
async startKyc(address, input) {
|
|
55
|
+
return await this.profilesService.startKYC(address, input);
|
|
56
|
+
}
|
|
57
|
+
async createWorkflowRun(address) {
|
|
58
|
+
return await this.profilesService.createWorkflowRun(address);
|
|
59
|
+
}
|
|
50
60
|
};
|
|
51
61
|
exports.ProfilesController = ProfilesController;
|
|
52
62
|
__decorate([
|
|
@@ -131,6 +141,30 @@ __decorate([
|
|
|
131
141
|
__metadata("design:paramtypes", [String]),
|
|
132
142
|
__metadata("design:returntype", Promise)
|
|
133
143
|
], ProfilesController.prototype, "unlinkAddress", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, common_1.Post)("/kyc"),
|
|
146
|
+
(0, swagger_1.ApiOperation)({ summary: "Start KYC" }),
|
|
147
|
+
(0, swagger_1.ApiResponse)({ status: 200, description: "KYC started successfully" }),
|
|
148
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
|
|
149
|
+
__param(0, (0, wallet_address_decorator_1.WalletAddress)()),
|
|
150
|
+
__param(1, (0, common_1.Body)()),
|
|
151
|
+
__metadata("design:type", Function),
|
|
152
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
153
|
+
__metadata("design:returntype", Promise)
|
|
154
|
+
], ProfilesController.prototype, "startKyc", null);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, common_1.Post)("/kyc/workflow"),
|
|
157
|
+
(0, swagger_1.ApiOperation)({ summary: "Start KYC workflow run" }),
|
|
158
|
+
(0, swagger_1.ApiResponse)({
|
|
159
|
+
status: 200,
|
|
160
|
+
description: "KYC workflow run created successfully",
|
|
161
|
+
}),
|
|
162
|
+
(0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
|
|
163
|
+
__param(0, (0, wallet_address_decorator_1.WalletAddress)()),
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", [String]),
|
|
166
|
+
__metadata("design:returntype", Promise)
|
|
167
|
+
], ProfilesController.prototype, "createWorkflowRun", null);
|
|
134
168
|
exports.ProfilesController = ProfilesController = __decorate([
|
|
135
169
|
(0, swagger_1.ApiTags)("Users"),
|
|
136
170
|
(0, common_1.Controller)("users"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.controller.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,+DAA2D;AAC3D,6CAKyB;AACzB,yDAAqD;AACrD,6DAAwD;AACxD,iEAA4D;AAC5D,6DAAwD;AACxD,2EAAsE;AACtE,uFAAyE;
|
|
1
|
+
{"version":3,"file":"profiles.controller.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,+DAA2D;AAC3D,6CAKyB;AACzB,yDAAqD;AACrD,6DAAwD;AACxD,iEAA4D;AAC5D,6DAAwD;AACxD,2EAAsE;AACtE,uFAAyE;AAKlE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAM3D,AAAN,KAAK,CAAC,WAAW,CACP,KAAqB,EACZ,OAAe;QAEhC,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAMK,AAAN,KAAK,CAAC,WAAW,CACP,KAAqB,EACZ,OAAe;QAEhC,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IAMK,AAAN,KAAK,CAAC,sBAAsB,CACT,OAAe,EACxB,KAA4B;QAEpC,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,sBAAsB,CACtD,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CAAC;IACJ,CAAC;IASK,AAAN,KAAK,CAAC,cAAc,CAAkB,OAAe;QACnD,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,OAAO,EAAE;YACxD,UAAU,EAAE,IAAI;YAChB,oBAAoB,EAAE,IAAI;YAC1B,iBAAiB,EAAE,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kDAEvD;AASK;IAPL,IAAA,aAAI,EAAC,eAAe,CAAC;IACrB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACnD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,uCAAuC;KACrD,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IAChC,WAAA,IAAA,wCAAa,GAAE,CAAA;;;;2DAEvC;6BA3GU,kBAAkB;IAF9B,IAAA,iBAAO,EAAC,OAAO,CAAC;IAChB,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAE4B,kCAAe;GADlD,kBAAkB,CA4G9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="multer" />
|
|
2
|
-
import { UserProfile, UpdateUserProfileInput } from "./profiles.types";
|
|
2
|
+
import { UserProfile, UpdateUserProfileInput, KycDataForm, GetUsersInput, KycApplicant, OnfidoWorkflowRunResponse, GetUserOptions } from "./profiles.types";
|
|
3
3
|
export declare class ProfilesService {
|
|
4
4
|
private readonly axiosInstance;
|
|
5
5
|
constructor();
|
|
@@ -7,9 +7,12 @@ export declare class ProfilesService {
|
|
|
7
7
|
linkAddress(email: string, address: string): Promise<void>;
|
|
8
8
|
verifyEmail(address: string, code: string): Promise<void>;
|
|
9
9
|
resendVerificationCode(address: string, email: string): Promise<void>;
|
|
10
|
-
getUserProfile(address: string): Promise<UserProfile>;
|
|
10
|
+
getUserProfile(address: string, options?: GetUserOptions): Promise<UserProfile>;
|
|
11
11
|
checkUsername(username: string): Promise<boolean>;
|
|
12
12
|
updateUserProfile(address: string, updateData: UpdateUserProfileInput, profileImage: Express.Multer.File | null): Promise<UserProfile>;
|
|
13
13
|
unlinkAddress(address: string): Promise<void>;
|
|
14
|
+
startKYC(walletAddress: string, kycData: KycDataForm): Promise<KycApplicant>;
|
|
15
|
+
createWorkflowRun(address: string): Promise<OnfidoWorkflowRunResponse>;
|
|
16
|
+
getUserProfiles(input: GetUsersInput, options?: GetUserOptions): Promise<Record<string, UserProfile>>;
|
|
14
17
|
private handleAxiosError;
|
|
15
18
|
}
|
|
@@ -66,9 +66,15 @@ let ProfilesService = class ProfilesService {
|
|
|
66
66
|
this.handleAxiosError(error);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
async getUserProfile(address) {
|
|
69
|
+
async getUserProfile(address, options = {}) {
|
|
70
70
|
try {
|
|
71
|
-
const response = await this.axiosInstance.get(`/users/${address}
|
|
71
|
+
const response = await this.axiosInstance.get(`/users/${address}`, {
|
|
72
|
+
params: {
|
|
73
|
+
includeKyc: options.includeKyc || false,
|
|
74
|
+
includePublicProfile: options.includePublicProfile || false,
|
|
75
|
+
includeUnverified: options.includeUnverified || false,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
72
78
|
return response.data;
|
|
73
79
|
}
|
|
74
80
|
catch (error) {
|
|
@@ -114,15 +120,48 @@ let ProfilesService = class ProfilesService {
|
|
|
114
120
|
this.handleAxiosError(error);
|
|
115
121
|
}
|
|
116
122
|
}
|
|
123
|
+
async startKYC(walletAddress, kycData) {
|
|
124
|
+
try {
|
|
125
|
+
const response = await this.axiosInstance.post("/users/kyc", Object.assign({ walletAddress }, kycData));
|
|
126
|
+
return response.data;
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
this.handleAxiosError(error);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async createWorkflowRun(address) {
|
|
133
|
+
try {
|
|
134
|
+
const response = await this.axiosInstance.post("/users/kyc/workflow", {
|
|
135
|
+
address,
|
|
136
|
+
});
|
|
137
|
+
return response.data;
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
this.handleAxiosError(error);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async getUserProfiles(input, options = {}) {
|
|
144
|
+
try {
|
|
145
|
+
const response = await this.axiosInstance.post("/users/profiles", input, {
|
|
146
|
+
params: {
|
|
147
|
+
includeKyc: options.includeKyc || false,
|
|
148
|
+
includePublicProfile: options.includePublicProfile || false,
|
|
149
|
+
includeUnverified: options.includeUnverified || false,
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
return response.data;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
this.handleAxiosError(error);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
117
158
|
handleAxiosError(error) {
|
|
159
|
+
console.log(error);
|
|
118
160
|
if (error.response) {
|
|
119
161
|
throw new common_1.HttpException(error.response.data, error.response.status);
|
|
120
162
|
}
|
|
121
|
-
else if (error.request) {
|
|
122
|
-
throw new common_1.HttpException("No response received from the server", common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
123
|
-
}
|
|
124
163
|
else {
|
|
125
|
-
throw
|
|
164
|
+
throw error;
|
|
126
165
|
}
|
|
127
166
|
}
|
|
128
167
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.service.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"profiles.service.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAuE;AACvE,iCAAyD;AACzD,+CAAoC;AAWpC,wEAAmE;AAG5D,IAAM,eAAe,GAArB,MAAM,eAAe;IAG1B;QACE,IAAI,CAAC,aAAa,GAAG,eAAK,CAAC,MAAM,CAAC;YAChC,OAAO,EAAE,qCAAgB,CAAC,eAAe,EAAE;SAC5C,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACrD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,MAAM,CAAC,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E;YACd,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SAC9B;IACH,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,KAAoB,EACpB,UAA0B,EAAE;QAE5B,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE;gBACvE,MAAM,EAAE;oBACN,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;oBACvC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,KAAK;oBAC3D,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,KAAK;iBACtD;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;SACtB;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SAC9B;IACH,CAAC;IAEO,gBAAgB,CAAC,KAAiB;QACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,IAAI,KAAK,CAAC,QAAQ,EAAE;YAElB,MAAM,IAAI,sBAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACrE;aAAM;YAEL,MAAM,KAAK,CAAC;SACb;IACH,CAAC;CACF,CAAA;AArLY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;;GACA,eAAe,CAqL3B"}
|
|
@@ -11,9 +11,71 @@ export interface UserProfile {
|
|
|
11
11
|
phoneNumber: string;
|
|
12
12
|
username: string;
|
|
13
13
|
profileImageUrl: string;
|
|
14
|
+
kycApplicant?: KycApplicant;
|
|
15
|
+
publicProfile?: {};
|
|
14
16
|
}
|
|
15
17
|
export interface UpdateUserProfileInput {
|
|
16
18
|
firstName?: string;
|
|
17
19
|
surname?: string;
|
|
18
20
|
username?: string;
|
|
19
21
|
}
|
|
22
|
+
export interface KycDataForm {
|
|
23
|
+
walletAddress: string;
|
|
24
|
+
dob: string;
|
|
25
|
+
flatNumber?: string;
|
|
26
|
+
buildingNumber?: string;
|
|
27
|
+
street: string;
|
|
28
|
+
town: string;
|
|
29
|
+
state: string;
|
|
30
|
+
postcode: string;
|
|
31
|
+
country: string;
|
|
32
|
+
}
|
|
33
|
+
export interface KycWorkflowRunForm {
|
|
34
|
+
address: string;
|
|
35
|
+
}
|
|
36
|
+
export interface GetUsersInput {
|
|
37
|
+
addresses: string[];
|
|
38
|
+
}
|
|
39
|
+
export declare enum KYC_Status {
|
|
40
|
+
PENDING = "PENDING",
|
|
41
|
+
APPROVED = "APPROVED",
|
|
42
|
+
REJECTED = "REJECTED"
|
|
43
|
+
}
|
|
44
|
+
export interface KycApplicant {
|
|
45
|
+
guid: string;
|
|
46
|
+
kycStatus: KYC_Status;
|
|
47
|
+
onfidoApplicantId: string | null;
|
|
48
|
+
workflowRunID?: string;
|
|
49
|
+
workflowStatus?: KYC_Status;
|
|
50
|
+
workflowRunCreatedAt?: string;
|
|
51
|
+
userId: number;
|
|
52
|
+
firstName: string;
|
|
53
|
+
lastName: string;
|
|
54
|
+
dob: string;
|
|
55
|
+
flatNumber: string;
|
|
56
|
+
buildingNumber: string;
|
|
57
|
+
street: string;
|
|
58
|
+
town: string;
|
|
59
|
+
state: string;
|
|
60
|
+
postcode: string;
|
|
61
|
+
country: string;
|
|
62
|
+
}
|
|
63
|
+
export interface OnfidoWorkflowRunResponse {
|
|
64
|
+
id: string;
|
|
65
|
+
workflow_id: string;
|
|
66
|
+
applicant_id: string;
|
|
67
|
+
status: string;
|
|
68
|
+
created_at: string;
|
|
69
|
+
tags?: string[];
|
|
70
|
+
custom_data?: Record<string, any>;
|
|
71
|
+
link?: {
|
|
72
|
+
href: string;
|
|
73
|
+
};
|
|
74
|
+
customer_user_id?: string;
|
|
75
|
+
sdk_token: string;
|
|
76
|
+
}
|
|
77
|
+
export interface GetUserOptions {
|
|
78
|
+
includeKyc?: boolean;
|
|
79
|
+
includePublicProfile?: boolean;
|
|
80
|
+
includeUnverified?: boolean;
|
|
81
|
+
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KYC_Status = void 0;
|
|
4
|
+
var KYC_Status;
|
|
5
|
+
(function (KYC_Status) {
|
|
6
|
+
KYC_Status["PENDING"] = "PENDING";
|
|
7
|
+
KYC_Status["APPROVED"] = "APPROVED";
|
|
8
|
+
KYC_Status["REJECTED"] = "REJECTED";
|
|
9
|
+
})(KYC_Status || (exports.KYC_Status = KYC_Status = {}));
|
|
3
10
|
//# sourceMappingURL=profiles.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.types.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"profiles.types.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.types.ts"],"names":[],"mappings":";;;AA+CA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;AACvB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
|