@riocrypto/common-server 1.0.893 → 1.0.895

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.
@@ -97,7 +97,7 @@ class BridgeClient {
97
97
  "Api-Key": this.apiKey,
98
98
  },
99
99
  });
100
- return data;
100
+ return data.data;
101
101
  });
102
102
  }
103
103
  exchangePlaidPublicToken(linkToken, publicToken) {
@@ -93,6 +93,21 @@ const getPlatformAndPartnerFees = (mongoose, conversionRateToUSD, amountFiat, fi
93
93
  }
94
94
  }
95
95
  }
96
+ // @ts-ignore
97
+ if (platformFeeFiat === undefined) {
98
+ let netPlatformFee = rioSettings.platformFee;
99
+ if (discount) {
100
+ netPlatformFee -= discount;
101
+ }
102
+ if (markup) {
103
+ netPlatformFee += markup;
104
+ }
105
+ if (netPlatformFee < 0) {
106
+ throw new Error("Discount cannot be greater than platform fee");
107
+ }
108
+ platformFeeFiat = amountFiat * netPlatformFee;
109
+ }
110
+ partnerFeeFiat = 0;
96
111
  }
97
112
  else if (user === null || user === void 0 ? void 0 : user.platformFeeRanges) {
98
113
  let volume;
@@ -13,7 +13,7 @@ exports.getProcessorFees = void 0;
13
13
  const common_1 = require("@riocrypto/common");
14
14
  const getProcessorFees = (processor, amountFiat, conversionRateFromUSD) => __awaiter(void 0, void 0, void 0, function* () {
15
15
  if (processor === common_1.Processor.Bridge) {
16
- return (((amountFiat / conversionRateFromUSD) * 0.00015 + 20) *
16
+ return ((amountFiat * (1 / conversionRateFromUSD) * 0.00015 + 20) *
17
17
  conversionRateFromUSD);
18
18
  }
19
19
  else if (processor === common_1.Processor.Kapstar) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.893",
3
+ "version": "1.0.895",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "@aws-sdk/client-s3": "^3.297.0",
25
25
  "@everapi/currencyapi-js": "^1.0.6",
26
26
  "@google-cloud/storage": "^6.9.5",
27
- "@riocrypto/common": "^1.0.766",
27
+ "@riocrypto/common": "^1.0.767",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",