diff --git a/docs/feature_snippets.json b/docs/feature_snippets.json
new file mode 100644
index 000000000..b179625e3
--- /dev/null
+++ b/docs/feature_snippets.json
@@ -0,0 +1,531 @@
+{
+ "PlatformFee": {
+ "name": "ContractPlatformFee",
+ "summary": "Handle platform fees and recipients\n\n",
+ "remarks": "\n\nConfigure platform fees for a contract, which can be applied on certain paid transactions\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nconst feeInfo = await contract.platformFee.get();\nawait contract.platformFee.set({\n platform_fee_basis_points: 100, // 1% fee\n platform_fee_recipient: \"0x...\" // the fee recipient\n})"
+ },
+ "methods": [],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.ContractPlatformFee"
+ }
+ },
+ "PrimarySale": {
+ "name": "ContractPrimarySale",
+ "summary": "Handle primary sales recipients\n\n",
+ "remarks": "\n\nConfigure primary sale recipients for an entire contract.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nconst salesRecipient = await contract.sales.getRecipient();\nawait contract.roles.setRecipient(recipientWalletAddress);"
+ },
+ "methods": [],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.ContractPrimarySale"
+ }
+ },
+ "Permissions": {
+ "name": "ContractRoles",
+ "summary": "Handle contract permissions\n\n",
+ "remarks": "\n\nConfigure roles and permissions for a contract, to restrict certain actions.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nconst rolesAndMembers = await contract.roles.getAll();\nawait contract.roles.grantRole(\"admin\", \"0x...\");"
+ },
+ "methods": [
+ {
+ "name": "get",
+ "summary": "Call this to get a list of addresses that are members of a specific role.\n\n",
+ "remarks": "\n\nSee {@link ContractRoles.getAll} to get get a list of addresses for all supported roles on the contract.\n\n",
+ "examples": {
+ "javascript": "const minterAddresses: string[] = await contract.getRoleMemberList(\"minter\");"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.ContractRoles.get"
+ }
+ },
+ {
+ "name": "setAll",
+ "summary": "Call this to OVERWRITE the list of addresses that are members of specific roles.\n\nEvery role in the list will be overwritten with the new list of addresses provided with them. If you want to add or remove addresses for a single address use {@link ContractRoles.grant} and {@link ContractRoles.revoke} respectively instead.\n\n",
+ "remarks": null,
+ "examples": {
+ "javascript": "const minterAddresses: string[] = await contract.getRoleMemberList(\"minter\");\nawait contract.setAll({\n minter: []\n});\nconsole.log(await contract.getRoleMemberList(\"minter\")); // No matter what members had the role before, the new list will be set to []"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.ContractRoles.setAll"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.ContractRoles"
+ }
+ },
+ "Royalty": {
+ "name": "ContractRoyalty",
+ "summary": "Handle contract royalties\n\n",
+ "remarks": "\n\nConfigure royalties for an entire contract or a particular token.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nconst royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();\nawait contract.roles.setTokenRoyaltyInfo(tokenId, {\n seller_fee_basis_points: 100, // 1% royalty fee\n fee_recipient: \"0x...\", // the fee recipient\n});"
+ },
+ "methods": [],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.ContractRoyalty"
+ }
+ },
+ "ERC1155": {
+ "name": "Erc1155",
+ "summary": "Standard ERC1155 NFT functions\n\n",
+ "remarks": "\n\nBasic functionality for a ERC1155 contract that handles IPFS storage for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.edition.transfer(walletAddress, tokenId, quantity);"
+ },
+ "methods": [
+ {
+ "name": "airdrop",
+ "summary": "Airdrop multiple NFTs\n\n",
+ "remarks": "\n\nAirdrop one or multiple NFTs to the provided wallet addresses.\n\n",
+ "examples": {
+ "javascript": "// Array of objects of addresses and quantities to airdrop NFTs to\nconst addresses = [\n {\n address: \"0x...\",\n quantity: 2,\n },\n {\n address: \"0x...\",\n quantity: 3,\n },\n];\nconst tokenId = \"0\";\nawait contract.airdrop(addresses, tokenId);\n\n// You can also pass an array of addresses, it will airdrop 1 NFT per address\nconst addresses = [\n \"0x...\", \"0x...\", \"0x...\",\n]\nconst tokenId = \"0\";\nawait contract.airdrop(addresses, tokenId);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155.airdrop"
+ }
+ },
+ {
+ "name": "balanceOf",
+ "summary": "Get NFT Balance\n\n",
+ "remarks": "\n\nGet a wallets NFT balance (number of NFTs in this contract owned by the wallet).\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet to check NFT balance\nconst walletAddress = \"{{wallet_address}}\";\nconst tokenId = 0; // Id of the NFT to check\nconst balance = await contract.balanceOf(walletAddress, tokenId);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155.balanceOf"
+ }
+ },
+ {
+ "name": "get",
+ "summary": "Get a single NFT Metadata\n\n",
+ "remarks": null,
+ "examples": {
+ "javascript": "const nft = await contract.get(\"0\");"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155.get"
+ }
+ },
+ {
+ "name": "transfer",
+ "summary": "Transfer a single NFT\n\n",
+ "remarks": "\n\nTransfer an NFT from the connected wallet to another wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet you want to send the NFT to\nconst toAddress = \"{{wallet_address}}\";\nconst tokenId = \"0\"; // The token ID of the NFT you want to send\nconst amount = 3; // How many copies of the NFTs to transfer\nawait contract.transfer(toAddress, tokenId, amount);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155.transfer"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155"
+ }
+ },
+ "ERC1155BatchMintable": {
+ "name": "Erc1155BatchMintable",
+ "summary": "Mint Many ERC1155 NFTs at once\n\n",
+ "remarks": "\n\nNFT batch minting functionality that handles IPFS storage for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.edition.mint.batch.to(walletAddress, [nftMetadataWithSupply1, nftMetadataWithSupply2, ...]);"
+ },
+ "methods": [
+ {
+ "name": "to",
+ "summary": "Mint Many NFTs with limited supplies\n\n",
+ "remarks": "\n\nMint many different NFTs with limited supplies to a specified wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet you want to mint the NFT to\nconst toAddress = \"{{wallet_address}}\"\n\n// Custom metadata and supplies of your NFTs\nconst metadataWithSupply = [{\n supply: 50, // The number of this NFT you want to mint\n metadata: {\n name: \"Cool NFT #1\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/image.png\"), // This can be an image url or file\n },\n}, {\n supply: 100,\n metadata: {\n name: \"Cool NFT #2\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/image.png\"), // This can be an image url or file\n },\n}];\n\nconst tx = await contract.edition.mint.batch.to(toAddress, metadataWithSupply);\nconst receipt = tx[0].receipt; // same transaction receipt for all minted NFTs\nconst firstTokenId = tx[0].id; // token id of the first minted NFT\nconst firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155BatchMintable.to"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155BatchMintable"
+ }
+ },
+ "ERC1155Enumerable": {
+ "name": "Erc1155Enumerable",
+ "summary": "List ERC1155 NFTs\n\n",
+ "remarks": "\n\nEasily list all the NFTs in a ERC1155 contract.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nconst nfts = await contract.edition.query.all();"
+ },
+ "methods": [
+ {
+ "name": "all",
+ "summary": "Get All NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with every NFT in this contract.\n\nBy default, returns the first 100 NFTs, use queryParams to fetch more.\n\n",
+ "examples": {
+ "javascript": "const nfts = await contract.edition.query.all();"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155Enumerable.all"
+ }
+ },
+ {
+ "name": "owned",
+ "summary": "Get Owned NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with the NFTs owned by a specific wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet to get the NFTs of\nconst address = \"{{wallet_address}}\";\nconst nfts = await contract.edition.query.owned(address);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155Enumerable.owned"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155Enumerable"
+ }
+ },
+ "ERC1155Mintable": {
+ "name": "Erc1155Mintable",
+ "summary": "Mint ERC1155 NFTs\n\n",
+ "remarks": "\n\nNFT minting functionality that handles IPFS storage for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.edition.mint.to(walletAddress, nftMetadata);"
+ },
+ "methods": [
+ {
+ "name": "to",
+ "summary": "Mint an NFT with a limited supply\n\n",
+ "remarks": "\n\nMint an NFT with a limited supply to a specified wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet you want to mint the NFT to\nconst toAddress = \"{{wallet_address}}\"\n\n// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.\nconst metadata = {\n name: \"Cool NFT\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/image.png\"), // This can be an image url or file\n}\n\nconst metadataWithSupply = {\n metadata,\n supply: 1000, // The number of this NFT you want to mint\n}\n\nconst tx = await contract.mintTo(toAddress, metadataWithSupply);\nconst receipt = tx.receipt; // the transaction receipt\nconst tokenId = tx.id; // the id of the NFT minted\nconst nft = await tx.data(); // (optional) fetch details of minted NFT"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155Mintable.to"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc1155Mintable"
+ }
+ },
+ "ERC20": {
+ "name": "Erc20",
+ "summary": "Standard ERC20 Token functions\n\n",
+ "remarks": "\n\nBasic functionality for a ERC20 contract that handles all unit transformation for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.token.transfer(walletAddress, amount);"
+ },
+ "methods": [
+ {
+ "name": "allowance",
+ "summary": "Get Token Allowance\n\n",
+ "remarks": "\n\nGet 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",
+ "examples": {
+ "javascript": "// Address of the wallet to check token allowance\nconst spenderAddress = \"0x...\";\nconst allowance = await contract.allowanceOf(otherAddress);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.allowance"
+ }
+ },
+ {
+ "name": "allowanceOf",
+ "summary": "Get Token Allowance\n\n",
+ "remarks": "\n\nGet 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",
+ "examples": {
+ "javascript": "// Address of the wallet who owns the funds\nconst owner = \"{{wallet_address}}\";\n// Address of the wallet to check token allowance\nconst spender = \"0x...\";\nconst allowance = await contract.allowanceOf(owner, spender);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.allowanceOf"
+ }
+ },
+ {
+ "name": "balance",
+ "summary": "Get Token Balance for the currently connected wallet\n\n",
+ "remarks": "\n\nGet a wallets token balance.\n\n",
+ "examples": {
+ "javascript": "const balance = await contract.balance();\nconsole.log(balance);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.balance"
+ }
+ },
+ {
+ "name": "balanceOf",
+ "summary": "Get Token Balance\n\n",
+ "remarks": "\n\nGet a wallets token balance.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet to check token balance\nconst walletAddress = \"{{wallet_address}}\";\nconst balance = await contract.balanceOf(walletAddress);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.balanceOf"
+ }
+ },
+ {
+ "name": "get",
+ "summary": "Get the token Metadata (name, symbol, etc...)\n\n",
+ "remarks": null,
+ "examples": {
+ "javascript": "const token = await contract.get();"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.get"
+ }
+ },
+ {
+ "name": "setAllowance",
+ "summary": "Allows the specified `spender` wallet to transfer the given `amount` of tokens to another wallet\n\n",
+ "remarks": null,
+ "examples": {
+ "javascript": "// Address of the wallet to allow transfers from\nconst spenderAddress = \"0x...\";\n// The number of tokens to give as allowance\nconst amount = 100\nawait contract.setAllowance(spenderAddress, amount);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.setAllowance"
+ }
+ },
+ {
+ "name": "transfer",
+ "summary": "Transfer Tokens\n\n",
+ "remarks": "\n\nTransfer tokens from the connected wallet to another wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet you want to send the tokens to\nconst toAddress = \"0x...\";\n// The amount of tokens you want to send\nconst amount = 0.1;\nawait contract.transfer(toAddress, amount);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.transfer"
+ }
+ },
+ {
+ "name": "transferBatch",
+ "summary": "Transfer Tokens To Many Wallets\n\n",
+ "remarks": "\n\nMint tokens from the connected wallet to many wallets\n\n",
+ "examples": {
+ "javascript": "// Data of the tokens you want to mint\nconst 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\nawait contract.transferBatch(data);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.transferBatch"
+ }
+ },
+ {
+ "name": "transferFrom",
+ "summary": "Transfer Tokens From Address\n\n",
+ "remarks": "\n\nTransfer tokens from one wallet to another\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet sending the tokens\nconst fromAddress = \"{{wallet_address}}\";\n// Address of the wallet you want to send the tokens to\nconst toAddress = \"0x...\";\n// The number of tokens you want to send\nconst amount = 1.2\n// Note that the connected wallet must have approval to transfer the tokens of the fromAddress\nawait contract.transferFrom(fromAddress, toAddress, amount);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20.transferFrom"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20"
+ }
+ },
+ "ERC20BatchMintable": {
+ "name": "Erc20BatchMintable",
+ "summary": "Mint Many ERC20 Tokens at once\n\n",
+ "remarks": "\n\nToken batch minting functionality that handles unit parsing for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.token.mint.batch.to(walletAddress, [nftMetadata1, nftMetadata2, ...]);"
+ },
+ "methods": [
+ {
+ "name": "to",
+ "summary": "Mint Tokens To Many Wallets\n\n",
+ "remarks": "\n\nMint tokens to many wallets in one transaction.\n\n",
+ "examples": {
+ "javascript": "// Data of the tokens you want to mint\nconst 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\nawait contract.mintBatchTo(data);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20BatchMintable.to"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20BatchMintable"
+ }
+ },
+ "ERC20Mintable": {
+ "name": "Erc20Mintable",
+ "summary": "Mint ERC20 Tokens\n\n",
+ "remarks": "\n\nToken minting functionality that handles unit parsing for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.nft.mint.to(walletAddress, nftMetadata);"
+ },
+ "methods": [
+ {
+ "name": "to",
+ "summary": "Mint Tokens\n\n",
+ "remarks": "\n\nMint tokens to a specified address.\n\n",
+ "examples": {
+ "javascript": "const toAddress = \"{{wallet_address}}\"; // Address of the wallet you want to mint the tokens to\nconst amount = \"1.5\"; // The amount of this token you want to mint\nawait contract.mintTo(toAddress, amount);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20Mintable.to"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc20Mintable"
+ }
+ },
+ "ERC721": {
+ "name": "Erc721",
+ "summary": "Standard ERC721 NFT functions\n\n",
+ "remarks": "\n\nBasic functionality for a ERC721 contract that handles IPFS storage for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.nft.transfer(walletAddress, tokenId);"
+ },
+ "methods": [
+ {
+ "name": "balanceOf",
+ "summary": "Get NFT Balance\n\n",
+ "remarks": "\n\nGet a wallets NFT balance (number of NFTs in this contract owned by the wallet).\n\n",
+ "examples": {
+ "javascript": "const walletAddress = \"{{wallet_address}}\";\nconst balance = await contract.balanceOf(walletAddress);\nconsole.log(balance);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721.balanceOf"
+ }
+ },
+ {
+ "name": "get",
+ "summary": "Get a single NFT Metadata\n\n",
+ "remarks": null,
+ "examples": {
+ "javascript": "const tokenId = 0;\nconst nft = await contract.get(tokenId);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721.get"
+ }
+ },
+ {
+ "name": "transfer",
+ "summary": "Transfer a single NFT\n\n",
+ "remarks": "\n\nTransfer an NFT from the connected wallet to another wallet.\n\n",
+ "examples": {
+ "javascript": "const walletAddress = \"{{wallet_address}}\";\nconst tokenId = 0;\nawait contract.transfer(walletAddress, tokenId);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721.transfer"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721"
+ }
+ },
+ "ERC721BatchMintable": {
+ "name": "Erc721BatchMintable",
+ "summary": "Mint Many ERC721 NFTs at once\n\n",
+ "remarks": "\n\nNFT batch minting functionality that handles IPFS storage for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.nft.mint.batch.to(walletAddress, [nftMetadata1, nftMetadata2, ...]);"
+ },
+ "methods": [
+ {
+ "name": "to",
+ "summary": "Mint Many unique NFTs\n\n",
+ "remarks": "\n\nMint many unique NFTs at once to a specified wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet you want to mint the NFT to\nconst walletAddress = \"{{wallet_address}}\";\n\n// Custom metadata of the NFTs you want to mint.\nconst metadatas = [{\n name: \"Cool NFT #1\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/image.png\"), // This can be an image url or file\n}, {\n name: \"Cool NFT #2\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/other/image.png\"),\n}];\n\nconst tx = await contract.mintBatchTo(walletAddress, metadatas);\nconst receipt = tx[0].receipt; // same transaction receipt for all minted NFTs\nconst firstTokenId = tx[0].id; // token id of the first minted NFT\nconst firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721BatchMintable.to"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721BatchMintable"
+ }
+ },
+ "ERC721Enumerable": {
+ "name": "Erc721Enumerable",
+ "summary": "List owned ERC721 NFTs\n\n",
+ "remarks": "\n\nEasily list all the NFTs from a ERC721 contract, owned by a certain wallet.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nconst walletAddress = \"0x...\";\nconst ownedNFTs = await contract.nft.query.owned.all(walletAddress);"
+ },
+ "methods": [
+ {
+ "name": "all",
+ "summary": "Get Owned NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with the NFTs owned by a specific wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet to get the NFTs of\nconst address = \"{{wallet_address}}\";\nconst nfts = await contract.query.owned.all(address);"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721Enumerable.all"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721Enumerable"
+ }
+ },
+ "ERC721Mintable": {
+ "name": "Erc721Mintable",
+ "summary": "Mint ERC721 NFTs\n\n",
+ "remarks": "\n\nNFT minting functionality that handles IPFS storage for you.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nawait contract.nft.mint.to(walletAddress, nftMetadata);"
+ },
+ "methods": [
+ {
+ "name": "to",
+ "summary": "Mint a unique NFT\n\n",
+ "remarks": "\n\nMint a unique NFT to a specified wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet you want to mint the NFT to\nconst walletAddress = \"{{wallet_address}}\";\n\n// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.\nconst metadata = {\n name: \"Cool NFT\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/image.png\"), // This can be an image url or file\n};\n\nconst tx = await contract.mint.to(walletAddress, metadata);\nconst receipt = tx.receipt; // the transaction receipt\nconst tokenId = tx.id; // the id of the NFT minted\nconst nft = await tx.data(); // (optional) fetch details of minted NFT"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721Mintable.to"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721Mintable"
+ }
+ },
+ "ERC721Supply": {
+ "name": "Erc721Supply",
+ "summary": "List ERC721 NFTs\n\n",
+ "remarks": "\n\nEasily list all the NFTs in a ERC721 contract.\n\n",
+ "examples": {
+ "javascript": "const contract = sdk.getContract(\"{{contract_address}}\");\nconst nfts = await contract.nft.query.all();"
+ },
+ "methods": [
+ {
+ "name": "all",
+ "summary": "Get All Minted NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with every NFT in this contract.\n\nBy default, returns the first 100 NFTs, use queryParams to fetch more.\n\n",
+ "examples": {
+ "javascript": "const nfts = await contract.query.all();"
+ },
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721Supply.all"
+ }
+ }
+ ],
+ "properties": [],
+ "reference": {
+ "javascript": "https://docs.thirdweb.com/typescript/sdk.Erc721Supply"
+ }
+ }
+}
\ No newline at end of file
diff --git a/docs/sdk.contractplatformfee.featurename.md b/docs/sdk.contractplatformfee.featurename.md
new file mode 100644
index 000000000..8dc607e64
--- /dev/null
+++ b/docs/sdk.contractplatformfee.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [ContractPlatformFee](./sdk.contractplatformfee.md) > [featureName](./sdk.contractplatformfee.featurename.md)
+
+## ContractPlatformFee.featureName property
+
+Signature:
+
+```typescript
+featureName: "PlatformFee";
+```
diff --git a/docs/sdk.contractplatformfee.md b/docs/sdk.contractplatformfee.md
index d1f216927..55fdd32ca 100644
--- a/docs/sdk.contractplatformfee.md
+++ b/docs/sdk.contractplatformfee.md
@@ -4,12 +4,29 @@
## ContractPlatformFee class
-Handles primary sales recipients for a Contract
+Handle platform fees and recipients
Signature:
```typescript
-export declare class ContractPlatformFee
+export declare class ContractPlatformFee implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Configure platform fees for a contract, which can be applied on certain paid transactions
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+const feeInfo = await contract.platformFee.get();
+await contract.platformFee.set({
+ platform_fee_basis_points: 100, // 1% fee
+ platform_fee_recipient: "0x..." // the fee recipient
+})
```
## Constructors
@@ -18,6 +35,12 @@ export declare class ContractPlatformFee
| --- | --- | --- |
| [(constructor)(contractWrapper)](./sdk.contractplatformfee._constructor_.md) | | Constructs a new instance of the ContractPlatformFee
class |
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.contractplatformfee.featurename.md) | | "PlatformFee" | |
+
## Methods
| Method | Modifiers | Description |
diff --git a/docs/sdk.contractprimarysale.featurename.md b/docs/sdk.contractprimarysale.featurename.md
new file mode 100644
index 000000000..23aaaa593
--- /dev/null
+++ b/docs/sdk.contractprimarysale.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [ContractPrimarySale](./sdk.contractprimarysale.md) > [featureName](./sdk.contractprimarysale.featurename.md)
+
+## ContractPrimarySale.featureName property
+
+Signature:
+
+```typescript
+featureName: "PrimarySale";
+```
diff --git a/docs/sdk.contractprimarysale.md b/docs/sdk.contractprimarysale.md
index 91ee7099a..afbe0920d 100644
--- a/docs/sdk.contractprimarysale.md
+++ b/docs/sdk.contractprimarysale.md
@@ -4,12 +4,26 @@
## ContractPrimarySale class
-Handles primary sales recipients for a Contract
+Handle primary sales recipients
Signature:
```typescript
-export declare class ContractPrimarySale
+export declare class ContractPrimarySale implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Configure primary sale recipients for an entire contract.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+const salesRecipient = await contract.sales.getRecipient();
+await contract.roles.setRecipient(recipientWalletAddress);
```
## Constructors
@@ -18,6 +32,12 @@ export declare class ContractPrimarySale
| --- | --- | --- |
| [(constructor)(contractWrapper)](./sdk.contractprimarysale._constructor_.md) | | Constructs a new instance of the ContractPrimarySale
class |
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.contractprimarysale.featurename.md) | | "PrimarySale" | |
+
## Methods
| Method | Modifiers | Description |
diff --git a/docs/sdk.contractroles.featurename.md b/docs/sdk.contractroles.featurename.md
new file mode 100644
index 000000000..cb4a7fbc8
--- /dev/null
+++ b/docs/sdk.contractroles.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [ContractRoles](./sdk.contractroles.md) > [featureName](./sdk.contractroles.featurename.md)
+
+## ContractRoles.featureName property
+
+Signature:
+
+```typescript
+featureName: "Permissions";
+```
diff --git a/docs/sdk.contractroles.md b/docs/sdk.contractroles.md
index 650f80c2b..56e8d0321 100644
--- a/docs/sdk.contractroles.md
+++ b/docs/sdk.contractroles.md
@@ -4,12 +4,26 @@
## ContractRoles class
-Handles Contract roles and permissions
+Handle contract permissions
Signature:
```typescript
-export declare class ContractRoles
+export declare class ContractRoles implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Configure roles and permissions for a contract, to restrict certain actions.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+const rolesAndMembers = await contract.roles.getAll();
+await contract.roles.grantRole("admin", "0x...");
```
## Constructors
@@ -18,6 +32,12 @@ export declare class ContractRolesContractRoles class |
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.contractroles.featurename.md) | | "Permissions" | |
+
## Methods
| Method | Modifiers | Description |
diff --git a/docs/sdk.contractroyalty.featurename.md b/docs/sdk.contractroyalty.featurename.md
new file mode 100644
index 000000000..1384dc783
--- /dev/null
+++ b/docs/sdk.contractroyalty.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [ContractRoyalty](./sdk.contractroyalty.md) > [featureName](./sdk.contractroyalty.featurename.md)
+
+## ContractRoyalty.featureName property
+
+Signature:
+
+```typescript
+featureName: "Royalty";
+```
diff --git a/docs/sdk.contractroyalty.md b/docs/sdk.contractroyalty.md
index 539c21784..c225881eb 100644
--- a/docs/sdk.contractroyalty.md
+++ b/docs/sdk.contractroyalty.md
@@ -4,12 +4,29 @@
## ContractRoyalty class
-Handles Contract royalties
+Handle contract royalties
Signature:
```typescript
-export declare class ContractRoyalty
+export declare class ContractRoyalty implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Configure royalties for an entire contract or a particular token.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();
+await contract.roles.setTokenRoyaltyInfo(tokenId, {
+ seller_fee_basis_points: 100, // 1% royalty fee
+ fee_recipient: "0x...", // the fee recipient
+});
```
## Constructors
@@ -18,6 +35,12 @@ export declare class ContractRoyaltyContractRoyalty class |
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.contractroyalty.featurename.md) | | "Royalty" | |
+
## Methods
| Method | Modifiers | Description |
diff --git a/docs/sdk.edition.getall.md b/docs/sdk.edition.getall.md
index 7ee9aa60b..1b875b5ae 100644
--- a/docs/sdk.edition.getall.md
+++ b/docs/sdk.edition.getall.md
@@ -4,7 +4,7 @@
## Edition.getAll() method
-Get All NFTs
+Get All Minted NFTs
Signature:
@@ -30,3 +30,10 @@ Get all the data associated with every NFT in this contract.
By default, returns the first 100 NFTs, use queryParams to fetch more.
+## Example
+
+
+```javascript
+const nfts = await contract.getAll();
+```
+
diff --git a/docs/sdk.edition.getowned.md b/docs/sdk.edition.getowned.md
index 86853c93f..8a4faea15 100644
--- a/docs/sdk.edition.getowned.md
+++ b/docs/sdk.edition.getowned.md
@@ -28,3 +28,12 @@ The NFT metadata for all NFTs in the contract.
Get all the data associated with the NFTs owned by a specific wallet.
+## Example
+
+
+```javascript
+// Address of the wallet to get the NFTs of
+const address = "{{wallet_address}}";
+const nfts = await contract.getOwned(address);
+```
+
diff --git a/docs/sdk.edition.md b/docs/sdk.edition.md
index 1ba88f07b..71cafdd15 100644
--- a/docs/sdk.edition.md
+++ b/docs/sdk.edition.md
@@ -53,7 +53,7 @@ const contract = sdk.getEdition("{{contract_address}}");
| Method | Modifiers | Description |
| --- | --- | --- |
| [burn(tokenId, amount)](./sdk.edition.burn.md) | | Burn a single NFT |
-| [getAll(queryParams)](./sdk.edition.getall.md) | | Get All NFTs |
+| [getAll(queryParams)](./sdk.edition.getall.md) | | Get All Minted NFTs |
| [getOwned(walletAddress)](./sdk.edition.getowned.md) | | Get Owned NFTs |
| [getTotalCount()](./sdk.edition.gettotalcount.md) | | Get the number of NFTs minted |
| [isTransferRestricted()](./sdk.edition.istransferrestricted.md) | | Get whether users can transfer NFTs from this contract |
diff --git a/docs/sdk.erc1155.balanceof.md b/docs/sdk.erc1155.balanceof.md
index 1bc1a0a4e..43eee4819 100644
--- a/docs/sdk.erc1155.balanceof.md
+++ b/docs/sdk.erc1155.balanceof.md
@@ -32,11 +32,8 @@ Get a wallets NFT balance (number of NFTs in this contract owned by the wallet).
```javascript
// Address of the wallet to check NFT balance
-const address = "{{wallet_address}}";
-// Id of the NFT to check
-const tokenId = 0;
-
-const balance = await contract.balanceOf(address, tokenId);
-console.log(balance);
+const walletAddress = "{{wallet_address}}";
+const tokenId = 0; // Id of the NFT to check
+const balance = await contract.balanceOf(walletAddress, tokenId);
```
diff --git a/docs/sdk.erc1155.featurename.md b/docs/sdk.erc1155.featurename.md
new file mode 100644
index 000000000..af0c7dfcd
--- /dev/null
+++ b/docs/sdk.erc1155.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155](./sdk.erc1155.md) > [featureName](./sdk.erc1155.featurename.md)
+
+## Erc1155.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC1155";
+```
diff --git a/docs/sdk.erc1155.get.md b/docs/sdk.erc1155.get.md
index 7adfb744a..39476133d 100644
--- a/docs/sdk.erc1155.get.md
+++ b/docs/sdk.erc1155.get.md
@@ -29,6 +29,5 @@ The NFT metadata
```javascript
const nft = await contract.get("0");
-console.log(nft);
```
diff --git a/docs/sdk.erc1155.md b/docs/sdk.erc1155.md
index fde88a00c..1aa42ee6d 100644
--- a/docs/sdk.erc1155.md
+++ b/docs/sdk.erc1155.md
@@ -4,14 +4,26 @@
## Erc1155 class
-Standard ERC1155 functions
+Standard ERC1155 NFT functions
Signature:
```typescript
-export declare class Erc1155 implements UpdateableNetwork
+export declare class Erc1155 implements UpdateableNetwork, DetectableFeature
+```
+Implements: UpdateableNetwork, DetectableFeature
+
+## Remarks
+
+Basic functionality for a ERC1155 contract that handles IPFS storage for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.edition.transfer(walletAddress, tokenId, quantity);
```
-Implements: UpdateableNetwork
## Constructors
@@ -24,7 +36,8 @@ export declare class Erc1155
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [contractWrapper](./sdk.erc1155.contractwrapper.md) | | ContractWrapper<T> | |
-| [mint](./sdk.erc1155.mint.md) | | Erc1155Mintable \| undefined | |
+| [featureName](./sdk.erc1155.featurename.md) | | "ERC1155" | |
+| [mint](./sdk.erc1155.mint.md) | | [Erc1155Mintable](./sdk.erc1155mintable.md) \| undefined | |
| [options](./sdk.erc1155.options.md) | | [SDKOptions](./sdk.sdkoptions.md) | |
| [query](./sdk.erc1155.query.md) | | [Erc1155Enumerable](./sdk.erc1155enumerable.md) \| undefined | |
| [storage](./sdk.erc1155.storage.md) | | [IStorage](./sdk.istorage.md) | |
diff --git a/docs/sdk.erc1155.transfer.md b/docs/sdk.erc1155.transfer.md
index 7ee8591fc..df07da39f 100644
--- a/docs/sdk.erc1155.transfer.md
+++ b/docs/sdk.erc1155.transfer.md
@@ -35,12 +35,8 @@ Transfer an NFT from the connected wallet to another wallet.
```javascript
// Address of the wallet you want to send the NFT to
const toAddress = "{{wallet_address}}";
-
-// The token ID of the NFT you want to send
-const tokenId = "0";
-// How many copies of the NFTs to transfer
-const amount = 3;
-
+const tokenId = "0"; // The token ID of the NFT you want to send
+const amount = 3; // How many copies of the NFTs to transfer
await contract.transfer(toAddress, tokenId, amount);
```
diff --git a/docs/sdk.erc1155batchmintable._constructor_.md b/docs/sdk.erc1155batchmintable._constructor_.md
new file mode 100644
index 000000000..1ed9e2872
--- /dev/null
+++ b/docs/sdk.erc1155batchmintable._constructor_.md
@@ -0,0 +1,22 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155BatchMintable](./sdk.erc1155batchmintable.md) > [(constructor)](./sdk.erc1155batchmintable._constructor_.md)
+
+## Erc1155BatchMintable.(constructor)
+
+Constructs a new instance of the `Erc1155BatchMintable` class
+
+Signature:
+
+```typescript
+constructor(erc1155: Erc1155, contractWrapper: ContractWrapper, storage: IStorage);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| erc1155 | [Erc1155](./sdk.erc1155.md)<BaseERC1155> | |
+| contractWrapper | ContractWrapper<IMintableERC1155 & IMulticall> | |
+| storage | [IStorage](./sdk.istorage.md) | |
+
diff --git a/docs/sdk.erc1155batchmintable.featurename.md b/docs/sdk.erc1155batchmintable.featurename.md
new file mode 100644
index 000000000..fc0b6f62a
--- /dev/null
+++ b/docs/sdk.erc1155batchmintable.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155BatchMintable](./sdk.erc1155batchmintable.md) > [featureName](./sdk.erc1155batchmintable.featurename.md)
+
+## Erc1155BatchMintable.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC1155BatchMintable";
+```
diff --git a/docs/sdk.erc1155batchmintable.md b/docs/sdk.erc1155batchmintable.md
new file mode 100644
index 000000000..90722f957
--- /dev/null
+++ b/docs/sdk.erc1155batchmintable.md
@@ -0,0 +1,45 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155BatchMintable](./sdk.erc1155batchmintable.md)
+
+## Erc1155BatchMintable class
+
+Mint Many ERC1155 NFTs at once
+
+Signature:
+
+```typescript
+export declare class Erc1155BatchMintable implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+NFT batch minting functionality that handles IPFS storage for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.edition.mint.batch.to(walletAddress, [nftMetadataWithSupply1, nftMetadataWithSupply2, ...]);
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(erc1155, contractWrapper, storage)](./sdk.erc1155batchmintable._constructor_.md) | | Constructs a new instance of the Erc1155BatchMintable
class |
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.erc1155batchmintable.featurename.md) | | "ERC1155BatchMintable" | |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [to(to, metadataWithSupply)](./sdk.erc1155batchmintable.to.md) | | Mint Many NFTs with limited supplies |
+
diff --git a/docs/sdk.erc1155batchmintable.to.md b/docs/sdk.erc1155batchmintable.to.md
new file mode 100644
index 000000000..d9f191fb2
--- /dev/null
+++ b/docs/sdk.erc1155batchmintable.to.md
@@ -0,0 +1,59 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155BatchMintable](./sdk.erc1155batchmintable.md) > [to](./sdk.erc1155batchmintable.to.md)
+
+## Erc1155BatchMintable.to() method
+
+Mint Many NFTs with limited supplies
+
+Signature:
+
+```typescript
+to(to: string, metadataWithSupply: EditionMetadataOrUri[]): Promise[]>;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| to | string | |
+| metadataWithSupply | [EditionMetadataOrUri](./sdk.editionmetadataoruri.md)\[\] | |
+
+Returns:
+
+Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)<[EditionMetadata](./sdk.editionmetadata.md)>\[\]>
+
+## Remarks
+
+Mint many different NFTs with limited supplies to a specified wallet.
+
+## Example
+
+
+```javascript
+// Address of the wallet you want to mint the NFT to
+const toAddress = "{{wallet_address}}"
+
+// Custom metadata and supplies of your NFTs
+const metadataWithSupply = [{
+ supply: 50, // The number of this NFT you want to mint
+ metadata: {
+ name: "Cool NFT #1",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+ },
+}, {
+ supply: 100,
+ metadata: {
+ name: "Cool NFT #2",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+ },
+}];
+
+const tx = await contract.edition.mint.batch.to(toAddress, metadataWithSupply);
+const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
+const firstTokenId = tx[0].id; // token id of the first minted NFT
+const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
+```
+
diff --git a/docs/sdk.erc1155enumerable.all.md b/docs/sdk.erc1155enumerable.all.md
index 6e6207eae..e6c0f8878 100644
--- a/docs/sdk.erc1155enumerable.all.md
+++ b/docs/sdk.erc1155enumerable.all.md
@@ -34,7 +34,6 @@ By default, returns the first 100 NFTs, use queryParams to fetch more.
```javascript
-const nfts = await contract.getAll();
-console.log(nfts);
+const nfts = await contract.edition.query.all();
```
diff --git a/docs/sdk.erc1155enumerable.featurename.md b/docs/sdk.erc1155enumerable.featurename.md
new file mode 100644
index 000000000..ae951feb3
--- /dev/null
+++ b/docs/sdk.erc1155enumerable.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155Enumerable](./sdk.erc1155enumerable.md) > [featureName](./sdk.erc1155enumerable.featurename.md)
+
+## Erc1155Enumerable.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC1155Enumerable";
+```
diff --git a/docs/sdk.erc1155enumerable.md b/docs/sdk.erc1155enumerable.md
index 20cfbf732..1e2b3b9fe 100644
--- a/docs/sdk.erc1155enumerable.md
+++ b/docs/sdk.erc1155enumerable.md
@@ -4,10 +4,25 @@
## Erc1155Enumerable class
+List ERC1155 NFTs
+
Signature:
```typescript
-export declare class Erc1155Enumerable
+export declare class Erc1155Enumerable implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Easily list all the NFTs in a ERC1155 contract.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+const nfts = await contract.edition.query.all();
```
## Constructors
@@ -16,6 +31,12 @@ export declare class Erc1155Enumerable
| --- | --- | --- |
| [(constructor)(erc1155, contractWrapper)](./sdk.erc1155enumerable._constructor_.md) | | Constructs a new instance of the Erc1155Enumerable
class |
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.erc1155enumerable.featurename.md) | | "ERC1155Enumerable" | |
+
## Methods
| Method | Modifiers | Description |
diff --git a/docs/sdk.erc1155enumerable.owned.md b/docs/sdk.erc1155enumerable.owned.md
index a0073363b..468b866bb 100644
--- a/docs/sdk.erc1155enumerable.owned.md
+++ b/docs/sdk.erc1155enumerable.owned.md
@@ -34,7 +34,6 @@ Get all the data associated with the NFTs owned by a specific wallet.
```javascript
// Address of the wallet to get the NFTs of
const address = "{{wallet_address}}";
-const nfts = await contract.getOwned(address);
-console.log(nfts);
+const nfts = await contract.edition.query.owned(address);
```
diff --git a/docs/sdk.erc1155mintable._constructor_.md b/docs/sdk.erc1155mintable._constructor_.md
new file mode 100644
index 000000000..8745be4e9
--- /dev/null
+++ b/docs/sdk.erc1155mintable._constructor_.md
@@ -0,0 +1,22 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155Mintable](./sdk.erc1155mintable.md) > [(constructor)](./sdk.erc1155mintable._constructor_.md)
+
+## Erc1155Mintable.(constructor)
+
+Constructs a new instance of the `Erc1155Mintable` class
+
+Signature:
+
+```typescript
+constructor(erc1155: Erc1155, contractWrapper: ContractWrapper, storage: IStorage);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| erc1155 | [Erc1155](./sdk.erc1155.md)<BaseERC1155> | |
+| contractWrapper | ContractWrapper<IMintableERC1155> | |
+| storage | [IStorage](./sdk.istorage.md) | |
+
diff --git a/docs/sdk.erc1155mintable.additionalsupplyto.md b/docs/sdk.erc1155mintable.additionalsupplyto.md
new file mode 100644
index 000000000..189c2d334
--- /dev/null
+++ b/docs/sdk.erc1155mintable.additionalsupplyto.md
@@ -0,0 +1,26 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155Mintable](./sdk.erc1155mintable.md) > [additionalSupplyTo](./sdk.erc1155mintable.additionalsupplyto.md)
+
+## Erc1155Mintable.additionalSupplyTo() method
+
+Increase the supply of an existing NFT and mint it to a given wallet address
+
+Signature:
+
+```typescript
+additionalSupplyTo(to: string, tokenId: BigNumberish, additionalSupply: BigNumberish): Promise>;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| to | string | the address to mint to |
+| tokenId | BigNumberish | the token id of the NFT to increase supply of |
+| additionalSupply | BigNumberish | the additional amount to mint |
+
+Returns:
+
+Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)<[EditionMetadata](./sdk.editionmetadata.md)>>
+
diff --git a/docs/sdk.erc1155mintable.batch.md b/docs/sdk.erc1155mintable.batch.md
new file mode 100644
index 000000000..866358108
--- /dev/null
+++ b/docs/sdk.erc1155mintable.batch.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155Mintable](./sdk.erc1155mintable.md) > [batch](./sdk.erc1155mintable.batch.md)
+
+## Erc1155Mintable.batch property
+
+Batch mint Tokens to many addresses
+
+Signature:
+
+```typescript
+batch: Erc1155BatchMintable | undefined;
+```
diff --git a/docs/sdk.erc1155mintable.featurename.md b/docs/sdk.erc1155mintable.featurename.md
new file mode 100644
index 000000000..d6dd1e220
--- /dev/null
+++ b/docs/sdk.erc1155mintable.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155Mintable](./sdk.erc1155mintable.md) > [featureName](./sdk.erc1155mintable.featurename.md)
+
+## Erc1155Mintable.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC1155Mintable";
+```
diff --git a/docs/sdk.erc1155mintable.md b/docs/sdk.erc1155mintable.md
new file mode 100644
index 000000000..e42b24126
--- /dev/null
+++ b/docs/sdk.erc1155mintable.md
@@ -0,0 +1,47 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155Mintable](./sdk.erc1155mintable.md)
+
+## Erc1155Mintable class
+
+Mint ERC1155 NFTs
+
+Signature:
+
+```typescript
+export declare class Erc1155Mintable implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+NFT minting functionality that handles IPFS storage for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.edition.mint.to(walletAddress, nftMetadata);
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(erc1155, contractWrapper, storage)](./sdk.erc1155mintable._constructor_.md) | | Constructs a new instance of the Erc1155Mintable
class |
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [batch](./sdk.erc1155mintable.batch.md) | | [Erc1155BatchMintable](./sdk.erc1155batchmintable.md) \| undefined | Batch mint Tokens to many addresses |
+| [featureName](./sdk.erc1155mintable.featurename.md) | | "ERC1155Mintable" | |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [additionalSupplyTo(to, tokenId, additionalSupply)](./sdk.erc1155mintable.additionalsupplyto.md) | | Increase the supply of an existing NFT and mint it to a given wallet address |
+| [to(to, metadataWithSupply)](./sdk.erc1155mintable.to.md) | | Mint an NFT with a limited supply |
+
diff --git a/docs/sdk.erc1155mintable.to.md b/docs/sdk.erc1155mintable.to.md
new file mode 100644
index 000000000..957b86daa
--- /dev/null
+++ b/docs/sdk.erc1155mintable.to.md
@@ -0,0 +1,54 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc1155Mintable](./sdk.erc1155mintable.md) > [to](./sdk.erc1155mintable.to.md)
+
+## Erc1155Mintable.to() method
+
+Mint an NFT with a limited supply
+
+Signature:
+
+```typescript
+to(to: string, metadataWithSupply: EditionMetadataOrUri): Promise>;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| to | string | |
+| metadataWithSupply | [EditionMetadataOrUri](./sdk.editionmetadataoruri.md) | |
+
+Returns:
+
+Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)<[EditionMetadata](./sdk.editionmetadata.md)>>
+
+## Remarks
+
+Mint an NFT with a limited supply to a specified wallet.
+
+## Example
+
+
+```javascript
+// Address of the wallet you want to mint the NFT to
+const toAddress = "{{wallet_address}}"
+
+// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
+const metadata = {
+ name: "Cool NFT",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+}
+
+const metadataWithSupply = {
+ metadata,
+ supply: 1000, // The number of this NFT you want to mint
+}
+
+const tx = await contract.mintTo(toAddress, metadataWithSupply);
+const receipt = tx.receipt; // the transaction receipt
+const tokenId = tx.id; // the id of the NFT minted
+const nft = await tx.data(); // (optional) fetch details of minted NFT
+```
+
diff --git a/docs/sdk.erc20.allowance.md b/docs/sdk.erc20.allowance.md
index aea0ec399..763d27893 100644
--- a/docs/sdk.erc20.allowance.md
+++ b/docs/sdk.erc20.allowance.md
@@ -34,8 +34,6 @@ Get the allowance of a 'spender' wallet over the connected wallet's funds - the
```javascript
// Address of the wallet to check token allowance
const spenderAddress = "0x...";
-
const allowance = await contract.allowanceOf(otherAddress);
-console.log(allowance);
```
diff --git a/docs/sdk.erc20.allowanceof.md b/docs/sdk.erc20.allowanceof.md
index 371ef7274..c43b82bc4 100644
--- a/docs/sdk.erc20.allowanceof.md
+++ b/docs/sdk.erc20.allowanceof.md
@@ -34,12 +34,9 @@ Get the allowance of one wallet over another wallet's funds - the allowance of a
```javascript
// Address of the wallet who owns the funds
-const address = "{{wallet_address}}";
-
+const owner = "{{wallet_address}}";
// Address of the wallet to check token allowance
-const spenderAddress = "0x...";
-
-const allowance = await contract.allowanceOf(address, spenderAddress);
-console.log(allowance);
+const spender = "0x...";
+const allowance = await contract.allowanceOf(owner, spender);
```
diff --git a/docs/sdk.erc20.balanceof.md b/docs/sdk.erc20.balanceof.md
index 1ba507b02..5b4e30a6c 100644
--- a/docs/sdk.erc20.balanceof.md
+++ b/docs/sdk.erc20.balanceof.md
@@ -33,9 +33,7 @@ Get a wallets token balance.
```javascript
// Address of the wallet to check token balance
-const address = "{{wallet_address}}";
-
-const balance = await contract.balanceOf(address);
-console.log(balance);
+const walletAddress = "{{wallet_address}}";
+const balance = await contract.balanceOf(walletAddress);
```
diff --git a/docs/sdk.erc20.featurename.md b/docs/sdk.erc20.featurename.md
new file mode 100644
index 000000000..5705d18ee
--- /dev/null
+++ b/docs/sdk.erc20.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20](./sdk.erc20.md) > [featureName](./sdk.erc20.featurename.md)
+
+## Erc20.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC20";
+```
diff --git a/docs/sdk.erc20.get.md b/docs/sdk.erc20.get.md
index df98adc65..f1c21b0c0 100644
--- a/docs/sdk.erc20.get.md
+++ b/docs/sdk.erc20.get.md
@@ -22,6 +22,5 @@ The token metadata
```javascript
const token = await contract.get();
-console.log(token);
```
diff --git a/docs/sdk.erc20.md b/docs/sdk.erc20.md
index 41fa3395a..11eb0bc47 100644
--- a/docs/sdk.erc20.md
+++ b/docs/sdk.erc20.md
@@ -4,14 +4,26 @@
## Erc20 class
-Standard ERC20 functions
+Standard ERC20 Token functions
Signature:
```typescript
-export declare class Erc20 implements UpdateableNetwork
+export declare class Erc20 implements UpdateableNetwork, DetectableFeature
+```
+Implements: UpdateableNetwork, DetectableFeature
+
+## Remarks
+
+Basic functionality for a ERC20 contract that handles all unit transformation for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.token.transfer(walletAddress, amount);
```
-Implements: UpdateableNetwork
## Constructors
@@ -24,7 +36,8 @@ export declare class Erc20 impleme
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [contractWrapper](./sdk.erc20.contractwrapper.md) | | ContractWrapper<T> | |
-| [mint](./sdk.erc20.mint.md) | | Erc20Mintable \| undefined | Mint tokens |
+| [featureName](./sdk.erc20.featurename.md) | | "ERC20" | |
+| [mint](./sdk.erc20.mint.md) | | [Erc20Mintable](./sdk.erc20mintable.md) \| undefined | Mint tokens |
| [options](./sdk.erc20.options.md) | | [SDKOptions](./sdk.sdkoptions.md) | |
| [storage](./sdk.erc20.storage.md) | | [IStorage](./sdk.istorage.md) | |
diff --git a/docs/sdk.erc20.setallowance.md b/docs/sdk.erc20.setallowance.md
index 437ecf7d9..cfe3bf9d7 100644
--- a/docs/sdk.erc20.setallowance.md
+++ b/docs/sdk.erc20.setallowance.md
@@ -29,10 +29,8 @@ Promise<[TransactionResult](./sdk.transactionresult.md)>
```javascript
// Address of the wallet to allow transfers from
const spenderAddress = "0x...";
-
// The number of tokens to give as allowance
const amount = 100
-
await contract.setAllowance(spenderAddress, amount);
```
diff --git a/docs/sdk.erc20.transfer.md b/docs/sdk.erc20.transfer.md
index 35b5a75c0..d8a91850a 100644
--- a/docs/sdk.erc20.transfer.md
+++ b/docs/sdk.erc20.transfer.md
@@ -33,10 +33,8 @@ Transfer tokens from the connected wallet to another wallet.
```javascript
// Address of the wallet you want to send the tokens to
const toAddress = "0x...";
-
// The amount of tokens you want to send
const amount = 0.1;
-
await contract.transfer(toAddress, amount);
```
diff --git a/docs/sdk.erc20.transferfrom.md b/docs/sdk.erc20.transferfrom.md
index 878e3699e..b91296763 100644
--- a/docs/sdk.erc20.transferfrom.md
+++ b/docs/sdk.erc20.transferfrom.md
@@ -34,13 +34,10 @@ Transfer tokens from one wallet to another
```javascript
// Address of the wallet sending the tokens
const fromAddress = "{{wallet_address}}";
-
// Address of the wallet you want to send the tokens to
const toAddress = "0x...";
-
// The number of tokens you want to send
const amount = 1.2
-
// Note that the connected wallet must have approval to transfer the tokens of the fromAddress
await contract.transferFrom(fromAddress, toAddress, amount);
```
diff --git a/docs/sdk.erc20batchmintable._constructor_.md b/docs/sdk.erc20batchmintable._constructor_.md
new file mode 100644
index 000000000..a46678643
--- /dev/null
+++ b/docs/sdk.erc20batchmintable._constructor_.md
@@ -0,0 +1,21 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20BatchMintable](./sdk.erc20batchmintable.md) > [(constructor)](./sdk.erc20batchmintable._constructor_.md)
+
+## Erc20BatchMintable.(constructor)
+
+Constructs a new instance of the `Erc20BatchMintable` class
+
+Signature:
+
+```typescript
+constructor(erc20: Erc20, contractWrapper: ContractWrapper);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| erc20 | [Erc20](./sdk.erc20.md)<BaseERC20> | |
+| contractWrapper | ContractWrapper<IMintableERC20 & IMulticall> | |
+
diff --git a/docs/sdk.erc20batchmintable.featurename.md b/docs/sdk.erc20batchmintable.featurename.md
new file mode 100644
index 000000000..cf51d18b9
--- /dev/null
+++ b/docs/sdk.erc20batchmintable.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20BatchMintable](./sdk.erc20batchmintable.md) > [featureName](./sdk.erc20batchmintable.featurename.md)
+
+## Erc20BatchMintable.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC20BatchMintable";
+```
diff --git a/docs/sdk.erc20batchmintable.md b/docs/sdk.erc20batchmintable.md
new file mode 100644
index 000000000..b0f8ff753
--- /dev/null
+++ b/docs/sdk.erc20batchmintable.md
@@ -0,0 +1,45 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20BatchMintable](./sdk.erc20batchmintable.md)
+
+## Erc20BatchMintable class
+
+Mint Many ERC20 Tokens at once
+
+Signature:
+
+```typescript
+export declare class Erc20BatchMintable implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Token batch minting functionality that handles unit parsing for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.token.mint.batch.to(walletAddress, [nftMetadata1, nftMetadata2, ...]);
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(erc20, contractWrapper)](./sdk.erc20batchmintable._constructor_.md) | | Constructs a new instance of the Erc20BatchMintable
class |
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.erc20batchmintable.featurename.md) | | "ERC20BatchMintable" | |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [to(args)](./sdk.erc20batchmintable.to.md) | | Mint Tokens To Many Wallets |
+
diff --git a/docs/sdk.erc20batchmintable.to.md b/docs/sdk.erc20batchmintable.to.md
new file mode 100644
index 000000000..2a03f5e1b
--- /dev/null
+++ b/docs/sdk.erc20batchmintable.to.md
@@ -0,0 +1,47 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20BatchMintable](./sdk.erc20batchmintable.md) > [to](./sdk.erc20batchmintable.to.md)
+
+## Erc20BatchMintable.to() method
+
+Mint Tokens To Many Wallets
+
+Signature:
+
+```typescript
+to(args: TokenMintInput[]): Promise;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| args | [TokenMintInput](./sdk.tokenmintinput.md)\[\] | |
+
+Returns:
+
+Promise<[TransactionResult](./sdk.transactionresult.md)>
+
+## Remarks
+
+Mint tokens to many wallets in one transaction.
+
+## Example
+
+
+```javascript
+// Data of the tokens you want to mint
+const data = [
+ {
+ toAddress: "{{wallet_address}}", // Address to mint tokens to
+ amount: 0.2, // How many tokens to mint to specified address
+ },
+ {
+ toAddress: "0x...",
+ amount: 1.4,
+ }
+]
+
+await contract.mintBatchTo(data);
+```
+
diff --git a/docs/sdk.erc20mintable._constructor_.md b/docs/sdk.erc20mintable._constructor_.md
new file mode 100644
index 000000000..2061483b1
--- /dev/null
+++ b/docs/sdk.erc20mintable._constructor_.md
@@ -0,0 +1,21 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20Mintable](./sdk.erc20mintable.md) > [(constructor)](./sdk.erc20mintable._constructor_.md)
+
+## Erc20Mintable.(constructor)
+
+Constructs a new instance of the `Erc20Mintable` class
+
+Signature:
+
+```typescript
+constructor(erc20: Erc20, contractWrapper: ContractWrapper);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| erc20 | [Erc20](./sdk.erc20.md)<BaseERC20> | |
+| contractWrapper | ContractWrapper<IMintableERC20> | |
+
diff --git a/docs/sdk.erc20mintable.batch.md b/docs/sdk.erc20mintable.batch.md
new file mode 100644
index 000000000..da3f61337
--- /dev/null
+++ b/docs/sdk.erc20mintable.batch.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20Mintable](./sdk.erc20mintable.md) > [batch](./sdk.erc20mintable.batch.md)
+
+## Erc20Mintable.batch property
+
+Batch mint Tokens to many addresses
+
+Signature:
+
+```typescript
+batch: Erc20BatchMintable | undefined;
+```
diff --git a/docs/sdk.erc20mintable.featurename.md b/docs/sdk.erc20mintable.featurename.md
new file mode 100644
index 000000000..3cbde3a79
--- /dev/null
+++ b/docs/sdk.erc20mintable.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20Mintable](./sdk.erc20mintable.md) > [featureName](./sdk.erc20mintable.featurename.md)
+
+## Erc20Mintable.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC20Mintable";
+```
diff --git a/docs/sdk.erc20mintable.md b/docs/sdk.erc20mintable.md
new file mode 100644
index 000000000..f4ea9879c
--- /dev/null
+++ b/docs/sdk.erc20mintable.md
@@ -0,0 +1,46 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20Mintable](./sdk.erc20mintable.md)
+
+## Erc20Mintable class
+
+Mint ERC20 Tokens
+
+Signature:
+
+```typescript
+export declare class Erc20Mintable implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Token minting functionality that handles unit parsing for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.nft.mint.to(walletAddress, nftMetadata);
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(erc20, contractWrapper)](./sdk.erc20mintable._constructor_.md) | | Constructs a new instance of the Erc20Mintable
class |
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [batch](./sdk.erc20mintable.batch.md) | | [Erc20BatchMintable](./sdk.erc20batchmintable.md) \| undefined | Batch mint Tokens to many addresses |
+| [featureName](./sdk.erc20mintable.featurename.md) | | "ERC20Mintable" | |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [to(to, amount)](./sdk.erc20mintable.to.md) | | Mint Tokens |
+
diff --git a/docs/sdk.erc20mintable.to.md b/docs/sdk.erc20mintable.to.md
new file mode 100644
index 000000000..468bc2452
--- /dev/null
+++ b/docs/sdk.erc20mintable.to.md
@@ -0,0 +1,38 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc20Mintable](./sdk.erc20mintable.md) > [to](./sdk.erc20mintable.to.md)
+
+## Erc20Mintable.to() method
+
+Mint Tokens
+
+Signature:
+
+```typescript
+to(to: string, amount: Amount): Promise;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| to | string | |
+| amount | [Amount](./sdk.amount.md) | |
+
+Returns:
+
+Promise<[TransactionResult](./sdk.transactionresult.md)>
+
+## Remarks
+
+Mint tokens to a specified address.
+
+## Example
+
+
+```javascript
+const toAddress = "{{wallet_address}}"; // Address of the wallet you want to mint the tokens to
+const amount = "1.5"; // The amount of this token you want to mint
+await contract.mintTo(toAddress, amount);
+```
+
diff --git a/docs/sdk.erc721.balanceof.md b/docs/sdk.erc721.balanceof.md
index 1d46c1e3f..2b55e5dfb 100644
--- a/docs/sdk.erc721.balanceof.md
+++ b/docs/sdk.erc721.balanceof.md
@@ -30,10 +30,8 @@ Get a wallets NFT balance (number of NFTs in this contract owned by the wallet).
```javascript
-// Address of the wallet to check NFT balance
-const address = "{{wallet_address}}";
-
-const balance = await contract.balanceOf(address);
+const walletAddress = "{{wallet_address}}";
+const balance = await contract.balanceOf(walletAddress);
console.log(balance);
```
diff --git a/docs/sdk.erc721.featurename.md b/docs/sdk.erc721.featurename.md
new file mode 100644
index 000000000..d2129a4b6
--- /dev/null
+++ b/docs/sdk.erc721.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc721](./sdk.erc721.md) > [featureName](./sdk.erc721.featurename.md)
+
+## Erc721.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC721";
+```
diff --git a/docs/sdk.erc721.get.md b/docs/sdk.erc721.get.md
index 7e090ee75..9e9a75028 100644
--- a/docs/sdk.erc721.get.md
+++ b/docs/sdk.erc721.get.md
@@ -28,7 +28,7 @@ The NFT metadata
```javascript
-const nft = await contract.get("0");
-console.log(nft);
+const tokenId = 0;
+const nft = await contract.get(tokenId);
```
diff --git a/docs/sdk.erc721.md b/docs/sdk.erc721.md
index 4013a9f91..a769068bf 100644
--- a/docs/sdk.erc721.md
+++ b/docs/sdk.erc721.md
@@ -4,14 +4,26 @@
## Erc721 class
-Standard ERC721 functions
+Standard ERC721 NFT functions
Signature:
```typescript
-export declare class Erc721 implements UpdateableNetwork
+export declare class Erc721 implements UpdateableNetwork, DetectableFeature
+```
+Implements: UpdateableNetwork, DetectableFeature
+
+## Remarks
+
+Basic functionality for a ERC721 contract that handles IPFS storage for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.nft.transfer(walletAddress, tokenId);
```
-Implements: UpdateableNetwork
## Constructors
@@ -24,6 +36,7 @@ export declare class Erc721 imp
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [contractWrapper](./sdk.erc721.contractwrapper.md) | | ContractWrapper<T> | |
+| [featureName](./sdk.erc721.featurename.md) | | "ERC721" | |
| [mint](./sdk.erc721.mint.md) | | [Erc721Mintable](./sdk.erc721mintable.md) \| undefined | |
| [options](./sdk.erc721.options.md) | | [SDKOptions](./sdk.sdkoptions.md) | |
| [query](./sdk.erc721.query.md) | | [Erc721Supply](./sdk.erc721supply.md) \| undefined | |
diff --git a/docs/sdk.erc721.transfer.md b/docs/sdk.erc721.transfer.md
index fe8e980da..a108f61f6 100644
--- a/docs/sdk.erc721.transfer.md
+++ b/docs/sdk.erc721.transfer.md
@@ -31,12 +31,8 @@ Transfer an NFT from the connected wallet to another wallet.
```javascript
-// Address of the wallet you want to send the NFT to
-const toAddress = "{{wallet_address}}";
-
-// The token ID of the NFT you want to send
-const tokenId = "0";
-
-await contract.transfer(toAddress, tokenId);
+const walletAddress = "{{wallet_address}}";
+const tokenId = 0;
+await contract.transfer(walletAddress, tokenId);
```
diff --git a/docs/sdk.erc721batchmintable.featurename.md b/docs/sdk.erc721batchmintable.featurename.md
new file mode 100644
index 000000000..5df4fa13f
--- /dev/null
+++ b/docs/sdk.erc721batchmintable.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc721BatchMintable](./sdk.erc721batchmintable.md) > [featureName](./sdk.erc721batchmintable.featurename.md)
+
+## Erc721BatchMintable.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC721BatchMintable";
+```
diff --git a/docs/sdk.erc721batchmintable.md b/docs/sdk.erc721batchmintable.md
index 5d518a649..cd821de39 100644
--- a/docs/sdk.erc721batchmintable.md
+++ b/docs/sdk.erc721batchmintable.md
@@ -4,10 +4,25 @@
## Erc721BatchMintable class
+Mint Many ERC721 NFTs at once
+
Signature:
```typescript
-export declare class Erc721BatchMintable
+export declare class Erc721BatchMintable implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+NFT batch minting functionality that handles IPFS storage for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.nft.mint.batch.to(walletAddress, [nftMetadata1, nftMetadata2, ...]);
```
## Constructors
@@ -16,6 +31,12 @@ export declare class Erc721BatchMintable
| --- | --- | --- |
| [(constructor)(erc721, contractWrapper, storage)](./sdk.erc721batchmintable._constructor_.md) | | Constructs a new instance of the Erc721BatchMintable
class |
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.erc721batchmintable.featurename.md) | | "ERC721BatchMintable" | |
+
## Methods
| Method | Modifiers | Description |
diff --git a/docs/sdk.erc721enumerable.all.md b/docs/sdk.erc721enumerable.all.md
index 72a03e963..fac318388 100644
--- a/docs/sdk.erc721enumerable.all.md
+++ b/docs/sdk.erc721enumerable.all.md
@@ -16,7 +16,7 @@ all(walletAddress?: string): Promise;
| Parameter | Type | Description |
| --- | --- | --- |
-| walletAddress | string | (Optional) |
+| walletAddress | string | (Optional) the wallet address to query, defaults to the connected wallet |
Returns:
@@ -35,6 +35,5 @@ Get all the data associated with the NFTs owned by a specific wallet.
// Address of the wallet to get the NFTs of
const address = "{{wallet_address}}";
const nfts = await contract.query.owned.all(address);
-console.log(nfts);
```
diff --git a/docs/sdk.erc721enumerable.featurename.md b/docs/sdk.erc721enumerable.featurename.md
new file mode 100644
index 000000000..fb1e264bc
--- /dev/null
+++ b/docs/sdk.erc721enumerable.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc721Enumerable](./sdk.erc721enumerable.md) > [featureName](./sdk.erc721enumerable.featurename.md)
+
+## Erc721Enumerable.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC721Enumerable";
+```
diff --git a/docs/sdk.erc721enumerable.md b/docs/sdk.erc721enumerable.md
index 2472c8d5f..d7e1268de 100644
--- a/docs/sdk.erc721enumerable.md
+++ b/docs/sdk.erc721enumerable.md
@@ -4,10 +4,26 @@
## Erc721Enumerable class
+List owned ERC721 NFTs
+
Signature:
```typescript
-export declare class Erc721Enumerable
+export declare class Erc721Enumerable implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Easily list all the NFTs from a ERC721 contract, owned by a certain wallet.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+const walletAddress = "0x...";
+const ownedNFTs = await contract.nft.query.owned.all(walletAddress);
```
## Constructors
@@ -16,6 +32,12 @@ export declare class Erc721Enumerable
| --- | --- | --- |
| [(constructor)(erc721, contractWrapper)](./sdk.erc721enumerable._constructor_.md) | | Constructs a new instance of the Erc721Enumerable
class |
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [featureName](./sdk.erc721enumerable.featurename.md) | | "ERC721Enumerable" | |
+
## Methods
| Method | Modifiers | Description |
diff --git a/docs/sdk.erc721mintable.featurename.md b/docs/sdk.erc721mintable.featurename.md
new file mode 100644
index 000000000..ae7e02ee6
--- /dev/null
+++ b/docs/sdk.erc721mintable.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc721Mintable](./sdk.erc721mintable.md) > [featureName](./sdk.erc721mintable.featurename.md)
+
+## Erc721Mintable.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC721Mintable";
+```
diff --git a/docs/sdk.erc721mintable.md b/docs/sdk.erc721mintable.md
index ea1c1d5b4..b0a444d2f 100644
--- a/docs/sdk.erc721mintable.md
+++ b/docs/sdk.erc721mintable.md
@@ -4,10 +4,25 @@
## Erc721Mintable class
+Mint ERC721 NFTs
+
Signature:
```typescript
-export declare class Erc721Mintable
+export declare class Erc721Mintable implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+NFT minting functionality that handles IPFS storage for you.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+await contract.nft.mint.to(walletAddress, nftMetadata);
```
## Constructors
@@ -21,6 +36,7 @@ export declare class Erc721Mintable
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [batch](./sdk.erc721mintable.batch.md) | | [Erc721BatchMintable](./sdk.erc721batchmintable.md) \| undefined | |
+| [featureName](./sdk.erc721mintable.featurename.md) | | "ERC721Mintable" | |
## Methods
diff --git a/docs/sdk.erc721mintable.to.md b/docs/sdk.erc721mintable.to.md
index 763522944..ae6ea6326 100644
--- a/docs/sdk.erc721mintable.to.md
+++ b/docs/sdk.erc721mintable.to.md
@@ -41,7 +41,7 @@ const metadata = {
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
};
-const tx = await contract.mintTo(walletAddress, metadata);
+const tx = await contract.mint.to(walletAddress, metadata);
const receipt = tx.receipt; // the transaction receipt
const tokenId = tx.id; // the id of the NFT minted
const nft = await tx.data(); // (optional) fetch details of minted NFT
diff --git a/docs/sdk.erc721supply.all.md b/docs/sdk.erc721supply.all.md
index b5a17a956..eee3db986 100644
--- a/docs/sdk.erc721supply.all.md
+++ b/docs/sdk.erc721supply.all.md
@@ -35,6 +35,5 @@ By default, returns the first 100 NFTs, use queryParams to fetch more.
```javascript
const nfts = await contract.query.all();
-console.log(nfts);
```
diff --git a/docs/sdk.erc721supply.featurename.md b/docs/sdk.erc721supply.featurename.md
new file mode 100644
index 000000000..aa646176c
--- /dev/null
+++ b/docs/sdk.erc721supply.featurename.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [Erc721Supply](./sdk.erc721supply.md) > [featureName](./sdk.erc721supply.featurename.md)
+
+## Erc721Supply.featureName property
+
+Signature:
+
+```typescript
+featureName: "ERC721Supply";
+```
diff --git a/docs/sdk.erc721supply.md b/docs/sdk.erc721supply.md
index cb1c98ba2..765f07506 100644
--- a/docs/sdk.erc721supply.md
+++ b/docs/sdk.erc721supply.md
@@ -4,10 +4,25 @@
## Erc721Supply class
+List ERC721 NFTs
+
Signature:
```typescript
-export declare class Erc721Supply
+export declare class Erc721Supply implements DetectableFeature
+```
+Implements: DetectableFeature
+
+## Remarks
+
+Easily list all the NFTs in a ERC721 contract.
+
+## Example
+
+
+```javascript
+const contract = sdk.getContract("{{contract_address}}");
+const nfts = await contract.nft.query.all();
```
## Constructors
@@ -20,6 +35,7 @@ export declare class Erc721Supply
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
+| [featureName](./sdk.erc721supply.featurename.md) | | "ERC721Supply" | |
| [owned](./sdk.erc721supply.owned.md) | | [Erc721Enumerable](./sdk.erc721enumerable.md) \| undefined | |
## Methods
diff --git a/docs/sdk.md b/docs/sdk.md
index 215bed643..c155464d5 100644
--- a/docs/sdk.md
+++ b/docs/sdk.md
@@ -12,27 +12,31 @@
| [ContractEncoder](./sdk.contractencoder.md) | Encodes and decodes Contract functions |
| [ContractEvents](./sdk.contractevents.md) | Listen to Contract events in real time |
| [ContractMetadata](./sdk.contractmetadata.md) | Handles metadata for a Contract |
-| [ContractPlatformFee](./sdk.contractplatformfee.md) | Handles primary sales recipients for a Contract |
-| [ContractPrimarySale](./sdk.contractprimarysale.md) | Handles primary sales recipients for a Contract |
-| [ContractRoles](./sdk.contractroles.md) | Handles Contract roles and permissions |
-| [ContractRoyalty](./sdk.contractroyalty.md) | Handles Contract royalties |
+| [ContractPlatformFee](./sdk.contractplatformfee.md) | Handle platform fees and recipients |
+| [ContractPrimarySale](./sdk.contractprimarysale.md) | Handle primary sales recipients |
+| [ContractRoles](./sdk.contractroles.md) | Handle contract permissions |
+| [ContractRoyalty](./sdk.contractroyalty.md) | Handle contract royalties |
| [DelayedReveal](./sdk.delayedreveal.md) | Handles delayed reveal logic |
| [DropClaimConditions](./sdk.dropclaimconditions.md) | Manages claim conditions for NFT Drop contracts |
| [DropErc1155ClaimConditions](./sdk.droperc1155claimconditions.md) | Manages claim conditions for Edition Drop contracts |
| [DropErc1155History](./sdk.droperc1155history.md) | Manages history for Edition Drop contracts |
| [Edition](./sdk.edition.md) | Create a collection of NFTs that lets you mint multiple copies of each NFT. |
| [EditionDrop](./sdk.editiondrop.md) | Setup a collection of NFTs with a customizable number of each NFT that are minted as users claim them. |
-| [Erc1155](./sdk.erc1155.md) | Standard ERC1155 functions |
-| [Erc1155Enumerable](./sdk.erc1155enumerable.md) | |
+| [Erc1155](./sdk.erc1155.md) | Standard ERC1155 NFT functions |
+| [Erc1155BatchMintable](./sdk.erc1155batchmintable.md) | Mint Many ERC1155 NFTs at once |
+| [Erc1155Enumerable](./sdk.erc1155enumerable.md) | List ERC1155 NFTs |
+| [Erc1155Mintable](./sdk.erc1155mintable.md) | Mint ERC1155 NFTs |
| [Erc1155SignatureMinting](./sdk.erc1155signatureminting.md) | Enables generating dynamic ERC1155 NFTs with rules and an associated signature, which can then be minted by anyone securely |
-| [Erc20](./sdk.erc20.md) | Standard ERC20 functions |
+| [Erc20](./sdk.erc20.md) | Standard ERC20 Token functions |
+| [Erc20BatchMintable](./sdk.erc20batchmintable.md) | Mint Many ERC20 Tokens at once |
+| [Erc20Mintable](./sdk.erc20mintable.md) | Mint ERC20 Tokens |
| [Erc20SignatureMinting](./sdk.erc20signatureminting.md) | Enables generating ERC20 Tokens with rules and an associated signature, which can then be minted by anyone securely |
-| [Erc721](./sdk.erc721.md) | Standard ERC721 functions |
-| [Erc721BatchMintable](./sdk.erc721batchmintable.md) | |
-| [Erc721Enumerable](./sdk.erc721enumerable.md) | |
-| [Erc721Mintable](./sdk.erc721mintable.md) | |
+| [Erc721](./sdk.erc721.md) | Standard ERC721 NFT functions |
+| [Erc721BatchMintable](./sdk.erc721batchmintable.md) | Mint Many ERC721 NFTs at once |
+| [Erc721Enumerable](./sdk.erc721enumerable.md) | List owned ERC721 NFTs |
+| [Erc721Mintable](./sdk.erc721mintable.md) | Mint ERC721 NFTs |
| [Erc721SignatureMinting](./sdk.erc721signatureminting.md) | Enables generating dynamic ERC721 NFTs with rules and an associated signature, which can then be minted by anyone securely |
-| [Erc721Supply](./sdk.erc721supply.md) | |
+| [Erc721Supply](./sdk.erc721supply.md) | List ERC721 NFTs |
| [GasCostEstimator](./sdk.gascostestimator.md) | Estimates the gas cost of Contract calls |
| [IpfsStorage](./sdk.ipfsstorage.md) | IPFS Storage implementation, accepts custom IPFS gateways |
| [Marketplace](./sdk.marketplace.md) | Create your own whitelabel marketplace that enables users to buy and sell any digital assets. |
diff --git a/docs/sdk.nftcollection.getall.md b/docs/sdk.nftcollection.getall.md
index ed5cb518e..ef825728c 100644
--- a/docs/sdk.nftcollection.getall.md
+++ b/docs/sdk.nftcollection.getall.md
@@ -4,7 +4,7 @@
## NFTCollection.getAll() method
-Get Owned NFTs
+Get All Minted NFTs
Signature:
@@ -16,15 +16,25 @@ getAll(queryParams?: QueryAllParams): Promise;
| Parameter | Type | Description |
| --- | --- | --- |
-| queryParams | [QueryAllParams](./sdk.queryallparams.md) | (Optional) |
+| queryParams | [QueryAllParams](./sdk.queryallparams.md) | (Optional) optional filtering to only fetch a subset of results. |
Returns:
Promise<[NFTMetadataOwner](./sdk.nftmetadataowner.md)\[\]>
-The NFT metadata for all NFTs in the contract.
+The NFT metadata for all NFTs queried.
## Remarks
-Get all the data associated with the NFTs owned by a specific wallet.
+Get all the data associated with every NFT in this contract.
+
+By default, returns the first 100 NFTs, use queryParams to fetch more.
+
+## Example
+
+
+```javascript
+const nfts = await contract.getAll();
+console.log(nfts);
+```
diff --git a/docs/sdk.nftcollection.getowned.md b/docs/sdk.nftcollection.getowned.md
index c15dee586..4b3f37ace 100644
--- a/docs/sdk.nftcollection.getowned.md
+++ b/docs/sdk.nftcollection.getowned.md
@@ -4,6 +4,7 @@
## NFTCollection.getOwned() method
+Get Owned NFTs
Signature:
@@ -15,9 +16,25 @@ getOwned(walletAddress?: string): Promise;
| Parameter | Type | Description |
| --- | --- | --- |
-| walletAddress | string | (Optional) |
+| walletAddress | string | (Optional) the wallet address to query, defaults to the connected wallet |
Returns:
Promise<[NFTMetadataOwner](./sdk.nftmetadataowner.md)\[\]>
+The NFT metadata for all NFTs in the contract.
+
+## Remarks
+
+Get all the data associated with the NFTs owned by a specific wallet.
+
+## Example
+
+
+```javascript
+// Address of the wallet to get the NFTs of
+const address = "{{wallet_address}}";
+const nfts = await contract.getOwned(address);
+console.log(nfts);
+```
+
diff --git a/docs/sdk.nftcollection.md b/docs/sdk.nftcollection.md
index f6624b122..1eb2a2be3 100644
--- a/docs/sdk.nftcollection.md
+++ b/docs/sdk.nftcollection.md
@@ -53,13 +53,13 @@ const contract = sdk.getNFTCollection("{{contract_address}}");
| Method | Modifiers | Description |
| --- | --- | --- |
| [burn(tokenId)](./sdk.nftcollection.burn.md) | | Burn a single NFT |
-| [getAll(queryParams)](./sdk.nftcollection.getall.md) | | Get Owned NFTs |
-| [getOwned(walletAddress)](./sdk.nftcollection.getowned.md) | | |
+| [getAll(queryParams)](./sdk.nftcollection.getall.md) | | Get All Minted NFTs |
+| [getOwned(walletAddress)](./sdk.nftcollection.getowned.md) | | Get Owned NFTs |
| [getOwnedTokenIds(walletAddress)](./sdk.nftcollection.getownedtokenids.md) | | |
| [isTransferRestricted()](./sdk.nftcollection.istransferrestricted.md) | | Get whether users can transfer NFTs from this contract |
| [mintBatch(metadata)](./sdk.nftcollection.mintbatch.md) | | Mint Many unique NFTs |
| [mintBatchTo(walletAddress, metadata)](./sdk.nftcollection.mintbatchto.md) | | Mint Many unique NFTs |
| [mintTo(walletAddress, metadata)](./sdk.nftcollection.mintto.md) | | Mint a unique NFT |
| [mintToSelf(metadata)](./sdk.nftcollection.minttoself.md) | | Mint a unique NFT |
-| [totalSupply()](./sdk.nftcollection.totalsupply.md) | | |
+| [totalSupply()](./sdk.nftcollection.totalsupply.md) | | Get the number of NFTs minted |
diff --git a/docs/sdk.nftcollection.mintbatch.md b/docs/sdk.nftcollection.mintbatch.md
index d32996c83..a0412f1a0 100644
--- a/docs/sdk.nftcollection.mintbatch.md
+++ b/docs/sdk.nftcollection.mintbatch.md
@@ -24,5 +24,26 @@ Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)&l
## Remarks
-Mint many unique NFTs at once to a specified wallet.
+Mint many unique NFTs at once to the connected wallet
+
+## Example
+
+
+```javascript*
+// Custom metadata of the NFTs you want to mint.
+const metadatas = [{
+ name: "Cool NFT #1",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+}, {
+ name: "Cool NFT #2",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/other/image.png"),
+}];
+
+const tx = await contract.mintBatch(metadatas);
+const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
+const firstTokenId = tx[0].id; // token id of the first minted NFT
+const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
+```
diff --git a/docs/sdk.nftcollection.mintbatchto.md b/docs/sdk.nftcollection.mintbatchto.md
index ccd7720df..6cea6534d 100644
--- a/docs/sdk.nftcollection.mintbatchto.md
+++ b/docs/sdk.nftcollection.mintbatchto.md
@@ -27,3 +27,27 @@ Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)&l
Mint many unique NFTs at once to a specified wallet.
+## Example
+
+
+```javascript
+// Address of the wallet you want to mint the NFT to
+const walletAddress = "{{wallet_address}}";
+
+// Custom metadata of the NFTs you want to mint.
+const metadatas = [{
+ name: "Cool NFT #1",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+}, {
+ name: "Cool NFT #2",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/other/image.png"),
+}];
+
+const tx = await contract.mintBatchTo(walletAddress, metadatas);
+const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
+const firstTokenId = tx[0].id; // token id of the first minted NFT
+const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
+```
+
diff --git a/docs/sdk.nftcollection.mintto.md b/docs/sdk.nftcollection.mintto.md
index f7ec72b1d..29d0637b6 100644
--- a/docs/sdk.nftcollection.mintto.md
+++ b/docs/sdk.nftcollection.mintto.md
@@ -27,3 +27,23 @@ Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)&l
Mint a unique NFT to a specified wallet.
+## Example
+
+
+```javascript
+// Address of the wallet you want to mint the NFT to
+const walletAddress = "{{wallet_address}}";
+
+// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
+const metadata = {
+ name: "Cool NFT",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+};
+
+const tx = await contract.mintTo(walletAddress, metadata);
+const receipt = tx.receipt; // the transaction receipt
+const tokenId = tx.id; // the id of the NFT minted
+const nft = await tx.data(); // (optional) fetch details of minted NFT
+```
+
diff --git a/docs/sdk.nftcollection.minttoself.md b/docs/sdk.nftcollection.minttoself.md
index beb48781e..8eb869cb7 100644
--- a/docs/sdk.nftcollection.minttoself.md
+++ b/docs/sdk.nftcollection.minttoself.md
@@ -26,3 +26,20 @@ Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)&l
Mint a unique NFT to a specified wallet.
+## Example
+
+
+```javascript*
+// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
+const metadata = {
+ name: "Cool NFT",
+ description: "This is a cool NFT",
+ image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+};
+
+const tx = await contract.mintToSelf(metadata);
+const receipt = tx.receipt; // the transaction receipt
+const tokenId = tx.id; // the id of the NFT minted
+const nft = await tx.data(); // (optional) fetch details of minted NFT
+```
+
diff --git a/docs/sdk.nftcollection.totalsupply.md b/docs/sdk.nftcollection.totalsupply.md
index 140f34d23..54abeb3ed 100644
--- a/docs/sdk.nftcollection.totalsupply.md
+++ b/docs/sdk.nftcollection.totalsupply.md
@@ -4,6 +4,7 @@
## NFTCollection.totalSupply() method
+Get the number of NFTs minted
Signature:
@@ -14,3 +15,5 @@ totalSupply(): Promise;
Promise<BigNumber>
+the total number of NFTs minted in this contract
+
diff --git a/docs/sdk.nftdrop.getall.md b/docs/sdk.nftdrop.getall.md
index 5fded4225..a4cb8aa84 100644
--- a/docs/sdk.nftdrop.getall.md
+++ b/docs/sdk.nftdrop.getall.md
@@ -4,7 +4,7 @@
## NFTDrop.getAll() method
-Get Owned NFTs
+Get All Minted NFTs
Signature:
@@ -16,15 +16,25 @@ getAll(queryParams?: QueryAllParams): Promise;
| Parameter | Type | Description |
| --- | --- | --- |
-| queryParams | [QueryAllParams](./sdk.queryallparams.md) | (Optional) |
+| queryParams | [QueryAllParams](./sdk.queryallparams.md) | (Optional) optional filtering to only fetch a subset of results. |
Returns:
Promise<[NFTMetadataOwner](./sdk.nftmetadataowner.md)\[\]>
-The NFT metadata for all NFTs in the contract.
+The NFT metadata for all NFTs queried.
## Remarks
-Get all the data associated with the NFTs owned by a specific wallet.
+Get all the data associated with every NFT in this contract.
+
+By default, returns the first 100 NFTs, use queryParams to fetch more.
+
+## Example
+
+
+```javascript
+const nfts = await contract.getAll();
+console.log(nfts);
+```
diff --git a/docs/sdk.nftdrop.getowned.md b/docs/sdk.nftdrop.getowned.md
index b517df965..2211610de 100644
--- a/docs/sdk.nftdrop.getowned.md
+++ b/docs/sdk.nftdrop.getowned.md
@@ -4,6 +4,7 @@
## NFTDrop.getOwned() method
+Get Owned NFTs
Signature:
@@ -15,9 +16,25 @@ getOwned(walletAddress?: string): Promise;
| Parameter | Type | Description |
| --- | --- | --- |
-| walletAddress | string | (Optional) |
+| walletAddress | string | (Optional) the wallet address to query, defaults to the connected wallet |
Returns:
Promise<[NFTMetadataOwner](./sdk.nftmetadataowner.md)\[\]>
+The NFT metadata for all NFTs in the contract.
+
+## Remarks
+
+Get all the data associated with the NFTs owned by a specific wallet.
+
+## Example
+
+
+```javascript
+// Address of the wallet to get the NFTs of
+const address = "{{wallet_address}}";
+const nfts = await contract.getOwned(address);
+console.log(nfts);
+```
+
diff --git a/docs/sdk.nftdrop.md b/docs/sdk.nftdrop.md
index 6f9cab506..f5f11f0a8 100644
--- a/docs/sdk.nftdrop.md
+++ b/docs/sdk.nftdrop.md
@@ -57,13 +57,13 @@ const contract = sdk.getNFTDrop("{{contract_address}}");
| [claim(quantity, proofs)](./sdk.nftdrop.claim.md) | | Claim NFTs to the connected wallet. |
| [claimTo(destinationAddress, quantity, proofs)](./sdk.nftdrop.claimto.md) | | Claim unique NFTs to a specific Wallet |
| [createBatch(metadatas)](./sdk.nftdrop.createbatch.md) | | Create a batch of unique NFTs to be claimed in the future |
-| [getAll(queryParams)](./sdk.nftdrop.getall.md) | | Get Owned NFTs |
+| [getAll(queryParams)](./sdk.nftdrop.getall.md) | | Get All Minted NFTs |
| [getAllClaimed(queryParams)](./sdk.nftdrop.getallclaimed.md) | | Get All Claimed NFTs |
| [getAllUnclaimed(queryParams)](./sdk.nftdrop.getallunclaimed.md) | | Get All Unclaimed NFTs |
-| [getOwned(walletAddress)](./sdk.nftdrop.getowned.md) | | |
+| [getOwned(walletAddress)](./sdk.nftdrop.getowned.md) | | Get Owned NFTs |
| [getOwnedTokenIds(walletAddress)](./sdk.nftdrop.getownedtokenids.md) | | |
| [isTransferRestricted()](./sdk.nftdrop.istransferrestricted.md) | | Get whether users can transfer NFTs from this contract |
| [totalClaimedSupply()](./sdk.nftdrop.totalclaimedsupply.md) | | Get the claimed supply |
-| [totalSupply()](./sdk.nftdrop.totalsupply.md) | | |
+| [totalSupply()](./sdk.nftdrop.totalsupply.md) | | Get the number of NFTs minted |
| [totalUnclaimedSupply()](./sdk.nftdrop.totalunclaimedsupply.md) | | Get the unclaimed supply |
diff --git a/docs/sdk.nftdrop.totalsupply.md b/docs/sdk.nftdrop.totalsupply.md
index a54ff30a2..371e21d63 100644
--- a/docs/sdk.nftdrop.totalsupply.md
+++ b/docs/sdk.nftdrop.totalsupply.md
@@ -4,6 +4,7 @@
## NFTDrop.totalSupply() method
+Get the number of NFTs minted
Signature:
@@ -14,3 +15,5 @@ totalSupply(): Promise;
Promise<BigNumber>
+the total number of NFTs minted in this contract
+
diff --git a/docs/sdk.thirdwebsdk.getcontractlist.md b/docs/sdk.thirdwebsdk.getcontractlist.md
index cb67fc16f..b89136130 100644
--- a/docs/sdk.thirdwebsdk.getcontractlist.md
+++ b/docs/sdk.thirdwebsdk.getcontractlist.md
@@ -11,7 +11,7 @@ Return all the contracts deployed by the specified address
```typescript
getContractList(walletAddress: string): Promise<{
address: string;
- contractType: "custom" | "token" | "pack" | "split" | "edition" | "edition-drop" | "token-drop" | "vote" | "marketplace" | "nft-drop" | "nft-collection";
+ contractType: "custom" | "token" | "pack" | "edition" | "split" | "edition-drop" | "token-drop" | "vote" | "marketplace" | "nft-drop" | "nft-collection";
metadata: () => Promise;
}[]>;
```
@@ -24,5 +24,5 @@ getContractList(walletAddress: string): Promise<{
Returns:
-Promise<{ address: string; contractType: "custom" \| "token" \| "pack" \| "split" \| "edition" \| "edition-drop" \| "token-drop" \| "vote" \| "marketplace" \| "nft-drop" \| "nft-collection"; metadata: () => Promise<any>; }\[\]>
+Promise<{ address: string; contractType: "custom" \| "token" \| "pack" \| "edition" \| "split" \| "edition-drop" \| "token-drop" \| "vote" \| "marketplace" \| "nft-drop" \| "nft-collection"; metadata: () => Promise<any>; }\[\]>
diff --git a/docs/snippets.json b/docs/snippets.json
index 12852eb72..a337c9c49 100644
--- a/docs/snippets.json
+++ b/docs/snippets.json
@@ -7,6 +7,24 @@
"javascript": "import { ThirdwebSDK } from \"@thirdweb-dev/sdk\";\n\n// You can switch out this provider with any wallet or provider setup you like.\nconst provider = ethers.Wallet.createRandom();\nconst sdk = new ThirdwebSDK(provider);\nconst contract = sdk.getEdition(\"{{contract_address}}\");"
},
"methods": [
+ {
+ "name": "getAll",
+ "summary": "Get All Minted NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with every NFT in this contract.\n\nBy default, returns the first 100 NFTs, use queryParams to fetch more.\n\n",
+ "examples": {
+ "javascript": "const nfts = await contract.getAll();"
+ },
+ "reference": "https://docs.thirdweb.com/typescript/sdk.Edition.getAll"
+ },
+ {
+ "name": "getOwned",
+ "summary": "Get Owned NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with the NFTs owned by a specific wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet to get the NFTs of\nconst address = \"{{wallet_address}}\";\nconst nfts = await contract.getOwned(address);"
+ },
+ "reference": "https://docs.thirdweb.com/typescript/sdk.Edition.getOwned"
+ },
{
"name": "mintBatchTo",
"summary": "Mint Many NFTs with limited supplies\n\n",
@@ -39,7 +57,7 @@
"summary": "Get NFT Balance\n\n",
"remarks": "\n\nGet a wallets NFT balance (number of NFTs in this contract owned by the wallet).\n\n",
"examples": {
- "javascript": "// Address of the wallet to check NFT balance\nconst address = \"{{wallet_address}}\";\n// Id of the NFT to check\nconst tokenId = 0;\n\nconst balance = await contract.balanceOf(address, tokenId);\nconsole.log(balance);"
+ "javascript": "// Address of the wallet to check NFT balance\nconst walletAddress = \"{{wallet_address}}\";\nconst tokenId = 0; // Id of the NFT to check\nconst balance = await contract.balanceOf(walletAddress, tokenId);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc1155.balanceOf"
},
@@ -48,7 +66,7 @@
"summary": "Get a single NFT Metadata\n\n",
"remarks": null,
"examples": {
- "javascript": "const nft = await contract.get(\"0\");\nconsole.log(nft);"
+ "javascript": "const nft = await contract.get(\"0\");"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc1155.get"
},
@@ -57,7 +75,7 @@
"summary": "Transfer a single NFT\n\n",
"remarks": "\n\nTransfer an NFT from the connected wallet to another wallet.\n\n",
"examples": {
- "javascript": "// Address of the wallet you want to send the NFT to\nconst toAddress = \"{{wallet_address}}\";\n\n// The token ID of the NFT you want to send\nconst tokenId = \"0\";\n// How many copies of the NFTs to transfer\nconst amount = 3;\n\nawait contract.transfer(toAddress, tokenId, amount);"
+ "javascript": "// Address of the wallet you want to send the NFT to\nconst toAddress = \"{{wallet_address}}\";\nconst tokenId = \"0\"; // The token ID of the NFT you want to send\nconst amount = 3; // How many copies of the NFTs to transfer\nawait contract.transfer(toAddress, tokenId, amount);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc1155.transfer"
}
@@ -124,7 +142,7 @@
"summary": "Get NFT Balance\n\n",
"remarks": "\n\nGet a wallets NFT balance (number of NFTs in this contract owned by the wallet).\n\n",
"examples": {
- "javascript": "// Address of the wallet to check NFT balance\nconst address = \"{{wallet_address}}\";\n// Id of the NFT to check\nconst tokenId = 0;\n\nconst balance = await contract.balanceOf(address, tokenId);\nconsole.log(balance);"
+ "javascript": "// Address of the wallet to check NFT balance\nconst walletAddress = \"{{wallet_address}}\";\nconst tokenId = 0; // Id of the NFT to check\nconst balance = await contract.balanceOf(walletAddress, tokenId);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc1155.balanceOf"
},
@@ -133,7 +151,7 @@
"summary": "Get a single NFT Metadata\n\n",
"remarks": null,
"examples": {
- "javascript": "const nft = await contract.get(\"0\");\nconsole.log(nft);"
+ "javascript": "const nft = await contract.get(\"0\");"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc1155.get"
},
@@ -142,7 +160,7 @@
"summary": "Transfer a single NFT\n\n",
"remarks": "\n\nTransfer an NFT from the connected wallet to another wallet.\n\n",
"examples": {
- "javascript": "// Address of the wallet you want to send the NFT to\nconst toAddress = \"{{wallet_address}}\";\n\n// The token ID of the NFT you want to send\nconst tokenId = \"0\";\n// How many copies of the NFTs to transfer\nconst amount = 3;\n\nawait contract.transfer(toAddress, tokenId, amount);"
+ "javascript": "// Address of the wallet you want to send the NFT to\nconst toAddress = \"{{wallet_address}}\";\nconst tokenId = \"0\"; // The token ID of the NFT you want to send\nconst amount = 3; // How many copies of the NFTs to transfer\nawait contract.transfer(toAddress, tokenId, amount);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc1155.transfer"
}
@@ -253,12 +271,48 @@
"javascript": "import { ThirdwebSDK } from \"@thirdweb-dev/sdk\";\n\n// You can switch out this provider with any wallet or provider setup you like.\nconst provider = ethers.Wallet.createRandom();\nconst sdk = new ThirdwebSDK(provider);\nconst contract = sdk.getNFTCollection(\"{{contract_address}}\");"
},
"methods": [
+ {
+ "name": "getAll",
+ "summary": "Get All Minted NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with every NFT in this contract.\n\nBy default, returns the first 100 NFTs, use queryParams to fetch more.\n\n",
+ "examples": {
+ "javascript": "const nfts = await contract.getAll();\nconsole.log(nfts);"
+ },
+ "reference": "https://docs.thirdweb.com/typescript/sdk.NFTCollection.getAll"
+ },
+ {
+ "name": "getOwned",
+ "summary": "Get Owned NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with the NFTs owned by a specific wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet to get the NFTs of\nconst address = \"{{wallet_address}}\";\nconst nfts = await contract.getOwned(address);\nconsole.log(nfts);"
+ },
+ "reference": "https://docs.thirdweb.com/typescript/sdk.NFTCollection.getOwned"
+ },
+ {
+ "name": "mintBatchTo",
+ "summary": "Mint Many unique NFTs\n\n",
+ "remarks": "\n\nMint many unique NFTs at once to a specified wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet you want to mint the NFT to\nconst walletAddress = \"{{wallet_address}}\";\n\n// Custom metadata of the NFTs you want to mint.\nconst metadatas = [{\n name: \"Cool NFT #1\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/image.png\"), // This can be an image url or file\n}, {\n name: \"Cool NFT #2\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/other/image.png\"),\n}];\n\nconst tx = await contract.mintBatchTo(walletAddress, metadatas);\nconst receipt = tx[0].receipt; // same transaction receipt for all minted NFTs\nconst firstTokenId = tx[0].id; // token id of the first minted NFT\nconst firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT"
+ },
+ "reference": "https://docs.thirdweb.com/typescript/sdk.NFTCollection.mintBatchTo"
+ },
+ {
+ "name": "mintTo",
+ "summary": "Mint a unique NFT\n\n",
+ "remarks": "\n\nMint a unique NFT to a specified wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet you want to mint the NFT to\nconst walletAddress = \"{{wallet_address}}\";\n\n// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.\nconst metadata = {\n name: \"Cool NFT\",\n description: \"This is a cool NFT\",\n image: fs.readFileSync(\"path/to/image.png\"), // This can be an image url or file\n};\n\nconst tx = await contract.mintTo(walletAddress, metadata);\nconst receipt = tx.receipt; // the transaction receipt\nconst tokenId = tx.id; // the id of the NFT minted\nconst nft = await tx.data(); // (optional) fetch details of minted NFT"
+ },
+ "reference": "https://docs.thirdweb.com/typescript/sdk.NFTCollection.mintTo"
+ },
{
"name": "balanceOf",
"summary": "Get NFT Balance\n\n",
"remarks": "\n\nGet a wallets NFT balance (number of NFTs in this contract owned by the wallet).\n\n",
"examples": {
- "javascript": "// Address of the wallet to check NFT balance\nconst address = \"{{wallet_address}}\";\n\nconst balance = await contract.balanceOf(address);\nconsole.log(balance);"
+ "javascript": "const walletAddress = \"{{wallet_address}}\";\nconst balance = await contract.balanceOf(walletAddress);\nconsole.log(balance);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc721.balanceOf"
},
@@ -267,7 +321,7 @@
"summary": "Get a single NFT Metadata\n\n",
"remarks": null,
"examples": {
- "javascript": "const nft = await contract.get(\"0\");\nconsole.log(nft);"
+ "javascript": "const tokenId = 0;\nconst nft = await contract.get(tokenId);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc721.get"
},
@@ -276,7 +330,7 @@
"summary": "Transfer a single NFT\n\n",
"remarks": "\n\nTransfer an NFT from the connected wallet to another wallet.\n\n",
"examples": {
- "javascript": "// Address of the wallet you want to send the NFT to\nconst toAddress = \"{{wallet_address}}\";\n\n// The token ID of the NFT you want to send\nconst tokenId = \"0\";\n\nawait contract.transfer(toAddress, tokenId);"
+ "javascript": "const walletAddress = \"{{wallet_address}}\";\nconst tokenId = 0;\nawait contract.transfer(walletAddress, tokenId);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc721.transfer"
}
@@ -329,6 +383,15 @@
},
"reference": "https://docs.thirdweb.com/typescript/sdk.NFTDrop.createBatch"
},
+ {
+ "name": "getAll",
+ "summary": "Get All Minted NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with every NFT in this contract.\n\nBy default, returns the first 100 NFTs, use queryParams to fetch more.\n\n",
+ "examples": {
+ "javascript": "const nfts = await contract.getAll();\nconsole.log(nfts);"
+ },
+ "reference": "https://docs.thirdweb.com/typescript/sdk.NFTDrop.getAll"
+ },
{
"name": "getAllClaimed",
"summary": "Get All Claimed NFTs\n\n",
@@ -347,6 +410,15 @@
},
"reference": "https://docs.thirdweb.com/typescript/sdk.NFTDrop.getAllUnclaimed"
},
+ {
+ "name": "getOwned",
+ "summary": "Get Owned NFTs\n\n",
+ "remarks": "\n\nGet all the data associated with the NFTs owned by a specific wallet.\n\n",
+ "examples": {
+ "javascript": "// Address of the wallet to get the NFTs of\nconst address = \"{{wallet_address}}\";\nconst nfts = await contract.getOwned(address);\nconsole.log(nfts);"
+ },
+ "reference": "https://docs.thirdweb.com/typescript/sdk.NFTDrop.getOwned"
+ },
{
"name": "totalClaimedSupply",
"summary": "Get the claimed supply\n\n",
@@ -370,7 +442,7 @@
"summary": "Get NFT Balance\n\n",
"remarks": "\n\nGet a wallets NFT balance (number of NFTs in this contract owned by the wallet).\n\n",
"examples": {
- "javascript": "// Address of the wallet to check NFT balance\nconst address = \"{{wallet_address}}\";\n\nconst balance = await contract.balanceOf(address);\nconsole.log(balance);"
+ "javascript": "const walletAddress = \"{{wallet_address}}\";\nconst balance = await contract.balanceOf(walletAddress);\nconsole.log(balance);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc721.balanceOf"
},
@@ -379,7 +451,7 @@
"summary": "Get a single NFT Metadata\n\n",
"remarks": null,
"examples": {
- "javascript": "const nft = await contract.get(\"0\");\nconsole.log(nft);"
+ "javascript": "const tokenId = 0;\nconst nft = await contract.get(tokenId);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc721.get"
},
@@ -388,7 +460,7 @@
"summary": "Transfer a single NFT\n\n",
"remarks": "\n\nTransfer an NFT from the connected wallet to another wallet.\n\n",
"examples": {
- "javascript": "// Address of the wallet you want to send the NFT to\nconst toAddress = \"{{wallet_address}}\";\n\n// The token ID of the NFT you want to send\nconst tokenId = \"0\";\n\nawait contract.transfer(toAddress, tokenId);"
+ "javascript": "const walletAddress = \"{{wallet_address}}\";\nconst tokenId = 0;\nawait contract.transfer(walletAddress, tokenId);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc721.transfer"
}
@@ -626,7 +698,7 @@
"summary": "Get Token Allowance\n\n",
"remarks": "\n\nGet 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",
"examples": {
- "javascript": "// Address of the wallet to check token allowance\nconst spenderAddress = \"0x...\";\n\nconst allowance = await contract.allowanceOf(otherAddress);\nconsole.log(allowance);"
+ "javascript": "// Address of the wallet to check token allowance\nconst spenderAddress = \"0x...\";\nconst allowance = await contract.allowanceOf(otherAddress);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc20.allowance"
},
@@ -635,7 +707,7 @@
"summary": "Get Token Allowance\n\n",
"remarks": "\n\nGet 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",
"examples": {
- "javascript": "// Address of the wallet who owns the funds\nconst address = \"{{wallet_address}}\";\n\n// Address of the wallet to check token allowance\nconst spenderAddress = \"0x...\";\n\nconst allowance = await contract.allowanceOf(address, spenderAddress);\nconsole.log(allowance);"
+ "javascript": "// Address of the wallet who owns the funds\nconst owner = \"{{wallet_address}}\";\n// Address of the wallet to check token allowance\nconst spender = \"0x...\";\nconst allowance = await contract.allowanceOf(owner, spender);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc20.allowanceOf"
},
@@ -653,7 +725,7 @@
"summary": "Get Token Balance\n\n",
"remarks": "\n\nGet a wallets token balance.\n\n",
"examples": {
- "javascript": "// Address of the wallet to check token balance\nconst address = \"{{wallet_address}}\";\n\nconst balance = await contract.balanceOf(address);\nconsole.log(balance);"
+ "javascript": "// Address of the wallet to check token balance\nconst walletAddress = \"{{wallet_address}}\";\nconst balance = await contract.balanceOf(walletAddress);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc20.balanceOf"
},
@@ -662,7 +734,7 @@
"summary": "Get the token Metadata (name, symbol, etc...)\n\n",
"remarks": null,
"examples": {
- "javascript": "const token = await contract.get();\nconsole.log(token);"
+ "javascript": "const token = await contract.get();"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc20.get"
},
@@ -671,7 +743,7 @@
"summary": "Allows the specified `spender` wallet to transfer the given `amount` of tokens to another wallet\n\n",
"remarks": null,
"examples": {
- "javascript": "// Address of the wallet to allow transfers from\nconst spenderAddress = \"0x...\";\n\n// The number of tokens to give as allowance\nconst amount = 100\n\nawait contract.setAllowance(spenderAddress, amount);"
+ "javascript": "// Address of the wallet to allow transfers from\nconst spenderAddress = \"0x...\";\n// The number of tokens to give as allowance\nconst amount = 100\nawait contract.setAllowance(spenderAddress, amount);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc20.setAllowance"
},
@@ -680,7 +752,7 @@
"summary": "Transfer Tokens\n\n",
"remarks": "\n\nTransfer tokens from the connected wallet to another wallet.\n\n",
"examples": {
- "javascript": "// Address of the wallet you want to send the tokens to\nconst toAddress = \"0x...\";\n\n// The amount of tokens you want to send\nconst amount = 0.1;\n\nawait contract.transfer(toAddress, amount);"
+ "javascript": "// Address of the wallet you want to send the tokens to\nconst toAddress = \"0x...\";\n// The amount of tokens you want to send\nconst amount = 0.1;\nawait contract.transfer(toAddress, amount);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc20.transfer"
},
@@ -698,7 +770,7 @@
"summary": "Transfer Tokens From Address\n\n",
"remarks": "\n\nTransfer tokens from one wallet to another\n\n",
"examples": {
- "javascript": "// Address of the wallet sending the tokens\nconst fromAddress = \"{{wallet_address}}\";\n\n// Address of the wallet you want to send the tokens to\nconst toAddress = \"0x...\";\n\n// The number of tokens you want to send\nconst amount = 1.2\n\n// Note that the connected wallet must have approval to transfer the tokens of the fromAddress\nawait contract.transferFrom(fromAddress, toAddress, amount);"
+ "javascript": "// Address of the wallet sending the tokens\nconst fromAddress = \"{{wallet_address}}\";\n// Address of the wallet you want to send the tokens to\nconst toAddress = \"0x...\";\n// The number of tokens you want to send\nconst amount = 1.2\n// Note that the connected wallet must have approval to transfer the tokens of the fromAddress\nawait contract.transferFrom(fromAddress, toAddress, amount);"
},
"reference": "https://docs.thirdweb.com/typescript/sdk.Erc20.transferFrom"
}
diff --git a/etc/sdk.api.md b/etc/sdk.api.md
index 36993726a..687322edc 100644
--- a/etc/sdk.api.md
+++ b/etc/sdk.api.md
@@ -652,10 +652,13 @@ export class ContractMetadata {
+export class ContractPlatformFee implements DetectableFeature {
constructor(contractWrapper: ContractWrapper);
+ // (undocumented)
+ featureName: "PlatformFee";
get(): Promise<{
platform_fee_basis_points: number;
platform_fee_recipient: string;
@@ -667,8 +670,10 @@ export class ContractPlatformFee {
// Warning: (ae-forgotten-export) The symbol "IPrimarySale" needs to be exported by the entry point index.d.ts
//
// @public
-export class ContractPrimarySale {
+export class ContractPrimarySale implements DetectableFeature {
constructor(contractWrapper: ContractWrapper);
+ // (undocumented)
+ featureName: "PrimarySale";
getRecipient(): Promise;
setRecipient(recipient: string): Promise;
}
@@ -691,8 +696,10 @@ export class ContractPublishedMetadata {
// Warning: (ae-forgotten-export) The symbol "IPermissionsEnumerable" needs to be exported by the entry point index.d.ts
//
// @public
-export class ContractRoles {
+export class ContractRoles implements DetectableFeature {
constructor(contractWrapper: ContractWrapper, roles: readonly TRole[]);
+ // (undocumented)
+ featureName: "Permissions";
get(role: TRole): Promise;
getAll(): Promise>;
grant(role: TRole, address: string): Promise;
@@ -708,8 +715,10 @@ export class ContractRoles {
+export class ContractRoyalty implements DetectableFeature {
constructor(contractWrapper: ContractWrapper, metadata: ContractMetadata);
+ // (undocumented)
+ featureName: "Royalty";
getDefaultRoyaltyInfo(): Promise<{
seller_fee_basis_points: number;
fee_recipient: string;
@@ -1493,21 +1502,21 @@ export const EditionMetadataWithOwnerOutputSchema: z.ZodObject implements UpdateableNetwork {
+export class Erc1155 implements UpdateableNetwork, DetectableFeature {
constructor(contractWrapper: ContractWrapper, storage: IStorage, options?: SDKOptions);
airdrop(tokenId: BigNumberish, addresses: AirdropInput, data?: BytesLike): Promise;
balance(tokenId: BigNumberish): Promise;
balanceOf(address: string, tokenId: BigNumberish): Promise;
// (undocumented)
protected contractWrapper: ContractWrapper;
+ // (undocumented)
+ featureName: "ERC1155";
get(tokenId: BigNumberish): Promise;
// (undocumented)
getAddress(): string;
// @internal (undocumented)
getTokenMetadata(tokenId: BigNumberish): Promise;
isApproved(address: string, operator: string): Promise;
- // Warning: (ae-forgotten-export) The symbol "Erc1155Mintable" needs to be exported by the entry point index.d.ts
- //
// (undocumented)
mint: Erc1155Mintable | undefined;
// @internal (undocumented)
@@ -1524,15 +1533,37 @@ export class Erc1155 impleme
transfer(to: string, tokenId: BigNumberish, amount: BigNumberish, data?: BytesLike): Promise;
}
-// @public (undocumented)
-export class Erc1155Enumerable {
+// @public
+export class Erc1155BatchMintable implements DetectableFeature {
+ // Warning: (ae-forgotten-export) The symbol "IMintableERC1155" needs to be exported by the entry point index.d.ts
+ // Warning: (ae-forgotten-export) The symbol "IMulticall" needs to be exported by the entry point index.d.ts
+ constructor(erc1155: Erc1155, contractWrapper: ContractWrapper, storage: IStorage);
+ // (undocumented)
+ featureName: "ERC1155BatchMintable";
+ to(to: string, metadataWithSupply: EditionMetadataOrUri[]): Promise[]>;
+}
+
+// @public
+export class Erc1155Enumerable implements DetectableFeature {
// Warning: (ae-forgotten-export) The symbol "IERC1155Enumerable" needs to be exported by the entry point index.d.ts
constructor(erc1155: Erc1155, contractWrapper: ContractWrapper);
all(queryParams?: QueryAllParams): Promise;
+ // (undocumented)
+ featureName: "ERC1155Enumerable";
getTotalCount(): Promise;
owned(walletAddress?: string): Promise;
}
+// @public
+export class Erc1155Mintable implements DetectableFeature {
+ constructor(erc1155: Erc1155, contractWrapper: ContractWrapper, storage: IStorage);
+ additionalSupplyTo(to: string, tokenId: BigNumberish, additionalSupply: BigNumberish): Promise>;
+ batch: Erc1155BatchMintable | undefined;
+ // (undocumented)
+ featureName: "ERC1155Mintable";
+ to(to: string, metadataWithSupply: EditionMetadataOrUri): Promise>;
+}
+
// @public
export class Erc1155SignatureMinting {
constructor(contractWrapper: ContractWrapper, roles: ContractRoles, storage: IStorage);
@@ -1547,7 +1578,7 @@ export class Erc1155SignatureMinting {
// Warning: (ae-forgotten-export) The symbol "BaseERC20" needs to be exported by the entry point index.d.ts
//
// @public
-export class Erc20 implements UpdateableNetwork {
+export class Erc20 implements UpdateableNetwork, DetectableFeature {
constructor(contractWrapper: ContractWrapper, storage: IStorage, options?: SDKOptions);
allowance(spender: string): Promise;
allowanceOf(owner: string, spender: string): Promise;
@@ -1555,12 +1586,13 @@ export class Erc20 implements Upda
balanceOf(address: string): Promise;
// (undocumented)
protected contractWrapper: ContractWrapper;
+ // (undocumented)
+ featureName: "ERC20";
get(): Promise;
// (undocumented)
getAddress(): string;
// @internal (undocumented)
protected getValue(value: BigNumberish): Promise;
- // Warning: (ae-forgotten-export) The symbol "Erc20Mintable" needs to be exported by the entry point index.d.ts
mint: Erc20Mintable | undefined;
// @internal
normalizeAmount(amount: Amount): Promise;
@@ -1577,6 +1609,24 @@ export class Erc20 implements Upda
transferFrom(from: string, to: string, amount: Amount): Promise;
}
+// @public
+export class Erc20BatchMintable implements DetectableFeature {
+ // Warning: (ae-forgotten-export) The symbol "IMintableERC20" needs to be exported by the entry point index.d.ts
+ constructor(erc20: Erc20, contractWrapper: ContractWrapper);
+ // (undocumented)
+ featureName: "ERC20BatchMintable";
+ to(args: TokenMintInput[]): Promise;
+}
+
+// @public
+export class Erc20Mintable implements DetectableFeature {
+ constructor(erc20: Erc20, contractWrapper: ContractWrapper);
+ batch: Erc20BatchMintable | undefined;
+ // (undocumented)
+ featureName: "ERC20Mintable";
+ to(to: string, amount: Amount): Promise;
+}
+
// @public
export class Erc20SignatureMinting {
constructor(contractWrapper: ContractWrapper, roles: ContractRoles);
@@ -1591,12 +1641,14 @@ export class Erc20SignatureMinting {
// Warning: (ae-forgotten-export) The symbol "BaseERC721" needs to be exported by the entry point index.d.ts
//
// @public
-export class Erc721 implements UpdateableNetwork {
+export class Erc721 implements UpdateableNetwork, DetectableFeature {
constructor(contractWrapper: ContractWrapper, storage: IStorage, options?: SDKOptions);
balance(): Promise;
balanceOf(address: string): Promise;
// (undocumented)
protected contractWrapper: ContractWrapper;
+ // (undocumented)
+ featureName: "ERC721";
get(tokenId: BigNumberish): Promise;
// (undocumented)
getAddress(): string;
@@ -1619,28 +1671,33 @@ export class Erc721 implements
transfer(to: string, tokenId: BigNumberish): Promise;
}
-// @public (undocumented)
-export class Erc721BatchMintable {
+// @public
+export class Erc721BatchMintable implements DetectableFeature {
// Warning: (ae-forgotten-export) The symbol "IMintableERC721" needs to be exported by the entry point index.d.ts
- // Warning: (ae-forgotten-export) The symbol "IMulticall" needs to be exported by the entry point index.d.ts
constructor(erc721: Erc721, contractWrapper: ContractWrapper, storage: IStorage);
+ // (undocumented)
+ featureName: "ERC721BatchMintable";
// Warning: (ae-forgotten-export) The symbol "NFTMetadataOrUri" needs to be exported by the entry point index.d.ts
to(to: string, metadatas: NFTMetadataOrUri[]): Promise[]>;
}
-// @public (undocumented)
-export class Erc721Enumerable {
+// @public
+export class Erc721Enumerable implements DetectableFeature {
// Warning: (ae-forgotten-export) The symbol "IERC721Enumerable" needs to be exported by the entry point index.d.ts
constructor(erc721: Erc721, contractWrapper: ContractWrapper);
all(walletAddress?: string): Promise;
+ // (undocumented)
+ featureName: "ERC721Enumerable";
tokenIds(walletAddress?: string): Promise;
}
-// @public (undocumented)
-export class Erc721Mintable {
+// @public
+export class Erc721Mintable implements DetectableFeature {
constructor(erc721: Erc721, contractWrapper: ContractWrapper, storage: IStorage);
// (undocumented)
batch: Erc721BatchMintable | undefined;
+ // (undocumented)
+ featureName: "ERC721Mintable";
to(to: string, metadata: NFTMetadataOrUri): Promise>;
}
@@ -1654,12 +1711,14 @@ export class Erc721SignatureMinting {
verify(signedPayload: SignedPayload721): Promise;
}
-// @public (undocumented)
-export class Erc721Supply {
+// @public
+export class Erc721Supply implements DetectableFeature {
// Warning: (ae-forgotten-export) The symbol "IERC721Supply" needs to be exported by the entry point index.d.ts
constructor(erc721: Erc721, contractWrapper: ContractWrapper);
all(queryParams?: QueryAllParams): Promise;
// (undocumented)
+ featureName: "ERC721Supply";
+ // (undocumented)
owned: Erc721Enumerable | undefined;
totalSupply(): Promise;
}
@@ -2227,11 +2286,8 @@ export class NFTCollection extends Erc721 {
// (undocumented)
events: ContractEvents;
getAll(queryParams?: QueryAllParams): Promise;
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@thirdweb-dev/sdk" does not have an export "Erc721Owned"
- //
- // (undocumented)
getOwned(walletAddress?: string): Promise;
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@thirdweb-dev/sdk" does not have an export "Erc721Owned"
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "tokendIds"
//
// (undocumented)
getOwnedTokenIds(walletAddress?: string): Promise;
@@ -2355,9 +2411,6 @@ export class NFTCollection extends Erc721 {
}>;
};
signature: Erc721SignatureMinting;
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "totalSupply"
- //
- // (undocumented)
totalSupply(): Promise;
}
@@ -2399,11 +2452,8 @@ export class NFTDrop extends Erc721 {
getAll(queryParams?: QueryAllParams): Promise;
getAllClaimed(queryParams?: QueryAllParams): Promise;
getAllUnclaimed(queryParams?: QueryAllParams): Promise;
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@thirdweb-dev/sdk" does not have an export "Erc721Owned"
- //
- // (undocumented)
getOwned(walletAddress?: string): Promise;
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@thirdweb-dev/sdk" does not have an export "Erc721Owned"
+ // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "tokendIds"
//
// (undocumented)
getOwnedTokenIds(walletAddress?: string): Promise;
@@ -2536,9 +2586,6 @@ export class NFTDrop extends Erc721 {
}>;
};
totalClaimedSupply(): Promise;
- // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: No member was found with name "totalSupply"
- //
- // (undocumented)
totalSupply(): Promise;
totalUnclaimedSupply(): Promise;
}
@@ -4158,7 +4205,7 @@ export class ThirdwebSDK extends RPCConnectionHandler {
getContractFromAbi(address: string, abi: ContractInterface): SmartContract;
getContractList(walletAddress: string): Promise<{
address: string;
- contractType: "custom" | "token" | "pack" | "split" | "edition" | "edition-drop" | "token-drop" | "vote" | "marketplace" | "nft-drop" | "nft-collection";
+ contractType: "custom" | "token" | "pack" | "edition" | "split" | "edition-drop" | "token-drop" | "vote" | "marketplace" | "nft-drop" | "nft-collection";
metadata: () => Promise;
}[]>;
getEdition(address: string): Edition;
diff --git a/package.json b/package.json
index ee515aa3a..0d50b3c34 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,7 @@
"full-build": "yarn typechain && yarn extract-abi && yarn build:lib && yarn generate-types && yarn extract-api",
"generate-md-docs": "yarn api-documenter markdown -i ./temp -o ./docs",
"generate-docs": "yarn full-build && yarn generate-md-docs",
- "generate-snippets": "node ./scripts/generate-snippets.mjs",
+ "generate-snippets": "node ./scripts/generate-snippets.mjs && node ./scripts/generate-feature-snippets.mjs",
"build": "yarn clean && yarn generate-docs && yarn generate-snippets",
"test": "echo \"\nUse 'yarn run test:all' to run all tests\nPass a test file pattern from ./test to run\n\n\t$ yarn run test test/pack.test.ts\" && ts-mocha -t 120000 -r esm -p tsconfig.testing.json",
"test:all": "ts-mocha --parallel --paths -t 120000 -r esm -p tsconfig.testing.json './test/**/*.test.ts'"
diff --git a/scripts/generate-feature-snippets.mjs b/scripts/generate-feature-snippets.mjs
new file mode 100644
index 000000000..c5b69ea67
--- /dev/null
+++ b/scripts/generate-feature-snippets.mjs
@@ -0,0 +1,147 @@
+import fs from "fs";
+import { TSDocParser, DocExcerpt } from "@microsoft/tsdoc";
+
+/**
+ * This is a simplistic solution until we implement proper DocNode rendering APIs.
+ */
+export class Formatter {
+ static renderDocNode(docNode) {
+ let result = "";
+ if (docNode) {
+ if (docNode instanceof DocExcerpt) {
+ result += docNode.content.toString();
+ }
+ for (const childNode of docNode.getChildNodes()) {
+ result += Formatter.renderDocNode(childNode);
+ }
+ }
+ return result;
+ }
+
+ static renderDocNodes(docNodes) {
+ let result = "";
+ for (const docNode of docNodes) {
+ result += Formatter.renderDocNode(docNode);
+ }
+ return result;
+ }
+}
+
+const tsdocParser = new TSDocParser();
+
+const json = JSON.parse(
+ fs.readFileSync(`${process.cwd()}/temp/sdk.api.json`, "utf8"),
+);
+
+function languageNameToKey(languageName) {
+ switch (languageName) {
+ case "js":
+ case "jsx":
+ return "javascript";
+ case "ts":
+ case "tsx":
+ return "tyepscript";
+ default:
+ return languageName;
+ }
+}
+
+// Get all the DetectableFeature classes
+const classes = json.members[0].members.filter(
+ (m) =>
+ m.kind === "Class" &&
+ m.excerptTokens.filter((t) => t.text === "DetectableFeature").length > 0,
+);
+
+function parseExampleTag(docComment) {
+ const exampleBlocks = docComment._customBlocks.filter(
+ (b) => b._blockTag._tagName === "@example",
+ );
+
+ const examplesString = Formatter.renderDocNodes(exampleBlocks);
+
+ const regex = /```([a-zA-Z]*)\n([\S\s]*?)\n```/g;
+
+ let matches;
+
+ const examples = {};
+
+ while ((matches = regex.exec(examplesString)) !== null) {
+ // This is necessary to avoid infinite loops with zero-width matches
+ if (matches.index === regex.lastIndex) {
+ regex.lastIndex++;
+ }
+ examples[languageNameToKey(matches[1])] = matches[2];
+ }
+ return examples;
+}
+
+const baseDocUrl = "https://docs.thirdweb.com/typescript/sdk.";
+
+const extractReferenceLink = (m, kind, contractName) => {
+ if (kind === "Property") {
+ return m.excerptTokens
+ .filter((e) => e.kind === "Reference")
+ .map((e) => `${baseDocUrl}${e.text.toLowerCase()}`)[0];
+ }
+ if (kind === "Method") {
+ return `${baseDocUrl}${contractName}.${m.name}`;
+ }
+ return `${baseDocUrl}${m.name}`;
+};
+
+const parseMembers = (members, kind, contractName) => {
+ const validMembers = members.filter((m) => m.kind === kind);
+ return validMembers
+ .map((m) => {
+ const parserContext = tsdocParser.parseString(m.docComment);
+ const docComment = parserContext.docComment;
+ const examples = parseExampleTag(docComment);
+ if (Object.keys(examples).length > 0) {
+ return {
+ name: m.name,
+ summary: Formatter.renderDocNode(docComment.summarySection),
+ remarks: docComment.remarksBlock
+ ? Formatter.renderDocNode(docComment.remarksBlock.content)
+ : null,
+ examples,
+ reference: {
+ javascript: extractReferenceLink(m, kind, contractName),
+ },
+ };
+ }
+ return null;
+ })
+ .filter((m) => !!m);
+};
+
+const moduleMap = classes.reduce((acc, m) => {
+ const parserContext = tsdocParser.parseString(m.docComment);
+ const docComment = parserContext.docComment;
+ const examples = parseExampleTag(docComment);
+ // if (Object.keys(examples).length > 0) {
+ const featureName = m.members
+ .filter((m) => m.kind === "Property" && m.name === "featureName")
+ .map((m) => m.excerptTokens[1].text.replace('"', "").replace('"', ""))[0];
+ acc[featureName] = {
+ name: m.name,
+ summary: Formatter.renderDocNode(docComment.summarySection),
+ remarks: docComment.remarksBlock
+ ? Formatter.renderDocNode(docComment.remarksBlock.content)
+ : null,
+ examples,
+ methods: parseMembers(m.members, "Method", m.name),
+ properties: parseMembers(m.members, "Property", m.name),
+ reference: {
+ javascript: extractReferenceLink(m),
+ },
+ };
+ // }
+
+ return acc;
+}, {});
+
+fs.writeFileSync(
+ `${process.cwd()}/docs/feature_snippets.json`,
+ JSON.stringify(moduleMap, null, 2),
+);
diff --git a/src/contracts/edition.ts b/src/contracts/edition.ts
index 9b5f61e28..dea1be307 100644
--- a/src/contracts/edition.ts
+++ b/src/contracts/edition.ts
@@ -149,7 +149,18 @@ export class Edition extends Erc1155 {
*******************************/
/**
- * {@inheritDoc Erc1155Enumerable.all}
+ * Get All Minted NFTs
+ *
+ * @remarks Get all the data associated with every NFT in this contract.
+ *
+ * By default, returns the first 100 NFTs, use queryParams to fetch more.
+ *
+ * @example
+ * ```javascript
+ * const nfts = await contract.getAll();
+ * ```
+ * @param queryParams - optional filtering to only fetch a subset of results.
+ * @returns The NFT metadata for all NFTs queried.
*/
public async getAll(
queryParams?: QueryAllParams,
@@ -158,7 +169,18 @@ export class Edition extends Erc1155 {
}
/**
- * {@inheritDoc Erc1155Enumerable.owned}
+ * Get Owned NFTs
+ *
+ * @remarks Get all the data associated with the NFTs owned by a specific wallet.
+ *
+ * @example
+ * ```javascript
+ * // Address of the wallet to get the NFTs of
+ * const address = "{{wallet_address}}";
+ * const nfts = await contract.getOwned(address);
+ * ```
+ *
+ * @returns The NFT metadata for all NFTs in the contract.
*/
public async getOwned(
walletAddress?: string,
diff --git a/src/contracts/nft-collection.ts b/src/contracts/nft-collection.ts
index acd523f83..84944819f 100644
--- a/src/contracts/nft-collection.ts
+++ b/src/contracts/nft-collection.ts
@@ -150,29 +150,54 @@ export class NFTCollection extends Erc721 {
*******************************/
/**
- * {@inheritDoc Erc721Enumerable.all}
+ * Get All Minted NFTs
+ *
+ * @remarks Get all the data associated with every NFT in this contract.
+ *
+ * By default, returns the first 100 NFTs, use queryParams to fetch more.
+ *
+ * @example
+ * ```javascript
+ * const nfts = await contract.getAll();
+ * console.log(nfts);
+ * ```
+ * @param queryParams - optional filtering to only fetch a subset of results.
+ * @returns The NFT metadata for all NFTs queried.
*/
public async getAll(
queryParams?: QueryAllParams,
): Promise {
return this._query.all(queryParams);
}
+
/**
- * {@inheritDoc Erc721Owned.all}
+ * Get Owned NFTs
+ *
+ * @remarks Get all the data associated with the NFTs owned by a specific wallet.
+ *
+ * @example
+ * ```javascript
+ * // Address of the wallet to get the NFTs of
+ * const address = "{{wallet_address}}";
+ * const nfts = await contract.getOwned(address);
+ * console.log(nfts);
+ * ```
+ * @param walletAddress - the wallet address to query, defaults to the connected wallet
+ * @returns The NFT metadata for all NFTs in the contract.
*/
public async getOwned(walletAddress?: string): Promise {
return this._owned.all(walletAddress);
}
/**
- * {@inheritDoc Erc721Owned.tokendIds}
+ * {@inheritDoc Erc721Enumerable.tokendIds}
*/
public async getOwnedTokenIds(walletAddress?: string): Promise {
return this._owned.tokenIds(walletAddress);
}
/**
- * {@inheritDoc Erc721Enumerable.totalSupply}
+ * {@inheritDoc Erc721Supply.totalSupply}
*/
public async totalSupply() {
return this._query.totalSupply();
@@ -194,7 +219,24 @@ export class NFTCollection extends Erc721 {
*******************************/
/**
- * {@inheritDoc Erc721Mintable.to}
+ * Mint a unique NFT
+ *
+ * @remarks Mint a unique NFT to a specified wallet.
+ *
+ * @example
+ * ```javascript*
+ * // Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
+ * const metadata = {
+ * name: "Cool NFT",
+ * description: "This is a cool NFT",
+ * image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+ * };
+ *
+ * const tx = await contract.mintToSelf(metadata);
+ * const receipt = tx.receipt; // the transaction receipt
+ * const tokenId = tx.id; // the id of the NFT minted
+ * const nft = await tx.data(); // (optional) fetch details of minted NFT
+ * ```
*/
public async mintToSelf(
metadata: NFTMetadataOrUri,
@@ -204,7 +246,27 @@ export class NFTCollection extends Erc721 {
}
/**
- * {@inheritDoc Erc721Mintable.to}
+ * Mint a unique NFT
+ *
+ * @remarks Mint a unique NFT to a specified wallet.
+ *
+ * @example
+ * ```javascript
+ * // Address of the wallet you want to mint the NFT to
+ * const walletAddress = "{{wallet_address}}";
+ *
+ * // Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
+ * const metadata = {
+ * name: "Cool NFT",
+ * description: "This is a cool NFT",
+ * image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+ * };
+ *
+ * const tx = await contract.mintTo(walletAddress, metadata);
+ * const receipt = tx.receipt; // the transaction receipt
+ * const tokenId = tx.id; // the id of the NFT minted
+ * const nft = await tx.data(); // (optional) fetch details of minted NFT
+ * ```
*/
public async mintTo(
walletAddress: string,
@@ -213,7 +275,28 @@ export class NFTCollection extends Erc721 {
return this._mint.to(walletAddress, metadata);
}
/**
- * {@inheritDoc Erc721BatchMintable.to}
+ * Mint Many unique NFTs
+ *
+ * @remarks Mint many unique NFTs at once to the connected wallet
+ *
+ * @example
+ * ```javascript*
+ * // Custom metadata of the NFTs you want to mint.
+ * const metadatas = [{
+ * name: "Cool NFT #1",
+ * description: "This is a cool NFT",
+ * image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+ * }, {
+ * name: "Cool NFT #2",
+ * description: "This is a cool NFT",
+ * image: fs.readFileSync("path/to/other/image.png"),
+ * }];
+ *
+ * const tx = await contract.mintBatch(metadatas);
+ * const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
+ * const firstTokenId = tx[0].id; // token id of the first minted NFT
+ * const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
+ * ```
*/
public async mintBatch(
metadata: NFTMetadataOrUri[],
@@ -222,7 +305,31 @@ export class NFTCollection extends Erc721 {
return this._batchMint.to(signerAddress, metadata);
}
/**
- * {@inheritDoc Erc721BatchMintable.to}
+ * Mint Many unique NFTs
+ *
+ * @remarks Mint many unique NFTs at once to a specified wallet.
+ *
+ * @example
+ * ```javascript
+ * // Address of the wallet you want to mint the NFT to
+ * const walletAddress = "{{wallet_address}}";
+ *
+ * // Custom metadata of the NFTs you want to mint.
+ * const metadatas = [{
+ * name: "Cool NFT #1",
+ * description: "This is a cool NFT",
+ * image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
+ * }, {
+ * name: "Cool NFT #2",
+ * description: "This is a cool NFT",
+ * image: fs.readFileSync("path/to/other/image.png"),
+ * }];
+ *
+ * const tx = await contract.mintBatchTo(walletAddress, metadatas);
+ * const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
+ * const firstTokenId = tx[0].id; // token id of the first minted NFT
+ * const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
+ * ```
*/
public async mintBatchTo(
walletAddress: string,
diff --git a/src/contracts/nft-drop.ts b/src/contracts/nft-drop.ts
index 65dd65e03..974e88922 100644
--- a/src/contracts/nft-drop.ts
+++ b/src/contracts/nft-drop.ts
@@ -197,29 +197,54 @@ export class NFTDrop extends Erc721 {
*******************************/
/**
- * {@inheritDoc Erc721Enumerable.all}
+ * Get All Minted NFTs
+ *
+ * @remarks Get all the data associated with every NFT in this contract.
+ *
+ * By default, returns the first 100 NFTs, use queryParams to fetch more.
+ *
+ * @example
+ * ```javascript
+ * const nfts = await contract.getAll();
+ * console.log(nfts);
+ * ```
+ * @param queryParams - optional filtering to only fetch a subset of results.
+ * @returns The NFT metadata for all NFTs queried.
*/
public async getAll(
queryParams?: QueryAllParams,
): Promise {
return this._query.all(queryParams);
}
+
/**
- * {@inheritDoc Erc721Owned.all}
+ * Get Owned NFTs
+ *
+ * @remarks Get all the data associated with the NFTs owned by a specific wallet.
+ *
+ * @example
+ * ```javascript
+ * // Address of the wallet to get the NFTs of
+ * const address = "{{wallet_address}}";
+ * const nfts = await contract.getOwned(address);
+ * console.log(nfts);
+ * ```
+ * @param walletAddress - the wallet address to query, defaults to the connected wallet
+ * @returns The NFT metadata for all NFTs in the contract.
*/
public async getOwned(walletAddress?: string): Promise {
return this._owned.all(walletAddress);
}
/**
- * {@inheritDoc Erc721Owned.tokendIds}
+ * {@inheritDoc Erc721Enumerable.tokendIds}
*/
public async getOwnedTokenIds(walletAddress?: string): Promise {
return this._owned.tokenIds(walletAddress);
}
/**
- * {@inheritDoc Erc721Enumerable.totalSupply}
+ * {@inheritDoc Erc721Supply.totalSupply}
*/
public async totalSupply() {
return this._query.totalSupply();
diff --git a/src/core/classes/contract-platform-fee.ts b/src/core/classes/contract-platform-fee.ts
index fd0c94eef..d60ef0756 100644
--- a/src/core/classes/contract-platform-fee.ts
+++ b/src/core/classes/contract-platform-fee.ts
@@ -3,12 +3,27 @@ import { ContractWrapper } from "./contract-wrapper";
import { TransactionResult } from "../types";
import { CommonPlatformFeeSchema } from "../../schema";
import { z } from "zod";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
+import { FEATURE_PLATFORM_FEE } from "../../constants/thirdweb-features";
/**
- * Handles primary sales recipients for a Contract
+ * Handle platform fees and recipients
+ * @remarks Configure platform fees for a contract, which can be applied on certain paid transactions
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * const feeInfo = await contract.platformFee.get();
+ * await contract.platformFee.set({
+ * platform_fee_basis_points: 100, // 1% fee
+ * platform_fee_recipient: "0x..." // the fee recipient
+ * })
+ * ```
* @public
*/
-export class ContractPlatformFee {
+export class ContractPlatformFee
+ implements DetectableFeature
+{
+ featureName = FEATURE_PLATFORM_FEE.name;
private contractWrapper;
constructor(contractWrapper: ContractWrapper) {
diff --git a/src/core/classes/contract-roles.ts b/src/core/classes/contract-roles.ts
index 3f12ace1f..a614d79ee 100644
--- a/src/core/classes/contract-roles.ts
+++ b/src/core/classes/contract-roles.ts
@@ -4,15 +4,26 @@ import invariant from "tiny-invariant";
import { ContractWrapper } from "./contract-wrapper";
import { MissingRoleError } from "../../common/error";
import { IPermissionsEnumerable } from "contracts";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
+import { FEATURE_PERMISSIONS } from "../../constants/thirdweb-features";
/**
- * Handles Contract roles and permissions
+ * Handle contract permissions
+ * @remarks Configure roles and permissions for a contract, to restrict certain actions.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * const rolesAndMembers = await contract.roles.getAll();
+ * await contract.roles.grantRole("admin", "0x...");
+ * ```
* @public
*/
export class ContractRoles<
TContract extends IPermissionsEnumerable,
TRole extends Role,
-> {
+> implements DetectableFeature
+{
+ featureName = FEATURE_PERMISSIONS.name;
private contractWrapper;
private readonly roles;
diff --git a/src/core/classes/contract-royalty.ts b/src/core/classes/contract-royalty.ts
index 055e12ba7..1644d5481 100644
--- a/src/core/classes/contract-royalty.ts
+++ b/src/core/classes/contract-royalty.ts
@@ -5,15 +5,29 @@ import { ContractWrapper } from "./contract-wrapper";
import { z } from "zod";
import { TransactionResult } from "../types";
import { BigNumberish } from "ethers";
+import { FEATURE_ROYALTY } from "../../constants/thirdweb-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
/**
- * Handles Contract royalties
+ * Handle contract royalties
+ * @remarks Configure royalties for an entire contract or a particular token.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * const royaltyInfo = await contract.royalties.getDefaultRoyaltyInfo();
+ * await contract.roles.setTokenRoyaltyInfo(tokenId, {
+ * seller_fee_basis_points: 100, // 1% royalty fee
+ * fee_recipient: "0x...", // the fee recipient
+ * });
+ * ```
* @public
*/
export class ContractRoyalty<
TContract extends IRoyalty & (IThirdwebContract | ThirdwebContract),
TSchema extends IGenericSchemaType,
-> {
+> implements DetectableFeature
+{
+ featureName = FEATURE_ROYALTY.name;
private contractWrapper;
private metadata;
diff --git a/src/core/classes/contract-sales.ts b/src/core/classes/contract-sales.ts
index 60d0b5e35..0ff82391b 100644
--- a/src/core/classes/contract-sales.ts
+++ b/src/core/classes/contract-sales.ts
@@ -1,12 +1,24 @@
import { IPrimarySale } from "contracts";
import { ContractWrapper } from "./contract-wrapper";
import { TransactionResult } from "../types";
+import { FEATURE_PRIMARY_SALE } from "../../constants/thirdweb-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
/**
- * Handles primary sales recipients for a Contract
+ * Handle primary sales recipients
+ * @remarks Configure primary sale recipients for an entire contract.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * const salesRecipient = await contract.sales.getRecipient();
+ * await contract.roles.setRecipient(recipientWalletAddress);
+ * ```
* @public
*/
-export class ContractPrimarySale {
+export class ContractPrimarySale
+ implements DetectableFeature
+{
+ featureName = FEATURE_PRIMARY_SALE.name;
private contractWrapper;
constructor(contractWrapper: ContractWrapper) {
diff --git a/src/core/classes/erc-1155-batch-mintable.ts b/src/core/classes/erc-1155-batch-mintable.ts
index ed73e79d8..de0f2c665 100644
--- a/src/core/classes/erc-1155-batch-mintable.ts
+++ b/src/core/classes/erc-1155-batch-mintable.ts
@@ -8,8 +8,21 @@ import { uploadOrExtractURIs } from "../../common/nft";
import { ethers } from "ethers";
import { TokensMintedEvent } from "contracts/TokenERC1155";
import { IStorage } from "../interfaces";
+import { FEATURE_EDITION_BATCH_MINTABLE } from "../../constants/erc1155-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
-export class Erc1155BatchMintable {
+/**
+ * Mint Many ERC1155 NFTs at once
+ * @remarks NFT batch minting functionality that handles IPFS storage for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.edition.mint.batch.to(walletAddress, [nftMetadataWithSupply1, nftMetadataWithSupply2, ...]);
+ * ```
+ * @public
+ */
+export class Erc1155BatchMintable implements DetectableFeature {
+ featureName = FEATURE_EDITION_BATCH_MINTABLE.name;
private contractWrapper: ContractWrapper;
private erc1155: Erc1155;
private storage: IStorage;
@@ -51,7 +64,7 @@ export class Erc1155BatchMintable {
* },
* }];
*
- * const tx = await contract.mintBatchTo(toAddress, metadataWithSupply);
+ * const tx = await contract.edition.mint.batch.to(toAddress, metadataWithSupply);
* const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
* const firstTokenId = tx[0].id; // token id of the first minted NFT
* const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
diff --git a/src/core/classes/erc-1155-enumerable.ts b/src/core/classes/erc-1155-enumerable.ts
index 97e323892..e97f1dabb 100644
--- a/src/core/classes/erc-1155-enumerable.ts
+++ b/src/core/classes/erc-1155-enumerable.ts
@@ -5,8 +5,21 @@ import { DEFAULT_QUERY_ALL_COUNT, QueryAllParams } from "../../types";
import { EditionMetadata, EditionMetadataOwner } from "../../schema";
import { Erc1155 } from "./erc-1155";
import { BaseERC1155 } from "../../types/eips";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
+import { FEATURE_EDITION_ENUMERABLE } from "../../constants/erc1155-features";
-export class Erc1155Enumerable {
+/**
+ * List ERC1155 NFTs
+ * @remarks Easily list all the NFTs in a ERC1155 contract.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * const nfts = await contract.edition.query.all();
+ * ```
+ * @public
+ */
+export class Erc1155Enumerable implements DetectableFeature {
+ featureName = FEATURE_EDITION_ENUMERABLE.name;
private contractWrapper: ContractWrapper;
private erc1155: Erc1155;
@@ -27,8 +40,7 @@ export class Erc1155Enumerable {
*
* @example
* ```javascript
- * const nfts = await contract.getAll();
- * console.log(nfts);
+ * const nfts = await contract.edition.query.all();
* ```
* @param queryParams - optional filtering to only fetch a subset of results.
* @returns The NFT metadata for all NFTs queried.
@@ -67,8 +79,7 @@ export class Erc1155Enumerable {
* ```javascript
* // Address of the wallet to get the NFTs of
* const address = "{{wallet_address}}";
- * const nfts = await contract.getOwned(address);
- * console.log(nfts);
+ * const nfts = await contract.edition.query.owned(address);
* ```
*
* @returns The NFT metadata for all NFTs in the contract.
diff --git a/src/core/classes/erc-1155-mintable.ts b/src/core/classes/erc-1155-mintable.ts
index 23f823757..5e407cc4d 100644
--- a/src/core/classes/erc-1155-mintable.ts
+++ b/src/core/classes/erc-1155-mintable.ts
@@ -10,8 +10,21 @@ import { uploadOrExtractURI } from "../../common/nft";
import { BigNumber, BigNumberish, ethers } from "ethers";
import { TokensMintedEvent } from "contracts/TokenERC1155";
import { IStorage } from "../interfaces";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
+import { FEATURE_EDITION_MINTABLE } from "../../constants/erc1155-features";
-export class Erc1155Mintable {
+/**
+ * Mint ERC1155 NFTs
+ * @remarks NFT minting functionality that handles IPFS storage for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.edition.mint.to(walletAddress, nftMetadata);
+ * ```
+ * @public
+ */
+export class Erc1155Mintable implements DetectableFeature {
+ featureName = FEATURE_EDITION_MINTABLE.name;
private contractWrapper: ContractWrapper;
private erc1155: Erc1155;
private storage: IStorage;
diff --git a/src/core/classes/erc-1155.ts b/src/core/classes/erc-1155.ts
index 071c87945..b0b5d8f6a 100644
--- a/src/core/classes/erc-1155.ts
+++ b/src/core/classes/erc-1155.ts
@@ -22,14 +22,23 @@ import { AirdropInputSchema } from "../../schema/contracts/common/airdrop";
import { BaseERC1155 } from "../../types/eips";
import { Erc1155Enumerable } from "./erc-1155-enumerable";
import { Erc1155Mintable } from "./erc-1155-mintable";
+import { FEATURE_EDITION } from "../../constants/erc1155-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
/**
- * Standard ERC1155 functions
+ * Standard ERC1155 NFT functions
+ * @remarks Basic functionality for a ERC1155 contract that handles IPFS storage for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.edition.transfer(walletAddress, tokenId, quantity);
+ * ```
* @public
*/
export class Erc1155
- implements UpdateableNetwork
+ implements UpdateableNetwork, DetectableFeature
{
+ featureName = FEATURE_EDITION.name;
protected contractWrapper: ContractWrapper;
protected storage: IStorage;
protected options: SDKOptions;
@@ -78,7 +87,6 @@ export class Erc1155
* @example
* ```javascript
* const nft = await contract.get("0");
- * console.log(nft);
* ```
* @param tokenId - the tokenId of the NFT to retrieve
* @returns The NFT metadata
@@ -113,12 +121,9 @@ export class Erc1155
* @example
* ```javascript
* // Address of the wallet to check NFT balance
- * const address = "{{wallet_address}}";
- * // Id of the NFT to check
- * const tokenId = 0;
- *
- * const balance = await contract.balanceOf(address, tokenId);
- * console.log(balance);
+ * const walletAddress = "{{wallet_address}}";
+ * const tokenId = 0; // Id of the NFT to check
+ * const balance = await contract.balanceOf(walletAddress, tokenId);
* ```
*/
public async balanceOf(
@@ -163,12 +168,8 @@ export class Erc1155
* ```javascript
* // Address of the wallet you want to send the NFT to
* const toAddress = "{{wallet_address}}";
- *
- * // The token ID of the NFT you want to send
- * const tokenId = "0";
- * // How many copies of the NFTs to transfer
- * const amount = 3;
- *
+ * const tokenId = "0"; // The token ID of the NFT you want to send
+ * const amount = 3; // How many copies of the NFTs to transfer
* await contract.transfer(toAddress, tokenId, amount);
* ```
*/
diff --git a/src/core/classes/erc-20-batch-mintable.ts b/src/core/classes/erc-20-batch-mintable.ts
index c99af6b80..8e7787dc4 100644
--- a/src/core/classes/erc-20-batch-mintable.ts
+++ b/src/core/classes/erc-20-batch-mintable.ts
@@ -4,8 +4,21 @@ import { Erc20 } from "./erc-20";
import { BaseERC20 } from "../../types/eips";
import { TokenMintInput } from "../../schema";
import { TransactionResult } from "../types";
+import { FEATURE_TOKEN_BATCH_MINTABLE } from "../../constants/erc20-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
-export class Erc20BatchMintable {
+/**
+ * Mint Many ERC20 Tokens at once
+ * @remarks Token batch minting functionality that handles unit parsing for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.token.mint.batch.to(walletAddress, [nftMetadata1, nftMetadata2, ...]);
+ * ```
+ * @public
+ */
+export class Erc20BatchMintable implements DetectableFeature {
+ featureName = FEATURE_TOKEN_BATCH_MINTABLE.name;
private contractWrapper: ContractWrapper;
private erc20: Erc20;
diff --git a/src/core/classes/erc-20-mintable.ts b/src/core/classes/erc-20-mintable.ts
index e6c3a5cec..1ce46f41e 100644
--- a/src/core/classes/erc-20-mintable.ts
+++ b/src/core/classes/erc-20-mintable.ts
@@ -6,8 +6,21 @@ import { BaseERC20 } from "../../types/eips";
import { Erc20 } from "./erc-20";
import { Amount } from "../../types";
import { Erc20BatchMintable } from "./erc-20-batch-mintable";
+import { FEATURE_TOKEN_MINTABLE } from "../../constants/erc20-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
-export class Erc20Mintable {
+/**
+ * Mint ERC20 Tokens
+ * @remarks Token minting functionality that handles unit parsing for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.nft.mint.to(walletAddress, nftMetadata);
+ * ```
+ * @public
+ */
+export class Erc20Mintable implements DetectableFeature {
+ featureName = FEATURE_TOKEN_MINTABLE.name;
private contractWrapper: ContractWrapper;
private erc20: Erc20;
@@ -34,7 +47,6 @@ export class Erc20Mintable {
* ```javascript
* const toAddress = "{{wallet_address}}"; // Address of the wallet you want to mint the tokens to
* const amount = "1.5"; // The amount of this token you want to mint
- *
* await contract.mintTo(toAddress, amount);
* ```
*/
diff --git a/src/core/classes/erc-20.ts b/src/core/classes/erc-20.ts
index b7194e2c0..ebd7007fa 100644
--- a/src/core/classes/erc-20.ts
+++ b/src/core/classes/erc-20.ts
@@ -15,14 +15,23 @@ import { PriceSchema } from "../../schema";
import { BaseERC20 } from "../../types/eips";
import { detectContractFeature } from "../../common";
import { Erc20Mintable } from "./erc-20-mintable";
+import { FEATURE_TOKEN } from "../../constants/erc20-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
/**
- * Standard ERC20 functions
+ * Standard ERC20 Token functions
+ * @remarks Basic functionality for a ERC20 contract that handles all unit transformation for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.token.transfer(walletAddress, amount);
+ * ```
* @public
*/
export class Erc20
- implements UpdateableNetwork
+ implements UpdateableNetwork, DetectableFeature
{
+ featureName = FEATURE_TOKEN.name;
protected contractWrapper: ContractWrapper;
protected storage: IStorage;
protected options: SDKOptions;
@@ -72,7 +81,6 @@ export class Erc20
* @example
* ```javascript
* const token = await contract.get();
- * console.log(token);
* ```
* @returns The token metadata
*/
@@ -108,10 +116,8 @@ export class Erc20
* @example
* ```javascript
* // Address of the wallet to check token balance
- * const address = "{{wallet_address}}";
- *
- * const balance = await contract.balanceOf(address);
- * console.log(balance);
+ * const walletAddress = "{{wallet_address}}";
+ * const balance = await contract.balanceOf(walletAddress);
* ```
*
* @returns The balance of a specific wallet.
@@ -140,9 +146,7 @@ export class Erc20
* ```javascript
* // Address of the wallet to check token allowance
* const spenderAddress = "0x...";
- *
* const allowance = await contract.allowanceOf(otherAddress);
- * console.log(allowance);
* ```
*
* @returns The allowance of one wallet over anothers funds.
@@ -162,13 +166,10 @@ export class Erc20
* @example
* ```javascript
* // Address of the wallet who owns the funds
- * const address = "{{wallet_address}}";
- *
+ * const owner = "{{wallet_address}}";
* // Address of the wallet to check token allowance
- * const spenderAddress = "0x...";
- *
- * const allowance = await contract.allowanceOf(address, spenderAddress);
- * console.log(allowance);
+ * const spender = "0x...";
+ * const allowance = await contract.allowanceOf(owner, spender);
* ```
*
* @returns The allowance of one wallet over anothers funds.
@@ -195,10 +196,8 @@ export class Erc20
* ```javascript
* // Address of the wallet you want to send the tokens to
* const toAddress = "0x...";
- *
* // The amount of tokens you want to send
* const amount = 0.1;
- *
* await contract.transfer(toAddress, amount);
* ```
*/
@@ -223,13 +222,10 @@ export class Erc20
* ```javascript
* // Address of the wallet sending the tokens
* const fromAddress = "{{wallet_address}}";
- *
* // Address of the wallet you want to send the tokens to
* const toAddress = "0x...";
- *
* // The number of tokens you want to send
* const amount = 1.2
- *
* // Note that the connected wallet must have approval to transfer the tokens of the fromAddress
* await contract.transferFrom(fromAddress, toAddress, amount);
* ```
@@ -255,10 +251,8 @@ export class Erc20
* ```javascript
* // Address of the wallet to allow transfers from
* const spenderAddress = "0x...";
- *
* // The number of tokens to give as allowance
* const amount = 100
- *
* await contract.setAllowance(spenderAddress, amount);
* ```
*/
diff --git a/src/core/classes/erc-721-batch-mintable.ts b/src/core/classes/erc-721-batch-mintable.ts
index 7a7ccdb61..f5b265bba 100644
--- a/src/core/classes/erc-721-batch-mintable.ts
+++ b/src/core/classes/erc-721-batch-mintable.ts
@@ -7,8 +7,21 @@ import { IStorage } from "../interfaces";
import { Erc721 } from "./erc-721";
import { TokensMintedEvent } from "contracts/IMintableERC721";
import { BaseERC721 } from "../../types/eips";
+import { FEATURE_NFT_BATCH_MINTABLE } from "../../constants/erc721-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
-export class Erc721BatchMintable {
+/**
+ * Mint Many ERC721 NFTs at once
+ * @remarks NFT batch minting functionality that handles IPFS storage for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.nft.mint.batch.to(walletAddress, [nftMetadata1, nftMetadata2, ...]);
+ * ```
+ * @public
+ */
+export class Erc721BatchMintable implements DetectableFeature {
+ featureName = FEATURE_NFT_BATCH_MINTABLE.name;
private contractWrapper: ContractWrapper;
private storage: IStorage;
private erc721: Erc721;
diff --git a/src/core/classes/erc-721-enumerable.ts b/src/core/classes/erc-721-enumerable.ts
index ffaaaedc1..2f6489a8d 100644
--- a/src/core/classes/erc-721-enumerable.ts
+++ b/src/core/classes/erc-721-enumerable.ts
@@ -4,8 +4,22 @@ import { BigNumber } from "ethers";
import { NFTMetadataOwner } from "../../schema";
import { Erc721 } from "./erc-721";
import { BaseERC721 } from "../../types/eips";
+import { FEATURE_NFT_ENUMERABLE } from "../../constants/erc721-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
-export class Erc721Enumerable {
+/**
+ * List owned ERC721 NFTs
+ * @remarks Easily list all the NFTs from a ERC721 contract, owned by a certain wallet.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * const walletAddress = "0x...";
+ * const ownedNFTs = await contract.nft.query.owned.all(walletAddress);
+ * ```
+ * @public
+ */
+export class Erc721Enumerable implements DetectableFeature {
+ featureName = FEATURE_NFT_ENUMERABLE.name;
private contractWrapper: ContractWrapper;
private erc721: Erc721;
@@ -27,9 +41,8 @@ export class Erc721Enumerable {
* // Address of the wallet to get the NFTs of
* const address = "{{wallet_address}}";
* const nfts = await contract.query.owned.all(address);
- * console.log(nfts);
* ```
- *
+ * @param walletAddress - the wallet address to query, defaults to the connected wallet
* @returns The NFT metadata for all NFTs in the contract.
*/
public async all(walletAddress?: string): Promise {
diff --git a/src/core/classes/erc-721-mintable.ts b/src/core/classes/erc-721-mintable.ts
index 8b6da37ec..0e167c629 100644
--- a/src/core/classes/erc-721-mintable.ts
+++ b/src/core/classes/erc-721-mintable.ts
@@ -9,8 +9,21 @@ import { TokensMintedEvent } from "contracts/IMintableERC721";
import { Erc721BatchMintable } from "./erc-721-batch-mintable";
import { detectContractFeature } from "../../common";
import { BaseERC721 } from "../../types/eips";
+import { FEATURE_NFT_MINTABLE } from "../../constants/erc721-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
-export class Erc721Mintable {
+/**
+ * Mint ERC721 NFTs
+ * @remarks NFT minting functionality that handles IPFS storage for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.nft.mint.to(walletAddress, nftMetadata);
+ * ```
+ * @public
+ */
+export class Erc721Mintable implements DetectableFeature {
+ featureName = FEATURE_NFT_MINTABLE.name;
private contractWrapper: ContractWrapper;
private storage: IStorage;
private erc721: Erc721;
@@ -45,7 +58,7 @@ export class Erc721Mintable {
* image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
* };
*
- * const tx = await contract.mintTo(walletAddress, metadata);
+ * const tx = await contract.mint.to(walletAddress, metadata);
* const receipt = tx.receipt; // the transaction receipt
* const tokenId = tx.id; // the id of the NFT minted
* const nft = await tx.data(); // (optional) fetch details of minted NFT
diff --git a/src/core/classes/erc-721-supply.ts b/src/core/classes/erc-721-supply.ts
index 2dc474f64..ad1ba35dd 100644
--- a/src/core/classes/erc-721-supply.ts
+++ b/src/core/classes/erc-721-supply.ts
@@ -7,8 +7,21 @@ import { Erc721 } from "./erc-721";
import { BaseERC721 } from "../../types/eips";
import { detectContractFeature } from "../../common";
import { Erc721Enumerable } from "./erc-721-enumerable";
+import { FEATURE_NFT_SUPPLY } from "../../constants/erc721-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
-export class Erc721Supply {
+/**
+ * List ERC721 NFTs
+ * @remarks Easily list all the NFTs in a ERC721 contract.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * const nfts = await contract.nft.query.all();
+ * ```
+ * @public
+ */
+export class Erc721Supply implements DetectableFeature {
+ featureName = FEATURE_NFT_SUPPLY.name;
private contractWrapper: ContractWrapper;
private erc721: Erc721;
@@ -33,7 +46,6 @@ export class Erc721Supply {
* @example
* ```javascript
* const nfts = await contract.query.all();
- * console.log(nfts);
* ```
* @param queryParams - optional filtering to only fetch a subset of results.
* @returns The NFT metadata for all NFTs queried.
diff --git a/src/core/classes/erc-721.ts b/src/core/classes/erc-721.ts
index e37678150..56a0794ed 100644
--- a/src/core/classes/erc-721.ts
+++ b/src/core/classes/erc-721.ts
@@ -17,14 +17,23 @@ import {
import { Erc721Supply } from "./erc-721-supply";
import { Erc721Mintable } from "./erc-721-mintable";
import { BaseERC721 } from "../../types/eips";
+import { FEATURE_NFT } from "../../constants/erc721-features";
+import { DetectableFeature } from "../interfaces/DetectableFeature";
/**
- * Standard ERC721 functions
+ * Standard ERC721 NFT functions
+ * @remarks Basic functionality for a ERC721 contract that handles IPFS storage for you.
+ * @example
+ * ```javascript
+ * const contract = sdk.getContract("{{contract_address}}");
+ * await contract.nft.transfer(walletAddress, tokenId);
+ * ```
* @public
*/
export class Erc721
- implements UpdateableNetwork
+ implements UpdateableNetwork, DetectableFeature
{
+ featureName = FEATURE_NFT.name;
protected contractWrapper: ContractWrapper;
protected storage: IStorage;
protected options: SDKOptions;
@@ -72,8 +81,8 @@ export class Erc721
*
* @example
* ```javascript
- * const nft = await contract.get("0");
- * console.log(nft);
+ * const tokenId = 0;
+ * const nft = await contract.get(tokenId);
* ```
* @param tokenId - the tokenId of the NFT to retrieve
* @returns The NFT metadata
@@ -103,10 +112,8 @@ export class Erc721
*
* @example
* ```javascript
- * // Address of the wallet to check NFT balance
- * const address = "{{wallet_address}}";
- *
- * const balance = await contract.balanceOf(address);
+ * const walletAddress = "{{wallet_address}}";
+ * const balance = await contract.balanceOf(walletAddress);
* console.log(balance);
* ```
*/
@@ -144,13 +151,9 @@ export class Erc721
*
* @example
* ```javascript
- * // Address of the wallet you want to send the NFT to
- * const toAddress = "{{wallet_address}}";
- *
- * // The token ID of the NFT you want to send
- * const tokenId = "0";
- *
- * await contract.transfer(toAddress, tokenId);
+ * const walletAddress = "{{wallet_address}}";
+ * const tokenId = 0;
+ * await contract.transfer(walletAddress, tokenId);
* ```
*/
public async transfer(
diff --git a/src/core/classes/index.ts b/src/core/classes/index.ts
index a2fcde654..b8fdeb575 100644
--- a/src/core/classes/index.ts
+++ b/src/core/classes/index.ts
@@ -7,6 +7,8 @@ export * from "./drop-claim-conditions";
export * from "./drop-erc1155-claim-conditions";
export * from "./drop-erc1155-history";
export * from "./erc-20";
+export * from "./erc-20-mintable";
+export * from "./erc-20-batch-mintable";
export * from "./erc-20-history";
export * from "./erc-20-signature-minting";
export * from "./erc-721";
@@ -17,6 +19,8 @@ export * from "./erc-721-mintable";
export * from "./erc-721-batch-mintable";
export * from "./erc-1155";
export * from "./erc-1155-enumerable";
+export * from "./erc-1155-mintable";
+export * from "./erc-1155-batch-mintable";
export * from "./erc-1155-signature-minting";
export * from "./marketplace-direct";
export * from "./marketplace-auction";
diff --git a/src/core/interfaces/DetectableFeature.ts b/src/core/interfaces/DetectableFeature.ts
new file mode 100644
index 000000000..d2654bbfe
--- /dev/null
+++ b/src/core/interfaces/DetectableFeature.ts
@@ -0,0 +1,5 @@
+import { FeatureName } from "../../constants/contract-features";
+
+export interface DetectableFeature {
+ featureName: FeatureName;
+}