diff --git a/lib/blockchain/install.js b/lib/blockchain/install.js index 0c2bcdfe..821591d6 100644 --- a/lib/blockchain/install.js +++ b/lib/blockchain/install.js @@ -23,10 +23,8 @@ const PLUGINS = { BTC: require('./bitcoin.js'), BCH: require('./bitcoincash.js'), DASH: require('./dash.js'), - ETH: require('./ethereum.js'), LTC: require('./litecoin.js'), - XMR: require('./monero.js'), - ZEC: require('./zcash.js') + XMR: require('./monero.js') } const BLOCKCHAIN_DIR = process.env.BLOCKCHAIN_DIR @@ -207,10 +205,6 @@ function isInstalled (crypto) { function isDisabled (crypto) { switch (crypto.cryptoCode) { - case 'ETH': - return 'Use admin\'s Infura plugin' - case 'ZEC': - return 'Use admin\'s BitGo plugin' case 'XMR': return isInstalled(crypto) && 'Installed' || isInstalled(_.find(it => it.code === 'zcash', cryptos)) && 'Insufficient resources. Contact support.' default: @@ -220,11 +214,10 @@ function isDisabled (crypto) { function run () { const choices = _.flow([ - _.filter(c => c.type !== 'erc-20'), + _.filter(c => !c.hideFromInstall), _.map(c => { - const name = c.code === 'ethereum' ? 'Ethereum and/or USDT' : c.display return { - name, + name: c.display, value: c.code, checked: isInstalled(c), disabled: isDisabled(c) diff --git a/lib/graphql/resolvers.js b/lib/graphql/resolvers.js index c97d48d3..c86dac81 100644 --- a/lib/graphql/resolvers.js +++ b/lib/graphql/resolvers.js @@ -89,6 +89,7 @@ const staticConfig = ({ currentConfigVersion, deviceId, deviceName, pq, settings 'cashInFee', 'cashOutCommission', 'cryptoCode', + 'cryptoCodeDisplay', 'cryptoNetwork', 'cryptoUnits', 'display', diff --git a/lib/graphql/types.js b/lib/graphql/types.js index 7840fa88..b7198b30 100644 --- a/lib/graphql/types.js +++ b/lib/graphql/types.js @@ -2,6 +2,7 @@ const { gql } = require('apollo-server-express') module.exports = gql` type Coin { cryptoCode: String! + cryptoCodeDisplay: String! display: String! minimumTx: String! cashInFee: String! diff --git a/lib/new-admin/config/accounts.js b/lib/new-admin/config/accounts.js index d32636db..05ab6089 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 } = COINS +const { BTC, BCH, DASH, ETH, LTC, USDT, ZEC, XMR, TRX, USDT_TRON } = COINS const { bitpay, coinbase, itbit, bitstamp, kraken, binanceus, cex, binance } = ALL const TICKER = 'ticker' @@ -29,6 +29,7 @@ const ALL_ACCOUNTS = [ { 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', class: WALLET, cryptos: [ETH, USDT] }, + { code: 'trongrid', display: 'Trongrid', class: WALLET, cryptos: [TRX, USDT_TRON] }, { code: 'geth', display: 'geth (deprecated)', class: WALLET, cryptos: [ETH, USDT] }, { code: 'zcashd', display: 'zcashd', class: WALLET, cryptos: [ZEC] }, { code: 'litecoind', display: 'litecoind', class: WALLET, cryptos: [LTC] }, diff --git a/lib/new-admin/config/index.js b/lib/new-admin/config/index.js index bb87e0c4..589de2b4 100644 --- a/lib/new-admin/config/index.js +++ b/lib/new-admin/config/index.js @@ -34,7 +34,8 @@ const mapLanguage = lang => { const massageCryptos = cryptos => { const convert = crypto => ({ code: crypto['cryptoCode'], - display: crypto['display'] + display: crypto['display'], + codeDisplay: crypto['cryptoCodeDisplay'] ?? crypto['cryptoCode'] }) return _.map(convert, cryptos) diff --git a/lib/new-admin/graphql/types/currency.type.js b/lib/new-admin/graphql/types/currency.type.js index ebfa91d8..a2d8afb4 100644 --- a/lib/new-admin/graphql/types/currency.type.js +++ b/lib/new-admin/graphql/types/currency.type.js @@ -9,6 +9,7 @@ const typeDef = gql` type CryptoCurrency { code: String! display: String! + codeDisplay: String! } type Query { diff --git a/lib/plugins.js b/lib/plugins.js index 72d9f337..ebdc63e1 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -312,6 +312,7 @@ function plugins (settings, deviceId) { return { cryptoCode, + cryptoCodeDisplay: cryptoRec.cryptoCodeDisplay ?? cryptoCode, display: cryptoRec.display, isCashInOnly: Boolean(cryptoRec.isCashinOnly), minimumTx: BN.max(minimumTx, cashInFee), diff --git a/lib/plugins/common/ccxt.js b/lib/plugins/common/ccxt.js index e870ce59..6b731d85 100644 --- a/lib/plugins/common/ccxt.js +++ b/lib/plugins/common/ccxt.js @@ -10,7 +10,7 @@ const bitpay = require('../ticker/bitpay') const binance = require('../exchange/binance') const logger = require('../../logger') -const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT } = COINS +const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, TRX, USDT_TRON } = COINS const ALL = { cex: cex, @@ -20,7 +20,7 @@ const ALL = { itbit: itbit, bitpay: bitpay, coinbase: { - CRYPTO: [BTC, ETH, LTC, DASH, ZEC, BCH, USDT], + CRYPTO: [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON, TRX], FIAT: 'ALL_CURRENCIES' }, binance: binance diff --git a/lib/plugins/exchange/binanceus.js b/lib/plugins/exchange/binanceus.js index f7185476..d68f78f5 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 } = COINS -const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, USDT] +const { BTC, BCH, DASH, ETH, LTC, ZEC, USDT, USDT_TRON } = COINS +const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, USDT, USDT_TRON] const FIAT = ['USD'] const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] diff --git a/lib/plugins/exchange/bitstamp.js b/lib/plugins/exchange/bitstamp.js index f325f447..05b0e23a 100644 --- a/lib/plugins/exchange/bitstamp.js +++ b/lib/plugins/exchange/bitstamp.js @@ -5,7 +5,7 @@ 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 CRYPTO = [BTC, ETH, LTC, BCH, USDT ] const FIAT = ['USD', 'EUR'] const AMOUNT_PRECISION = 8 const REQUIRED_CONFIG_FIELDS = ['key', 'secret', 'clientId'] diff --git a/lib/plugins/exchange/ccxt.js b/lib/plugins/exchange/ccxt.js index bc0c73a0..1124586d 100644 --- a/lib/plugins/exchange/ccxt.js +++ b/lib/plugins/exchange/ccxt.js @@ -9,8 +9,9 @@ const DEFAULT_PRICE_PRECISION = 2 const DEFAULT_AMOUNT_PRECISION = 8 function trade (side, account, tradeEntry, exchangeName) { - const { cryptoAtoms, fiatCode, cryptoCode, tradeId } = tradeEntry + const { cryptoAtoms, fiatCode, _cryptoCode, tradeId } = tradeEntry try { + const cryptoCode = coinUtils.getEquivalentCode(_cryptoCode) const exchangeConfig = ALL[exchangeName] if (!exchangeConfig) throw Error('Exchange configuration not found') diff --git a/lib/plugins/exchange/cex.js b/lib/plugins/exchange/cex.js index b38a85fe..03ef1f35 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 } = COINS -const CRYPTO = [BTC, ETH, LTC, DASH, BCH, USDT] +const { BTC, BCH, DASH, ETH, LTC, USDT, TRX, USDT_TRON } = COINS +const CRYPTO = [BTC, ETH, LTC, DASH, BCH, USDT, TRX, USDT_TRON] const FIAT = ['USD', 'EUR'] const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] diff --git a/lib/plugins/exchange/ftx.js b/lib/plugins/exchange/ftx.js deleted file mode 100644 index 09b57367..00000000 --- a/lib/plugins/exchange/ftx.js +++ /dev/null @@ -1,20 +0,0 @@ -const { COINS } = require('@lamassu/coins') -const _ = require('lodash/fp') - -const { ORDER_TYPES } = require('./consts') - -const ORDER_TYPE = ORDER_TYPES.MARKET -const { BTC, BCH, ETH, LTC, USDT } = COINS -const CRYPTO = [BTC, ETH, LTC, BCH, USDT] -const FIAT = ['USD'] -const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] - -const loadConfig = (account) => { - const mapper = { - 'privateKey': 'secret' - } - const mapped = _.mapKeys(key => mapper[key] ? mapper[key] : key)(account) - return { ...mapped, timeout: 3000 } -} - -module.exports = { loadConfig, REQUIRED_CONFIG_FIELDS, CRYPTO, FIAT, ORDER_TYPE } diff --git a/lib/plugins/exchange/kraken.js b/lib/plugins/exchange/kraken.js index 3b5e2032..856990b0 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 } = COINS -const CRYPTO = [BTC, ETH, LTC, DASH, ZEC, BCH, XMR, USDT] +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 FIAT = ['USD', 'EUR'] const AMOUNT_PRECISION = 6 const REQUIRED_CONFIG_FIELDS = ['apiKey', 'privateKey'] diff --git a/lib/plugins/wallet/geth/base.js b/lib/plugins/wallet/geth/base.js index 2eeb7a1c..bdf5bd73 100644 --- a/lib/plugins/wallet/geth/base.js +++ b/lib/plugins/wallet/geth/base.js @@ -16,8 +16,6 @@ const BN = require('../../../bn') const ABI = require('../../tokens') const logger = require('../../../logger') -exports.SUPPORTED_MODULES = ['wallet'] - const paymentPrefixPath = "m/44'/60'/0'/0'" const defaultPrefixPath = "m/44'/60'/1'/0'" let lastUsedNonces = {} diff --git a/lib/plugins/wallet/pazuz-wallet/pazuz-wallet.js b/lib/plugins/wallet/pazuz-wallet/pazuz-wallet.js index 582b7d40..afb0aa74 100644 --- a/lib/plugins/wallet/pazuz-wallet/pazuz-wallet.js +++ b/lib/plugins/wallet/pazuz-wallet/pazuz-wallet.js @@ -87,10 +87,6 @@ function sweep (account, txId, cryptoCode, hdIndex, settings, operatorId) { throw new E.NotImplementedError() } -function isStrictAddress (cryptoCode, toAddress, settings, operatorId) { - throw new E.NotImplementedError() -} - module.exports = { balance, sendCoins, @@ -99,5 +95,4 @@ module.exports = { getStatus, sweep, supportsHd: true, - isStrictAddress } diff --git a/lib/plugins/wallet/tron/base.js b/lib/plugins/wallet/tron/base.js new file mode 100644 index 00000000..c3a854f5 --- /dev/null +++ b/lib/plugins/wallet/tron/base.js @@ -0,0 +1,191 @@ +const TronWeb = require('tronweb') +const coins = require('@lamassu/coins') +const { default: PQueue } = require('p-queue') + +const BN = require('../../../bn') + +let tronWeb = null + +const DEFAULT_PREFIX_PATH = "m/44'/195'/0'/0" +const PAYMENT_PREFIX_PATH = "m/44'/195'/1'/0" + +const SWEEP_QUEUE = new PQueue({ + concurrency: 3, + interval: 250, +}) + +function checkCryptoCode (cryptoCode) { + if (cryptoCode === 'TRX' || coins.utils.isTrc20Token(cryptoCode)) { + return Promise.resolve(cryptoCode) + } + return Promise.reject(new Error('cryptoCode must be TRX')) +} + +function defaultWallet (account) { + const mnemonic = account.mnemonic + if (!mnemonic) throw new Error('No mnemonic seed!') + + return TronWeb.fromMnemonic(mnemonic.replace(/[\r\n]/gm, ' ').trim(), `${DEFAULT_PREFIX_PATH}/0`) +} + +function paymentWallet (account, index) { + const mnemonic = account.mnemonic + if (!mnemonic) throw new Error('No mnemonic seed!') + + return TronWeb.fromMnemonic(mnemonic.replace(/[\r\n]/gm, ' ').trim(), `${PAYMENT_PREFIX_PATH}/${index}`) +} + +function newAddress (account, info, tx, settings, operatorId) { + const wallet = paymentWallet(account, info.hdIndex) + return Promise.resolve(wallet.address) +} + +function defaultAddress (account) { + return defaultWallet(account).address +} + +function balance (account, cryptoCode, settings, operatorId) { + return checkCryptoCode(cryptoCode) + .then(code => confirmedBalance(defaultAddress(account), code)) +} + +const confirmedBalance = (address, cryptoCode) => _balance(address, cryptoCode) + +const _balance = async (address, cryptoCode) => { + if (coins.utils.isTrc20Token(cryptoCode)) { + const contractAddress = coins.utils.getTrc20Token(cryptoCode).contractAddress + const { abi } = await tronWeb.trx.getContract(contractAddress) + const contract = tronWeb.contract(abi.entrys, contractAddress) + + const balance = await contract.methods.balanceOf(address).call() + return BN(balance.toString()) + } + + const balance = await tronWeb.trx.getBalance(address) + return balance ? BN(balance) : BN(0) +} + +const sendCoins = async (account, tx) => { + const { toAddress, cryptoAtoms, cryptoCode } = tx + const isTrc20Token = coins.utils.isTrc20Token(cryptoCode) + + const txFunction = isTrc20Token ? generateTrc20Tx : generateTx + const rawTx = await txFunction(toAddress, defaultWallet(account), cryptoAtoms.toString(), cryptoCode) + + let response = null + + try { + response = await tronWeb.trx.sendRawTransaction(rawTx) + if (!response.result) throw new Error(response.code) + } catch (err) { + // for some reason err here is just a string + throw new Error(err) + } + + const transaction = response.transaction + const txid = transaction.txID + const transactionInfo = tronWeb.trx.getTransactionInfo(txid) + + if (!transactionInfo || !transactionInfo.fee) return { txid } + + const fee = new BN(transactionInfo.fee).decimalPlaces(0) + return { txid, fee } +} + +const generateTrc20Tx = async (toAddress, wallet, amount, cryptoCode) => { + const contractAddress = coins.utils.getTrc20Token(cryptoCode).contractAddress + const functionSelector = 'transfer(address,uint256)' + const parameters = [ + { type: 'address', value: tronWeb.address.toHex(toAddress) }, + { type: 'uint256', value: amount } + ] + + const tx = await tronWeb.transactionBuilder.triggerSmartContract(contractAddress, functionSelector, {}, parameters, wallet.address) + + return tronWeb.trx.sign(tx.transaction, wallet.privateKey.slice(2)) +} + +const generateTx = async (toAddress, wallet, amount) => { + const transaction = await tronWeb.transactionBuilder.sendTrx(toAddress, amount, wallet.address) + + const privateKey = wallet.privateKey + + // their api return a hex string starting with 0x but expects without it + return tronWeb.trx.sign(transaction, privateKey.slice(2)) +} + +function newFunding (account, cryptoCode) { + return checkCryptoCode(cryptoCode) + .then(code => { + const fundingAddress = defaultAddress(account) + + return confirmedBalance(fundingAddress, code) + .then((balance) => ({ + fundingPendingBalance: BN(0), + fundingConfirmedBalance: balance, + fundingAddress + })) + }) +} + +function sweep (account, txId, cryptoCode, hdIndex) { + const wallet = paymentWallet(account, hdIndex) + const fromAddress = wallet.address + const isTrc20Token = coins.utils.isTrc20Token(cryptoCode) + + const txFunction = isTrc20Token ? generateTrc20Tx : generateTx + + return SWEEP_QUEUE.add(async () => { + const r = await confirmedBalance(fromAddress, cryptoCode) + if (r.eq(0)) return + const signedTx = await txFunction(defaultAddress(account), wallet, r.toString(), cryptoCode) + let response = null + try { + response = await tronWeb.trx.sendRawTransaction(signedTx) + if (!response.result) throw new Error(response.code) + } catch (err) { + // for some reason err here is just a string + throw new Error(err) + } + return response + }) +} + +function connect(account) { + if (tronWeb != null) return + const endpoint = account.endpoint + const apiKey = account.apiKey + tronWeb = new TronWeb({ + fullHost: endpoint, + headers: { "TRON-PRO-API-KEY": apiKey }, + privateKey: '01' + }) +} + +function getStatus (account, tx, requested, settings, operatorId) { + const { toAddress, cryptoCode } = tx + return checkCryptoCode(cryptoCode) + .then(code => confirmedBalance(toAddress, code)) + .then((confirmed) => { + if (confirmed.gte(requested)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' } + if (confirmed.gt(0)) return { receivedCryptoAtoms: confirmed, status: 'insufficientFunds' } + return { receivedCryptoAtoms: 0, status: 'notSeen' } + }) +} + +function getTxHashesByAddress (cryptoCode, address) { + throw new Error(`Transactions hash retrieval is not implemented for this coin!`) +} + +module.exports = { + balance, + sendCoins, + newAddress, + getStatus, + sweep, + defaultAddress, + supportsHd: true, + newFunding, + connect, + getTxHashesByAddress, +} diff --git a/lib/plugins/wallet/trongrid/trongrid.js b/lib/plugins/wallet/trongrid/trongrid.js new file mode 100644 index 00000000..4d21a522 --- /dev/null +++ b/lib/plugins/wallet/trongrid/trongrid.js @@ -0,0 +1,12 @@ +const _ = require('lodash/fp') +const base = require('../tron/base') + +const NAME = 'trongrid' + +function run (account) { + const endpoint = 'https://api.trongrid.io' + + base.connect({ ...account, endpoint }) +} + +module.exports = _.merge(base, { NAME, run }) diff --git a/lib/ticker.js b/lib/ticker.js index 1536fafb..389a0428 100644 --- a/lib/ticker.js +++ b/lib/ticker.js @@ -1,3 +1,4 @@ +const { utils: coinUtils } = require('@lamassu/coins') const _ = require('lodash/fp') const mem = require('mem') const configManager = require('./new-config-manager') @@ -35,10 +36,13 @@ function _getRates (settings, fiatCode, cryptoCode) { }) } -function buildTicker (fiatCode, cryptoCode, tickerName) { +function buildTicker (fiatCode, _cryptoCode, tickerName) { const fiatPeggedEquivalent = _.includes(fiatCode, _.keys(PEGGED_FIAT_CURRENCIES)) ? PEGGED_FIAT_CURRENCIES[fiatCode] : fiatCode + + const cryptoCode = coinUtils.getEquivalentCode(_cryptoCode) + if (tickerName === 'bitpay') return bitpay.ticker(fiatPeggedEquivalent, cryptoCode) if (tickerName === 'mock-ticker') return mockTicker.ticker(fiatPeggedEquivalent, cryptoCode) return ccxt.ticker(fiatPeggedEquivalent, cryptoCode, tickerName) diff --git a/lib/wallet.js b/lib/wallet.js index ecdf66fc..24f6b5c2 100644 --- a/lib/wallet.js +++ b/lib/wallet.js @@ -38,9 +38,10 @@ function fetchWallet (settings, cryptoCode) { const wallet = ph.load(ph.WALLET, plugin) const rawAccount = settings.accounts[plugin] const account = _.set('seed', computeSeed(masterSeed), rawAccount) - if (_.isFunction(wallet.run)) wallet.run(account) + const accountWithMnemonic = _.set('mnemonic', mnemonic, account) + if (_.isFunction(wallet.run)) wallet.run(accountWithMnemonic) const operatorId = computeOperatorId(masterSeed) - return { wallet, account, operatorId } + return { wallet, account: accountWithMnemonic, operatorId } }) } diff --git a/new-lamassu-admin/package-lock.json b/new-lamassu-admin/package-lock.json index e8a410d0..55e525df 100644 --- a/new-lamassu-admin/package-lock.json +++ b/new-lamassu-admin/package-lock.json @@ -4394,15 +4394,16 @@ } }, "@lamassu/coins": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@lamassu/coins/-/coins-1.2.0.tgz", - "integrity": "sha512-xp1R2+hd++6WfDOrHxpUdPBqnQiWDz0KttoSHu4KkQsCKCmjr2zUcf6NRKr3syqAhBKekYX+8kDL27VVG+OuUw==", + "version": "1.3.1-trx.3", + "resolved": "https://registry.npmjs.org/@lamassu/coins/-/coins-1.3.1-trx.3.tgz", + "integrity": "sha512-ZYbevhcXnnErrUPlev+TeIh+DV82OjzIBTEE/cVHN6iM/+tT0GLVXzuZtNghXBLZpATNOwyFGl+mcUdZJvn2PA==", "requires": { "bech32": "2.0.0", "big-integer": "^1.6.48", "bignumber.js": "^9.0.0", "bitcoinjs-lib": "4.0.3", "bitcore-lib-cash": "^8.25.25", + "blakejs": "^1.2.1", "bs58check": "^2.0.2", "cashaddrjs": "~0.2.8", "crypto-js": "^3.1.9-1", @@ -8396,9 +8397,9 @@ } }, "bitcore-lib": { - "version": "8.25.28", - "resolved": "https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-8.25.28.tgz", - "integrity": "sha512-UrNHh0Ba8GUiHUYRmm2IKlb8eomsbvk/Z6oQdaOPQoLiamiKnu45pAMqtcHg06wMDF8at54oIdoD2WEU+TQujw==", + "version": "8.25.47", + "resolved": "https://registry.npmjs.org/bitcore-lib/-/bitcore-lib-8.25.47.tgz", + "integrity": "sha512-qDZr42HuP4P02I8kMGZUx/vvwuDsz8X3rQxXLfM0BtKzlQBcbSM7ycDkDN99Xc5jzpd4fxNQyyFXOmc6owUsrQ==", "requires": { "bech32": "=2.0.0", "bip-schnorr": "=0.6.4", @@ -8413,16 +8414,16 @@ "inherits": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==" } } }, "bitcore-lib-cash": { - "version": "8.25.28", - "resolved": "https://registry.npmjs.org/bitcore-lib-cash/-/bitcore-lib-cash-8.25.28.tgz", - "integrity": "sha512-Zaue7z/iDdQDTNsDoX8LkxH04/pCpHKpSgbxJe2D/2n1YLi1JtzOl9Ox4agYQtR/k9SWCg4p8qJ1W7lVWVP8+A==", + "version": "8.25.47", + "resolved": "https://registry.npmjs.org/bitcore-lib-cash/-/bitcore-lib-cash-8.25.47.tgz", + "integrity": "sha512-Qk8L0zLJPv34vSd3pbOOvjpgIi/gU6SHSmX1lJY+lwL9S16KF8fi1Lc9/RNm2tWLGiuMxrg2vKV/9U0yCuQBlQ==", "requires": { - "bitcore-lib": "^8.25.28", + "bitcore-lib": "^8.25.47", "bn.js": "=4.11.8", "bs58": "^4.0.1", "buffer-compare": "=1.1.1", @@ -8434,10 +8435,15 @@ "inherits": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==" } } }, + "blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + }, "bluebird": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", @@ -17311,9 +17317,9 @@ } }, "keccak": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", - "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", + "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", "requires": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0", @@ -17331,9 +17337,9 @@ }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "buffer": { "version": "6.0.3", @@ -18181,7 +18187,7 @@ "merkle-lib": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/merkle-lib/-/merkle-lib-2.0.10.tgz", - "integrity": "sha1-grjbrnXieneFOItz+ddyXQ9vMyY=" + "integrity": "sha512-XrNQvUbn1DL5hKNe46Ccs+Tu3/PYOlrcZILuGUhb95oKBPjc/nmIC8D462PQkipVDGKRvwhn+QFg2cCdIvmDJA==" }, "methods": { "version": "1.1.2", @@ -18638,9 +18644,9 @@ "dev": true }, "node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", + "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==" }, "node-int64": { "version": "0.4.0", @@ -21120,7 +21126,7 @@ "pushdata-bitcoin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz", - "integrity": "sha1-FZMdPNlnreUiBvUjqnMxrvfUOvc=", + "integrity": "sha512-hw7rcYTJRAl4olM8Owe8x0fBuJJ+WGbMhQuLWOXEMN3PxPCKQHRkhfL+XG0+iXUmSHjkMmb3Ba55Mt21cZc9kQ==", "requires": { "bitcoin-ops": "^1.3.0" } @@ -29088,7 +29094,7 @@ "wif": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", - "integrity": "sha1-CNP1IFbGZnkplyb63g1DKudLRwQ=", + "integrity": "sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ==", "requires": { "bs58check": "<3.0.0" } diff --git a/new-lamassu-admin/package.json b/new-lamassu-admin/package.json index ec21f781..4c0a46f5 100644 --- a/new-lamassu-admin/package.json +++ b/new-lamassu-admin/package.json @@ -4,7 +4,7 @@ "license": "unlicense", "dependencies": { "@apollo/react-hooks": "^3.1.3", - "@lamassu/coins": "1.2.0", + "@lamassu/coins": "v1.3.1-trx.3", "@material-ui/core": "4.11.0", "@material-ui/icons": "4.9.1", "@material-ui/lab": "^4.0.0-alpha.56", diff --git a/new-lamassu-admin/src/pages/Funding.js b/new-lamassu-admin/src/pages/Funding.js index 13f2a6c8..e642aaf3 100644 --- a/new-lamassu-admin/src/pages/Funding.js +++ b/new-lamassu-admin/src/pages/Funding.js @@ -190,7 +190,7 @@ const Funding = () => { {selected && !viewHistory && !selected.errorMsg && (