Skip to content

exclude fields from token list fetch - #4235

Merged
bergeron merged 7 commits into
mainfrom
brian/token-list-response-size
May 31, 2024
Merged

exclude fields from token list fetch#4235
bergeron merged 7 commits into
mainfrom
brian/token-list-response-size

Conversation

@bergeron

@bergeronbergeron commented Apr 30, 2024

Copy link
Copy Markdown
Contributor

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

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 3da4577May 31, 2024 01:54
@bergeron
bergeron merged commit 26d4fe4 into mainMay 31, 2024
@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 freeto 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

@bergeron@sahar-fehri@hurricanenara