From 3e81e591ad3c452591e708ad6a1bfb9d1576c6d2 Mon Sep 17 00:00:00 2001 From: CrypticaScriptura <7396812+CrypticaScriptura@users.noreply.github.com> Date: Thu, 27 Feb 2025 15:58:21 -0500 Subject: [PATCH] feat: add USDC --- lib/new-admin/config/accounts.js | 10 +++++----- lib/plugins/common/ccxt.js | 4 ++-- lib/plugins/exchange/binanceus.js | 4 ++-- lib/plugins/exchange/bitfinex.js | 4 ++-- lib/plugins/exchange/bitstamp.js | 4 ++-- lib/plugins/exchange/kraken.js | 4 ++-- new-lamassu-admin/src/pages/Wallet/WizardSplash.jsx | 3 +++ new-lamassu-admin/src/pages/Wallet/helper.jsx | 2 +- .../src/styling/logos/icon-usdc-colour.svg | 5 +++++ 9 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 new-lamassu-admin/src/styling/logos/icon-usdc-colour.svg diff --git a/lib/new-admin/config/accounts.js b/lib/new-admin/config/accounts.js index 8a2279d9..c5b21f2e 100644 --- a/lib/new-admin/config/accounts.js +++ b/lib/new-admin/config/accounts.js @@ -3,7 +3,7 @@ const _ = require('lodash/fp') const { ALL } = require('../../plugins/common/ccxt') -const { BTC, BCH, DASH, ETH, LTC, USDT, ZEC, XMR, LN, TRX, USDT_TRON } = COINS +const { BTC, BCH, DASH, ETH, LTC, USDT, ZEC, XMR, LN, TRX, USDT_TRON, USDC } = COINS const { bitpay, coinbase, itbit, bitstamp, kraken, binanceus, cex, binance, bitfinex } = ALL const TICKER = 'ticker' @@ -31,9 +31,9 @@ const ALL_ACCOUNTS = [ { code: 'mock-ticker', display: 'Mock (Caution!)', class: TICKER, cryptos: ALL_CRYPTOS, dev: true }, { code: 'bitcoind', display: 'bitcoind', class: WALLET, cryptos: [BTC] }, { code: 'no-layer2', display: 'No Layer 2', class: LAYER_2, cryptos: ALL_CRYPTOS }, - { code: 'infura', display: 'Infura/Alchemy', class: WALLET, cryptos: [ETH, USDT] }, + { code: 'infura', display: 'Infura/Alchemy', class: WALLET, cryptos: [ETH, USDT, USDC] }, { code: 'trongrid', display: 'Trongrid', class: WALLET, cryptos: [TRX, USDT_TRON] }, - { code: 'geth', display: 'geth (deprecated)', class: WALLET, cryptos: [ETH, USDT] }, + { code: 'geth', display: 'geth (deprecated)', class: WALLET, cryptos: [ETH, USDT, USDC] }, { code: 'zcashd', display: 'zcashd', class: WALLET, cryptos: [ZEC] }, { code: 'litecoind', display: 'litecoind', class: WALLET, cryptos: [LTC] }, { code: 'dashd', display: 'dashd', class: WALLET, cryptos: [DASH] }, @@ -61,8 +61,8 @@ const ALL_ACCOUNTS = [ { code: 'none', display: 'None', class: ZERO_CONF, cryptos: ALL_CRYPTOS }, { code: 'blockcypher', display: 'Blockcypher', class: ZERO_CONF, cryptos: [BTC] }, { code: 'mock-zero-conf', display: 'Mock 0-conf', class: ZERO_CONF, cryptos: ALL_CRYPTOS, dev: true }, - { code: 'scorechain', display: 'Scorechain', class: WALLET_SCORING, cryptos: [BTC, ETH, LTC, BCH, DASH, USDT, USDT_TRON, TRX] }, - { code: 'elliptic', display: 'Elliptic', class: WALLET_SCORING, cryptos: [BTC, ETH, LTC, BCH, USDT, USDT_TRON, TRX, ZEC] }, + { code: 'scorechain', display: 'Scorechain', class: WALLET_SCORING, cryptos: [BTC, ETH, LTC, BCH, DASH, USDT, USDC, USDT_TRON, TRX] }, + { code: 'elliptic', display: 'Elliptic', class: WALLET_SCORING, cryptos: [BTC, ETH, LTC, BCH, USDT, USDC, USDT_TRON, TRX, ZEC] }, { code: 'mock-scoring', display: 'Mock scoring', class: WALLET_SCORING, cryptos: ALL_CRYPTOS, dev: true }, { code: 'sumsub', display: 'Sumsub', class: COMPLIANCE }, { code: 'mock-compliance', display: 'Mock Compliance', class: COMPLIANCE, dev: true }, diff --git a/lib/plugins/common/ccxt.js b/lib/plugins/common/ccxt.js index 825c30b7..46c7b50c 100644 --- a/lib/plugins/common/ccxt.js +++ b/lib/plugins/common/ccxt.js @@ -12,7 +12,7 @@ const binance = require('../exchange/binance') const bitfinex = require('../exchange/bitfinex') const logger = require('../../logger') -const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, TRX, USDT_TRON, LN } = COINS +const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, TRX, USDT_TRON, LN, USDC } = COINS const ALL = { cex: cex, @@ -22,7 +22,7 @@ const ALL = { itbit: itbit, bitpay: bitpay, coinbase: { - CRYPTO: [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON, TRX, LN], + CRYPTO: [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON, TRX, LN, USDC], FIAT: 'ALL_CURRENCIES', DEFAULT_FIAT_MARKET: 'EUR' }, diff --git a/lib/plugins/exchange/binanceus.js b/lib/plugins/exchange/binanceus.js index e8f0c371..1c57b239 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, LN } = COINS -const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON, LN] +const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, USDT_TRON, LN, USDC } = COINS +const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON, LN, USDC] const FIAT = ['USD'] const DEFAULT_FIAT_MARKET = 'USD' const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey', 'currencyMarket'] diff --git a/lib/plugins/exchange/bitfinex.js b/lib/plugins/exchange/bitfinex.js index 4e4d85ce..a8796f7d 100644 --- a/lib/plugins/exchange/bitfinex.js +++ b/lib/plugins/exchange/bitfinex.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, LN } = COINS -const CRYPTO = [BTC, ETH, LTC, BCH, USDT, LN] +const { BTC, ETH, LTC, BCH, USDT, LN, USDC } = COINS +const CRYPTO = [BTC, ETH, LTC, BCH, USDT, LN, USDC] const FIAT = ['USD', 'EUR'] const DEFAULT_FIAT_MARKET = 'EUR' const AMOUNT_PRECISION = 8 diff --git a/lib/plugins/exchange/bitstamp.js b/lib/plugins/exchange/bitstamp.js index bd745d49..959e7619 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, LN } = COINS -const CRYPTO = [BTC, ETH, LTC, BCH, USDT, LN] +const { BTC, ETH, LTC, BCH, USDT, LN, USDC } = COINS +const CRYPTO = [BTC, ETH, LTC, BCH, USDT, LN, USDC] const FIAT = ['USD', 'EUR'] const DEFAULT_FIAT_MARKET = 'EUR' const AMOUNT_PRECISION = 8 diff --git a/lib/plugins/exchange/kraken.js b/lib/plugins/exchange/kraken.js index 0f050ccf..29e80630 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, LN } = COINS -const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, XMR, USDT, TRX, USDT_TRON, LN] +const { BTC, BCH, DASH, ETH, LTC, ZEC, XMR, USDT, TRX, USDT_TRON, LN, USDC } = COINS +const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, XMR, USDT, TRX, USDT_TRON, LN, USDC] const FIAT = ['USD', 'EUR'] const DEFAULT_FIAT_MARKET = 'EUR' const AMOUNT_PRECISION = 6 diff --git a/new-lamassu-admin/src/pages/Wallet/WizardSplash.jsx b/new-lamassu-admin/src/pages/Wallet/WizardSplash.jsx index b33e9abd..1e362d40 100644 --- a/new-lamassu-admin/src/pages/Wallet/WizardSplash.jsx +++ b/new-lamassu-admin/src/pages/Wallet/WizardSplash.jsx @@ -9,6 +9,7 @@ import LitecoinLogo from 'src/styling/logos/icon-litecoin-colour.svg?react' import MoneroLogo from 'src/styling/logos/icon-monero-colour.svg?react' import TetherLogo from 'src/styling/logos/icon-tether-colour.svg?react' import TronLogo from 'src/styling/logos/icon-tron-colour.svg?react' +import USDCLogo from 'src/styling/logos/icon-usdc-colour.svg' import ZCashLogo from 'src/styling/logos/icon-zcash-colour.svg?react' import { Button } from 'src/components/buttons' @@ -56,6 +57,8 @@ const getLogo = code => { case 'USDT': case 'USDT_TRON': return TetherLogo + case 'USDC': + return USDCLogo case 'XMR': return MoneroLogo case 'TRX': diff --git a/new-lamassu-admin/src/pages/Wallet/helper.jsx b/new-lamassu-admin/src/pages/Wallet/helper.jsx index ff4c97c0..bd6d90a6 100644 --- a/new-lamassu-admin/src/pages/Wallet/helper.jsx +++ b/new-lamassu-admin/src/pages/Wallet/helper.jsx @@ -202,7 +202,7 @@ const getAdvancedWalletElementsOverrides = ( const has0Conf = R.complement( /* NOTE: List of coins without 0conf settings. */ - R.pipe(R.prop('id'), R.flip(R.includes)(['ETH', 'USDT'])) + R.pipe(R.prop('id'), R.flip(R.includes)(['ETH', 'USDT', 'USDC'])) ) const getElements = (cryptoCurrencies, accounts, onChange, wizard = false) => { diff --git a/new-lamassu-admin/src/styling/logos/icon-usdc-colour.svg b/new-lamassu-admin/src/styling/logos/icon-usdc-colour.svg new file mode 100644 index 00000000..5dfea926 --- /dev/null +++ b/new-lamassu-admin/src/styling/logos/icon-usdc-colour.svg @@ -0,0 +1,5 @@ + + + + +