Account Abstraction
Account abstraction (AA) replaces traditional externally owned accounts (EOAs) with programmable smart contract accounts. This unlocks capabilities that EOAs alone cannot provide:- Gas sponsorship — let users transact without holding native tokens for gas fees
- Batched transactions — bundle multiple operations into a single atomic transaction
- Session keys — grant temporary, scoped permissions without exposing the primary key
- Custom authorization — implement multi-factor auth, spending limits, or recovery logic at the account level
- Programmable accounts — create accounts with built-in rules for corporate or multi-user scenarios
| EIP-4337 | EIP-7702 | |
|---|---|---|
| How it works | UserOperations processed by bundlers via an EntryPoint contract | EOA delegates to a smart contract via a type-4 transaction |
| Account address | New smart contract address (different from EOA) | Same as your EOA |
| Chain support | All EVM chains | Requires chain-level support |
| Infrastructure | Bundler + Paymaster | Provider-dependent |
| Gas overhead | Higher (extra validation steps) | Lower (native execution) |
| Maturity | Production-ready | Emerging |
| Best for | Maximum compatibility, dedicated smart wallet | Keeping EOA address, simpler flows |
Para Integrations
Para acts as the signer (EOA) that controls smart contract wallets — it is not a smart wallet itself. Para handles secure key management via MPC, while the AA provider deploys and manages the smart contract account on-chain. This means your users’ private keys remain secure and under their control regardless of which provider you choose. Para wraps each provider in a sharedSmartAccount interface. Whether you use EIP-4337 or EIP-7702 mode, your application code stays the same — you can swap providers or switch between standards without rewriting transaction logic.
Every provider integration is available as an action function (createXxxSmartAccount) — an imperative async function you can call anywhere, including outside React components, inside custom hooks, or in server-side code. React applications also get a hook (useXxxSmartAccount) — a declarative wrapper powered by React Query that handles initialization, caching, and automatic re-creation when config changes.
Both return the same SmartAccount object:
Copy
Ask AI
import type { Chain, Hex, LocalAccount, TransactionReceipt } from "viem";
interface SmartAccount {
smartAccountAddress: Hex; // On-chain account address
signer: LocalAccount; // Para viem signer
chain: Chain; // Configured chain
mode: "4337" | "7702"; // Account type
provider: string; // Provider name
// Send a single transaction and wait for receipt
sendTransaction(params: {
to: Hex;
value?: bigint;
data?: Hex;
}): Promise<TransactionReceipt>;
// Send batched transactions atomically
sendBatchTransaction(calls: Array<{
to: Hex;
value?: bigint;
data?: Hex;
}>): Promise<TransactionReceipt>;
client: any; // Provider-specific client for advanced usage
}
mode: "7702", the return type narrows to include an optional delegationAddress field — the smart
contract the EOA delegates to. When using mode: "4337", smartAccountAddress is the counterfactual smart
contract address (different from signer.address).
Provider Comparison
| Provider | 4337 | 7702 | External Wallets | Chain Restrictions | Key Feature |
|---|---|---|---|---|---|
| Alchemy | ✓ | ✓ | ✓ | Alchemy-supported chains | Modular accounts, gas policies |
| ZeroDev | ✓ | ✓ | ✓ | Any EVM chain | Kernel accounts, session keys, plugins |
| Pimlico | ✓ | ✓ | ✓ | Any EVM chain | Permissionless SDK, flexible paymaster |
| Biconomy | ✓ | ✓ | ✓ | MEE-supported chains | Cross-chain orchestration via MEE |
| Thirdweb | ✓ | ✓ | ✓ | Any EVM chain | Smart wallets, gas sponsorship |
| Gelato | ✓ | Any EVM chain | Native 7702, built-in gas sponsorship | ||
| Porto | ✓ | Multiple chains | 7702-native relay, merchant-based gas sponsorship | ||
| Safe | ✓ | ✓ | Any EVM chain | Multi-sig, modular accounts | |
| Rhinestone | ✓ | ✓ | Any EVM chain | Cross-chain orchestration | |
| Coinbase Developer Platform | ✓ | Base, Base Sepolia only | Coinbase smart accounts |
Using with External Wallets
If your user signs in with a supported browser wallet (MetaMask, Rainbow, etc.) and has no embedded wallets in their session, invoking any of the hooks and not specifying an address (or specifying the external wallet’s address) will use that wallet as the smart account signer, with no extra configuration needed.- External wallets can only use EIP-4337 mode. EIP-7702 requires
signAuthorization, which most browser wallets currently don’t support — attempting it throws aSmartAccountErrorwith codeINVALID_CONFIG. - The external wallet must be on the same chain as the smart account before calling
sendTransaction. A mismatch throws aSmartAccountErrorwith codeCHAIN_MISMATCH. You can use wagmi’suseSwitchChainto manage your connection state before attempting a transaction.
Provider Guides
Select a provider below for installation and usage instructions.- Alchemy
- ZeroDev
- Pimlico
- Biconomy
- Thirdweb
- Gelato
- Porto
- Safe
- Rhinestone
- Coinbase Developer Platform
provides modular smart accounts with built-in gas sponsorship via Alchemy’s Gas Manager. Create and manage smart accounts, submit gasless transactions, and execute batched UserOperations — all without requiring users to leave your application. Supports both EIP-4337 and EIP-7702 modes.
Setup
- Create an and obtain your API key and Gas Policy ID from the Alchemy dashboard.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- useAlchemySmartAccount
- createAlchemySmartAccount
The simplest way to integrate Alchemy smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
AlchemySmartAccount.tsx
Copy
Ask AI
import { useAlchemySmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
const ALCHEMY_API_KEY = process.env.NEXT_PUBLIC_ALCHEMY_API_KEY!;
const GAS_POLICY_ID = process.env.NEXT_PUBLIC_ALCHEMY_GAS_POLICY_ID!;
export function AlchemySmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// account client setup, and paymaster configuration internally.
// It re-creates the account automatically if any config value changes.
const { smartAccount, isLoading, error } = useAlchemySmartAccount({
apiKey: ALCHEMY_API_KEY,
chain: sepolia,
gasPolicyId: GAS_POLICY_ID, // enables gas sponsorship
mode: "4337", // or "7702" — see EIP comparison above
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
// All calls are bundled into a single on-chain transaction.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
alchemy-action.ts
Copy
Ask AI
import { createAlchemySmartAccount } from "@getpara/react-sdk";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createAlchemySmartAccount({
para,
apiKey: "YOUR_ALCHEMY_API_KEY",
chain: sepolia,
gasPolicyId: "YOUR_GAS_POLICY_ID",
mode: "4337", // or "7702"
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
Alchemy requires chains from
@account-kit/infra (e.g. sepolia, baseSepolia). Plain viem chains are
automatically mapped if an Alchemy equivalent exists. For gasless transactions, set up a Gas Manager Policy in your and pass the policy ID as gasPolicyId.External wallet support: Alchemy supports external wallets (e.g. MetaMask, Rainbow) as signers via the
signer parameter in 4337 mode. Requesting mode: "7702" with an external wallet will throw a SmartAccountError — external wallets cannot produce the raw signAuthorization needed for EIP-7702. is an embedded AA wallet powering many smart accounts across EVM chains. Known for its extensive feature set including gas sponsorship, session keys, recovery, multisig, and . Supports both EIP-4337 and EIP-7702 modes.
Setup
- Create a and obtain your Project ID from the ZeroDev dashboard.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- useZeroDevSmartAccount
- createZeroDevSmartAccount
The simplest way to integrate ZeroDev smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
ZeroDevSmartAccount.tsx
Copy
Ask AI
import { useZeroDevSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
const ZERODEV_PROJECT_ID = process.env.NEXT_PUBLIC_ZERODEV_PROJECT_ID!;
export function ZeroDevSmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// Kernel account setup, and ECDSA validator configuration internally.
const { smartAccount, isLoading, error } = useZeroDevSmartAccount({
projectId: ZERODEV_PROJECT_ID,
chain: sepolia,
mode: "4337", // or "7702"
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
zerodev-action.ts
Copy
Ask AI
import { createZeroDevSmartAccount } from "@getpara/react-sdk";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createZeroDevSmartAccount({
para,
projectId: "YOUR_ZERODEV_PROJECT_ID",
chain: sepolia,
mode: "4337", // or "7702"
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
You can optionally pass
bundlerUrl and paymasterUrl to use custom infrastructure instead of ZeroDev’s defaults. For more on managing your ZeroDev project and RPC endpoints, see the .External wallet support: ZeroDev supports external wallets (e.g. MetaMask, Rainbow) as signers via the
signer parameter in 4337 mode. Requesting mode: "7702" with an external wallet will throw a SmartAccountError — external wallets cannot produce the raw signAuthorization needed for EIP-7702. provides account abstraction infrastructure via , a TypeScript library built on viem with no extra dependencies and a small bundle size. Pimlico supports multiple account implementations including Safe, Kernel, Biconomy, and SimpleAccount. Supports both EIP-4337 and EIP-7702 modes.
Setup
- Create a and obtain your API key from the Pimlico dashboard.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- usePimlicoSmartAccount
- createPimlicoSmartAccount
The simplest way to integrate Pimlico smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
PimlicoSmartAccount.tsx
Copy
Ask AI
import { usePimlicoSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
const PIMLICO_API_KEY = process.env.NEXT_PUBLIC_PIMLICO_API_KEY!;
export function PimlicoSmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// simple account setup, and Pimlico paymaster configuration internally.
const { smartAccount, isLoading, error } = usePimlicoSmartAccount({
apiKey: PIMLICO_API_KEY,
chain: sepolia,
mode: "4337", // or "7702"
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
pimlico-action.ts
Copy
Ask AI
import { createPimlicoSmartAccount } from "@getpara/react-sdk";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createPimlicoSmartAccount({
para,
apiKey: "YOUR_PIMLICO_API_KEY",
chain: sepolia,
mode: "4337", // or "7702"
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
The Pimlico bundler/paymaster URL is automatically constructed from your API key and chain name. You can override it with a custom
rpcUrl. Pimlico’s permissionless.js also supports other account types (Safe, Kernel, Biconomy, SimpleAccount) — see the .External wallet support: Pimlico supports external wallets (e.g. MetaMask, Rainbow) as signers via the
signer parameter in 4337 mode. Requesting mode: "7702" with an external wallet will throw a SmartAccountError — external wallets cannot produce the raw signAuthorization needed for EIP-7702. is a full-stack AA toolkit built on ERC-4337 that provides smart accounts, paymasters, and bundlers. Its Multi-chain Execution Environment (MEE) enables cross-chain orchestration of transactions. Supports both EIP-4337 and EIP-7702 modes.
Setup
- Create a and obtain your API key from the Biconomy dashboard.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- useBiconomySmartAccount
- createBiconomySmartAccount
The simplest way to integrate Biconomy smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
BiconomySmartAccount.tsx
Copy
Ask AI
import { useBiconomySmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
const BICONOMY_API_KEY = process.env.NEXT_PUBLIC_BICONOMY_API_KEY!;
export function BiconomySmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// Nexus account setup, and MEE client configuration internally.
const { smartAccount, isLoading, error } = useBiconomySmartAccount({
apiKey: BICONOMY_API_KEY,
chain: sepolia,
mode: "4337", // or "7702"
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
biconomy-action.ts
Copy
Ask AI
import { createBiconomySmartAccount } from "@getpara/react-sdk";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createBiconomySmartAccount({
para,
apiKey: "YOUR_BICONOMY_API_KEY",
chain: sepolia,
mode: "4337", // or "7702"
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
Biconomy transactions are executed via the MEE (Multi-chain Execution Environment). You can optionally pass a custom
meeUrl to use your own MEE node.External wallet support: Biconomy supports external wallets (e.g. MetaMask, Rainbow) as signers via the
signer parameter in 4337 mode. Requesting mode: "7702" with an external wallet will throw a SmartAccountError — external wallets cannot produce the raw signAuthorization needed for EIP-7702. provides smart wallets with built-in gas sponsorship.
Supports both EIP-4337 and EIP-7702 modes.
Setup
- Create a and obtain your Client ID from the Thirdweb dashboard.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- useThirdwebSmartAccount
- createThirdwebSmartAccount
The simplest way to integrate Thirdweb smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
ThirdwebSmartAccount.tsx
Copy
Ask AI
import { useThirdwebSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
const THIRDWEB_CLIENT_ID = process.env.NEXT_PUBLIC_THIRDWEB_CLIENT_ID!;
export function ThirdwebSmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// smart wallet setup, and gas sponsorship configuration internally.
const { smartAccount, isLoading, error } = useThirdwebSmartAccount({
clientId: THIRDWEB_CLIENT_ID,
chain: sepolia,
sponsorGas: true, // enable gas sponsorship (default)
mode: "4337", // or "7702"
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
thirdweb-action.ts
Copy
Ask AI
import { createThirdwebSmartAccount } from "@getpara/react-sdk";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createThirdwebSmartAccount({
para,
clientId: "YOUR_THIRDWEB_CLIENT_ID",
chain: sepolia,
sponsorGas: true, // enable gas sponsorship (default)
mode: "4337", // or "7702"
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
Set
sponsorGas: false to disable gas sponsorship. In EIP-4337 mode, you can optionally provide factoryAddress and accountAddress for custom smart wallet deployments.External wallet support: Thirdweb supports external wallets (e.g. MetaMask, Rainbow) as signers via the
signer parameter in 4337 mode. Requesting mode: "7702" with an external wallet will throw a SmartAccountError — external wallets cannot produce the raw signAuthorization needed for EIP-7702. provides native EIP-7702 smart accounts with built-in gas sponsorship via relay infrastructure.
Setup
- Create a and obtain your API key from the Gelato dashboard.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- useGelatoSmartAccount
- createGelatoSmartAccount
The simplest way to integrate Gelato smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
GelatoSmartAccount.tsx
Copy
Ask AI
import { useGelatoSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
const GELATO_API_KEY = process.env.NEXT_PUBLIC_GELATO_API_KEY!;
export function GelatoSmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// Gelato account setup, and 7702 delegation internally.
// Gelato only supports EIP-7702 mode.
const { smartAccount, isLoading, error } = useGelatoSmartAccount({
apiKey: GELATO_API_KEY,
chain: sepolia,
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
gelato-action.ts
Copy
Ask AI
import { createGelatoSmartAccount } from "@getpara/react-sdk";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createGelatoSmartAccount({
para,
apiKey: "YOUR_GELATO_API_KEY",
chain: sepolia,
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
Gelato only supports EIP-7702 mode. Gas sponsorship is built into Gelato’s relay infrastructure — no separate paymaster configuration is needed.
No external wallet support. Gelato is 7702-only and requires
signAuthorization, which external wallets (MetaMask, Rainbow, etc.) cannot produce. Passing an external wallet as signer will throw a SmartAccountError. provides 7702-native smart accounts with a built-in relay — no bundler or paymaster needed.
Setup
- No API key or third-party account is needed. Porto uses its own relay RPC.
-
Gas sponsorship: On testnets, Porto’s relay sponsors gas by default — no setup needed.
For mainnet, you must set up a
to cover gas fees for your users. Run
pnpx porto onboard --admin-keyto create a merchant account, deploy a server-side merchant route usingporto/server, and pass your endpoint URL asmerchantUrlin the config below. - Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- usePortoSmartAccount
- createPortoSmartAccount
The simplest way to integrate Porto smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
PortoSmartAccount.tsx
Copy
Ask AI
import { usePortoSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { parseEther } from "viem";
import { base } from "viem/chains";
export function PortoSmartAccount() {
// Initialize the smart account. The hook handles Para signer creation
// and Porto relay configuration internally.
// Testnets: gas is sponsored by default, no merchantUrl needed.
// Mainnet: merchantUrl is required for gas sponsorship.
const { smartAccount, isLoading, error } = usePortoSmartAccount({
chain: base,
merchantUrl: '/porto/merchant', // required for mainnet
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
porto-action.ts
Copy
Ask AI
import { createPortoSmartAccount } from "@getpara/react-sdk";
import { parseEther } from "viem";
import { base } from "viem/chains";
// `para` is your authenticated Para instance
// Testnets: gas is sponsored by default, no merchantUrl needed.
// Mainnet: merchantUrl is required for gas sponsorship.
const smartAccount = await createPortoSmartAccount({
para,
chain: base,
merchantUrl: '/porto/merchant', // required for mainnet
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
Porto only supports EIP-7702 mode. The Porto relay supports including Base, Optimism, Arbitrum, Ethereum, and several testnets. On testnets, gas fees are sponsored by default. For mainnet, a is required — pass
merchantUrl to enable gas sponsorship.No external wallet support. Porto is 7702-only and requires
signAuthorization, which external wallets (MetaMask, Rainbow, etc.) cannot produce. Passing an external wallet as signer will throw a SmartAccountError. (formerly Gnosis Safe) provides multi-signature smart contract wallets with ERC-4337 compatibility. The user’s EOA from Para serves as the signer, while the Safe smart contract wallet holds assets and submits transactions. Powered by Pimlico’s bundler and paymaster infrastructure.
Setup
- Create a and obtain your API key — Safe uses Pimlico for bundler and paymaster services.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- useSafeSmartAccount
- createSafeSmartAccount
The simplest way to integrate Safe smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
SafeSmartAccount.tsx
Copy
Ask AI
import { useSafeSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
const PIMLICO_API_KEY = process.env.NEXT_PUBLIC_PIMLICO_API_KEY!;
export function SafeSmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// Safe account setup, and Pimlico paymaster configuration internally.
// Safe only supports EIP-4337 mode.
const { smartAccount, isLoading, error } = useSafeSmartAccount({
pimlicoApiKey: PIMLICO_API_KEY,
chain: sepolia,
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
safe-action.ts
Copy
Ask AI
import { createSafeSmartAccount } from "@getpara/react-sdk";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createSafeSmartAccount({
para,
pimlicoApiKey: "YOUR_PIMLICO_API_KEY",
chain: sepolia,
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
Safe only supports EIP-4337 mode. You can optionally pass
safeVersion (default: "1.4.1") and saltNonce for deterministic address generation.External wallet support: Safe supports external wallets (e.g. MetaMask, Rainbow) as signers via the
signer parameter. provides cross-chain smart accounts with intent-based transactions, automatic bridging, and gas abstraction across multiple EVM chains. Transactions are routed through Rhinestone’s orchestrator which handles cross-chain execution automatically.
Setup
- Obtain your Rhinestone API key and optionally a Pimlico API key for bundler/paymaster infrastructure.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- useRhinestoneSmartAccount
- createRhinestoneSmartAccount
The simplest way to integrate Rhinestone smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
RhinestoneSmartAccount.tsx
Copy
Ask AI
import { useRhinestoneSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
const RHINESTONE_API_KEY = process.env.NEXT_PUBLIC_RHINESTONE_API_KEY!;
const PIMLICO_API_KEY = process.env.NEXT_PUBLIC_PIMLICO_API_KEY!;
export function RhinestoneSmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// Rhinestone account setup, and orchestrator configuration internally.
// Rhinestone only supports EIP-4337 mode.
const { smartAccount, isLoading, error } = useRhinestoneSmartAccount({
chain: sepolia,
rhinestoneApiKey: RHINESTONE_API_KEY,
pimlicoApiKey: PIMLICO_API_KEY,
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
rhinestone-action.ts
Copy
Ask AI
import { createRhinestoneSmartAccount } from "@getpara/react-sdk";
import { sepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createRhinestoneSmartAccount({
para,
chain: sepolia,
rhinestoneApiKey: "YOUR_RHINESTONE_API_KEY",
pimlicoApiKey: "YOUR_PIMLICO_API_KEY",
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
Rhinestone only supports EIP-4337 mode. Both
rhinestoneApiKey and pimlicoApiKey are optional but recommended for production use. For advanced cross-chain use cases with automatic bridging, see the .External wallet support: Rhinestone supports external wallets (e.g. MetaMask, Rainbow) as signers via the
signer parameter. provides Coinbase smart accounts on Base. Uses viem’s built-in
toCoinbaseSmartAccount — no additional bundler packages required.Setup
- Create a and obtain your RPC token from the paymaster URL in the CDP dashboard.
- Install the required dependencies:
Copy
Ask AI
npm install @getpara/react-sdk viem
Usage
- useCDPSmartAccount
- createCDPSmartAccount
The simplest way to integrate CDP smart accounts into your Para React application. The hook manages initialization, caching, and re-creation automatically via React Query.
CDPSmartAccount.tsx
Copy
Ask AI
import { useCDPSmartAccount } from "@getpara/react-sdk";
import { useMutation } from "@tanstack/react-query";
import { baseSepolia } from "viem/chains";
import { parseEther } from "viem";
const CDP_RPC_TOKEN = process.env.NEXT_PUBLIC_CDP_RPC_TOKEN!;
export function CDPSmartAccount() {
// Initialize the smart account. The hook handles Para signer creation,
// Coinbase account setup, and CDP paymaster configuration internally.
// CDP only supports EIP-4337 mode on Base and Base Sepolia.
const { smartAccount, isLoading, error } = useCDPSmartAccount({
rpcToken: CDP_RPC_TOKEN,
chain: baseSepolia,
});
// Wrap sendTransaction in a mutation for loading/error state management.
const {
mutate: sendTransaction,
isPending: isSending,
error: sendError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
},
onSuccess: (receipt) => {
console.log("Transaction hash:", receipt.transactionHash);
},
});
// Wrap sendBatchTransaction for executing multiple calls atomically.
const {
mutate: sendBatch,
isPending: isBatching,
error: batchError,
} = useMutation({
mutationFn: async () => {
if (!smartAccount) throw new Error("Smart account not ready");
return smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
},
onSuccess: (receipt) => {
console.log("Batch tx hash:", receipt.transactionHash);
},
});
if (isLoading) return <p>Setting up smart account...</p>;
if (error) return <p>Error: {error.message}</p>;
if (!smartAccount) return null;
return (
<div>
<p>Smart Account: {smartAccount.smartAccountAddress}</p>
<p>Mode: {smartAccount.mode}</p>
{/* Single transaction */}
<button onClick={() => sendTransaction()} disabled={isSending}>
{isSending ? "Sending..." : "Send Transaction"}
</button>
{sendError && <p>Send failed: {sendError.message}</p>}
{/* Batched transactions */}
<button onClick={() => sendBatch()} disabled={isBatching}>
{isBatching ? "Batching..." : "Send Batch"}
</button>
{batchError && <p>Batch failed: {batchError.message}</p>}
</div>
);
}
For use outside React components or when you need more control over initialization.
cdp-action.ts
Copy
Ask AI
import { createCDPSmartAccount } from "@getpara/react-sdk";
import { baseSepolia } from "viem/chains";
import { parseEther } from "viem";
// `para` is your authenticated Para instance
const smartAccount = await createCDPSmartAccount({
para,
rpcToken: "YOUR_CDP_RPC_TOKEN",
chain: baseSepolia,
});
if (smartAccount) {
// Send a single transaction
const receipt = await smartAccount.sendTransaction({
to: "0xRecipient",
value: parseEther("0.01"),
});
// Send batched transactions
const batchReceipt = await smartAccount.sendBatchTransaction([
{ to: "0xRecipientA", value: parseEther("0.01") },
{ to: "0xRecipientB", data: "0xencodedCallData" },
]);
}
CDP only supports EIP-4337 mode and is limited to Base and Base Sepolia chains. No additional bundler packages are needed — CDP uses viem’s built-in
toCoinbaseSmartAccount.No external wallet support. CDP’s Coinbase smart wallet uses raw
ecrecover for signature verification, which is incompatible with the EIP-191 prefix that external wallets (MetaMask, Rainbow, etc.) add when signing. Passing an external wallet as signer will throw a SmartAccountError.