Feature: Fetch metadata Browser-Harmony #8
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why is this change neccesary?
Because is neccesary retrieve the ERC721 contract metadata from the browser.
How does it address the issue?
I created an interface for contract manipulation at contacts/domain where I defined the
ERC721Contract
with the methodgetMetadata()
, in the future here will be defined all the methods that we will use, the idea is manipulate the contracts in an abstract way, so we can use the same procedures at front applying polimorfism.The implementation of the abstract contract is
ERC721HarmonyContract
located at contracts/infrastructure, here I put all the Harmony logic and contract wrappers. I created an instance of it as example at index.js. If we use polimorfism, we could instance anERC721EthereumContract
without change anything in the code, only the line where it is instanced.What side effects does this change have?
There are a lot of changes in dependencies that must be installed. I deleted the dist file generated by webpack build process because it changes frecuently and could create git conflicts. On the other hand, I added typescript, but my configuration allows Javascript, so the only side effect that could be appear is a conflict in build, and if you delete the dist file it won't appear.