diff --git a/pkg/mev/bloxroute_submit_bundle.go b/pkg/mev/bloxroute_submit_bundle.go index 68ff816..8f2b094 100644 --- a/pkg/mev/bloxroute_submit_bundle.go +++ b/pkg/mev/bloxroute_submit_bundle.go @@ -83,7 +83,7 @@ func (s *BloxrouteClient) SendBundle( return SendBundleResponse{}, fmt.Errorf("new http request error: %w", err) } - resp, err := doRequest[SendBundleResponse](s.c, httpReq, [2]string{"Authorization", s.auth}) + resp, err := doRequest[BLXRSubmitBundleResponse](s.c, httpReq, [2]string{"Authorization", s.auth}) if err != nil { return SendBundleResponse{}, err } @@ -93,7 +93,12 @@ func (s *BloxrouteClient) SendBundle( resp.Error.Code, resp.Error.Messange) } - return resp, nil + return SendBundleResponse{ + Jsonrpc: resp.Jsonrpc, + ID: resp.ID, + Result: resp.Result, + Error: resp.Error, + }, nil } type BLXRSubmitBundleRequest struct { @@ -129,6 +134,13 @@ func (p *BLXRSubmitBundleParams) SetBlockNumber(block uint64) *BLXRSubmitBundleP return p } +type BLXRSubmitBundleResponse struct { + Jsonrpc string `json:"jsonrpc,omitempty"` + ID int `json:"id,string,omitempty"` + Result SendBundleResult `json:"result,omitempty"` + Error SendBundbleError `json:"error,omitempty"` +} + func bloxrouteSignFlashbot(key *ecdsa.PrivateKey, p *BLXRSubmitBundleParams) (string, error) { param := new(SendBundleParams) param.Txs = p.Transaction diff --git a/pkg/mev/pkg.go b/pkg/mev/pkg.go index 1ea629f..8b42f2e 100644 --- a/pkg/mev/pkg.go +++ b/pkg/mev/pkg.go @@ -82,7 +82,7 @@ func doRequest[T any](c *http.Client, req *http.Request, headers ...[2]string) ( type SendBundleResponse struct { Jsonrpc string `json:"jsonrpc,omitempty"` - ID int `json:"id,string,omitempty"` + ID int `json:"id,omitempty"` Result SendBundleResult `json:"result,omitempty"` Error SendBundbleError `json:"error,omitempty"` }