Skip to content

Commit

Permalink
💄 Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
bal7hazar committed Dec 19, 2024
1 parent 92004db commit c08909c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const Recipient = ({
setWarning("");
setTo("");
},
[to, address, setSelectedName, setValue, setWarning, setTo],
[setSelectedName, setValue, setWarning, setTo],
);

const handleBlur = useCallback(() => {
Expand All @@ -108,6 +108,7 @@ export const Recipient = ({
}
setSelectedName(formatAddress(address, { size: "xs", padding: true }));
}, [
name,
address,
wallet,
warning,
Expand Down
11 changes: 9 additions & 2 deletions packages/profile/src/hooks/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function useAccountInfo({ nameOrAddress }: { nameOrAddress: string }) {
return controllerName;
}
return "";
}, [starkName, controllerName, nameOrAddress]);
}, [starkName, controllerName]);

const address = useMemo(() => {
if (starkAddress) {
Expand Down Expand Up @@ -118,7 +118,14 @@ export function useAccountInfo({ nameOrAddress }: { nameOrAddress: string }) {
return "Please input a valid Starknet address";
}
return "";
}, [starkError, controllerError, address, walletError]);
}, [

Check warning on line 121 in packages/profile/src/hooks/account.ts

View workflow job for this annotation

GitHub Actions / ts-lint

React Hook useMemo has an unnecessary dependency: 'walletError'. Either exclude it or remove the dependency array
starkError,
controllerError,
address,
walletError,
controllerName,
starkName,
]);

const warning = useMemo(() => {
return walletError;
Expand Down
15 changes: 9 additions & 6 deletions packages/profile/src/hooks/wallet.ts
Original file line number Diff line number Diff line change
@@ -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"),
];

Expand All @@ -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.",
);
Expand Down

0 comments on commit c08909c

Please sign in to comment.