@liberfi.io/react-predict 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -948,7 +948,7 @@ function useOrderbook(params, queryOptions = {}) {
948
948
  queryKey: orderbookQueryKey(params.slug, params.source),
949
949
  queryFn: () => client.getOrderbook(params.slug, params.source),
950
950
  enabled: Boolean(params.slug),
951
- refetchInterval: 5e3,
951
+ refetchInterval: 3e4,
952
952
  ...queryOptions
953
953
  });
954
954
  }
@@ -1092,13 +1092,13 @@ function dflowQuoteQueryKey(params) {
1092
1092
  }
1093
1093
  function useDFlowQuote(params, queryOptions = {}) {
1094
1094
  const client = usePredictClient();
1095
- const enabled = Boolean(params.inputMint) && Boolean(params.outputMint) && Boolean(params.userPublicKey) && params.amount !== "0" && params.amount !== "";
1095
+ const paramsValid = Boolean(params.inputMint) && Boolean(params.outputMint) && Boolean(params.userPublicKey) && params.amount !== "0" && params.amount !== "";
1096
1096
  return useQuery({
1097
1097
  queryKey: dflowQuoteQueryKey(params),
1098
1098
  queryFn: () => client.createDFlowQuote(params),
1099
- enabled,
1100
1099
  staleTime: 1e4,
1101
- ...queryOptions
1100
+ ...queryOptions,
1101
+ enabled: paramsValid && (queryOptions.enabled ?? true)
1102
1102
  });
1103
1103
  }
1104
1104
  function useDFlowSubmit(mutationOptions = {}) {