internal/ethapi, internal/web3ext: adds raw tx retrieval methods

This commit is contained in:
Kobi Gurkan
2016-10-07 01:38:00 +03:00
parent c88e435724
commit 1a6682c21d
2 changed files with 55 additions and 1 deletions

View File

@ -468,6 +468,19 @@ web3._extend({
call: 'eth_submitTransaction',
params: 1,
inputFormatter: [web3._extend.formatters.inputTransactionFormatter]
}),
new web3._extend.Method({
name: 'getRawTransaction',
call: 'eth_getRawTransactionByHash',
params: 1
}),
new web3._extend.Method({
name: 'getRawTransactionFromBlock',
call: function(args) {
return (web3._extend.utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getRawTransactionByBlockHashAndIndex' : 'eth_getRawTransactionByBlockNumberAndIndex';
},
params: 2,
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, web3._extend.utils.toHex]
})
],
properties: