To use Para, you need an API key. This key authenticates your requests to Para services and is essential for integration. Before integrating Para with your application, ensure you have:
Completed Para authentication setup in your application (see one of our Setup Guides)
A valid Para API key
An RPC endpoint for your desired network
Need an API key? Visit the Developer Portal to create API keys, manage billing, teams, and more.
import { createParaViemClient, createParaAccount } from "@getpara/viem-v2-integration";import { http, parseEther } from "viem";import { sepolia } from "viem/chains";import Para, { Environment } from "@getpara/web-sdk";// Initialize Para (ensure authentication is completed before signing)const para = new Para(Environment.BETA, YOUR_API_KEY);// Create a Para Accountconst account = await createParaAccount(para);// Create the Para Viem WalletClientconst walletClient = createParaViemClient(para, { account: account, chain: sepolia, transport: http("https://ethereum-sepolia-rpc.publicnode.com"),});// Now you can use the client with Viem's API
Copy
Ask AI
import { createParaViemClient, createParaAccount } from "@getpara/viem-v2-integration";import { http, parseEther } from "viem";import { sepolia } from "viem/chains";import Para, { Environment } from "@getpara/web-sdk";// Initialize Para (ensure authentication is completed before signing)const para = new Para(Environment.BETA, YOUR_API_KEY);// Create a Para Accountconst account = await createParaAccount(para);// Create the Para Viem WalletClientconst walletClient = createParaViemClient(para, { account: account, chain: sepolia, transport: http("https://ethereum-sepolia-rpc.publicnode.com"),});// Now you can use the client with Viem's API
If you’re currently using Viem v1, we recommend migrating to v2 for improved features and ongoing support.
Copy
Ask AI
import { createParaViemClient, createParaAccount } from "@getpara/viem-v1-integration";import { http, parseEther } from "viem";import { sepolia } from "viem/chains";import Para, { Environment } from "@getpara/web-sdk";// Initialize Para (ensure authentication is completed before signing)const para = new Para(Environment.BETA, YOUR_API_KEY);// Create a Para Accountconst viemParaAccount = await createParaAccount(para);// Create the Para Viem Clientconst paraClient = createParaViemClient(para, { account: viemParaAccount, chain: sepolia, transport: http("https://ethereum-sepolia-rpc.publicnode.com"),});// Now you can use the client with Viem's API
Once you’ve set up the Para Viem integration, you can leverage Viem’s API with Para’s secure signing. Para handles the secure signing process without changing how you construct transactions.
Para handles only the signing process. It does not modify your transaction in any way. All transaction construction, including gas estimations and parameter settings, is your responsibility through the Viem API.
When working with the Para Viem integration, keep in mind:
Authentication requirement: The Para client must have an authenticated account before attempting any signing operations.
Wallet availability: Ensure Para has wallets available for the EVM wallet type. If you encounter errors about missing wallets, check your developer portal settings to confirm your API key is configured for EVM wallet types.
Transaction construction: Para only signs the raw bytes of the transaction you provide. Any issues related to transaction parameters (gas price, gas limit, etc.) or RPC interactions are not related to Para’s signing functionality.
Viem version compatibility: Ensure you’re using the correct Para integration package that matches your Viem version (v1 or v2).
Para’s signers can also be used on the server-side using pregen wallets or an active client side session. To learn more about using para on the server, check out these guides:
If your transaction fails with an RPC error, the issue is likely related to transaction construction, not Para’s signing process. Common causes include:
Insufficient funds for the transaction
Incorrect nonce value
Inadequate gas limit
RPC endpoint connectivity issues
Try constructing a simpler transaction first to verify the signing process works correctly.
If you receive an error about no wallets being available:
Ensure the user has completed Para’s authentication process
Verify the user has created or imported an Ethereum wallet
Check that you’re using the correct Para instance that was used during authentication
Viem v2 has stricter type requirements than v1, particularly around address formatting. Ensure you’re using the correct type annotations:
Copy
Ask AI
// Convert string addresses to the correct Viem typeconst address = "0x1234..." as `0x${string}`;// For v2, use BigInt values for gas limitsconst gas = 21000n; // or parseGwei("21000")