@riocrypto/common-server 1.0.2851 → 1.0.2852

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.
@@ -208,6 +208,7 @@ declare class ClusterClient {
208
208
  mpe001IDL: number;
209
209
  beneficiaryName: string;
210
210
  }>;
211
+ getAlfinBalance(fiat: Fiat): Promise<number>;
211
212
  getSTPMXNBalance(): Promise<number>;
212
213
  createSTPMXNWithdrawal(amount: number, CLABE: string, concepto: string, beneficiaryName: string, internalTransferId?: string): Promise<STPMXNWithdrawalDoc>;
213
214
  getSTPMXNWithdrawal(id: string): Promise<STPMXNWithdrawal>;
@@ -696,6 +696,12 @@ class ClusterClient {
696
696
  return response.data;
697
697
  });
698
698
  }
699
+ getAlfinBalance(fiat) {
700
+ return __awaiter(this, void 0, void 0, function* () {
701
+ const response = yield this.axios.get(`${this.baseUrl}/api/bank/accounts/alfin/${fiat}/balance`, { headers: { "x-cluster-api-key": this.clusterApiKey } });
702
+ return response.data.disponible;
703
+ });
704
+ }
699
705
  getSTPMXNBalance() {
700
706
  return __awaiter(this, void 0, void 0, function* () {
701
707
  const response = yield this.axios.get(`${this.baseUrl}/api/bank/accounts/STP/MXN/balance`, { headers: { "x-cluster-api-key": this.clusterApiKey } });
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getProcessor = void 0;
4
4
  const common_1 = require("@riocrypto/common");
5
- // Alfin takes effect only in Test (Alfin UAT) and Production (Alfin prod). In
6
- // every other environment we never route to Alfin, regardless of user
7
- // attributes or active processors.
8
- const isAlfinEnabled = () => [common_1.RioEnv.Test, common_1.RioEnv.Production].includes(process.env.RIO_ENV);
5
+ // Alfin takes effect only in Production (Alfin prod). In every other
6
+ // environment we never route to Alfin, regardless of user attributes or active
7
+ // processors; non-prod Peru flows fall back to the mocked Interbank path.
8
+ const isAlfinEnabled = () => [common_1.RioEnv.Production].includes(process.env.RIO_ENV);
9
9
  const getProcessor = ({ country, fiat, user, activeProcessors, side, isBinanceRFQ, }) => {
10
10
  var _a, _b, _c, _d, _e, _f;
11
11
  if (isBinanceRFQ === true) {
@@ -46,6 +46,9 @@ interface InternalBalancesDoc extends mongoose.Document {
46
46
  STP: {
47
47
  [key in Fiat & Crypto]: number;
48
48
  };
49
+ alfin: {
50
+ [key in Fiat & Crypto]: number;
51
+ };
49
52
  bancrea: {
50
53
  [key in Fiat & Crypto]: number;
51
54
  };
@@ -68,6 +68,9 @@ const buildInternalBalances = (mongoose) => {
68
68
  [common_1.TreasuryProvider.STP]: {
69
69
  type: Object,
70
70
  },
71
+ [common_1.TreasuryProvider.Alfin]: {
72
+ type: Object,
73
+ },
71
74
  }, {
72
75
  toJSON: {
73
76
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2851",
3
+ "version": "1.0.2852",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",