Separate Transaction and TransactionConfig in typings #2479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently Transaction has all field optional what is incorrect. This causes senseless checks when using transaction:
I think the Transaction and TransactionConfig should be different types, as it has been done before: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/web3/eth/index.d.ts (See Transaction and Tx) I change names though and corrected types a bit. This also should fix #2474
I also updated RLPEncodedTransaction type with respect to https://web3js.readthedocs.io/en/1.0/web3-eth-personal.html#signtransaction but I'm not 100% sure about this. @nivida could you take a closer look please?
Type of change
Checklist:
npm run test
in the root folder with success and extended the tests if necessary.npm run build
in the root folder and tested it in the browser and with node.npm run dtslint
in the root folder and tested that all my types are correct