import { useWalletKitLink } from "@walletkit/react-link";
import { parseUnits } from "viem";
export function App() {
const walletKit = useWalletKitLink();
const [hash, setHash] = useState("");
const sendTransaction = async () => {
const hash = await walletKit.signAndSendTransactions([
{
abi: erc20ABI,
address: USDC_ADDRESS,
functionName: "approve",
args: [
"0x000000000000000000000000000000000000dead",
parseUnits("5", 6),
],
},
{
abi: erc20ABI,
address: USDC_ADDRESS,
functionName: "transfer",
args: [
"0x000000000000000000000000000000000000dead",
parseUnits("5", 6),
],
},
]);
setHash(hash);
};
return (
<div>
<button onClick={() => sendTransaction()}>Send Transaction</button>
{hash ? <div>Transaction: {hash}</div> : null}
</div>
);
}