@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.js CHANGED
@@ -950,7 +950,7 @@ function useOrderbook(params, queryOptions = {}) {
950
950
  queryKey: orderbookQueryKey(params.slug, params.source),
951
951
  queryFn: () => client.getOrderbook(params.slug, params.source),
952
952
  enabled: Boolean(params.slug),
953
- refetchInterval: 5e3,
953
+ refetchInterval: 3e4,
954
954
  ...queryOptions
955
955
  });
956
956
  }
@@ -1094,13 +1094,13 @@ function dflowQuoteQueryKey(params) {
1094
1094
  }
1095
1095
  function useDFlowQuote(params, queryOptions = {}) {
1096
1096
  const client = usePredictClient();
1097
- const enabled = Boolean(params.inputMint) && Boolean(params.outputMint) && Boolean(params.userPublicKey) && params.amount !== "0" && params.amount !== "";
1097
+ const paramsValid = Boolean(params.inputMint) && Boolean(params.outputMint) && Boolean(params.userPublicKey) && params.amount !== "0" && params.amount !== "";
1098
1098
  return reactQuery.useQuery({
1099
1099
  queryKey: dflowQuoteQueryKey(params),
1100
1100
  queryFn: () => client.createDFlowQuote(params),
1101
- enabled,
1102
1101
  staleTime: 1e4,
1103
- ...queryOptions
1102
+ ...queryOptions,
1103
+ enabled: paramsValid && (queryOptions.enabled ?? true)
1104
1104
  });
1105
1105
  }
1106
1106
  function useDFlowSubmit(mutationOptions = {}) {