proxy/eth_sendRawTransaction - 发送裸交易
使用proxy模块的eth_sendRawTransaction方法发送裸交易。
API调用
GET|POST /api
查询|表单参数:
- module:proxy
- action:eth_sendRawTransaction
- hex:要发送的裸交易
- apikey:etherscan API密钥
注意,由于HTTP GET方法对长度有限制,当交易很长时,应当使用POST方法发送。
API返回结果
返回结果为一个JSON对象,主要字段如下:
- jsonrpc:RPC版本号,2.0
- id:RPC请求编号
- result:调用结果
- error:错误信息
示例代码
以curl为例的调用代码如下,也可以点击这里查看浏览器中的运行结果:
~$ curl https://api.etherscan.io/api?module=proxy&action=eth_sendRawTransaction&hex=0xf904808000831cfde080&apikey=YourApiKeyToken
返回结果如下:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "rlp: value size exceeds available input length"
}
}