export type GetApiApiV2ToolsRegistryChainRegistryAddrToolIdArgs = {registry_chain: string, registry_addr: string, tool_id: string}; export type GetApiApiV2ToolsRegistryChainRegistryAddrToolIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * [Beta] Get a registered tool * * GET /api/v2/tools/{registry_chain}/{registry_addr}/{tool_id} */ export const getApiApiV2ToolsRegistryChainRegistryAddrToolId = async (args: GetApiApiV2ToolsRegistryChainRegistryAddrToolIdArgs, options?: GetApiApiV2ToolsRegistryChainRegistryAddrToolIdOptions) => { const {baseUrl = "https://api.opensea.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/tools/${encodeURIComponent(String(args.registry_chain))}/${encodeURIComponent(String(args.registry_addr))}/${encodeURIComponent(String(args.tool_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };