-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEngineApiClient.scala
More file actions
42 lines (29 loc) · 1.36 KB
/
EngineApiClient.scala
File metadata and controls
42 lines (29 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package units.client.engine
import play.api.libs.json.*
import units.client.engine.EngineApiClient.PayloadId
import units.client.engine.model.*
import units.eth.EthAddress
import units.BlockHash
trait EngineApiClient {
def forkChoiceUpdated(blockHash: BlockHash, finalizedBlockHash: BlockHash): Either[String, PayloadStatus]
def forkChoiceUpdatedWithPayloadId(
lastBlockHash: BlockHash,
finalizedBlockHash: BlockHash,
unixEpochSeconds: Long,
suggestedFeeRecipient: EthAddress,
prevRandao: String,
withdrawals: Vector[Withdrawal] = Vector.empty
): Either[String, PayloadId]
def getPayload(payloadId: PayloadId): Either[String, JsObject]
def applyNewPayload(payloadJson: JsObject): Either[String, Option[BlockHash]]
def getPayloadBodyByHash(hash: BlockHash): Either[String, Option[JsObject]]
def getBlockByNumber(number: BlockNumber): Either[String, Option[ExecutionPayload]]
def getBlockByHash(hash: BlockHash): Either[String, Option[ExecutionPayload]]
def getLatestBlock: Either[String, ExecutionPayload]
def getBlockJsonByHash(hash: BlockHash): Either[String, Option[JsObject]]
def getPayloadJsonDataByHash(hash: BlockHash): Either[String, PayloadJsonData]
def getLogs(hash: BlockHash, address: EthAddress, topic: String): Either[String, List[GetLogsResponseEntry]]
}
object EngineApiClient {
type PayloadId = String
}