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

exclude fields from token list fetch #4235

Merged
merged 7 commits into from
May 31, 2024
Merged

Conversation

bergeron
Copy link
Contributor

@bergeron bergeron commented Apr 30, 2024

Explanation

Adds 2 query parameters when fetching token lists:

  • includeERC20Permit=false
  • includeStorage=false

The best I can tell, neither field is used by extension or mobile. So we'll instead take the reduction in network usage (~5KB on mainnet) and controller state.

References

https://consensyssoftware.atlassian.net/browse/API-1186

Changelog

@metamask/assets-controllers

  • BREAKING: TokenListController no longer includes the fields storage and erc20Permit in its state.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@bergeron bergeron requested a review from a team as a code owner April 30, 2024 19:49
hurricanenara
hurricanenara previously approved these changes Apr 30, 2024
hurricanenara
hurricanenara previously approved these changes Apr 30, 2024
sahar-fehri
sahar-fehri previously approved these changes May 1, 2024
@bergeron bergeron dismissed stale reviews from sahar-fehri and hurricanenara via 3da4577 May 31, 2024 01:54
@bergeron bergeron merged commit 26d4fe4 into main May 31, 2024
147 checks passed
@bergeron bergeron deleted the brian/token-list-response-size branch May 31, 2024 14:28
mcmire pushed a commit that referenced this pull request May 31, 2024
## Explanation

Adds 2 query parameters when fetching token lists:
- `includeERC20Permit=false`
- `includeStorage=false`

The best I can tell, neither field is used by extension or mobile. So
we'll instead take the reduction in network usage (~5KB on mainnet) and
controller state.

## References

https://consensyssoftware.atlassian.net/browse/API-1186

## Changelog

### `@metamask/assets-controllers`

- **BREAKING**: `TokenListController` no longer includes the fields
`storage` and `erc20Permit` in its state.

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
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.

3 participants