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

Function coresPricesQueryOptions

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

Source from the content-addressed store, hash-verified

209export const transactionRefetchIntervalMs = 2500;
210
211export const coresPricesQueryOptions = ({
212 isLoggedIn,
213 user,
214}: {
215 isLoggedIn: boolean;
216 user?: LoggedUser;
217}) => {
218 return {
219 queryKey: generateQueryKey(
220 RequestKey.PricePreview,
221 user,
222 PurchaseType.Cores,
223 ),
224 queryFn: async () => {
225 if (iOSSupportsCoresPurchase()) {
226 const metadata = await fetchPricingMetadata(PurchaseType.Cores);
227
228 return getApplePricing(metadata);
229 }
230
231 return fetchPricingPreview(PurchaseType.Cores);
232 },
233 enabled: isLoggedIn,
234 staleTime: StaleTime.Default,
235 };
236};
237
238type UserTransactionSummary = {
239 purchased: number;

Callers 7

SeedCorePacksFunction · 0.90
usePreselectedPackFunction · 0.90
CoreOptionListFunction · 0.90
PacksWidgetFunction · 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