Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LAM-1336] feat: add USDC #1795

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/new-admin/config/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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] },
Expand Down Expand Up @@ -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 },
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/common/ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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'
},
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/exchange/binanceus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/exchange/bitfinex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/exchange/bitstamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/exchange/kraken.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions new-lamassu-admin/src/pages/Wallet/WizardSplash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -56,6 +57,8 @@ const getLogo = code => {
case 'USDT':
case 'USDT_TRON':
return TetherLogo
case 'USDC':
return USDCLogo
case 'XMR':
return MoneroLogo
case 'TRX':
Expand Down
2 changes: 1 addition & 1 deletion new-lamassu-admin/src/pages/Wallet/helper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
5 changes: 5 additions & 0 deletions new-lamassu-admin/src/styling/logos/icon-usdc-colour.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@ethereumjs/tx": "^3.5.1",
"@graphql-tools/merge": "^6.2.5",
"@haensl/subset-sum": "^3.0.5",
"@lamassu/coins": "v1.4.12",
"@lamassu/coins": "v1.5.4",
"@simplewebauthn/server": "^3.0.0",
"@vonage/auth": "1.5.0",
"@vonage/server-client": "1.7.0",
Expand Down