// sendRawTransaction makes an RPC call to send a signed tx to the blockchain and returns the transaction hash.
// "0x"+raw has to be inserted in a curl command to send the transaction via Infura.io eth_sendRawTransaction RPC
//  curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xf86b0285012a05f20082ffff941cd434711fbae1f2d9c70001409fd82d71fdccaa87b1a2bc2ec50000802aa0727841e5f55e5a8315a83ee1341405f05ba68ca8667db13fa694b5e680f41e31a07e291bc489aefb24ee2217900cddbd533966cc456799032fea6632896f100b64"],"id":4}' http://localhost:8545
// Example response from Infura:
//  {"jsonrpc":"2.0","id":4,"result":"0xfdd2beb06580944421f4e0ea8e408d9cb51dace689d5835288bf934500931e5d"}
sendRawTransaction makes an RPC call to send a signed tx to the blockchain and returns the transaction hash.
// sendRawTransaction makes an RPC call to send a signed tx to the blockchain and returns the transaction hash . // " 0x " + raw has to be inserted in a curl command to send the transaction via Infura . io eth_sendRawTransaction RPC // curl - X POST -- data ' { " jsonrpc " : " 2 . 0 " " method " : " eth_sendRawTransaction " " params " : [ " 0xf86b0285012a05f20082ffff941cd434711fbae1f2d9c70001409fd82d71fdccaa87b1a2bc2ec50000802aa0727841e5f55e5a8315a83ee1341405f05ba68ca8667db13fa694b5e680f41e31a07e291bc489aefb24ee2217900cddbd533966cc456799032fea6632896f100b64 " ] " id " : 4 } ' http : // localhost : 8545 // Example response from Infura : // { " jsonrpc " : " 2 . 0 " " id " : 4 " result " : " 0xfdd2beb06580944421f4e0ea8e408d9cb51dace689d5835288bf934500931e5d " }
func (c *EthCli) sendRawTransaction(raw []byte) (hash string, err error) {
	var response interface{}
	if err = c.Call("eth_sendRawTransaction", []interface{}{"0x" + hex.EncodeToString(raw)}, &response); err != nil {
		return hash, err
	}
	return response.(string), nil
}
func ( c * EthCli ) sendRawTransaction ( raw [ ] byte ) ( hash string , err error ) { var response interface { } if err = c . Call ( " " , [ ] interface { } { " " + hex . EncodeToString ( raw ) } , & response ) ; err != nil { return hash , err } return response . ( string ) , nil }
sendRawTransaction makes an RPC call to send a signed tx to the blockchain and returns the transaction hash.
sendRawTransaction makes an RPC call to send a signed tx to the blockchain and returns the transaction hash .