Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ethereum address importing #4

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mrosnerr
Copy link

@mrosnerr mrosnerr commented Jan 29, 2025

Summary

This is intended as a fix for Error importing Ethereum address

My assumption is that this line is the root cause of the error seen in the UI: Error initiating ethereum: (intermediate value).toBigInt is not a function

API Changes

  • This Library is getting a minor version bump to v1.3.0
  • With the latest token list, a token's logoURI can now be null so this type was updated which may impact the consuming application.
  • The latest token list naturally has more tokens and the current architecture of checking each one does mean this takes a little more time to run (15 to 20 seconds from a quick test).

Details

The changes encapsulated here are broken down by commit:

  1. bb42bec - Made this package locally runnable via updating yarn to a stable release and simplifying the running of typescript files by moving to tsx. Also updated most packages to their most updated versions.
  2. 2b4f6d5 - Integrated the dependency updates and added in a custom provider to facilitate a clean integration between the two core ethereum dependancies.
  3. f6a6947 - I noticed a bug while working on this where there was an assumption that all token balances where defined with 18 decimal places. This commit corrects decimal place handling for ERC-20 tokens.
  4. e5439b3 - This seemed like a good opportunity to update the list of tokens 🤷‍♂️.
  5. fd84018 - Fixed some issues I ran into attempting to run yarn run build
  6. 30b2b23 - Minor version bump from v1.2.0 to v1.3.0
  7. e2428c2 - Added more explicit handling for chains outside of mainnet
  8. 630aaa9 - Updated the package type to commonjs

Sample run output

Address: 0x51d71410381D2467fd7Ab26eB95fC7dD519B06aa

export LM_ETHERSCAN_API_KEY="************************" 
export LM_ETHEREUM_WALLET_ADDRESS="0x51d71410381D2467fd7Ab26eB95fC7dD519B06aa"
./bin/get-balances.ts

ETH: 0.253573677057353335
USDC: 7393.031132
USDT: 37201.32449

src/client.ts Show resolved Hide resolved
@mrosnerr mrosnerr requested a review from jpjpjp February 5, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants