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

refactor: migrate getFloorPrice to Alchemy v3 #468

Merged
merged 8 commits into from
Nov 22, 2023

Conversation

shahin-hq
Copy link
Contributor

@shahin-hq shahin-hq commented Nov 17, 2023

Summary

Depends on #467
Closes: https://app.clickup.com/t/86dqjv3hw

Checklist

  • I checked my UI changes against the design and there are no notable differences
  • I checked my UI changes for any responsiveness issues
  • I checked my (code) changes for obvious issues, debug statements and commented code
  • I opened a corresponding card on Clickup for any remaining TODOs in my code
  • I added a short description on how to test this PR (if necessary)
  • I added a storybook entry for the component that was added (if necessary)
  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@ItsANameToo ItsANameToo added this to the TBD milestone Nov 17, 2023
// }
// }
/** @var array<string, mixed> | null $priceInfo */
$priceInfo = collect($data)->first(function ($k, $v) {
return ! Arr::has($k, 'error');
return Arr::get($k, 'error', 1) === null;
Copy link
Contributor Author

@shahin-hq shahin-hq Nov 17, 2023

Choose a reason for hiding this comment

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

Find the first entry with error===null, if the error key is not there 1 === null will ensure that it won't be returned:

https://docs.alchemy.com/reference/nft-api-v2-vs-v3-endpoint-differences#getfloorprice

{
    "openSea": {
        "floorPrice": 0.02,
        "priceCurrency": "ETH",
        "collectionUrl": "https://opensea.io/collection/link3",
        "retrievedAt": "2023-04-04T18:10:59.263Z",
        "error": null
    },
    "looksRare": {
        "floorPrice": 12.5,
        "priceCurrency": "ETH",
        "collectionUrl": "https://looksrare.org/collections/0x8cc6517e45db7a0803fef220d9b577326a12033f",
        "retrievedAt": "2023-04-04T18:10:59.316Z",
        "error": null
    }
}

@crnkovic crnkovic self-assigned this Nov 21, 2023
Base automatically changed from refactor/migrate-v3-getSpamContracts to develop November 22, 2023 08:47
@goga-m goga-m self-requested a review November 22, 2023 08:51
@goga-m goga-m merged commit 802dd46 into develop Nov 22, 2023
12 checks passed
@goga-m goga-m deleted the refactor/migrate-v3-getFloorPrice branch November 22, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants