[web3@1.0.0] Generated typings don't have BigNumber as a type
See original GitHub issueWith web3@1.0.0
as target, generated types no longer support BigNumber
for the contracts. As an example, this is the typing generated with web3@0.26.0
– https://github.com/MARKETProtocol/types/blob/develop/types/MarketCollateralPool.ts#L178 and the below is generated using web3@1.0.0
target which has string
instead of BigNumber
– https://github.com/MARKETProtocol/types/blob/feature/upgrade-web3-1.0.0/types/MarketCollateralPool.d.ts#L44
BigNumber
might need some additional parsing while generating the types I guess. Would be really great if this can be supported soon. Thanks 😃
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
[web3@1.0.0] Generated typings don't have BigNumber as a ...
I think it raises a broader question: should TypeChain allow to customize targets. For example, one can always write own target and just...
Read more >TypeScript Type Definitions for BigNumber - node.js
The typings declare a variable and a namespace both named BigNumber : declare var BigNumber: BigNumber.BigNumberStatic; export as namespace ...
Read more >web3.utils — web3.js 1.0.0 documentation - Read the Docs
js library for calculating with big numbers in JavaScript. See the BN.js documentation for details. Note. For safe conversion of many types, incl...
Read more >invalid bignumber value ethers - You.com | The AI Search ...
this error type "Error: invalid BigNumber value(value=undefined)" indicates that you are passing "undefined", a wrong argument.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sebastianst Thanks a lot. This is pretty much the same as we came up with as well. I think the TypeChain should allow for “configurable”
BigNumber
library. It is such a great tool, I think it would benefit from some little flexibility.@hickscorp don’t worry about it, you did a fine job on
truffle-typings
repo 😉Some background on this feature. TypeChain under the hood uses https://github.com/krzkaczor/ts-generator which abstracts away some parts regarding type generation. What we could do is allow typechain users to provide custom “plugin” for ts-generator. All existing targets are just plugins for ts-generator.
CLI usage could look something like: