Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
refactor: update wallet hook usage
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Jun 4, 2022
1 parent 31a7b82 commit 379242d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/app/hooks/auth/use-wallet-login.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useUser } from "../use-user";
import { useWeb3 } from "../use-web3";
import { useAuth } from "./use-auth";
import { useNonce } from "./use-nonce";
import { useWagmi } from "./use-wagmi";
import { useWallet } from "./use-wallet";
import { useWalletLoginState } from "./use-wallet-login-state";

const LOGIN_WALLET_ENDPOINT = "login_wallet";
Expand All @@ -28,7 +28,7 @@ export function useWalletLogin() {
signed,
provider,
signature,
} = useWagmi();
} = useWallet();
const { isAuthenticated } = useUser();
const accessToken = useAccessToken();
const authenticated = useMemo(() => !!isAuthenticated, [isAuthenticated]);
Expand Down
4 changes: 2 additions & 2 deletions packages/app/hooks/use-buy-nft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ierc20MetaTx from "app/abi/IERC20MetaTx.json";
import ierc20MetaTxNonces from "app/abi/IERC20MetaTxNonces.json";
import iercPermit20Abi from "app/abi/IERC20Permit.json";
import marketplaceAbi from "app/abi/ShowtimeV1Market.json";
import { useWagmi } from "app/hooks/auth/use-wagmi";
import { useWallet } from "app/hooks/auth/use-wallet";
import { useSignerAndProvider } from "app/hooks/use-signer-provider";
import { track } from "app/lib/analytics";
import { CURRENCY_NAMES, LIST_CURRENCIES } from "app/lib/constants";
Expand Down Expand Up @@ -81,7 +81,7 @@ const buyNFTReducer = (
export const useBuyNFT = () => {
const [state, dispatch] = useReducer(buyNFTReducer, initialState);
const { getSignerAndProvider } = useSignerAndProvider();
const { address, signTypedDataAsync } = useWagmi();
const { address, signTypedDataAsync } = useWallet();

const buyNFT = async ({ nft, quantity }: { nft: NFT; quantity: number }) => {
if (!nft || !nft.listing) return;
Expand Down
4 changes: 2 additions & 2 deletions packages/app/hooks/use-current-user-address.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { Platform } from "react-native";

import { useWagmi } from "app/hooks/auth/use-wagmi";
import { useWallet } from "app/hooks/auth/use-wallet";
import { useUser } from "app/hooks/use-user";
import { useWeb3 } from "app/hooks/use-web3";
import { useWalletConnect } from "app/lib/walletconnect";
Expand All @@ -16,7 +16,7 @@ function useCurrentUserAddress() {
const [userAddress, setUserAddress] = useState("");
const { web3 } = useWeb3();
const connector = useWalletConnect();
const { address } = useWagmi();
const { address } = useWallet();
const connectedAddress = connector?.session?.accounts[0];

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/hooks/use-signer-provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Platform } from "react-native";

import { useWagmi } from "app/hooks/auth/use-wagmi";
import { useWallet } from "app/hooks/auth/use-wallet";
import { useWeb3 } from "app/hooks/use-web3";
import { useWalletConnect } from "app/lib/walletconnect";
import { getBiconomy } from "app/utilities";
Expand All @@ -11,7 +11,7 @@ export const useSignerAndProvider = () => {
const connector = useWalletConnect();
let { web3 } = useWeb3();
const Alert = useAlert();
const { address } = useWagmi();
const { address } = useWallet();

const getSignerAndProvider = async () => {
let userAddress;
Expand Down
4 changes: 2 additions & 2 deletions packages/app/providers/web3-provider.web.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useWagmi } from "app/hooks/auth/use-wagmi";
import { useWallet } from "app/hooks/auth/use-wallet";

import { Web3Provider as Web3ProviderBase } from "./web3-provider.tsx";

Expand All @@ -7,7 +7,7 @@ interface Web3ProviderProps {
}

export function Web3Provider({ children }: Web3ProviderProps) {
const { connected, provider } = useWagmi();
const { connected, provider } = useWallet();

return (
<Web3ProviderBase connected={connected} provider={provider}>
Expand Down

0 comments on commit 379242d

Please sign in to comment.