parity_allTransactions - 获取交易池交易
使用parity_allTransactions
调用返回交易队列中的所有交易。
调用参数
无
返回值
parity_allTransactions
调用返回一个数组,每个成员表示一个交易,结构如下:
- hash:交易哈希,32字节长
- nonce:发送账户之前的交易总数
- blockHash:交易所在区块的哈希,当交易待定时值为null
- blockNumber:交易所在区块的编号,当交易待定时值为null
- transactionIndex:交易在区块中的索引位置,当交易待定时值为null
- from:发送账户地址
- to:接收账户地址,当交易为合约创建交易时为null
- value:交易金额,单位:wei
- gasPrice:发送方提供的gas价格,单位:wei
- gas:发送方提供的gas用量
- input:交易附加数据
- creates:被创建合约的地址或null,可选
- raw:裸交易数据
- publicKey:签名账号的公钥
- chainId:交易的链ID
- standardV:签名的标准化V字段,0或1
- v:签名的V字段
- r:签名的R字段
- s:签名的S字段
- condition:交易提交条件,区块号或时间戳或null,可选
示例代码
请求:
~$ curl --data '{
"method":"parity_allTransactions",
"params":[],
"id":1,
"jsonrpc":"2.0"
}' -H "Content-Type: application/json" -X POST localhost:8545
响应:
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"blockHash": null,
"blockNumber": null,
"chainId": null,
"condition": null,
"creates": null,
"from": "0x5f3dffcf347944d3739b0805c934d86c8621997f",
"gas": "0x493e0",
"gasPrice": "0x12a05f200",
"hash": "0x045301a128ffcb4662dd199d1176bdf4cc9f0628e10d6bf120edfb52e3e39a78",
"input": "0x13f56f730...f3b4dc000",
"nonce": "0x577",
"publicKey": "0x3bb...9ce1b1",
"r": "0x6fd2c7a5dbb8795038ca258196083b3eabe15a20e3020c3f45e88f2e447be410",
"raw": "0xf88b8247d202...83eef3f8916bb818ce7",
"s": "0x5993992c547d20234aabfc8c32a58d25784255fef500383eef3f8916bb818ce7",
"standardV": "0x0",
"to": "0xe8b2d01ffa0a15736b2370b6e5064f9702c891b6",
"transactionIndex": null,
"v": "0x1b",
"value": "0x0"
},
{ ... }, { ... }, ...
]
}