> ## Documentation Index
> Fetch the complete documentation index at: https://primev-24-updates-and-fixes-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools for Bid Submission

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](https://github.com/fullstorydev/grpcurl), or [BloomRPC](https://github.com/bloomrpc/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:

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

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

```go
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:

<CodeGroup>
  ```shell ❯_ structure
  curl -X POST http://localhost:13523/v1/bidder/bid \
  -d '{
    "txHashes": [<the hash of the transaction>],
    "amount": <amount in wei>,
    "blockNumber": <l1blocknumber>
    "decayStartTimestamp": <timestamp>,
    "decayEndTimestamp": <timestamp>
  }'
  ```

  ```shell ❯_ example
  curl -X POST http://localhost:13523/v1/bidder/bid \
  -d '{
    "txHashes": ["91a89B633194c0D86C539A1A5B14DCCacfD47094"],
    "amount": 10000000000000000,
    "blockNumber": 4123456,
    "decayStartTimestamp": 1716935571901,
    "decayEndTimestamp": 1716935572901
  }'
  ```
</CodeGroup>

🌐 **Postman Power**: Prefer a GUI? We've created a
[custom Postman request](https://primev.postman.co/workspace/Team-Workspace~18870d84-94f0-4d1e-8163-db558f83d7e8/request/27192304-fab87a71-9722-46f8-825f-d9791ead6178?ctx=documentation\&tab=body)
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](/api-reference/bidder/sendbid).
