From c08909c927ea017e01f4fe9da4341c4006bb9dad Mon Sep 17 00:00:00 2001 From: bal7hazar Date: Thu, 19 Dec 2024 20:42:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Linter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/inventory/token/send/recipient.tsx | 3 ++- packages/profile/src/hooks/account.ts | 11 +++++++++-- packages/profile/src/hooks/wallet.ts | 15 +++++++++------ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/profile/src/components/inventory/token/send/recipient.tsx b/packages/profile/src/components/inventory/token/send/recipient.tsx index e2faeeaac..21dbb089c 100644 --- a/packages/profile/src/components/inventory/token/send/recipient.tsx +++ b/packages/profile/src/components/inventory/token/send/recipient.tsx @@ -86,7 +86,7 @@ export const Recipient = ({ setWarning(""); setTo(""); }, - [to, address, setSelectedName, setValue, setWarning, setTo], + [setSelectedName, setValue, setWarning, setTo], ); const handleBlur = useCallback(() => { @@ -108,6 +108,7 @@ export const Recipient = ({ } setSelectedName(formatAddress(address, { size: "xs", padding: true })); }, [ + name, address, wallet, warning, diff --git a/packages/profile/src/hooks/account.ts b/packages/profile/src/hooks/account.ts index e808d573e..9ee4e61c0 100644 --- a/packages/profile/src/hooks/account.ts +++ b/packages/profile/src/hooks/account.ts @@ -76,7 +76,7 @@ export function useAccountInfo({ nameOrAddress }: { nameOrAddress: string }) { return controllerName; } return ""; - }, [starkName, controllerName, nameOrAddress]); + }, [starkName, controllerName]); const address = useMemo(() => { if (starkAddress) { @@ -118,7 +118,14 @@ export function useAccountInfo({ nameOrAddress }: { nameOrAddress: string }) { return "Please input a valid Starknet address"; } return ""; - }, [starkError, controllerError, address, walletError]); + }, [ + starkError, + controllerError, + address, + walletError, + controllerName, + starkName, + ]); const warning = useMemo(() => { return walletError; diff --git a/packages/profile/src/hooks/wallet.ts b/packages/profile/src/hooks/wallet.ts index 475862088..f24b703b9 100644 --- a/packages/profile/src/hooks/wallet.ts +++ b/packages/profile/src/hooks/wallet.ts @@ -1,19 +1,20 @@ import { useQuery } from "react-query"; import { useConnection } from "./context"; import { useMemo, useState } from "react"; +import { BigNumberish } from "starknet"; -const ARGENT_ACCOUNT_CLASS_HASHES: BigInt[] = [ +const ARGENT_ACCOUNT_CLASS_HASHES: BigNumberish[] = [ BigInt("0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f"), ]; -const BRAAVOS_ACCOUNT_CLASS_HASHES: BigInt[] = [ +const BRAAVOS_ACCOUNT_CLASS_HASHES: BigNumberish[] = [ BigInt("0x02c8c7e6fbcfb3e8e15a46648e8914c6aa1fc506fc1e7fb3d1e19630716174bc"), BigInt("0x013bfe114fb1cf405bfc3a7f8dbe2d91db146c17521d40dcf57e16d6b59fa8e6"), BigInt("0x00816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253"), ]; -const OZ_ACCOUNT_CLASS_HASHES: BigInt[] = [ +const OZ_ACCOUNT_CLASS_HASHES: BigNumberish[] = [ BigInt("0x04a444ef8caf8fa0db05da60bf0ad9bae264c73fa7e32c61d245406f5523174b"), ]; -const CONTROLLER_CLASS_HASHES: BigInt[] = [ +const CONTROLLER_CLASS_HASHES: BigNumberish[] = [ BigInt("0x511dd75da368f5311134dee2356356ac4da1538d2ad18aa66d57c47e3757d59"), ]; @@ -35,8 +36,10 @@ export function useWallet({ address }: { address: string }) { try { setError(""); return await provider.getClassHashAt(BigInt(address)); - } catch (error: any) { - if (error.message.includes("Contract not found")) { + } catch (error: unknown) { + if ( + (error as { message: string }).message.includes("Contract not found") + ) { setError( "No contract detected at this address. I understand and agree to send funds to an undeployed address.", );