diff --git a/assets/img/currencies/png/RBTC.png b/assets/img/currencies/png/RBTC.png new file mode 100644 index 0000000000..8b592cb0f3 Binary files /dev/null and b/assets/img/currencies/png/RBTC.png differ diff --git a/assets/img/currencies/png/xusd.png b/assets/img/currencies/png/xusd.png new file mode 100644 index 0000000000..5ec67bcf32 Binary files /dev/null and b/assets/img/currencies/png/xusd.png differ diff --git a/assets/img/currencies/rbtc.svg b/assets/img/currencies/rbtc.svg new file mode 100644 index 0000000000..72d40c535b --- /dev/null +++ b/assets/img/currencies/rbtc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/currencies/xusd.svg b/assets/img/currencies/xusd.svg new file mode 100644 index 0000000000..d86a30137e --- /dev/null +++ b/assets/img/currencies/xusd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/constants/SupportedCurrencyOptions.tsx b/src/constants/SupportedCurrencyOptions.tsx index 42126d0fb8..15a82c548c 100644 --- a/src/constants/SupportedCurrencyOptions.tsx +++ b/src/constants/SupportedCurrencyOptions.tsx @@ -2,6 +2,8 @@ import React, {ReactElement} from 'react'; import BtcIcon from '../../assets/img/currencies/btc.svg'; import BchIcon from '../../assets/img/currencies/bch.svg'; import EthIcon from '../../assets/img/currencies/eth.svg'; +import RbtcIcon from '../../assets/img/currencies/rbtc.svg'; +import XUSDIcon from '../../assets/img/currencies/xusd.svg'; import DogeIcon from '../../assets/img/currencies/doge.svg'; import LtcIcon from '../../assets/img/currencies/ltc.svg'; import XrpIcon from '../../assets/img/currencies/xrp.svg'; @@ -32,6 +34,8 @@ export const CurrencyListIcons: { btc: props => , bch: props => , eth: props => , + rbtc: props => , + xusd: props => , doge: props => , ltc: props => , xrp: props => , @@ -71,6 +75,14 @@ export const SupportedCurrencyOptions: Array = [ hasMultisig: false, // TODO imgSrc: require('../../assets/img/currencies/png/ETH.png'), }, + { + id: 'rbtc', + img: CurrencyListIcons.rbtc, + currencyName: 'RSK', + currencyAbbreviation: 'RBTC', + hasMultisig: false, // TODO + imgSrc: require('../../assets/img/currencies/png/RBTC.png'), + }, { id: 'doge', img: CurrencyListIcons.doge, @@ -142,6 +154,14 @@ export const SupportedCurrencyOptions: Array = [ isToken: true, imgSrc: require('../../assets/img/currencies/png/BUSD.png'), }, + { + id: 'xusd', + img: CurrencyListIcons.xusd, + currencyName: 'Sovryn XUSD', + currencyAbbreviation: 'XUSD', + isToken: true, + imgSrc: require('../../assets/img/currencies/png/xusd.png'), + }, { id: 'dai', img: CurrencyListIcons.dai, diff --git a/src/constants/config.card.ts b/src/constants/config.card.ts index 378df47c76..93fb824127 100644 --- a/src/constants/config.card.ts +++ b/src/constants/config.card.ts @@ -8,6 +8,7 @@ import BUSDShape from '../navigation/card/assets/currency-shapes/BUSD-shape.svg' import DAIShape from '../navigation/card/assets/currency-shapes/DAI-shape.svg'; import DOGEShape from '../navigation/card/assets/currency-shapes/DOGE-shape.svg'; import ETHShape from '../navigation/card/assets/currency-shapes/ETH-shape.svg'; +import RBTCShape from '../navigation/card/assets/currency-shapes/RBTC-shape.svg'; import GUSDShape from '../navigation/card/assets/currency-shapes/GUSD-shape.svg'; import USDPShape from '../navigation/card/assets/currency-shapes/USDP-shape.svg'; import USDCShape from '../navigation/card/assets/currency-shapes/USDC-shape.svg'; @@ -192,6 +193,18 @@ export const SUPPORTED_DESIGN_CURRENCIES: SupportedDesignCurrenciesConfig = { pillCircleBackground: '#FFF', }, }, + RBTC: { + currency: 'RBTC', + enabled: true, + palette: { + BackgroundShape: RBTCShape, + stopColor1: '#9A9FF1', + stopColor2: '#575DC2', + pillColor: '#FFF', + pillBackground: '#595FC6', + pillCircleBackground: '#FFF', + }, + }, GUSD: { currency: 'GUSD', enabled: true, diff --git a/src/constants/currencies.ts b/src/constants/currencies.ts index 2165480eca..034f222046 100644 --- a/src/constants/currencies.ts +++ b/src/constants/currencies.ts @@ -1,4 +1,4 @@ -export type SupportedCoins = 'btc' | 'bch' | 'ltc' | 'doge' | 'eth'; +export type SupportedCoins = 'btc' | 'bch' | 'ltc' | 'doge' | 'eth' | 'rbtc'; export type SupportedTokens = | 'usdc' | 'gusd' @@ -8,7 +8,8 @@ export type SupportedTokens = | 'wbtc' | 'shib' | 'ape' - | 'euroc'; + | 'euroc' + | 'xusd'; export type SupportedCurrencies = SupportedCoins | SupportedTokens; export interface CurrencyOpts { @@ -168,6 +169,117 @@ export const Currencies: {[key in string]: CurrencyOpts} = { gradientBackgroundColor: '#6b71d6', }, }, + rbtc: { + name: 'Smart Bitcoin', + chain: 'RSK', + coin: 'rbtc', + unitInfo: { + unitName: 'RBTC', + unitToSatoshi: 1e18, + unitDecimals: 18, + unitCode: 'rbtc' + }, + properties: { + hasMultiSig: false, + hasMultiSend: false, + isUtxo: false, + isERCToken: false, + isStableCoin: false, + singleAddress: true + }, + paymentInfo: { + paymentCode: 'EIP681', + protocolPrefix: { livenet: 'rsk', testnet: 'rsk' }, + ratesApi: 'https://bws.bitpay.com/bws/api/v3/fiatrates/rbtc', + blockExplorerUrls: 'explorer.rsk.co/', + blockExplorerUrlsTestnet: 'explorer.testet.rsk.co/' + }, + feeInfo: { + feeUnit: 'Gwei', + feeUnitAmount: 1e9, + blockTime: 0.53, + maxMerchantFee: 'urgent' + }, + theme: { + coinColor: '#41d434', + backgroundColor: '#1e90ff', + gradientBackgroundColor: '#1e90ff' + } + }, + rsk: { // This entry is because exchange-rates assumes that chain and coin are the same and asks for theme to 'rsk' + name: 'Smart Bitcoin', + chain: 'RSK', + coin: 'rbtc', + unitInfo: { + unitName: 'RBTC', + unitToSatoshi: 1e18, + unitDecimals: 18, + unitCode: 'rbtc' + }, + properties: { + hasMultiSig: false, + hasMultiSend: false, + isUtxo: false, + isERCToken: false, + isStableCoin: false, + singleAddress: true + }, + paymentInfo: { + paymentCode: 'EIP681', + protocolPrefix: { livenet: 'rsk', testnet: 'rsk' }, + ratesApi: 'https://bws.bitpay.com/bws/api/v3/fiatrates/btc', + blockExplorerUrls: 'explorer.rsk.co/', + blockExplorerUrlsTestnet: 'explorer.testet.rsk.co/' + }, + feeInfo: { + feeUnit: 'Gwei', + feeUnitAmount: 1e9, + blockTime: 0.53, + maxMerchantFee: 'urgent' + }, + theme: { + coinColor: '#41d434', + backgroundColor: '#1e90ff', + gradientBackgroundColor: '#1e90ff' + }, + }, + xusd: { + name: 'Sovryn XUSD', + chain: 'RSK', + coin: 'xusd', + unitInfo: { + unitName: 'XUSD', + unitToSatoshi: 1e18, + unitDecimals: 18, + unitCode: 'xusd', + }, + properties: { + hasMultiSig: false, + hasMultiSend: false, + isUtxo: false, + isERCToken: true, + isStableCoin: true, + singleAddress: true, + }, + paymentInfo: { + paymentCode: 'EIP681', + protocolPrefix: { livenet: 'rsk', testnet: 'rsk' }, + ratesApi: 'https://bws.bitpay.com/bws/api/v3/fiatrates/xusd', + blockExplorerUrls: 'explorer.rsk.co/', + blockExplorerUrlsTestnet: 'explorer.testet.rsk.co/' + }, + feeInfo: { + feeUnit: 'Gwei', + feeUnitAmount: 1e9, + blockTime: 0.2, + maxMerchantFee: 'urgent', + }, + theme: { + coinColor: '#f3ba2d', + backgroundColor: 'rgba(135,206,250,1)', + gradientBackgroundColor: 'rgba(30,144,255, 0.2)', + }, + }, xrp: { name: 'XRP', chain: 'XRP', @@ -628,7 +740,7 @@ export const SUPPORTED_TOKENS = [ 'ape', 'euroc', ]; -export const SUPPORTED_COINS = ['btc', 'bch', 'eth', 'doge', 'ltc', 'xrp']; +export const SUPPORTED_COINS = ['btc', 'bch', 'eth', 'rbtc', 'doge', 'ltc', 'xrp']; export const SUPPORTED_CURRENCIES = [...SUPPORTED_COINS, ...SUPPORTED_TOKENS]; export const POPULAR_TOKENS = [ 'UNI', diff --git a/src/constants/defaultDerivationPath.ts b/src/constants/defaultDerivationPath.ts index bbb95d40d3..523ad93a47 100644 --- a/src/constants/defaultDerivationPath.ts +++ b/src/constants/defaultDerivationPath.ts @@ -2,6 +2,7 @@ export enum DefaultDerivationPath { defaultBTC = "m/44'/0'/0'", defaultBCH = "m/44'/145'/0'", defaultETH = "m/44'/60'/0'", + defaultRBTC = "m/44'/137'/0'", defaultXRP = "m/44'/144'/0'", defaultDOGE = "m/44'/3'/0'", defaultLTC = "m/44'/2'/0'", diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index 7bd02e7c91..959e77e2f0 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -32,6 +32,12 @@ export const BitpaySupportedTokenOpts: TokenOptsType = { decimals: 18, address: '0x4fabb145d64652a948d72533023f6e7a623c7c53', }, + xusd: { + name: 'Sovryn XUSD', + symbol: 'XUSD', + decimals: 18, + address: '0xb5999795BE0EbB5bAb23144AA5FD6A02D080299F', + }, dai: { name: 'Dai', symbol: 'DAI', @@ -89,6 +95,12 @@ export const BitpaySupportedTokenOptsByAddress: TokenOptsType = { decimals: 18, address: '0x4fabb145d64652a948d72533023f6e7a623c7c53', }, + '0xb5999795BE0EbB5bAb23144AA5FD6A02D080299F': { + name: 'Sovryn XUSD', + symbol: 'XUSD', + decimals: 18, + address: '0xb5999795BE0EbB5bAb23144AA5FD6A02D080299F', + }, '0x6b175474e89094c44da98b954eedeac495271d0f': { name: 'Dai', symbol: 'DAI', diff --git a/src/navigation/card/assets/currency-shapes/RBTC-shape.svg b/src/navigation/card/assets/currency-shapes/RBTC-shape.svg new file mode 100644 index 0000000000..72d40c535b --- /dev/null +++ b/src/navigation/card/assets/currency-shapes/RBTC-shape.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/navigation/wallet/screens/CurrencySelection.tsx b/src/navigation/wallet/screens/CurrencySelection.tsx index 306fabfd99..8b739b166d 100644 --- a/src/navigation/wallet/screens/CurrencySelection.tsx +++ b/src/navigation/wallet/screens/CurrencySelection.tsx @@ -129,6 +129,7 @@ const DESCRIPTIONS: Record = { const POPULAR_TOKENS: Record = { eth: ['usdc', 'busd', 'ape'], + rsk: ['xusd'], matic: ['usdc', 'busd', 'gusd'], }; @@ -256,7 +257,7 @@ const CurrencySelection: React.VFC = ({ const tokenData = Currencies[k] || appTokenData[k] || appCustomTokenData[k]; - const chainData = chainMap[tokenData.chain.toLowerCase()]; + const chainData = chainMap[tokenData.chain.toLowerCase() === 'rsk' ? 'rbtc' : tokenData.chain.toLowerCase()]; const imgSrc = SupportedCurrencyOptions.find(c => c.id === k)?.imgSrc; const isReqSrc = ( src: ImageSourcePropType | undefined, diff --git a/src/navigation/wallet/screens/WalletDetails.tsx b/src/navigation/wallet/screens/WalletDetails.tsx index 28adcdcb45..8d6150a77c 100644 --- a/src/navigation/wallet/screens/WalletDetails.tsx +++ b/src/navigation/wallet/screens/WalletDetails.tsx @@ -714,6 +714,12 @@ const WalletDetails: React.FC = ({route}) => { ? `https://${Currencies.eth.paymentInfo.blockExplorerUrls}address/${address}` : `https://${Currencies.eth.paymentInfo.blockExplorerUrlsTestnet}address/${address}`; } + if (coin === 'rbtc') { + url = + fullWalletObj.network === 'livenet' + ? `https://${Currencies.rbtc.paymentInfo.blockExplorerUrls}address/${address}` + : `https://${Currencies.rbtc.paymentInfo.blockExplorerUrlsTestnet}address/${address}`; + } if (dispatch(IsERCToken(coin))) { url = fullWalletObj.network === 'livenet' diff --git a/src/navigation/wallet/screens/send/SendTo.tsx b/src/navigation/wallet/screens/send/SendTo.tsx index 1ed014f4fd..c3e8e1520e 100644 --- a/src/navigation/wallet/screens/send/SendTo.tsx +++ b/src/navigation/wallet/screens/send/SendTo.tsx @@ -87,6 +87,7 @@ const ValidDataTypes: string[] = [ 'BitcoinAddress', 'BitcoinCashAddress', 'EthereumAddress', + 'RSKAddress', 'RippleAddress', 'DogecoinAddress', 'LitecoinAddress', @@ -94,6 +95,7 @@ const ValidDataTypes: string[] = [ 'BitcoinUri', 'BitcoinCashUri', 'EthereumUri', + 'RSKUri', 'DogecoinUri', 'LitecoinUri', 'BitPayUri', diff --git a/src/store/card/card.types.ts b/src/store/card/card.types.ts index 6e49854207..33113a81d1 100644 --- a/src/store/card/card.types.ts +++ b/src/store/card/card.types.ts @@ -28,6 +28,7 @@ export type SupportedCurrencies = | 'BTC' | 'BCH' | 'ETH' + | 'RBTC' | 'GUSD' | 'USDP' | 'BUSD' diff --git a/src/store/scan/scan.effects.ts b/src/store/scan/scan.effects.ts index 42b3fae80b..2fdf50ebd0 100644 --- a/src/store/scan/scan.effects.ts +++ b/src/store/scan/scan.effects.ts @@ -19,6 +19,8 @@ import { IsValidDogecoinUri, IsValidEthereumAddress, IsValidEthereumUri, + IsValidRSKAddress, + IsValidRSKUri, IsValidImportPrivateKey, IsValidJoinCode, IsValidLitecoinAddress, @@ -98,6 +100,9 @@ export const incomingData = // Ethereum URI } else if (IsValidEthereumUri(data)) { dispatch(handleEthereumUri(data, opts?.wallet)); + // RSK URI + } else if (IsValidRSKUri(data)) { + dispatch(handleRSKUri(data, opts?.wallet)); // Ripple URI } else if (IsValidRippleUri(data)) { dispatch(handleRippleUri(data, opts?.wallet)); @@ -128,6 +133,9 @@ export const incomingData = // Address (Ethereum) } else if (IsValidEthereumAddress(data)) { dispatch(handlePlainAddress(data, coin || 'eth', opts)); + // Address RSK + } else if (IsValidRSKAddress(data)) { + dispatch(handlePlainAddress(data, coin || 'rsk' || 'rbtc', opts)); // Address (Ripple) } else if (IsValidRippleAddress(data)) { dispatch(handlePlainAddress(data, coin || 'xrp', opts)); @@ -721,6 +729,39 @@ const handleEthereumUri = } }; +const handleRSKUri = + (data: string, wallet?: Wallet): Effect => + dispatch => { + dispatch(LogActions.info('[scan] Incoming-data: RSK URI')); + const coin = 'rbtc'; + const value = /[\?\&]value=(\d+([\,\.]\d+)?)/i; + const gasPrice = /[\?\&]gasPrice=(\d+([\,\.]\d+)?)/i; + let feePerKb; + if (gasPrice.exec(data)) { + feePerKb = Number(gasPrice.exec(data)![1]); + } + const address = ExtractBitPayUriAddress(data); + const recipient = { + type: 'address', + currency: coin, + address, + }; + if (!value.exec(data)) { + dispatch(goToAmount({coin, recipient, wallet, opts: {feePerKb}})); + } else { + const parsedAmount = value.exec(data)![1]; + const amount = Number(dispatch(FormatAmount(coin, Number(parsedAmount)))); + dispatch( + goToConfirm({ + recipient, + amount, + wallet, + opts: {feePerKb}, + }), + ); + } + }; + const handleRippleUri = (data: string, wallet?: Wallet): Effect => dispatch => { diff --git a/src/store/wallet/effects/create/create.ts b/src/store/wallet/effects/create/create.ts index a0dc275fd4..126eb85a2c 100644 --- a/src/store/wallet/effects/create/create.ts +++ b/src/store/wallet/effects/create/create.ts @@ -15,6 +15,7 @@ import { buildWalletObj, checkEncryptPassword, } from '../../utils/wallet'; +import { getRSKChainAbbrevation } from '../../utils/currency'; import { failedAddWallet, successAddWallet, @@ -244,7 +245,7 @@ const createMultipleWallets = })) as Wallet; wallets.push(wallet); - if (coin === 'eth') { + if (coin === 'eth' || coin === 'rbtc') { wallet.preferences = wallet.preferences || { tokenAddresses: [], }; @@ -307,7 +308,7 @@ const createWallet = (params: { bwcClient.fromString( key.createCredentials(password, { - coin, + coin: getRSKChainAbbrevation(coin), network, account, n: 1, @@ -323,7 +324,7 @@ const createWallet = (params: { { network, singleAddress, - coin, + coin: getRSKChainAbbrevation(coin), useNativeSegwit, }, (err: any) => { diff --git a/src/store/wallet/effects/transactions/transactions.ts b/src/store/wallet/effects/transactions/transactions.ts index b86afc6a9c..865cbebe31 100644 --- a/src/store/wallet/effects/transactions/transactions.ts +++ b/src/store/wallet/effects/transactions/transactions.ts @@ -12,6 +12,7 @@ import { IsCustomERCToken, IsERCToken, IsUtxoCoin, + getRSKCurrencyAbbrevation, } from '../../utils/currency'; import {ToAddress, ToLtcAddress} from '../address/address'; import { @@ -125,6 +126,7 @@ const ProcessTx = tx: TransactionProposal, ): Effect => dispatch => { + currencyAbbreviation = getRSKCurrencyAbbrevation(currencyAbbreviation); if (!tx || tx.action === 'invalid') { return tx; } @@ -823,7 +825,8 @@ export const buildTransactionDetails = time, hasMultiplesOutputs, } = transaction; - const {coin: currency} = wallet.credentials; + let {coin: currency} = wallet.credentials; + currency = getRSKCurrencyAbbrevation(currency); const chain = dispatch(GetChain(currency)).toLowerCase(); const _fee = fees || fee; diff --git a/src/store/wallet/utils/currency.ts b/src/store/wallet/utils/currency.ts index 12209cbf11..d4f76f52d3 100644 --- a/src/store/wallet/utils/currency.ts +++ b/src/store/wallet/utils/currency.ts @@ -34,7 +34,7 @@ export const GetPrecision = WALLET: {tokenData, customTokenData}, } = getState(); const tokens = {...tokenData, ...customTokenData}; - const currency = currencyAbbreviation.toLowerCase(); + const currency = getRSKCurrencyAbbrevation(currencyAbbreviation.toLowerCase()); return Currencies[currency]?.unitInfo || tokens[currency]?.unitInfo; }; @@ -76,6 +76,7 @@ export const IsERCToken = export const GetBlockExplorerUrl = (currencyAbbreviation: string, network: string = 'livenet'): Effect => (dispatch, getState) => { + currencyAbbreviation = getRSKCurrencyAbbrevation(currencyAbbreviation); const { WALLET: {tokenData, customTokenData}, } = getState(); @@ -147,3 +148,19 @@ export const isSingleAddressCoin = tokens[currency]?.properties.singleAddress ); }; + + /** + * In case of rsk chain and currency having different names. + * This function will return the currency name for rsk. + */ + export const getRSKCurrencyAbbrevation = (name: string) => { + return name === 'rsk' ? 'rbtc': name; + } + + /** + * In case of rsk chain and currency having different names. + * This function will return the chain name for rsk. + */ + export const getRSKChainAbbrevation = (name: string) => { + return name === 'rbtc' ? 'rsk': name; + } diff --git a/src/store/wallet/utils/validations.ts b/src/store/wallet/utils/validations.ts index f1cd8ac5bf..5c114dac8d 100644 --- a/src/store/wallet/utils/validations.ts +++ b/src/store/wallet/utils/validations.ts @@ -62,6 +62,11 @@ export const IsValidEthereumUri = (data: string): boolean => { return !!BWC.getCore().Validation.validateUri('ETH', data); }; +export const IsValidRSKUri = (data: string): boolean => { + data = SanitizeUri(data); + return !!BWC.getCore().Validation.validateUri('RSK', data); +}; + export const IsValidRippleUri = (data: string): boolean => { data = SanitizeUri(data); return !!BWC.getCore().Validation.validateUri('XRP', data); @@ -104,6 +109,10 @@ export const IsValidEthereumAddress = (data: string): boolean => { return !!BWC.getCore().Validation.validateAddress('ETH', 'livenet', data); }; +export const IsValidRSKAddress = (data: string): boolean => { + return !!BWC.getCore().Validation.validateAddress('RSK', 'livenet', data); +}; + export const IsValidRippleAddress = (data: string): boolean => { return !!BWC.getCore().Validation.validateAddress('XRP', 'livenet', data); }; @@ -219,6 +228,14 @@ export const ValidateURI = (data: string): any => { }; } + if (IsValidRSKUri(data)) { + return { + data, + type: 'RSKUri', + title: 'RSK URI', + }; + } + if (IsValidRippleUri(data)) { return { data, @@ -275,6 +292,14 @@ export const ValidateURI = (data: string): any => { }; } + if (IsValidRSKAddress(data)) { + return { + data, + type: 'RSKAddress', + title: 'RSK Address', + }; + } + if (IsValidRippleAddress(data)) { return { data, @@ -329,6 +354,7 @@ export const ValidateCoinAddress = ( const addressLtc = BWC.getBitcoreLtc().Address; return !!addressLtc.isValid(str, network); case 'eth': + case 'rsk': case 'xrp': const {Validation} = BWC.getCore(); return !!Validation.validateAddress(coin.toUpperCase(), network, str); diff --git a/src/store/wallet/utils/wallet.ts b/src/store/wallet/utils/wallet.ts index 9c36eb84ec..b1f1ec4f90 100644 --- a/src/store/wallet/utils/wallet.ts +++ b/src/store/wallet/utils/wallet.ts @@ -11,7 +11,7 @@ import {Credentials} from 'bitcore-wallet-client/ts_build/lib/credentials'; import {SUPPORTED_CURRENCIES} from '../../../constants/currencies'; import {CurrencyListIcons} from '../../../constants/SupportedCurrencyOptions'; import {BwcProvider} from '../../../lib/bwc'; -import {GetName, GetPrecision, GetProtocolPrefix} from './currency'; +import {GetName, GetPrecision, GetProtocolPrefix, getRSKChainAbbrevation} from './currency'; import merge from 'lodash.merge'; import cloneDeep from 'lodash.clonedeep'; import {convertToFiat, formatFiatAmount} from '../../../utils/helper-methods'; @@ -45,6 +45,11 @@ const mapAbbreviationAndName = currencyAbbreviation: 'usdp', currencyName: dispatch(GetName(coin)), }; + case 'rsk': + return { + currencyAbbreviation: 'rbtc', + currencyName: dispatch(GetName('rbtc')), + }; default: return { currencyAbbreviation: coin, @@ -207,6 +212,7 @@ export const toFiat = customRate?: number, ): Effect => dispatch => { + currencyAbbreviation = getRSKChainAbbrevation(currencyAbbreviation); const ratesPerCurrency = rates[currencyAbbreviation]; if (!ratesPerCurrency) { diff --git a/src/utils/helper-methods.ts b/src/utils/helper-methods.ts index f1063c0cd8..2f8889c79a 100644 --- a/src/utils/helper-methods.ts +++ b/src/utils/helper-methods.ts @@ -64,6 +64,9 @@ export const getNetworkName = (path: string): string => { case "60'": // for ETH networkName = 'livenet'; break; + case "137'": // for RSK + networkName = 'livenet'; + break; case "144'": // for XRP networkName = 'livenet'; break; @@ -114,6 +117,9 @@ export const isValidDerivationPathCoin = ( case 'eth': isValid = ["60'", "0'", "1'"].indexOf(coinCode) > -1; break; + case 'rbtc': + isValid = ["137'", "0'", "1'"].indexOf(coinCode) > -1; + break; case 'xrp': isValid = ["144'", "0'", "1'"].indexOf(coinCode) > -1; break;