@riocrypto/common 1.0.1241 → 1.0.1247
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/build/clients/rio-admin-client.d.ts +1 -1
- package/build/clients/rio-admin-client.js +2 -2
- package/build/clients/rio-client.d.ts +1 -1
- package/build/clients/rio-client.js +2 -2
- package/build/events/user-created-event.d.ts +2 -2
- package/build/events/user-updated-event.d.ts +2 -2
- package/build/helpers/get-highest-onboarding-status.d.ts +3 -0
- package/build/helpers/get-highest-onboarding-status.js +19 -0
- package/build/helpers/humanize-onboarding-status.d.ts +2 -0
- package/build/helpers/humanize-onboarding-status.js +27 -0
- package/build/index.d.ts +3 -3
- package/build/index.js +3 -3
- package/build/types/{kyc-status.d.ts → onboarding-status.d.ts} +1 -1
- package/build/types/onboarding-status.js +17 -0
- package/build/types/user-input.d.ts +3 -3
- package/build/types/user-query.d.ts +2 -2
- package/build/types/user-update.d.ts +3 -3
- package/build/types/user.d.ts +3 -3
- package/package.json +1 -1
- package/build/helpers/get-highest-kyc-status.d.ts +0 -3
- package/build/helpers/get-highest-kyc-status.js +0 -18
- package/build/helpers/humanize-kyc-status.d.ts +0 -2
- package/build/helpers/humanize-kyc-status.js +0 -27
- package/build/types/kyc-status.js +0 -17
|
@@ -54,7 +54,7 @@ export declare class RioAdminClient {
|
|
|
54
54
|
signinAdmin(email: string, password: string, authenticatorCode: string): Promise<any>;
|
|
55
55
|
updateUser(update: UserUpdate, userId?: string): Promise<User>;
|
|
56
56
|
uploadCOI(id: string, formData: FormData): Promise<User>;
|
|
57
|
-
|
|
57
|
+
getOnboardingRequirements(userType: UserType, country: Country, countryOfOrigin: CountryOfOrigin): Promise<{
|
|
58
58
|
textRequirements: ("personalId" | "taxId")[];
|
|
59
59
|
fileRequirements: KYCFileType[];
|
|
60
60
|
}>;
|
|
@@ -91,9 +91,9 @@ class RioAdminClient {
|
|
|
91
91
|
return data;
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
getOnboardingRequirements(userType, country, countryOfOrigin) {
|
|
95
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
const { data } = yield this.axios.get(`/api/
|
|
96
|
+
const { data } = yield this.axios.get(`/api/users/requirements`, {
|
|
97
97
|
params: {
|
|
98
98
|
type: userType,
|
|
99
99
|
country,
|
|
@@ -49,7 +49,7 @@ export declare class RioClient {
|
|
|
49
49
|
uploadKYCReport(id: string, formData: FormData): Promise<User>;
|
|
50
50
|
uploadCSF(id: string, formData: FormData): Promise<User>;
|
|
51
51
|
getRioSettings(): Promise<RioSettings>;
|
|
52
|
-
|
|
52
|
+
getOnboardingRequirements(userType: UserType, country: Country, countryOfOrigin: CountryOfOrigin): Promise<{
|
|
53
53
|
textRequirements: ("personalId" | "taxId")[];
|
|
54
54
|
fileRequirements: KYCFileType[];
|
|
55
55
|
}>;
|
|
@@ -106,9 +106,9 @@ class RioClient {
|
|
|
106
106
|
return data;
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
getOnboardingRequirements(userType, country, countryOfOrigin) {
|
|
110
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
-
const { data } = yield this.axios.get(`/api/
|
|
111
|
+
const { data } = yield this.axios.get(`/api/users/requirements`, {
|
|
112
112
|
params: {
|
|
113
113
|
type: userType,
|
|
114
114
|
country,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnboardingStatus } from "../types/onboarding-status";
|
|
2
2
|
import { USState } from "../types/us-state";
|
|
3
3
|
import { UserAttribute } from "../types/user-attribute";
|
|
4
4
|
import { Subjects } from "./subjects";
|
|
@@ -17,7 +17,7 @@ export interface UserCreatedEvent {
|
|
|
17
17
|
state: USState | string;
|
|
18
18
|
country: string;
|
|
19
19
|
postalCode: string;
|
|
20
|
-
kycStatus:
|
|
20
|
+
kycStatus: OnboardingStatus;
|
|
21
21
|
language?: string;
|
|
22
22
|
attributes?: UserAttribute[];
|
|
23
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Country } from "../types/country";
|
|
2
2
|
import { CountryOfOrigin } from "../types/country-of-origin";
|
|
3
|
-
import {
|
|
3
|
+
import { OnboardingStatus } from "../types/onboarding-status";
|
|
4
4
|
import { PlatformFeeRange } from "../types/platform-fee-range";
|
|
5
5
|
import { UserAttribute } from "../types/user-attribute";
|
|
6
6
|
import { UserType } from "../types/user-type";
|
|
@@ -18,7 +18,7 @@ export interface UserUpdatedEvent {
|
|
|
18
18
|
state?: string;
|
|
19
19
|
country?: CountryOfOrigin;
|
|
20
20
|
postalCode?: string;
|
|
21
|
-
kycStatus?:
|
|
21
|
+
kycStatus?: OnboardingStatus;
|
|
22
22
|
CPF?: string;
|
|
23
23
|
CURP?: string;
|
|
24
24
|
economicActivity?: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getHighestOnboardingStatus = void 0;
|
|
4
|
+
const onboarding_status_1 = require("../types/onboarding-status");
|
|
5
|
+
const getHighestOnboardingStatus = (user) => {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
let status = onboarding_status_1.OnboardingStatus.None;
|
|
8
|
+
if (user.onboarding) {
|
|
9
|
+
for (const country of Object.keys(user.onboarding)) {
|
|
10
|
+
if (((_a = user.onboarding[country]) === null || _a === void 0 ? void 0 : _a.status) &&
|
|
11
|
+
((_b = user.onboarding[country]) === null || _b === void 0 ? void 0 : _b.status) !==
|
|
12
|
+
onboarding_status_1.OnboardingStatus.None) {
|
|
13
|
+
status = user.onboarding[country].status;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return status;
|
|
18
|
+
};
|
|
19
|
+
exports.getHighestOnboardingStatus = getHighestOnboardingStatus;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.humanizeOnboardingStatus = void 0;
|
|
4
|
+
const onboarding_status_1 = require("../types/onboarding-status");
|
|
5
|
+
const humanizeOnboardingStatus = (status) => {
|
|
6
|
+
switch (status) {
|
|
7
|
+
case onboarding_status_1.OnboardingStatus.Failed:
|
|
8
|
+
return "Failed";
|
|
9
|
+
case onboarding_status_1.OnboardingStatus.Review:
|
|
10
|
+
return "Review";
|
|
11
|
+
case onboarding_status_1.OnboardingStatus.Approved:
|
|
12
|
+
return "Approved";
|
|
13
|
+
case onboarding_status_1.OnboardingStatus.LegalRepresentativePassed:
|
|
14
|
+
return "Legal Representative Passed";
|
|
15
|
+
case onboarding_status_1.OnboardingStatus.LegalRepresentativeFailed:
|
|
16
|
+
return "Legal Representative Failed";
|
|
17
|
+
case onboarding_status_1.OnboardingStatus.IndividualPassed:
|
|
18
|
+
return "Individual Passed";
|
|
19
|
+
case onboarding_status_1.OnboardingStatus.IndividualFailed:
|
|
20
|
+
return "Individual Failed";
|
|
21
|
+
case onboarding_status_1.OnboardingStatus.None:
|
|
22
|
+
return "None";
|
|
23
|
+
default:
|
|
24
|
+
return "Processing";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.humanizeOnboardingStatus = humanizeOnboardingStatus;
|
package/build/index.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ export * from "./types/order-update";
|
|
|
145
145
|
export * from "./types/quote";
|
|
146
146
|
export * from "./types/fees";
|
|
147
147
|
export * from "./types/user-update";
|
|
148
|
-
export * from "./types/
|
|
148
|
+
export * from "./types/onboarding-status";
|
|
149
149
|
export * from "./types/dlocal-payment-method";
|
|
150
150
|
export * from "./types/admin";
|
|
151
151
|
export * from "./types/users-stats";
|
|
@@ -223,13 +223,13 @@ export * from "./helpers/validate-address";
|
|
|
223
223
|
export * from "./helpers/round-down-to-two-decimal-places";
|
|
224
224
|
export * from "./helpers/humanize-order-status";
|
|
225
225
|
export * from "./helpers/humanize-chained-order-status";
|
|
226
|
-
export * from "./helpers/humanize-
|
|
226
|
+
export * from "./helpers/humanize-onboarding-status";
|
|
227
227
|
export * from "./helpers/format-transaction-hash";
|
|
228
228
|
export * from "./helpers/round-to-decimals";
|
|
229
229
|
export * from "./helpers/number-with-commas";
|
|
230
230
|
export * from "./helpers/alpha-2-to-alpha-3";
|
|
231
231
|
export * from "./helpers/get-user-name";
|
|
232
|
-
export * from "./helpers/get-highest-
|
|
232
|
+
export * from "./helpers/get-highest-onboarding-status";
|
|
233
233
|
export * from "./clients/rio-client";
|
|
234
234
|
export * from "./clients/rio-admin-client";
|
|
235
235
|
export * from "./constants/mexico-fiscal-regimens";
|
package/build/index.js
CHANGED
|
@@ -161,7 +161,7 @@ __exportStar(require("./types/order-update"), exports);
|
|
|
161
161
|
__exportStar(require("./types/quote"), exports);
|
|
162
162
|
__exportStar(require("./types/fees"), exports);
|
|
163
163
|
__exportStar(require("./types/user-update"), exports);
|
|
164
|
-
__exportStar(require("./types/
|
|
164
|
+
__exportStar(require("./types/onboarding-status"), exports);
|
|
165
165
|
__exportStar(require("./types/dlocal-payment-method"), exports);
|
|
166
166
|
__exportStar(require("./types/admin"), exports);
|
|
167
167
|
__exportStar(require("./types/users-stats"), exports);
|
|
@@ -239,13 +239,13 @@ __exportStar(require("./helpers/validate-address"), exports);
|
|
|
239
239
|
__exportStar(require("./helpers/round-down-to-two-decimal-places"), exports);
|
|
240
240
|
__exportStar(require("./helpers/humanize-order-status"), exports);
|
|
241
241
|
__exportStar(require("./helpers/humanize-chained-order-status"), exports);
|
|
242
|
-
__exportStar(require("./helpers/humanize-
|
|
242
|
+
__exportStar(require("./helpers/humanize-onboarding-status"), exports);
|
|
243
243
|
__exportStar(require("./helpers/format-transaction-hash"), exports);
|
|
244
244
|
__exportStar(require("./helpers/round-to-decimals"), exports);
|
|
245
245
|
__exportStar(require("./helpers/number-with-commas"), exports);
|
|
246
246
|
__exportStar(require("./helpers/alpha-2-to-alpha-3"), exports);
|
|
247
247
|
__exportStar(require("./helpers/get-user-name"), exports);
|
|
248
|
-
__exportStar(require("./helpers/get-highest-
|
|
248
|
+
__exportStar(require("./helpers/get-highest-onboarding-status"), exports);
|
|
249
249
|
__exportStar(require("./clients/rio-client"), exports);
|
|
250
250
|
__exportStar(require("./clients/rio-admin-client"), exports);
|
|
251
251
|
__exportStar(require("./constants/mexico-fiscal-regimens"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OnboardingStatus = void 0;
|
|
4
|
+
var OnboardingStatus;
|
|
5
|
+
(function (OnboardingStatus) {
|
|
6
|
+
OnboardingStatus["Approved"] = "approved";
|
|
7
|
+
OnboardingStatus["IndividualPassed"] = "individualPassed";
|
|
8
|
+
OnboardingStatus["IndividualReview"] = "individualReview";
|
|
9
|
+
OnboardingStatus["IndividualFailed"] = "individualFailed";
|
|
10
|
+
OnboardingStatus["LegalRepresentativePassed"] = "legalRepresentativeApproved";
|
|
11
|
+
OnboardingStatus["LegalRepresentativeFailed"] = "legalRepresentativeFailed";
|
|
12
|
+
OnboardingStatus["BridgeTosAndKYCCompleted"] = "bridgeToSAndKYCCompleted";
|
|
13
|
+
OnboardingStatus["BridgeKYCCompleted"] = "bridgeKYCCompleted";
|
|
14
|
+
OnboardingStatus["Failed"] = "failed";
|
|
15
|
+
OnboardingStatus["Review"] = "review";
|
|
16
|
+
OnboardingStatus["None"] = "none";
|
|
17
|
+
})(OnboardingStatus = exports.OnboardingStatus || (exports.OnboardingStatus = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CountryOfOrigin } from "./country-of-origin";
|
|
2
|
-
import {
|
|
2
|
+
import { OnboardingStatus } from "./onboarding-status";
|
|
3
3
|
import { PlatformFeeRange } from "./platform-fee-range";
|
|
4
4
|
import { UserAttribute } from "./user-attribute";
|
|
5
5
|
import { UserType } from "./user-type";
|
|
@@ -59,9 +59,9 @@ export declare type UserInput = {
|
|
|
59
59
|
sell?: PlatformFeeRange[];
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
onboarding?: {
|
|
63
63
|
[country in CountryOfOrigin]?: {
|
|
64
|
-
status?:
|
|
64
|
+
status?: OnboardingStatus;
|
|
65
65
|
personalId?: string;
|
|
66
66
|
taxId?: string;
|
|
67
67
|
files?: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CountryOfOrigin } from "./country-of-origin";
|
|
2
|
-
import {
|
|
2
|
+
import { OnboardingStatus } from "./onboarding-status";
|
|
3
3
|
export interface UserQuery {
|
|
4
4
|
firstName?: string;
|
|
5
5
|
lastName?: string;
|
|
6
6
|
companyName?: string;
|
|
7
7
|
country?: CountryOfOrigin;
|
|
8
|
-
kycStatus?:
|
|
8
|
+
kycStatus?: OnboardingStatus;
|
|
9
9
|
brokerId?: string;
|
|
10
10
|
email?: string;
|
|
11
11
|
phoneNumber?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RiskTier } from "./risk-tier";
|
|
2
2
|
import { CountryOfOrigin } from "./country-of-origin";
|
|
3
|
-
import {
|
|
3
|
+
import { OnboardingStatus } from "./onboarding-status";
|
|
4
4
|
import { PlatformFeeRange } from "./platform-fee-range";
|
|
5
5
|
import { UserAttribute } from "./user-attribute";
|
|
6
6
|
import { UserType } from "./user-type";
|
|
@@ -63,9 +63,9 @@ export declare type UserUpdate = {
|
|
|
63
63
|
sell?: PlatformFeeRange[];
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
-
|
|
66
|
+
onboarding?: {
|
|
67
67
|
[country in CountryOfOrigin]?: {
|
|
68
|
-
status?:
|
|
68
|
+
status?: OnboardingStatus;
|
|
69
69
|
personalId?: string;
|
|
70
70
|
taxId?: string;
|
|
71
71
|
files?: {
|
package/build/types/user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RiskTier } from "./risk-tier";
|
|
2
2
|
import { CountryOfOrigin } from "./country-of-origin";
|
|
3
|
-
import {
|
|
3
|
+
import { OnboardingStatus } from "./onboarding-status";
|
|
4
4
|
import { PlatformFeeRange } from "./platform-fee-range";
|
|
5
5
|
import { UserAttribute } from "./user-attribute";
|
|
6
6
|
import { UserType } from "./user-type";
|
|
@@ -65,9 +65,9 @@ export declare type User = {
|
|
|
65
65
|
sell?: PlatformFeeRange[];
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
onboarding?: {
|
|
69
69
|
[country in CountryOfOrigin]?: {
|
|
70
|
-
status?:
|
|
70
|
+
status?: OnboardingStatus;
|
|
71
71
|
personalId?: string;
|
|
72
72
|
taxId?: string;
|
|
73
73
|
isResident?: boolean;
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHighestKYCStatus = void 0;
|
|
4
|
-
const kyc_status_1 = require("../types/kyc-status");
|
|
5
|
-
const getHighestKYCStatus = (user) => {
|
|
6
|
-
var _a, _b;
|
|
7
|
-
let status = kyc_status_1.KYCStatus.None;
|
|
8
|
-
if (user.KYC) {
|
|
9
|
-
for (const country of Object.keys(user.KYC)) {
|
|
10
|
-
if (((_a = user.KYC[country]) === null || _a === void 0 ? void 0 : _a.status) &&
|
|
11
|
-
((_b = user.KYC[country]) === null || _b === void 0 ? void 0 : _b.status) !== kyc_status_1.KYCStatus.None) {
|
|
12
|
-
status = user.KYC[country].status;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return status;
|
|
17
|
-
};
|
|
18
|
-
exports.getHighestKYCStatus = getHighestKYCStatus;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.humanizeKYCStatus = void 0;
|
|
4
|
-
const kyc_status_1 = require("../types/kyc-status");
|
|
5
|
-
const humanizeKYCStatus = (status) => {
|
|
6
|
-
switch (status) {
|
|
7
|
-
case kyc_status_1.KYCStatus.Failed:
|
|
8
|
-
return "Failed";
|
|
9
|
-
case kyc_status_1.KYCStatus.Review:
|
|
10
|
-
return "Review";
|
|
11
|
-
case kyc_status_1.KYCStatus.Approved:
|
|
12
|
-
return "Approved";
|
|
13
|
-
case kyc_status_1.KYCStatus.LegalRepresentativePassed:
|
|
14
|
-
return "Legal Representative Passed";
|
|
15
|
-
case kyc_status_1.KYCStatus.LegalRepresentativeFailed:
|
|
16
|
-
return "Legal Representative Failed";
|
|
17
|
-
case kyc_status_1.KYCStatus.IndividualPassed:
|
|
18
|
-
return "Individual Passed";
|
|
19
|
-
case kyc_status_1.KYCStatus.IndividualFailed:
|
|
20
|
-
return "Individual Failed";
|
|
21
|
-
case kyc_status_1.KYCStatus.None:
|
|
22
|
-
return "None";
|
|
23
|
-
default:
|
|
24
|
-
return "Processing";
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
exports.humanizeKYCStatus = humanizeKYCStatus;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KYCStatus = void 0;
|
|
4
|
-
var KYCStatus;
|
|
5
|
-
(function (KYCStatus) {
|
|
6
|
-
KYCStatus["Approved"] = "approved";
|
|
7
|
-
KYCStatus["IndividualPassed"] = "individualPassed";
|
|
8
|
-
KYCStatus["IndividualReview"] = "individualReview";
|
|
9
|
-
KYCStatus["IndividualFailed"] = "individualFailed";
|
|
10
|
-
KYCStatus["LegalRepresentativePassed"] = "legalRepresentativeApproved";
|
|
11
|
-
KYCStatus["LegalRepresentativeFailed"] = "legalRepresentativeFailed";
|
|
12
|
-
KYCStatus["BridgeTosAndKYCCompleted"] = "bridgeToSAndKYCCompleted";
|
|
13
|
-
KYCStatus["BridgeKYCCompleted"] = "bridgeKYCCompleted";
|
|
14
|
-
KYCStatus["Failed"] = "failed";
|
|
15
|
-
KYCStatus["Review"] = "review";
|
|
16
|
-
KYCStatus["None"] = "none";
|
|
17
|
-
})(KYCStatus = exports.KYCStatus || (exports.KYCStatus = {}));
|