ERC1155Enumerable
Functionality available for contracts that implement the ERC1155Enumerable extension.
Metadata for each NFT is fetched from the NFT’s uri property.
If the metadata is hosted on IPFS, the metadata is fetched and made available as an object.
The object’s image property will be a URL that is available through the thirdweb IPFS gateway.
get_all
Get the metadata and current owner of all NFTs in the contract.
By default, returns the first 100 NFTs (in order of token ID). Use queryParams to paginate the results.
metadatas = contract.erc1155.get_all()
print(metadatas)
Configuration
query_params (optional)
Provide an optional QueryAllParams object to configure the query. Useful for paginating the results.
class QueryAllParams:
start: int = 0
count: int = 100
from thirdweb.types.nft import QueryAllParams
query_params = QueryAllParams(
# The number of NFTs to return
count= 100, # Default is 100
# The index to start from
start= 0, # Default is 0
)
nfts = contract.erc1155.get_all(query_params)
Return Value
Returns a list of EditionMetadata objects:
class EditionMetadata:
metadata: NFTMetadata
supply: int
class NFTMetadata:
id: int
uri: str
name: str
description: Optional[str] = None
image: Optional[str] = None
external_url: Optional[str] = None
animation_url: Optional[str] = None
background_color: Optional[str] = None
properties: Optional[Dict[Any, Any]] = None
attributes: Optional[Dict[str, Any]] = None
get_owned
Get all the data associated with the NFTs owned by a specific wallet.
# Address of the wallet to get the NFTs of
address = "{{wallet_address}}"
nfts = contract.erc1155.get_owned(address)