@icgio/icg-utils 1.9.38 → 1.9.40
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.
- package/index.js +0 -1
- package/lib/crypto-rates.js +3 -0
- package/package.json +1 -1
- package/lib/mail.js +0 -25
package/index.js
CHANGED
|
@@ -5,7 +5,6 @@ module.exports = {
|
|
|
5
5
|
influx: require('./lib/influxdb.js'),
|
|
6
6
|
ip: require('./lib/ip.js'),
|
|
7
7
|
logger: require('./lib/logger.js'),
|
|
8
|
-
mail: require('./lib/mail.js'),
|
|
9
8
|
observable: require('./lib/observable.js'),
|
|
10
9
|
ohlcv: require('./lib/ohlcv'),
|
|
11
10
|
rate_limiter: require('./lib/rate-limiter.js'),
|
package/lib/crypto-rates.js
CHANGED
|
@@ -240,6 +240,9 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
240
240
|
}
|
|
241
241
|
})
|
|
242
242
|
} else if (exchange === 'coinstore') {
|
|
243
|
+
if (cur === 'SWAGG') {
|
|
244
|
+
cur = 'SWAGGERC20'
|
|
245
|
+
}
|
|
243
246
|
let pair = cur.toLowerCase() + 'usdt'
|
|
244
247
|
let url = `https://api.coinstore.com/api/v1/market/depth/${pair}`
|
|
245
248
|
limiter.process(needle.get, url, (err, res, body) => {
|
package/package.json
CHANGED
package/lib/mail.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const logger = require('./logger.js')
|
|
2
|
-
|
|
3
|
-
module.exports.send = function (address, subject, data, config) {
|
|
4
|
-
const mailgun = require('mailgun-js')({
|
|
5
|
-
apiKey: config.mail_api_key,
|
|
6
|
-
domain: config.mail_domain,
|
|
7
|
-
})
|
|
8
|
-
let options = {
|
|
9
|
-
from: config.mail_from_address,
|
|
10
|
-
to: address,
|
|
11
|
-
subject: config.message_prefix() + subject,
|
|
12
|
-
}
|
|
13
|
-
if (/<[a-z][\s\S]*>/i.test(data)) {
|
|
14
|
-
options.html = data
|
|
15
|
-
} else {
|
|
16
|
-
options.text = data
|
|
17
|
-
}
|
|
18
|
-
mailgun.messages().send(options, (err, body) => {
|
|
19
|
-
if (err) {
|
|
20
|
-
logger.error('Mail sent error: %j', err)
|
|
21
|
-
} else if (body.id) {
|
|
22
|
-
logger.info('Mail sent successfully')
|
|
23
|
-
}
|
|
24
|
-
})
|
|
25
|
-
}
|