EVM Integration
Guide to working with EVM chains using the Para Swift SDK
The Para Swift SDK provides robust support for Ethereum Virtual Machine (EVM) compatible blockchains through the ParaEvmSigner
class. This guide demonstrates how to perform common operations such as signing messages, signing transactions, and sending transactions on EVM chains.
Getting Started
To work with EVM chains, youβll need:
- An initialized
ParaManager
instance - A wallet with EVM capabilities
- An RPC URL for your target EVM network
Initializing the EVM Signer
First, create an instance of ParaEvmSigner
by providing your Para manager, an RPC URL, and optionally a wallet ID:
Replace YOUR_API_KEY
with your actual API key from providers like Infura, Alchemy, or your own RPC node.
Selecting a Wallet
If you didnβt specify a wallet ID when creating the signer, or if you want to switch to a different wallet, use the selectWallet
method:
Signing Messages
Para makes it easy to sign arbitrary messages with your EVM wallet:
Working with Transactions
Creating an EVM Transaction
Para uses the EVMTransaction
model to represent transactions:
Signing a Transaction
To sign a transaction without broadcasting it to the network:
Sending a Transaction
To sign and broadcast a transaction in a single step:
Interacting with Smart Contracts
Paraβs EVMTransaction
model supports smart contract interactions:
Calling a Contract Function (Read-Only)
Sending a Transaction to a Contract (Write)
Deploying a Smart Contract
Working with Different Networks
Para supports any EVM-compatible network. Simply update the RPC URL and chain ID to target different networks: