Document how to import types like BigNumber
See original GitHub issueImporting base types like Contract
or Wallet
is trivial:
import { Contract, Wallet } from "ethers";
const myContract: Contract = ...
But I had to dig up the source code to figure out how to import BigNumber
:
import { utils } from "ethers";
const myBigNumber: utils.BigNumber = ...
It’d be nice to have this explained in the docs.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:13 (3 by maintainers)
Top Results From Across the Web
bignumber.js API
Returns a new independent BigNumber constructor with configuration as described by object (see config ), or with the default configuration if object is...
Read more >BigNumber - ethers
A BigNumber is an object which safely allows mathematical operations on numbers of any magnitude. Most operations which need to return a value...
Read more >@ethersproject/bignumber - npm
Start using @ethersproject/bignumber in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >Bignumber.js - JavaScripting
The library is the single JavaScript file bignumber.js or ES module ... As with JavaScript's Number type, there are toExponential , toFixed and...
Read more >BigNumbers - Math.js
Most functions can determine the type of output from the type of input: a number as input will return a number as output,...
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
I’ve been mulling back-and-forth how to add this to the new docs, especially since many things are available from their sub-modules too.
I’ll work on this on the next docs pass.
The package README.md files include this info, which in v6 will be linked to and will include a large import page that indicates where each class, function and interface comes from.