-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-binance-wallet
- Loading branch information
Showing
188 changed files
with
1,859 additions
and
1,125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+3.28 KB
(100%)
...shots/simulator/recurring/Recurring_limit_limit/simulator-results-animation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-590 Bytes
(99%)
...enshots/simulator/recurring/Recurring_limit_limit/simulator-results-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.1 KB
(99%)
...shots/simulator/recurring/Recurring_limit_range/simulator-results-animation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.84 KB
(97%)
...enshots/simulator/recurring/Recurring_limit_range/simulator-results-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+182 Bytes
(100%)
e2e/screenshots/simulator/recurring/Recurring_range_limit/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-37 Bytes
(100%)
...screenshots/simulator/recurring/Recurring_range_limit/simulator-input-price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.86 KB
(100%)
...shots/simulator/recurring/Recurring_range_limit/simulator-results-animation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.76 KB
(97%)
...enshots/simulator/recurring/Recurring_range_limit/simulator-results-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+226 Bytes
(100%)
e2e/screenshots/simulator/recurring/Recurring_range_range/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.99 KB
(100%)
...shots/simulator/recurring/Recurring_range_range/simulator-results-animation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.57 KB
(98%)
...enshots/simulator/recurring/Recurring_range_range/simulator-results-summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+379 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_limit/create/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+649 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_limit/create/my-strategy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.18 KB
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_limit/deposit/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+287 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_limit/duplicate/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+520 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_limit/editPrices/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+277 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_limit/undercut/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.12 KB
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_limit/withdraw/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+222 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_range/create/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+651 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_range/create/my-strategy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.33 KB
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_range/deposit/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+277 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_range/duplicate/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+388 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_range/editPrices/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+286 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_range/undercut/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.08 KB
(100%)
e2e/screenshots/strategy/disposable/Disposable_buy_range/withdraw/form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+69 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_limit/create/form.png
Oops, something went wrong.
Binary file modified
BIN
+934 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_limit/create/my-strategy.png
Oops, something went wrong.
Binary file modified
BIN
+817 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_limit/deposit/form.png
Oops, something went wrong.
Binary file modified
BIN
+79 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_limit/duplicate/form.png
Oops, something went wrong.
Binary file modified
BIN
+512 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_limit/editPrices/form.png
Oops, something went wrong.
Binary file modified
BIN
+74 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_limit/undercut/form.png
Oops, something went wrong.
Binary file modified
BIN
+824 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_limit/withdraw/form.png
Oops, something went wrong.
Binary file modified
BIN
+78 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_range/create/form.png
Oops, something went wrong.
Binary file modified
BIN
+871 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_range/create/my-strategy.png
Oops, something went wrong.
Binary file modified
BIN
+829 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_range/deposit/form.png
Oops, something went wrong.
Binary file modified
BIN
+74 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_range/duplicate/form.png
Oops, something went wrong.
Binary file modified
BIN
+363 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_range/editPrices/form.png
Oops, something went wrong.
Binary file modified
BIN
+75 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_range/undercut/form.png
Oops, something went wrong.
Binary file modified
BIN
+777 Bytes
(100%)
e2e/screenshots/strategy/disposable/Disposable_sell_range/withdraw/form.png
Oops, something went wrong.
Binary file modified
BIN
-55 Bytes
(100%)
e2e/screenshots/strategy/overlapping/Overlapping/create/form.png
Oops, something went wrong.
Binary file modified
BIN
+1.53 KB
(100%)
e2e/screenshots/strategy/overlapping/Overlapping/create/my-strategy.png
Oops, something went wrong.
Binary file modified
BIN
+970 Bytes
(100%)
e2e/screenshots/strategy/overlapping/Overlapping/deposit/form.png
Oops, something went wrong.
Binary file modified
BIN
-38 Bytes
(100%)
e2e/screenshots/strategy/overlapping/Overlapping/duplicate/form.png
Oops, something went wrong.
Binary file modified
BIN
+1.02 KB
(100%)
e2e/screenshots/strategy/overlapping/Overlapping/editPrices/form.png
Oops, something went wrong.
Binary file modified
BIN
-36 Bytes
(100%)
e2e/screenshots/strategy/overlapping/Overlapping/undercut/form.png
Oops, something went wrong.
Binary file modified
BIN
+1009 Bytes
(100%)
e2e/screenshots/strategy/overlapping/Overlapping/withdraw/form.png
Oops, something went wrong.
Binary file modified
BIN
+336 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_limit/create/form.png
Oops, something went wrong.
Binary file modified
BIN
+896 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_limit/create/my-strategy.png
Oops, something went wrong.
Binary file modified
BIN
-3.35 KB
(95%)
e2e/screenshots/strategy/recurring/Recurring_limit_limit/deposit/form.png
Oops, something went wrong.
Binary file modified
BIN
+350 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_limit/duplicate/form.png
Oops, something went wrong.
Binary file modified
BIN
+556 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_limit/editPrices/form.png
Oops, something went wrong.
Binary file modified
BIN
+539 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_limit/renew/form.png
Oops, something went wrong.
Binary file modified
BIN
+405 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_limit/undercut/form.png
Oops, something went wrong.
Binary file modified
BIN
+1.27 KB
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_limit/withdraw/form.png
Oops, something went wrong.
Binary file modified
BIN
+340 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_range/create/form.png
Oops, something went wrong.
Binary file modified
BIN
+902 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_range/create/my-strategy.png
Oops, something went wrong.
Binary file modified
BIN
+1.03 KB
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_range/deposit/form.png
Oops, something went wrong.
Binary file modified
BIN
+342 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_range/duplicate/form.png
Oops, something went wrong.
Binary file modified
BIN
+419 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_range/editPrices/form.png
Oops, something went wrong.
Binary file modified
BIN
+423 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_range/renew/form.png
Oops, something went wrong.
Binary file modified
BIN
+357 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_range/undercut/form.png
Oops, something went wrong.
Binary file modified
BIN
+1.05 KB
(100%)
e2e/screenshots/strategy/recurring/Recurring_limit_range/withdraw/form.png
Oops, something went wrong.
Binary file modified
BIN
+510 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_limit/create/form.png
Oops, something went wrong.
Binary file modified
BIN
+900 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_limit/create/my-strategy.png
Oops, something went wrong.
Binary file modified
BIN
+1.03 KB
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_limit/deposit/form.png
Oops, something went wrong.
Binary file modified
BIN
+339 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_limit/duplicate/form.png
Oops, something went wrong.
Binary file modified
BIN
+556 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_limit/editPrices/form.png
Oops, something went wrong.
Binary file modified
BIN
+556 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_limit/renew/form.png
Oops, something went wrong.
Binary file modified
BIN
+4.46 KB
(110%)
e2e/screenshots/strategy/recurring/Recurring_range_limit/undercut/form.png
Oops, something went wrong.
Binary file modified
BIN
+1.02 KB
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_limit/withdraw/form.png
Oops, something went wrong.
Binary file modified
BIN
+347 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_range/create/form.png
Oops, something went wrong.
Binary file modified
BIN
+897 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_range/create/my-strategy.png
Oops, something went wrong.
Binary file modified
BIN
+1.08 KB
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_range/deposit/form.png
Oops, something went wrong.
Binary file modified
BIN
+382 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_range/duplicate/form.png
Oops, something went wrong.
Binary file modified
BIN
+553 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_range/editPrices/form.png
Oops, something went wrong.
Binary file modified
BIN
+550 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_range/renew/form.png
Oops, something went wrong.
Binary file modified
BIN
+354 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_range/undercut/form.png
Oops, something went wrong.
Binary file modified
BIN
+953 Bytes
(100%)
e2e/screenshots/strategy/recurring/Recurring_range_range/withdraw/form.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
"private": true, | ||
"dependencies": { | ||
"@babel/core": "^7.0.0-0", | ||
"@bancor/carbon-sdk": "0.0.99-DEV", | ||
"@binance/w3w-wagmi-connector-v2": "^1.2.4-alpha.0", | ||
"@bancor/carbon-sdk": "0.0.103-DEV", | ||
"@cloudflare/workers-types": "^4.20230717.0", | ||
"@ethersproject/abi": "^5.0.0", | ||
"@ethersproject/bytes": "^5.0.0", | ||
|
@@ -30,11 +30,11 @@ | |
"@types/body-scroll-lock": "^3.1.0", | ||
"@types/lodash": "4.14.191", | ||
"@types/node": "^20.0.0", | ||
"@types/react": "^18.0.0", | ||
"@types/react-dom": "^18.0.0", | ||
"@types/react": "19.0.1", | ||
"@types/react-dom": "19.0.2", | ||
"@typescript-eslint/eslint-plugin": "^5.59.9", | ||
"@typescript-eslint/parser": "^5.59.9", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"@vitejs/plugin-react": "^4.3.4", | ||
"@vitest/coverage-v8": "^1.6.0", | ||
"autoprefixer": "^10.4.12", | ||
"body-scroll-lock": "^4.0.0-beta.0", | ||
|
@@ -59,9 +59,8 @@ | |
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-unused-imports": "^2.0.0", | ||
"ethers": "^5.1.3", | ||
"framer-motion": "7.6.7", | ||
"framer-motion": "11.13.5", | ||
"fuse.js": "^6.6.2", | ||
"graphemer": "^1.4.0", | ||
"highcharts": "^11.1.0", | ||
"highcharts-react-official": "^3.2.0", | ||
"husky": "^8.0.3", | ||
|
@@ -73,10 +72,9 @@ | |
"postcss": "^8.4.31", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-tailwindcss": "^0.1.13", | ||
"react": "^18.2.0", | ||
"react-day-picker": "^8.10.0", | ||
"react-dom": "^18.2.0", | ||
"source-map-explorer": "^2.5.3", | ||
"react": "19.0.0", | ||
"react-day-picker": "9.4.2", | ||
"react-dom": "19.0.0", | ||
"tailwind-merge": "^2.2.2", | ||
"tailwindcss": "3.4.3", | ||
"typechain": "^8.1.0", | ||
|
@@ -93,7 +91,6 @@ | |
"scripts": { | ||
"compile-abis": "typechain --target ethers-v5 --out-dir \"src/abis/types\" \"src/abis/**/*.json\"", | ||
"prepare": "yarn husky install", | ||
"analyze": "source-map-explorer 'build/static/js/*.js'", | ||
"start": "vite", | ||
"start:ethereum": "cross-env VITE_NETWORK=ethereum vite", | ||
"start:sei": "cross-env VITE_NETWORK=sei vite", | ||
|
@@ -110,7 +107,8 @@ | |
"lint": "eslint --ext .tsx,.ts .", | ||
"pre-commit": "yarn lint-staged", | ||
"e2e:report": "npx playwright show-report e2e/playwright-report", | ||
"update-browserslist": "npx update-browserslist-db@latest" | ||
"update-browserslist": "npx update-browserslist-db@latest", | ||
"analyze": "npx analyze -c vite.config.ts" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
|
@@ -130,7 +128,8 @@ | |
] | ||
}, | ||
"devDependencies": { | ||
"@types/d3": "^7.4.3" | ||
"@types/d3": "^7.4.3", | ||
"vite-bundle-analyzer": "^0.15.2" | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ module.exports = { | |
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.export-button { | ||
@apply border-background-800 text-12 gap-8 rounded-full border-2 px-12 py-8; | ||
display: grid; | ||
grid-template-columns: repeat(3, auto); | ||
grid-template-areas: "icon text loading"; | ||
align-items: center; | ||
overflow-y: clip; | ||
} | ||
.export-button:hover { | ||
@apply border-background-700 bg-background-800; | ||
} | ||
.export-button:disabled { | ||
pointer-events: none; | ||
opacity: 0.6; | ||
} | ||
.export-button > * { | ||
grid-row: 1/1; | ||
transition: transform 0.3s var(--ease-back-in-out); | ||
} | ||
.export { | ||
grid-column: text / loading; | ||
} | ||
.exporting { | ||
grid-column: text; | ||
} | ||
.loading { | ||
grid-column: loading; | ||
} | ||
|
||
.export-button:not(:disabled) .export { | ||
transition-delay: 200ms; | ||
} | ||
.export-button:not(:disabled) .exporting { | ||
transform: translateY(40px); | ||
transition-delay: 100ms; | ||
} | ||
.export-button:not(:disabled) .loading { | ||
transform: translateY(40px); | ||
transition-delay: 0ms; | ||
} | ||
.export-button:disabled .export { | ||
transform: translateY(-40px); | ||
transition-delay: 0ms; | ||
} | ||
.export-button:disabled .exporting { | ||
transition-delay: 100ms; | ||
} | ||
.export-button:disabled .loading { | ||
transition-delay: 200ms; | ||
} | ||
.export-button:disabled .loading path { | ||
transform-origin: center; | ||
animation: rotate 0.6s linear infinite; | ||
} | ||
|
||
@keyframes rotate { | ||
from { | ||
transform: 0; | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useFiatCurrency } from 'hooks/useFiatCurrency'; | ||
import { useGetTokenPrice } from 'libs/queries'; | ||
import { SafeDecimal } from 'libs/safedecimal'; | ||
import { Token } from 'libs/tokens'; | ||
import { FC } from 'react'; | ||
import { cn, getFiatDisplayValue } from 'utils/helpers'; | ||
|
||
interface Props { | ||
token?: Token; | ||
amount: SafeDecimal | string | number; | ||
className?: string; | ||
} | ||
export const FiatPrice: FC<Props> = ({ token, amount, className }) => { | ||
const query = useGetTokenPrice(token?.address); | ||
const { selectedFiatCurrency: currentCurrency } = useFiatCurrency(); | ||
const loading = !token || query.isPending; | ||
const value = new SafeDecimal(query.data?.[currentCurrency] || 0).mul(amount); | ||
return ( | ||
<span className={cn(className, { invisible: loading })}> | ||
{getFiatDisplayValue(value, currentCurrency)} | ||
</span> | ||
); | ||
}; |
Oops, something went wrong.