@riocrypto/common-server 1.0.616 → 1.0.618

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.
@@ -34,7 +34,8 @@ class CurrencyAPIClient {
34
34
  exchangeRate = currencyAPIResponse.data.data[to].value;
35
35
  cache.set(`v3/latest?apikey=${this.apiKey}&base_currency=${from}&currencies=${to}`, currencyAPIResponse.data);
36
36
  }
37
- return exchangeRate * 0.9987;
37
+ const rioExchangeRate = to === from ? exchangeRate : exchangeRate * 0.9987;
38
+ return rioExchangeRate;
38
39
  }
39
40
  catch (e) {
40
41
  const cachedResponse = cache.get(`v3/latest?apikey=${this.apiKey}&base_currency=${from}&currencies=${to}`);
@@ -42,7 +43,8 @@ class CurrencyAPIClient {
42
43
  throw new Error(`Unable to get exchange rate from currencyAPI for ${from} to ${to}`);
43
44
  }
44
45
  const exchangeRate = cachedResponse.data[to].value;
45
- return exchangeRate * 0.9987;
46
+ const rioExchangeRate = to === from ? exchangeRate : exchangeRate * 0.9987;
47
+ return rioExchangeRate;
46
48
  }
47
49
  });
48
50
  }
@@ -4,6 +4,7 @@ interface BankPayoutAttrs {
4
4
  originBank: string;
5
5
  destinationBank?: string;
6
6
  accountNumber: string;
7
+ swiftCode?: string;
7
8
  status: string;
8
9
  }
9
10
  interface BankPayoutDoc extends Document {
@@ -11,6 +12,7 @@ interface BankPayoutDoc extends Document {
11
12
  originBank: string;
12
13
  destinationBank?: string;
13
14
  accountNumber: string;
15
+ swiftCode?: string;
14
16
  status: string;
15
17
  }
16
18
  interface BankPayoutModel extends Model<BankPayoutDoc> {
@@ -19,6 +19,9 @@ const buildBankPayout = (mongoose) => {
19
19
  type: String,
20
20
  required: true,
21
21
  },
22
+ swiftCode: {
23
+ type: String,
24
+ },
22
25
  status: {
23
26
  type: String,
24
27
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.616",
3
+ "version": "1.0.618",
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.582",
27
+ "@riocrypto/common": "^1.0.583",
28
28
  "@types/express": "^4.17.13",
29
29
  "axios": "^0.27.2",
30
30
  "ccxt": "^3.0.30",