feat: allow to search for a seller account based on the auth token #295
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.
Description
coreSDK.getSellerByAddress()has been updated, so that if no seller account is found with any of the addresses (operator, admin, clerk and treasury), then it checks the LENS contract to retrive any tokenId, and if so, it tries to get the seller account using the auth tokencoreSDK.getSellerByAuthToken()a new service to directly retrieve a seller based on the auth tokencoreSDK.fetchUserAuthTokens()a new service to directly get all LENS tokenIds owned by a given addressNOTE: this won't work with ENS, as their contract is not supporting the ERC721Enumrable interface, as LENS does...
How to test
I've added just a few unit tests in this PR.
I've been able to make an e2e:test to check the service is working as expected. However I can't push it right now, because it requires a few update in the contracts repo (needs sync with the protocol team).
It will be done later, and I propose the PR to be merged without waiting for it, as it's fixing a blocking point