Improvement: Optimize and Unify Ethereum Dependencies (Remove Web3.js)

Open
#59 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #95 by @Rav1Chauhan — closed without merging

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Read Transaction.js, WalletContext.jsx, TransactionReview.jsx, and package.json to trace where djed-sdk uses web3.js and where viem is already used. Check whether djed-sdk supports a provider-agnostic mode, then assess the scope of replacing its used functions with viem. Done means the SDK uses viem consistently and web3 is removed from package.json; the payload names no tests to run.

Written by the indexing model from the issue text.

Description

[y] I have checked for duplicate issues

Description
The SDK currently bundles two large Ethereum libraries: web3.js (legacy v1.x) and viem (modern, lightweight).

  • Transaction.js relies on djed-sdk which uses web3.js.
  • WalletContext.jsx and TransactionReview.jsx use viem.

Problem
This significantly bloats the final bundle size (~300KB+ unnecessary weight) and confuses developers about which library to use for new features.

Proposed Solution
Refactor the SDK to use viem exclusively if possible.

  • Check if djed-sdk has a provider-agnostic mode or if we can instantiate the Djed contracts using viem instead of web3.js.
  • If djed-sdk strictly requires web3.js, wrap it or investigate migrating the few utilized djed-sdk functions to direct contract calls using viem.
  • Remove web3 from package.json dependencies.

Benefits

  • Massive reduction in bundle size (crucial for a widget SDK).
  • Consistent API across the codebase.
  • Better performance (viem is significantly faster than web3.js).

[y] I want to work on this issue

Dominant language
JavaScript
Stars
16
Forks
29
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from StabilityNexus/StablePay

All issues in StabilityNexus/StablePay

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.