import type { SWRConfiguration, SWRResponse } from "swr"; import useSWR from "swr"; import client from "../../client"; import type { GetUsersWalletorhandlePathParams, GetUsersWalletorhandleQueryParams, GetUsersWalletorhandleQueryResponse, } from "../models/GetUsersWalletorhandle"; export function getUsersWalletorhandleQueryOptions< TData = GetUsersWalletorhandleQueryResponse, TError = unknown, >( walletOrHandle: GetUsersWalletorhandlePathParams["walletOrHandle"], params?: GetUsersWalletorhandleQueryParams, options: Partial[0]> = {} ): SWRConfiguration { return { fetcher: () => { return client({ method: "get", url: `/users/${walletOrHandle}`, params, ...options, }); }, }; } /** * @description Get a user's profile and activity * @summary User details * @link /users/:walletOrHandle */ export function useGetUsersWalletorhandle< TData = GetUsersWalletorhandleQueryResponse, TError = unknown, >( walletOrHandle: GetUsersWalletorhandlePathParams["walletOrHandle"], params?: GetUsersWalletorhandleQueryParams, options?: { query?: SWRConfiguration; client?: Partial>[0]>; } ): SWRResponse { const { query: queryOptions, client: clientOptions = {} } = options ?? {}; const query = useSWR(`/users/${walletOrHandle}`, { ...getUsersWalletorhandleQueryOptions( walletOrHandle, params, clientOptions ), ...queryOptions, }); return query; }