Swift EVM Signing
Sign and send EVM transactions using the Para Swift SDK
Overview
Para Swift SDK provides EVM signing capabilities through the ParaEvmSigner
class, enabling you to sign messages, sign
transactions, and send transactions on EVM-compatible networks.
Prerequisites
If you haven’t already done so follow the Swift SDK Setup guide to set up the Para Swift SDK before proceeding with this guide.
Usage
Initialize EVM Signer
Create a new instance of ParaEvmSigner
by providing your ParaManager instance, RPC URL, and optional wallet ID:
Select Wallet
You can change the active wallet used for signing at any time:
Sign Messages
Sign a message using the selected wallet:
Sign Transactions
To sign a transaction without sending it:
- Create and encode your transaction
- Convert it to base64
- Sign using the EVM signer
Transaction
type that can be used to create transactions. You can also use your own transaction type as long as it conforms to the RLP Encodable
protocol. Our Transaction type follows a similar structure as the Ethers.js v6 Transaction TypeSend Transactions
To sign and send a transaction in one operation:
Example
Here’s a complete example showing how to initialize the signer and perform various operations:
Do not pass in hex values for the transaction parameters. The SDK will automatically convert them to hex. Values are assumed to be in wei
by default.
Example
For an active example swift project, check out: