MCPcopy Create free account
hub / github.com/dailydotdev/apps / coresPricesQueryOptions

Function coresPricesQueryOptions

packages/shared/src/graphql/njord.ts:189–214  ·  view source on GitHub ↗
({
  isLoggedIn,
  user,
}: {
  isLoggedIn: boolean;
  user: LoggedUser;
})

Source from the content-addressed store, hash-verified

187export const transactionRefetchIntervalMs = 2500;
188
189export const coresPricesQueryOptions = ({
190 isLoggedIn,
191 user,
192}: {
193 isLoggedIn: boolean;
194 user: LoggedUser;
195}) => {
196 return {
197 queryKey: generateQueryKey(
198 RequestKey.PricePreview,
199 user,
200 PurchaseType.Cores,
201 ),
202 queryFn: async () => {
203 if (iOSSupportsCoresPurchase()) {
204 const metadata = await fetchPricingMetadata(PurchaseType.Cores);
205
206 return getApplePricing(metadata);
207 }
208
209 return fetchPricingPreview(PurchaseType.Cores);
210 },
211 enabled: isLoggedIn,
212 staleTime: StaleTime.Default,
213 };
214};
215
216type UserTransactionSummary = {
217 purchased: number;

Callers 5

CoreOptionListFunction · 0.90
FeaturedCoresWidgetFunction · 0.90

Calls 5

generateQueryKeyFunction · 0.90
iOSSupportsCoresPurchaseFunction · 0.90
fetchPricingMetadataFunction · 0.90
getApplePricingFunction · 0.90
fetchPricingPreviewFunction · 0.90

Tested by

no test coverage detected