diff --git a/pkg/mev/pkg.go b/pkg/mev/pkg.go index 2c4d9b0..8b42f2e 100644 --- a/pkg/mev/pkg.go +++ b/pkg/mev/pkg.go @@ -24,7 +24,7 @@ type IBundleSender interface { } var ( - _ IBundleSender = &MEVClient{} + _ IBundleSender = &Client{} _ IBundleSender = &BloxrouteClient{} ) diff --git a/pkg/mev/send_bundle.go b/pkg/mev/send_bundle.go index 2f10f15..593cc5b 100644 --- a/pkg/mev/send_bundle.go +++ b/pkg/mev/send_bundle.go @@ -14,24 +14,24 @@ import ( "github.com/ethereum/go-ethereum/crypto" ) -// MEVClient https://beaverbuild.org/docs.html; https://rsync-builder.xyz/docs; +// Client https://beaverbuild.org/docs.html; https://rsync-builder.xyz/docs; // https://docs.flashbots.net/flashbots-auction/advanced/rpc-endpoint#eth_sendbundle -type MEVClient struct { +type Client struct { c *http.Client endpoint string flashbotKey *ecdsa.PrivateKey } -// NewMEVClient set the flashbotKey to nil will skip adding the signature header. -func NewMEVClient(c *http.Client, endpoint string, flashbotKey *ecdsa.PrivateKey) *MEVClient { - return &MEVClient{ +// NewClient set the flashbotKey to nil will skip adding the signature header. +func NewClient(c *http.Client, endpoint string, flashbotKey *ecdsa.PrivateKey) *Client { + return &Client{ c: c, endpoint: endpoint, flashbotKey: flashbotKey, } } -func (s *MEVClient) SendBundle( +func (s *Client) SendBundle( ctx context.Context, blockNumber uint64, txs ...*types.Transaction, ) (SendBundleResponse, error) { req := SendBundleRequest{ diff --git a/pkg/mev/send_bundle_test.go b/pkg/mev/send_bundle_test.go index 521d619..1aa1963 100644 --- a/pkg/mev/send_bundle_test.go +++ b/pkg/mev/send_bundle_test.go @@ -55,7 +55,7 @@ func TestSendBundle(t *testing.T) { t.Log("new tx", signedTx.Hash().String()) - sender := mev.NewMEVClient(client, endpoint, privateKey) + sender := mev.NewClient(client, endpoint, privateKey) resp, err := sender.SendBundle(ctx, blockNumber+12, signedTx) require.NoError(t, err) // sepolia: code: [-32000], message: [internal server error]