import{r as a,M as d}from"./thirdweb-Co3M1EyP.js";import{f as u}from"./fetchTokenMetadata-dQEbpZ5P.js";import{parseNFT as i}from"./parseNft-DD6m8xPf.js";import{totalSupply as o}from"./totalSupply-CY4mHg6C.js";import"./uint8-array-DZKEMhA1.js";const I="0x0e89341c",k=[{name:"tokenId",type:"uint256"}],f=[{type:"string"}];async function m(t){return a({contract:t.contract,method:[I,k,f],params:[t.tokenId]})}async function N(t){const{useIndexer:r=!0}=t;if(r)try{return await y(t)}catch{return await c(t)}return await c(t)}async function y(t){const r=await d({chain:t.contract.chain,client:t.contract.client,contractAddress:t.contract.address,tokenId:t.tokenId});return r||c(t)}async function c(t){const[r,e]=await Promise.all([m({contract:t.contract,tokenId:t.tokenId}),o({contract:t.contract,id:t.tokenId}).catch(()=>0n)]);return i(await u({client:t.contract.client,tokenId:t.tokenId,tokenUri:r}).then(n=>n||{id:t.tokenId,type:"ERC1155",uri:r}).catch(()=>({id:t.tokenId,type:"ERC1155",uri:r})),{chainId:t.contract.chain.id,owner:null,supply:e,tokenAddress:t.contract.address,tokenId:t.tokenId,tokenUri:r,type:"ERC1155"})}export{N as getNFT};
