import type { UseMutationResult } from '@tanstack/react-query'; import type { Config, ResolvedRegister } from '@wagmi/core'; import type { ConfigParameter, ExactPartial, UnionCompute } from '@wagmi/core/internal'; import { Actions } from '@wagmi/core/tempo'; import { type UseMutationParameters, type UseQueryReturnType } from '../../utils/query.js'; import type { QueryParameter } from '../utils.js'; /** * Hook for creating a new policy. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.policy.useCreate() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useCreate(parameters?: useCreate.Parameters): useCreate.ReturnType; export declare namespace useCreate { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for creating a new policy. * * Note: This is a synchronous hook that waits for the transaction * to be included on a block before returning a response. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.policy.useCreateSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useCreateSync(parameters?: useCreateSync.Parameters): useCreateSync.ReturnType; export declare namespace useCreateSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for setting the admin for a policy. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.policy.useSetAdmin() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useSetAdmin(parameters?: useSetAdmin.Parameters): useSetAdmin.ReturnType; export declare namespace useSetAdmin { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for setting the admin for a policy. * * Note: This is a synchronous hook that waits for the transaction * to be included on a block before returning a response. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.policy.useSetAdminSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useSetAdminSync(parameters?: useSetAdminSync.Parameters): useSetAdminSync.ReturnType; export declare namespace useSetAdminSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for modifying a policy whitelist. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.policy.useModifyWhitelist() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useModifyWhitelist(parameters?: useModifyWhitelist.Parameters): useModifyWhitelist.ReturnType; export declare namespace useModifyWhitelist { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for modifying a policy whitelist. * * Note: This is a synchronous hook that waits for the transaction * to be included on a block before returning a response. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.policy.useModifyWhitelistSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useModifyWhitelistSync(parameters?: useModifyWhitelistSync.Parameters): useModifyWhitelistSync.ReturnType; export declare namespace useModifyWhitelistSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for modifying a policy blacklist. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.policy.useModifyBlacklist() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useModifyBlacklist(parameters?: useModifyBlacklist.Parameters): useModifyBlacklist.ReturnType; export declare namespace useModifyBlacklist { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for modifying a policy blacklist. * * Note: This is a synchronous hook that waits for the transaction * to be included on a block before returning a response. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { mutate, isPending } = Hooks.policy.useModifyBlacklistSync() * * return ( * * ) * } * ``` * * @param parameters - Parameters. * @returns Mutation result. */ export declare function useModifyBlacklistSync(parameters?: useModifyBlacklistSync.Parameters): useModifyBlacklistSync.ReturnType; export declare namespace useModifyBlacklistSync { type Parameters = ConfigParameter & { mutation?: UseMutationParameters, context> | undefined; }; type ReturnType = UseMutationResult, context>; } /** * Hook for getting policy data. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data, isLoading } = Hooks.policy.useData({ * policyId: 2n, * }) * * if (isLoading) return
Loading...
* return
Admin: {data?.admin}
* } * ``` * * @param parameters - Parameters. * @returns Query result with policy data. */ export declare function useData(parameters?: useData.Parameters): useData.ReturnValue; export declare namespace useData { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for checking if a user is authorized by a policy. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * const { data, isLoading } = Hooks.policy.useIsAuthorized({ * policyId: 2n, * user: '0x...', * }) * * if (isLoading) return
Loading...
* return
Authorized: {data ? 'Yes' : 'No'}
* } * ``` * * @param parameters - Parameters. * @returns Query result with authorization status. */ export declare function useIsAuthorized(parameters?: useIsAuthorized.Parameters): useIsAuthorized.ReturnValue; export declare namespace useIsAuthorized { type Parameters = ConfigParameter & QueryParameter> & ExactPartial>; type ReturnValue = UseQueryReturnType; } /** * Hook for watching policy creation events. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.policy.useWatchCreate({ * onPolicyCreated(args) { * console.log('Policy created:', args) * }, * }) * * return
Watching for policy creation...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchCreate(parameters?: useWatchCreate.Parameters): void; export declare namespace useWatchCreate { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } /** * Hook for watching policy admin update events. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.policy.useWatchAdminUpdated({ * onAdminUpdated(args) { * console.log('Policy admin updated:', args) * }, * }) * * return
Watching for admin updates...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchAdminUpdated(parameters?: useWatchAdminUpdated.Parameters): void; export declare namespace useWatchAdminUpdated { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } /** * Hook for watching whitelist update events. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.policy.useWatchWhitelistUpdated({ * onWhitelistUpdated(args) { * console.log('Whitelist updated:', args) * }, * }) * * return
Watching for whitelist updates...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchWhitelistUpdated(parameters?: useWatchWhitelistUpdated.Parameters): void; export declare namespace useWatchWhitelistUpdated { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } /** * Hook for watching blacklist update events. * * @example * ```tsx * import { Hooks } from 'wagmi/tempo' * * function App() { * Hooks.policy.useWatchBlacklistUpdated({ * onBlacklistUpdated(args) { * console.log('Blacklist updated:', args) * }, * }) * * return
Watching for blacklist updates...
* } * ``` * * @param parameters - Parameters. */ export declare function useWatchBlacklistUpdated(parameters?: useWatchBlacklistUpdated.Parameters): void; export declare namespace useWatchBlacklistUpdated { type Parameters = UnionCompute> & ConfigParameter & { enabled?: boolean | undefined; }>; } //# sourceMappingURL=policy.d.ts.map