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

feat: added DeFiPositionsController #5400

Open
wants to merge 53 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8bcfe5f
controller initial version
bergarces Feb 26, 2025
d920a3e
progress
bergarces Feb 27, 2025
45274d5
tests
bergarces Feb 27, 2025
0fbf229
tests
bergarces Feb 28, 2025
4e9054d
linting
bergarces Feb 28, 2025
0a306af
fix linting
bergarces Feb 28, 2025
1be9d57
fix type
bergarces Feb 28, 2025
2d0b62f
fix type
bergarces Feb 28, 2025
d67e81b
changes from comments
bergarces Feb 28, 2025
905532b
improvements
bergarces Mar 4, 2025
2ca190b
exports
bergarces Mar 5, 2025
9b03ade
use custom api url
bergarces Mar 7, 2025
d23da09
corrections
bergarces Mar 7, 2025
247eb17
jsdoc
bergarces Mar 7, 2025
d46d5fb
export messenger
bergarces Mar 11, 2025
51d13ac
clean actions
bergarces Mar 14, 2025
9b02be3
fix test
bergarces Mar 14, 2025
af4eff5
Merge branch 'main' into feat/MMASSETS-553-create-defi-controller
bergarces Apr 9, 2025
4512215
chore: remove console.logs
bergarces Apr 9, 2025
e640ad6
chore: remove todos
bergarces Apr 9, 2025
3ca2b5d
Merge branch 'main' into feat/MMASSETS-553-create-defi-controller
bergarces Apr 9, 2025
c6ff885
fix: fix test
bergarces Apr 9, 2025
4aaaa53
chore: Empty commit
bergarces Apr 9, 2025
9d7b1fa
fix: correct urls
bergarces Apr 9, 2025
fc4b415
Merge branch 'main' into feat/MMASSETS-553-create-defi-controller
jpsains Apr 9, 2025
fb2de0c
feat: use interval polling
bergarces Apr 9, 2025
be69b4f
fix: linting
bergarces Apr 9, 2025
2c92e57
fix: linting
bergarces Apr 9, 2025
a5f4872
fix: lint
bergarces Apr 9, 2025
4cfa1c5
fix: more linting
bergarces Apr 9, 2025
25d2050
remove mocks from build
bergarces Apr 10, 2025
75e7b42
lockfile
bergarces Apr 10, 2025
9620cde
linting
bergarces Apr 10, 2025
8509861
add eslint ignores
bergarces Apr 10, 2025
33e322c
Merge branch 'main' into feat/MMASSETS-553-create-defi-controller
bergarces Apr 10, 2025
ac3077a
isEnabled as function
bergarces Apr 10, 2025
ba3d909
changelog and readme
bergarces Apr 10, 2025
340df10
remove unneeded config
bergarces Apr 10, 2025
6c06b91
new account subscription
bergarces Apr 10, 2025
dc15ddd
jsdoc update
bergarces Apr 10, 2025
c15822b
better changelog
bergarces Apr 10, 2025
eb1c3e2
remove coverage from fixtures folder
bergarces Apr 10, 2025
9aaf2a6
Merge branch 'main' into feat/MMASSETS-553-create-defi-controller
bergarces Apr 10, 2025
40ff340
save isEnabled
bergarces Apr 10, 2025
be5c4f8
simplify more
bergarces Apr 10, 2025
98c4896
fix test
bergarces Apr 10, 2025
20c091f
add allowed events and actions to exports
bergarces Apr 10, 2025
e74bb78
changelog and rename
bergarces Apr 10, 2025
026f9ec
forced to add transaction-controller as devDependency
bergarces Apr 10, 2025
b3841f7
remove eslint-directive
bergarces Apr 10, 2025
43d0b3a
Merge branch 'main' into feat/MMASSETS-553-create-defi-controller
bergarces Apr 11, 2025
b1a54ec
better changelog
bergarces Apr 11, 2025
629a22a
lint
bergarces Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/assets-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add a new `DeFiPositionsController` that keeps an update list of DeFi positions for EVM accounts ([#5400](https://github.com/MetaMask/core/pull/5400))
- Export `DeFiPositionsController`
- Export the following types
- `DeFiPositionsControllerState`
- `DeFiPositionsControllerAllowedActions`
- `DeFiPositionsControllerAllowedEvents`
- `DeFiPositionsControllerActions`
- `DeFiPositionsControllerEvents`
- `DeFiPositionsControllerGetStateAction`
- `DeFiPositionsControllerStateChangeEvent`
- `DeFiPositionsControllerMessenger`
- `GroupedDeFiPositions`
- Add `@metamask/transaction-controller@^45.0.0` as a peer and dev dependency

## [56.0.0]

### Changed
Expand Down
1 change: 1 addition & 0 deletions packages/assets-controllers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This package features the following controllers:
- [**CollectibleDetectionController**](src/CollectibleDetectionController.ts) keeps a periodically updated list of ERC-721 tokens assigned to the currently selected address.
- [**CollectiblesController**](src/CollectiblesController.ts) tracks ERC-721 and ERC-1155 tokens assigned to the currently selected address, using OpenSea to retrieve token information.
- [**CurrencyRateController**](src/CurrencyRateController.ts) keeps a periodically updated value of the exchange rate from the currently selected "native" currency to another (handling testnet tokens specially).
- [**DeFiPositionsController**](src/DeFiPositionsController/DeFiPositionsController.ts.ts) keeps a periodically updated value of the DeFi positions for the owner EVM addresses.
- [**RatesController**](src/RatesController/RatesController.ts) keeps a periodically updated value for the exchange rates for different cryptocurrencies. The difference between the `RatesController` and `CurrencyRateController` is that the second one is coupled to the `NetworksController` and is EVM specific, whilst the first one can handle different blockchain currencies like BTC and SOL.
- [**TokenBalancesController**](src/TokenBalancesController.ts) keeps a periodically updated set of balances for the current set of ERC-20 tokens.
- [**TokenDetectionController**](src/TokenDetectionController.ts) keeps a periodically updated list of ERC-20 tokens assigned to the currently selected address.
Expand Down
6 changes: 6 additions & 0 deletions packages/assets-controllers/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: [
...baseConfig.coveragePathIgnorePatterns,
'/__fixtures__/',
],

// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
Expand Down
2 changes: 2 additions & 0 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"@metamask/providers": "^18.1.1",
"@metamask/snaps-controllers": "^9.19.0",
"@metamask/snaps-sdk": "^6.17.1",
"@metamask/transaction-controller": "^54.0.0",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.191",
"@types/node": "^16.18.54",
Expand All @@ -113,6 +114,7 @@
"@metamask/preferences-controller": "^17.0.0",
"@metamask/providers": "^18.1.0",
"@metamask/snaps-controllers": "^9.19.0",
"@metamask/transaction-controller": "^54.0.0",
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
},
"engines": {
Expand Down
Loading
Loading