We recommend leveraging the Go RPC client or alternatively using the REST API below to send bids. For those who prefer to use command-line tools, options like grpcurl, or BloomRPC are available. These tools require the protobuf definitions from the repository to interact with the RPC services.

Official Go RPC Client

For Go developers, leveraging the official Go RPC client is the recommended approach. Start by installing the mev-commit package:

❯_ terminal
go install github.com/primev/mev-commit@latest

Then, incorporate the generated client into your Go application as follows:

import bidderapiv1 "github.com/primev/mev-commit/p2p/gen/go/bidderapi/v1"

conn, err := grpc.DialContext(
    context.Background(),
    "localhost:13524",
    grpc.WithBlock(),
    grpc.WithTransportCredentials(insecure.NewCredentials()),
)

if err != nil {
    // Error handling logic here
}

currentTime := time.Now().UnixMilli()

bid := &pb.Bid{
    TxHashes: []string{
        "fe4cb47db3630551beedfbd02a71ecc69fd59758e2ba699606e2d5c74284ffa7",
        "71c1348f2d7ff7e814f9c3617983703435ea7446de420aeac488bf1de35737e8",
    },
    Amount:              "1000000000", // Specify amount in wei
    BlockNumber:         123456,
    DecayStartTimestamp: currentTime - (time.Duration(8 * time.Second).Milliseconds()),
	DecayEndTimestamp:   currentTime + (time.Duration(8 * time.Second).Milliseconds()),
}

rcv, err := bidderClient.SendBid(context.Background(), bid)
if err != nil {
    // Error handling logic here
}

for {
    pc, err := rcv.Recv()
    if err == io.EOF {
        break
    }
    if err != nil {
        // Error handling logic here
    }
    fmt.Println("Received preconfirmation:", pc.String())
}

Custom Client Generation

Utilize the provided protobuf files to generate a client in your preferred programming language, enabling seamless integration with your existing codebase.

REST API

🚀 Ready to send bids? Just execute this command:

🌐 Postman Power: Prefer a GUI? We’ve created a custom Postman request as an alterative way to send bids. Ensure you’ve got the Postman agent ready to go!

The REST API provides a straightforward way to submit bids using HTTP requests. For detailed usage instructions, refer to the Bidder API documentation.