@liberfi.io/react-predict 0.1.9 → 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 +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1094,13 +1094,13 @@ function dflowQuoteQueryKey(params) {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
function useDFlowQuote(params, queryOptions = {}) {
|
|
1096
1096
|
const client = usePredictClient();
|
|
1097
|
-
const
|
|
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 = {}) {
|