Skip to main content
WalletKit prompts the user with a modal that shows the transaction details along with any expected changes in assets. The user can then review and sign the transaction using their 6-digit pin.
import { useWalletKitLink } from "@walletkit/react-link";
import { parseEther } from "viem";

export function App() {
  const walletKit = useWalletKitLink();
  const [hash, setHash] = useState("");

  const sendTransaction = async () => {
    const hash = await walletKit.signAndSendTransactions([
      {
        to: "0xc6FfEB1298Eb33Da430d14e5Eb789256ec344625",
        value: parseEther("0.01"),
      },
    ]);
    setHash(hash);
  };

  return (
    <div>
      <button onClick={() => sendTransaction()}>Send Transaction</button>
      {hash ? <div>Transaction: {hash}</div> : null}
    </div>
  );
}
import { useSendTransaction } from "wagmi";
import { parseEther } from "viem";

function App() {
  const { data, isLoading, isSuccess, sendTransaction } = useSendTransaction({
    to: "0xc6FfEB1298Eb33Da430d14e5Eb789256ec344625",
    value: parseEther("0.01"),
  });

  return (
    <div>
      <button onClick={() => sendTransaction()}>Send Transaction</button>
      {isLoading && <div>Check Wallet</div>}
      {isSuccess && <div>Transaction: {JSON.stringify(data)}</div>}
    </div>
  );
}