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

Fetch dynamic batches data from bg app API endpoint #54

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Pabl0cks
Copy link
Member

@Pabl0cks Pabl0cks commented Nov 5, 2024

Fetching data dynamically from the new bg app API endpoint for Batches, using the same env var that we're already using on other parts of the website.

Did some formatting and calculations that maybe should be moved elsewhere, wasn't sure about it.

Closes #47

Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
buidlguidl-landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 29, 2024 11:23pm

@Pabl0cks
Copy link
Member Author

Not very happy with the hardcoded opensea links for the batches. Some alternatives:

  • Do some hacky calculations hoping that the url will be autonumeric "-1","-2","-3" after batch 9, for every batch that is closed but is not the last closed batch (ongoing batch). Don't love it.
  • Delete the opensea link, and maybe show the number of graduated builders, like we do in bg app.
  • Set the opensea link in the bg app, and add it to the endpoint

What do you think @carletex @phipsae ?

@carletex
Copy link
Contributor

Great stuff @Pabl0cks !

Haven't got into detail yet... but some thoughts on the opensea thing.

So I think the cleanest way to go would be:

  1. Remove the hardcoded stuff here for now (we don't show opensea)... so we can merge this PR.
  2. On BG v3.5 we set the NFT contract address
  • It could be manual or automatic (e.g. whenever we update/set the Batch contract address, we fetch the NFT address from the backend)
  1. We return it from the API
  2. We update it here.

Open tho! What do you all think?

@Pabl0cks
Copy link
Member Author

Thanks for the feedback @carletex !! ♥

I was inclined to do option 1, to merge without opensea link, but talking with @phipsae he told me I could get the nft contract from the batch contract (which we have in the /batches endpoint).

I just pushed this logic in 7409c2d but we think is not a good idea to have such implementation, and that logic in the bg3.5 app, I'm happy to revert.

I found that current ongoing batch is throwing opensea 404 error when I access to the link, I could control that in some way if we are up for this solution 🙏

@Pabl0cks
Copy link
Member Author

I found that current ongoing batch is throwing opensea 404 error when I access to the link, I could control that in some way if we are up for this solution 🙏

Phillip also suggested to add graduates data to the table, added here a125705, and found out it was a good checker to show or not show opensea graduation NFT link

@carletex
Copy link
Contributor

carletex commented Nov 28, 2024

I was inclined to do option 1, to merge without opensea link, but talking with @phipsae he told me I could get the nft contract from the batch contract (which we have in the /batches endpoint).
I just pushed this logic in 7409c2d but we think is not a good idea to have such implementation, and that logic in the bg3.5 app, I'm happy to revert.

Sorry, I didn't explain myself correctly. It wasn't "option 1", it was "step 1". I think the source of truth should live on 3.5 (step 2 + step 3), not here. We don't want to have this data/logic spread out over repos.

Suggested step 1, so we could merge this PR until v3.5 logic is ready. But other option is just to wait.

I found that current ongoing batch is throwing opensea 404 error when I access to the link, I could control that in some way if we are up for this solution 🙏

I guess this is happening because not NFT have been minted yet. One easy fix is not showing the opensea link on the current/active batch.

@phipsae
Copy link

phipsae commented Nov 29, 2024

I'm not sure if I understand correctly.
Should we add the NFT contract address to the batch data point in the database (BG 3.5)?

@carletex
Copy link
Contributor

Should we add the NFT contract address to the batch data point in the database (BG 3.5)?

yes.

I think the source of truth should live on 3.5 (step 2 + step 3)

It could be manual or automatic (e.g. whenever we update/set the Batch contract address, we fetch the NFT address from the backend)

To expand a bit:

Manual

  1. We just add a new field (Batch NFT contract) on the form
  2. save it to database
  3. return data in API endpoint

Automatic

  1. Form is the same
  2. Backend detect that we are adding a Batch contract address
  3. Backend fetches the NFT contract address (reading Batch contract)
  4. save it to database
  5. return data in API endpoint

LEt me know if you have any questions!

@Pabl0cks
Copy link
Member Author

Not sure if it will be valuable, but here is the logic I was using @phipsae : 7409c2d

Will revert the changes here, so we can merge without opensea link, and add it when it's ready in the endpoint in a different PR 🙏

@Pabl0cks
Copy link
Member Author

Reverted nft contract fetch logic and deleted opensea column, will add it again when we have it in bg3.5 API endpoint🙏

@phipsae
Copy link

phipsae commented Nov 29, 2024

Here’s the corresponding PR to implement it.

scaffold-eth/buidlguidl-v3#119

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.

Fetch batch data from bg app API when it is available
3 participants