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

Add listing query for collection #814

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

alchemistgo87
Copy link
Contributor

Addresses: #813

Copy link
Contributor

@kespinola kespinola left a comment

Choose a reason for hiding this comment

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

To reduce complexity we should hold off on this until moonrank collections are in place that way we don't need to do the switching between mcc and me collections.

crates/core/src/db/queries/metadatas.rs Outdated Show resolved Hide resolved
crates/graphql/src/schema/objects/nft.rs Outdated Show resolved Hide resolved
Expiry,
}

/// Input parameters for the [`collection_nfts`] query.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Input parameters for the [`collection_nfts`] query.
/// Input parameters for the `collection_nfts` query.

pub thirty_day_marketcap_change: i32,
}

impl<'a> TryFrom<models::CollectionTrend> for CollectionTrend {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
impl<'a> TryFrom<models::CollectionTrend> for CollectionTrend {
impl TryFrom<models::CollectionTrend> for CollectionTrend {

Comment on lines +975 to +1024
floor_price: floor_price.try_into().unwrap_or_default(),
nft_count: nft_count.try_into()?,
one_day_volume: one_day_volume.try_into().unwrap_or_default(),
seven_day_volume: seven_day_volume.try_into().unwrap_or_default(),
thirty_day_volume: thirty_day_volume.try_into().unwrap_or_default(),
one_day_sales_count: one_day_sales_count.try_into().unwrap_or_default(),
seven_day_sales_count: seven_day_sales_count.try_into().unwrap_or_default(),
thirty_day_sales_count: thirty_day_sales_count.try_into().unwrap_or_default(),
prev_one_day_volume: prev_one_day_volume.try_into().unwrap_or_default(),
prev_seven_day_volume: prev_seven_day_volume.try_into().unwrap_or_default(),
prev_thirty_day_volume: prev_thirty_day_volume.try_into().unwrap_or_default(),
prev_one_day_sales_count: prev_one_day_sales_count.try_into().unwrap_or_default(),
prev_seven_day_sales_count: prev_seven_day_sales_count
.to_u64()
.unwrap_or_default()
.into(),
prev_thirty_day_sales_count: prev_thirty_day_sales_count
.to_u64()
.unwrap_or_default()
.into(),
prev_one_day_floor_price: prev_one_day_floor_price.try_into().unwrap_or_default(),
prev_seven_day_floor_price: prev_seven_day_floor_price
.to_u64()
.unwrap_or_default()
.into(),
prev_thirty_day_floor_price: prev_thirty_day_floor_price
.to_u64()
.unwrap_or_default()
.into(),
prev_one_day_marketcap: prev_one_day_marketcap.to_u64().unwrap_or_default().into(),
prev_seven_day_marketcap: prev_seven_day_marketcap.to_u64().unwrap_or_default().into(),
prev_thirty_day_marketcap: prev_thirty_day_marketcap
.to_u64()
.unwrap_or_default()
.into(),
one_day_volume_change: one_day_volume_change.try_into()?,
seven_day_volume_change: seven_day_volume_change.try_into()?,
thirty_day_volume_change: thirty_day_volume_change.try_into()?,
one_day_floor_price_change: one_day_floor_price_change.try_into()?,
seven_day_floor_price_change: seven_day_floor_price_change.try_into()?,
thirty_day_floor_price_change: thirty_day_floor_price_change.try_into()?,
one_day_sales_count_change: one_day_sales_count_change.try_into()?,
seven_day_sales_count_change: seven_day_sales_count_change.try_into()?,
thirty_day_sales_count_change: thirty_day_sales_count_change.try_into()?,
one_day_marketcap: one_day_marketcap.try_into().unwrap_or_default(),
seven_day_marketcap: seven_day_marketcap.try_into().unwrap_or_default(),
thirty_day_marketcap: thirty_day_marketcap.try_into().unwrap_or_default(),
one_day_marketcap_change: one_day_marketcap_change.try_into()?,
seven_day_marketcap_change: seven_day_marketcap_change.try_into()?,
thirty_day_marketcap_change: thirty_day_marketcap_change.try_into()?,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if unwrap_or_default is the method you want to be using here.

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.

3 participants