-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return sender (and chainId) on 'eth_subscribe', ['newPendingTransactions', true]
#26030
Labels
Comments
Agreed, for consistency it would be nice to send the result of ethapi.newRPCTransaction(tx, ...). |
That's because web3.js is post-processing the result. If you getTransactionByHash via curl: ❯ curl -X POST -H "Content-Type: application/json" --data '{"method":"eth_getTransactionByHash","params":["0xfa1c1fe6823ceb6b0c8688e3f690025aaf7188c44fc1a334f47b71013caba2df":15295,"jsonrpc":"2.0"}' http://localhost:8545 | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3090 0 2946 100 144 208k 10424 --:--:-- --:--:-- --:--:-- 3017k
{
"jsonrpc": "2.0",
"id": 15295,
"result": {
"blockHash": "0x7744902ac62296047d47cd68fc89676de31053973bc2cff24d8ba70da0ea585a",
"blockNumber": "0x72b5d8",
"from": "0x7351dc227bacc5b33d1e14c778e46439852673b7",
"gas": "0x1c9c380",
"gasPrice": "0x95032efe",
"maxFeePerGas": "0x95032efe",
"maxPriorityFeePerGas": "0x9502f900",
"hash": "0xfa1c1fe6823ceb6b0c8688e3f690025aaf7188c44fc1a334f47b71013caba2df",
"input": "0x2e....",
"nonce": "0x5c",
"to": "0x9b0b70edaa3b6ae70389d8514ed65acd86386ef2",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x2",
"accessList": [],
"chainId": "0x5",
"v": "0x1",
"r": "0x5556afe935aae3e4f3275b04c8bf7405733cd0c6bdef6aae9dc5c3f8d96a2f9f",
"s": "0x1c5305e2d9e6068bfdb154b3139c07cd67a98d158c3f0e3e0e01840783df3eff"
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The new feature added on 5b1a04b returning the full transaction on
newPendingTransactions
subscription is really useful, but does not return the full information like subscribing for hashes and then usingeth_getTransaction
with it does.Please add
from
and possiblychainId
(to make it complete) on the full transaction object.Example of object returned with
'eth_subscribe', ['newPendingTransactions', true]
:Example of object returned with
'eth_subscribe', ['newPendingTransactions']
, and theneth_getTransaction
on the result:Note: web3.js (v1.8.0) does not support yet the
true
argument when subscribing'newPendingTransactions'
. I've opened an issue for it (web3/web3.js#5548).Workaround for now is to comment out line 70 in
\node_modules\web3-core-subscriptions\lib\subscription.js
Note 2: I just noticed that while one method returns hex values, the other returns numbers. I am not sure if that's due to web3.js lack of support but maybe worth taking a look as well.
The text was updated successfully, but these errors were encountered: