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eAAA,2BAC7B,WAAA8D,EAAA,KAAA9D,eAAA,CAGA,CACA","sources":["webpack://_N_E/./node_modules/@thirdweb-dev/sdk/dist/erc-20-6b5cf86d.browser.esm.js","webpack://_N_E/"],"sourcesContent":["import { utils, BigNumber } from 'ethers';\nimport { C as ContractEncoder, f as fetchCurrencyMetadata, a as fetchCurrencyValue } from './fetchCurrencyValue-a150f8dd.browser.esm.js';\nimport { cw as AmountSchema, cD as FEATURE_TOKEN_BURNABLE, aM as resolveAddress, cE as FEATURE_TOKEN_CLAIM_CONDITIONS_V2, bh as CustomContractSchema, cF as FEATURE_TOKEN_BATCH_MINTABLE, cG as FEATURE_TOKEN_MINTABLE, cH as FEATURE_TOKEN_SIGNATURE_MINTABLE, cI as FEATURE_TOKEN } from './index-02e94cec.browser.esm.js';\nimport { a as assertEnabled } from './assertEnabled-4605112f.browser.esm.js';\nimport { C as ContractMetadata, d as detectContractFeature } from './contract-appuri-84a944c8.browser.esm.js';\nimport { f as buildTransactionFunction, T as Transaction } from './transactions-91b95b4c.browser.esm.js';\nimport { D as DropClaimConditions } from './drop-claim-conditions-443a688e.browser.esm.js';\nimport invariant from 'tiny-invariant';\nimport { n as normalizePriceValue } from './normalizePriceValue-74eeb144.browser.esm.js';\nimport { s as setErc20Allowance } from './setErc20Allowance-e3ef471a.browser.esm.js';\nimport { S as Signature20PayloadInput, n as Signature20PayloadOutput, M as MintRequest20 } from './signature-52783ae4.browser.esm.js';\n\n/**\n * @internal\n */\nasync function normalizeAmount(contractWrapper, amount) {\n const decimals = await contractWrapper.read(\"decimals\", []);\n return utils.parseUnits(AmountSchema.parse(amount), decimals);\n}\n\n/**\n * @internal\n */\nclass Erc20Burnable {\n featureName = FEATURE_TOKEN_BURNABLE.name;\n constructor(erc20, contractWrapper) {\n this.erc20 = erc20;\n this.contractWrapper = contractWrapper;\n }\n\n /**\n * Burn Tokens\n *\n * @remarks Burn tokens held by the connected wallet\n *\n * @example\n * ```javascript\n * // The amount of this token you want to burn\n * const amount = 1.2;\n *\n * await contract.token.burn.tokens(amount);\n * ```\n */\n tokens = /* @__PURE__ */buildTransactionFunction(async amount => {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"burn\",\n args: [await this.erc20.normalizeAmount(amount)]\n });\n });\n\n /**\n * Burn Tokens\n *\n * @remarks Burn tokens held by the specified wallet\n *\n * @example\n * ```javascript\n * // Address of the wallet sending the tokens\n * const holderAddress = \"{{wallet_address}}\";\n *\n * // The amount of this token you want to burn\n * const amount = 1.2;\n *\n * await contract.token.burn.from(holderAddress, amount);\n * ```\n */\n from = /* @__PURE__ */buildTransactionFunction(async (holder, amount) => {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"burnFrom\",\n args: await Promise.all([resolveAddress(holder), this.erc20.normalizeAmount(amount)])\n });\n });\n}\n\n/**\n * Configure and claim ERC20 tokens\n * @remarks Manage claim phases and claim ERC20 tokens that have been lazily minted.\n * @example\n * ```javascript\n * const contract = await sdk.getContract(\"{{contract_address}}\");\n * await contract.token.drop.claim.to(\"0x...\", quantity);\n * ```\n */\n\nclass Erc20ClaimableWithConditions {\n featureName = FEATURE_TOKEN_CLAIM_CONDITIONS_V2.name;\n /**\n * Configure claim conditions\n * @remarks Define who can claim NFTs in the collection, when and how many.\n * @example\n * ```javascript\n * const presaleStartTime = new Date();\n * const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);\n * const claimConditions = [\n * {\n * startTime: presaleStartTime, // start the presale now\n * maxClaimableSupply: 2, // limit how many mints for this presale\n * price: 0.01, // presale price\n * snapshot: ['0x...', '0x...'], // limit minting to only certain addresses\n * },\n * {\n * startTime: publicSaleStartTime, // 24h after presale, start public sale\n * price: 0.08, // public sale price\n * }\n * ]);\n * await contract.token.drop.claim.conditions.set(claimConditions);\n * ```\n */\n\n constructor(erc20, contractWrapper, storage) {\n this.erc20 = erc20;\n this.contractWrapper = contractWrapper;\n this.storage = storage;\n const metadata = new ContractMetadata(this.contractWrapper, CustomContractSchema, this.storage);\n this.conditions = new DropClaimConditions(this.contractWrapper, metadata, this.storage);\n }\n\n /**\n * Claim a certain amount of tokens to a specific Wallet\n *\n * @remarks Let the specified wallet claim Tokens.\n *\n * @example\n * ```javascript\n * const address = \"{{wallet_address}}\"; // address of the wallet you want to claim the NFTs\n * const quantity = 42.69; // how many tokens you want to claim\n *\n * const tx = await contract.token.drop.claim.to(address, quantity);\n * const receipt = tx.receipt; // the transaction receipt\n * ```\n *\n * @param destinationAddress - Address you want to send the token to\n * @param amount - Quantity of the tokens you want to claim\n * @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer\n * @param claimData - Optional, data to pass to the claim function\n * @returns The transaction receipt\n */\n to = /* @__PURE__ */buildTransactionFunction(async (destinationAddress, amount, options) => {\n const quantity = await this.erc20.normalizeAmount(amount);\n return await this.conditions.getClaimTransaction(destinationAddress, quantity, options);\n });\n}\n\n/**\n * Configure and claim ERC20 tokens\n * @remarks Manage claim phases and claim ERC20 tokens that have been lazily minted.\n * @example\n * ```javascript\n * const contract = await sdk.getContract(\"{{contract_address}}\");\n * await contract.token.drop.claim.to(\"0x...\", quantity);\n * ```\n */\n\nclass Erc20Droppable {\n /**\n * Configure claim conditions\n * @remarks Define who can claim NFTs in the collection, when and how many.\n * @example\n * ```javascript\n * const presaleStartTime = new Date();\n * const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);\n * const claimConditions = [\n * {\n * startTime: presaleStartTime, // start the presale now\n * maxClaimableSupply: 2, // limit how many mints for this presale\n * price: 0.01, // presale price\n * snapshot: ['0x...', '0x...'], // limit minting to only certain addresses\n * },\n * {\n * startTime: publicSaleStartTime, // 24h after presale, start public sale\n * price: 0.08, // public sale price\n * }\n * ]);\n * await contract.nft.drop.claim.conditions.set(claimConditions);\n * ```\n */\n\n constructor(erc20, contractWrapper, storage) {\n this.erc20 = erc20;\n this.contractWrapper = contractWrapper;\n this.storage = storage;\n this.claim = new Erc20ClaimableWithConditions(this.erc20, this.contractWrapper, this.storage);\n }\n}\n\n/**\n * Mint Many ERC20 Tokens at once\n * @remarks Token batch minting functionality that handles unit parsing for you.\n * @example\n * ```javascript\n * const contract = await sdk.getContract(\"{{contract_address}}\");\n * await contract.token.mint.batch.to(walletAddress, [nftMetadata1, nftMetadata2, ...]);\n * ```\n * @internal\n */\nclass Erc20BatchMintable {\n featureName = FEATURE_TOKEN_BATCH_MINTABLE.name;\n constructor(erc20, contractWrapper) {\n this.erc20 = erc20;\n this.contractWrapper = contractWrapper;\n }\n\n /**\n * Mint Tokens To Many Wallets\n *\n * @remarks Mint tokens to many wallets in one transaction.\n *\n * @example\n * ```javascript\n * // Data of the tokens you want to mint\n * const data = [\n * {\n * toAddress: \"{{wallet_address}}\", // Address to mint tokens to\n * amount: 0.2, // How many tokens to mint to specified address\n * },\n * {\n * toAddress: \"0x...\",\n * amount: 1.4,\n * }\n * ]\n *\n * await contract.token.mint.batch(data);\n * ```\n */\n to = /* @__PURE__ */buildTransactionFunction(async args => {\n const contractEncoder = new ContractEncoder(this.contractWrapper);\n const _items = await Promise.all(args.map(item => Promise.all([resolveAddress(item.toAddress), this.erc20.normalizeAmount(item.amount)])));\n const encoded = _items.map(_ref => {\n let [address, amount] = _ref;\n return contractEncoder.encode(\"mintTo\", [address, amount]);\n });\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"multicall\",\n args: [encoded]\n });\n });\n}\n\n/**\n * Mint ERC20 Tokens\n * @remarks Token minting functionality that handles unit parsing for you.\n * @example\n * ```javascript\n * const contract = await sdk.getContract(\"{{contract_address}}\");\n * await contract.nft.mint.to(walletAddress, nftMetadata);\n * ```\n * @public\n */\n\nclass Erc20Mintable {\n featureName = FEATURE_TOKEN_MINTABLE.name;\n\n /**\n * Batch mint Tokens to many addresses\n */\n\n constructor(erc20, contractWrapper) {\n this.erc20 = erc20;\n this.contractWrapper = contractWrapper;\n this.batch = this.detectErc20BatchMintable();\n }\n\n /**\n * Mint Tokens\n *\n * @remarks Mint tokens to a specified address.\n *\n * @example\n * ```javascript\n * const toAddress = \"{{wallet_address}}\"; // Address of the wallet you want to mint the tokens to\n * const amount = \"1.5\"; // The amount of this token you want to mint\n * await contract.token.mint.to(toAddress, amount);\n * ```\n */\n to = /* @__PURE__ */buildTransactionFunction(async (to, amount) => {\n return await this.getMintTransaction(to, amount);\n });\n\n /**\n * @deprecated Use `contract.erc20.mint.prepare(...args)` instead\n */\n async getMintTransaction(to, amount) {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"mintTo\",\n args: await Promise.all([resolveAddress(to), this.erc20.normalizeAmount(amount)])\n });\n }\n detectErc20BatchMintable() {\n if (detectContractFeature(this.contractWrapper, \"ERC20BatchMintable\")) {\n return new Erc20BatchMintable(this.erc20, this.contractWrapper);\n }\n return undefined;\n }\n}\n\n/**\n * Enables generating ERC20 Tokens with rules and an associated signature, which can then be minted by anyone securely\n * @erc20\n * @public\n */\n// TODO consolidate into a single class\n\nclass Erc20SignatureMintable {\n featureName = FEATURE_TOKEN_SIGNATURE_MINTABLE.name;\n constructor(contractWrapper, roles) {\n this.contractWrapper = contractWrapper;\n this.roles = roles;\n }\n\n /**\n * Mint tokens from a signature\n *\n * @remarks Mint a certain amount of tokens from a previously generated signature.\n *\n * @example\n * ```javascript\n * // see how to craft a payload to sign in the `generate()` documentation\n * const signedPayload = contract.erc20.signature.generate(payload);\n *\n * // Use the signed payload to mint the tokens\n * const tx = contract.erc20.signature.mint(signedPayload);\n * ```\n * @param signedPayload - the previously generated payload and signature with {@link Erc20SignatureMintable.generate}\n * @twfeature ERC20SignatureMintable\n */\n mint = /* @__PURE__ */buildTransactionFunction(async signedPayload => {\n const mintRequest = signedPayload.payload;\n const signature = signedPayload.signature;\n const [message, overrides] = await Promise.all([this.mapPayloadToContractStruct(mintRequest), this.contractWrapper.getCallOverrides()]);\n // TODO: Transaction Sequence Pattern\n await setErc20Allowance(this.contractWrapper, BigNumber.from(message.price), mintRequest.currencyAddress, overrides);\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"mintWithSignature\",\n args: [message, signature],\n overrides\n });\n });\n\n /**\n * Mint any number of generated tokens signatures at once\n * @remarks Mint multiple token signatures in one transaction. Note that this is only possible for free mints (cannot batch mints with a price attached to it for security reasons)\n * @param signedPayloads - the array of signed payloads to mint\n * @twfeature ERC20SignatureMintable\n */\n mintBatch = /* @__PURE__ */buildTransactionFunction(async signedPayloads => {\n const messages = await Promise.all(signedPayloads.map(s => this.mapPayloadToContractStruct(s.payload)));\n const contractPayloads = signedPayloads.map((s, index) => {\n const message = messages[index];\n const signature = s.signature;\n const price = s.payload.price;\n if (BigNumber.from(price).gt(0)) {\n throw new Error(\"Can only batch free mints. For mints with a price, use regular mint()\");\n }\n return {\n message,\n signature\n };\n });\n const contractEncoder = new ContractEncoder(this.contractWrapper);\n const encoded = contractPayloads.map(p => {\n return contractEncoder.encode(\"mintWithSignature\", [p.message, p.signature]);\n });\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"multicall\",\n args: [encoded]\n });\n });\n\n /**\n * Verify that a payload is correctly signed\n * @param signedPayload - the payload to verify\n * @twfeature ERC20SignatureMintable\n *\n * ```javascript\n * const startTime = new Date();\n * const endTime = new Date(Date.now() + 60 * 60 * 24 * 1000);\n * const payload = {\n * quantity: 4.2, // The quantity of tokens to be minted\n * to: {{wallet_address}}, // Who will receive the tokens\n * price: 0.5, // the price to pay for minting those tokens\n * currencyAddress: NATIVE_TOKEN_ADDRESS, // the currency to pay with\n * mintStartTime: startTime, // can mint anytime from now\n * mintEndTime: endTime, // to 24h from now,\n * primarySaleRecipient: \"0x...\", // custom sale recipient for this token mint\n * };\n *\n * const signedPayload = await contract.erc20.signature.generate(payload);\n * // Now you can verify if the signed payload is valid\n * const isValid = await contract.erc20.signature.verify(signedPayload);\n * ```\n */\n async verify(signedPayload) {\n const mintRequest = signedPayload.payload;\n const signature = signedPayload.signature;\n const message = await this.mapPayloadToContractStruct(mintRequest);\n const verification = await this.contractWrapper.read(\"verify\", [message, signature]);\n return verification[0];\n }\n\n /**\n * Generate a signature that can be used to mint a certain amount of tokens\n *\n * @remarks Takes in a quantity of tokens, some conditions for how it can be minted and signs it with your private key. The generated signature can then be used to mint those tokens using the exact payload and signature generated.\n *\n * @example\n * ```javascript\n * const startTime = new Date();\n * const endTime = new Date(Date.now() + 60 * 60 * 24 * 1000);\n * const payload = {\n * quantity: 4.2, // The quantity of tokens to be minted\n * to: {{wallet_address}}, // Who will receive the tokens\n * price: 0.5, // the price to pay for minting those tokens\n * currencyAddress: NATIVE_TOKEN_ADDRESS, // the currency to pay with\n * mintStartTime: startTime, // can mint anytime from now\n * mintEndTime: endTime, // to 24h from now,\n * primarySaleRecipient: \"0x...\", // custom sale recipient for this token mint\n * };\n *\n * const signedPayload = await contract.erc20.signature.generate(payload);\n * // now anyone can use these to mint the NFT using `contract.erc20.signature.mint(signedPayload)`\n * ```\n * @param mintRequest - the payload to sign\n * @returns The signed payload and the corresponding signature\n * @twfeature ERC20SignatureMintable\n */\n async generate(mintRequest) {\n return (await this.generateBatch([mintRequest]))[0];\n }\n\n /**\n * Generate a batch of signatures that can be used to mint many token signatures.\n *\n * @remarks See {@link Erc20SignatureMintable.generate}\n *\n * @param payloadsToSign - the payloads to sign\n * @returns An array of payloads and signatures\n * @twfeature ERC20SignatureMintable\n */\n async generateBatch(payloadsToSign) {\n await this.roles?.verify([\"minter\"], await this.contractWrapper.getSignerAddress());\n const [chainId, name, parsedRequests] = await Promise.all([this.contractWrapper.getChainID(), this.contractWrapper.read(\"name\", []),\n // ERC20Permit (EIP-712) spec differs from signature mint 721, 1155.\n Promise.all(payloadsToSign.map(m => Signature20PayloadInput.parseAsync(m)))]);\n const signer = this.contractWrapper.getSigner();\n invariant(signer, \"No signer available\");\n const finalPayloads = await Promise.all(parsedRequests.map(m => Signature20PayloadOutput.parseAsync(m)));\n const contractStructs = await Promise.all(finalPayloads.map(payload => this.mapPayloadToContractStruct(payload)));\n const signatures = await Promise.all(contractStructs.map(struct => this.contractWrapper.signTypedData(signer, {\n name,\n version: \"1\",\n chainId,\n verifyingContract: this.contractWrapper.address\n }, {\n MintRequest: MintRequest20\n }, struct)));\n return parsedRequests.map((m, index) => {\n const finalPayload = finalPayloads[index];\n const signature = signatures[index];\n return {\n payload: finalPayload,\n signature: signature.toString()\n };\n });\n }\n\n /** ******************************\n * PRIVATE FUNCTIONS\n *******************************/\n /**\n * Maps a payload to the format expected by the contract\n *\n * @internal\n *\n * @param mintRequest - The payload to map.\n * @returns The mapped payload.\n */\n async mapPayloadToContractStruct(mintRequest) {\n const [normalizedPrice, decimals] = await Promise.all([normalizePriceValue(this.contractWrapper.getProvider(), mintRequest.price, mintRequest.currencyAddress), this.contractWrapper.read(\"decimals\", [])]);\n const amountWithDecimals = utils.parseUnits(mintRequest.quantity, decimals);\n return {\n to: mintRequest.to,\n primarySaleRecipient: mintRequest.primarySaleRecipient,\n quantity: amountWithDecimals,\n price: normalizedPrice,\n currency: mintRequest.currencyAddress,\n validityEndTimestamp: mintRequest.mintEndTime,\n validityStartTimestamp: mintRequest.mintStartTime,\n uid: mintRequest.uid\n };\n }\n}\n\n/**\n * Standard ERC20 Token functions\n * @remarks Basic functionality for a ERC20 contract that handles all unit transformation for you.\n * @example\n * ```javascript\n * const contract = await sdk.getContract(\"{{contract_address}}\");\n * await contract.erc20.transfer(walletAddress, amount);\n * ```\n * @erc20\n * @public\n */\nclass Erc20 {\n featureName = FEATURE_TOKEN.name;\n /**\n * Mint tokens\n */\n\n get chainId() {\n return this._chainId;\n }\n constructor(contractWrapper, storage, chainId) {\n this.contractWrapper = contractWrapper;\n this.storage = storage;\n this.mintable = this.detectErc20Mintable();\n this.burnable = this.detectErc20Burnable();\n this.droppable = this.detectErc20Droppable();\n this.signatureMintable = this.detectErc20SignatureMintable();\n this._chainId = chainId;\n }\n\n /**\n * @internal\n */\n onNetworkUpdated(network) {\n this.contractWrapper.updateSignerOrProvider(network);\n }\n\n /**\n * @internal\n */\n getAddress() {\n return this.contractWrapper.address;\n }\n\n ////// Standard ERC20 Extension //////\n\n /**\n * Get the token metadata\n * @remarks name, symbol, etc...\n * @example\n * ```javascript\n * const token = await contract.erc20.get();\n * ```\n * @returns The token metadata\n * @twfeature ERC20\n */\n async get() {\n return await fetchCurrencyMetadata(this.contractWrapper.getProvider(), this.getAddress());\n }\n\n /**\n * Get token balance for the currently connected wallet\n *\n * @remarks Get a wallets token balance.\n *\n * @example\n * ```javascript\n * const balance = await contract.erc20.balance();\n * ```\n *\n * @returns The balance of a specific wallet.\n * @twfeature ERC20\n */\n async balance() {\n return await this.balanceOf(await this.contractWrapper.getSignerAddress());\n }\n\n /**\n * Get token balance for a specific wallet\n *\n * @remarks Get a wallets token balance.\n *\n * @example\n * ```javascript\n * const walletAddress = \"{{wallet_address}}\";\n * const balance = await contract.erc20.balanceOf(walletAddress);\n * ```\n *\n * @returns The balance of a specific wallet.\n * @twfeature ERC20\n */\n async balanceOf(address) {\n return this.getValue(await this.contractWrapper.read(\"balanceOf\", [await resolveAddress(address)]));\n }\n\n /**\n * Get the total supply for this token\n * @remarks Get how much supply has been minted\n * @example\n * ```javascript\n * const balance = await contract.erc20.totalSupply();\n * ```\n * @twfeature ERC20\n */\n async totalSupply() {\n return await this.getValue(await this.contractWrapper.read(\"totalSupply\", []));\n }\n\n /**\n * Get token allowance\n *\n * @remarks Get the allowance of a 'spender' wallet over the connected wallet's funds - the allowance of a different address for a token is the amount of tokens that the `spender` wallet is allowed to spend on behalf of the connected wallet.\n *\n * @example\n * ```javascript\n * // Address of the wallet to check token allowance\n * const spenderAddress = \"0x...\";\n * const allowance = await contract.erc20.allowance(spenderAddress);\n * ```\n *\n * @returns The allowance of one wallet over anothers funds.\n * @twfeature ERC20\n */\n async allowance(spender) {\n const [owner, spenderAddress] = await Promise.all([this.contractWrapper.getSignerAddress(), resolveAddress(spender)]);\n return await this.allowanceOf(owner, spenderAddress);\n }\n\n /**\n * Get token allowance of a specific wallet\n *\n * @remarks Get the allowance of one wallet over another wallet's funds - the allowance of a different address for a token is the amount of tokens that the wallet is allowed to spend on behalf of the specified wallet.\n *\n * @example\n * ```javascript\n * // Address of the wallet who owns the funds\n * const owner = \"{{wallet_address}}\";\n * // Address of the wallet to check token allowance\n * const spender = \"0x...\";\n * const allowance = await contract.erc20.allowanceOf(owner, spender);\n * ```\n *\n * @returns The allowance of one wallet over anothers funds.\n * @twfeature ERC20\n */\n async allowanceOf(owner, spender) {\n const args = await Promise.all([resolveAddress(owner), resolveAddress(spender)]);\n return await this.getValue(await this.contractWrapper.read(\"allowance\", args));\n }\n\n /**\n * Transfer tokens\n *\n * @remarks Transfer tokens from the connected wallet to another wallet.\n *\n * @example\n * ```javascript\n * // Address of the wallet you want to send the tokens to\n * const toAddress = \"0x...\";\n * // The amount of tokens you want to send\n * const amount = 0.1;\n * await contract.erc20.transfer(toAddress, amount);\n * ```\n * @twfeature ERC20\n */\n transfer = /* @__PURE__ */buildTransactionFunction(async (to, amount) => {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"transfer\",\n args: await Promise.all([resolveAddress(to), this.normalizeAmount(amount)])\n });\n });\n\n /**\n * Transfer tokens from a specific address\n *\n * @remarks Transfer tokens from one wallet to another\n *\n * @example\n * ```javascript\n * // Address of the wallet sending the tokens\n * const fromAddress = \"{{wallet_address}}\";\n * // Address of the wallet you want to send the tokens to\n * const toAddress = \"0x...\";\n * // The number of tokens you want to send\n * const amount = 1.2\n * // Note that the connected wallet must have approval to transfer the tokens of the fromAddress\n * await contract.erc20.transferFrom(fromAddress, toAddress, amount);\n * ```\n * @twfeature ERC20\n */\n transferFrom = /* @__PURE__ */buildTransactionFunction(async (from, to, amount) => {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"transferFrom\",\n args: await Promise.all([resolveAddress(from), resolveAddress(to), this.normalizeAmount(amount)])\n });\n });\n\n /**\n * Set token allowance\n * @remarks Allows the specified `spender` wallet to transfer the given `amount` of tokens to another wallet\n * @example\n * ```javascript\n * // Address of the wallet to allow transfers from\n * const spenderAddress = \"0x...\";\n * // The number of tokens to give as allowance\n * const amount = 100\n * await contract.erc20.setAllowance(spenderAddress, amount);\n * ```\n * @twfeature ERC20\n */\n setAllowance = /* @__PURE__ */buildTransactionFunction(async (spender, amount) => {\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"approve\",\n args: await Promise.all([resolveAddress(spender), this.normalizeAmount(amount)])\n });\n });\n\n /**\n * Transfer tokens to many wallets\n *\n * @remarks Mint tokens from the connected wallet to many wallets\n *\n * @example\n * ```javascript\n * // Data of the tokens you want to mint\n * const data = [\n * {\n * toAddress: \"{{wallet_address}}\", // Address to mint tokens to\n * amount: 100, // How many tokens to mint to specified address\n * },\n * {\n * toAddress: \"0x...\",\n * amount: 100,\n * }\n * ]\n *\n * await contract.erc20.transferBatch(data);\n * ```\n */\n transferBatch = /* @__PURE__ */buildTransactionFunction(async args => {\n const contractEncoder = new ContractEncoder(this.contractWrapper);\n const encoded = (await Promise.all(args.map(arg => Promise.all([this.normalizeAmount(arg.amount), resolveAddress(arg.toAddress)])))).map(_ref => {\n let [amountWithDecimals, address] = _ref;\n return contractEncoder.encode(\"transfer\", [address, amountWithDecimals]);\n });\n return Transaction.fromContractWrapper({\n contractWrapper: this.contractWrapper,\n method: \"multicall\",\n args: [encoded]\n });\n });\n\n ////// ERC20 Mintable Extension //////\n\n /**\n * Mint tokens\n *\n * @remarks Mint tokens to the connected wallet.\n *\n * @example\n * ```javascript\n * const amount = \"1.5\"; // The amount of this token you want to mint\n * await contract.erc20.mint(amount);\n * ```\n * @twfeature ERC20Mintable\n */\n mint = /* @__PURE__ */buildTransactionFunction(async amount => {\n return this.mintTo.prepare(await this.contractWrapper.getSignerAddress(), amount);\n });\n\n /**\n * Mint tokens to a specific wallet\n *\n * @remarks Mint tokens to a specified address.\n *\n * @example\n * ```javascript\n * const toAddress = \"{{wallet_address}}\"; // Address of the wallet you want to mint the tokens to\n * const amount = \"1.5\"; // The amount of this token you want to mint\n * await contract.erc20.mintTo(toAddress, amount);\n * ```\n * @twfeature ERC20Mintable\n */\n mintTo = /* @__PURE__ */buildTransactionFunction(async (receiver, amount) => {\n return assertEnabled(this.mintable, FEATURE_TOKEN_MINTABLE).to.prepare(receiver, amount);\n });\n\n /**\n * Construct a mint transaction without executing it\n * @remarks This is useful for estimating the gas cost of a mint transaction, overriding transaction options and having fine grained control over the transaction execution.\n * @param receiver - Address you want to send the token to\n * @param amount - The amount of tokens you want to mint\n *\n * @deprecated Use `contract.erc20.mint.prepare(...args)` instead\n * @twfeature ERC20Mintable\n */\n async getMintTransaction(receiver, amount) {\n return assertEnabled(this.mintable, FEATURE_TOKEN_MINTABLE).getMintTransaction(receiver, amount);\n }\n\n ////// ERC20 BatchMintable Extension //////\n\n /**\n * Mint tokens to many wallets\n *\n * @remarks Mint tokens to many wallets in one transaction.\n *\n * @example\n * ```javascript\n * // Data of the tokens you want to mint\n * const data = [\n * {\n * toAddress: \"{{wallet_address}}\", // Address to mint tokens to\n * amount: 0.2, // How many tokens to mint to specified address\n * },\n * {\n * toAddress: \"0x...\",\n * amount: 1.4,\n * }\n * ]\n *\n * await contract.mintBatchTo(data);\n * ```\n * @twfeature ERC20BatchMintable\n */\n mintBatchTo = /* @__PURE__ */buildTransactionFunction(async args => {\n return assertEnabled(this.mintable?.batch, FEATURE_TOKEN_BATCH_MINTABLE).to.prepare(args);\n });\n\n ////// ERC20 Burnable Extension //////\n\n /**\n * Burn tokens\n *\n * @remarks Burn tokens held by the connected wallet\n *\n * @example\n * ```javascript\n * // The amount of this token you want to burn\n * const amount = 1.2;\n *\n * await contract.erc20.burn(amount);\n * ```\n * @twfeature ERC20Burnable\n */\n burn = /* @__PURE__ */buildTransactionFunction(async amount => {\n return assertEnabled(this.burnable, FEATURE_TOKEN_BURNABLE).tokens.prepare(amount);\n });\n\n /**\n * Burn tokens from a specific wallet\n *\n * @remarks Burn tokens held by the specified wallet\n *\n * @example\n * ```javascript\n * // Address of the wallet sending the tokens\n * const holderAddress = \"{{wallet_address}}\";\n *\n * // The amount of this token you want to burn\n * const amount = 1.2;\n *\n * await contract.erc20.burnFrom(holderAddress, amount);\n * ```\n * @twfeature ERC20Burnable\n */\n burnFrom = /* @__PURE__ */buildTransactionFunction(async (holder, amount) => {\n return assertEnabled(this.burnable, FEATURE_TOKEN_BURNABLE).from.prepare(holder, amount);\n });\n\n ////// ERC20 Claimable Extension //////\n\n /**\n * Claim tokens\n *\n * @remarks Let the specified wallet claim Tokens.\n *\n * @example\n * ```javascript\n * const address = \"{{wallet_address}}\"; // address of the wallet you want to claim the NFTs\n * const quantity = 42.69; // how many tokens you want to claim\n *\n * const tx = await contract.erc20.claim(address, quantity);\n * const receipt = tx.receipt; // the transaction receipt\n * ```\n *\n * @param destinationAddress - Address you want to send the token to\n * @param amount - Quantity of the tokens you want to claim\n * @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer\n * @param claimData - Optional, claim data\n * @returns The transaction receipt\n * @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1\n */\n claim = /* @__PURE__ */buildTransactionFunction(async (amount, options) => {\n return this.claimTo.prepare(await this.contractWrapper.getSignerAddress(), amount, options);\n });\n\n /**\n * Claim tokens to a specific wallet\n *\n * @remarks Let the specified wallet claim Tokens.\n *\n * @example\n * ```javascript\n * const address = \"{{wallet_address}}\"; // address of the wallet you want to claim the NFTs\n * const quantity = 42.69; // how many tokens you want to claim\n *\n * const tx = await contract.erc20.claim(address, quantity);\n * const receipt = tx.receipt; // the transaction receipt\n * ```\n *\n * @param destinationAddress - Address you want to send the token to\n * @param amount - Quantity of the tokens you want to claim\n * @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer\n * @param claimData - Optional, claim data\n * @returns The transaction receipt\n * @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1\n */\n claimTo = /* @__PURE__ */buildTransactionFunction(async (destinationAddress, amount, options) => {\n return assertEnabled(this.droppable?.claim, FEATURE_TOKEN_CLAIM_CONDITIONS_V2).to.prepare(destinationAddress, amount, options);\n });\n\n /**\n * Configure claim conditions\n * @remarks Define who can claim NFTs in the collection, when and how many.\n * @example\n * ```javascript\n * const presaleStartTime = new Date();\n * const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);\n * const claimConditions = [\n * {\n * startTime: presaleStartTime, // start the presale now\n * maxClaimableSupply: 2, // limit how many mints for this presale\n * price: 0.01, // presale price\n * snapshot: ['0x...', '0x...'], // limit minting to only certain addresses\n * },\n * {\n * startTime: publicSaleStartTime, // 24h after presale, start public sale\n * price: 0.08, // public sale price\n * }\n * ]);\n * await contract.erc20.claimConditions.set(claimConditions);\n * ```\n * @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1\n */\n get claimConditions() {\n return assertEnabled(this.droppable?.claim, FEATURE_TOKEN_CLAIM_CONDITIONS_V2).conditions;\n }\n\n ////// ERC20 SignatureMint Extension //////\n\n /**\n * Mint with signature\n * @remarks Generate dynamic tokens with your own signature, and let others mint them using that signature.\n * @example\n * ```javascript\n * // see how to craft a payload to sign in the `contract.erc20.signature.generate()` documentation\n * const signedPayload = contract.erc20.signature().generate(payload);\n *\n * // now the payload can be used to mint tokens\n * const tx = contract.erc20.signature.mint(signedPayload);\n * ```\n * @twfeature ERC20SignatureMintable\n */\n get signature() {\n return assertEnabled(this.signatureMintable, FEATURE_TOKEN_SIGNATURE_MINTABLE);\n }\n\n /** ******************************\n * PRIVATE FUNCTIONS\n *******************************/\n\n /**\n * returns the wei amount from a token amount\n * @internal\n * @param amount - The token amount\n */\n async normalizeAmount(amount) {\n return normalizeAmount(this.contractWrapper, amount);\n }\n\n /**\n * @internal\n */\n async getValue(value) {\n return await fetchCurrencyValue(this.contractWrapper.getProvider(), this.getAddress(), BigNumber.from(value));\n }\n detectErc20Mintable() {\n if (detectContractFeature(this.contractWrapper, \"ERC20\")) {\n return new Erc20Mintable(this, this.contractWrapper);\n }\n return undefined;\n }\n detectErc20Burnable() {\n if (detectContractFeature(this.contractWrapper, \"ERC20Burnable\")) {\n return new Erc20Burnable(this, this.contractWrapper);\n }\n return undefined;\n }\n detectErc20Droppable() {\n if (detectContractFeature(this.contractWrapper, \"ERC20ClaimConditionsV1\") || detectContractFeature(this.contractWrapper, \"ERC20ClaimConditionsV2\") || detectContractFeature(this.contractWrapper, \"ERC20ClaimPhasesV1\") || detectContractFeature(this.contractWrapper, \"ERC20ClaimPhasesV2\")) {\n return new Erc20Droppable(this, this.contractWrapper, this.storage);\n }\n return undefined;\n }\n detectErc20SignatureMintable() {\n if (detectContractFeature(this.contractWrapper, \"ERC20SignatureMintable\")) {\n return new Erc20SignatureMintable(this.contractWrapper);\n }\n return undefined;\n }\n}\n\nexport { Erc20 as E, Erc20SignatureMintable as a, normalizeAmount as n };\n"],"names":["normalizeAmount","contractWrapper","amount","decimals","read","ethers__WEBPACK_IMPORTED_MODULE_0__","parseUnits","_index_02e94cec_browser_esm_js__WEBPACK_IMPORTED_MODULE_1__","cw","parse","Erc20Burnable","featureName","cD","name","erc20","tokens","_transactions_91b95b4c_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__","f","T","fromContractWrapper","method","args","from","holder","Promise","all","aM","Erc20ClaimableWithConditions","cE","storage","metadata","_contract_appuri_84a944c8_browser_esm_js__WEBPACK_IMPORTED_MODULE_3__","C","bh","conditions","_drop_claim_conditions_443a688e_browser_esm_js__WEBPACK_IMPORTED_MODULE_4__","D","to","destinationAddress","options","quantity","getClaimTransaction","Erc20Droppable","constructor","claim","Erc20BatchMintable","cF","contractEncoder","_fetchCurrencyValue_a150f8dd_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__","_items","map","item","toAddress","encoded","_ref","address","encode","Erc20Mintable","cG","batch","detectErc20BatchMintable","getMintTransaction","d","Erc20SignatureMintable","cH","roles","mint","signedPayload","mintRequest","payload","signature","message","overrides","mapPayloadToContractStruct","getCallOverrides","_setErc20Allowance_e3ef471a_browser_esm_js__WEBPACK_IMPORTED_MODULE_6__","s","ethers__WEBPACK_IMPORTED_MODULE_7__","O$","price","currencyAddress","mintBatch","signedPayloads","messages","contractPayloads","index","gt","p","verify","verification","generate","generateBatch","payloadsToSign","getSignerAddress","chainId","parsedRequests","getChainID","m","_signature_52783ae4_browser_esm_js__WEBPACK_IMPORTED_MODULE_8__","S","parseAsync","signer","getSigner","tiny_invariant__WEBPACK_IMPORTED_MODULE_9__","Z","finalPayloads","n","contractStructs","signatures","struct","signTypedData","version","verifyingContract","MintRequest","M","finalPayload","toString","normalizedPrice","_normalizePriceValue_74eeb144_browser_esm_js__WEBPACK_IMPORTED_MODULE_10__","getProvider","amountWithDecimals","primarySaleRecipient","currency","validityEndTimestamp","mintEndTime","validityStartTimestamp","mintStartTime","uid","Erc20","cI","_chainId","mintable","detectErc20Mintable","burnable","detectErc20Burnable","droppable","detectErc20Droppable","signatureMintable","detectErc20SignatureMintable","onNetworkUpdated","network","updateSignerOrProvider","getAddress","get","balance","balanceOf","getValue","totalSupply","allowance","spender","owner","spenderAddress","allowanceOf","transfer","transferFrom","setAllowance","transferBatch","arg","mintTo","prepare","receiver","_assertEnabled_4605112f_browser_esm_js__WEBPACK_IMPORTED_MODULE_11__","a","mintBatchTo","burn","burnFrom","claimTo","claimConditions","value"],"sourceRoot":""}