Skip to content

Add listing query for collection#814

Open
alchemistgo87 wants to merge 6 commits into
devfrom
anshul/collection-listings-query
Open

Add listing query for collection#814
alchemistgo87 wants to merge 6 commits into
devfrom
anshul/collection-listings-query

Conversation

@alchemistgo87

Copy link
Copy Markdown
Contributor

Addresses: #813

@kespinola kespinola left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread crates/core/src/db/queries/metadatas.rs Outdated
Comment thread crates/graphql/src/schema/objects/nft.rs Outdated
Comment thread crates/core/src/db/queries/listings.rs Outdated
Expiry,
}

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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