This example shows how to embed a simple checkout-style payment flow into a web app using Lazorkit passkey wallets, without requiring wallet extensions.
The user connects using a passkey instead of installing a browser wallet.
The app constructs a Solana transfer instruction representing the payment.
The transaction is signed with the passkey and sent on-chain with gas fees sponsored.
Minimal “Pay with Solana” widget implementation using Lazorkit. This pattern enables Web2-style checkout experiences backed by Solana smart wallets.
import { useWallet } from "@lazorkit/wallet";
import { SystemProgram, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js";
export function PayWithSolanaButton() {
const { signAndSendTransaction, smartWalletPubkey } = useWallet();
const handlePay = async () => {
if (!smartWalletPubkey) return;
const instruction = SystemProgram.transfer({
fromPubkey: smartWalletPubkey,
toPubkey: new PublicKey(""),
lamports: Math.floor(0.05 * LAMPORTS_PER_SOL),
});
await signAndSendTransaction({
instructions: [instruction],
transactionOptions: {
feeToken: "USDC",
},
});
alert("Payment successful!");
};
return <button onClick={handlePay}>Pay ₹99 with Solana</button>;
}