docs: modular contract docs (#4553)

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates JSDoc annotations in various files to change `@module` to `@modules` for improved clarity and consistency.

### Detailed summary
- Updated JSDoc annotations from `@module` to `@modules` in multiple files
- Added `@social` tag in `tsdoc.json`
- Updated annotations in ERC20, ERC721, and ERC1155 related modules

> The following files were skipped due to too many changes: `packages/thirdweb/src/extensions/airdrop/write/merkleInfoERC721.ts`, `packages/thirdweb/src/extensions/airdrop/write/merkleInfoERC1155.ts`, `packages/thirdweb/src/extensions/modules/common/installPublishedModule.ts`, `packages/thirdweb/src/extensions/modules/common/uninstallPublishedModule.ts`, `packages/thirdweb/src/extensions/modules/MintableERC20/mintWithSignature.ts`, `packages/thirdweb/src/extensions/modules/MintableERC721/mintWithSignature.ts`, `packages/thirdweb/src/extensions/modules/MintableERC1155/mintWithSignature.ts`, `packages/thirdweb/src/extensions/split/read/getRecipientSplitPercentage.ts`, `packages/thirdweb/src/react/core/utils/defaultTokens.ts`, `apps/portal/src/app/typescript/v5/modular/upgrade/page.mdx`, `packages/thirdweb/src/extensions/airdrop/write/airdropERC20WithSignature.ts`, `packages/thirdweb/src/extensions/airdrop/write/airdropERC721WithSignature.ts`, `packages/thirdweb/src/extensions/airdrop/write/airdropERC1155WithSignature.ts`, `packages/thirdweb/src/extensions/erc20/drops/read/getActiveClaimCondition.ts`, `packages/thirdweb/src/extensions/modules/BatchMetadataERC721/uploadMetadata.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/module/install.ts`, `packages/thirdweb/src/extensions/modules/ClaimableERC20/setClaimConditions.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/module/install.ts`, `packages/thirdweb/src/extensions/modules/ClaimableERC721/setClaimConditions.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/module/install.ts`, `packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/module/install.ts`, `packages/thirdweb/src/extensions/modules/ClaimableERC1155/setClaimConditions.ts`, `apps/portal/src/app/typescript/v5/modular/interact/page.mdx`, `apps/portal/src/app/typescript/v5/modular/deploy/page.mdx`, `packages/thirdweb/src/extensions/modules/BatchMetadataERC1155/uploadMetadata.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/read/totalMinted.ts`, `packages/thirdweb/scripts/generate/generate.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/read/getSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/read/getSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/read/getSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/read/getClaimCondition.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/read/getClaimCondition.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidator.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getDefaultRoyaltyInfo.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidator.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getDefaultRoyaltyInfo.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabled.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabled.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getTransferValidationFunction.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabled.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/encodeBytesOnInstall.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getTransferValidationFunction.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/encodeBytesOnInstall.ts`, `packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/encodeBytesOnInstall.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/encodeBytesOnInstall.ts`, `packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/read/getAllMetadataBatches.ts`, `packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/getNextTokenId.ts`, `packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/encodeBytesOnInstall.ts`, `packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/read/getAllMetadataBatches.ts`, `packages/thirdweb/src/extensions/modules/__generated__/SequentialTokenIdERC1155/read/encodeBytesOnInstall.ts`, `packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/encodeBytesOnInstall.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/burn.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mint.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/burn.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mint.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/burn.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mint.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/initialize.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/initialize.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/initialize.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC20Core/write/mintWithSignature.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC721Core/write/mintWithSignature.ts`, `packages/thirdweb/src/extensions/modules/common/getOrDeployModule.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ERC1155Core/write/mintWithSignature.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setTokenURI.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC20/write/setSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setRoyaltyInfoForToken.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC721/write/setSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setTransferValidator.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setRoyaltyInfoForToken.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/MintableERC1155/write/setSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setTransferValidator.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/write/setDefaultRoyaltyInfo.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC20/write/setClaimCondition.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setSaleConfig.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/write/setDefaultRoyaltyInfo.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC721/write/setClaimCondition.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferable.ts`, `apps/portal/src/app/typescript/v5/modular/page.mdx`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/write/setTransferableFor.ts`, `packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC721/write/uploadMetadata.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferable.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/write/setTransferableFor.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/write/setClaimConditionByTokenId.ts`, `packages/thirdweb/src/extensions/modules/__generated__/BatchMetadataERC1155/write/uploadMetadata.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferable.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/write/setTransferableFor.ts`, `packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/write/setSharedMetadata.ts`, `apps/portal/src/app/typescript/v5/modular/built-in/page.tsx`, `apps/portal/src/app/typescript/v5/extensions/built-in/page.tsx`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/royaltyInfo.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/royaltyInfo.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC721/read/getRoyaltyInfoForToken.ts`, `packages/thirdweb/src/extensions/modules/__generated__/RoyaltyERC1155/read/getRoyaltyInfoForToken.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC20/read/isTransferEnabledFor.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC721/read/isTransferEnabledFor.ts`, `packages/thirdweb/src/extensions/modules/__generated__/TransferableERC1155/read/isTransferEnabledFor.ts`, `packages/thirdweb/src/extensions/modules/__generated__/ClaimableERC1155/read/getClaimConditionByTokenId.ts`, `packages/thirdweb/src/extensions/modules/__generated__/OpenEditionMetadataERC721/read/onTokenURI.ts`, `packages/thirdweb/src/exports/modules.ts`, `apps/portal/src/app/references/components/TDoc/utils/slugs.ts`, `apps/portal/src/app/references/components/TDoc/utils/getSidebarLinkgroups.ts`, `apps/portal/src/app/typescript/v5/sidebar.tsx`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
This commit is contained in:
joaquim-verges
2024-09-12 09:41:36 +00:00
parent 28c46b3bc4
commit 1f7bf82fe0
152 changed files with 1881 additions and 1228 deletions
@@ -1,320 +1,365 @@
import { SomeDoc } from "@/app/references/components/TDoc/types";
import { BlockTag, TransformedDoc } from "typedoc-better-json";
import {
LinkGroup,
SidebarLink,
import type { SomeDoc } from "@/app/references/components/TDoc/types";
import type { BlockTag, TransformedDoc } from "typedoc-better-json";
import type {
LinkGroup,
SidebarLink,
} from "../../../../../components/others/Sidebar";
import { subgroups } from "./subgroups";
import { uniqueSlugger } from "./uniqueSlugger";
const tagsToGroup = {
"@contract": "Contract",
"@claimConditions": "Claim Conditions",
"@nftDrop": "NFT Drop",
"@platformFees": "Royalty & Fees",
"@nft": "NFT",
"@metadata": "Metadata",
"@permissionControl": "Permissions Control",
"@networkConnection": "Network Connection",
"@delayedReveal": "Delayed Reveal",
"@marketplace": "Marketplace",
"@walletConnection": "Wallet Connection",
"@walletUtils": "Wallet Utilities",
"@token": "Tokens",
"@auth": "Auth",
"@smartWallet": "Smart Wallet",
"@connectWallet": "Connect Wallet",
"@appURI": "App URI",
"@storage": "Storage",
"@others": "Others",
"@wallet": "Wallets",
"@walletConfig": "WalletConfig",
"@theme": "Theme",
"@locale": "Locale",
"@abstractWallet": "Abstract Wallets",
"@extension": "Extensions",
"@rpc": "RPC",
"@transaction": "Transactions",
"@buyCrypto": "Buy Crypto",
"@utils": "Utils",
"@chain": "Chain",
"@social": "Social API",
"@contract": "Contract",
"@claimConditions": "Claim Conditions",
"@nftDrop": "NFT Drop",
"@platformFees": "Royalty & Fees",
"@nft": "NFT",
"@metadata": "Metadata",
"@permissionControl": "Permissions Control",
"@networkConnection": "Network Connection",
"@delayedReveal": "Delayed Reveal",
"@marketplace": "Marketplace",
"@walletConnection": "Wallet Connection",
"@walletUtils": "Wallet Utilities",
"@token": "Tokens",
"@auth": "Auth",
"@smartWallet": "Smart Wallet",
"@connectWallet": "Connect Wallet",
"@appURI": "App URI",
"@storage": "Storage",
"@others": "Others",
"@wallet": "Wallets",
"@walletConfig": "WalletConfig",
"@theme": "Theme",
"@locale": "Locale",
"@abstractWallet": "Abstract Wallets",
"@extension": "Extensions",
"@rpc": "RPC",
"@transaction": "Transactions",
"@buyCrypto": "Buy Crypto",
"@utils": "Utils",
"@chain": "Chain",
"@social": "Social API",
"@modules": "Modules",
} as const;
type TagKey = keyof typeof tagsToGroup;
const sidebarGroupOrder: TagKey[] = [
"@wallet",
"@abstractWallet",
"@locale",
"@chain",
"@contract",
"@networkConnection",
"@walletConfig",
"@walletConnection",
"@walletUtils",
"@nft",
"@buyCrypto",
"@nftDrop",
"@claimConditions",
"@delayedReveal",
"@token",
"@marketplace",
"@metadata",
"@permissionControl",
"@platformFees",
"@auth",
"@storage",
"@smartWallet",
"@connectWallet",
"@appURI",
"@extension",
"@transaction",
"@rpc",
"@utils",
"@social",
"@theme",
"@others",
"@wallet",
"@abstractWallet",
"@locale",
"@chain",
"@contract",
"@networkConnection",
"@walletConfig",
"@walletConnection",
"@walletUtils",
"@nft",
"@buyCrypto",
"@nftDrop",
"@claimConditions",
"@delayedReveal",
"@token",
"@marketplace",
"@metadata",
"@permissionControl",
"@platformFees",
"@auth",
"@storage",
"@smartWallet",
"@connectWallet",
"@appURI",
"@extension",
"@transaction",
"@rpc",
"@utils",
"@social",
"@modules",
"@theme",
"@others",
];
function findTag(
blockTags?: BlockTag[],
blockTags?: BlockTag[],
): [TagKey, string | undefined] | undefined {
if (!blockTags) {
return;
}
if (!blockTags) {
return;
}
for (const blockTag of blockTags) {
if (blockTag.tag in tagsToGroup) {
return [blockTag.tag as TagKey, getExtensionName(blockTag)];
}
}
for (const blockTag of blockTags) {
if (blockTag.tag in tagsToGroup) {
return [blockTag.tag as TagKey, getExtensionName(blockTag)];
}
}
}
export function getCustomTag(
doc: SomeDoc,
doc: SomeDoc,
): [TagKey, string | undefined] | undefined {
switch (doc.kind) {
case "class": {
return findTag(doc.blockTags);
}
case "function": {
if (doc.signatures && doc.signatures[0] && doc.signatures[0].blockTags) {
return findTag(doc.signatures?.[0].blockTags);
}
return undefined;
}
switch (doc.kind) {
case "class": {
return findTag(doc.blockTags);
}
case "function": {
if (doc.signatures && doc.signatures[0] && doc.signatures[0].blockTags) {
return findTag(doc.signatures?.[0].blockTags);
}
return undefined;
}
case "variable": {
return findTag(doc.blockTags);
}
case "variable": {
return findTag(doc.blockTags);
}
case "enum": {
return findTag(doc.blockTags);
}
case "enum": {
return findTag(doc.blockTags);
}
case "accessor": {
return findTag(doc.blockTags);
}
case "accessor": {
return findTag(doc.blockTags);
}
case "type": {
return findTag(doc.blockTags);
}
}
case "type": {
return findTag(doc.blockTags);
}
}
}
export function getSidebarLinkGroups(doc: TransformedDoc, path: string) {
const linkGroups: LinkGroup[] = [];
const generatedLinks = new Set<string>();
const linkGroups: LinkGroup[] = [];
const generatedLinks = new Set<string>();
const getLink = (href: string) => {
const link = uniqueSlugger({
base: href,
isUnique: (s) => !generatedLinks.has(s),
});
const getLink = (href: string) => {
const link = uniqueSlugger({
base: href,
isUnique: (s) => !generatedLinks.has(s),
});
generatedLinks.add(link);
return link;
};
generatedLinks.add(link);
return link;
};
// group links by tags
function createSubGroups(key: keyof typeof subgroups, docs: SomeDoc[]) {
const name = subgroups[key];
// group links by tags
function createSubGroups(key: keyof typeof subgroups, docs: SomeDoc[]) {
const name = subgroups[key];
const groups: {
[K in TagKey]?: SomeDoc[];
} = {};
const groups: {
[K in TagKey]?: SomeDoc[];
} = {};
const ungroupedLinks: SomeDoc[] = [];
const ungroupedLinks: SomeDoc[] = [];
const extensions = docs.filter((d) => {
const [tag] = getCustomTag(d) || [];
return tag === "@extension";
});
const extensions = docs.filter((d) => {
const [tag] = getCustomTag(d) || [];
return tag === "@extension";
});
// sort extensions into their own groups
if (extensions.length) {
const extensionGroups = extensions.reduce(
(acc, d) => {
const [, extensionName] = getCustomTag(d) || [];
if (extensionName) {
if (!acc[extensionName]) {
acc[extensionName] = [];
}
acc[extensionName]!.push(d);
}
return acc;
},
{} as Record<string, SomeDoc[]>,
);
const extensionLinkGroups = Object.entries(extensionGroups).map(
([extensionName, docs]) => {
const links = docs.map((d) => ({
name: d.name,
href: getLink(`${path}/${extensionName.toLowerCase()}/${d.name}`),
}));
return {
name: extensionName,
links,
};
},
);
if (!linkGroups.find((group) => group.name === name)) {
linkGroups.push({
name: name,
href: getLink(`${path}/${key}`),
links: [{ name: "Extensions", links: extensionLinkGroups }],
});
} else {
linkGroups
.find((group) => group.name === name)!
.links.push({ name: "Extensions", links: extensionLinkGroups });
}
}
const modules = docs.filter((d) => {
const [tag] = getCustomTag(d) || [];
return tag === "@modules";
});
const nonExtensions = docs.filter((d) => {
const [tag] = getCustomTag(d) || [];
return tag !== "@extension";
});
// sort extensions into their own groups
if (extensions.length) {
const extensionGroups = extensions.reduce(
(acc, d) => {
const [, extensionName] = getCustomTag(d) || [];
if (extensionName) {
if (!acc[extensionName]) {
acc[extensionName] = [];
}
acc[extensionName]!.push(d);
}
return acc;
},
{} as Record<string, SomeDoc[]>,
);
const extensionLinkGroups = Object.entries(extensionGroups).map(
([extensionName, docs]) => {
const links = docs.map((d) => ({
name: d.name,
href: getLink(`${path}/${extensionName.toLowerCase()}/${d.name}`),
}));
return {
name: extensionName,
links,
};
},
);
if (!linkGroups.find((group) => group.name === name)) {
linkGroups.push({
name: name,
href: getLink(`${path}/${key}`),
links: [{ name: "Extensions", links: extensionLinkGroups }],
});
} else {
linkGroups
.find((group) => group.name === name)!
.links.push({ name: "Extensions", links: extensionLinkGroups });
}
}
// sort into groups
nonExtensions.forEach((d) => {
const [tag] = getCustomTag(d) || [];
if (modules.length) {
const extensionGroups = modules.reduce(
(acc, d) => {
const [, extensionName] = getCustomTag(d) || [];
if (extensionName) {
if (!acc[extensionName]) {
acc[extensionName] = [];
}
acc[extensionName]!.push(d);
}
return acc;
},
{} as Record<string, SomeDoc[]>,
);
const extensionLinkGroups = Object.entries(extensionGroups).map(
([extensionName, docs]) => {
const links = docs.map((d) => ({
name: d.name,
href: getLink(`${path}/${extensionName.toLowerCase()}/${d.name}`),
}));
return {
name: extensionName,
links,
};
},
);
if (!linkGroups.find((group) => group.name === name)) {
linkGroups.push({
name: name,
href: getLink(`${path}/${key}`),
links: [{ name: "modules", links: extensionLinkGroups }],
});
} else {
linkGroups
.find((group) => group.name === name)!
.links.push({ name: "Modules", links: extensionLinkGroups });
}
}
if (tag) {
if (!groups[tag]) {
groups[tag] = [];
}
groups[tag]!.push(d);
} else {
ungroupedLinks.push(d);
}
});
const nonExtensions = docs.filter((d) => {
const [tag] = getCustomTag(d) || [];
return tag !== "@extension" && tag !== "@modules";
});
// If a group only has one item, do not create a group for it and add it to noGroups
for (const _tag in groups) {
const tag = _tag as TagKey;
const links = groups[tag];
if (links && links.length === 1 && links[0]) {
ungroupedLinks.push(links[0]);
delete groups[tag];
}
}
// sort into groups
nonExtensions.forEach((d) => {
const [tag] = getCustomTag(d) || [];
// throw error if we don't know where to put the group in sidebar ( because this leads to it not being added in sidebar at all )
Object.keys(groups).forEach((tag) => {
if (!sidebarGroupOrder.includes(tag as TagKey)) {
throw new Error(`${tag} not added in sidebarGroupOrder array`);
}
});
if (tag) {
if (!groups[tag]) {
groups[tag] = [];
}
groups[tag]!.push(d);
} else {
ungroupedLinks.push(d);
}
});
const links: SidebarLink[] = [];
// If a group only has one item, do not create a group for it and add it to noGroups
for (const _tag in groups) {
const tag = _tag as TagKey;
const links = groups[tag];
if (links && links.length === 1 && links[0]) {
ungroupedLinks.push(links[0]);
delete groups[tag];
}
}
const addGroup = (tag: TagKey) => {
const groupDocs = groups[tag];
if (!groupDocs) {
return;
}
// throw error if we don't know where to put the group in sidebar ( because this leads to it not being added in sidebar at all )
Object.keys(groups).forEach((tag) => {
if (!sidebarGroupOrder.includes(tag as TagKey)) {
throw new Error(`${tag} not added in sidebarGroupOrder array`);
}
});
links.push({
name: tagsToGroup[tag],
links: groupDocs.map((d) => ({
name: d.name,
href: getLink(`${path}/${d.name}`),
})),
});
};
const links: SidebarLink[] = [];
sidebarGroupOrder.forEach((tag) => {
addGroup(tag);
});
const addGroup = (tag: TagKey) => {
const groupDocs = groups[tag];
if (!groupDocs) {
return;
}
ungroupedLinks.forEach((d) => {
links.push({
name: d.name,
href: getLink(`${path}/${d.name}`),
});
});
links.push({
name: tagsToGroup[tag],
links: groupDocs.map((d) => ({
name: d.name,
href: getLink(`${path}/${d.name}`),
})),
});
};
const target = linkGroups.find((group) => group.name === name);
sidebarGroupOrder.forEach((tag) => {
addGroup(tag);
});
// push links to existing group
if (target) {
target.links.push(...links);
}
// create new group
else {
linkGroups.push({
name: name,
links: links,
href: getLink(`${path}/${key}`),
});
}
}
ungroupedLinks.forEach((d) => {
links.push({
name: d.name,
href: getLink(`${path}/${d.name}`),
});
});
if (doc.components) {
createSubGroups("components", doc.components);
}
const target = linkGroups.find((group) => group.name === name);
if (doc.hooks) {
createSubGroups("hooks", doc.hooks);
}
// push links to existing group
if (target) {
target.links.push(...links);
}
// create new group
else {
linkGroups.push({
name: name,
links: links,
href: getLink(`${path}/${key}`),
});
}
}
if (doc.classes) {
createSubGroups("classes", doc.classes);
}
if (doc.components) {
createSubGroups("components", doc.components);
}
if (doc.functions) {
createSubGroups("functions", doc.functions);
}
if (doc.hooks) {
createSubGroups("hooks", doc.hooks);
}
if (doc.variables) {
createSubGroups("variables", doc.variables);
}
if (doc.classes) {
createSubGroups("classes", doc.classes);
}
if (doc.types) {
createSubGroups("types", doc.types);
}
if (doc.functions) {
createSubGroups("functions", doc.functions);
}
if (doc.enums) {
createSubGroups("enums", doc.enums);
}
if (doc.variables) {
createSubGroups("variables", doc.variables);
}
return linkGroups;
if (doc.types) {
createSubGroups("types", doc.types);
}
if (doc.enums) {
createSubGroups("enums", doc.enums);
}
return linkGroups;
}
export function getExtensionName(
extensionBlockTag: BlockTag,
extensionBlockTag: BlockTag,
): string | undefined {
try {
const extensionNameString = (
extensionBlockTag?.summary?.[0]?.children?.[0]?.value || "COMMON"
).toUpperCase();
try {
const extensionNameString =
extensionBlockTag?.summary?.[0]?.children?.[0]?.value || "Common";
if (typeof extensionNameString === "string" && extensionNameString) {
return extensionNameString;
}
} catch {
return undefined;
}
if (typeof extensionNameString === "string" && extensionNameString) {
return extensionNameString;
}
} catch {
return undefined;
}
}
@@ -1,73 +1,79 @@
import { SomeDoc } from "@/app/references/components/TDoc/types";
import { TransformedDoc } from "typedoc-better-json";
import type { SomeDoc } from "@/app/references/components/TDoc/types";
import type { TransformedDoc } from "typedoc-better-json";
import { getExtensionName } from "./getSidebarLinkgroups";
import { subgroups } from "./subgroups";
import { uniqueSlugger } from "./uniqueSlugger";
export function fetchAllSlugs(doc: TransformedDoc) {
const names = Object.keys(getSlugToDocMap(doc));
const names = Object.keys(getSlugToDocMap(doc));
// add slugs for category pages
for (const _key in subgroups) {
const slug = _key as keyof typeof subgroups;
if (doc[slug]) {
names.push(slug);
}
}
// add slugs for category pages
for (const _key in subgroups) {
const slug = _key as keyof typeof subgroups;
if (doc[slug]) {
names.push(slug);
}
}
return names;
return names;
}
export function getSlugToDocMap(doc: TransformedDoc) {
const slugToDocMap: Record<string, SomeDoc> = {};
const slugToDocMap: Record<string, SomeDoc> = {};
const ensureUniqueSlug = (slug: string) => {
return uniqueSlugger({
base: slug,
isUnique: (s) => !(s in slugToDocMap),
});
};
const ensureUniqueSlug = (slug: string) => {
return uniqueSlugger({
base: slug,
isUnique: (s) => !(s in slugToDocMap),
});
};
for (const key in doc) {
const value = doc[key as keyof TransformedDoc];
if (Array.isArray(value)) {
value.forEach((v) => {
if (v.kind === "function") {
const extensionBlockTag = v.signatures
?.find((s) => s.blockTags?.some((tag) => tag.tag === "@extension"))
?.blockTags?.find((tag) => tag.tag === "@extension");
for (const key in doc) {
const value = doc[key as keyof TransformedDoc];
if (Array.isArray(value)) {
value.forEach((v) => {
if (v.kind === "function") {
const extensionBlockTag = v.signatures
?.find((s) =>
s.blockTags?.some(
(tag) => tag.tag === "@extension" || tag.tag === "@modules",
),
)
?.blockTags?.find(
(tag) => tag.tag === "@extension" || tag.tag === "@modules",
);
if (extensionBlockTag) {
const extensionName = getExtensionName(extensionBlockTag);
if (extensionName) {
const name = `${extensionName.toLowerCase()}/${v.name}`;
if (extensionBlockTag) {
const extensionName = getExtensionName(extensionBlockTag);
if (extensionName) {
const name = `${extensionName.toLowerCase()}/${v.name}`;
slugToDocMap[ensureUniqueSlug(name)] = v;
slugToDocMap[ensureUniqueSlug(name)] = v;
// skip to next loop
return;
}
}
}
// skip to next loop
return;
}
}
}
slugToDocMap[ensureUniqueSlug(v.name)] = v;
});
}
}
slugToDocMap[ensureUniqueSlug(v.name)] = v;
});
}
}
return slugToDocMap;
return slugToDocMap;
}
export function getLinkMap(doc: TransformedDoc, path: string) {
const linkMap: Map<string, string> = new Map();
for (const key in doc) {
const value = doc[key as keyof TransformedDoc];
if (Array.isArray(value)) {
value.forEach((v) => {
linkMap.set(v.name, `${path}/${v.name}`);
});
}
}
const linkMap: Map<string, string> = new Map();
for (const key in doc) {
const value = doc[key as keyof TransformedDoc];
if (Array.isArray(value)) {
value.forEach((v) => {
linkMap.set(v.name, `${path}/${v.name}`);
});
}
}
return linkMap;
return linkMap;
}
@@ -1,19 +1,25 @@
import { TBody, Table, Td, Th, Tr } from "@/components/Document/Table";
import Link from "next/link";
import { Heading, Paragraph } from "../../../../../components/Document";
import { fetchTypeScriptDoc } from "../../../../references/components/TDoc/fetchDocs/fetchTypeScriptDoc";
import { getCustomTag } from "../../../../references/components/TDoc/utils/getSidebarLinkgroups";
export default async function ExtensionPage() {
const doc = await import(
"../../../../../../../../packages/thirdweb/typedoc/documentation.json"
);
const toExclude = [""];
const docs = await fetchTypeScriptDoc("v5");
const extensions = [
...new Set(
doc.children
.filter((item: { name: string }) => item.name.startsWith("extensions/"))
.map((item: { name: string }) => item.name.split("/")[1]),
docs.functions
?.filter((f) => {
const [extension] = getCustomTag(f) || [];
return extension === "@extension";
})
?.map((f) => {
const [, extensionName] = getCustomTag(f) || [];
return extensionName;
})
.filter((item) => item !== undefined) || [],
),
].filter((name) => !toExclude.includes(name as string)) as string[];
];
const overrides: Record<string, { name?: string; description?: string }> = {
common: {
@@ -50,19 +56,16 @@ export default async function ExtensionPage() {
{extensions.map((item) => {
return (
<Tr key={item}>
<Td>{overrides[item]?.name ?? item.toUpperCase()}</Td>
<Td>{overrides[item]?.name ?? item}</Td>
<Td>
<Link
href={`/references/typescript/v5/functions#${item}`}
href={`/references/typescript/v5/functions#${item.toLowerCase()}`}
className="text-accent-500 hover:text-f-100 flex flex-nowrap items-center gap-4 whitespace-nowrap font-medium transition-colors"
>
thirdweb/extensions/{item}
thirdweb/extensions/{item.toLowerCase()}
</Link>
</Td>
<Td>
{overrides[item]?.description ??
`${item.toUpperCase()} extensions`}
</Td>
<Td>{overrides[item]?.description ?? `${item} extensions`}</Td>
</Tr>
);
})}
@@ -0,0 +1,66 @@
import { TBody, Table, Td, Th, Tr } from "@/components/Document/Table";
import Link from "next/link";
import { Heading, Paragraph } from "../../../../../components/Document";
import { fetchTypeScriptDoc } from "../../../../references/components/TDoc/fetchDocs/fetchTypeScriptDoc";
import { getCustomTag } from "../../../../references/components/TDoc/utils/getSidebarLinkgroups";
export default async function ModulesPage() {
const docs = await fetchTypeScriptDoc("v5");
const extensions = [
...new Set(
docs.functions
?.filter((f) => {
const [extension, extensionName] = getCustomTag(f) || [];
return extension === "@modules" && extensionName !== "Common";
})
?.map((f) => {
const [, extensionName] = getCustomTag(f) || [];
return extensionName;
})
.filter((item) => item !== undefined) || [],
),
];
return (
<>
<Heading level={1} id="built-in-extensions">
Built-in modules{" "}
</Heading>
<Paragraph>
The SDK comes packed with a set of built-in modules for convenient use.
Note that you can also create your own modules.
</Paragraph>
<Table>
<TBody>
<Tr>
<Th>Module Name</Th>
{/* <Th>Description</Th> TODO add descriptions */}
</Tr>
{extensions.map((item) => {
return (
<Tr key={item}>
<Td>
<Link
href={`/references/typescript/v5/functions#${item.toLowerCase()}`}
className="text-accent-500 hover:text-f-100 flex flex-nowrap items-center gap-4 whitespace-nowrap font-medium transition-colors"
>
{item}
</Link>
</Td>
{/* <Td>{`${item}`}</Td> */}
</Tr>
);
})}
</TBody>
</Table>
More modules are being added regularly. You can also{" "}
<Link
className="text-accent-500 hover:text-f-100 font-medium transition-colors"
href="/contracts/modular-contracts/get-started/create-module-contract"
>
create your own modules
</Link>
.
</>
);
}
@@ -0,0 +1,38 @@
import {
ArticleIconCard,
} from "@doc";
import {
ContractModularContractIcon
} from "@/icons";
# Deploying a Modular Contract
To deploy a modular contract, you can use the `deployModularContract` function. You can deploy just the core contract, or decide to deploy a core with specific modules preinstalled.
Here's an example of deploying a modular ERC721 contract with the `ClaimableERC721` and `BatchMetadataERC721` modules, which recreate a NFT Drop behavior.
```ts
import {
ClaimableERC721,
BatchMetadataERC721,
deployModularContract,
} from "thirdweb/modules";
const deployed = deployModularContract({
client,
chain,
account,
core: "ERC721", // or "ERC20" or "ERC1155"
params: {
name: "My Modular NFT Contract",
},
modules: [
ClaimableERC721.module({
primarySaleRecipient: "0x...",
}),
BatchMetadataERC721.module(),
],
});
```
Check out the [`deployModularContract`](/typescript/v5/common/deployModularContract) reference for more information.
@@ -0,0 +1,33 @@
import {
ArticleIconCard,
} from "@doc";
import {
ContractModularContractIcon
} from "@/icons";
# Interacting with a Modular Contract
There are core contracts for ERC20, ERC721 and ERC1155 standards. Those follow the standard ERCs and can be interacted with like usual with the standard extensions.
The interesting part is to interact with an attached module. This is done by using the defined module name spaced API for that module.
```ts
import { ClaimableERC721 } from "thirdweb/modules";
const transaction = ClaimableERC721.mint({
contract,
to: "0x...", // Address to mint tokens to
quantity: 2, // Amount of tokens to mint
});
// Send the transaction
await sendTransaction({ transaction, account });
```
You can view all the prebuilt modules available in the [modules reference](/references/typescript/v5/functions#modules-1).
@@ -0,0 +1,68 @@
import {
ArticleIconCard,
Stack
} from "@doc";
import {
ContractModularContractIcon,
ContractInteractIcon,
ContractExploreIcon,
ContractDeployIcon,
ContractPublishIcon,
TypeScriptIcon
} from "@/icons";
# Modular Contracts
Modular contracts are a new way to build, deploy, and interact with contracts that can be upgraded and modified over time.
<Stack>
<ArticleIconCard
title="Deploying Modular Contracts"
icon={ContractDeployIcon}
href="/typescript/v5/modular/deploy"
description="Learn how to deploy core contracts with modules"
/>
<ArticleIconCard
title="Upgrading Modular Contracts"
icon={ContractPublishIcon}
href="/typescript/v5/modular/upgrade"
description="Learn how to add and remove modules from your contracts"
/>
<ArticleIconCard
title="Interacting with Modular Contracts"
icon={ContractInteractIcon}
href="/typescript/v5/modular/interact"
description="Learn how to interact with modular contracts"
/>
</Stack>
## Built-in modules
The SDK comes with a set of built-in modules that are designed to make it easy to interact with popular contracts and protocols.
<ArticleIconCard
title="Built in modules"
icon={TypeScriptIcon}
href="/typescript/v5/modular/built-in"
description="View all built-in modules"
/>
## Creating your own modules
You can also create your own modules to add new functionality to your contracts. Learn more about how to create your own modules [here](/contracts/modular-contracts/get-started/create-module-contract).
<ArticleIconCard
title="Create your own modules"
icon={ContractExploreIcon}
href="/contracts/modular-contracts/get-started/create-module-contract"
description="Learn how to create your own custom modules"
/>
@@ -0,0 +1,25 @@
# Upgrading a Modular Contract
### Installing a new module
These modules can be swapped at any time, and new ones can also be added post deployment. Here's how to install a new module.
```ts
import {
RoyaltyERC721,
} from "thirdweb/modules";
const transaction = RoyaltyERC721.install({
contract: coreContract,
account,
params: {
royaltyRecipient: account.address,
royaltyBps: 100n,
transferValidator: ZERO_ADDRESS,
},
});
```
The `install` function is available on all modules, organized by module name space.
You can also use the standalone [`installPublishedModule`](/typescript/v5/common/installPublishedModule) function to install custom modules.
File diff suppressed because it is too large Load Diff
@@ -405,7 +405,7 @@ function getFunctionOrModuleInfo(
}
function getTsDocTag() {
return isModule
? `@module ${moduleName}`
? `@modules ${moduleName}`
: `@extension ${extensionName.toUpperCase()}`;
}
return {
@@ -644,7 +644,7 @@ const contractId = "${moduleName}";
* ],
* });
* \`\`\`
* @module ${moduleName}
* @modules ${moduleName}
*/
export function module(${needsParams ? "params: EncodeBytesOnInstallParams & { publisher?: string }" : "params?: { publisher?: string }"}) {
return async (args: {
@@ -692,7 +692,7 @@ export function module(${needsParams ? "params: EncodeBytesOnInstallParams & { p
* account,
* });
* \`\`\`
* @module ${moduleName}
* @modules ${moduleName}
*/
export function install(options: {
contract: ThirdwebContract;
@@ -712,9 +712,11 @@ export function install(options: {
* Encodes the install data for the ${moduleName} module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module ${moduleName}
* @modules ${moduleName}
*/
export const encodeInstall = ${needsParams ? "encodeBytesOnInstallParams" : "() => '0x'"}
export function encodeInstall(${needsParams ? "params: EncodeBytesOnInstallParams" : ""}) {
return ${needsParams ? "encodeBytesOnInstallParams(params)" : `"0x"`};
}
`;
}
+1 -1
View File
@@ -2,7 +2,7 @@
import { typedoc } from "typedoc-gen";
typedoc({
entryPoints: ["src/exports/**/*.ts"],
entryPoints: ["src/exports/**/*.ts", "src/extensions/modules/**/index.ts"],
exclude: [
"src/exports/*.native.ts",
"src/exports/**/*.native.ts",
@@ -16,7 +16,8 @@ import { formatCompilerMetadata } from "./compiler-metadata.js";
* });
* const metadata = await getCompilerMetadata(contract);
* ```
* @returns
* @returns The compiler metadata for the contract
* @contract
*/
export async function getCompilerMetadata(contract: ThirdwebContract) {
const { address, chain } = contract;
+71 -1
View File
@@ -1,20 +1,90 @@
// Modules
/**
* All functions related to the MintableERC20 module.
* @modules MintableERC20
*/
export * as MintableERC20 from "../extensions/modules/MintableERC20/index.js";
/**
* All functions related to the MintableERC721 module.
* @modules MintableERC721
*/
export * as MintableERC721 from "../extensions/modules/MintableERC721/index.js";
/**
* All functions related to the MintableERC1155 module.
* @modules MintableERC1155
*/
export * as MintableERC1155 from "../extensions/modules/MintableERC1155/index.js";
/**
* All functions related to the ClaimableERC20 module.
* @modules ClaimableERC20
*/
export * as ClaimableERC20 from "../extensions/modules/ClaimableERC20/index.js";
/**
* All functions related to the ClaimableERC721 module.
* @modules ClaimableERC721
*/
export * as ClaimableERC721 from "../extensions/modules/ClaimableERC721/index.js";
/**
* All functions related to the ClaimableERC1155 module.
* @modules ClaimableERC1155
*/
export * as ClaimableERC1155 from "../extensions/modules/ClaimableERC1155/index.js";
/**
* All functions related to the OpenEditionMetadataERC721 module.
* @modules OpenEditionMetadataERC721
*/
export * as OpenEditionMetadataERC721 from "../extensions/modules/OpenEditionMetadataERC721/index.js";
/**
* All functions related to the BatchMetadataERC721 module.
* @modules BatchMetadataERC721
*/
export * as BatchMetadataERC721 from "../extensions/modules/BatchMetadataERC721/index.js";
/**
* All functions related to the BatchMetadataERC1155 module.
* @modules BatchMetadataERC1155
*/
export * as BatchMetadataERC1155 from "../extensions/modules/BatchMetadataERC1155/index.js";
/**
* All functions related to the SequentialTokenIdERC1155 module.
* @modules SequentialTokenIdERC1155
*/
export * as SequentialTokenIdERC1155 from "../extensions/modules/SequentialTokenIdERC1155/index.js";
/**
* All functions related to the RoyaltyERC721 module.
* @modules RoyaltyERC721
*/
export * as RoyaltyERC721 from "../extensions/modules/RoyaltyERC721/index.js";
/**
* All functions related to the RoyaltyERC1155 module.
* @modules RoyaltyERC1155
*/
export * as RoyaltyERC1155 from "../extensions/modules/RoyaltyERC1155/index.js";
export * as TransferableERC20 from "../extensions/modules/TransferableERC721/index.js";
/**
* All functions related to the TransferableERC20 module.
* @modules TransferableERC20
*/
export * as TransferableERC20 from "../extensions/modules/TransferableERC20/index.js";
/**
* All functions related to the TransferableERC721 module.
* @modules TransferableERC721
*/
export * as TransferableERC721 from "../extensions/modules/TransferableERC721/index.js";
/**
* All functions related to the TransferableERC1155 module.
* @modules TransferableERC1155
*/
export * as TransferableERC1155 from "../extensions/modules/TransferableERC1155/index.js";
// deploy
export {
deployModularContract,
type DeployModularContractOptions,
type CoreType,
type ModularContractParams,
type ModuleInstallData,
type ModuleInstaller,
} from "../extensions/prebuilts/deploy-modular.js";
// Common
export { grantMinterRole } from "../extensions/modules/common/grantMinterRole.js";
export {
@@ -23,13 +23,13 @@ import { airdropERC1155WithSignature as generatedAirdropERC1155WithSignature } f
* });
* await sendTransaction({ transaction, account });
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the transaction result.
*/
export const airdropERC1155WithSignature = generatedAirdropERC1155WithSignature;
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type GenerateAirdropERC1155SignatureOptions = {
account: Account;
@@ -67,7 +67,7 @@ export type GenerateAirdropERC1155SignatureOptions = {
* });
* await sendTransaction({ transaction, account });
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the req and signature.
*/
export async function generateAirdropSignatureERC1155(
@@ -23,13 +23,13 @@ import { airdropERC20WithSignature as generatedAirdropERC20WithSignature } from
* });
* await sendTransaction({ transaction, account });
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the transaction result.
*/
export const airdropERC20WithSignature = generatedAirdropERC20WithSignature;
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type GenerateAirdropERC20SignatureOptions = {
account: Account;
@@ -67,7 +67,7 @@ export type GenerateAirdropERC20SignatureOptions = {
* });
* await sendTransaction({ transaction, account });
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the req and signature.
*/
export async function generateAirdropSignatureERC20(
@@ -23,13 +23,13 @@ import { airdropERC721WithSignature as generatedAirdropERC721WithSignature } fro
* });
* await sendTransaction({ transaction, account });
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the transaction result.
*/
export const airdropERC721WithSignature = generatedAirdropERC721WithSignature;
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type GenerateAirdropERC721SignatureOptions = {
account: Account;
@@ -67,7 +67,7 @@ export type GenerateAirdropERC721SignatureOptions = {
* });
* await sendTransaction({ transaction, account });
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the req and signature.
*/
export async function generateAirdropSignatureERC721(
@@ -5,7 +5,7 @@ import { tokenMerkleRoot } from "../__generated__/Airdrop/read/tokenMerkleRoot.j
import { claimERC1155 as generatedClaimERC1155 } from "../__generated__/Airdrop/write/claimERC1155.js";
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type ClaimERC1155Params = {
tokenAddress: string;
@@ -32,7 +32,7 @@ export type ClaimERC1155Params = {
* await sendTransaction({ claimTransaction, account });
*
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the transaction result.
*/
export function claimERC1155(
@@ -9,7 +9,7 @@ import { tokenMerkleRoot } from "../__generated__/Airdrop/read/tokenMerkleRoot.j
import { claimERC20 as generatedClaimERC20 } from "../__generated__/Airdrop/write/claimERC20.js";
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type ClaimERC20Params = {
tokenAddress: string;
@@ -36,7 +36,7 @@ export type ClaimERC20Params = {
* await sendTransaction({ claimTransaction, account });
*
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the transaction result.
*/
export function claimERC20(options: BaseTransactionOptions<ClaimERC20Params>) {
@@ -5,7 +5,7 @@ import { tokenMerkleRoot } from "../__generated__/Airdrop/read/tokenMerkleRoot.j
import { claimERC721 as generatedClaimERC721 } from "../__generated__/Airdrop/write/claimERC721.js";
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type ClaimERC721Params = {
tokenAddress: string;
@@ -32,7 +32,7 @@ export type ClaimERC721Params = {
* await sendTransaction({ claimTransaction, account });
*
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the transaction result.
*/
export function claimERC721(
@@ -3,7 +3,7 @@ import { processSnapshotERC1155 } from "../../../utils/extensions/airdrop/proces
import type { SnapshotEntryERC1155 } from "../../../utils/extensions/airdrop/types.js";
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type GenerateMerkleTreeInfoERC1155Params = {
snapshot: SnapshotEntryERC1155[];
@@ -37,7 +37,7 @@ export type GenerateMerkleTreeInfoERC1155Params = {
* // - Set merkle root on the contract to enable claiming
*
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the merkle-root and snapshot-uri.
*/
export async function generateMerkleTreeInfoERC1155(
@@ -7,7 +7,7 @@ import { processSnapshotERC20 } from "../../../utils/extensions/airdrop/process-
import type { SnapshotEntryERC20 } from "../../../utils/extensions/airdrop/types.js";
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type GenerateMerkleTreeInfoERC20Params = {
snapshot: SnapshotEntryERC20[];
@@ -41,7 +41,7 @@ export type GenerateMerkleTreeInfoERC20Params = {
* // - Set merkle root on the contract to enable claiming
*
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the merkle-root and snapshot-uri.
*/
export async function generateMerkleTreeInfoERC20(
@@ -3,7 +3,7 @@ import { processSnapshotERC721 } from "../../../utils/extensions/airdrop/process
import type { SnapshotEntryERC721 } from "../../../utils/extensions/airdrop/types.js";
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type GenerateMerkleTreeInfoERC721Params = {
snapshot: SnapshotEntryERC721[];
@@ -37,7 +37,7 @@ export type GenerateMerkleTreeInfoERC721Params = {
* // - Set merkle root on the contract to enable claiming
*
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the merkle-root and snapshot-uri.
*/
export async function generateMerkleTreeInfoERC721(
@@ -3,7 +3,7 @@ import type { BaseTransactionOptions } from "../../../transaction/types.js";
import { setContractURI } from "../../common/__generated__/IContractMetadata/write/setContractURI.js";
/**
* @extension Airdrop
* @extension AIRDROP
*/
export type SaveSnapshotParams = {
merkleRoot: string;
@@ -52,7 +52,7 @@ export type SaveSnapshotParams = {
* await sendTransaction({ setMerkleRootTransaction, account });
*
* ```
* @extension Airdrop
* @extension AIRDROP
* @returns A promise that resolves to the transaction result.
*/
export function saveSnapshot(
@@ -26,6 +26,18 @@ export async function getActiveClaimCondition(
}
}
/**
* Checks if the `getActiveClaimCondition` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getActiveClaimCondition` method is supported.
* @extension ERC20
* @example
* ```ts
* import { isGetActiveClaimConditionSupported } from "thirdweb/extensions/erc20";
*
* const supported = isGetActiveClaimConditionSupported(["0x..."]);
* ```
*/
export function isGetActiveClaimConditionSupported(
availableSelectors: string[],
) {
@@ -53,7 +53,7 @@ export type GetApprovalForTransactionParams = {
* }
* ```
*
* @transactions
* @transaction
*/
export async function getApprovalForTransaction(
options: GetApprovalForTransactionParams,
@@ -1,3 +1,4 @@
import type { BaseTransactionOptions } from "../../../transaction/types.js";
import {} from "../../../utils/ipfs.js";
import {
type UploadMetadataParams as CommonUploadMetadataParams,
@@ -6,5 +7,32 @@ import {
export type UploadMetadataParams = CommonUploadMetadataParams;
// exact same implementation as BatchMetadataERC721
export const uploadMetadata = commonUploadMetadata;
/**
* Uploads metadata for a batch of NFTs.
* @param options - The options for the transaction.
* @param options.contract - The contract to upload the metadata for.
* @param options.metadatas - The metadata for the NFTs.
* @returns The transaction to upload the metadata.
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
*
* const transaction = BatchMetadataERC1155.uploadMetadata({
* contract,
* metadatas: [
* { name: "My NFT", description: "This is my NFT" },
* ],
* });
*
* await sendTransaction({
* transaction,
* account,
* });
* ```
*/
export function uploadMetadata(
options: BaseTransactionOptions<UploadMetadataParams>,
) {
return commonUploadMetadata(options);
}
@@ -10,6 +10,30 @@ export type UploadMetadataParams = {
metadatas: (NFTInput | string)[];
};
/**
* Uploads metadata for a batch of NFTs.
* @param options - The options for the transaction.
* @param options.contract - The contract to upload the metadata for.
* @param options.metadatas - The metadata for the NFTs.
* @returns The transaction to upload the metadata.
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
*
* const transaction = BatchMetadataERC721.uploadMetadata({
* contract,
* metadatas: [
* { name: "My NFT", description: "This is my NFT" },
* ],
* });
*
* await sendTransaction({
* transaction,
* account,
* });
* ```
*/
export function uploadMetadata(
options: BaseTransactionOptions<UploadMetadataParams>,
) {
@@ -30,7 +30,7 @@ export type MintParams = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module ClaimableERC1155
* @modules ClaimableERC1155
*/
export function mint(options: BaseTransactionOptions<MintParams>) {
return generatedMint({
@@ -10,6 +10,26 @@ import type { ClaimConditionInput } from "../../../utils/extensions/drops/types.
import { keccak256 } from "../../../utils/hashing/keccak256.js";
import { setClaimConditionByTokenId as generatedSetClaimCondition } from "../__generated__/ClaimableERC1155/write/setClaimConditionByTokenId.js";
/**
* Sets the claim conditions for a given token ID.
* @param options - The options for setting the claim conditions.
* @returns A transaction to set the claim conditions.
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
*
* const transaction = ClaimableERC1155.setClaimCondition({
* contract: contract,
* tokenId: 0n,
* pricePerToken: "1", // in ETH
* maxClaimableSupply: "1000000",
* maxClaimablePerWallet: "1",
* });
*
* await sendTransaction({ transaction, account });
* ```
*/
export function setClaimCondition(
options: BaseTransactionOptions<ClaimConditionInput & { tokenId: bigint }>,
) {
@@ -28,7 +28,7 @@ export type MintParams = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module ClaimableERC20
* @modules ClaimableERC20
*/
export function mint(options: BaseTransactionOptions<MintParams>) {
return generatedMint({
@@ -10,6 +10,25 @@ import type { ClaimConditionInput } from "../../../utils/extensions/drops/types.
import { keccak256 } from "../../../utils/hashing/keccak256.js";
import { setClaimCondition as generatedSetClaimCondition } from "../__generated__/ClaimableERC20/write/setClaimCondition.js";
/**
* Sets the claim conditions for a given token ID.
* @param options - The options for setting the claim conditions.
* @returns A transaction to set the claim conditions.
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
*
* const transaction = ClaimableERC20.setClaimCondition({
* contract: contract,
* pricePerToken: "1", // in ETH
* maxClaimableSupply: "1000000",
* maxClaimablePerWallet: "1",
* });
*
* await sendTransaction({ transaction, account });
* ```
*/
export function setClaimCondition(
options: BaseTransactionOptions<ClaimConditionInput>,
) {
@@ -29,7 +29,7 @@ export type MintParams = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module ClaimableERC721
* @modules ClaimableERC721
*/
export function mint(options: BaseTransactionOptions<MintParams>) {
return generatedMint({
@@ -10,6 +10,25 @@ import type { ClaimConditionInput } from "../../../utils/extensions/drops/types.
import { keccak256 } from "../../../utils/hashing/keccak256.js";
import { setClaimCondition as generatedSetClaimCondition } from "../__generated__/ClaimableERC721/write/setClaimCondition.js";
/**
* Sets the claim conditions for a given token ID.
* @param options - The options for setting the claim conditions.
* @returns A transaction to set the claim conditions.
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
*
* const transaction = ClaimableERC721.setClaimCondition({
* contract: contract,
* pricePerToken: "1", // in ETH
* maxClaimableSupply: "1000000",
* maxClaimablePerWallet: "1",
* });
*
* await sendTransaction({ transaction, account });
* ```
*/
export function setClaimCondition(
options: BaseTransactionOptions<ClaimConditionInput>,
) {
@@ -37,7 +37,7 @@ export type EditionMintParams = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC1155
* @modules MintableERC1155
*/
export function mintWithRole(
options: BaseTransactionOptions<EditionMintParams>,
@@ -49,7 +49,7 @@ import {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC1155
* @modules MintableERC1155
*/
export function mintWithSignature(
options: BaseTransactionOptions<
@@ -114,7 +114,7 @@ export type GenerateMintSignatureOptions = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC1155
* @modules MintableERC1155
*/
export async function generateMintSignature(
options: GenerateMintSignatureOptions,
@@ -26,7 +26,7 @@ export type TokenMintParams = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC20
* @modules MintableERC20
*/
export function mintWithRole(options: BaseTransactionOptions<TokenMintParams>) {
return generatedMint({
@@ -42,7 +42,7 @@ import {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC20
* @modules MintableERC20
*/
export function mintWithSignature(
options: BaseTransactionOptions<
@@ -99,7 +99,7 @@ export type GenerateMintSignatureOptions = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC20
* @modules MintableERC20
*/
export async function generateMintSignature(
options: GenerateMintSignatureOptions,
@@ -36,7 +36,7 @@ export type NFTMintParams = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC721
* @modules MintableERC721
*/
export function mintWithRole(options: BaseTransactionOptions<NFTMintParams>) {
return generatedMint({
@@ -53,7 +53,7 @@ import {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC721
* @modules MintableERC721
*/
export function mintWithSignature(
options: BaseTransactionOptions<
@@ -116,7 +116,7 @@ export type GenerateMintSignatureOptions = {
* // Send the transaction
* await sendTransaction({ transaction, account });
* ```
* @module MintableERC721
* @modules MintableERC721
*/
export async function generateMintSignature(
options: GenerateMintSignatureOptions,
@@ -3,7 +3,7 @@ import { prepareEvent } from "../../../../../event/prepare-event.js";
/**
* Creates an event object for the BatchMetadataUpdate event.
* @returns The prepared event object.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -31,7 +31,7 @@ const contractId = "BatchMetadataERC1155";
* ],
* });
* ```
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
*/
export function module(params?: { publisher?: string }) {
return async (args: {
@@ -73,7 +73,7 @@ export function module(params?: { publisher?: string }) {
* account,
* });
* ```
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
*/
export function install(options: {
contract: ThirdwebContract;
@@ -93,6 +93,8 @@ export function install(options: {
* Encodes the install data for the BatchMetadataERC1155 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
*/
export const encodeInstall = () => "0x";
export function encodeInstall() {
return "0x";
}
@@ -17,7 +17,7 @@ const FN_OUTPUTS = [
* Checks if the `encodeBytesOnInstall` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `encodeBytesOnInstall` method is supported.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -35,7 +35,7 @@ export function isEncodeBytesOnInstallSupported(availableSelectors: string[]) {
* Decodes the result of the encodeBytesOnInstall function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function decodeEncodeBytesOnInstallResult(result: Hex) {
* Calls the "encodeBytesOnInstall" function on the contract.
* @param options - The options for the encodeBytesOnInstall function.
* @returns The parsed result of the function call.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -31,7 +31,7 @@ const FN_OUTPUTS = [
* Checks if the `getAllMetadataBatches` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getAllMetadataBatches` method is supported.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -49,7 +49,7 @@ export function isGetAllMetadataBatchesSupported(availableSelectors: string[]) {
* Decodes the result of the getAllMetadataBatches function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -64,7 +64,7 @@ export function decodeGetAllMetadataBatchesResult(result: Hex) {
* Calls the "getAllMetadataBatches" function on the contract.
* @param options - The options for the getAllMetadataBatches function.
* @returns The parsed result of the function call.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -33,7 +33,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `uploadMetadata` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `uploadMetadata` method is supported.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -52,7 +52,7 @@ export function isUploadMetadataSupported(availableSelectors: string[]) {
* Encodes the parameters for the "uploadMetadata" function.
* @param options - The options for the uploadMetadata function.
* @returns The encoded ABI parameters.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -70,7 +70,7 @@ export function encodeUploadMetadataParams(options: UploadMetadataParams) {
* Encodes the "uploadMetadata" function into a Hex string with its parameters.
* @param options - The options for the uploadMetadata function.
* @returns The encoded hexadecimal string.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { BatchMetadataERC1155 } from "thirdweb/modules";
@@ -93,7 +93,7 @@ export function encodeUploadMetadata(options: UploadMetadataParams) {
* Prepares a transaction to call the "uploadMetadata" function on the contract.
* @param options - The options for the "uploadMetadata" function.
* @returns A prepared transaction object.
* @module BatchMetadataERC1155
* @modules BatchMetadataERC1155
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -3,7 +3,7 @@ import { prepareEvent } from "../../../../../event/prepare-event.js";
/**
* Creates an event object for the BatchMetadataUpdate event.
* @returns The prepared event object.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -31,7 +31,7 @@ const contractId = "BatchMetadataERC721";
* ],
* });
* ```
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
*/
export function module(params?: { publisher?: string }) {
return async (args: {
@@ -73,7 +73,7 @@ export function module(params?: { publisher?: string }) {
* account,
* });
* ```
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
*/
export function install(options: {
contract: ThirdwebContract;
@@ -93,6 +93,8 @@ export function install(options: {
* Encodes the install data for the BatchMetadataERC721 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
*/
export const encodeInstall = () => "0x";
export function encodeInstall() {
return "0x";
}
@@ -17,7 +17,7 @@ const FN_OUTPUTS = [
* Checks if the `encodeBytesOnInstall` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `encodeBytesOnInstall` method is supported.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -35,7 +35,7 @@ export function isEncodeBytesOnInstallSupported(availableSelectors: string[]) {
* Decodes the result of the encodeBytesOnInstall function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function decodeEncodeBytesOnInstallResult(result: Hex) {
* Calls the "encodeBytesOnInstall" function on the contract.
* @param options - The options for the encodeBytesOnInstall function.
* @returns The parsed result of the function call.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -31,7 +31,7 @@ const FN_OUTPUTS = [
* Checks if the `getAllMetadataBatches` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getAllMetadataBatches` method is supported.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -49,7 +49,7 @@ export function isGetAllMetadataBatchesSupported(availableSelectors: string[]) {
* Decodes the result of the getAllMetadataBatches function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -64,7 +64,7 @@ export function decodeGetAllMetadataBatchesResult(result: Hex) {
* Calls the "getAllMetadataBatches" function on the contract.
* @param options - The options for the getAllMetadataBatches function.
* @returns The parsed result of the function call.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -33,7 +33,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `uploadMetadata` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `uploadMetadata` method is supported.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -52,7 +52,7 @@ export function isUploadMetadataSupported(availableSelectors: string[]) {
* Encodes the parameters for the "uploadMetadata" function.
* @param options - The options for the uploadMetadata function.
* @returns The encoded ABI parameters.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -70,7 +70,7 @@ export function encodeUploadMetadataParams(options: UploadMetadataParams) {
* Encodes the "uploadMetadata" function into a Hex string with its parameters.
* @param options - The options for the uploadMetadata function.
* @returns The encoded hexadecimal string.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { BatchMetadataERC721 } from "thirdweb/modules";
@@ -93,7 +93,7 @@ export function encodeUploadMetadata(options: UploadMetadataParams) {
* Prepares a transaction to call the "uploadMetadata" function on the contract.
* @param options - The options for the "uploadMetadata" function.
* @returns A prepared transaction object.
* @module BatchMetadataERC721
* @modules BatchMetadataERC721
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -36,7 +36,7 @@ const contractId = "ClaimableERC1155";
* ],
* });
* ```
* @module ClaimableERC1155
* @modules ClaimableERC1155
*/
export function module(
params: EncodeBytesOnInstallParams & { publisher?: string },
@@ -82,7 +82,7 @@ export function module(
* account,
* });
* ```
* @module ClaimableERC1155
* @modules ClaimableERC1155
*/
export function install(options: {
contract: ThirdwebContract;
@@ -102,6 +102,8 @@ export function install(options: {
* Encodes the install data for the ClaimableERC1155 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module ClaimableERC1155
* @modules ClaimableERC1155
*/
export const encodeInstall = encodeBytesOnInstallParams;
export function encodeInstall(params: EncodeBytesOnInstallParams) {
return encodeBytesOnInstallParams(params);
}
@@ -65,7 +65,7 @@ const FN_OUTPUTS = [
* Checks if the `getClaimConditionByTokenId` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getClaimConditionByTokenId` method is supported.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -85,7 +85,7 @@ export function isGetClaimConditionByTokenIdSupported(
* Encodes the parameters for the "getClaimConditionByTokenId" function.
* @param options - The options for the getClaimConditionByTokenId function.
* @returns The encoded ABI parameters.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -104,7 +104,7 @@ export function encodeGetClaimConditionByTokenIdParams(
* Encodes the "getClaimConditionByTokenId" function into a Hex string with its parameters.
* @param options - The options for the getClaimConditionByTokenId function.
* @returns The encoded hexadecimal string.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -128,7 +128,7 @@ export function encodeGetClaimConditionByTokenId(
* Decodes the result of the getClaimConditionByTokenId function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -143,7 +143,7 @@ export function decodeGetClaimConditionByTokenIdResult(result: Hex) {
* Calls the "getClaimConditionByTokenId" function on the contract.
* @param options - The options for the getClaimConditionByTokenId function.
* @returns The parsed result of the function call.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -18,7 +18,7 @@ const FN_OUTPUTS = [
* Checks if the `getSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getSaleConfig` method is supported.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -36,7 +36,7 @@ export function isGetSaleConfigSupported(availableSelectors: string[]) {
* Decodes the result of the getSaleConfig function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -51,7 +51,7 @@ export function decodeGetSaleConfigResult(result: Hex) {
* Calls the "getSaleConfig" function on the contract.
* @param options - The options for the getSaleConfig function.
* @returns The parsed result of the function call.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -80,7 +80,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setClaimConditionByTokenId` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setClaimConditionByTokenId` method is supported.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -101,7 +101,7 @@ export function isSetClaimConditionByTokenIdSupported(
* Encodes the parameters for the "setClaimConditionByTokenId" function.
* @param options - The options for the setClaimConditionByTokenId function.
* @returns The encoded ABI parameters.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -124,7 +124,7 @@ export function encodeSetClaimConditionByTokenIdParams(
* Encodes the "setClaimConditionByTokenId" function into a Hex string with its parameters.
* @param options - The options for the setClaimConditionByTokenId function.
* @returns The encoded hexadecimal string.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -149,7 +149,7 @@ export function encodeSetClaimConditionByTokenId(
* Prepares a transaction to call the "setClaimConditionByTokenId" function on the contract.
* @param options - The options for the "setClaimConditionByTokenId" function.
* @returns A prepared transaction object.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -31,7 +31,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setSaleConfig` method is supported.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function isSetSaleConfigSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setSaleConfig" function.
* @param options - The options for the setSaleConfig function.
* @returns The encoded ABI parameters.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -67,7 +67,7 @@ export function encodeSetSaleConfigParams(options: SetSaleConfigParams) {
* Encodes the "setSaleConfig" function into a Hex string with its parameters.
* @param options - The options for the setSaleConfig function.
* @returns The encoded hexadecimal string.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { ClaimableERC1155 } from "thirdweb/modules";
@@ -89,7 +89,7 @@ export function encodeSetSaleConfig(options: SetSaleConfigParams) {
* Prepares a transaction to call the "setSaleConfig" function on the contract.
* @param options - The options for the "setSaleConfig" function.
* @returns A prepared transaction object.
* @module ClaimableERC1155
* @modules ClaimableERC1155
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -36,7 +36,7 @@ const contractId = "ClaimableERC20";
* ],
* });
* ```
* @module ClaimableERC20
* @modules ClaimableERC20
*/
export function module(
params: EncodeBytesOnInstallParams & { publisher?: string },
@@ -82,7 +82,7 @@ export function module(
* account,
* });
* ```
* @module ClaimableERC20
* @modules ClaimableERC20
*/
export function install(options: {
contract: ThirdwebContract;
@@ -102,6 +102,8 @@ export function install(options: {
* Encodes the install data for the ClaimableERC20 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module ClaimableERC20
* @modules ClaimableERC20
*/
export const encodeInstall = encodeBytesOnInstallParams;
export function encodeInstall(params: EncodeBytesOnInstallParams) {
return encodeBytesOnInstallParams(params);
}
@@ -52,7 +52,7 @@ const FN_OUTPUTS = [
* Checks if the `getClaimCondition` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getClaimCondition` method is supported.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -70,7 +70,7 @@ export function isGetClaimConditionSupported(availableSelectors: string[]) {
* Decodes the result of the getClaimCondition function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -85,7 +85,7 @@ export function decodeGetClaimConditionResult(result: Hex) {
* Calls the "getClaimCondition" function on the contract.
* @param options - The options for the getClaimCondition function.
* @returns The parsed result of the function call.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -18,7 +18,7 @@ const FN_OUTPUTS = [
* Checks if the `getSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getSaleConfig` method is supported.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -36,7 +36,7 @@ export function isGetSaleConfigSupported(availableSelectors: string[]) {
* Decodes the result of the getSaleConfig function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -51,7 +51,7 @@ export function decodeGetSaleConfigResult(result: Hex) {
* Calls the "getSaleConfig" function on the contract.
* @param options - The options for the getSaleConfig function.
* @returns The parsed result of the function call.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -75,7 +75,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setClaimCondition` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setClaimCondition` method is supported.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -94,7 +94,7 @@ export function isSetClaimConditionSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setClaimCondition" function.
* @param options - The options for the setClaimCondition function.
* @returns The encoded ABI parameters.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -113,7 +113,7 @@ export function encodeSetClaimConditionParams(
* Encodes the "setClaimCondition" function into a Hex string with its parameters.
* @param options - The options for the setClaimCondition function.
* @returns The encoded hexadecimal string.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -135,7 +135,7 @@ export function encodeSetClaimCondition(options: SetClaimConditionParams) {
* Prepares a transaction to call the "setClaimCondition" function on the contract.
* @param options - The options for the "setClaimCondition" function.
* @returns A prepared transaction object.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -31,7 +31,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setSaleConfig` method is supported.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function isSetSaleConfigSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setSaleConfig" function.
* @param options - The options for the setSaleConfig function.
* @returns The encoded ABI parameters.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -67,7 +67,7 @@ export function encodeSetSaleConfigParams(options: SetSaleConfigParams) {
* Encodes the "setSaleConfig" function into a Hex string with its parameters.
* @param options - The options for the setSaleConfig function.
* @returns The encoded hexadecimal string.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { ClaimableERC20 } from "thirdweb/modules";
@@ -89,7 +89,7 @@ export function encodeSetSaleConfig(options: SetSaleConfigParams) {
* Prepares a transaction to call the "setSaleConfig" function on the contract.
* @param options - The options for the "setSaleConfig" function.
* @returns A prepared transaction object.
* @module ClaimableERC20
* @modules ClaimableERC20
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -36,7 +36,7 @@ const contractId = "ClaimableERC721";
* ],
* });
* ```
* @module ClaimableERC721
* @modules ClaimableERC721
*/
export function module(
params: EncodeBytesOnInstallParams & { publisher?: string },
@@ -82,7 +82,7 @@ export function module(
* account,
* });
* ```
* @module ClaimableERC721
* @modules ClaimableERC721
*/
export function install(options: {
contract: ThirdwebContract;
@@ -102,6 +102,8 @@ export function install(options: {
* Encodes the install data for the ClaimableERC721 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module ClaimableERC721
* @modules ClaimableERC721
*/
export const encodeInstall = encodeBytesOnInstallParams;
export function encodeInstall(params: EncodeBytesOnInstallParams) {
return encodeBytesOnInstallParams(params);
}
@@ -52,7 +52,7 @@ const FN_OUTPUTS = [
* Checks if the `getClaimCondition` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getClaimCondition` method is supported.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -70,7 +70,7 @@ export function isGetClaimConditionSupported(availableSelectors: string[]) {
* Decodes the result of the getClaimCondition function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -85,7 +85,7 @@ export function decodeGetClaimConditionResult(result: Hex) {
* Calls the "getClaimCondition" function on the contract.
* @param options - The options for the getClaimCondition function.
* @returns The parsed result of the function call.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -18,7 +18,7 @@ const FN_OUTPUTS = [
* Checks if the `getSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getSaleConfig` method is supported.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -36,7 +36,7 @@ export function isGetSaleConfigSupported(availableSelectors: string[]) {
* Decodes the result of the getSaleConfig function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -51,7 +51,7 @@ export function decodeGetSaleConfigResult(result: Hex) {
* Calls the "getSaleConfig" function on the contract.
* @param options - The options for the getSaleConfig function.
* @returns The parsed result of the function call.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -75,7 +75,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setClaimCondition` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setClaimCondition` method is supported.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -94,7 +94,7 @@ export function isSetClaimConditionSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setClaimCondition" function.
* @param options - The options for the setClaimCondition function.
* @returns The encoded ABI parameters.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -113,7 +113,7 @@ export function encodeSetClaimConditionParams(
* Encodes the "setClaimCondition" function into a Hex string with its parameters.
* @param options - The options for the setClaimCondition function.
* @returns The encoded hexadecimal string.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -135,7 +135,7 @@ export function encodeSetClaimCondition(options: SetClaimConditionParams) {
* Prepares a transaction to call the "setClaimCondition" function on the contract.
* @param options - The options for the "setClaimCondition" function.
* @returns A prepared transaction object.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -31,7 +31,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setSaleConfig` method is supported.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function isSetSaleConfigSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setSaleConfig" function.
* @param options - The options for the setSaleConfig function.
* @returns The encoded ABI parameters.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -67,7 +67,7 @@ export function encodeSetSaleConfigParams(options: SetSaleConfigParams) {
* Encodes the "setSaleConfig" function into a Hex string with its parameters.
* @param options - The options for the setSaleConfig function.
* @returns The encoded hexadecimal string.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { ClaimableERC721 } from "thirdweb/modules";
@@ -89,7 +89,7 @@ export function encodeSetSaleConfig(options: SetSaleConfigParams) {
* Prepares a transaction to call the "setSaleConfig" function on the contract.
* @param options - The options for the "setSaleConfig" function.
* @returns A prepared transaction object.
* @module ClaimableERC721
* @modules ClaimableERC721
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -43,7 +43,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `burn` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `burn` method is supported.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -62,7 +62,7 @@ export function isBurnSupported(availableSelectors: string[]) {
* Encodes the parameters for the "burn" function.
* @param options - The options for the burn function.
* @returns The encoded ABI parameters.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -87,7 +87,7 @@ export function encodeBurnParams(options: BurnParams) {
* Encodes the "burn" function into a Hex string with its parameters.
* @param options - The options for the burn function.
* @returns The encoded hexadecimal string.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -110,7 +110,7 @@ export function encodeBurn(options: BurnParams) {
* Prepares a transaction to call the "burn" function on the contract.
* @param options - The options for the "burn" function.
* @returns A prepared transaction object.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -59,7 +59,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `initialize` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `initialize` method is supported.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -78,7 +78,7 @@ export function isInitializeSupported(availableSelectors: string[]) {
* Encodes the parameters for the "initialize" function.
* @param options - The options for the initialize function.
* @returns The encoded ABI parameters.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -107,7 +107,7 @@ export function encodeInitializeParams(options: InitializeParams) {
* Encodes the "initialize" function into a Hex string with its parameters.
* @param options - The options for the initialize function.
* @returns The encoded hexadecimal string.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -134,7 +134,7 @@ export function encodeInitialize(options: InitializeParams) {
* Prepares a transaction to call the "initialize" function on the contract.
* @param options - The options for the "initialize" function.
* @returns A prepared transaction object.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -48,7 +48,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `mint` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `mint` method is supported.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -67,7 +67,7 @@ export function isMintSupported(availableSelectors: string[]) {
* Encodes the parameters for the "mint" function.
* @param options - The options for the mint function.
* @returns The encoded ABI parameters.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -94,7 +94,7 @@ export function encodeMintParams(options: MintParams) {
* Encodes the "mint" function into a Hex string with its parameters.
* @param options - The options for the mint function.
* @returns The encoded hexadecimal string.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -118,7 +118,7 @@ export function encodeMint(options: MintParams) {
* Prepares a transaction to call the "mint" function on the contract.
* @param options - The options for the "mint" function.
* @returns A prepared transaction object.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -53,7 +53,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `mintWithSignature` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `mintWithSignature` method is supported.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -72,7 +72,7 @@ export function isMintWithSignatureSupported(availableSelectors: string[]) {
* Encodes the parameters for the "mintWithSignature" function.
* @param options - The options for the mintWithSignature function.
* @returns The encoded ABI parameters.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -103,7 +103,7 @@ export function encodeMintWithSignatureParams(
* Encodes the "mintWithSignature" function into a Hex string with its parameters.
* @param options - The options for the mintWithSignature function.
* @returns The encoded hexadecimal string.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { ERC1155Core } from "thirdweb/modules";
@@ -130,7 +130,7 @@ export function encodeMintWithSignature(options: MintWithSignatureParams) {
* Prepares a transaction to call the "mintWithSignature" function on the contract.
* @param options - The options for the "mintWithSignature" function.
* @returns A prepared transaction object.
* @module ERC1155Core
* @modules ERC1155Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -38,7 +38,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `burn` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `burn` method is supported.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -57,7 +57,7 @@ export function isBurnSupported(availableSelectors: string[]) {
* Encodes the parameters for the "burn" function.
* @param options - The options for the burn function.
* @returns The encoded ABI parameters.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -80,7 +80,7 @@ export function encodeBurnParams(options: BurnParams) {
* Encodes the "burn" function into a Hex string with its parameters.
* @param options - The options for the burn function.
* @returns The encoded hexadecimal string.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -102,7 +102,7 @@ export function encodeBurn(options: BurnParams) {
* Prepares a transaction to call the "burn" function on the contract.
* @param options - The options for the "burn" function.
* @returns A prepared transaction object.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -59,7 +59,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `initialize` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `initialize` method is supported.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -78,7 +78,7 @@ export function isInitializeSupported(availableSelectors: string[]) {
* Encodes the parameters for the "initialize" function.
* @param options - The options for the initialize function.
* @returns The encoded ABI parameters.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -107,7 +107,7 @@ export function encodeInitializeParams(options: InitializeParams) {
* Encodes the "initialize" function into a Hex string with its parameters.
* @param options - The options for the initialize function.
* @returns The encoded hexadecimal string.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -134,7 +134,7 @@ export function encodeInitialize(options: InitializeParams) {
* Prepares a transaction to call the "initialize" function on the contract.
* @param options - The options for the "initialize" function.
* @returns A prepared transaction object.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -38,7 +38,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `mint` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `mint` method is supported.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -57,7 +57,7 @@ export function isMintSupported(availableSelectors: string[]) {
* Encodes the parameters for the "mint" function.
* @param options - The options for the mint function.
* @returns The encoded ABI parameters.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -80,7 +80,7 @@ export function encodeMintParams(options: MintParams) {
* Encodes the "mint" function into a Hex string with its parameters.
* @param options - The options for the mint function.
* @returns The encoded hexadecimal string.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -102,7 +102,7 @@ export function encodeMint(options: MintParams) {
* Prepares a transaction to call the "mint" function on the contract.
* @param options - The options for the "mint" function.
* @returns A prepared transaction object.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -43,7 +43,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `mintWithSignature` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `mintWithSignature` method is supported.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -62,7 +62,7 @@ export function isMintWithSignatureSupported(availableSelectors: string[]) {
* Encodes the parameters for the "mintWithSignature" function.
* @param options - The options for the mintWithSignature function.
* @returns The encoded ABI parameters.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -89,7 +89,7 @@ export function encodeMintWithSignatureParams(
* Encodes the "mintWithSignature" function into a Hex string with its parameters.
* @param options - The options for the mintWithSignature function.
* @returns The encoded hexadecimal string.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { ERC20Core } from "thirdweb/modules";
@@ -114,7 +114,7 @@ export function encodeMintWithSignature(options: MintWithSignatureParams) {
* Prepares a transaction to call the "mintWithSignature" function on the contract.
* @param options - The options for the "mintWithSignature" function.
* @returns A prepared transaction object.
* @module ERC20Core
* @modules ERC20Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -17,7 +17,7 @@ const FN_OUTPUTS = [
* Checks if the `totalMinted` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `totalMinted` method is supported.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -35,7 +35,7 @@ export function isTotalMintedSupported(availableSelectors: string[]) {
* Decodes the result of the totalMinted function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function decodeTotalMintedResult(result: Hex) {
* Calls the "totalMinted" function on the contract.
* @param options - The options for the totalMinted function.
* @returns The parsed result of the function call.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -33,7 +33,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `burn` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `burn` method is supported.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -52,7 +52,7 @@ export function isBurnSupported(availableSelectors: string[]) {
* Encodes the parameters for the "burn" function.
* @param options - The options for the burn function.
* @returns The encoded ABI parameters.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -70,7 +70,7 @@ export function encodeBurnParams(options: BurnParams) {
* Encodes the "burn" function into a Hex string with its parameters.
* @param options - The options for the burn function.
* @returns The encoded hexadecimal string.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -91,7 +91,7 @@ export function encodeBurn(options: BurnParams) {
* Prepares a transaction to call the "burn" function on the contract.
* @param options - The options for the "burn" function.
* @returns A prepared transaction object.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -59,7 +59,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `initialize` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `initialize` method is supported.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -78,7 +78,7 @@ export function isInitializeSupported(availableSelectors: string[]) {
* Encodes the parameters for the "initialize" function.
* @param options - The options for the initialize function.
* @returns The encoded ABI parameters.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -107,7 +107,7 @@ export function encodeInitializeParams(options: InitializeParams) {
* Encodes the "initialize" function into a Hex string with its parameters.
* @param options - The options for the initialize function.
* @returns The encoded hexadecimal string.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -134,7 +134,7 @@ export function encodeInitialize(options: InitializeParams) {
* Prepares a transaction to call the "initialize" function on the contract.
* @param options - The options for the "initialize" function.
* @returns A prepared transaction object.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -43,7 +43,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `mint` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `mint` method is supported.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -62,7 +62,7 @@ export function isMintSupported(availableSelectors: string[]) {
* Encodes the parameters for the "mint" function.
* @param options - The options for the mint function.
* @returns The encoded ABI parameters.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -87,7 +87,7 @@ export function encodeMintParams(options: MintParams) {
* Encodes the "mint" function into a Hex string with its parameters.
* @param options - The options for the mint function.
* @returns The encoded hexadecimal string.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -110,7 +110,7 @@ export function encodeMint(options: MintParams) {
* Prepares a transaction to call the "mint" function on the contract.
* @param options - The options for the "mint" function.
* @returns A prepared transaction object.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -48,7 +48,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `mintWithSignature` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `mintWithSignature` method is supported.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -67,7 +67,7 @@ export function isMintWithSignatureSupported(availableSelectors: string[]) {
* Encodes the parameters for the "mintWithSignature" function.
* @param options - The options for the mintWithSignature function.
* @returns The encoded ABI parameters.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -96,7 +96,7 @@ export function encodeMintWithSignatureParams(
* Encodes the "mintWithSignature" function into a Hex string with its parameters.
* @param options - The options for the mintWithSignature function.
* @returns The encoded hexadecimal string.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { ERC721Core } from "thirdweb/modules";
@@ -122,7 +122,7 @@ export function encodeMintWithSignature(options: MintWithSignatureParams) {
* Prepares a transaction to call the "mintWithSignature" function on the contract.
* @param options - The options for the "mintWithSignature" function.
* @returns A prepared transaction object.
* @module ERC721Core
* @modules ERC721Core
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -3,7 +3,7 @@ import { prepareEvent } from "../../../../../event/prepare-event.js";
/**
* Creates an event object for the MetadataUpdate event.
* @returns The prepared event object.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -3,7 +3,7 @@ import { prepareEvent } from "../../../../../event/prepare-event.js";
/**
* Creates an event object for the MintableTokenURIUpdated event.
* @returns The prepared event object.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -36,7 +36,7 @@ const contractId = "MintableERC1155";
* ],
* });
* ```
* @module MintableERC1155
* @modules MintableERC1155
*/
export function module(
params: EncodeBytesOnInstallParams & { publisher?: string },
@@ -82,7 +82,7 @@ export function module(
* account,
* });
* ```
* @module MintableERC1155
* @modules MintableERC1155
*/
export function install(options: {
contract: ThirdwebContract;
@@ -102,6 +102,8 @@ export function install(options: {
* Encodes the install data for the MintableERC1155 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module MintableERC1155
* @modules MintableERC1155
*/
export const encodeInstall = encodeBytesOnInstallParams;
export function encodeInstall(params: EncodeBytesOnInstallParams) {
return encodeBytesOnInstallParams(params);
}
@@ -18,7 +18,7 @@ const FN_OUTPUTS = [
* Checks if the `getSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getSaleConfig` method is supported.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -36,7 +36,7 @@ export function isGetSaleConfigSupported(availableSelectors: string[]) {
* Decodes the result of the getSaleConfig function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -51,7 +51,7 @@ export function decodeGetSaleConfigResult(result: Hex) {
* Calls the "getSaleConfig" function on the contract.
* @param options - The options for the getSaleConfig function.
* @returns The parsed result of the function call.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -31,7 +31,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setSaleConfig` method is supported.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function isSetSaleConfigSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setSaleConfig" function.
* @param options - The options for the setSaleConfig function.
* @returns The encoded ABI parameters.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -67,7 +67,7 @@ export function encodeSetSaleConfigParams(options: SetSaleConfigParams) {
* Encodes the "setSaleConfig" function into a Hex string with its parameters.
* @param options - The options for the setSaleConfig function.
* @returns The encoded hexadecimal string.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -89,7 +89,7 @@ export function encodeSetSaleConfig(options: SetSaleConfigParams) {
* Prepares a transaction to call the "setSaleConfig" function on the contract.
* @param options - The options for the "setSaleConfig" function.
* @returns A prepared transaction object.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -33,7 +33,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setTokenURI` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setTokenURI` method is supported.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -52,7 +52,7 @@ export function isSetTokenURISupported(availableSelectors: string[]) {
* Encodes the parameters for the "setTokenURI" function.
* @param options - The options for the setTokenURI function.
* @returns The encoded ABI parameters.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -70,7 +70,7 @@ export function encodeSetTokenURIParams(options: SetTokenURIParams) {
* Encodes the "setTokenURI" function into a Hex string with its parameters.
* @param options - The options for the setTokenURI function.
* @returns The encoded hexadecimal string.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { MintableERC1155 } from "thirdweb/modules";
@@ -93,7 +93,7 @@ export function encodeSetTokenURI(options: SetTokenURIParams) {
* Prepares a transaction to call the "setTokenURI" function on the contract.
* @param options - The options for the "setTokenURI" function.
* @returns A prepared transaction object.
* @module MintableERC1155
* @modules MintableERC1155
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -36,7 +36,7 @@ const contractId = "MintableERC20";
* ],
* });
* ```
* @module MintableERC20
* @modules MintableERC20
*/
export function module(
params: EncodeBytesOnInstallParams & { publisher?: string },
@@ -82,7 +82,7 @@ export function module(
* account,
* });
* ```
* @module MintableERC20
* @modules MintableERC20
*/
export function install(options: {
contract: ThirdwebContract;
@@ -102,6 +102,8 @@ export function install(options: {
* Encodes the install data for the MintableERC20 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module MintableERC20
* @modules MintableERC20
*/
export const encodeInstall = encodeBytesOnInstallParams;
export function encodeInstall(params: EncodeBytesOnInstallParams) {
return encodeBytesOnInstallParams(params);
}
@@ -18,7 +18,7 @@ const FN_OUTPUTS = [
* Checks if the `getSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getSaleConfig` method is supported.
* @module MintableERC20
* @modules MintableERC20
* @example
* ```ts
* import { MintableERC20 } from "thirdweb/modules";
@@ -36,7 +36,7 @@ export function isGetSaleConfigSupported(availableSelectors: string[]) {
* Decodes the result of the getSaleConfig function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module MintableERC20
* @modules MintableERC20
* @example
* ```ts
* import { MintableERC20 } from "thirdweb/modules";
@@ -51,7 +51,7 @@ export function decodeGetSaleConfigResult(result: Hex) {
* Calls the "getSaleConfig" function on the contract.
* @param options - The options for the getSaleConfig function.
* @returns The parsed result of the function call.
* @module MintableERC20
* @modules MintableERC20
* @example
* ```ts
* import { MintableERC20 } from "thirdweb/modules";
@@ -31,7 +31,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setSaleConfig` method is supported.
* @module MintableERC20
* @modules MintableERC20
* @example
* ```ts
* import { MintableERC20 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function isSetSaleConfigSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setSaleConfig" function.
* @param options - The options for the setSaleConfig function.
* @returns The encoded ABI parameters.
* @module MintableERC20
* @modules MintableERC20
* @example
* ```ts
* import { MintableERC20 } from "thirdweb/modules";
@@ -67,7 +67,7 @@ export function encodeSetSaleConfigParams(options: SetSaleConfigParams) {
* Encodes the "setSaleConfig" function into a Hex string with its parameters.
* @param options - The options for the setSaleConfig function.
* @returns The encoded hexadecimal string.
* @module MintableERC20
* @modules MintableERC20
* @example
* ```ts
* import { MintableERC20 } from "thirdweb/modules";
@@ -89,7 +89,7 @@ export function encodeSetSaleConfig(options: SetSaleConfigParams) {
* Prepares a transaction to call the "setSaleConfig" function on the contract.
* @param options - The options for the "setSaleConfig" function.
* @returns A prepared transaction object.
* @module MintableERC20
* @modules MintableERC20
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -3,7 +3,7 @@ import { prepareEvent } from "../../../../../event/prepare-event.js";
/**
* Creates an event object for the BatchMetadataUpdate event.
* @returns The prepared event object.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -21,7 +21,7 @@ export type NewMetadataBatchEventFilters = Partial<{
* Creates an event object for the NewMetadataBatch event.
* @param filters - Optional filters to apply to the event.
* @returns The prepared event object.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -36,7 +36,7 @@ const contractId = "MintableERC721";
* ],
* });
* ```
* @module MintableERC721
* @modules MintableERC721
*/
export function module(
params: EncodeBytesOnInstallParams & { publisher?: string },
@@ -82,7 +82,7 @@ export function module(
* account,
* });
* ```
* @module MintableERC721
* @modules MintableERC721
*/
export function install(options: {
contract: ThirdwebContract;
@@ -102,6 +102,8 @@ export function install(options: {
* Encodes the install data for the MintableERC721 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module MintableERC721
* @modules MintableERC721
*/
export const encodeInstall = encodeBytesOnInstallParams;
export function encodeInstall(params: EncodeBytesOnInstallParams) {
return encodeBytesOnInstallParams(params);
}
@@ -18,7 +18,7 @@ const FN_OUTPUTS = [
* Checks if the `getSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `getSaleConfig` method is supported.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { MintableERC721 } from "thirdweb/modules";
@@ -36,7 +36,7 @@ export function isGetSaleConfigSupported(availableSelectors: string[]) {
* Decodes the result of the getSaleConfig function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { MintableERC721 } from "thirdweb/modules";
@@ -51,7 +51,7 @@ export function decodeGetSaleConfigResult(result: Hex) {
* Calls the "getSaleConfig" function on the contract.
* @param options - The options for the getSaleConfig function.
* @returns The parsed result of the function call.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { MintableERC721 } from "thirdweb/modules";
@@ -31,7 +31,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setSaleConfig` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setSaleConfig` method is supported.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { MintableERC721 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function isSetSaleConfigSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setSaleConfig" function.
* @param options - The options for the setSaleConfig function.
* @returns The encoded ABI parameters.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { MintableERC721 } from "thirdweb/modules";
@@ -67,7 +67,7 @@ export function encodeSetSaleConfigParams(options: SetSaleConfigParams) {
* Encodes the "setSaleConfig" function into a Hex string with its parameters.
* @param options - The options for the setSaleConfig function.
* @returns The encoded hexadecimal string.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { MintableERC721 } from "thirdweb/modules";
@@ -89,7 +89,7 @@ export function encodeSetSaleConfig(options: SetSaleConfigParams) {
* Prepares a transaction to call the "setSaleConfig" function on the contract.
* @param options - The options for the "setSaleConfig" function.
* @returns A prepared transaction object.
* @module MintableERC721
* @modules MintableERC721
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -3,7 +3,7 @@ import { prepareEvent } from "../../../../../event/prepare-event.js";
/**
* Creates an event object for the BatchMetadataUpdate event.
* @returns The prepared event object.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -3,7 +3,7 @@ import { prepareEvent } from "../../../../../event/prepare-event.js";
/**
* Creates an event object for the SharedMetadataUpdated event.
* @returns The prepared event object.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -31,7 +31,7 @@ const contractId = "OpenEditionMetadataERC721";
* ],
* });
* ```
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
*/
export function module(params?: { publisher?: string }) {
return async (args: {
@@ -73,7 +73,7 @@ export function module(params?: { publisher?: string }) {
* account,
* });
* ```
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
*/
export function install(options: {
contract: ThirdwebContract;
@@ -93,6 +93,8 @@ export function install(options: {
* Encodes the install data for the OpenEditionMetadataERC721 module.
* @param params - The parameters for the module.
* @returns - The encoded data.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
*/
export const encodeInstall = () => "0x";
export function encodeInstall() {
return "0x";
}
@@ -17,7 +17,7 @@ const FN_OUTPUTS = [
* Checks if the `encodeBytesOnInstall` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `encodeBytesOnInstall` method is supported.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -35,7 +35,7 @@ export function isEncodeBytesOnInstallSupported(availableSelectors: string[]) {
* Decodes the result of the encodeBytesOnInstall function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -50,7 +50,7 @@ export function decodeEncodeBytesOnInstallResult(result: Hex) {
* Calls the "encodeBytesOnInstall" function on the contract.
* @param options - The options for the encodeBytesOnInstall function.
* @returns The parsed result of the function call.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -30,7 +30,7 @@ const FN_OUTPUTS = [
* Checks if the `onTokenURI` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `onTokenURI` method is supported.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -48,7 +48,7 @@ export function isOnTokenURISupported(availableSelectors: string[]) {
* Encodes the parameters for the "onTokenURI" function.
* @param options - The options for the onTokenURI function.
* @returns The encoded ABI parameters.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -65,7 +65,7 @@ export function encodeOnTokenURIParams(options: OnTokenURIParams) {
* Encodes the "onTokenURI" function into a Hex string with its parameters.
* @param options - The options for the onTokenURI function.
* @returns The encoded hexadecimal string.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -87,7 +87,7 @@ export function encodeOnTokenURI(options: OnTokenURIParams) {
* Decodes the result of the onTokenURI function call.
* @param result - The hexadecimal result to decode.
* @returns The decoded result as per the FN_OUTPUTS definition.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -102,7 +102,7 @@ export function decodeOnTokenURIResult(result: Hex) {
* Calls the "onTokenURI" function on the contract.
* @param options - The options for the onTokenURI function.
* @returns The parsed result of the function call.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -55,7 +55,7 @@ const FN_OUTPUTS = [] as const;
* Checks if the `setSharedMetadata` method is supported by the given contract.
* @param availableSelectors An array of 4byte function selectors of the contract. You can get this in various ways, such as using "whatsabi" or if you have the ABI of the contract available you can use it to generate the selectors.
* @returns A boolean indicating if the `setSharedMetadata` method is supported.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -74,7 +74,7 @@ export function isSetSharedMetadataSupported(availableSelectors: string[]) {
* Encodes the parameters for the "setSharedMetadata" function.
* @param options - The options for the setSharedMetadata function.
* @returns The encoded ABI parameters.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -93,7 +93,7 @@ export function encodeSetSharedMetadataParams(
* Encodes the "setSharedMetadata" function into a Hex string with its parameters.
* @param options - The options for the setSharedMetadata function.
* @returns The encoded hexadecimal string.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { OpenEditionMetadataERC721 } from "thirdweb/modules";
@@ -115,7 +115,7 @@ export function encodeSetSharedMetadata(options: SetSharedMetadataParams) {
* Prepares a transaction to call the "setSharedMetadata" function on the contract.
* @param options - The options for the "setSharedMetadata" function.
* @returns A prepared transaction object.
* @module OpenEditionMetadataERC721
* @modules OpenEditionMetadataERC721
* @example
* ```ts
* import { sendTransaction } from "thirdweb";
@@ -16,7 +16,7 @@ export type DefaultRoyaltyUpdatedEventFilters = Partial<{
* Creates an event object for the DefaultRoyaltyUpdated event.
* @param filters - Optional filters to apply to the event.
* @returns The prepared event object.
* @module RoyaltyERC1155
* @modules RoyaltyERC1155
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -21,7 +21,7 @@ export type TokenRoyaltyUpdatedEventFilters = Partial<{
* Creates an event object for the TokenRoyaltyUpdated event.
* @param filters - Optional filters to apply to the event.
* @returns The prepared event object.
* @module RoyaltyERC1155
* @modules RoyaltyERC1155
* @example
* ```ts
* import { getContractEvents } from "thirdweb";
@@ -3,7 +3,7 @@ import { prepareEvent } from "../../../../../event/prepare-event.js";
/**
* Creates an event object for the TransferValidatorUpdated event.
* @returns The prepared event object.
* @module RoyaltyERC1155
* @modules RoyaltyERC1155
* @example
* ```ts
* import { getContractEvents } from "thirdweb";

Some files were not shown because too many files have changed in this diff Show More