Skip to content

EthBundleApiClient trait clashes with MevApiClient #35

@optimiz-r

Description

@optimiz-r

It's a common use-case to want to send a private transaction in conjunction with a bundle, similar to the backrun example in the TS reference implementation.
However, importing both traits will lead to compiler error: they have methods having the same name. Differentiating them, can be verbose see example below.

Proposal 1: Split the API client

One way to address this is by breaking up the EthBundleApiClient into two separate clients:

  • EthTxApiClient: this client would exclusively handle individual transactions. It would encompass methods such as:

    • send_private_transaction
    • send_raw_private_transaction
    • cancel_private_transaction
  • EthBundleApiClient: this client would retain methods specifically designed for bundle operations, including:

    • send_bundle
    • sim_bundle
    • cancel_bundle

Proposal 2: Prefix the 'eth' methods

An alternative solution would be to prefix the eth methods, for instance, renaming send_bundle to eth_send_bundle. However, this approach might introduce a new expectation for the mev_* methods to follow a similar naming convention, like mev_send_bundle.
This inconsistency can be confusing for users. Therefore, Proposal 1 might be more intuitive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions