parity_postTransaction - 发送交易
parity_postTransaction
调用将交易发送给签名器,不等待响应结果。
调用参数
- 交易对象,结构如下:
- from:交易发起地址
- to:交易接收地址
- gas:交易的gas用量上限,可选
- gasPrice:gas价格,可选
- value:交易转账金额,可选
- data:附加数据,可选
- nonce:发起账户之前的交易数量
- condition:交易提交条件对象,可以是区块号
{ block: 1 }
或者UTC时间戳{ time: 1491290692 }
或null。
返回结果
parity_postTransaction
调用返回发送给签名器的请求ID。如果账号已经解锁,那么返回交易哈希。
示例代码
请求:
~$ curl --data '{"method":"parity_postTransaction","params":[{"from":"0xb60e8dd61c5d32be8058bb8eb970870f07233155","to":"0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas":"0x76c0","gasPrice":"0x9184e72a000","value":"0x9184e72a","data":"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675","condition":{"block":354221,"time":"2018-11-16T15:59:08.596Z"}}],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
响应:
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x1"
}