Skip to content

Commit

Permalink
Add send raw transaction request
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolev-igor committed Sep 17, 2024
1 parent 9261c38 commit 9b4ae32
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,14 @@ func (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) er
return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data))
}

// SendRawTransaction injects a raw transaction into the pending pool for execution.
//
// If the transaction was a contract creation use the TransactionReceipt method to get the
// contract address after the transaction has been mined.
func (ec *Client) SendRawTransaction(ctx context.Context, rawTx string) error {
return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", rawTx)
}

func toBlockNumArg(number *big.Int) string {
if number == nil {
return "latest"
Expand Down

0 comments on commit 9b4ae32

Please sign in to comment.