diff --git a/packages/profile/src/hooks/starknetid.ts b/packages/profile/src/hooks/starknetid.ts index 77f506b51..2037ddd25 100644 --- a/packages/profile/src/hooks/starknetid.ts +++ b/packages/profile/src/hooks/starknetid.ts @@ -1,6 +1,5 @@ import { useQuery } from "react-query"; import { useConnection } from "./context"; -import { Provider } from "starknet"; import { useState } from "react"; export const useStarkAddress = ({ name }: { name: string }) => { @@ -11,12 +10,8 @@ export const useStarkAddress = ({ name }: { name: string }) => { enabled: !!name && name.includes(".stark"), queryKey: ["starknetid", name], queryFn: async () => { - console.log(provider); setError(""); - const custom = new Provider({ - nodeUrl: "https://api.cartridge.gg/x/starknet/mainnet", - }); - const address = await custom.getAddressFromStarkName(name); + const address = await provider.getAddressFromStarkName(name); if (!address || address === "0x0") { setError("Could not get address from stark name"); return null; diff --git a/packages/profile/src/hooks/wallet.ts b/packages/profile/src/hooks/wallet.ts index b05aad173..475862088 100644 --- a/packages/profile/src/hooks/wallet.ts +++ b/packages/profile/src/hooks/wallet.ts @@ -1,7 +1,6 @@ import { useQuery } from "react-query"; import { useConnection } from "./context"; import { useMemo, useState } from "react"; -import { Provider } from "starknet"; const ARGENT_ACCOUNT_CLASS_HASHES: BigInt[] = [ BigInt("0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f"), @@ -35,11 +34,7 @@ export function useWallet({ address }: { address: string }) { queryFn: async () => { try { setError(""); - console.log(provider); - const custom = new Provider({ - nodeUrl: "https://api.cartridge.gg/x/starknet/mainnet", - }); - return await custom.getClassHashAt(BigInt(address)); + return await provider.getClassHashAt(BigInt(address)); } catch (error: any) { if (error.message.includes("Contract not found")) { setError(