go-ethereum/suave/builder/api/api.go
Ferran Borreguero 733df027e9 Build block?
2024-02-07 09:32:46 +00:00

37 lines
1.1 KiB
Go

package api
import (
"context"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
type Bundle struct {
BlockNumber *big.Int `json:"blockNumber,omitempty"` // if BlockNumber is set it must match DecryptionCondition!
MaxBlock *big.Int `json:"maxBlock,omitempty"`
Txs types.Transactions `json:"txs"`
RevertingHashes []common.Hash `json:"revertingHashes,omitempty"`
RefundPercent *int `json:"percent,omitempty"`
}
type BuildBlockArgs struct {
Slot uint64
ProposerPubkey []byte
Parent common.Hash
Timestamp uint64
FeeRecipient common.Address
GasLimit uint64
Random common.Hash
Withdrawals []*types.Withdrawal
Extra []byte
FillPending bool
}
type API interface {
NewSession(ctx context.Context, args *BuildBlockArgs) (string, error)
AddTransaction(ctx context.Context, sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error)
AddBundle(ctx context.Context, sessionId string, bundle Bundle) error
BuildBlock(ctx context.Context, sessionId string) error
}