export type ChainIdentifier = 'base' | 'ethereum' | 'zora' | 'arbitrum' | 'sei' | 'avalanche' | 'polygon' | 'optimism' | 'ape_chain' | 'flow' | 'soneium' | 'ronin' | 'bera_chain' | 'solana' | 'shape' | 'unichain' | 'gunzilla' | 'abstract' | 'animechain' | 'hyperevm' | 'somnia' | 'monad' | 'hyperliquid' | 'megaeth' | 'ink' | 'robinhood' | 'stablechain'; export type CreateApiApiV2ChainChainContractAddressNftsIdentifierRefreshArgs = {address: string, chain: ChainIdentifier, identifier: string, ignoreCachedItemUrls?: boolean | undefined}; export type CreateApiApiV2ChainChainContractAddressNftsIdentifierRefreshOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Refresh NFT metadata * * POST /api/v2/chain/{chain}/contract/{address}/nfts/{identifier}/refresh */ export const createApiApiV2ChainChainContractAddressNftsIdentifierRefresh = async (args: CreateApiApiV2ChainChainContractAddressNftsIdentifierRefreshArgs, options?: CreateApiApiV2ChainChainContractAddressNftsIdentifierRefreshOptions) => { const {baseUrl = "https://api.opensea.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.ignoreCachedItemUrls != null) query.append("ignoreCachedItemUrls", String(args.ignoreCachedItemUrls)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/chain/${encodeURIComponent(String(args.chain))}/contract/${encodeURIComponent(String(args.address))}/nfts/${encodeURIComponent(String(args.identifier))}/refresh${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };