@safe-global/safe-react-hooks
Version:
A collection of React Hooks that facilitates the interaction of React apps with Safe Smart Accounts
16 lines • 663 B
JavaScript
import { usePublicClientQuery } from '../../hooks/usePublicClientQuery.js';
import { QueryKey } from '../../constants.js';
/**
* Hook to get the connected Safe's address.
* @param params Parameters to customize the hook behavior.
* @param params.config SafeConfig to use instead of the one provided by `SafeProvider`.
* @returns Query result object containing the Safe's address.
*/
export function useAddress(params = {}) {
return usePublicClientQuery({
...params,
querySafeClientFn: (safeClient) => safeClient.getAddress().then((address) => address),
queryKey: [QueryKey.Address]
});
}
//# sourceMappingURL=useAddress.js.map