4️⃣Wallet Connect
Walkthrough for tracking wallet connects
Setting Up Wallet Connection Tracking
import { w3aSDK } from "@web3acquire/w3a";
w3aSDK.walletConnect({
walletAddress: "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
chainId: "0x1", // Optional: chainId of the connected wallet
walletProvider: "MetaMask" // Optional: wallet provider of the connected wallet
});Integration with WalletConnect
// Code snippet integrating with Wallet Connect
import { useAccount, useNetwork } from "wagmi";
import { w3aSDK } from "@web3acquire/w3a";
// -- snip --
export const WalletLogin = () => {
const { address, connector } = useAccount();
const { chain } = useNetwork();
React.useEffect(() => {
w3aSDK.walletConnect({
walletAddress: address,
chainId: chain?.id,
walletProvider: connector?.name,
});
}, [address, chain]);
// ... rest of the component
}Last updated