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EAAA,MAAoC,GAAAlP,EAAAqK,EAAA,EAAcpB,EAAAgG,aAAA,EAClDmF,EAAAA,EAAAnL,MAAA,CAAAgG,GAAAA,EAAArN,aAAA,CAAAwM,QAAA,GAAA5K,WAAA,KAAA0L,GAAAd,WAAA5K,cACA,CACAoB,KAAAA,IAAAqE,EAAApH,OAAA,EACAuS,CAAAA,EAAAA,EAAAnL,MAAA,CAAAgG,GAAAA,EAAApN,OAAA,CAAAuM,QAAA,KAAAnF,GAAApH,SAAAuM,WAAA,CAEA,CACA,OAAAnF,GAAAkG,OAAAlG,EAAAkG,KAAA,CAAAiF,EAAAhF,MAAA,CAAAgF,EAAA/E,KAAA,GAAApG,EAAAkG,KAAA,EAAAiF,CACA,CACA","sources":["webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/cleanCurrencyAddress-a57dd7bc.browser.esm.js","webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/contract-platform-fee-cf472ea2.browser.esm.js","webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/marketplace-cc35d3ed.browser.esm.js","webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/marketplacev3-offers-0b60c72d.browser.esm.js","webpack://_N_E/"],"sourcesContent":["import { aW as NATIVE_TOKEN_ADDRESS } from './index-02e94cec.browser.esm.js';\nimport { i as isNativeToken } from './fetchCurrencyValue-a150f8dd.browser.esm.js';\n\n/**\n * @internal\n */\nfunction cleanCurrencyAddress(currencyAddress) {\n if (isNativeToken(currencyAddress)) {\n return NATIVE_TOKEN_ADDRESS;\n }\n return currencyAddress;\n}\n\nexport { cleanCurrencyAddress as c };\n","import { f as buildTransactionFunction, T as Transaction } from './transactions-91b95b4c.browser.esm.js';\nimport { dr as FEATURE_PLATFORM_FEE, bH as CommonPlatformFeeSchema } from './index-02e94cec.browser.esm.js';\n\n/**\n * Handle platform fees and recipients\n * @remarks Configure platform fees for a contract, which can be applied on certain paid transactions\n * @example\n * ```javascript\n * const contract = await sdk.getContract(\"{{contract_address}}\");\n * const feeInfo = await contract.platformFees.get();\n * await contract.platformFees.set({\n * platform_fee_basis_points: 100, // 1% fee\n * platform_fee_recipient: \"0x...\" // the fee recipient\n * })\n * ```\n * @public\n */\nclass ContractPlatformFee {\n featureName = FEATURE_PLATFORM_FEE.name;\n constructor(contractWrapper) {\n this.contractWrapper = contractWrapper;\n }\n\n /**\n * Get the platform fee recipient and basis points\n *\n * @example\n * ```javascript\n * const feeInfo = await contract.platformFees.get();\n * console.log(feeInfo.platform_fee_recipient);\n * console.log(feeInfo.platform_fee_basis_points);\n * ```\n * @twfeature PlatformFee\n */\n async get() {\n const [platformFeeRecipient, platformFeeBps] = await this.contractWrapper.read(\"getPlatformFeeInfo\", []);\n return CommonPlatformFeeSchema.parseAsync({\n platform_fee_recipient: platformFeeRecipient,\n platform_fee_basis_points: platformFeeBps\n });\n }\n\n /**\n * Set the platform fee recipient and basis points\n *\n * @example\n * ```javascript\n * await contract.platformFees.set({\n * platform_fee_basis_points: 100, // 1% fee\n * platform_fee_recipient: \"0x...\" // the fee recipient\n * })\n * ```\n *\n * @param platformFeeInfo - the platform fee information\n * @twfeature PlatformFee\n */\n set = /* @__PURE__ */buildTransactionFunction(async platformFeeInfo => {\n const parsed = await CommonPlatformFeeSchema.parseAsync(platformFeeInfo);\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"setPlatformFeeInfo\",\n args: [parsed.platform_fee_recipient, parsed.platform_fee_basis_points]\n });\n });\n}\n\nexport { ContractPlatformFee as C };\n","import { Contract, BigNumber } from 'ethers';\nimport invariant from 'tiny-invariant';\nimport { I as InterfaceId_IERC721, a as InterfaceId_IERC1155, D as DEFAULT_QUERY_ALL_COUNT } from './QueryParams-b6af7045.browser.esm.js';\nimport { cs as ContractWrapper, dB as MAX_BPS } from './index-02e94cec.browser.esm.js';\nimport { a as fetchCurrencyValue } from './fetchCurrencyValue-a150f8dd.browser.esm.js';\n\n/**\n * This method checks if the given token is approved for the transferrerContractAddress contract.\n * This is particularly useful for contracts that need to transfer NFTs on the users' behalf\n *\n * @internal\n * @param provider - The connected provider\n * @param transferrerContractAddress - The address of the marketplace contract\n * @param assetContract - The address of the asset contract.\n * @param tokenId - The token id of the token.\n * @param owner - The address of the account that owns the token.\n * @returns True if the transferrerContractAddress is approved on the token, false otherwise.\n */\nasync function isTokenApprovedForTransfer(provider, transferrerContractAddress, assetContract, tokenId, owner) {\n try {\n const ERC165Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC165.json')).default;\n const erc165 = new Contract(assetContract, ERC165Abi, provider);\n const [isERC721, isERC1155] = await Promise.all([erc165.supportsInterface(InterfaceId_IERC721), erc165.supportsInterface(InterfaceId_IERC1155)]);\n if (isERC721) {\n const ERC721Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC721.json')).default;\n const asset = new Contract(assetContract, ERC721Abi, provider);\n const approved = await asset.isApprovedForAll(owner, transferrerContractAddress);\n if (approved) {\n return true;\n }\n\n // Handle reverts in case of non-existent tokens\n let approvedAddress;\n try {\n approvedAddress = await asset.getApproved(tokenId);\n } catch (e) {}\n return approvedAddress?.toLowerCase() === transferrerContractAddress.toLowerCase();\n } else if (isERC1155) {\n const ERC1155Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC1155.json')).default;\n const asset = new Contract(assetContract, ERC1155Abi, provider);\n return await asset.isApprovedForAll(owner, transferrerContractAddress);\n } else {\n console.error(\"Contract does not implement ERC 1155 or ERC 721.\");\n return false;\n }\n } catch (err) {\n console.error(\"Failed to check if token is approved\", err);\n return false;\n }\n}\n\n/**\n * Checks if the marketplace is approved to make transfers on the assetContract\n * If not, it tries to set the approval.\n * @param contractWrapper - The contract wrapper to use\n * @param marketplaceAddress - The address of the marketplace contract\n * @param assetContract - The address of the asset contract.\n * @param tokenId - The token id of the token.\n * @param from - The address of the account that owns the token.\n */\nasync function handleTokenApproval(contractWrapper, marketplaceAddress, assetContract, tokenId, from) {\n const ERC165Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC165.json')).default;\n const erc165 = new ContractWrapper(contractWrapper.getSignerOrProvider(), assetContract, ERC165Abi, contractWrapper.options, contractWrapper.storage);\n const [isERC721, isERC1155] = await Promise.all([erc165.read(\"supportsInterface\", [InterfaceId_IERC721]), erc165.read(\"supportsInterface\", [InterfaceId_IERC1155])]);\n // check for token approval\n if (isERC721) {\n const ERC721Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC721.json')).default;\n const asset = new ContractWrapper(contractWrapper.getSignerOrProvider(), assetContract, ERC721Abi, contractWrapper.options, contractWrapper.storage);\n const approved = await asset.read(\"isApprovedForAll\", [from, marketplaceAddress]);\n if (!approved) {\n const isTokenApproved = (await asset.read(\"getApproved\", [tokenId])).toLowerCase() === marketplaceAddress.toLowerCase();\n if (!isTokenApproved) {\n await asset.sendTransaction(\"setApprovalForAll\", [marketplaceAddress, true]);\n }\n }\n } else if (isERC1155) {\n const ERC1155Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC1155.json')).default;\n const asset = new ContractWrapper(contractWrapper.getSignerOrProvider(), assetContract, ERC1155Abi, contractWrapper.options, contractWrapper.storage);\n const approved = await asset.read(\"isApprovedForAll\", [from, marketplaceAddress]);\n if (!approved) {\n await asset.sendTransaction(\"setApprovalForAll\", [marketplaceAddress, true]);\n }\n } else {\n throw Error(\"Contract must implement ERC 1155 or ERC 721.\");\n }\n}\n\n/**\n * Used to verify fields in new listing.\n * @internal\n */\n// TODO this should be done in zod\nfunction validateNewListingParam(param) {\n invariant(param.assetContractAddress !== undefined && param.assetContractAddress !== null, \"Asset contract address is required\");\n invariant(param.buyoutPricePerToken !== undefined && param.buyoutPricePerToken !== null, \"Buyout price is required\");\n invariant(param.listingDurationInSeconds !== undefined && param.listingDurationInSeconds !== null, \"Listing duration is required\");\n invariant(param.startTimestamp !== undefined && param.startTimestamp !== null, \"Start time is required\");\n invariant(param.tokenId !== undefined && param.tokenId !== null, \"Token ID is required\");\n invariant(param.quantity !== undefined && param.quantity !== null, \"Quantity is required\");\n switch (param.type) {\n case \"NewAuctionListing\":\n {\n invariant(param.reservePricePerToken !== undefined && param.reservePricePerToken !== null, \"Reserve price is required\");\n }\n }\n}\n\n/**\n * Maps a contract offer to the strict interface\n *\n * @internal\n * @param offer - The offer to map\n * @returns An `Offer` object\n */\nasync function mapOffer(provider, listingId, offer) {\n return {\n quantity: offer.quantityDesired,\n pricePerToken: offer.pricePerToken,\n currencyContractAddress: offer.currency,\n buyerAddress: offer.offeror,\n quantityDesired: offer.quantityWanted,\n currencyValue: await fetchCurrencyValue(provider, offer.currency, offer.quantityWanted.mul(offer.pricePerToken)),\n listingId\n };\n}\nfunction isWinningBid(winningPrice, newBidPrice, bidBuffer) {\n bidBuffer = BigNumber.from(bidBuffer);\n winningPrice = BigNumber.from(winningPrice);\n newBidPrice = BigNumber.from(newBidPrice);\n if (winningPrice.eq(BigNumber.from(0))) {\n return false;\n }\n const buffer = newBidPrice.sub(winningPrice).mul(MAX_BPS).div(winningPrice);\n return buffer.gte(bidBuffer);\n}\nasync function getAllInBatches(start, end, fn) {\n const batches = [];\n while (end - start > DEFAULT_QUERY_ALL_COUNT) {\n batches.push(fn(start, start + DEFAULT_QUERY_ALL_COUNT - 1));\n start += DEFAULT_QUERY_ALL_COUNT;\n }\n batches.push(fn(start, end - 1));\n return await Promise.all(batches);\n}\n\nexport { isWinningBid as a, getAllInBatches as g, handleTokenApproval as h, isTokenApprovedForTransfer as i, mapOffer as m, validateNewListingParam as v };\n","import { BigNumber, Contract, constants, utils } from 'ethers';\nimport invariant from 'tiny-invariant';\nimport { c as cleanCurrencyAddress } from './cleanCurrencyAddress-a57dd7bc.browser.esm.js';\nimport { C as ContractEncoder, a as fetchCurrencyValue, f as fetchCurrencyMetadata, i as isNativeToken } from './fetchCurrencyValue-a150f8dd.browser.esm.js';\nimport { n as normalizePriceValue } from './normalizePriceValue-74eeb144.browser.esm.js';\nimport { s as setErc20Allowance } from './setErc20Allowance-e3ef471a.browser.esm.js';\nimport { ba as AddressOrEnsSchema, b7 as BigNumberishSchema, aW as NATIVE_TOKEN_ADDRESS, cw as AmountSchema, dx as FEATURE_DIRECT_LISTINGS, aM as resolveAddress, dy as FEATURE_ENGLISH_AUCTIONS, w as AuctionHasNotEndedError, dz as FEATURE_OFFERS, aX as NATIVE_TOKENS, cs as ContractWrapper } from './index-02e94cec.browser.esm.js';\nimport { g as getAllInBatches, i as isTokenApprovedForTransfer, h as handleTokenApproval } from './marketplace-cc35d3ed.browser.esm.js';\nimport { c as fetchTokenMetadataForContract, I as InterfaceId_IERC721, a as InterfaceId_IERC1155 } from './QueryParams-b6af7045.browser.esm.js';\nimport { f as buildTransactionFunction, T as Transaction } from './transactions-91b95b4c.browser.esm.js';\nimport { R as RawDateSchema, E as EndDateSchema } from './assertEnabled-4605112f.browser.esm.js';\nimport { z } from 'zod';\nimport { a as ContractEvents, G as GasCostEstimator } from './contract-appuri-84a944c8.browser.esm.js';\nimport { C as ContractInterceptor } from './contract-interceptor-d7b164a7.browser.esm.js';\n\n/**\n * @internal\n */\nconst DirectListingInputParamsSchema = /* @__PURE__ */(() => z.object({\n /**\n * The address of the asset being listed.\n */\n assetContractAddress: AddressOrEnsSchema,\n /**\n * The ID of the token to list.\n */\n tokenId: BigNumberishSchema,\n /**\n * The quantity of tokens to include in the listing.\n *\n * For ERC721s, this value should always be 1 (and will be forced internally regardless of what is passed here).\n */\n quantity: BigNumberishSchema.default(1),\n /**\n * The address of the currency to accept for the listing.\n */\n currencyContractAddress: AddressOrEnsSchema.default(NATIVE_TOKEN_ADDRESS),\n /**\n * The price to pay per unit of NFTs listed.\n */\n pricePerToken: AmountSchema,\n /**\n * The start time of the listing.\n */\n startTimestamp: RawDateSchema.default(new Date()),\n /**\n * The end time of the listing.\n */\n endTimestamp: EndDateSchema,\n /**\n * Whether the listing is reserved to be bought from a specific set of buyers.\n */\n isReservedListing: z.boolean().default(false)\n}))();\n\n/**\n * @public\n */\n\nlet Status = /*#__PURE__*/function (Status) {\n Status[Status[\"UNSET\"] = 0] = \"UNSET\";\n Status[Status[\"Created\"] = 1] = \"Created\";\n Status[Status[\"Completed\"] = 2] = \"Completed\";\n Status[Status[\"Cancelled\"] = 3] = \"Cancelled\";\n Status[Status[\"Active\"] = 4] = \"Active\";\n Status[Status[\"Expired\"] = 5] = \"Expired\";\n return Status;\n}({});\n\n/**\n * Handles direct listings\n * @public\n */\nclass MarketplaceV3DirectListings {\n featureName = FEATURE_DIRECT_LISTINGS.name;\n\n // utilities\n\n constructor(contractWrapper, storage) {\n this.contractWrapper = contractWrapper;\n this.storage = storage;\n this.events = new ContractEvents(this.contractWrapper);\n this.encoder = new ContractEncoder(this.contractWrapper);\n this.interceptor = new ContractInterceptor(this.contractWrapper);\n this.estimator = new GasCostEstimator(this.contractWrapper);\n }\n getAddress() {\n return this.contractWrapper.address;\n }\n\n /** ******************************\n * READ FUNCTIONS\n *******************************/\n\n /**\n * Get the total number of direct listings\n *\n * @returns Returns the total number of direct listings created.\n * @public\n *\n * @example\n * ```javascript\n * const totalListings = await contract.directListings.getTotalCount();\n * ```\n * @twfeature DirectListings\n */\n async getTotalCount() {\n return await this.contractWrapper.read(\"totalListings\", []);\n }\n\n /**\n * Get all direct listings\n *\n * @example\n * ```javascript\n * const listings = await contract.directListings.getAll();\n * ```\n *\n * @param filter - optional filter parameters\n * @returns The Direct listing object array\n * @twfeature DirectListings\n */\n async getAll(filter) {\n const totalListings = await this.getTotalCount();\n const start = BigNumber.from(filter?.start || 0).toNumber();\n const end = totalListings.toNumber();\n if (end === 0) {\n throw new Error(`No listings exist on the contract.`);\n }\n let rawListings = [];\n const batches = await getAllInBatches(start, end, (startId, endId) => this.contractWrapper.read(\"getAllListings\", [startId, endId]));\n rawListings = batches.flat();\n const filteredListings = await this.applyFilter(rawListings, filter);\n return await Promise.all(filteredListings.map(listing => this.mapListing(listing)));\n }\n\n /**\n * Get all valid direct listings\n *\n * @remarks A valid listing is where the listing is active, and the creator still owns & has approved Marketplace to transfer the listed NFTs.\n *\n * @example\n * ```javascript\n * const listings = await contract.directListings.getAllValid();\n * ```\n *\n * @param filter - optional filter parameters\n * @returns The Direct listing object array\n * @twfeature DirectListings\n */\n async getAllValid(filter) {\n const totalListings = await this.getTotalCount();\n const start = BigNumber.from(filter?.start || 0).toNumber();\n const end = totalListings.toNumber();\n if (end === 0) {\n throw new Error(`No listings exist on the contract.`);\n }\n let rawListings = [];\n const batches = await getAllInBatches(start, end, (startId, endId) => this.contractWrapper.read(\"getAllValidListings\", [startId, endId]));\n rawListings = batches.flat();\n const filteredListings = await this.applyFilter(rawListings, filter);\n return await Promise.all(filteredListings.map(listing => this.mapListing(listing)));\n }\n\n /**\n * Get a single direct listing\n *\n * @example\n * ```javascript\n * const listingId = 0;\n * const listing = await contract.directListings.getListing(listingId);\n * ```\n *\n * @param listingId - the listing id\n * @returns The Direct listing object\n *\n * @example\n * ```javascript\n * const listingId = 0;\n * const listing = await contract.directListings.getListing(listingId);\n * ```\n * @twfeature DirectListings\n */\n async getListing(listingId) {\n const listing = await this.contractWrapper.read(\"getListing\", [listingId]);\n return await this.mapListing(listing);\n }\n\n /**\n * Check if a buyer is approved for a specific direct listing\n *\n * @example\n * ```javascript\n * const listingId = 0;\n * const isBuyerApproved = await contract.directListings.isBuyerApprovedForListing(listingId, \"{{wallet_address}}\");\n * ```\n *\n * @param listingId - the listing id\n * @param buyer - buyer address\n * @twfeature DirectListings\n */\n async isBuyerApprovedForListing(listingId, buyer) {\n const listing = await this.validateListing(BigNumber.from(listingId));\n if (!listing.isReservedListing) {\n throw new Error(`Listing ${listingId} is not a reserved listing.`);\n }\n return await this.contractWrapper.read(\"isBuyerApprovedForListing\", [listingId, await resolveAddress(buyer)]);\n }\n\n /**\n * Check if a currency is approved for a specific direct listing\n *\n * @example\n * ```javascript\n * const listingId = 0;\n * const currencyContractAddress = '0x1234';\n * const isApproved = await contract.directListings.isCurrencyApprovedForListing(listingId, currencyContractAddress);\n * ```\n *\n * @param listingId - the listing id\n * @param currency - currency address\n * @twfeature DirectListings\n */\n async isCurrencyApprovedForListing(listingId, currency) {\n await this.validateListing(BigNumber.from(listingId));\n return await this.contractWrapper.read(\"isCurrencyApprovedForListing\", [listingId, await resolveAddress(currency)]);\n }\n\n /**\n * Check price per token for an approved currency\n *\n * @example\n * ```javascript\n * const listingId = 0;\n * const currencyContractAddress = '0x1234';\n * const price = await contract.directListings.currencyPriceForListing(listingId, currencyContractAddress);\n * ```\n *\n * @param listingId - the listing id\n * @param currencyContractAddress - currency contract address\n * @twfeature DirectListings\n */\n async currencyPriceForListing(listingId, currencyContractAddress) {\n const listing = await this.validateListing(BigNumber.from(listingId));\n const resolvedCurrencyAddress = await resolveAddress(currencyContractAddress);\n if (resolvedCurrencyAddress === listing.currencyContractAddress) {\n return listing.pricePerToken;\n }\n const isApprovedCurrency = await this.isCurrencyApprovedForListing(listingId, resolvedCurrencyAddress);\n if (!isApprovedCurrency) {\n throw new Error(`Currency ${resolvedCurrencyAddress} is not approved for Listing ${listingId}.`);\n }\n return await this.contractWrapper.read(\"currencyPriceForListing\", [listingId, resolvedCurrencyAddress]);\n }\n\n /** ******************************\n * WRITE FUNCTIONS\n *******************************/\n\n /**\n * Create new direct listing\n *\n * @remarks Create a new listing on the marketplace where people can buy an asset directly.\n *\n * @example\n * ```javascript\n * // Data of the listing you want to create\n * const listing = {\n * // address of the contract the asset you want to list is on\n * assetContractAddress: \"0x...\",\n * // token ID of the asset you want to list\n * tokenId: \"0\",\n * // how many of the asset you want to list\n * quantity: 1,\n * // address of the currency contract that will be used to pay for the listing\n * currencyContractAddress: NATIVE_TOKEN_ADDRESS,\n * // The price to pay per unit of NFTs listed.\n * pricePerToken: 1.5,\n * // when should the listing open up for offers\n * startTimestamp: new Date(Date.now()),\n * // how long the listing will be open for\n * endTimestamp: new Date(Date.now() + 5 * 24 * 60 * 60 * 1000),\n * // Whether the listing is reserved for a specific set of buyers.\n * isReservedListing: false\n * }\n *\n * const tx = await contract.directListings.createListing(listing);\n * const receipt = tx.receipt; // the transaction receipt\n * const id = tx.id; // the id of the newly created listing\n * ```\n * @twfeature DirectListings\n */\n createListing = /* @__PURE__ */buildTransactionFunction(async listing => {\n const parsedListing = await DirectListingInputParamsSchema.parseAsync(listing);\n await handleTokenApproval(this.contractWrapper, this.getAddress(), parsedListing.assetContractAddress, parsedListing.tokenId, await this.contractWrapper.getSignerAddress());\n const normalizedPricePerToken = await normalizePriceValue(this.contractWrapper.getProvider(), parsedListing.pricePerToken, parsedListing.currencyContractAddress);\n const block = await this.contractWrapper.getProvider().getBlock(\"latest\");\n const blockTime = block.timestamp;\n if (parsedListing.startTimestamp.lt(blockTime)) {\n parsedListing.startTimestamp = BigNumber.from(blockTime);\n }\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"createListing\",\n args: [{\n assetContract: parsedListing.assetContractAddress,\n tokenId: parsedListing.tokenId,\n quantity: parsedListing.quantity,\n currency: cleanCurrencyAddress(parsedListing.currencyContractAddress),\n pricePerToken: normalizedPricePerToken,\n startTimestamp: parsedListing.startTimestamp,\n endTimestamp: parsedListing.endTimestamp,\n reserved: parsedListing.isReservedListing\n }],\n parse: receipt => {\n const event = this.contractWrapper.parseLogs(\"NewListing\", receipt?.logs);\n return {\n id: event[0].args.listingId,\n receipt\n };\n }\n });\n });\n\n /**\n * Create a batch of new listings\n *\n * @remarks Create a batch of new listings on the marketplace\n *\n * @example\n * ```javascript\n * const listings = [...];\n * const tx = await contract.directListings.createListingsBatch(listings);\n * ```\n */\n createListingsBatch = /* @__PURE__ */buildTransactionFunction(async listings => {\n const data = (await Promise.all(listings.map(listing => this.createListing.prepare(listing)))).map(tx => tx.encode());\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"multicall\",\n args: [data],\n parse: receipt => {\n const events = this.contractWrapper.parseLogs(\"NewListing\", receipt?.logs);\n return events.map(event => {\n return {\n id: event.args.listingId,\n receipt\n };\n });\n }\n });\n });\n\n /**\n * Update a direct listing\n *\n * @param listing - the new listing information\n *\n * @example\n * ```javascript\n * // Data of the listing you want to update\n *\n * const listingId = 0; // ID of the listing you want to update\n *\n * const listing = {\n * // address of the contract the asset you want to list is on\n * assetContractAddress: \"0x...\", // should be same as original listing\n * // token ID of the asset you want to list\n * tokenId: \"0\", // should be same as original listing\n * // how many of the asset you want to list\n * quantity: 1,\n * // address of the currency contract that will be used to pay for the listing\n * currencyContractAddress: NATIVE_TOKEN_ADDRESS,\n * // The price to pay per unit of NFTs listed.\n * pricePerToken: 1.5,\n * // when should the listing open up for offers\n * startTimestamp: new Date(Date.now()), // can't change this if listing already active\n * // how long the listing will be open for\n * endTimestamp: new Date(Date.now() + 5 * 24 * 60 * 60 * 1000),\n * // Whether the listing is reserved for a specific set of buyers.\n * isReservedListing: false\n * }\n *\n * const tx = await contract.directListings.updateListing(listingId, listing);\n * const receipt = tx.receipt; // the transaction receipt\n * const id = tx.id; // the id of the newly created listing\n * ```\n * @twfeature DirectListings\n */\n updateListing = /* @__PURE__ */buildTransactionFunction(async (listingId, listing) => {\n const parsedListing = await DirectListingInputParamsSchema.parseAsync(listing);\n await handleTokenApproval(this.contractWrapper, this.getAddress(), parsedListing.assetContractAddress, parsedListing.tokenId, await this.contractWrapper.getSignerAddress());\n const normalizedPricePerToken = await normalizePriceValue(this.contractWrapper.getProvider(), parsedListing.pricePerToken, parsedListing.currencyContractAddress);\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"updateListing\",\n args: [listingId, {\n assetContract: parsedListing.assetContractAddress,\n tokenId: parsedListing.tokenId,\n quantity: parsedListing.quantity,\n currency: cleanCurrencyAddress(parsedListing.currencyContractAddress),\n pricePerToken: normalizedPricePerToken,\n startTimestamp: parsedListing.startTimestamp,\n endTimestamp: parsedListing.endTimestamp,\n reserved: parsedListing.isReservedListing\n }],\n parse: receipt => {\n const event = this.contractWrapper.parseLogs(\"UpdatedListing\", receipt?.logs);\n return {\n id: event[0].args.listingId,\n receipt\n };\n }\n });\n });\n\n /**\n * Cancel Direct Listing\n *\n * @remarks Cancel a direct listing on the marketplace\n *\n * @example\n * ```javascript\n * // The listing ID of the direct listing you want to cancel\n * const listingId = 0;\n *\n * await contract.directListings.cancelListing(listingId);\n * ```\n * @twfeature DirectListings\n */\n cancelListing = /* @__PURE__ */buildTransactionFunction(async listingId => {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"cancelListing\",\n args: [listingId]\n });\n });\n\n /**\n * Buy direct listing for a specific wallet\n *\n * @remarks Buy from a specific direct listing from the marketplace.\n *\n * @example\n * ```javascript\n * // The ID of the listing you want to buy from\n * const listingId = 0;\n * // Quantity of the asset you want to buy\n * const quantityDesired = 1;\n *\n * await contract.directListings.buyFromListing(listingId, quantityDesired, \"{{wallet_address}}\");\n * ```\n *\n * @param listingId - The listing id to buy\n * @param quantityDesired - the quantity to buy\n * @param receiver - optional receiver of the bought listing if different from the connected wallet\n * @twfeature DirectListings\n */\n buyFromListing = /* @__PURE__ */buildTransactionFunction(async (listingId, quantityDesired, receiver) => {\n if (receiver) {\n receiver = await resolveAddress(receiver);\n }\n const listing = await this.validateListing(BigNumber.from(listingId));\n const {\n valid,\n error\n } = await this.isStillValidListing(listing, quantityDesired);\n if (!valid) {\n throw new Error(`Listing ${listingId} is no longer valid. ${error}`);\n }\n const buyFor = receiver ? receiver : await this.contractWrapper.getSignerAddress();\n const quantity = BigNumber.from(quantityDesired);\n const value = BigNumber.from(listing.pricePerToken).mul(quantity);\n const overrides = (await this.contractWrapper.getCallOverrides()) || {};\n await setErc20Allowance(this.contractWrapper, value, listing.currencyContractAddress, overrides);\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"buyFromListing\",\n args: [listingId, buyFor, quantity, listing.currencyContractAddress, value],\n overrides\n });\n });\n\n /**\n * Approve buyer for a reserved direct listing\n *\n * @remarks Approve a buyer to buy from a reserved listing.\n *\n * @example\n * ```javascript\n * // The listing ID of the direct listing you want to approve buyer for\n * const listingId = \"0\";\n *\n * await contract.directListings.approveBuyerForReservedListing(listingId, \"{{wallet_address}}\");\n * ```\n *\n * @param listingId - The listing id to buy\n * @param buyer - Address of buyer being approved\n * @twfeature DirectListings\n */\n approveBuyerForReservedListing = /* @__PURE__ */buildTransactionFunction(async (listingId, buyer) => {\n const isApproved = await this.isBuyerApprovedForListing(listingId, buyer);\n if (!isApproved) {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"approveBuyerForListing\",\n args: [listingId, buyer, true]\n });\n } else {\n throw new Error(`Buyer ${buyer} already approved for listing ${listingId}.`);\n }\n });\n\n /**\n * Revoke approval of a buyer for a reserved direct listing\n *\n * @example\n * ```javascript\n * // The listing ID of the direct listing you want to approve buyer for\n * const listingId = \"0\";\n *\n * await contract.directListings.revokeBuyerApprovalForReservedListing(listingId, \"{{wallet_address}}\");\n * ```\n *\n * @param listingId - The listing id to buy\n * @param buyer - Address of buyer being approved\n */\n revokeBuyerApprovalForReservedListing = /* @__PURE__ */buildTransactionFunction(async (listingId, buyer) => {\n const isApproved = await this.isBuyerApprovedForListing(listingId, buyer);\n if (isApproved) {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"approveBuyerForListing\",\n args: [listingId, buyer, false]\n });\n } else {\n throw new Error(`Buyer ${buyer} not approved for listing ${listingId}.`);\n }\n });\n\n /**\n * Approve a currency for a direct listing\n *\n *\n * @example\n * ```javascript\n * // The listing ID of the direct listing you want to approve currency for\n * const listingId = \"0\";\n *\n * await contract.directListings.approveCurrencyForListing(listingId, currencyContractAddress, pricePerTokenInCurrency);\n * ```\n *\n * @param listingId - The listing id to buy\n * @param currencyContractAddress - Address of currency being approved\n * @param pricePerTokenInCurrency - Price per token in the currency\n * @twfeature DirectListings\n */\n approveCurrencyForListing = /* @__PURE__ */buildTransactionFunction(async (listingId, currencyContractAddress, pricePerTokenInCurrency) => {\n const listing = await this.validateListing(BigNumber.from(listingId));\n const resolvedCurrencyAddress = await resolveAddress(currencyContractAddress);\n if (resolvedCurrencyAddress === listing.currencyContractAddress) {\n invariant(pricePerTokenInCurrency === listing.pricePerToken, \"Approving listing currency with a different price.\");\n }\n const currencyPrice = await this.contractWrapper.read(\"currencyPriceForListing\", [listingId, resolvedCurrencyAddress]);\n invariant(pricePerTokenInCurrency === currencyPrice, \"Currency already approved with this price.\");\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"approveCurrencyForListing\",\n args: [listingId, resolvedCurrencyAddress, pricePerTokenInCurrency]\n });\n });\n\n /**\n * Revoke approval of a currency for a direct listing\n *\n *\n * @example\n * ```javascript\n * // The listing ID of the direct listing you want to revoke currency for\n * const listingId = \"0\";\n *\n * await contract.directListings.revokeCurrencyApprovalForListing(listingId, currencyContractAddress);\n * ```\n *\n * @param listingId - The listing id to buy\n * @param currencyContractAddress - Address of currency\n * @twfeature DirectListings\n */\n revokeCurrencyApprovalForListing = /* @__PURE__ */buildTransactionFunction(async (listingId, currencyContractAddress) => {\n const listing = await this.validateListing(BigNumber.from(listingId));\n const resolvedCurrencyAddress = await resolveAddress(currencyContractAddress);\n if (resolvedCurrencyAddress === listing.currencyContractAddress) {\n throw new Error(`Can't revoke approval for main listing currency.`);\n }\n const currencyPrice = await this.contractWrapper.read(\"currencyPriceForListing\", [listingId, resolvedCurrencyAddress]);\n invariant(!currencyPrice.isZero(), \"Currency not approved.\");\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"approveCurrencyForListing\",\n args: [listingId, resolvedCurrencyAddress, BigNumber.from(0)]\n });\n });\n\n /** ******************************\n * PRIVATE FUNCTIONS\n *******************************/\n\n /**\n * Throws error if listing could not be found\n *\n * @param listingId - Listing to check for\n */\n async validateListing(listingId) {\n try {\n return await this.getListing(listingId);\n } catch (err) {\n console.error(`Error getting the listing with id ${listingId}`);\n throw err;\n }\n }\n\n /**\n * Helper method maps the auction listing to the direct listing interface.\n *\n * @internal\n * @param listing - The listing to map, as returned from the contract.\n * @returns The mapped interface.\n */\n async mapListing(listing) {\n let status = Status.UNSET;\n const block = await this.contractWrapper.getProvider().getBlock(\"latest\");\n const blockTime = block.timestamp;\n switch (listing.status) {\n case 1:\n status = BigNumber.from(listing.startTimestamp).gt(blockTime) ? Status.Created : BigNumber.from(listing.endTimestamp).lt(blockTime) ? Status.Expired : Status.Active;\n break;\n case 2:\n status = Status.Completed;\n break;\n case 3:\n status = Status.Cancelled;\n break;\n }\n return {\n assetContractAddress: listing.assetContract,\n currencyContractAddress: listing.currency,\n pricePerToken: listing.pricePerToken.toString(),\n currencyValuePerToken: await fetchCurrencyValue(this.contractWrapper.getProvider(), listing.currency, listing.pricePerToken),\n id: listing.listingId.toString(),\n tokenId: listing.tokenId.toString(),\n quantity: listing.quantity.toString(),\n startTimeInSeconds: BigNumber.from(listing.startTimestamp).toNumber(),\n asset: await fetchTokenMetadataForContract(listing.assetContract, this.contractWrapper.getProvider(), listing.tokenId, this.storage),\n endTimeInSeconds: BigNumber.from(listing.endTimestamp).toNumber(),\n creatorAddress: listing.listingCreator,\n isReservedListing: listing.reserved,\n status: status\n };\n }\n\n /**\n * Use this method to check if a direct listing is still valid.\n *\n * Ways a direct listing can become invalid:\n * 1. The asset holder transferred the asset to another wallet\n * 2. The asset holder burned the asset\n * 3. The asset holder removed the approval on the marketplace\n *\n * @internal\n * @param listing - The listing to check.\n * @returns True if the listing is valid, false otherwise.\n */\n async isStillValidListing(listing, quantity) {\n const approved = await isTokenApprovedForTransfer(this.contractWrapper.getProvider(), this.getAddress(), listing.assetContractAddress, listing.tokenId, listing.creatorAddress);\n if (!approved) {\n return {\n valid: false,\n error: `Token '${listing.tokenId}' from contract '${listing.assetContractAddress}' is not approved for transfer`\n };\n }\n const provider = this.contractWrapper.getProvider();\n const ERC165Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC165.json')).default;\n const erc165 = new Contract(listing.assetContractAddress, ERC165Abi, provider);\n const isERC721 = await erc165.supportsInterface(InterfaceId_IERC721);\n const isERC1155 = await erc165.supportsInterface(InterfaceId_IERC1155);\n if (isERC721) {\n const ERC721Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC721.json')).default;\n const asset = new Contract(listing.assetContractAddress, ERC721Abi, provider);\n\n // Handle reverts in case of non-existent tokens\n let owner;\n try {\n owner = await asset.ownerOf(listing.tokenId);\n } catch (e) {}\n const valid = owner?.toLowerCase() === listing.creatorAddress.toLowerCase();\n return {\n valid,\n error: valid ? undefined : `Seller is not the owner of Token '${listing.tokenId}' from contract '${listing.assetContractAddress} anymore'`\n };\n } else if (isERC1155) {\n const ERC1155Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC1155.json')).default;\n const asset = new Contract(listing.assetContractAddress, ERC1155Abi, provider);\n const balance = await asset.balanceOf(listing.creatorAddress, listing.tokenId);\n const valid = balance.gte(quantity || listing.quantity);\n return {\n valid,\n error: valid ? undefined : `Seller does not have enough balance of Token '${listing.tokenId}' from contract '${listing.assetContractAddress} to fulfill the listing`\n };\n } else {\n return {\n valid: false,\n error: \"Contract does not implement ERC 1155 or ERC 721.\"\n };\n }\n }\n async applyFilter(listings, filter) {\n let rawListings = [...listings];\n if (filter) {\n if (filter.seller) {\n const resolvedSeller = await resolveAddress(filter.seller);\n rawListings = rawListings.filter(seller => seller.listingCreator.toString().toLowerCase() === resolvedSeller?.toString().toLowerCase());\n }\n if (filter.tokenContract) {\n const resolvedToken = await resolveAddress(filter.tokenContract);\n rawListings = rawListings.filter(tokenContract => tokenContract.assetContract.toString().toLowerCase() === resolvedToken?.toString().toLowerCase());\n }\n if (filter.tokenId !== undefined) {\n rawListings = rawListings.filter(tokenContract => tokenContract.tokenId.toString() === filter?.tokenId?.toString());\n }\n }\n return filter?.count && filter.count < rawListings.length ? rawListings.slice(0, filter.count) : rawListings;\n }\n}\n\n/**\n * @internal\n */\nconst EnglishAuctionInputParamsSchema = /* @__PURE__ */(() => z.object({\n /**\n * The address of the asset being auctioned.\n */\n assetContractAddress: AddressOrEnsSchema,\n /**\n * The ID of the token to auction.\n */\n tokenId: BigNumberishSchema,\n /**\n * The quantity of tokens to include in the listing.\n *\n * For ERC721s, this value should always be 1 (and will be forced internally regardless of what is passed here).\n */\n quantity: BigNumberishSchema.default(1),\n /**\n * The address of the currency to accept for the listing.\n */\n currencyContractAddress: AddressOrEnsSchema.default(NATIVE_TOKEN_ADDRESS),\n /**\n * The minimum price that a bid must be in order to be accepted.\n */\n minimumBidAmount: AmountSchema,\n /**\n * The buyout price of the auction.\n */\n buyoutBidAmount: AmountSchema,\n /**\n * This is a buffer e.g. x seconds.\n *\n * If a new winning bid is made less than x seconds before expirationTimestamp, the\n * expirationTimestamp is increased by x seconds.\n */\n timeBufferInSeconds: BigNumberishSchema.default(900),\n // 15 minutes by default\n\n /**\n * This is a buffer in basis points e.g. x%.\n *\n * To be considered as a new winning bid, a bid must be at least x% greater than\n * the current winning bid.\n */\n bidBufferBps: BigNumberishSchema.default(500),\n // 5% by default\n\n /**\n * The start time of the auction.\n */\n startTimestamp: RawDateSchema.default(new Date()),\n /**\n * The end time of the auction.\n */\n endTimestamp: EndDateSchema\n}))();\n\n/**\n * @public\n */\n\n/**\n * Handles auctions\n * @public\n */\nclass MarketplaceV3EnglishAuctions {\n featureName = FEATURE_ENGLISH_AUCTIONS.name;\n\n // utilities\n\n constructor(contractWrapper, storage) {\n this.contractWrapper = contractWrapper;\n this.storage = storage;\n this.events = new ContractEvents(this.contractWrapper);\n this.encoder = new ContractEncoder(this.contractWrapper);\n this.interceptor = new ContractInterceptor(this.contractWrapper);\n this.estimator = new GasCostEstimator(this.contractWrapper);\n }\n getAddress() {\n return this.contractWrapper.address;\n }\n\n /** ******************************\n * READ FUNCTIONS\n *******************************/\n\n /**\n * Get the total number of english auctions\n *\n * @returns Returns the total number of auctions created.\n * @public\n *\n * @example\n * ```javascript\n * const totalAuctions = await contract.englishAuctions.getTotalCount();\n * ```\n * @twfeature EnglishAuctions\n */\n async getTotalCount() {\n return await this.contractWrapper.read(\"totalAuctions\", []);\n }\n\n /**\n * Get all english auctions\n *\n * @example\n * ```javascript\n * const auctions = await contract.englishAuctions.getAll();\n * ```\n *\n * @param filter - optional filter parameters\n * @returns The Auction object array\n * @twfeature EnglishAuctions\n */\n async getAll(filter) {\n const totalAuctions = await this.getTotalCount();\n const start = BigNumber.from(filter?.start || 0).toNumber();\n const end = totalAuctions.toNumber();\n if (end === 0) {\n throw new Error(`No auctions exist on the contract.`);\n }\n let rawAuctions = [];\n const batches = await getAllInBatches(start, end, (startId, endId) => this.contractWrapper.read(\"getAllAuctions\", [startId, endId]));\n rawAuctions = batches.flat();\n const filteredAuctions = await this.applyFilter(rawAuctions, filter);\n return await Promise.all(filteredAuctions.map(auction => this.mapAuction(auction)));\n }\n\n /**\n * Get all valid english auctions\n *\n * @example\n * ```javascript\n * const auctions = await contract.englishAuctions.getAllValid();\n * ```\n *\n * @param filter - optional filter parameters\n * @returns The Auction object array\n * @twfeature EnglishAuctions\n */\n async getAllValid(filter) {\n const totalAuctions = await this.getTotalCount();\n const start = BigNumber.from(filter?.start || 0).toNumber();\n const end = totalAuctions.toNumber();\n if (end === 0) {\n throw new Error(`No auctions exist on the contract.`);\n }\n let rawAuctions = [];\n const batches = await getAllInBatches(start, end, (startId, endId) => this.contractWrapper.read(\"getAllValidAuctions\", [startId, endId]));\n rawAuctions = batches.flat();\n const filteredAuctions = await this.applyFilter(rawAuctions, filter);\n return await Promise.all(filteredAuctions.map(auction => this.mapAuction(auction)));\n }\n\n /**\n * Get a single english auction\n *\n * @example\n * ```javascript\n * const auctionId = 0;\n * const auction = await contract.englishAuctions.getAuction(auctionId);\n * ```\n *\n * @param auctionId - the auction Id\n * @returns The Auction object\n * @twfeature EnglishAuctions\n */\n async getAuction(auctionId) {\n const auction = await this.contractWrapper.read(\"getAuction\", [auctionId]);\n return await this.mapAuction(auction);\n }\n\n /**\n * Get winning bid of an english auction\n *\n * @remarks Get the current highest bid of an active auction.\n *\n * @example\n * ```javascript\n * // The ID of the auction\n * const auctionId = 0;\n * const winningBid = await contract.englishAuctions.getWinningBid(auctionId);\n * ```\n * @param auctionId - the auction Id\n * @twfeature EnglishAuctions\n */\n async getWinningBid(auctionId) {\n await this.validateAuction(BigNumber.from(auctionId));\n const bid = await this.contractWrapper.read(\"getWinningBid\", [auctionId]);\n if (bid._bidder === constants.AddressZero) {\n return undefined;\n }\n return await this.mapBid(auctionId.toString(), bid._bidder, bid._currency, bid._bidAmount.toString());\n }\n\n /**\n * Check if a bid is or will be a winning bid\n *\n * @example\n * ```javascript\n * const auctionId = 0;\n * const bidAmount = 100;\n * const isWinningBid = await contract.englishAuctions.isWinningBid(auctionId, bidAmount);\n * ```\n *\n * @param auctionId - Auction Id\n * @param bidAmount - Amount to bid\n * @returns true if the bid is or will be a winning bid\n * @twfeature EnglishAuctions\n */\n async isWinningBid(auctionId, bidAmount) {\n return await this.contractWrapper.read(\"isNewWinningBid\", [auctionId, bidAmount]);\n }\n\n /**\n * Get the winner for a specific english auction\n *\n * @remarks Get the winner of the auction after an auction ends.\n *\n * @example\n * ```javascript\n * // The auction ID of a closed english auction\n * const auctionId = 0;\n * const auctionWinner = await contract.englishAuctions.getWinner(auctionId);\n * ```\n * @param auctionId - the auction Id\n * @returns The address of the auction winner\n * @twfeature EnglishAuctions\n */\n async getWinner(auctionId) {\n const auction = await this.validateAuction(BigNumber.from(auctionId));\n const bid = await this.contractWrapper.read(\"getWinningBid\", [auctionId]);\n const now = BigNumber.from(Math.floor(Date.now() / 1000));\n const endTime = BigNumber.from(auction.endTimeInSeconds);\n\n // if we have a winner in the map and the current time is past the endtime of the auction return the address of the winner\n if (now.gt(endTime) && bid._bidder !== constants.AddressZero) {\n return bid._bidder;\n }\n // otherwise fall back to query filter things\n\n // TODO this should be via indexer or direct contract call\n const contractEvent = new ContractEvents(this.contractWrapper);\n const closedAuctions = await contractEvent.getEvents(\"AuctionClosed\");\n const closed = closedAuctions.find(a => a.data.auctionId.eq(BigNumber.from(auctionId)));\n if (!closed) {\n throw new Error(`Could not find auction with ID ${auctionId} in closed auctions`);\n }\n return closed.data.winningBidder;\n }\n\n /** ******************************\n * WRITE FUNCTIONS\n *******************************/\n\n /**\n * Create an english auction\n *\n * @remarks Create a new auction where people can bid on an asset.\n *\n * @example\n * ```javascript\n * // Data of the auction you want to create\n * const auction = {\n * // address of the contract of the asset you want to auction\n * assetContractAddress: \"0x...\",\n * // token ID of the asset you want to auction\n * tokenId: \"0\",\n * // how many of the asset you want to auction\n * quantity: 1,\n * // address of the currency contract that will be used to pay for the auctioned tokens\n * currencyContractAddress: NATIVE_TOKEN_ADDRESS,\n * // the minimum bid that will be accepted for the token\n * minimumBidAmount: \"1.5\",\n * // how much people would have to bid to instantly buy the asset\n * buyoutBidAmount: \"10\",\n * // If a bid is made less than these many seconds before expiration, the expiration time is increased by this.\n * timeBufferInSeconds: \"900\", // 15 minutes by default\n * // A bid must be at least this much bps greater than the current winning bid\n * bidBufferBps: \"500\", // 5% by default\n * // when should the auction open up for bidding\n * startTimestamp: new Date(Date.now()),\n * // end time of auction\n * endTimestamp: new Date(Date.now() + 5 * 24 * 60 * 60 * 1000),\n * }\n *\n * const tx = await contract.englishAuctions.createAuction(auction);\n * const receipt = tx.receipt; // the transaction receipt\n * const id = tx.id; // the id of the newly created auction\n * ```\n * @param auction - the auction data\n * @returns The transaction hash and the auction id\n * @twfeature EnglishAuctions\n */\n createAuction = /* @__PURE__ */buildTransactionFunction(async auction => {\n const parsedAuction = EnglishAuctionInputParamsSchema.parse(auction);\n await handleTokenApproval(this.contractWrapper, this.getAddress(), parsedAuction.assetContractAddress, parsedAuction.tokenId, await this.contractWrapper.getSignerAddress());\n const normalizedBuyoutAmount = await normalizePriceValue(this.contractWrapper.getProvider(), parsedAuction.buyoutBidAmount, parsedAuction.currencyContractAddress);\n const normalizedMinBidAmount = await normalizePriceValue(this.contractWrapper.getProvider(), parsedAuction.minimumBidAmount, parsedAuction.currencyContractAddress);\n const block = await this.contractWrapper.getProvider().getBlock(\"latest\");\n const blockTime = block.timestamp;\n if (parsedAuction.startTimestamp.lt(blockTime)) {\n parsedAuction.startTimestamp = BigNumber.from(blockTime);\n }\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"createAuction\",\n args: [{\n assetContract: parsedAuction.assetContractAddress,\n tokenId: parsedAuction.tokenId,\n quantity: parsedAuction.quantity,\n currency: cleanCurrencyAddress(parsedAuction.currencyContractAddress),\n minimumBidAmount: normalizedMinBidAmount,\n buyoutBidAmount: normalizedBuyoutAmount,\n timeBufferInSeconds: parsedAuction.timeBufferInSeconds,\n bidBufferBps: parsedAuction.bidBufferBps,\n startTimestamp: parsedAuction.startTimestamp,\n endTimestamp: parsedAuction.endTimestamp\n }],\n parse: receipt => {\n const event = this.contractWrapper.parseLogs(\"NewAuction\", receipt.logs)[0];\n return {\n id: event.args.auctionId,\n receipt\n };\n }\n });\n });\n\n /**\n * Create a batch of new auctions\n *\n * @remarks Create a batch of new auctions on the marketplace\n *\n * @example\n * ```javascript\n * const auctions = [...];\n * const tx = await contract.englishAuctions.createAuctionsBatch(auctions);\n * ```\n */\n createAuctionsBatch = /* @__PURE__ */buildTransactionFunction(async listings => {\n const data = (await Promise.all(listings.map(listing => this.createAuction.prepare(listing)))).map(tx => tx.encode());\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"multicall\",\n args: [data],\n parse: receipt => {\n const events = this.contractWrapper.parseLogs(\"NewAuction\", receipt?.logs);\n return events.map(event => {\n return {\n id: event.args.auctionId,\n receipt\n };\n });\n }\n });\n });\n\n /**\n * Buyout an english auction\n *\n * @remarks Buy a specific auction from the marketplace.\n *\n * @example\n * ```javascript\n * // The auction ID you want to buy\n * const auctionId = 0;\n *\n * await contract.englishAuctions.buyoutAuction(auctionId);\n * ```\n * @param auctionId - the auction id\n * @returns The transaction result\n * @twfeature EnglishAuctions\n */\n buyoutAuction = /* @__PURE__ */buildTransactionFunction(async auctionId => {\n const auction = await this.validateAuction(BigNumber.from(auctionId));\n const currencyMetadata = await fetchCurrencyMetadata(this.contractWrapper.getProvider(), auction.currencyContractAddress);\n return this.makeBid.prepare(auctionId, utils.formatUnits(auction.buyoutBidAmount, currencyMetadata.decimals));\n });\n\n /**\n * Bid on an english auction\n *\n * @remarks Make a bid on an auction\n *\n * @example\n * ```javascript\n * // The auction ID of the asset you want to bid on\n * const auctionId = 0;\n * // The total amount you are willing to bid for auctioned tokens\n * const bidAmount = 1;\n *\n * await contract.englishAuctions.makeBid(auctionId, bidAmount);\n * ```\n * @param auctionId - the auction id\n * @param bidAmount - the amount you are willing to bid\n * @returns The transaction result\n * @twfeature EnglishAuctions\n */\n makeBid = /* @__PURE__ */buildTransactionFunction(async (auctionId, bidAmount) => {\n const auction = await this.validateAuction(BigNumber.from(auctionId));\n const normalizedBidAmount = await normalizePriceValue(this.contractWrapper.getProvider(), bidAmount, auction.currencyContractAddress);\n if (normalizedBidAmount.eq(BigNumber.from(0))) {\n throw new Error(\"Cannot make a bid with 0 value\");\n }\n if (BigNumber.from(auction.buyoutBidAmount).gt(0) && normalizedBidAmount.gt(auction.buyoutBidAmount)) {\n throw new Error(\"Bid amount must be less than or equal to buyoutBidAmount\");\n }\n const winningBid = await this.getWinningBid(auctionId);\n if (winningBid) {\n const isWinnner = await this.isWinningBid(auctionId, normalizedBidAmount);\n invariant(isWinnner, \"Bid price is too low based on the current winning bid and the bid buffer\");\n } else {\n const tokenPrice = normalizedBidAmount;\n const minimumBidAmount = BigNumber.from(auction.minimumBidAmount);\n invariant(tokenPrice.gte(minimumBidAmount), \"Bid price is too low based on minimum bid amount\");\n }\n const overrides = (await this.contractWrapper.getCallOverrides()) || {};\n await setErc20Allowance(this.contractWrapper, normalizedBidAmount, auction.currencyContractAddress, overrides);\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"bidInAuction\",\n args: [auctionId, normalizedBidAmount],\n overrides\n });\n });\n\n /**\n * Cancel an english auction\n *\n * @remarks Cancel an auction on the marketplace\n *\n * @example\n * ```javascript\n * // The ID of the auction you want to cancel\n * const auctionId = \"0\";\n *\n * await contract.englishAuctions.cancelAuction(auctionId);\n * ```\n * @param auctionId - the auction id\n * @returns The transaction result\n * @twfeature EnglishAuctions\n */\n cancelAuction = /* @__PURE__ */buildTransactionFunction(async auctionId => {\n const winningBid = await this.getWinningBid(auctionId);\n if (winningBid) {\n throw new Error(`Bids already made.`);\n }\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"cancelAuction\",\n args: [auctionId]\n });\n });\n\n /**\n * Close the english auction for the bidder\n *\n * @remarks Closes the Auction and executes the sale for the buyer.\n *\n * @example\n * ```javascript\n * // The ID of the auction you want to close\n * const auction = \"0\";\n * await contract.englishAuctions.closeAuctionForBidder(auctionId);\n * ```\n *\n * @param auctionId - the auction id to close\n * @param closeFor - optionally pass the winning bid offeror address to close the auction on their behalf\n * @returns The transaction result\n * @twfeature EnglishAuctions\n */\n closeAuctionForBidder = /* @__PURE__ */buildTransactionFunction(async (auctionId, closeFor) => {\n if (!closeFor) {\n closeFor = await this.contractWrapper.getSignerAddress();\n }\n const auction = await this.validateAuction(BigNumber.from(auctionId));\n try {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"collectAuctionTokens\",\n args: [BigNumber.from(auctionId)]\n });\n } catch (err) {\n if (err.message.includes(\"Marketplace: auction still active.\")) {\n throw new AuctionHasNotEndedError(auctionId.toString(), auction.endTimeInSeconds.toString());\n } else {\n throw err;\n }\n }\n });\n\n /**\n * Close the english auction for the seller\n *\n * @remarks Closes the Auction and executes the sale for the seller.\n *\n * @example\n * ```javascript\n * // The ID of the auction you want to close\n * const auctionId = \"0\";\n * await contract.englishAuctions.closeAuctionForSeller(auctionId);\n * ```\n *\n * @param auctionId - the auction id to close\n * @returns The transaction result\n * @twfeature EnglishAuctions\n */\n closeAuctionForSeller = /* @__PURE__ */buildTransactionFunction(async auctionId => {\n const auction = await this.validateAuction(BigNumber.from(auctionId));\n try {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"collectAuctionPayout\",\n args: [BigNumber.from(auctionId)]\n });\n } catch (err) {\n if (err.message.includes(\"Marketplace: auction still active.\")) {\n throw new AuctionHasNotEndedError(auctionId.toString(), auction.endTimeInSeconds.toString());\n } else {\n throw err;\n }\n }\n });\n\n /**\n * Close the english auction for both the seller and the bidder\n *\n * @remarks Closes the Auction and executes the sale for both parties.\n *\n * @example\n * ```javascript\n * // The ID of the auction you want to close\n * const auction = \"0\";\n * await contract.englishAuctions.executeSale(auctionId);\n * ```\n *\n * @param auctionId - the auction to close\n * @returns The transaction result\n * @twfeature EnglishAuctions\n */\n executeSale = /* @__PURE__ */buildTransactionFunction(async auctionId => {\n const auction = await this.validateAuction(BigNumber.from(auctionId));\n try {\n const winningBid = await this.getWinningBid(auctionId);\n invariant(winningBid, \"No winning bid found\");\n const closeForSeller = this.encoder.encode(\"collectAuctionPayout\", [auctionId]);\n const closeForBuyer = this.encoder.encode(\"collectAuctionTokens\", [auctionId]);\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"multicall\",\n args: [[closeForSeller, closeForBuyer]]\n });\n } catch (err) {\n if (err.message.includes(\"Marketplace: auction still active.\")) {\n throw new AuctionHasNotEndedError(auctionId.toString(), auction.endTimeInSeconds.toString());\n } else {\n throw err;\n }\n }\n });\n\n /**\n * Get the buffer for an english auction\n *\n * @example\n * ```javascript\n * // The ID of the auction you want to get the buffer for\n * const auctionId = \"0\";\n * const buffer = await contract.englishAuctions.getBidBufferBps(auctionId);\n * ```\n *\n * @param auctionId - id of the auction\n * @returns The buffer in basis points\n * @twfeature EnglishAuctions\n */\n async getBidBufferBps(auctionId) {\n return (await this.getAuction(auctionId)).bidBufferBps;\n }\n\n /**\n * Get the minimum next bid for an english auction\n *\n * @example\n * ```javascript\n * // The ID of the auction you want to get the minimum next bid for\n * const auctionId = \"0\";\n * const minimumNextBid = await contract.englishAuctions.getMinimumNextBid(auctionId);\n * ```\n *\n * @returns The minimum bid a user can place to outbid the previous highest bid\n * @param auctionId - id of the auction\n * @twfeature EnglishAuctions\n */\n async getMinimumNextBid(auctionId) {\n // we can fetch all of these at the same time using promise.all\n const [currentBidBufferBps, winningBid, auction] = await Promise.all([this.getBidBufferBps(auctionId), this.getWinningBid(auctionId), this.validateAuction(BigNumber.from(auctionId))]);\n const currentBidOrReservePrice = winningBid ?\n // if there is a winning bid use the value of it\n BigNumber.from(winningBid.bidAmount) :\n // if there is no winning bid use the reserve price\n BigNumber.from(auction.minimumBidAmount);\n const minimumNextBid = currentBidOrReservePrice.add(\n // the addition of the current bid and the buffer\n // (have to divide by 10000 to get the fraction of the buffer (since it's in basis points))\n currentBidOrReservePrice.mul(currentBidBufferBps).div(10000));\n\n // it's more useful to return a currency value here\n return fetchCurrencyValue(this.contractWrapper.getProvider(), auction.currencyContractAddress, minimumNextBid);\n }\n\n /** ******************************\n * PRIVATE FUNCTIONS\n *******************************/\n\n /**\n * Throws error if auction could not be found\n *\n * @param auctionId - Auction to check for\n */\n async validateAuction(auctionId) {\n try {\n return await this.getAuction(auctionId);\n } catch (err) {\n console.error(`Error getting the auction with id ${auctionId}`);\n throw err;\n }\n }\n\n /**\n * Helper method maps the auction to the auction interface.\n *\n * @internal\n * @param auction - The auction to map, as returned from the contract.\n * @returns The mapped interface.\n */\n async mapAuction(auction) {\n let status = Status.UNSET;\n const block = await this.contractWrapper.getProvider().getBlock(\"latest\");\n const blockTime = block.timestamp;\n switch (auction.status) {\n case 1:\n status = BigNumber.from(auction.startTimestamp).gt(blockTime) ? Status.Created : BigNumber.from(auction.endTimestamp).lt(blockTime) ? Status.Expired : Status.Active;\n break;\n case 2:\n status = Status.Completed;\n break;\n case 3:\n status = Status.Cancelled;\n break;\n }\n return {\n id: auction.auctionId.toString(),\n creatorAddress: auction.auctionCreator,\n assetContractAddress: auction.assetContract,\n tokenId: auction.tokenId.toString(),\n quantity: auction.quantity.toString(),\n currencyContractAddress: auction.currency,\n minimumBidAmount: auction.minimumBidAmount.toString(),\n minimumBidCurrencyValue: await fetchCurrencyValue(this.contractWrapper.getProvider(), auction.currency, auction.minimumBidAmount),\n buyoutBidAmount: auction.buyoutBidAmount.toString(),\n buyoutCurrencyValue: await fetchCurrencyValue(this.contractWrapper.getProvider(), auction.currency, auction.buyoutBidAmount),\n timeBufferInSeconds: BigNumber.from(auction.timeBufferInSeconds).toNumber(),\n bidBufferBps: BigNumber.from(auction.bidBufferBps).toNumber(),\n startTimeInSeconds: BigNumber.from(auction.startTimestamp).toNumber(),\n endTimeInSeconds: BigNumber.from(auction.endTimestamp).toNumber(),\n asset: await fetchTokenMetadataForContract(auction.assetContract, this.contractWrapper.getProvider(), auction.tokenId, this.storage),\n status: status\n };\n }\n\n /**\n * Maps an auction-bid to the strict interface\n *\n * @internal\n * @param bid - The bid to map, as returned from the contract.\n * @returns A `Bid` object\n */\n async mapBid(auctionId, bidderAddress, currencyContractAddress, bidAmount) {\n const resolvedBidderAddress = await resolveAddress(bidderAddress);\n const resolvedCurrencyAddress = await resolveAddress(currencyContractAddress);\n return {\n auctionId,\n bidderAddress: resolvedBidderAddress,\n currencyContractAddress: resolvedCurrencyAddress,\n bidAmount,\n bidAmountCurrencyValue: await fetchCurrencyValue(this.contractWrapper.getProvider(), resolvedCurrencyAddress, bidAmount)\n };\n }\n async applyFilter(auctions, filter) {\n let rawAuctions = [...auctions];\n if (filter) {\n if (filter.seller) {\n const resolvedSeller = await resolveAddress(filter.seller);\n rawAuctions = rawAuctions.filter(seller => seller.auctionCreator.toString().toLowerCase() === resolvedSeller?.toString().toLowerCase());\n }\n if (filter.tokenContract) {\n const resolvedToken = await resolveAddress(filter.tokenContract);\n rawAuctions = rawAuctions.filter(tokenContract => tokenContract.assetContract.toString().toLowerCase() === resolvedToken?.toString().toLowerCase());\n }\n if (filter.tokenId !== undefined) {\n rawAuctions = rawAuctions.filter(tokenContract => tokenContract.tokenId.toString() === filter?.tokenId?.toString());\n }\n }\n return filter?.count && filter.count < rawAuctions.length ? rawAuctions.slice(0, filter.count) : rawAuctions;\n }\n}\n\n/**\n * @internal\n */\nconst OfferInputParamsSchema = /* @__PURE__ */(() => z.object({\n /**\n * The address of the asset being sought.\n */\n assetContractAddress: AddressOrEnsSchema,\n /**\n * The ID of the token.\n */\n tokenId: BigNumberishSchema,\n /**\n * The quantity of tokens to buy.\n *\n * For ERC721s, this value should always be 1 (and will be forced internally regardless of what is passed here).\n */\n quantity: BigNumberishSchema.default(1),\n /**\n * The address of the currency offered for the NFTs.\n */\n currencyContractAddress: AddressOrEnsSchema.default(NATIVE_TOKEN_ADDRESS),\n /**\n * The total offer amount for the NFTs.\n */\n totalPrice: AmountSchema,\n /**\n * The end time of the offer.\n */\n endTimestamp: EndDateSchema\n}))();\n\n/**\n * @public\n */\n\n/**\n * Handles marketplace offers\n * @public\n */\nclass MarketplaceV3Offers {\n featureName = FEATURE_OFFERS.name;\n\n // utilities\n\n constructor(contractWrapper, storage) {\n this.contractWrapper = contractWrapper;\n this.storage = storage;\n this.events = new ContractEvents(this.contractWrapper);\n this.encoder = new ContractEncoder(this.contractWrapper);\n this.interceptor = new ContractInterceptor(this.contractWrapper);\n this.estimator = new GasCostEstimator(this.contractWrapper);\n }\n getAddress() {\n return this.contractWrapper.address;\n }\n\n /** ******************************\n * READ FUNCTIONS\n *******************************/\n\n /**\n * Get the total number of offers\n *\n * @returns Returns the total number of offers created.\n * @public\n *\n * @example\n * ```javascript\n * const totalOffers = await contract.offers.getTotalCount();\n * ```\n * @twfeature Offers\n */\n async getTotalCount() {\n return await this.contractWrapper.read(\"totalOffers\", []);\n }\n\n /**\n * Get all offers\n *\n * @example\n * ```javascript\n * const offers = await contract.offers.getAll();\n * ```\n *\n * @param filter - optional filter parameters\n * @returns The Offer object array\n * @twfeature Offers\n */\n async getAll(filter) {\n const totalOffers = await this.getTotalCount();\n const start = BigNumber.from(filter?.start || 0).toNumber();\n const end = totalOffers.toNumber();\n if (end === 0) {\n throw new Error(`No offers exist on the contract.`);\n }\n let rawOffers = [];\n const batches = await getAllInBatches(start, end, (startId, endId) => this.contractWrapper.read(\"getAllOffers\", [startId, endId]));\n rawOffers = batches.flat();\n const filteredOffers = await this.applyFilter(rawOffers, filter);\n return await Promise.all(filteredOffers.map(offer => this.mapOffer(offer)));\n }\n\n /**\n * Get all valid offers\n *\n * @example\n * ```javascript\n * const offers = await contract.offers.getAllValid();\n * ```\n *\n * @param filter - optional filter parameters\n * @returns The Offer object array\n * @twfeature Offers\n */\n async getAllValid(filter) {\n const totalOffers = await this.getTotalCount();\n const start = BigNumber.from(filter?.start || 0).toNumber();\n const end = totalOffers.toNumber();\n if (end === 0) {\n throw new Error(`No offers exist on the contract.`);\n }\n let rawOffers = [];\n const batches = await getAllInBatches(start, end, (startId, endId) => this.contractWrapper.read(\"getAllValidOffers\", [startId, endId]));\n rawOffers = batches.flat();\n const filteredOffers = await this.applyFilter(rawOffers, filter);\n return await Promise.all(filteredOffers.map(offer => this.mapOffer(offer)));\n }\n\n /**\n * Get a single offer\n *\n * @example\n * ```javascript\n * const offerId = 0;\n * const offer = await contract.offers.getOffer(offerId);\n * ```\n *\n * @param offerId - the listing id\n * @returns The Direct listing object\n * @twfeature Offers\n */\n async getOffer(offerId) {\n const offer = await this.contractWrapper.read(\"getOffer\", [offerId]);\n return await this.mapOffer(offer);\n }\n\n /** ******************************\n * WRITE FUNCTIONS\n *******************************/\n\n /**\n * Make an offer\n *\n * @remarks Make an offer on the marketplace for an asset.\n *\n * @example\n * ```javascript\n * // Data of the offer you want to make\n * const offer = {\n * // address of the contract the asset you want to make an offer for\n * assetContractAddress: \"0x...\",\n * // token ID of the asset you want to buy\n * tokenId: \"0\",\n * // how many of the asset you want to buy\n * quantity: 1,\n * // address of the currency contract that you offer to pay in\n * currencyContractAddress: NATIVE_TOKEN_ADDRESS,\n * // Total price you offer to pay for the mentioned token(s)\n * totalPrice: \"1.5\",\n * // Offer valid until\n * endTimestamp: new Date(),\n * }\n *\n * const tx = await contract.offers.makeOffer(offer);\n * const receipt = tx.receipt; // the transaction receipt\n * const id = tx.id; // the id of the newly created offer\n * ```\n * @param offer - the offer data\n * @returns The transaction receipt and the id of the newly created offer\n * @twfeature Offers\n */\n makeOffer = /* @__PURE__ */buildTransactionFunction(async offer => {\n const parsedOffer = await OfferInputParamsSchema.parseAsync(offer);\n const chainId = await this.contractWrapper.getChainID();\n const currency = isNativeToken(parsedOffer.currencyContractAddress) ? NATIVE_TOKENS[chainId].wrapped.address : parsedOffer.currencyContractAddress;\n const normalizedTotalPrice = await normalizePriceValue(this.contractWrapper.getProvider(), parsedOffer.totalPrice, currency);\n const overrides = await this.contractWrapper.getCallOverrides();\n await setErc20Allowance(this.contractWrapper, normalizedTotalPrice, currency, overrides);\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"makeOffer\",\n args: [{\n assetContract: parsedOffer.assetContractAddress,\n tokenId: parsedOffer.tokenId,\n quantity: parsedOffer.quantity,\n currency: currency,\n totalPrice: normalizedTotalPrice,\n expirationTimestamp: parsedOffer.endTimestamp\n }],\n parse: receipt => {\n const event = this.contractWrapper.parseLogs(\"NewOffer\", receipt?.logs);\n return {\n id: event[0].args.offerId,\n receipt\n };\n }\n });\n });\n\n /**\n * Cancel an offer\n *\n * @remarks Cancel an offer on the marketplace\n *\n * @example\n * ```javascript\n * // The ID of the offer you want to cancel\n * const offerId = \"0\";\n *\n * await contract.offers.cancelOffer(offerId);\n * ```\n * @param offerId - the offer id\n * @returns The transaction receipt\n * @twfeature Offers\n */\n cancelOffer = /* @__PURE__ */buildTransactionFunction(async offerId => {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"cancelOffer\",\n args: [offerId]\n });\n });\n\n /**\n * Accept an offer\n *\n * @example\n * ```javascript\n * // The ID of the offer you want to accept\n * const offerId = 0;\n *\n * await contract.offers.acceptOffer(offerId);\n * ```\n *\n * @param offerId - The offer id\n * @returns The transaction receipt\n * @twfeature Offers\n */\n acceptOffer = /* @__PURE__ */buildTransactionFunction(async offerId => {\n const offer = await this.validateOffer(BigNumber.from(offerId));\n const {\n valid,\n error\n } = await this.isStillValidOffer(offer);\n if (!valid) {\n throw new Error(`Offer ${offerId} is no longer valid. ${error}`);\n }\n const overrides = (await this.contractWrapper.getCallOverrides()) || {};\n await handleTokenApproval(this.contractWrapper, this.getAddress(), offer.assetContractAddress, offer.tokenId, await this.contractWrapper.getSignerAddress());\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"acceptOffer\",\n args: [offerId],\n overrides\n });\n });\n\n /** ******************************\n * PRIVATE FUNCTIONS\n *******************************/\n\n /**\n * Throws error if offer could not be found\n *\n * @param offerId - offer to check for\n */\n async validateOffer(offerId) {\n try {\n return await this.getOffer(offerId);\n } catch (err) {\n console.error(`Error getting the offer with id ${offerId}`);\n throw err;\n }\n }\n\n /**\n * Helper method maps the offer to the offer interface.\n *\n * @internal\n * @param offer - The offer to map, as returned from the contract.\n * @returns The mapped interface.\n */\n async mapOffer(offer) {\n let status = Status.UNSET;\n const block = await this.contractWrapper.getProvider().getBlock(\"latest\");\n const blockTime = block.timestamp;\n switch (offer.status) {\n case 1:\n status = BigNumber.from(offer.expirationTimestamp).lt(blockTime) ? Status.Expired : Status.Active;\n break;\n case 2:\n status = Status.Completed;\n break;\n case 3:\n status = Status.Cancelled;\n break;\n }\n return {\n id: offer.offerId.toString(),\n offerorAddress: offer.offeror,\n assetContractAddress: offer.assetContract,\n currencyContractAddress: offer.currency,\n tokenId: offer.tokenId.toString(),\n quantity: offer.quantity.toString(),\n totalPrice: offer.totalPrice.toString(),\n currencyValue: await fetchCurrencyValue(this.contractWrapper.getProvider(), offer.currency, offer.totalPrice),\n asset: await fetchTokenMetadataForContract(offer.assetContract, this.contractWrapper.getProvider(), offer.tokenId, this.storage),\n endTimeInSeconds: BigNumber.from(offer.expirationTimestamp).toNumber(),\n status: status\n };\n }\n\n /**\n * Use this method to check if an offer is still valid.\n *\n * Ways an offer can become invalid:\n * 1. The offer has expired\n * 2. The offeror doesn't have enough balance of currency tokens\n * 3. The offeror removed the approval of currency tokens on the marketplace\n *\n * @internal\n * @param offer - The offer to check.\n * @returns True if the offer is valid, false otherwise.\n */\n async isStillValidOffer(offer) {\n const now = BigNumber.from(Math.floor(Date.now() / 1000));\n if (now.gt(offer.endTimeInSeconds)) {\n return {\n valid: false,\n error: `Offer with ID ${offer.id} has expired`\n };\n }\n const chainId = await this.contractWrapper.getChainID();\n const currency = isNativeToken(offer.currencyContractAddress) ? NATIVE_TOKENS[chainId].wrapped.address : offer.currencyContractAddress;\n const provider = this.contractWrapper.getProvider();\n const ERC20Abi = (await import('@thirdweb-dev/contracts-js/dist/abis/IERC20.json')).default;\n const erc20 = new ContractWrapper(provider, currency, ERC20Abi, {}, this.storage);\n const offerorBalance = await erc20.read(\"balanceOf\", [offer.offerorAddress]);\n if (offerorBalance.lt(offer.totalPrice)) {\n return {\n valid: false,\n error: `Offeror ${offer.offerorAddress} doesn't have enough balance of token ${currency}`\n };\n }\n const offerorAllowance = await erc20.read(\"allowance\", [offer.offerorAddress, this.getAddress()]);\n if (offerorAllowance.lt(offer.totalPrice)) {\n return {\n valid: false,\n error: `Offeror ${offer.offerorAddress} hasn't approved enough amount of token ${currency}`\n };\n }\n return {\n valid: true,\n error: \"\"\n };\n }\n async applyFilter(offers, filter) {\n let rawOffers = [...offers];\n if (filter) {\n if (filter.offeror) {\n const resolvedOfferor = await resolveAddress(filter.offeror);\n rawOffers = rawOffers.filter(offeror => offeror.offeror.toString().toLowerCase() === resolvedOfferor?.toString().toLowerCase());\n }\n if (filter.tokenContract) {\n const resolvedToken = await resolveAddress(filter.tokenContract);\n rawOffers = rawOffers.filter(tokenContract => tokenContract.assetContract.toString().toLowerCase() === resolvedToken?.toString().toLowerCase());\n }\n if (filter.tokenId !== undefined) {\n rawOffers = rawOffers.filter(tokenContract => tokenContract.tokenId.toString() === filter?.tokenId?.toString());\n }\n }\n return filter?.count && filter.count < rawOffers.length ? rawOffers.slice(0, filter.count) : rawOffers;\n }\n}\n\nexport { MarketplaceV3DirectListings as M, Status as S, MarketplaceV3EnglishAuctions as a, MarketplaceV3Offers as b };\n"],"names":["cleanCurrencyAddress","currencyAddress","_fetchCurrencyValue_a150f8dd_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__","i","_index_02e94cec_browser_esm_js__WEBPACK_IMPORTED_MODULE_1__","aW","ContractPlatformFee","featureName","_index_02e94cec_browser_esm_js__WEBPACK_IMPORTED_MODULE_0__","dr","name","contractWrapper","get","platformFeeRecipient","platformFeeBps","read","bH","parseAsync","platform_fee_recipient","platform_fee_basis_points","set","_transactions_91b95b4c_browser_esm_js__WEBPACK_IMPORTED_MODULE_1__","f","platformFeeInfo","parsed","T","fromContractWrapper","method","args","isTokenApprovedForTransfer","provider","transferrerContractAddress","assetContract","tokenId","owner","ERC165Abi","__webpack_require__","e","then","t","bind","default","erc165","ethers__WEBPACK_IMPORTED_MODULE_0__","CH","isERC721","isERC1155","Promise","all","supportsInterface","_QueryParams_b6af7045_browser_esm_js__WEBPACK_IMPORTED_MODULE_1__","I","a","approvedAddress","ERC721Abi","resolve","asset","approved","isApprovedForAll","getApproved","toLowerCase","console","error","ERC1155Abi","err","handleTokenApproval","marketplaceAddress","from","_index_02e94cec_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__","cs","getSignerOrProvider","options","storage","isTokenApproved","sendTransaction","Error","validateNewListingParam","param","tiny_invariant__WEBPACK_IMPORTED_MODULE_3__","Z","undefined","assetContractAddress","buyoutPricePerToken","listingDurationInSeconds","startTimestamp","quantity","type","reservePricePerToken","mapOffer","listingId","offer","quantityDesired","pricePerToken","currencyContractAddress","currency","buyerAddress","offeror","quantityWanted","currencyValue","_fetchCurrencyValue_a150f8dd_browser_esm_js__WEBPACK_IMPORTED_MODULE_4__","mul","isWinningBid","winningPrice","newBidPrice","bidBuffer","ethers__WEBPACK_IMPORTED_MODULE_5__","O$","eq","buffer","sub","dB","div","gte","getAllInBatches","start","end","fn","batches","D","push","Status","DirectListingInputParamsSchema","zod__WEBPACK_IMPORTED_MODULE_0__","z","object","ba","b7","cw","_assertEnabled_4605112f_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__","R","Date","endTimestamp","E","isReservedListing","boolean","MarketplaceV3DirectListings","dx","events","_contract_appuri_84a944c8_browser_esm_js__WEBPACK_IMPORTED_MODULE_3__","encoder","C","interceptor","_contract_interceptor_d7b164a7_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__","estimator","G","getAddress","address","getTotalCount","getAll","filter","totalListings","ethers__WEBPACK_IMPORTED_MODULE_6__","toNumber","rawListings","_marketplace_cc35d3ed_browser_esm_js__WEBPACK_IMPORTED_MODULE_7__","g","startId","endId","flat","filteredListings","applyFilter","map","listing","mapListing","getAllValid","getListing","isBuyerApprovedForListing","buyer","validateListing","aM","isCurrencyApprovedForListing","currencyPriceForListing","resolvedCurrencyAddress","isApprovedCurrency","createListing","_transactions_91b95b4c_browser_esm_js__WEBPACK_IMPORTED_MODULE_8__","parsedListing","h","getSignerAddress","normalizedPricePerToken","_normalizePriceValue_74eeb144_browser_esm_js__WEBPACK_IMPORTED_MODULE_9__","n","getProvider","block","getBlock","blockTime","timestamp","lt","_cleanCurrencyAddress_a57dd7bc_browser_esm_js__WEBPACK_IMPORTED_MODULE_10__","c","reserved","parse","receipt","id","event","parseLogs","logs","createListingsBatch","listings","data","prepare","tx","encode","updateListing","cancelListing","buyFromListing","receiver","valid","isStillValidListing","buyFor","value","overrides","getCallOverrides","_setErc20Allowance_e3ef471a_browser_esm_js__WEBPACK_IMPORTED_MODULE_11__","s","approveBuyerForReservedListing","isApproved","revokeBuyerApprovalForReservedListing","approveCurrencyForListing","pricePerTokenInCurrency","tiny_invariant__WEBPACK_IMPORTED_MODULE_12__","currencyPrice","revokeCurrencyApprovalForListing","isZero","status","UNSET","gt","Created","Expired","Active","Completed","Cancelled","toString","currencyValuePerToken","startTimeInSeconds","_QueryParams_b6af7045_browser_esm_js__WEBPACK_IMPORTED_MODULE_13__","endTimeInSeconds","creatorAddress","listingCreator","ethers__WEBPACK_IMPORTED_MODULE_14__","ownerOf","balance","balanceOf","seller","resolvedSeller","tokenContract","resolvedToken","count","length","slice","EnglishAuctionInputParamsSchema","minimumBidAmount","buyoutBidAmount","timeBufferInSeconds","bidBufferBps","MarketplaceV3EnglishAuctions","dy","totalAuctions","rawAuctions","filteredAuctions","auction","mapAuction","getAuction","auctionId","getWinningBid","validateAuction","bid","_bidder","ethers__WEBPACK_IMPORTED_MODULE_15__","d","mapBid","_currency","_bidAmount","bidAmount","getWinner","now","Math","floor","endTime","contractEvent","closedAuctions","getEvents","closed","find","winningBidder","createAuction","parsedAuction","normalizedBuyoutAmount","normalizedMinBidAmount","createAuctionsBatch","buyoutAuction","currencyMetadata","makeBid","ethers__WEBPACK_IMPORTED_MODULE_16__","formatUnits","decimals","normalizedBidAmount","winningBid","isWinnner","tokenPrice","cancelAuction","closeAuctionForBidder","closeFor","message","includes","w","closeAuctionForSeller","executeSale","closeForSeller","closeForBuyer","getBidBufferBps","getMinimumNextBid","currentBidBufferBps","currentBidOrReservePrice","minimumNextBid","add","auctionCreator","minimumBidCurrencyValue","buyoutCurrencyValue","bidderAddress","resolvedBidderAddress","bidAmountCurrencyValue","auctions","OfferInputParamsSchema","totalPrice","MarketplaceV3Offers","dz","totalOffers","rawOffers","filteredOffers","getOffer","offerId","makeOffer","parsedOffer","chainId","getChainID","aX","wrapped","normalizedTotalPrice","expirationTimestamp","cancelOffer","acceptOffer","validateOffer","isStillValidOffer","offerorAddress","ERC20Abi","erc20","offerorBalance","offerorAllowance","offers","resolvedOfferor"],"sourceRoot":""}