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.

Document how to import types like BigNumber

See original GitHub issue

Importing 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:open
  • Created 3 years ago
  • Reactions:5
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
ricmoocommented, Jun 3, 2020

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.

1reaction
ricmoocommented, Feb 3, 2022

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.

Read more comments on GitHub >

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

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