From 3815d5e7d17c8e29bac38b400fd6ced32671f0dd Mon Sep 17 00:00:00 2001 From: pedromcunha Date: Tue, 12 Nov 2024 15:08:04 -0500 Subject: [PATCH 1/2] Ensure chain id is passed in when getting default dead address --- .../ui/src/components/common/CustomAddressModal.tsx | 8 ++++---- .../ui/src/components/widgets/SwapWidgetRenderer.tsx | 12 ++++++++++-- packages/ui/src/hooks/useCurrencyBalance.ts | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/ui/src/components/common/CustomAddressModal.tsx b/packages/ui/src/components/common/CustomAddressModal.tsx index e054409c..b2f64ff9 100644 --- a/packages/ui/src/components/common/CustomAddressModal.tsx +++ b/packages/ui/src/components/common/CustomAddressModal.tsx @@ -77,7 +77,7 @@ export const CustomAddressModal: FC = ({ setAddress('') setInput('') } else { - if (isValidAddress(toChain?.vmType, toAddress ?? '')) { + if (isValidAddress(toChain?.vmType, toAddress ?? '', toChain?.id)) { setAddress(toAddress ? toAddress : '') setInput(toAddress ? toAddress : '') } @@ -90,7 +90,7 @@ export const CustomAddressModal: FC = ({ ) useEffect(() => { - if (isValidAddress(toChain?.vmType, input)) { + if (isValidAddress(toChain?.vmType, input, toChain?.id)) { setAddress(input) } else if (resolvedENS?.address) { setAddress(resolvedENS.address) @@ -247,10 +247,10 @@ export const CustomAddressModal: FC = ({ ) : null}