Ethers Integration
Integrate Para with Ethers.js (v5 or v6) to enable secure transaction signing while preserving the full Ethers API functionality.
Ethers.js is a library for interacting with Ethereum. This guide shows how to integrate Para’s secure signing with both v6 and v5 versions. Build transactions with Ethers API and sign them securely using Para.
Prerequisites
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.
Installation
Choose your package manager to install the Para Ethers integration along with Ethers.js:
Basic Setup
Usage Examples
Once you’ve set up the Para Ethers Signer, you can use it just like any standard Ethers signer. Para handles the secure signing process without changing how you construct transactions. An example of sending ETH and interacting with a smart contract is provided below.
Sending ETH
Interacting with Smart Contracts
As long as the Para client is authenticated and has wallets available, you can use the full Ethers.js API with the Para Ethers Signer without any additional changes.
ParaEthersSigner Methods
The ParaEthersSigner
provides standard Ethers.js signer functionality, allowing you to use Para’s secure signing capabilities:
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 Ethers.js API.
Important Considerations
When working with the ParaEthersSigner
, 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 for 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. The RPC endpoint or the transaction itself may be the source of any issues.
-
Network configuration: Make sure your RPC endpoint matches the network configuration in your Para setup. Ensuring you set the correct RPC URL to match the transaction Chain ID is crucial for successful transaction signing and submission.
Server-Side Signing
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:
Examples
If you’d like to learn more about how to use the ParaEthersSigner for different transaction types, check out this example in our Examples Hub:
Troubleshooting
Transaction Fails with RPC Error
Transaction Fails with RPC Error
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.
No Wallets Available
No Wallets Available
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
Signature Verification Issues
Signature Verification Issues
If signatures are not being verified correctly:
- Check that you’re using the correct address from
getAddress()
- For EIP-712 typed data, ensure your domain and types match exactly between signing and verification
- Verify that message formatting is consistent (some applications may prepend specific prefixes)
Next Steps
Now that you’ve completed signing transactions with Ethers.js, explore more advanced features like Permissions Popups. If you’re ready to kick off your project launch with Para, check out our Go Live Checklist.