All issues which aren't created with this template will get immediately closed.
Hello,
I'm not sure the typing Account.signTransaction interface is correct here, should be that isn't it?
signTransaction(tx: Transaction, privateKey: string, callback?: () => void): Promise<SignedTransaction>;
or similar
signTransaction?: (tx: Transaction) => {};
>1.0.0-beta.36Account typing definitionExpected 1 arguments, but got 2.ts(2554)
Typescript latest
npm latest
Hey @oktapodia Thanks for raising this looking at it you are correct. In actual fact the documents are incorrect as well https://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#signtransaction
I think it needs to be
signTransaction(tx: Transaction, callback?: (signTransaction: SignedTransaction) => void): Promise<SignedTransaction>;
as it gets your private key from your account so the typing's should be above.
I will do a PR later on and update the docs to be inline with the code. good spot!
Awesome! Let me know if you need any help on that
Hey sorry about the delay i have been away from my computer.
https://github.com/ethereum/web3.js/pull/2417
It is fixed in this PR and will be released within the next release - thanks again for the issue raised.
Most helpful comment
Hey @oktapodia Thanks for raising this looking at it you are correct. In actual fact the documents are incorrect as well https://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#signtransaction
I think it needs to be
signTransaction(tx: Transaction, callback?: (signTransaction: SignedTransaction) => void): Promise<SignedTransaction>;as it gets your private key from your account so the typing's should be above.
https://github.com/ethereum/web3.js/blob/v1.0.0-beta.46/packages/web3-eth-accounts/src/Accounts.js#L92
I will do a PR later on and update the docs to be inline with the code. good spot!