-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
Expiry, | ||
} | ||
|
||
/// Input parameters for the [`collection_nfts`] query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
impl<'a> TryFrom<models::CollectionTrend> for CollectionTrend { | |
impl TryFrom<models::CollectionTrend> for CollectionTrend { |
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()?, |
There was a problem hiding this comment.
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.
Addresses: #813