lambdaclass / lambdaclass/eth-agent

Duplicate gas params object construction in wallet.ts

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code-quality low-priority
Dominant language
TypeScript
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Problem

Same gas params object is constructed multiple times in different methods.

Locations

  • src/agent/wallet.ts:287-294 (send)
  • src/agent/wallet.ts:309-316 (send simulation)
  • src/agent/wallet.ts:840-848 (preview)

Recommendation

Extract to helper function:

private buildGasParams(to: Address, value: bigint, data?: Hex) {
  // ...
}

Priority

Low - Code quality/DRY

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start in src/agent/wallet.ts at lines 287-294, 309-316, and 840-848, comparing how the gas params object is constructed in send, send simulation, and preview. Extract the shared construction into the proposed buildGasParams helper and verify all three methods use it without changing their behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.