Package-level declarations

Types

Link copied to clipboard
open class EthereumRpcClient(rpcUrl: String, networkId: String? = null, httpClient: HttpClient? = null)

Simple Ethereum JSON-RPC client for EVM-compatible chains.

Link copied to clipboard

Builds Ethereum transaction protobufs for use with WalletCore's TransactionCompiler.

Link copied to clipboard
@Serializable
data class JsonRpcError(val code: Int, val message: String, val data: JsonElement? = null)
Link copied to clipboard
@Serializable
data class JsonRpcObjectResponse<T>(val jsonrpc: String = "2.0", val id: Int = 1, val result: T? = null, val error: JsonRpcError? = null)

Generic JSON-RPC response that can handle object results (blocks, transactions, etc.)

Link copied to clipboard
@Serializable
data class JsonRpcRequest(val jsonrpc: String = "2.0", val method: String, val params: List<JsonElement> = emptyList(), val id: Int = 1)
Link copied to clipboard
@Serializable
data class JsonRpcResponse(val jsonrpc: String = "2.0", val id: Int = 1, val result: String? = null, val error: JsonRpcError? = null)
Link copied to clipboard
data class PreImageHashResult(val preSigningOutput: ByteArray, val signingInputData: ByteArray)

Result of building a preImageHash, containing both the PreSigningOutput and the original SigningInput bytes needed for compilation.

Link copied to clipboard
@Serializable
data class RpcBlock(val number: String, val hash: String, val timestamp: String, val baseFeePerGas: String? = null, val gasLimit: String, val gasUsed: String)

Ethereum block data from eth_getBlockByNumber. Only includes fields needed for fee calculation.

Link copied to clipboard
class RpcException(val code: Int, message: String, val data: JsonElement? = null) : Exception
Link copied to clipboard
@Serializable
data class RpcFeeHistory(val oldestBlock: String, val baseFeePerGas: List<String>, val gasUsedRatio: List<Double>, val reward: List<List<String>>? = null)

Response from eth_feeHistory.

Link copied to clipboard
@Serializable
data class RpcLog(val address: String, val topics: List<String>, val data: String, val blockNumber: String, val transactionHash: String, val transactionIndex: String, val blockHash: String, val logIndex: String, val removed: Boolean = false)

Log entry in transaction receipt.

Link copied to clipboard
@Serializable
data class RpcTransaction(val hash: String, val nonce: String, val blockHash: String? = null, val blockNumber: String? = null, val transactionIndex: String? = null, val from: String, val to: String? = null, val value: String, val gas: String, val gasPrice: String? = null, val maxFeePerGas: String? = null, val maxPriorityFeePerGas: String? = null, val input: String, val type: String? = null)

Transaction data from eth_getTransactionByHash.

Link copied to clipboard
@Serializable
data class RpcTransactionCall(val from: String? = null, val to: String, val gas: String? = null, val gasPrice: String? = null, val maxFeePerGas: String? = null, val maxPriorityFeePerGas: String? = null, val value: String? = null, val data: String? = null)

Transaction call object for eth_call and eth_estimateGas.

Link copied to clipboard
@Serializable
data class RpcTransactionReceipt(val transactionHash: String, val transactionIndex: String, val blockHash: String, val blockNumber: String, val from: String, val to: String? = null, val cumulativeGasUsed: String, val gasUsed: String, val effectiveGasPrice: String, val contractAddress: String? = null, val logs: List<RpcLog>, val logsBloom: String, val status: String, val type: String? = null, val l1Fee: String? = null, val l1GasPrice: String? = null, val l1GasUsed: String? = null)

Transaction receipt from eth_getTransactionReceipt.