Contract Deployer
deploy_nft_collection
Deploy an nft collection prebuilt contract.
from thirdweb.types.nft import NFTCollectionContractMetadata
metadata = NFTCollectionContractMetadata.from_json(
"name" : "my_nft_collection",
#...
)
contract.deploy_nft_collection(metadata)
Configuration
metadata
The contract metadata. Must be an NFTCollectionContractMetadata
object:
class NFTCollectionContractMetadata(
ContractMetadataSchema,
ContractRoyaltySchema,
ContractSymbolSchema,
ContractPlatformFeeSchema,
ContractPrimarySaleSchema,
ContractTrustedForwarderSchema
):
class ContractMetadataSchema:
name: str = ""
description: Optional[str] = None
image: Optional[Union[str, TextIO, BinaryIO]] = None
external_link: Optional[str] = None
class ContractRoyaltySchema:
seller_fee_basis_points: int = 0
fee_recipient: str = ZERO_ADDRESS
class ContractPrimarySaleSchema:
primary_sale_recipient: str = ZERO_ADDRESS
class ContractPlatformFeeSchema:
platform_fee_basis_points: int = 0
platform_fee_recipient: str = ZERO_ADDRESS
class ContractSymbolSchema:
symbol: str = ""
class ContractTrustedForwarderSchema:
trusted_forwarders: List[str] = dataclasses.field(default_factory=list)
deploy_edition
Deploy an Edition contract
metadata = EditionContractMetadata.from_json(
"name" : "my contract"
# ...
)
sdk.deploy_edition(metadata)
Configuration
metadata
The contract metadata. Must be an EditionContractMetadata
object:
class EditionContractMetadata(
ContractMetadataSchema,
ContractRoyaltySchema,
ContractSymbolSchema,
ContractPlatformFeeSchema,
ContractPrimarySaleSchema,
ContractTrustedForwarderSchema
):
class ContractMetadataSchema:
name: str = ""
description: Optional[str] = None
image: Optional[Union[str, TextIO, BinaryIO]] = None
external_link: Optional[str] = None
class ContractRoyaltySchema:
seller_fee_basis_points: int = 0
fee_recipient: str = ZERO_ADDRESS
class ContractPrimarySaleSchema:
primary_sale_recipient: str = ZERO_ADDRESS
class ContractPlatformFeeSchema:
platform_fee_basis_points: int = 0
platform_fee_recipient: str = ZERO_ADDRESS
class ContractSymbolSchema:
symbol: str = ""
class ContractTrustedForwarderSchema:
trusted_forwarders: List[str] = dataclasses.field(default_factory=list)
deploy_token
Deploy a Token contract
metadata = TokenContractMetadata.from_json(
"name" : "my contract"
# ...
)
sdk.deploy_token(metadata)
Configuration
metadata
The contract metadata. Must be a TokenContractMetadata
object:
class TokenContractMetadata(
ContractMetadataSchema,
ContractSymbolSchema,
ContractPrimarySaleSchema,
ContractTrustedForwarderSchema,
ContractPlatformFeeSchema,
):
class ContractMetadataSchema:
name: str = ""
description: Optional[str] = None
image: Optional[Union[str, TextIO, BinaryIO]] = None
external_link: Optional[str] = None
class ContractPrimarySaleSchema:
primary_sale_recipient: str = ZERO_ADDRESS
class ContractPlatformFeeSchema:
platform_fee_basis_points: int = 0
platform_fee_recipient: str = ZERO_ADDRESS
class ContractSymbolSchema:
symbol: str = ""
class ContractTrustedForwarderSchema:
trusted_forwarders: List[str] = dataclasses.field(default_factory=list)
deploy_marketplace
Deploy a Marketplace contract
metadata = MarketplaceContractMetadata.from_json(
"name" : "my contract"
# ...
)
sdk.deploy_marketplace(metadata)
Configuration
metadata
The contract metadata. Must be a MarketplaceContractMetadata
object:
class MarketplaceContractMetadata(
ContractMetadataSchema,
ContractPlatformFeeSchema,
ContractTrustedForwarderSchema
):
class ContractMetadataSchema:
name: str = ""
description: Optional[str] = None
image: Optional[Union[str, TextIO, BinaryIO]] = None
external_link: Optional[str] = None
class ContractPlatformFeeSchema:
platform_fee_basis_points: int = 0
platform_fee_recipient: str = ZERO_ADDRESS
class ContractTrustedForwarderSchema:
trusted_forwarders: List[str] = dataclasses.field(default_factory=list)
deploy_nft_drop
Deploy an NFT Drop contract
metadata = NFTDropContractMetadata.from_json(
"name" : "my contract"
# ...
)
sdk.deploy_nft_drop(metadata)
Configuration
metadata
The contract metadata. Must be an NFTDropContractMetadata
object:
class NFTDropContractMetadata(
ContractMetadataSchema,
ContractRoyaltySchema,
ContractSymbolSchema,
ContractPlatformFeeSchema,
ContractPrimarySaleSchema,
ContractTrustedForwarderSchema,
MerkleSchema,
):
class ContractMetadataSchema:
name: str = ""
description: Optional[str] = None
image: Optional[Union[str, TextIO, BinaryIO]] = None
external_link: Optional[str] = None
class ContractRoyaltySchema:
seller_fee_basis_points: int = 0
fee_recipient: str = ZERO_ADDRESS
class ContractPrimarySaleSchema:
primary_sale_recipient: str = ZERO_ADDRESS
class ContractPlatformFeeSchema:
platform_fee_basis_points: int = 0
platform_fee_recipient: str = ZERO_ADDRESS
class ContractSymbolSchema:
symbol: str = ""
class ContractTrustedForwarderSchema:
trusted_forwarders: List[str] = dataclasses.field(default_factory=list)
class MerkleSchema:
merkle: Dict[str, str] = dataclasses.field(default_factory=lambda: {})
deploy_edition_drop
Deploy an Edition Drop contract
metadata = EditionDropContractMetadata.from_json(
"name" : "my contract"
# ...
)
sdk.deploy_edition_drop(metadata)
Configuration
metadata
The contract metadata. Must be an EditionDropContractMetadata
object:
class EditionDropContractMetadata(
ContractMetadataSchema,
ContractRoyaltySchema,
ContractSymbolSchema,
ContractPlatformFeeSchema,
ContractPrimarySaleSchema,
ContractTrustedForwarderSchema,
MerkleSchema,
):
class ContractMetadataSchema:
name: str = ""
description: Optional[str] = None
image: Optional[Union[str, TextIO, BinaryIO]] = None
external_link: Optional[str] = None
class ContractRoyaltySchema:
seller_fee_basis_points: int = 0
fee_recipient: str = ZERO_ADDRESS
class ContractPrimarySaleSchema:
primary_sale_recipient: str = ZERO_ADDRESS
class ContractPlatformFeeSchema:
platform_fee_basis_points: int = 0
platform_fee_recipient: str = ZERO_ADDRESS
class ContractSymbolSchema:
symbol: str = ""
class ContractTrustedForwarderSchema:
trusted_forwarders: List[str] = dataclasses.field(default_factory=list)
class MerkleSchema:
merkle: Dict[str, str] = dataclasses.field(default_factory=lambda: {})
deploy_multiwrap
Deploy a Multiwrap contract
metadata = MultiwrapContractMetadata.from_json(
"name" : "my contract"
# ...
)
sdk.deploy_multiwrap(metadata)
Configuration
metadata
The contract metadata. Must be a MultiwrapContractMetadata
object:
class MultiwrapContractMetadata(
ContractMetadataSchema,
ContractRoyaltySchema,
ContractSymbolSchema,
ContractTrustedForwarderSchema
):
class ContractMetadataSchema:
name: str = ""
description: Optional[str] = None
image: Optional[Union[str, TextIO, BinaryIO]] = None
external_link: Optional[str] = None
class ContractRoyaltySchema:
seller_fee_basis_points: int = 0
fee_recipient: str = ZERO_ADDRESS
class ContractSymbolSchema:
symbol: str = ""
class ContractTrustedForwarderSchema:
trusted_forwarders: List[str] = dataclasses.field(default_factory=list)