
Link
Send transaction
Prompt the user to review, sign, and send a gasless transaction with their wallet

Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Prompt the user to review, sign, and send a gasless transaction with their wallet

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>
);
}