sdk.evm
EVM blockchain operations module for Ethereum and compatible chains.createPublicClient
Create a public client for a specific chain.Parameters
- chainId (Int) - Chain ID of the network
Returns
- PublicClient - Public client for the specified chain
Example
sendTransaction
Send an EVM transaction.Parameters
- transaction (EthereumTransaction) - Transaction to send
- wallet (BaseWallet) - Wallet to send from
Returns
- String - Transaction hash
Example
signTransaction
Sign a transaction without sending it.Parameters
- transaction (EthereumTransaction) - Transaction to sign
- wallet (BaseWallet) - Wallet to sign with
Returns
- String - Signed transaction
Example
writeContract
Write to a smart contract.Parameters
- wallet (BaseWallet) - Wallet to send from
- input (WriteContractInput) - Contract call input
Returns
- String - Transaction hash
Example
sdk.networks.evm
Get available EVM networks.Example
EthereumTransaction
Transaction object for EVM chains. Requiresimport SwiftBigInt.
Properties
| Property | Type | Description |
|---|---|---|
from | String | Sender address |
to | String | Recipient address |
value | BigUInt | Amount in Wei |
gas | BigUInt | Gas limit |
maxFeePerGas | BigUInt | Maximum fee per gas |
maxPriorityFeePerGas | BigUInt | Priority fee per gas |
data | String? | Contract call data (optional) |
WriteContractInput
Input for smart contract interactions. The ABI must be parsed from JSON string to array.Properties
| Property | Type | Description |
|---|---|---|
address | String | Contract address |
abi | [[String: Any]] | Parsed contract ABI (JSON array) |
functionName | String | Function to call |
args | [Any] | Function arguments |
Parsing ABI
Complete EVM Example
Next Steps
- Send ETH Transactions - Detailed transaction guide
- ERC-20 Token Transfers - Send ERC-20 tokens
- Smart Contract Interactions - Call contract functions