Skip to content

Commit 9b4ae32

Browse files
committed
Add send raw transaction request
1 parent 9261c38 commit 9b4ae32

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ethclient/ethclient.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,14 @@ func (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) er
588588
return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data))
589589
}
590590

591+
// SendRawTransaction injects a raw transaction into the pending pool for execution.
592+
//
593+
// If the transaction was a contract creation use the TransactionReceipt method to get the
594+
// contract address after the transaction has been mined.
595+
func (ec *Client) SendRawTransaction(ctx context.Context, rawTx string) error {
596+
return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", rawTx)
597+
}
598+
591599
func toBlockNumArg(number *big.Int) string {
592600
if number == nil {
593601
return "latest"

0 commit comments

Comments
 (0)