From 2f2089d5432c5834b9e7286de5dadf709eb8df37 Mon Sep 17 00:00:00 2001 From: Jimmy Hardwick Date: Wed, 5 Jun 2024 12:29:46 +1000 Subject: [PATCH] fix:[ISGS-11] Token fiat conversions (#1866) --- .../widgets-lib/src/widgets/swap/components/SwapForm.tsx | 2 +- .../checkout/widgets-sample-app/src/components/ui/swap/swap.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/checkout/widgets-lib/src/widgets/swap/components/SwapForm.tsx b/packages/checkout/widgets-lib/src/widgets/swap/components/SwapForm.tsx index adde7e4f11..4e2a699c0c 100644 --- a/packages/checkout/widgets-lib/src/widgets/swap/components/SwapForm.tsx +++ b/packages/checkout/widgets-lib/src/widgets/swap/components/SwapForm.tsx @@ -518,7 +518,7 @@ export function SwapForm({ data, theme }: SwapFromProps) { fromToken.symbol, cryptoFiatState.conversions, )); - }, [fromAmount, fromToken]); + }, [fromAmount, fromToken, cryptoFiatState.conversions]); const onFromSelectChange = useCallback((value: OptionKey) => { const selected = tokenBalances diff --git a/packages/checkout/widgets-sample-app/src/components/ui/swap/swap.tsx b/packages/checkout/widgets-sample-app/src/components/ui/swap/swap.tsx index b702d1f207..69ae47e433 100644 --- a/packages/checkout/widgets-sample-app/src/components/ui/swap/swap.tsx +++ b/packages/checkout/widgets-sample-app/src/components/ui/swap/swap.tsx @@ -11,7 +11,7 @@ function SwapUI() { const updateTheme = (theme: WidgetTheme) => swap.update({config: {theme}}); useEffect(() => { - swap.mount(SWAP_TARGET_ID,{amount: '10', fromTokenAddress: 'native', toTokenAddress: "0xb95B75B4E4c09F04d5DA6349861BF1b6F163D78c"}); + swap.mount(SWAP_TARGET_ID,{amount: '5', fromTokenAddress: '0x3B2d8A1931736Fc321C24864BceEe981B11c3c57', toTokenAddress: "0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439"}); swap.addListener(SwapEventType.SUCCESS, (data: SwapSuccess) => { }) swap.addListener(SwapEventType.FAILURE, (data: any) => {