From 638ca968d0b9d8e30b26084671cd1b0dd20318bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Tue, 12 Apr 2022 18:13:59 +0100 Subject: [PATCH] feat: add exchanges/tickers support for LN coin --- lib/plugins/common/ccxt.js | 4 ++-- lib/plugins/exchange/binance.js | 4 ++-- lib/plugins/exchange/binanceus.js | 4 ++-- lib/plugins/exchange/bitstamp.js | 4 ++-- lib/plugins/exchange/cex.js | 4 ++-- lib/plugins/exchange/itbit.js | 4 ++-- lib/plugins/exchange/kraken.js | 4 ++-- lib/plugins/ticker/bitpay.js | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/plugins/common/ccxt.js b/lib/plugins/common/ccxt.js index c4c54245..883c28b9 100644 --- a/lib/plugins/common/ccxt.js +++ b/lib/plugins/common/ccxt.js @@ -11,7 +11,7 @@ const bitpay = require('../ticker/bitpay') const binance = require('../exchange/binance') const logger = require('../../logger') -const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, TRX, USDT_TRON } = COINS +const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, TRX, USDT_TRON, LN } = COINS const ALL = { cex: cex, @@ -21,7 +21,7 @@ const ALL = { itbit: itbit, bitpay: bitpay, coinbase: { - CRYPTO: [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON, TRX], + CRYPTO: [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON, TRX, LN], FIAT: 'ALL_CURRENCIES' }, binance: binance diff --git a/lib/plugins/exchange/binance.js b/lib/plugins/exchange/binance.js index 0de4c9f9..8a45723c 100644 --- a/lib/plugins/exchange/binance.js +++ b/lib/plugins/exchange/binance.js @@ -4,8 +4,8 @@ const _ = require('lodash/fp') const { ORDER_TYPES } = require('./consts') const ORDER_TYPE = ORDER_TYPES.MARKET -const { BTC, BCH, XMR, ETH, LTC, ZEC } = COINS -const CRYPTO = [BTC, ETH, LTC, ZEC, BCH, XMR] +const { BTC, BCH, XMR, ETH, LTC, ZEC, LN } = COINS +const CRYPTO = [BTC, ETH, LTC, ZEC, BCH, XMR, LN] const FIAT = ['USD', 'EUR'] const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] diff --git a/lib/plugins/exchange/binanceus.js b/lib/plugins/exchange/binanceus.js index d68f78f5..ecf058b6 100644 --- a/lib/plugins/exchange/binanceus.js +++ b/lib/plugins/exchange/binanceus.js @@ -4,8 +4,8 @@ const _ = require('lodash/fp') const { ORDER_TYPES } = require('./consts') const ORDER_TYPE = ORDER_TYPES.MARKET -const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, USDT_TRON } = COINS -const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON] +const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, USDT_TRON, LN } = COINS +const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON, LN] const FIAT = ['USD'] const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] diff --git a/lib/plugins/exchange/bitstamp.js b/lib/plugins/exchange/bitstamp.js index 05b0e23a..5494ff1c 100644 --- a/lib/plugins/exchange/bitstamp.js +++ b/lib/plugins/exchange/bitstamp.js @@ -4,8 +4,8 @@ const _ = require('lodash/fp') const { ORDER_TYPES } = require('./consts') const ORDER_TYPE = ORDER_TYPES.MARKET -const { BTC, ETH, LTC, BCH, USDT } = COINS -const CRYPTO = [BTC, ETH, LTC, BCH, USDT ] +const { BTC, ETH, LTC, BCH, USDT, LN } = COINS +const CRYPTO = [BTC, ETH, LTC, BCH, USDT, LN] const FIAT = ['USD', 'EUR'] const AMOUNT_PRECISION = 8 const REQUIRED_CONFIG_FIELDS = ['key', 'secret', 'clientId'] diff --git a/lib/plugins/exchange/cex.js b/lib/plugins/exchange/cex.js index 03ef1f35..525eb427 100644 --- a/lib/plugins/exchange/cex.js +++ b/lib/plugins/exchange/cex.js @@ -4,8 +4,8 @@ const _ = require('lodash/fp') const { ORDER_TYPES } = require('./consts') const ORDER_TYPE = ORDER_TYPES.MARKET -const { BTC, BCH, DASH, ETH, LTC, USDT, TRX, USDT_TRON } = COINS -const CRYPTO = [BTC, ETH, LTC, DASH, BCH, USDT, TRX, USDT_TRON] +const { BTC, BCH, DASH, ETH, LTC, USDT, TRX, USDT_TRON, LN } = COINS +const CRYPTO = [BTC, ETH, LTC, DASH, BCH, USDT, TRX, USDT_TRON, LN] const FIAT = ['USD', 'EUR'] const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] diff --git a/lib/plugins/exchange/itbit.js b/lib/plugins/exchange/itbit.js index dcaa3d83..02572335 100644 --- a/lib/plugins/exchange/itbit.js +++ b/lib/plugins/exchange/itbit.js @@ -4,8 +4,8 @@ const { ORDER_TYPES } = require('./consts') const { COINS } = require('@lamassu/coins') const ORDER_TYPE = ORDER_TYPES.LIMIT -const { BTC, ETH, USDT } = COINS -const CRYPTO = [BTC, ETH, USDT] +const { BTC, ETH, USDT, LN } = COINS +const CRYPTO = [BTC, ETH, USDT, LN] const FIAT = ['USD'] const AMOUNT_PRECISION = 4 const REQUIRED_CONFIG_FIELDS = ['clientKey', 'clientSecret', 'userId', 'walletId'] diff --git a/lib/plugins/exchange/kraken.js b/lib/plugins/exchange/kraken.js index 856990b0..849af0e5 100644 --- a/lib/plugins/exchange/kraken.js +++ b/lib/plugins/exchange/kraken.js @@ -4,8 +4,8 @@ const { ORDER_TYPES } = require('./consts') const { COINS } = require('@lamassu/coins') const ORDER_TYPE = ORDER_TYPES.MARKET -const { BTC, BCH, DASH, ETH, LTC, ZEC, XMR, USDT, TRX, USDT_TRON } = COINS -const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, XMR, USDT, TRX, USDT_TRON] +const { BTC, BCH, DASH, ETH, LTC, ZEC, XMR, USDT, TRX, USDT_TRON, LN } = COINS +const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, XMR, USDT, TRX, USDT_TRON, LN] const FIAT = ['USD', 'EUR'] const AMOUNT_PRECISION = 6 const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] diff --git a/lib/plugins/ticker/bitpay.js b/lib/plugins/ticker/bitpay.js index f352131c..0952ab40 100644 --- a/lib/plugins/ticker/bitpay.js +++ b/lib/plugins/ticker/bitpay.js @@ -2,9 +2,9 @@ const axios = require('axios') const { COINS } = require('@lamassu/coins') const BN = require('../../bn') -const { BTC, BCH } = COINS +const { BTC, BCH, LN } = COINS -const CRYPTO = [BTC, BCH] +const CRYPTO = [BTC, BCH, LN] const FIAT = 'ALL_CURRENCIES' function ticker (fiatCode, cryptoCode) {