require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../constants/contracts.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../utils/tron.utils.cjs`),i=require(`../utils/create-provider.cjs`);let a=require(`ethers`);var o=(r,i)=>{let a=e.networkRegistry[i];if(!a)throw Error(n.transactionErrorCodes.UNSUPPORTED_NETWORK);let o=t.contractMetadataMapping[r];if(!o)throw Error(`Unsupported contractType: ${r}`);return o(a.contractData)},s=(e,t,n,i)=>{let s=o(e,t);if(!s.abi)throw Error(`No ABI configured for contractType: ${e}`);if(s.address&&n)throw Error(`Overriding address is not supported for contractType: ${e}`);let c=s.address??n;if(!c)throw Error(`No contractAddress configured for contractType: ${e}`);return new a.ethers.Contract(r.addressToHexFormat(c),s.abi,i)},c=(e,t,n=void 0)=>s(t,e,n,i.createJsonRpcProvider(e));exports.getContract=s,exports.getContractMetadata=o,exports.getContractWithFetcherByChainId=c;