@turtleclub/hooks 0.5.0-beta.93 → 0.5.0-beta.95
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.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/v2/geocheck/hooks.ts +5 -4
- package/src/v2/lib/api-client.ts +1 -0
- package/src/v2/lib/turtle-provider.tsx +2 -1
- package/src/v2/streams/schemas.ts +1 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turtleclub/hooks",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.0-beta.
|
|
4
|
+
"version": "0.5.0-beta.95",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "3f7a4a79294f72108d38af5653822077f29b661e"
|
|
58
58
|
}
|
package/src/v2/geocheck/hooks.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
2
2
|
import type { UseQueryResult } from "@tanstack/react-query";
|
|
3
3
|
import { geocheckQueries } from "./queries";
|
|
4
4
|
import { queryDefaults } from "../lib/query-config";
|
|
5
|
+
import { apiClient } from "../lib/api-client";
|
|
5
6
|
import type { GeoCheckResponse } from "./schema";
|
|
6
7
|
|
|
7
8
|
export interface UseGeocheckOptions {
|
|
@@ -21,15 +22,15 @@ export interface UseGeocheckOptions {
|
|
|
21
22
|
* if (!geocheck?.canInteract) return <div>Service not available in your region</div>;
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
24
|
-
export function useGeocheck(
|
|
25
|
-
options: UseGeocheckOptions = {}
|
|
26
|
-
): UseQueryResult<GeoCheckResponse> {
|
|
25
|
+
export function useGeocheck(options: UseGeocheckOptions = {}): UseQueryResult<GeoCheckResponse> {
|
|
27
26
|
const { enabled = true, staleTime, gcTime } = options;
|
|
27
|
+
const { disableGeocheck } = apiClient.getConfig();
|
|
28
28
|
|
|
29
29
|
return useQuery({
|
|
30
30
|
...geocheckQueries.check,
|
|
31
31
|
...queryDefaults,
|
|
32
|
-
enabled,
|
|
32
|
+
enabled: enabled && !disableGeocheck,
|
|
33
|
+
...(disableGeocheck && { initialData: { canInteract: true } }),
|
|
33
34
|
staleTime: staleTime ?? 5 * 60 * 1000, // 5 minutes
|
|
34
35
|
gcTime: gcTime ?? 10 * 60 * 1000, // 10 minutes
|
|
35
36
|
});
|
package/src/v2/lib/api-client.ts
CHANGED
|
@@ -36,8 +36,9 @@ export function TurtleHooksProvider({
|
|
|
36
36
|
getToken,
|
|
37
37
|
earnApiKey,
|
|
38
38
|
debug,
|
|
39
|
+
disableGeocheck,
|
|
39
40
|
}: TurtleHooksProviderProps) {
|
|
40
|
-
apiClient.configure({ apiUrl, earnUrl, getToken, earnApiKey, debug });
|
|
41
|
+
apiClient.configure({ apiUrl, earnUrl, getToken, earnApiKey, debug, disableGeocheck });
|
|
41
42
|
|
|
42
43
|
return <>{children}</>;
|
|
43
44
|
}
|
|
@@ -206,8 +206,7 @@ export const streamSignatureRequestInputSchema = z.object({
|
|
|
206
206
|
chainId: z.number().nullable(),
|
|
207
207
|
customArgs: z.intersection(
|
|
208
208
|
z.object({
|
|
209
|
-
|
|
210
|
-
targetTokenAddress: z.string(),
|
|
209
|
+
targetTokenId: z.string().uuid(),
|
|
211
210
|
}),
|
|
212
211
|
z.union([
|
|
213
212
|
z.object({ tokensPerUSD: z.string() }),
|