Skip to content

Assets controller - #18

Merged
estebanmino merged 16 commits into
masterfrom
assets-controller
Sep 18, 2018
Merged

Assets controller#18
estebanmino merged 16 commits into
masterfrom
assets-controller

Conversation

@estebanmino

@estebanminoestebanmino commented Sep 12, 2018

Copy link
Copy Markdown
Contributor

This PR adds AssetsController in order to support assets on it. First two assets supported are tokens (ERC20) and collectibles (ERC721).

  • Add collectible/token
  • Remove collectible/token
  • Assets per account and network basis
  • Tests

Related #17

BLOCKER: eth-contract-metadata is not the official, we should decide what to do with collectibles metadata before merge.

@estebanminoestebanmino changed the title Assets controller[WIP] Assets controllerSep 12, 2018
@codecov-io

codecov-io commented Sep 13, 2018

Copy link
Copy Markdown

Codecov Report

Merging #18 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@## master #18 +/- ##
======================================
Coverage 100% 100% ======================================
Files 14 15 +1 Lines 626 770 +144 Branches 73 99 +26 ======================================
+ Hits 626 770 +144
Impacted FilesCoverage Δ
src/PreferencesController.ts100% <ø> (ø)⬆️
src/AssetsController.ts100% <100%> (ø)
src/TokenRatesController.ts100% <100%> (ø)⬆️
src/TransactionController.ts100% <0%> (ø)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90648e8...56e346a. Read the comment docs.

@estebanminoestebanmino changed the title [WIP] Assets controllerAssets controllerSep 13, 2018

@bitpshrbitpshr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very strong pull request, I have very little feedback. Really well done. I created MetaMask/website#134 to track stuff around eth-contract-metadata. Feel free to land this whenever you want and I can cut a new release (or show you how to do that as well.)

Comment threadsrc/AssetsController.ts Outdated
*
* @param address - Hex address of the collectible contract
* @param tokenId - The NFT identifier
* @returns - Current collectible list

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This may be more accurate if it says "Promise resolving to the current collectible list".

Comment threadsrc/AssetsController.ts Outdated
* @param tokenId - The NFT identifier
* @returns - Current collectible name and image
*/
async requestNFTCustomInformation(address: string, tokenId: number): Promise<CollectibleCustomInformation> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this method should be public? Will it ever be called externally? Same question for fetchCollectibleBasicInformation. If these methods will only ever be used internally to this controller, I say we make them private to keep the external API as small as possible.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally agree, I'll move it

@estebanmino

Copy link
Copy Markdown
ContributorAuthor

Thanks @bitpshr. I'll wait for you in order to coordinate the integration to the app as well.

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #18 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@## master #18 +/- ##
======================================
Coverage 100% 100% ======================================
Files 14 15 +1 Lines 626 760 +134 Branches 73 99 +26 ======================================
+ Hits 626 760 +134
Impacted FilesCoverage Δ
src/PreferencesController.ts100% <ø> (ø)⬆️
src/AssetsController.ts100% <100%> (ø)
src/TokenRatesController.ts100% <100%> (ø)⬆️
src/TransactionController.ts100% <0%> (ø)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90648e8...c4fb377. Read the comment docs.

@estebanmino
estebanmino merged commit 82c29fa into masterSep 18, 2018
@estebanmino
estebanmino deleted the assets-controller branch September 18, 2018 22:40
MajorLift pushed a commit that referenced this pull request Sep 22, 2023
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: legobt <6wbvkn0j@anonaddy.me>
MajorLift pushed a commit that referenced this pull request Sep 22, 2023
v1.0.1 contains two changes that should have been considered
semver-major:
- Type-interface incompatability with previous version (MetaMask/json-rpc-engine#139)
- Introduced dependency `@metamask/json-rpc-engine` indicates a minimum
supported Node.js version of 16. This prevents the module from
installing on some package manager configurations, like default
yarn classic.
This will be re-released as v2.0.0.
kanthesha pushed a commit that referenced this pull request Oct 11, 2023
Escalate errors on RPC responses
Mrtenz pushed a commit to Mrtenz/core that referenced this pull request Jun 17, 2026
…sk#18)
Bumps [@metamask/controllers](https://github.com/MetaMask/controllers) from 16.0.0 to 19.0.0.
- [Release notes](https://github.com/MetaMask/controllers/releases)
- [Changelog](https://github.com/MetaMask/controllers/blob/main/CHANGELOG.md)
- [Commits](MetaMask/core@v16.0.0...v19.0.0)
---
updated-dependencies:
- dependency-name: "@metamask/controllers"
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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

@estebanmino@codecov-io@bitpshr