LazorKit SDK Example

Gasless Transactions

Pay transaction fees with USDC instead of SOL.Perfect for onboarding users with no native tokens.

Powered by LazorKit Paymaster

Why Gasless?

Remove the biggest barrier to Web3 adoption. Let users transact with just USDC.

No SOL Required

Users can transact without holding any SOL. Perfect for new users with just USDC.

Pay with USDC

Transaction fees are automatically converted from USDC to SOL by the paymaster.

Same Speed

Gasless transactions are processed at the same speed as regular transactions.

Better Onboarding

Dramatically simplify user onboarding by removing the SOL acquisition step.

Fully Secure

Same security guarantees as regular transactions with passkey authentication.

Simple Integration

Just add feeToken: "USDC" to your transaction options. That's it!

Quick Implementation

gasless-transaction.tsx
1import { useWallet } from '@lazorkit/wallet';
2import { SystemProgram, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';
3
4function SendTransaction() {
5 const { signAndSendTransaction, smartWalletPubkey } = useWallet();
6
7 const sendWithGasless = async (recipient: string, amount: number) => {
8 const instruction = SystemProgram.transfer({
9 fromPubkey: smartWalletPubkey,
10 toPubkey: new PublicKey(recipient),
11 lamports: Math.floor(amount * LAMPORTS_PER_SOL),
12 });
13
14 // Pay gas with USDC instead of SOL
15 const signature = await signAndSendTransaction({
16 instructions: [instruction],
17 transactionOptions: { feeToken: 'USDC' } // <-- Magic happens here!
18 });
19
20 return signature;
21 };
22
23 return (
24 <button onClick={() => sendWithGasless(recipient, 0.001)}>
25 Send Gasless Transaction
26 </button>
27 );
28}