question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[web3@1.0.0] Generated typings don't have BigNumber as a type

See original GitHub issue

With 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.0https://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 BigNumberhttps://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:open
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hickscorpcommented, Jun 12, 2019

@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.

0reactions
krzkaczorcommented, Jun 13, 2019

@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:

typechain --target=./typechain-generator.ts --outDir app/contracts './node_modules/neufund-contracts/build/contracts/*.json'
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found