@riocrypto/common-server 1.0.2364 → 1.0.2368
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.
|
@@ -27,9 +27,7 @@ class CoincoverClient {
|
|
|
27
27
|
return address;
|
|
28
28
|
};
|
|
29
29
|
this.getResidenceCountry = (user) => {
|
|
30
|
-
|
|
31
|
-
const highestOnboardingCountry = (0, common_1.getHighestOnboardingStatus)(user).country;
|
|
32
|
-
return (_b = (_a = user.onboarding[highestOnboardingCountry]) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b.country;
|
|
30
|
+
return user.address.country;
|
|
33
31
|
};
|
|
34
32
|
if ([common_1.RioEnv.Development, common_1.RioEnv.Production].includes(process.env.RIO_ENV)) {
|
|
35
33
|
this.baseUrl = "https://api.txm.coincover.com";
|
|
@@ -3,19 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getTaxRate = void 0;
|
|
4
4
|
const common_1 = require("@riocrypto/common");
|
|
5
5
|
const getTaxRate = (user, country, fiat, processor) => {
|
|
6
|
-
var _a, _b
|
|
6
|
+
var _a, _b;
|
|
7
7
|
let taxRate = 0;
|
|
8
8
|
if ((fiat === common_1.Fiat.MXN && processor === common_1.Processor.SPEI) ||
|
|
9
9
|
(fiat === common_1.Fiat.MXN && processor === common_1.Processor.SPEI_NVIO) ||
|
|
10
10
|
(fiat === common_1.Fiat.MXN && processor === common_1.Processor.SPEI_STP) ||
|
|
11
11
|
(fiat === common_1.Fiat.USD && processor === common_1.Processor.SPID)) {
|
|
12
12
|
if (country === common_1.Country.Mexico &&
|
|
13
|
-
((
|
|
13
|
+
((_a = user === null || user === void 0 ? void 0 : user.address) === null || _a === void 0 ? void 0 : _a.country) === common_1.CountryOfOrigin.Mexico) {
|
|
14
14
|
taxRate = 0.16;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
if (fiat === common_1.Fiat.PEN && processor === common_1.Processor.Interbank) {
|
|
18
|
-
if (((
|
|
18
|
+
if (((_b = user === null || user === void 0 ? void 0 : user.address) === null || _b === void 0 ? void 0 : _b.country) === common_1.CountryOfOrigin.Peru) {
|
|
19
19
|
taxRate = 0.18;
|
|
20
20
|
}
|
|
21
21
|
}
|
package/build/models/user.d.ts
CHANGED
|
@@ -71,21 +71,20 @@ interface UserAttrs {
|
|
|
71
71
|
authorizedPhoneNumbers?: string[];
|
|
72
72
|
onboarding: {
|
|
73
73
|
country: Country;
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
aipriseProfileId?: string;
|
|
75
|
+
aipriseVerificationSessionUrl?: string;
|
|
76
76
|
bridgeCustomerId?: string;
|
|
77
|
-
|
|
78
|
-
aipriseUserVerificationSessionUrl?: string;
|
|
77
|
+
bridgeKYCLinkId?: string;
|
|
79
78
|
status: OnboardingStatus;
|
|
80
79
|
hasAcceptedTerms: boolean;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
};
|
|
81
|
+
address: {
|
|
82
|
+
street1?: string;
|
|
83
|
+
street2?: string;
|
|
84
|
+
city?: string;
|
|
85
|
+
state?: string;
|
|
86
|
+
postalCode?: string;
|
|
87
|
+
country?: CountryOfOrigin;
|
|
89
88
|
};
|
|
90
89
|
invoicing?: {
|
|
91
90
|
MX: {
|
|
@@ -184,21 +183,20 @@ interface UserDoc extends Document {
|
|
|
184
183
|
authorizedPhoneNumbers?: string[];
|
|
185
184
|
onboarding: {
|
|
186
185
|
country: Country;
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
aipriseProfileId?: string;
|
|
187
|
+
aipriseVerificationSessionUrl?: string;
|
|
189
188
|
bridgeCustomerId?: string;
|
|
190
|
-
|
|
191
|
-
aipriseUserVerificationSessionUrl?: string;
|
|
189
|
+
bridgeKYCLinkId?: string;
|
|
192
190
|
status: OnboardingStatus;
|
|
193
191
|
hasAcceptedTerms: boolean;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
192
|
+
};
|
|
193
|
+
address: {
|
|
194
|
+
street1?: string;
|
|
195
|
+
street2?: string;
|
|
196
|
+
city?: string;
|
|
197
|
+
state?: string;
|
|
198
|
+
postalCode?: string;
|
|
199
|
+
country?: CountryOfOrigin;
|
|
202
200
|
};
|
|
203
201
|
invoicing?: {
|
|
204
202
|
MX: {
|
package/build/models/user.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2368",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.2089",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|