@riocrypto/common-server 1.0.2833 → 1.0.2834

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.
@@ -195,11 +195,11 @@ declare class ClusterClient {
195
195
  generateSTPDepositCLABE(userId: string): Promise<{
196
196
  CLABE: string;
197
197
  }>;
198
- generateAlfinVirtualCci(userId: string): Promise<{
198
+ generateAlfinVirtualCci(userId: string, fiat: Fiat): Promise<{
199
199
  CCIV: string;
200
200
  codigoPagoCCIV?: string;
201
201
  }>;
202
- createAlfinPENTreasuryWithdrawal(amount: number, CCI: string, internalTransferId?: string): Promise<{
202
+ createAlfinTreasuryWithdrawal(fiat: Fiat, amount: number, CCI: string, internalTransferId?: string): Promise<{
203
203
  movimientoUId: number;
204
204
  transferenciaId: string;
205
205
  mpe001IDL: number;
@@ -683,15 +683,15 @@ class ClusterClient {
683
683
  return response.data;
684
684
  });
685
685
  }
686
- generateAlfinVirtualCci(userId) {
686
+ generateAlfinVirtualCci(userId, fiat) {
687
687
  return __awaiter(this, void 0, void 0, function* () {
688
- const response = yield this.axios.post(`${this.baseUrl}/api/bank/accounts/alfin/CCIV`, { userId }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
688
+ const response = yield this.axios.post(`${this.baseUrl}/api/bank/accounts/alfin/CCIV`, { userId, fiat }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
689
689
  return response.data;
690
690
  });
691
691
  }
692
- createAlfinPENTreasuryWithdrawal(amount, CCI, internalTransferId) {
692
+ createAlfinTreasuryWithdrawal(fiat, amount, CCI, internalTransferId) {
693
693
  return __awaiter(this, void 0, void 0, function* () {
694
- const response = yield this.axios.post(`${this.baseUrl}/api/bank/accounts/alfin/PEN/treasury-withdrawal`, { amount, CCI, internalTransferId }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
694
+ const response = yield this.axios.post(`${this.baseUrl}/api/bank/accounts/alfin/${fiat}/treasury-withdrawal`, { amount, CCI, internalTransferId }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
695
695
  return response.data;
696
696
  });
697
697
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getProcessor = void 0;
4
4
  const common_1 = require("@riocrypto/common");
5
5
  const getProcessor = ({ country, fiat, user, activeProcessors, side, isBinanceRFQ, }) => {
6
- var _a, _b, _c, _d;
6
+ var _a, _b, _c, _d, _e, _f;
7
7
  if (isBinanceRFQ === true) {
8
8
  return common_1.Processor.BinanceRFQ;
9
9
  }
@@ -70,6 +70,16 @@ const getProcessor = ({ country, fiat, user, activeProcessors, side, isBinanceRF
70
70
  return common_1.Processor.SPID;
71
71
  }
72
72
  else if (country === common_1.Country.Peru) {
73
+ if (side === common_1.Side.Buy &&
74
+ ((_e = user.attributes) === null || _e === void 0 ? void 0 : _e.includes(common_1.UserAttribute.UseAlfinForUSDDeposits)) &&
75
+ activeProcessors.includes(common_1.Processor.Alfin)) {
76
+ return common_1.Processor.Alfin;
77
+ }
78
+ if (side === common_1.Side.Sell &&
79
+ ((_f = user.attributes) === null || _f === void 0 ? void 0 : _f.includes(common_1.UserAttribute.UseAlfinForUSDWithdrawals)) &&
80
+ activeProcessors.includes(common_1.Processor.Alfin)) {
81
+ return common_1.Processor.Alfin;
82
+ }
73
83
  return common_1.Processor.Interbank;
74
84
  }
75
85
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2833",
3
+ "version": "1.0.2834",
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.6.0",
29
29
  "@google-cloud/storage": "^7.19.0",
30
30
  "@hyperdx/node-opentelemetry": "^0.10.3",
31
- "@riocrypto/common": "1.0.2632",
31
+ "@riocrypto/common": "1.0.2633",
32
32
  "@slack/web-api": "^7.15.0",
33
33
  "@types/express": "^4.17.25",
34
34
  "axios": "1.16.0",