Skip to main content

Bundle

Bundle is a library with utilities to interact with the Flashbots bundle API described in https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint#eth_sendbundle.

Functions​

sendBundle​

Send a bundle to the Flashbots relay.

Input:

  • url (string): The URL of the Flashbots relay.

  • bundle (BundleObj): The bundle to send.

Output:

  • response (bytes): Raw bytes response from the Flashbots relay.

encodeBundleParams​

Encode a bundle in json format.

Input:

Output:

  • params (bytes): JSON-encoded bytes: {blockNumber, txs, minTimestamp, maxTimestamp}.

encodeBundle​

Encode a call to eth_sendBundle as an HttpRequest.

Input:

Output:

  • request (HttpRequest): The HttpRequest to send the bundle.

decodeBundle​

Decode a bundle from a JSON string.

Input:

  • bundleJson (string): The JSON string of the bundle.

Output:

Structs​

BundleObj​

BundleObj is a struct that represents a bundle to be sent to the Flashbots relay.

  • blockNumber (uint64): The block number at which the bundle should be executed.
  • minTimestamp (uint64): The minimum timestamp at which the bundle should be executed.
  • maxTimestamp (uint64): The maximum timestamp at which the bundle should be executed.
  • txns (``): The transactions to be included in the bundle.