MetaMask / MetaMask/metamask-extension

[Typescript Conversion: Level 18]: Convert shared/modules/swaps.utils.js to typescript

Open
#31,800 0 comments 0 reactions 0 assignees View on GitHub
INVALID-ISSUE-TEMPLATE team-extension-platform
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

## **Description**

Convert `shared/modules/swaps.utils.js` from JavaScript to TypeScript as part of the TS migration initiative.

## **Scenario (for user stories only)**

_(Not applicable)_

## **Design (for user stories only)**

_(Not applicable)_

## **Technical Details (for technical tasks only)**

- Convert this file to TypeScript.
- Migration Level: **18**
- Dependencies:
- shared/constants/swaps.ts
- Dependents:
- ui/hooks/useSwappedTokenValue.js
- ui/pages/swaps/awaiting-swap/awaiting-swap.js
- ui/pages/swaps/swaps.util.ts

## **[Threat Modeling Framework](https://github.com/adamshostack/4QuestionFrame) (for technical tasks only)**

- What are we working on? Convert file to TypeScript.
- What can go wrong? Type errors, integration mismatches, missing types.
- What are we going to do about it? Write types carefully and test thoroughly.
- Did we do a good job? _(To be evaluated)_

## **Acceptance Criteria**

- File is fully converted to TypeScript.
- Tests pass.
- File adheres to linting rules.
- Functionality remains unchanged.

## **Stakeholder Review (for MetaMask employees only)**

- [X] Engineering
- [ ] Design
- [ ] Product
- [ ] QA
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management
- [ ] Other

## **References**

- Parent issue: #31460

Contributor guide

Open the contributing guide

Research direction

Start with shared/modules/swaps.utils.js and its dependency shared/constants/swaps.ts, then inspect the listed UI dependents for compatibility expectations. Run the relevant swaps tests and lint checks. Done means the utility is fully TypeScript, functionality is unchanged, and all tests and linting pass.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.