From b8d01b8e57d4f87a25541a7e498073aee57c5e31 Mon Sep 17 00:00:00 2001 From: irrun Date: Fri, 26 Apr 2024 12:29:56 +0800 Subject: [PATCH] feat: ethclient of bundle --- ethclient/ethclient.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index d02e7975a5..d01f96df10 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -773,8 +773,20 @@ func (ec *Client) BestBidGasFee(ctx context.Context, parentHash common.Hash) (*b } // SendBundle sends a bundle -func (ec *Client) SendBundle(ctx context.Context, args *types.SendBundleArgs) error { - return ec.c.CallContext(ctx, nil, "eth_sendBundle", args) +func (ec *Client) SendBundle(ctx context.Context, args types.SendBundleArgs) (common.Hash, error) { + var hash common.Hash + err := ec.c.CallContext(ctx, &hash, "eth_sendBundle", args) + if err != nil { + return common.Hash{}, err + } + return hash, nil +} + +// BundlePrice returns the price of a bundle +func (ec *Client) BundlePrice(ctx context.Context) *big.Int { + var price *big.Int + _ = ec.c.CallContext(ctx, &price, "eth_bundlePrice") + return price } // MevParams returns the static params of mev