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: Rentals NFT Component #152

Merged
merged 41 commits into from
Nov 14, 2022
Merged

feat: Rentals NFT Component #152

merged 41 commits into from
Nov 14, 2022

Conversation

fzavalia
Copy link
Contributor

@fzavalia fzavalia commented Nov 4, 2022

Closes #150

Added rentalsNFTComponent in charge of looking for assets that belonged to a certain user that are currently locked in the rentals contract.

With this component, any nft search with owner and isLand query params will also return the lands in the rentals contract that have lessor as the provided owner.

@fzavalia fzavalia marked this pull request as ready for review November 9, 2022 17:01
src/index.ts Outdated Show resolved Hide resolved
src/ports/items/utils.ts Outdated Show resolved Hide resolved
src/ports/nfts/rentalsNFTComponent.ts Outdated Show resolved Hide resolved
lessors: [options.owner!],
contractAddresses: [contractAddresses.land, contractAddresses.estate],
isClaimed: false,
// In order to avoid pagination issues, we need to fetch all the assets for this owner in the rentals subgraph.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind creating a ticket to fix this eventually? We might forget about it and it could come in handy to have it recorded somewhere.

}

// This function is currently not needed for the current use cases of this component so it will always return an empty array.
async function fetchByTokenIds(_tokenIds: string[]): Promise<NFTResult[]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if you make fetchByTokenIds optional in the INFTsComponent type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it really necessary?

src/ports/nfts/rentalsNFTComponent.ts Outdated Show resolved Hide resolved
src/tests/ports/nfts-rentalsNFTComponent.spec.ts Outdated Show resolved Hide resolved
src/tests/ports/nfts-rentalsNFTComponent.spec.ts Outdated Show resolved Hide resolved
src/tests/ports/nfts-rentalsNFTComponent.spec.ts Outdated Show resolved Hide resolved
src/tests/ports/nfts-rentalsNFTComponent.spec.ts Outdated Show resolved Hide resolved
src/tests/ports/nfts-rentalsNFTComponent.spec.ts Outdated Show resolved Hide resolved
fzavalia and others added 8 commits November 14, 2022 09:23
Co-authored-by: Lautaro Petaccio <1120791+LautaroPetaccio@users.noreply.github.com>
Co-authored-by: Lautaro Petaccio <1120791+LautaroPetaccio@users.noreply.github.com>
Co-authored-by: Lautaro Petaccio <1120791+LautaroPetaccio@users.noreply.github.com>
Co-authored-by: Lautaro Petaccio <1120791+LautaroPetaccio@users.noreply.github.com>
* feat: Rental status option

* feat: Remove rental status from source instantiation

* feat: Get rental status to enhance nfts from query params

* chore: Fix test

* chore: Refactor logic for status
@fzavalia fzavalia merged commit 0bef26b into master Nov 14, 2022
@fzavalia fzavalia deleted the feat/rentals-nft-component branch November 14, 2022 18:54
Sign up for free to 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.

Support some way of bringing assets locked in Rentals contract as if they were still yours
3 participants