@riocrypto/common 1.0.1818 → 1.0.1820
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.
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Fiat } from "../types/fiat";
|
|
2
|
-
import { Crypto } from "../types/crypto";
|
|
3
1
|
import { PreSettlementTransactionType } from "../types/pre-settlement-transaction-type";
|
|
4
2
|
import { Subjects } from "./subjects";
|
|
5
|
-
import {
|
|
3
|
+
import { CurrencyWithCountry } from "../types/currency-with-country";
|
|
6
4
|
export interface PreSettlementTransactionCreatedEvent {
|
|
7
5
|
subject: Subjects.PreSettlementTransactionCreated;
|
|
8
6
|
data: {
|
|
@@ -10,8 +8,7 @@ export interface PreSettlementTransactionCreatedEvent {
|
|
|
10
8
|
userId: string;
|
|
11
9
|
type: PreSettlementTransactionType;
|
|
12
10
|
amount: number;
|
|
13
|
-
currency:
|
|
14
|
-
country: Country;
|
|
11
|
+
currency: CurrencyWithCountry;
|
|
15
12
|
orderId?: string;
|
|
16
13
|
};
|
|
17
14
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Country } from "../types/country";
|
|
2
|
+
import { CurrencyWithCountry } from "../types/currency-with-country";
|
|
3
|
+
import { Fiat } from "../types/fiat";
|
|
4
|
+
import { Crypto } from "../types/crypto";
|
|
5
|
+
export declare const getCurrencyWithCountry: (currency: Fiat | Crypto, country: Country) => CurrencyWithCountry;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCurrencyWithCountry = void 0;
|
|
4
|
+
const crypto_1 = require("../types/crypto");
|
|
5
|
+
const getCurrencyWithCountry = (currency, country) => {
|
|
6
|
+
if (Object.values(crypto_1.Crypto).includes(currency)) {
|
|
7
|
+
return currency;
|
|
8
|
+
}
|
|
9
|
+
return `${currency}-${country}`;
|
|
10
|
+
};
|
|
11
|
+
exports.getCurrencyWithCountry = getCurrencyWithCountry;
|
package/build/index.d.ts
CHANGED
|
@@ -350,5 +350,6 @@ export * from "./helpers/get-address-for-testing";
|
|
|
350
350
|
export * from "./helpers/humanize-admin-auth-role";
|
|
351
351
|
export * from "./helpers/humanize-auth-role";
|
|
352
352
|
export * from "./helpers/get-base-url";
|
|
353
|
+
export * from "./helpers/get-currency-with-country";
|
|
353
354
|
export * from "./constants/mexico-fiscal-regimens";
|
|
354
355
|
export * from "./constants/mexican-banks";
|
package/build/index.js
CHANGED
|
@@ -366,5 +366,6 @@ __exportStar(require("./helpers/get-address-for-testing"), exports);
|
|
|
366
366
|
__exportStar(require("./helpers/humanize-admin-auth-role"), exports);
|
|
367
367
|
__exportStar(require("./helpers/humanize-auth-role"), exports);
|
|
368
368
|
__exportStar(require("./helpers/get-base-url"), exports);
|
|
369
|
+
__exportStar(require("./helpers/get-currency-with-country"), exports);
|
|
369
370
|
__exportStar(require("./constants/mexico-fiscal-regimens"), exports);
|
|
370
371
|
__exportStar(require("./constants/mexican-banks"), exports);
|