@riocrypto/common 1.0.2082 → 1.0.2084
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/index.d.ts
CHANGED
|
@@ -392,7 +392,6 @@ export * from "./helpers/round-to-decimals";
|
|
|
392
392
|
export * from "./helpers/number-with-commas";
|
|
393
393
|
export * from "./helpers/alpha-2-to-alpha-3";
|
|
394
394
|
export * from "./helpers/get-user-name";
|
|
395
|
-
export * from "./helpers/get-highest-onboarding-status";
|
|
396
395
|
export * from "./helpers/get-auth-name";
|
|
397
396
|
export * from "./helpers/validate-individual-name";
|
|
398
397
|
export * from "./helpers/validate-business-name";
|
package/build/index.js
CHANGED
|
@@ -408,7 +408,6 @@ __exportStar(require("./helpers/round-to-decimals"), exports);
|
|
|
408
408
|
__exportStar(require("./helpers/number-with-commas"), exports);
|
|
409
409
|
__exportStar(require("./helpers/alpha-2-to-alpha-3"), exports);
|
|
410
410
|
__exportStar(require("./helpers/get-user-name"), exports);
|
|
411
|
-
__exportStar(require("./helpers/get-highest-onboarding-status"), exports);
|
|
412
411
|
__exportStar(require("./helpers/get-auth-name"), exports);
|
|
413
412
|
__exportStar(require("./helpers/validate-individual-name"), exports);
|
|
414
413
|
__exportStar(require("./helpers/validate-business-name"), exports);
|
package/build/types/user.d.ts
CHANGED
|
@@ -4,56 +4,10 @@ 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";
|
|
7
|
-
import { ImmigrationStatus } from "./immigration-status";
|
|
8
7
|
import { Country } from "./country";
|
|
9
8
|
import { Fiat } from "./fiat";
|
|
10
9
|
import { Crypto } from "./crypto";
|
|
11
10
|
import { Side } from "./side";
|
|
12
|
-
declare type OnboardingBase = {
|
|
13
|
-
aipriseBusinessProfileId?: string;
|
|
14
|
-
aipriseUserProfileId?: string;
|
|
15
|
-
};
|
|
16
|
-
declare type OnboardingCountryData = {
|
|
17
|
-
[country in CountryOfOrigin]?: {
|
|
18
|
-
status?: OnboardingStatus;
|
|
19
|
-
hasAcceptedTerms?: boolean;
|
|
20
|
-
bridgeId?: string;
|
|
21
|
-
onboardingId?: string;
|
|
22
|
-
personalId?: string;
|
|
23
|
-
taxId?: string;
|
|
24
|
-
immigrationStatus?: ImmigrationStatus;
|
|
25
|
-
individualIdentityVerification?: {
|
|
26
|
-
status?: "passed" | "failed" | "review";
|
|
27
|
-
};
|
|
28
|
-
legalRepresentative?: {
|
|
29
|
-
firstName?: string;
|
|
30
|
-
middleName?: string;
|
|
31
|
-
lastName?: string;
|
|
32
|
-
secondLastName?: string;
|
|
33
|
-
verificationStatus?: "passed" | "failed" | "review";
|
|
34
|
-
email?: string;
|
|
35
|
-
};
|
|
36
|
-
files?: {
|
|
37
|
-
certificateOfIncorporation?: string;
|
|
38
|
-
KYCReport?: string;
|
|
39
|
-
taxTranscript?: string;
|
|
40
|
-
proofOfAddress?: string;
|
|
41
|
-
businessRegistration?: string;
|
|
42
|
-
taxIdentificationCertificate?: string;
|
|
43
|
-
legalRepresentativeIdPowerOfAttorney?: string;
|
|
44
|
-
personalIdentificationCertificate?: string;
|
|
45
|
-
extraFiles?: string[];
|
|
46
|
-
};
|
|
47
|
-
address?: {
|
|
48
|
-
street1?: string;
|
|
49
|
-
street2?: string;
|
|
50
|
-
city?: string;
|
|
51
|
-
state?: string;
|
|
52
|
-
postalCode?: string;
|
|
53
|
-
country?: CountryOfOrigin;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
11
|
declare type IndividualUser = {
|
|
58
12
|
id: string;
|
|
59
13
|
individualData?: {
|
|
@@ -108,7 +62,24 @@ export declare type User = {
|
|
|
108
62
|
sell?: PlatformFeeRange[];
|
|
109
63
|
};
|
|
110
64
|
};
|
|
111
|
-
onboarding
|
|
65
|
+
onboarding: {
|
|
66
|
+
country: Country;
|
|
67
|
+
aipriseBusinessProfileId?: string;
|
|
68
|
+
aipriseUserProfileId?: string;
|
|
69
|
+
bridgeCustomerId?: string;
|
|
70
|
+
aipriseBusinessVerificationSessionUrl?: string;
|
|
71
|
+
aipriseUserVerificationSessionUrl?: string;
|
|
72
|
+
status: OnboardingStatus;
|
|
73
|
+
hasAcceptedTerms: boolean;
|
|
74
|
+
address?: {
|
|
75
|
+
street1?: string;
|
|
76
|
+
street2?: string;
|
|
77
|
+
city?: string;
|
|
78
|
+
state?: string;
|
|
79
|
+
postalCode?: string;
|
|
80
|
+
country?: CountryOfOrigin;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
112
83
|
invoicing?: {
|
|
113
84
|
MX?: {
|
|
114
85
|
shouldInvoice?: boolean;
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UBO } from "../types/UBO";
|
|
2
|
-
import { CountryOfOrigin } from "../types/country-of-origin";
|
|
3
|
-
import { OnboardingStatus } from "../types/onboarding-status";
|
|
4
|
-
import { User } from "../types/user";
|
|
5
|
-
export declare const getHighestOnboardingStatus: (user: User | UBO, excludeUS?: boolean) => {
|
|
6
|
-
status?: OnboardingStatus | undefined;
|
|
7
|
-
country?: CountryOfOrigin | undefined;
|
|
8
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHighestOnboardingStatus = void 0;
|
|
4
|
-
const country_of_origin_1 = require("../types/country-of-origin");
|
|
5
|
-
const onboarding_status_1 = require("../types/onboarding-status");
|
|
6
|
-
const onboardingStatusOrder = [
|
|
7
|
-
onboarding_status_1.OnboardingStatus.None,
|
|
8
|
-
onboarding_status_1.OnboardingStatus.Started,
|
|
9
|
-
onboarding_status_1.OnboardingStatus.Review,
|
|
10
|
-
onboarding_status_1.OnboardingStatus.Approved,
|
|
11
|
-
];
|
|
12
|
-
const getHighestOnboardingStatus = (user, excludeUS) => {
|
|
13
|
-
var _a;
|
|
14
|
-
let status = undefined;
|
|
15
|
-
let statusCountry = undefined;
|
|
16
|
-
if (user.onboarding) {
|
|
17
|
-
for (const country of Object.keys(user.onboarding)) {
|
|
18
|
-
if ((_a = user.onboarding[country]) === null || _a === void 0 ? void 0 : _a.status) {
|
|
19
|
-
if (!status ||
|
|
20
|
-
onboardingStatusOrder.indexOf(user.onboarding[country].status) > onboardingStatusOrder.indexOf(status)) {
|
|
21
|
-
if (excludeUS && country === country_of_origin_1.CountryOfOrigin.UnitedStates) {
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
status = user.onboarding[country].status;
|
|
25
|
-
statusCountry = country;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return { status, country: statusCountry };
|
|
31
|
-
};
|
|
32
|
-
exports.getHighestOnboardingStatus = getHighestOnboardingStatus;
|