diff --git a/src/common/constants.ts b/src/common/constants.ts index aa031936647..49c3e63ca13 100644 --- a/src/common/constants.ts +++ b/src/common/constants.ts @@ -184,5 +184,5 @@ export const bannerTypes = { } export const firebaseConfig = { - databaseURL: 'https://deriv-static-pricingfeedv2.firebaseio.com', + databaseURL: 'https://deriv-static-pricingfeed.firebaseio.com', } diff --git a/src/components/elements/symbols-shortcode.ts b/src/components/elements/symbols-shortcode.ts index 6458888eabd..7547e1df030 100644 --- a/src/components/elements/symbols-shortcode.ts +++ b/src/components/elements/symbols-shortcode.ts @@ -1,53 +1,51 @@ -// etfs -import ETFSICON from 'images/svg/symbols/etf-usd-500.svg' //commodities import Vol_1HZ250V from 'images/svg/symbols/volatility_250_1s.svg' import Vol_1HZ150V from 'images/svg/symbols/volatility_150_1s.svg' import WTI_OIL from 'images/svg/symbols/usd-brent.svg' import CL_BRENT from 'images/svg/symbols/pound-brent.svg' import XAGEUR from 'images/svg/symbols/silver-eur.svg' -import XAGUSD from 'images/svg/symbols/silver-usd.svg' +import frxXAGUSD from 'images/svg/symbols/silver-usd.svg' import XAUEUR from 'images/svg/symbols/gold-eur.svg' import XALUSD from 'images/svg/symbols/aluminium-usd.svg' -import XCUUSD from 'images/svg/symbols/copper-usd.svg' -import XAUUSD from 'images/svg/symbols/gold-usd.svg' +import frxXCUUSD from 'images/svg/symbols/copper-usd.svg' +import frxXAUUSD from 'images/svg/symbols/gold-usd.svg' import XNIUSD from 'images/svg/symbols/nickel-usd.svg' import XPBUSD from 'images/svg/symbols/lead-usd.svg' -import XPDUSD from 'images/svg/symbols/palladium-usd.svg' -import XPTUSD from 'images/svg/symbols/platinum-usd.svg' +import frxXPDUSD from 'images/svg/symbols/palladium-usd.svg' +import frxXPTUSD from 'images/svg/symbols/platinum-usd.svg' import XZNUSD from 'images/svg/symbols/zinc-usd.svg' //crypto -import ADAUSD from 'images/svg/symbols/ada-usd.svg' -import ALGUSD from 'images/svg/symbols/algorand.svg' -import AVAUSD from 'images/svg/symbols/avalanche.svg' -import BATUSD from 'images/svg/symbols/bat.svg' -import BCHUSD from 'images/svg/symbols/btc_cash_flag-new.svg' -import BNBUSD from 'images/svg/symbols/bnb-usd.svg' -import BTCETH from 'images/svg/symbols/btc-eth.svg' -import BTCLTC from 'images/svg/symbols/bct-ltc.svg' -import BTCUSD from 'images/svg/symbols/btc-usd.svg' -import DOGUSD from 'images/svg/symbols/dog-usd.svg' -import DOTUSD from 'images/svg/symbols/dot-usd.svg' -import DSHUSD from 'images/svg/symbols/dsh-usd1.svg' -import EOSUSD from 'images/svg/symbols/eos-usd1.svg' -import ETCUSD from 'images/svg/symbols/etc-usd.svg' -import ETHUSD from 'images/svg/symbols/eth-usd.svg' -import FILUSD from 'images/svg/symbols/fil-usd.svg' -import IOTUSD from 'images/svg/symbols/iot-usd.svg' -import LNKUSD from 'images/svg/symbols/lnk-usd.svg' -import LTCUSD from 'images/svg/symbols/ltc-usd.svg' -import MKRUSD from 'images/svg/symbols/mkr-usd.svg' -import MTCUSD from 'images/svg/symbols/mtc-usd.svg' -import NEOUSD from 'images/svg/symbols/neo-usd.svg' -import OMGUSD from 'images/svg/symbols/omg-usd.svg' -import SOLUSD from 'images/svg/symbols/sol-usd.svg' -import TRXUSD from 'images/svg/symbols/trx-usd.svg' -import UNIUSD from 'images/svg/symbols/uni-usd.svg' -import XLMUSD from 'images/svg/symbols/xlm-usd.svg' -import XMRUSD from 'images/svg/symbols/xmr-usd.svg' -import XRPUSD from 'images/svg/symbols/xrp-usd1.svg' -import XTZUSD from 'images/svg/symbols/xtz-usd.svg' -import ZECUSD from 'images/svg/symbols/zec-usd.svg' +import cryADAUSD from 'images/svg/symbols/ada-usd.svg' +import cryALGUSD from 'images/svg/symbols/algorand.svg' +import cryAVAUSD from 'images/svg/symbols/avalanche.svg' +import cryBATUSD from 'images/svg/symbols/bat.svg' +import cryBCHUSD from 'images/svg/symbols/btc_cash_flag-new.svg' +import cryBNBUSD from 'images/svg/symbols/bnb-usd.svg' +import cryBTCETH from 'images/svg/symbols/btc-eth.svg' +import cryBTCLTC from 'images/svg/symbols/bct-ltc.svg' +import cryBTCUSD from 'images/svg/symbols/btc-usd.svg' +import cryDOGUSD from 'images/svg/symbols/dog-usd.svg' +import cryDOTUSD from 'images/svg/symbols/dot-usd.svg' +import cryDSHUSD from 'images/svg/symbols/dsh-usd1.svg' +import cryEOSUSD from 'images/svg/symbols/eos-usd1.svg' +import cryETCUSD from 'images/svg/symbols/etc-usd.svg' +import cryETHUSD from 'images/svg/symbols/eth-usd.svg' +import cryFILUSD from 'images/svg/symbols/fil-usd.svg' +import cryIOTUSD from 'images/svg/symbols/iot-usd.svg' +import cryLNKUSD from 'images/svg/symbols/lnk-usd.svg' +import cryLTCUSD from 'images/svg/symbols/ltc-usd.svg' +import cryMKRUSD from 'images/svg/symbols/mkr-usd.svg' +import cryMTCUSD from 'images/svg/symbols/mtc-usd.svg' +import cryNEOUSD from 'images/svg/symbols/neo-usd.svg' +import cryOMGUSD from 'images/svg/symbols/omg-usd.svg' +import crySOLUSD from 'images/svg/symbols/sol-usd.svg' +import cryTRXUSD from 'images/svg/symbols/trx-usd.svg' +import cryUNIUSD from 'images/svg/symbols/uni-usd.svg' +import cryXLMUSD from 'images/svg/symbols/xlm-usd.svg' +import cryXMRUSD from 'images/svg/symbols/xmr-usd.svg' +import cryXRPUSD from 'images/svg/symbols/xrp-usd1.svg' +import cryXTZUSD from 'images/svg/symbols/xtz-usd.svg' +import cryZECUSD from 'images/svg/symbols/zec-usd.svg' //stocks import DEADS from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-adidas-salomon.svg' import FRAIR from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-airbus.svg' @@ -60,7 +58,7 @@ import DELHAG from 'images/svg/symbols/markets-stocks-and-indices/american-stock import DEPSHG from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-porsche.svg' import DEPUMG from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-puma.svg' import USAAL from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-american-airlines-group-inc.svg' -import AAPL from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-apple.svg' +import USAAPL from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-apple.svg' import USABNB from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-airbnb.svg' import USAIG from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-american-international-group.svg' import USAMD from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-amd.svg' @@ -73,7 +71,7 @@ import USC from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/s import USCRM from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-salesforce-com-inc.svg' import USCSCO from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-cisco-systems.svg' import USDAL from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-delta-air-lines.svg' -import DIS from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-walt-disney-company.svg' +import USDIS from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-walt-disney-company.svg' import USEBAY from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-e-bay-inc.svg' import USFB from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-facebook-inc.svg' import USFDX from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-fedex.svg' @@ -101,7 +99,7 @@ import USPG from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/ import USPYPL from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-paypal.svg' import USSONY from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-sony.svg' import USTEVA from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-teva-pharmaceutical-inds.svg' -import TSLA from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-tesla-inc.svg' +import USTSLMTR from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-tesla-inc.svg' import USUBER from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-uber-technologies-inc.svg' import USVISA from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-visa.svg' import USWMT from 'images/svg/symbols/markets-stocks-and-indices/american-stocks/stocks-wal-mart-stores-inc.svg' @@ -112,19 +110,19 @@ import OTC_SX5E from 'images/svg/symbols/markets-stocks-and-indices/european-ind import OTC_FCHI from 'images/svg/symbols/markets-stocks-and-indices/european-indices/france-40.svg' import OTC_N225 from 'images/svg/symbols/markets-stocks-and-indices/asian-indices/japan-225.svg' import OTC_FTSE from 'images/svg/symbols/markets-stocks-and-indices/european-indices/uk-100.svg' -import US_100 from 'images/svg/symbols/markets-stocks-and-indices/american-indices/us-tech-100.svg' -import US_30 from 'images/svg/symbols/markets-stocks-and-indices/american-indices/wall-street-30.svg' +import OTC_NDX from 'images/svg/symbols/markets-stocks-and-indices/american-indices/us-tech-100.svg' +import OTC_DJI from 'images/svg/symbols/markets-stocks-and-indices/american-indices/wall-street-30.svg' import OTC_SPC from 'images/svg/symbols/markets-stocks-and-indices/american-indices/us-500.svg' import OTC_AS51 from 'images/svg/symbols/markets-stocks-and-indices/asian-indices/aus-200.svg' //derived import R_10 from 'images/svg/symbols/index10-new.svg' import R_25 from 'images/svg/symbols/index25-new.svg' import R_50 from 'images/svg/symbols/index50-new.svg' -import Volatility_75_Index from 'images/svg/symbols/index75-new.svg' +import R_75 from 'images/svg/symbols/index75-new.svg' import R_100 from 'images/svg/symbols/index100-new.svg' import stpRNG from 'images/svg/symbols/step-indices-new.svg' import RB100 from 'images/svg/symbols/rb-100-new.svg' -import Range_Break_200_Index from 'images/svg/symbols/rb-200-new.svg' +import RB200 from 'images/svg/symbols/rb-200-new.svg' import Vol_1HZ10V from 'images/svg/symbols/index10s1-new.svg' import Vol_1HZ25V from 'images/svg/symbols/index25s1-new.svg' import Vol_1HZ50V from 'images/svg/symbols/index50s1-new.svg' @@ -134,12 +132,12 @@ import Vol_1HZ200V from 'images/svg/symbols/volatility_200_1s.svg' import Vol_1HZ300V from 'images/svg/symbols/volatility_300_1s.svg' import BOOM1000 from 'images/svg/symbols/boom-indices-1000-new.svg' import BOOM500 from 'images/svg/symbols/boom-indices-500-new.svg' -import Crash_1000_Index from 'images/svg/symbols/crash-indices-1000-new.svg' +import CRASH1000 from 'images/svg/symbols/crash-indices-1000-new.svg' import CRASH500 from 'images/svg/symbols/crash-indices-500-new.svg' import JD10 from 'images/svg/symbols/jump-10-new.svg' import JD100 from 'images/svg/symbols/jump-100-new.svg' import JD25 from 'images/svg/symbols/jump-25-new.svg' -import Jump_50_Index from 'images/svg/symbols/jump-50-new.svg' +import JD50 from 'images/svg/symbols/jump-50-new.svg' import JD75 from 'images/svg/symbols/jump-75-new.svg' import WLDAUD from 'images/svg/symbols/aud-basket.svg' import WLDEUR from 'images/svg/symbols/eur-basket.svg' @@ -150,94 +148,94 @@ import USDJPYDFX10 from 'images/svg/symbols/usd-jpy-10.svg' import GBPUSDDFX10 from 'images/svg/symbols/gbp-usd-10.svg' import AUDUSDDFX10 from 'images/svg/symbols/aud-usd-10.svg' import USDCHFDFX10 from 'images/svg/symbols/usd-chf-10.svg' -import EURUSD_DFX_10_Index from 'images/svg/symbols/eur-usd-10.svg' -import Boom_300_Index from 'images/svg/symbols/boom-eu-boom-300.svg' -import Crash_300_Index from 'images/svg/symbols/crash-eu-crash-300.svg' +import EURUSDDFX10 from 'images/svg/symbols/eur-usd-10.svg' +import BOOM300 from 'images/svg/symbols/boom-eu-boom-300.svg' +import CRASH300 from 'images/svg/symbols/crash-eu-crash-300.svg' //forex -import AUDJPY from 'images/svg/symbols/aud-jpy.svg' -import AUDUSD from 'images/svg/symbols/aud-usd.svg' -import EURAUD from 'images/svg/symbols/eur-aud.svg' -import EURCAD from 'images/svg/symbols/eur-cad.svg' -import EURCHF from 'images/svg/symbols/eur-chf.svg' -import EURGBP from 'images/svg/symbols/eur-gbp.svg' -import EURJPY from 'images/svg/symbols/eur-jpy.svg' -import EURUSD from 'images/svg/symbols/eur-usd.svg' -import GBPAUD from 'images/svg/symbols/gbp-aud.svg' -import GBPJPY from 'images/svg/symbols/gbp-jpy.svg' -import GBPUSD from 'images/svg/symbols/gbp-usd.svg' -import USDCAD from 'images/svg/symbols/usd-cad.svg' -import USDCHF from 'images/svg/symbols/usd-chf.svg' -import USDJPY from 'images/svg/symbols/usd-jpy.svg' -import AUDCAD from 'images/svg/symbols/aud-cad.svg' -import AUDCHF from 'images/svg/symbols/aud-chf.svg' -import AUDNZD from 'images/svg/symbols/aud-nzd.svg' -import CADCHF from 'images/svg/symbols/cad-chf.svg' -import CADJPY from 'images/svg/symbols/cad-jpy.svg' -import CHFJPY from 'images/svg/symbols/chf-jpy.svg' -import EURNOK from 'images/svg/symbols/eur-nok.svg' -import EURNZD from 'images/svg/symbols/eur-nzd.svg' -import EURPLN from 'images/svg/symbols/eur-pln.svg' -import EURSEK from 'images/svg/symbols/eur-sek.svg' -import GBPCAD from 'images/svg/symbols/gbp-cad.svg' -import GBPCHF from 'images/svg/symbols/gbp-chf.svg' -import GBPNOK from 'images/svg/symbols/gbp-nok.svg' -import GBPNZD from 'images/svg/symbols/gbp-nzd.svg' -import GBPSEK from 'images/svg/symbols/gbp-sek.svg' -import NZDCAD from 'images/svg/symbols/nzd-cad.svg' -import NZDJPY from 'images/svg/symbols/nzd-jpy.svg' -import NZDUSD from 'images/svg/symbols/nzd-usd.svg' -import USDCNH from 'images/svg/symbols/usd-cnh.svg' -import USDMXN from 'images/svg/symbols/usd-mxn.svg' -import USDNOK from 'images/svg/symbols/usd-nok.svg' -import USDPLN from 'images/svg/symbols/usd-pln.svg' -import USDSEK from 'images/svg/symbols/usd-sek.svg' -import USDZAR from 'images/svg/symbols/usd-zar.svg' +import frxAUDJPY from 'images/svg/symbols/aud-jpy.svg' +import frxAUDUSD from 'images/svg/symbols/aud-usd.svg' +import frxEURAUD from 'images/svg/symbols/eur-aud.svg' +import frxEURCAD from 'images/svg/symbols/eur-cad.svg' +import frxEURCHF from 'images/svg/symbols/eur-chf.svg' +import frxEURGBP from 'images/svg/symbols/eur-gbp.svg' +import frxEURJPY from 'images/svg/symbols/eur-jpy.svg' +import frxEURUSD from 'images/svg/symbols/eur-usd.svg' +import frxGBPAUD from 'images/svg/symbols/gbp-aud.svg' +import frxGBPJPY from 'images/svg/symbols/gbp-jpy.svg' +import frxGBPUSD from 'images/svg/symbols/gbp-usd.svg' +import frxUSDCAD from 'images/svg/symbols/usd-cad.svg' +import frxUSDCHF from 'images/svg/symbols/usd-chf.svg' +import frxUSDJPY from 'images/svg/symbols/usd-jpy.svg' +import frxAUDCAD from 'images/svg/symbols/aud-cad.svg' +import frxAUDCHF from 'images/svg/symbols/aud-chf.svg' +import frxAUDNZD from 'images/svg/symbols/aud-nzd.svg' +import frxCADCHF from 'images/svg/symbols/cad-chf.svg' +import frxCADJPY from 'images/svg/symbols/cad-jpy.svg' +import frxCHFJPY from 'images/svg/symbols/chf-jpy.svg' +import frxEURNOK from 'images/svg/symbols/eur-nok.svg' +import frxEURNZD from 'images/svg/symbols/eur-nzd.svg' +import frxEURPLN from 'images/svg/symbols/eur-pln.svg' +import frxEURSEK from 'images/svg/symbols/eur-sek.svg' +import frxGBPCAD from 'images/svg/symbols/gbp-cad.svg' +import frxGBPCHF from 'images/svg/symbols/gbp-chf.svg' +import frxGBPNOK from 'images/svg/symbols/gbp-nok.svg' +import frxGBPNZD from 'images/svg/symbols/gbp-nzd.svg' +import frxGBPSEK from 'images/svg/symbols/gbp-sek.svg' +import frxNZDCAD from 'images/svg/symbols/nzd-cad.svg' +import frxNZDJPY from 'images/svg/symbols/nzd-jpy.svg' +import frxNZDUSD from 'images/svg/symbols/nzd-usd.svg' +import frxUSDCNH from 'images/svg/symbols/usd-cnh.svg' +import frxUSDMXN from 'images/svg/symbols/usd-mxn.svg' +import frxUSDNOK from 'images/svg/symbols/usd-nok.svg' +import frxUSDPLN from 'images/svg/symbols/usd-pln.svg' +import frxUSDSEK from 'images/svg/symbols/usd-sek.svg' +import frxUSDZAR from 'images/svg/symbols/usd-zar.svg' export { WTI_OIL, CL_BRENT, XAGEUR, - XAGUSD, + frxXAGUSD, XAUEUR, XALUSD, - XCUUSD, - XAUUSD, + frxXCUUSD, + frxXAUUSD, XNIUSD, XPBUSD, - XPDUSD, - XPTUSD, + frxXPDUSD, + frxXPTUSD, XZNUSD, - ADAUSD, - ALGUSD, - AVAUSD, - BATUSD, - BCHUSD, - BNBUSD, - BTCETH, - BTCLTC, - BTCUSD, - DOGUSD, - DOTUSD, - DSHUSD, - EOSUSD, - ETCUSD, - ETHUSD, - FILUSD, - IOTUSD, - LNKUSD, - LTCUSD, - MKRUSD, - MTCUSD, - NEOUSD, - OMGUSD, - SOLUSD, - TRXUSD, - UNIUSD, - XLMUSD, - XMRUSD, - XRPUSD, - XTZUSD, - ZECUSD, + cryADAUSD, + cryALGUSD, + cryAVAUSD, + cryBATUSD, + cryBCHUSD, + cryBNBUSD, + cryBTCETH, + cryBTCLTC, + cryBTCUSD, + cryDOGUSD, + cryDOTUSD, + cryDSHUSD, + cryEOSUSD, + cryETCUSD, + cryETHUSD, + cryFILUSD, + cryIOTUSD, + cryLNKUSD, + cryLTCUSD, + cryMKRUSD, + cryMTCUSD, + cryNEOUSD, + cryOMGUSD, + crySOLUSD, + cryTRXUSD, + cryUNIUSD, + cryXLMUSD, + cryXMRUSD, + cryXRPUSD, + cryXTZUSD, + cryZECUSD, DEADS, FRAIR, FRAIRF, @@ -249,7 +247,7 @@ export { DEPSHG, DEPUMG, USAAL, - AAPL, + USAAPL, USABNB, USAIG, USAMD, @@ -262,7 +260,7 @@ export { USCRM, USCSCO, USDAL, - DIS, + USDIS, USEBAY, USFB, USFDX, @@ -290,7 +288,7 @@ export { USPYPL, USSONY, USTEVA, - TSLA, + USTSLMTR, USUBER, USVISA, USWMT, @@ -301,18 +299,18 @@ export { OTC_FCHI, OTC_N225, OTC_FTSE, - US_100, - US_30, + OTC_NDX, + OTC_DJI, OTC_SPC, OTC_AS51, R_10, R_25, R_50, - Volatility_75_Index, + R_75, R_100, stpRNG, RB100, - Range_Break_200_Index, + RB200, Vol_1HZ10V, Vol_1HZ25V, Vol_1HZ50V, @@ -324,14 +322,14 @@ export { Vol_1HZ250V, BOOM1000, BOOM500, - Boom_300_Index, - Crash_300_Index, - Crash_1000_Index, + BOOM300, + CRASH300, + CRASH1000, CRASH500, JD10, JD100, JD25, - Jump_50_Index, + JD50, JD75, WLDAUD, WLDEUR, @@ -342,44 +340,43 @@ export { GBPUSDDFX10, AUDUSDDFX10, USDCHFDFX10, - EURUSD_DFX_10_Index, - AUDJPY, - AUDUSD, - EURAUD, - EURCAD, - EURCHF, - EURGBP, - EURJPY, - EURUSD, - GBPAUD, - GBPJPY, - GBPUSD, - USDCAD, - USDCHF, - USDJPY, - AUDCAD, - AUDCHF, - AUDNZD, - CADCHF, - CADJPY, - CHFJPY, - EURNOK, - EURNZD, - EURPLN, - EURSEK, - GBPCAD, - GBPCHF, - GBPNOK, - GBPNZD, - GBPSEK, - NZDCAD, - NZDJPY, - NZDUSD, - USDCNH, - USDMXN, - USDNOK, - USDPLN, - USDSEK, - USDZAR, - ETFSICON, + EURUSDDFX10, + frxAUDJPY, + frxAUDUSD, + frxEURAUD, + frxEURCAD, + frxEURCHF, + frxEURGBP, + frxEURJPY, + frxEURUSD, + frxGBPAUD, + frxGBPJPY, + frxGBPUSD, + frxUSDCAD, + frxUSDCHF, + frxUSDJPY, + frxAUDCAD, + frxAUDCHF, + frxAUDNZD, + frxCADCHF, + frxCADJPY, + frxCHFJPY, + frxEURNOK, + frxEURNZD, + frxEURPLN, + frxEURSEK, + frxGBPCAD, + frxGBPCHF, + frxGBPNOK, + frxGBPNZD, + frxGBPSEK, + frxNZDCAD, + frxNZDJPY, + frxNZDUSD, + frxUSDCNH, + frxUSDMXN, + frxUSDNOK, + frxUSDPLN, + frxUSDSEK, + frxUSDZAR, } diff --git a/src/components/hooks/use-pricing-feed.tsx b/src/components/hooks/use-pricing-feed.tsx index 36d4b1b892e..fdd1f25a84f 100644 --- a/src/components/hooks/use-pricing-feed.tsx +++ b/src/components/hooks/use-pricing-feed.tsx @@ -13,7 +13,7 @@ const usePricingFeed = () => { const app = initializeApp(firebaseConfig) const db = getDatabase(app) - const commoditiesRef = ref(db, is_eu ? 'eu/mkt' : 'row/mkt') + const commoditiesRef = ref(db, is_eu ? 'eu/market' : 'row/market') const unsubscribe = onValue( commoditiesRef, (snapshot) => { diff --git a/src/features/pages/home/live-pricing/index.tsx b/src/features/pages/home/live-pricing/index.tsx index 236cf976878..ffa3620ce50 100644 --- a/src/features/pages/home/live-pricing/index.tsx +++ b/src/features/pages/home/live-pricing/index.tsx @@ -18,12 +18,21 @@ const LivePricing = () => { return ( + + + + + { - const [selected_market, setSelectedMarket] = useState('fx') + const [selected_market, setSelectedMarket] = useState('forex') const [tab_name, setTabName] = useState('Forex') const [linkToMarketPage, setLinkToMarketPage] = useState('/markets/forex/') - const { is_eu } = useRegion() - const updated_market_buttons = market_buttons.filter((items) => { - if (!is_eu) return items - if (is_eu && items.market_name !== 'etfs') return items - }) - const onMarketButtonClick = (selected) => { setSelectedMarket(selected) } + return ( { padding_block="10x" md={{ justify: 'center', padding: '10x' }} > - {updated_market_buttons.map((market_item) => ( + {market_buttons.map((market_item) => ( { ), )} + ) diff --git a/src/features/pages/home/live-pricing/market-tabs/utils.tsx b/src/features/pages/home/live-pricing/market-tabs/utils.tsx index 15e96ea1195..5fd8cad27ea 100644 --- a/src/features/pages/home/live-pricing/market-tabs/utils.tsx +++ b/src/features/pages/home/live-pricing/market-tabs/utils.tsx @@ -2,13 +2,11 @@ import { TMarketButtons } from '../types' import Forex from 'images/svg/home/ts_fx_icon.svg' import Derived from 'images/svg/home/ts_derived_icon.svg' import Stocks from 'images/svg/home/ts_stocks_icon.svg' -import ETFS from 'images/svg/home/ts_etfs.svg' import Crypto from 'images/svg/home/ts_crypto_icon.svg' import Commodities from 'images/svg/home/ts_commodities_icon.svg' import SelectedForex from 'images/svg/home/selected_ts_fx_icon.svg' import SelectedDerived from 'images/svg/home/selected_ts_derived_icon.svg' import SelectedStocks from 'images/svg/home/selected_ts_stocks_icon.svg' -import SelectedETFS from 'images/svg/home/selected_etfs.svg' import SelectedCrypto from 'images/svg/home/selected_ts_crypto_icon.svg' import SelectedCommodities from 'images/svg/home/selected_ts_commodities_icon.svg' @@ -17,7 +15,7 @@ export const market_buttons: TMarketButtons[] = [ src: Forex, selected_src: SelectedForex, button_text: 'Forex', - market_name: 'fx', + market_name: 'forex', market_description: '_t_Benefit from round-the-clock trading hours (Monday to Friday), high liquidity, low barriers to entry, a wide range of offerings, and opportunities to trade on world events._t_', to: '/markets/forex/', @@ -26,7 +24,7 @@ export const market_buttons: TMarketButtons[] = [ src: Derived, selected_src: SelectedDerived, button_text: 'Derived indices', - market_name: 'der', + market_name: 'derived', market_description: '_t_Trade on asset prices derived from real-world or simulated markets. Manage your exposure by selecting the volatility level to suit your risk appetite. Choose from our 24/7 synthetics, derived FX, and baskets._t_', to: '/markets/synthetic/', @@ -35,25 +33,16 @@ export const market_buttons: TMarketButtons[] = [ src: Stocks, selected_src: SelectedStocks, button_text: 'Stocks & indices', - market_name: 'ind', + market_name: 'indices', market_description: '_t_Trade global stocks of your favourite household brands and international stock market indices on Deriv. Expand your trading opportunities with access to a wide range of stocks and indices at competitive prices, and the convenience to trade indices beyond standard market hours._t_', to: '/markets/stock/', }, - { - src: ETFS, - selected_src: SelectedETFS, - button_text: 'ETFs', - market_name: 'etfs', - market_description: - '_t_Speculate on the price movements of popular exchange-traded funds (ETFs). Diversify your portfolio with assets that track bonds, commodities, and indices, without the high cost of owning the underlying assets._t_', - to: '/markets/exchange-traded-funds/', - }, { src: Crypto, selected_src: SelectedCrypto, button_text: 'Cryptocurrencies', - market_name: 'cry', + market_name: 'cryptocurrency', market_description: "_t_Take advantage of a highly liquid market with round-the-clock trading. Profit from correctly predicting the movement of world's most popular cryptocurrencies._t_", to: '/markets/cryptocurrencies/', @@ -62,7 +51,7 @@ export const market_buttons: TMarketButtons[] = [ src: Commodities, selected_src: SelectedCommodities, button_text: 'Commodities', - market_name: 'com', + market_name: 'commodities', market_description: '_t_Speculate on the price movements of silver, gold, oil and more. Profit from the price difference when the market moves in the direction that you have predicted._t_', to: '/markets/commodities/', diff --git a/src/features/pages/home/live-pricing/table-component/live-market-table.tsx b/src/features/pages/home/live-pricing/table-component/live-market-table.tsx index 75a64807cf1..c609b2a9172 100644 --- a/src/features/pages/home/live-pricing/table-component/live-market-table.tsx +++ b/src/features/pages/home/live-pricing/table-component/live-market-table.tsx @@ -49,12 +49,13 @@ const LiveMarketTable = ({ selected_market, link_to }: TLiveMarketTableProps) => const [error, rawMarketsData] = usePricingFeed() const TABLE_VISIBLE_ROWS = 5 const [sorting, setSorting] = React.useState([]) + const markets_data = useMemo(() => { if (rawMarketsData) { - const stocks = rawMarketsData['stk'] - const indices = rawMarketsData['ind'] + const stocks = rawMarketsData['stocks'] + const indices = rawMarketsData['indices'] const stocks_indices = { ...stocks, ...indices } - const res = { ...rawMarketsData, ind: stocks_indices } + const res = { ...rawMarketsData, indices: stocks_indices } if (res[selected_market]) { return Object.values(res[selected_market]) diff --git a/src/features/pages/home/live-pricing/table-component/live-pricing.module.scss b/src/features/pages/home/live-pricing/table-component/live-pricing.module.scss index 19f2d9217b0..327b3eac476 100644 --- a/src/features/pages/home/live-pricing/table-component/live-pricing.module.scss +++ b/src/features/pages/home/live-pricing/table-component/live-pricing.module.scss @@ -10,7 +10,7 @@ align-items: center; min-block-size: 7.5rem; th { - padding: 1rem; + padding-block: 0; inline-size: 7.3rem; &:nth-child(1) { inline-size: 11rem; @@ -80,7 +80,6 @@ } } @include breakpoints(phone) { - padding: 2rem; gap: 0; td { justify-content: flex-start; @@ -98,7 +97,7 @@ } } @include breakpoints(laptop) { - padding: 2rem; + padding: 1rem; gap: 0; td { justify-content: flex-start; @@ -116,3 +115,8 @@ } } } + + + + + diff --git a/src/features/pages/home/live-pricing/table-component/symbol-icon.tsx b/src/features/pages/home/live-pricing/table-component/symbol-icon.tsx index b968d1ac64d..6b769b1fbee 100644 --- a/src/features/pages/home/live-pricing/table-component/symbol-icon.tsx +++ b/src/features/pages/home/live-pricing/table-component/symbol-icon.tsx @@ -3,9 +3,9 @@ import * as icons from 'components/elements/symbols-shortcode' import Image from 'features/components/atoms/image' const SymbolIcon = ({ icon_src }: { icon_src: string }) => { - if (icon_src === 'Volatility_150_(1s)_Index') + if (icon_src === '1HZ150V') return - if (icon_src === 'Volatility_250_(1s)_Index') + if (icon_src === '1HZ250V') return else return } diff --git a/src/features/pages/home/live-pricing/types.tsx b/src/features/pages/home/live-pricing/types.tsx index 33d0f4d5888..3b0c30fe26d 100644 --- a/src/features/pages/home/live-pricing/types.tsx +++ b/src/features/pages/home/live-pricing/types.tsx @@ -3,14 +3,25 @@ import { TString } from 'types/generics' export type TMarketData = { ask: number bid: number - chng: number - mkt: string - sprd: number - sym: string - code: string + day_percentage_change: number + market: string + spread: number + symbol: string + shortcode: string } -export type TAvailableLiveMarkets = 'fx' | 'der' | 'ind' | 'cry' | 'com' | 'etfs' +export type TMarketDataResponse = { + trading_platform_asset_listing: any + active_symbols: TMarketData[] + req_id: number +} + +export type TAvailableLiveMarkets = + | 'forex' + | 'derived' + | 'indices' + | 'cryptocurrency' + | 'commodities' export type TMarketButtons = { src: string diff --git a/src/features/pages/home/live-pricing/use-live-columns.tsx b/src/features/pages/home/live-pricing/use-live-columns.tsx index cfdd43ca4fa..f6b1a53ad9d 100644 --- a/src/features/pages/home/live-pricing/use-live-columns.tsx +++ b/src/features/pages/home/live-pricing/use-live-columns.tsx @@ -11,10 +11,9 @@ const liveMarketColumnHelper = createColumnHelper() const useLiveColumns = () => { const { is_mobile } = useBreakpoints() - const columns = useMemo(() => { return [ - liveMarketColumnHelper.accessor('code', { + liveMarketColumnHelper.accessor('shortcode', { header: () => ( { ), cell: (info) => ( - {info.row.original.mkt !== 'etfs' ? ( - - ) : ( - - )} + ), }), - liveMarketColumnHelper.accessor('sym', { + liveMarketColumnHelper.accessor('symbol', { header: () => , cell: (info) => ( @@ -89,7 +84,7 @@ const useLiveColumns = () => { ), }), - liveMarketColumnHelper.accessor('sprd', { + liveMarketColumnHelper.accessor('spread', { header: () => ( { ), }), - liveMarketColumnHelper.accessor('chng', { + liveMarketColumnHelper.accessor('day_percentage_change', { header: () => ( - - - - - - - - - - - - - - -