Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ethclient of bundle #23

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading