diff --git a/package-lock.json b/package-lock.json index ed3cdfef..6cf781cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "@babel/preset-env": "^7.24.5", - "@deriv-com/api-hooks": "^0.1.19", + "@deriv-com/api-hooks": "^0.1.24", "@deriv-com/translations": "^1.2.4", "@deriv-com/ui": "^1.26.0", "@deriv-com/utils": "latest", @@ -2604,25 +2604,32 @@ } }, "node_modules/@deriv-com/api-hooks": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@deriv-com/api-hooks/-/api-hooks-0.1.19.tgz", - "integrity": "sha512-7xIGWpsMmJ0fP7mbCOxo32ZLdWT0FM9Txw5OS3XbkxW67zZuK8khRo5MiVCunlDMGIkO3nG/EBeqJGi/TzK5Mw==", + "version": "0.1.24", + "resolved": "https://registry.npmjs.org/@deriv-com/api-hooks/-/api-hooks-0.1.24.tgz", + "integrity": "sha512-SiZsyZlnfXWlioa7MSiZgu8N4wTEpiKzYpKhuKvQS86Ek/dyjw43iviqJkXD3n/AZX2FZA40lCwE363tURMGVg==", "dependencies": { - "@deriv-com/utils": "^0.0.11", - "@deriv/api-types": "^1.0.177", + "@deriv-com/utils": "^0.0.22", + "@deriv/api-types": "^1.0.560", "@deriv/deriv-api": "^1.0.15", - "@tanstack/react-query": "^5.28.14", + "@tanstack/react-query": "^5.37.1", "@types/js-cookie": "^3.0.6", "js-cookie": "^3.0.5" }, "optionalDependencies": { - "@rollup/rollup-linux-x64-gnu": "^4.6.1" + "@rollup/rollup-linux-x64-gnu": "^4.17.2" } }, - "node_modules/@deriv-com/api-hooks/node_modules/@deriv-com/utils": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.11.tgz", - "integrity": "sha512-O2ueP2Gu0FjPAe/4x94cj9b/cre8bIm0FdBL42TGy8dFa4zqA44fJdyl6uI1Ohg/uqQia7f/aR9iBBtnK3pg3A==" + "node_modules/@deriv-com/api-hooks/node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] }, "node_modules/@deriv-com/eslint-config-deriv": { "version": "2.1.0-beta.3", @@ -2729,14 +2736,14 @@ } }, "node_modules/@deriv-com/utils": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.14.tgz", - "integrity": "sha512-zpgi8b1mBCZJIKQeipMydj7SMONjQFfmdR5Jp4IffXp/9Z/I+jfsRHpP5D5eDrsFEnD5/NK9gHFg36u8hu1kww==" + "version": "0.0.22", + "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.22.tgz", + "integrity": "sha512-9eVZTPEwfNPXhHsq0qHAGxQW0/ZwzP7gca3CfjPgI9rNvFNVcduxi9wJ3HXl3FKrT8rSpO0X8rHjJKxdOjmjog==" }, "node_modules/@deriv/api-types": { - "version": "1.0.178", - "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.178.tgz", - "integrity": "sha512-mfue5/EEGQyyiUqdKADYK8wj4jbusztDeT8HtrT5Up4le0pPbS0kaL0U31HjseT8pOqXzXHfwn6DK9se740zbg==" + "version": "1.0.633", + "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.633.tgz", + "integrity": "sha512-T4FqGdpw0YNdZ4GdM8XSVOaRH4ct2nWNVeJjJjAsvAs5hckxhNXt/O6tvbPoEF2QBw/VovCWTXYl5aSnYPhrQw==" }, "node_modules/@deriv/deriv-api": { "version": "1.0.15", @@ -4802,20 +4809,20 @@ } }, "node_modules/@tanstack/query-core": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.29.0.tgz", - "integrity": "sha512-WgPTRs58hm9CMzEr5jpISe8HXa3qKQ8CxewdYZeVnA54JrPY9B1CZiwsCoLpLkf0dGRZq+LcX5OiJb0bEsOFww==", + "version": "5.38.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.38.0.tgz", + "integrity": "sha512-QtkoxvFcu52mNpp3+qOo9H265m3rt83Dgbw5WnNyJvr83cegrQ7zT8haHhL4Rul6ZQkeovxyWbXVW9zI0WYx6g==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/react-query": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.29.2.tgz", - "integrity": "sha512-nyuWILR4u7H5moLGSiifLh8kIqQDLNOHGuSz0rcp+J75fNc8aQLyr5+I2JCHU3n+nJrTTW1ssgAD8HiKD7IFBQ==", + "version": "5.39.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.39.0.tgz", + "integrity": "sha512-zc0WnyEffyTgG+myLv8cY2tJOUT6jOprCiprpbMqylCaCFipSDUPCYCt2AC+qxgk2CFuqiI/fjb1u5/HhLkrPg==", "dependencies": { - "@tanstack/query-core": "5.29.0" + "@tanstack/query-core": "5.38.0" }, "funding": { "type": "github", @@ -22629,23 +22636,24 @@ } }, "@deriv-com/api-hooks": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@deriv-com/api-hooks/-/api-hooks-0.1.19.tgz", - "integrity": "sha512-7xIGWpsMmJ0fP7mbCOxo32ZLdWT0FM9Txw5OS3XbkxW67zZuK8khRo5MiVCunlDMGIkO3nG/EBeqJGi/TzK5Mw==", + "version": "0.1.24", + "resolved": "https://registry.npmjs.org/@deriv-com/api-hooks/-/api-hooks-0.1.24.tgz", + "integrity": "sha512-SiZsyZlnfXWlioa7MSiZgu8N4wTEpiKzYpKhuKvQS86Ek/dyjw43iviqJkXD3n/AZX2FZA40lCwE363tURMGVg==", "requires": { - "@deriv-com/utils": "^0.0.11", - "@deriv/api-types": "^1.0.177", + "@deriv-com/utils": "^0.0.22", + "@deriv/api-types": "^1.0.560", "@deriv/deriv-api": "^1.0.15", - "@rollup/rollup-linux-x64-gnu": "^4.6.1", - "@tanstack/react-query": "^5.28.14", + "@rollup/rollup-linux-x64-gnu": "^4.17.2", + "@tanstack/react-query": "^5.37.1", "@types/js-cookie": "^3.0.6", "js-cookie": "^3.0.5" }, "dependencies": { - "@deriv-com/utils": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.11.tgz", - "integrity": "sha512-O2ueP2Gu0FjPAe/4x94cj9b/cre8bIm0FdBL42TGy8dFa4zqA44fJdyl6uI1Ohg/uqQia7f/aR9iBBtnK3pg3A==" + "@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "optional": true } } }, @@ -22705,14 +22713,14 @@ } }, "@deriv-com/utils": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.14.tgz", - "integrity": "sha512-zpgi8b1mBCZJIKQeipMydj7SMONjQFfmdR5Jp4IffXp/9Z/I+jfsRHpP5D5eDrsFEnD5/NK9gHFg36u8hu1kww==" + "version": "0.0.22", + "resolved": "https://registry.npmjs.org/@deriv-com/utils/-/utils-0.0.22.tgz", + "integrity": "sha512-9eVZTPEwfNPXhHsq0qHAGxQW0/ZwzP7gca3CfjPgI9rNvFNVcduxi9wJ3HXl3FKrT8rSpO0X8rHjJKxdOjmjog==" }, "@deriv/api-types": { - "version": "1.0.178", - "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.178.tgz", - "integrity": "sha512-mfue5/EEGQyyiUqdKADYK8wj4jbusztDeT8HtrT5Up4le0pPbS0kaL0U31HjseT8pOqXzXHfwn6DK9se740zbg==" + "version": "1.0.633", + "resolved": "https://registry.npmjs.org/@deriv/api-types/-/api-types-1.0.633.tgz", + "integrity": "sha512-T4FqGdpw0YNdZ4GdM8XSVOaRH4ct2nWNVeJjJjAsvAs5hckxhNXt/O6tvbPoEF2QBw/VovCWTXYl5aSnYPhrQw==" }, "@deriv/deriv-api": { "version": "1.0.15", @@ -24010,16 +24018,16 @@ } }, "@tanstack/query-core": { - "version": "5.29.0", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.29.0.tgz", - "integrity": "sha512-WgPTRs58hm9CMzEr5jpISe8HXa3qKQ8CxewdYZeVnA54JrPY9B1CZiwsCoLpLkf0dGRZq+LcX5OiJb0bEsOFww==" + "version": "5.38.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.38.0.tgz", + "integrity": "sha512-QtkoxvFcu52mNpp3+qOo9H265m3rt83Dgbw5WnNyJvr83cegrQ7zT8haHhL4Rul6ZQkeovxyWbXVW9zI0WYx6g==" }, "@tanstack/react-query": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.29.2.tgz", - "integrity": "sha512-nyuWILR4u7H5moLGSiifLh8kIqQDLNOHGuSz0rcp+J75fNc8aQLyr5+I2JCHU3n+nJrTTW1ssgAD8HiKD7IFBQ==", + "version": "5.39.0", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.39.0.tgz", + "integrity": "sha512-zc0WnyEffyTgG+myLv8cY2tJOUT6jOprCiprpbMqylCaCFipSDUPCYCt2AC+qxgk2CFuqiI/fjb1u5/HhLkrPg==", "requires": { - "@tanstack/query-core": "5.29.0" + "@tanstack/query-core": "5.38.0" } }, "@tanstack/react-table": { diff --git a/package.json b/package.json index b49028a3..29ace1be 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@babel/preset-env": "^7.24.5", - "@deriv-com/api-hooks": "^0.1.19", + "@deriv-com/api-hooks": "^0.1.24", "@deriv-com/translations": "^1.2.4", "@deriv-com/ui": "^1.26.0", "@deriv-com/utils": "latest", diff --git a/src/components/AdvertsTableRow/AdvertsTableRow.tsx b/src/components/AdvertsTableRow/AdvertsTableRow.tsx index f7b8abee..e599a47c 100644 --- a/src/components/AdvertsTableRow/AdvertsTableRow.tsx +++ b/src/components/AdvertsTableRow/AdvertsTableRow.tsx @@ -57,8 +57,9 @@ const AdvertsTableRow = memo((props: TAdvertsTableRowRenderer) => { }, [local_currency]); useEffect(() => { - if (exchangeRateData?.exchange_rates?.rates) { - exchangeRateRef.current = exchangeRateData?.exchange_rates?.rates?.[local_currency]; + const rate = exchangeRateData?.exchange_rates?.rates?.[local_currency]; + if (typeof rate === 'number') { + exchangeRateRef.current = rate; } // eslint-disable-next-line react-hooks/exhaustive-deps }, [exchangeRateData]); diff --git a/src/components/BuySellForm/BuySellForm.tsx b/src/components/BuySellForm/BuySellForm.tsx index 1ff50001..69dc3d7a 100644 --- a/src/components/BuySellForm/BuySellForm.tsx +++ b/src/components/BuySellForm/BuySellForm.tsx @@ -105,9 +105,11 @@ const BuySellForm = ({ advertId, isModalOpen, onRequestClose }: TBuySellFormProp }, [local_currency]); useEffect(() => { - if (exchangeRatesData?.exchange_rates?.rates) { - exchangeRateRef.current = exchangeRatesData?.exchange_rates.rates?.[local_currency]; + const rate = exchangeRatesData?.exchange_rates?.rates?.[local_currency]; + if (typeof rate === 'number') { + exchangeRateRef.current = rate; } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [exchangeRatesData]); diff --git a/src/components/FloatingRate/FloatingRate.tsx b/src/components/FloatingRate/FloatingRate.tsx index 8c26c45f..dbcfa30a 100644 --- a/src/components/FloatingRate/FloatingRate.tsx +++ b/src/components/FloatingRate/FloatingRate.tsx @@ -46,8 +46,9 @@ const FloatingRate = ({ }, [localCurrency]); useEffect(() => { - if (exchangeRateData?.exchange_rates?.rates) { - exchangeRateRef.current = exchangeRateData?.exchange_rates?.rates?.[localCurrency]; + const rate = exchangeRateData?.exchange_rates?.rates?.[localCurrency]; + if (typeof rate === 'number') { + exchangeRateRef.current = rate; } // eslint-disable-next-line react-hooks/exhaustive-deps }, [exchangeRateData]); diff --git a/src/pages/my-ads/components/AdSummary/AdSummary.tsx b/src/pages/my-ads/components/AdSummary/AdSummary.tsx index 5773cb10..7e41dffd 100644 --- a/src/pages/my-ads/components/AdSummary/AdSummary.tsx +++ b/src/pages/my-ads/components/AdSummary/AdSummary.tsx @@ -56,9 +56,11 @@ const AdSummary = ({ }, [currency, localCurrency]); useEffect(() => { - if (exchangeRatesData?.exchange_rates?.rates) { - exchangeRateRef.current = exchangeRatesData.exchange_rates?.rates?.[localCurrency]; + const rate = exchangeRatesData?.exchange_rates?.rates?.[localCurrency]; + if (typeof rate === 'number') { + exchangeRateRef.current = rate; } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [exchangeRatesData]); diff --git a/src/pages/my-ads/screens/MyAds/MyAdsTableRow/MyAdsTableRow.tsx b/src/pages/my-ads/screens/MyAds/MyAdsTableRow/MyAdsTableRow.tsx index 15d0a3c7..ff2243b6 100644 --- a/src/pages/my-ads/screens/MyAds/MyAdsTableRow/MyAdsTableRow.tsx +++ b/src/pages/my-ads/screens/MyAds/MyAdsTableRow/MyAdsTableRow.tsx @@ -79,8 +79,9 @@ const MyAdsTableRow = ({ currentRateType, showModal, ...rest }: TMyAdsTableProps }, [localCurrency]); useEffect(() => { - if (exchangeRatesData?.exchange_rates?.rates) { - exchangeRateRef.current = exchangeRatesData.exchange_rates?.rates?.[localCurrency ?? '']; + const rate = exchangeRatesData?.exchange_rates?.rates?.[localCurrency ?? '']; + if (typeof rate === 'number') { + exchangeRateRef.current = rate; } // eslint-disable-next-line react-hooks/exhaustive-deps }, [exchangeRatesData]);