Erc1155
Standard ERC1155 NFT functions
Basic functionality for a ERC1155 contract that handles IPFS storage for you.
const contract = await sdk.getContract("{{contract_address}}");await contract.erc1155.transfer(walletAddress, tokenId, quantity);
class Erc1155< T extends DropERC1155 | TokenERC1155 | BaseERC1155 = | BaseERC1155 | BaseSignatureMintERC1155, > implements UpdateableNetwork, DetectableFeature {}
function constructor( contractWrapper: ContractWrapper<T>, chainId: number,
Get NFT balance for the currently connected wallet
function balance(tokenId: BigNumberish): Promise<BigNumber>;
Get NFT balance of a specific wallet
Get a wallets NFT balance (number of NFTs in this contract owned by the wallet).
// Address of the wallet to check NFT balanceconst walletAddress = "{{wallet_address}}";const tokenId = 0; // Id of the NFT to checkconst balance = await contract.erc1155.balanceOf( walletAddress, tokenId,);
function balanceOf( address: string, tokenId: BigNumberish,): Promise<BigNumber>;
Get a single NFT
const tokenId = 0;const nft = await contract.erc1155.get(tokenId);
let returnType: | { id: bigint; owner: string | null; tokenURI: string; type: "ERC721"; } | { id: bigint; owner: string | null; supply: bigint; tokenURI: string; type: "ERC1155"; };
The NFT metadata
Get all NFTs
Get all the data associated with every NFT in this contract.
By default, returns the first 100 NFTs, use queryParams to fetch more.
const nfts = await contract.erc1155.getAll();
function getAll(queryParams?: { count?: number; start?: number;
let returnType: | { id: bigint; owner: string | null; tokenURI: string; type: "ERC721"; } | { id: bigint; owner: string | null; supply: bigint; tokenURI: string; type: "ERC1155"; };
The NFT metadata for all NFTs queried.
Use contract.erc1155.claim.prepare(...args)
instead
Construct a claim transaction without executing it. This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
function getClaimTransaction( destinationAddress: string, tokenId: BigNumberish, quantity: BigNumberish,): Promise<>;
let returnType: Promise<>;
Use contract.erc1155.mint.prepare(...args)
instead
Construct a mint transaction without executing it. This is useful for estimating the gas cost of a mint transaction, overriding transaction options and having fine grained control over the transaction execution.
function getMintTransaction(receiver: string, metadataWithSupply: { metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<..., ...>, Array<...>, Array<...>>, ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<..., ...>, Array<...>, Array<...>>, ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }) : Promise<Transaction<Omit<TransactionResultWithMetadata<unknown>, "data">>>
The metadata of the NFT you want to mint
let metadataWithSupply: { metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; name: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodNumber]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<..., ...>, Array<...>, Array<...>>, ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[ZodString, ZodEffects<ZodString, string, string>, ZodString]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[ZodUnion<[..., ...]>, ZodString]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[ZodEffects<ZodArray<..., ...>, Array<...>, Array<...>>, ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">, ZodObject<{ }, "strip", ZodUnion<...>, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<BigNumber, ZodTypeDef, BigNumber>, ZodType<BN, ZodTypeDef, BN>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }
let returnType: Promise<>;
Get all NFTs owned by a specific wallet
Get all the data associated with the NFTs owned by a specific wallet.
// Address of the wallet to get the NFTs ofconst address = "{{wallet_address}}";const nfts = await contract.erc1155.getOwned(address);
function getOwned( walletAddress?: string, queryParams?: { count?: number; start?: number },
let returnType: | { id: bigint; owner: string | null; tokenURI: string; type: "ERC721"; } | { id: bigint; owner: string | null; supply: bigint; tokenURI: string; type: "ERC1155"; };
The NFT metadata for all NFTs in the contract.
Get whether this wallet has approved transfers from the given operator
function isApproved( address: string, operator: string,): Promise<boolean>;
Get the total supply of a specific NFT
This is not the sum of supply of all NFTs in the contract.
function totalCirculatingSupply( tokenId: BigNumberish,): Promise<BigNumber>;
Get the total number of NFTs minted
This returns the total number of NFTs minted in this contract, not the total supply of a given token.
const count = await contract.erc1155.totalCount();console.log(count);
function totalCount(): Promise<BigNumber>;
Get the total supply of a specific token
const tokenId = 0;const nft = await contract.erc1155.totalSupply(tokenId);
function totalSupply(tokenId: BigNumberish): Promise<BigNumber>;
function airdrop( tokenId: BigNumberish, addresses: | Array<string> | Array<{ address: string; quantity?: string | number }>, fromAddress: string, data: BytesLike,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling airdrop.prepare()
with same arguments.Learn more
function burn( tokenId: BigNumberish, amount: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling burn.prepare()
with same arguments.Learn more
function burnBatch( tokenIds: Array<BigNumberish>, amounts: Array<BigNumberish>,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling burnBatch.prepare()
with same arguments.Learn more
function burnBatchFrom( account: string, tokenIds: Array<BigNumberish>, amounts: Array<BigNumberish>,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling burnBatchFrom.prepare()
with same arguments.Learn more
function burnFrom( account: string, tokenId: BigNumberish, amount: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling burnFrom.prepare()
with same arguments.Learn more
function claim( tokenId: BigNumberish, quantity: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling claim.prepare()
with same arguments.Learn more
function claimTo( destinationAddress: string, tokenId: BigNumberish, quantity: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling claimTo.prepare()
with same arguments.Learn more
function lazyMint(metadatas: Array<string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)>, options: { onProgress: (event: UploadProgressEvent) => void }) : Promise<TResult>
let metadatas: Array<string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">)>
Preparable
You can also prepare the transaction without executing it by calling lazyMint.prepare()
with same arguments.Learn more
function mint(metadataWithSupply: { metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }) : Promise<TResult>
let metadataWithSupply: { metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }
Preparable
You can also prepare the transaction without executing it by calling mint.prepare()
with same arguments.Learn more
function mintAdditionalSupply( tokenId: BigNumberish, additionalSupply: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling mintAdditionalSupply.prepare()
with same arguments.Learn more
function mintAdditionalSupplyTo( receiver: string, tokenId: BigNumberish, additionalSupply: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling mintAdditionalSupplyTo.prepare()
with same arguments.Learn more
function mintBatch(metadataWithSupply: Array<{ metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<...>>>; description: ZodNullable<ZodOptional<ZodNullable<...>>>; image: ZodOptional<ZodNullable<ZodUnion<...>>>; name: ZodNullable<ZodOptional<ZodUnion<...>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<...>>>; background_color: ZodNullable<ZodOptional<ZodUnion<...>>>; external_url: ZodOptional<ZodNullable<ZodUnion<...>>>; properties: ZodNullable<ZodOptional<ZodUnion<...>>> }>, ZodUnion<[ZodEffects<ZodUnion<[..., ..., ...]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }>) : Promise<TResult>
let metadataWithSupply: Array<{ metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<...>>>; description: ZodNullable<ZodOptional<ZodNullable<...>>>; image: ZodOptional<ZodNullable<ZodUnion<...>>>; name: ZodNullable<ZodOptional<ZodUnion<...>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<...>>>; background_color: ZodNullable<ZodOptional<ZodUnion<...>>>; external_url: ZodOptional<ZodNullable<ZodUnion<...>>>; properties: ZodNullable<ZodOptional<ZodUnion<...>>> }>, ZodUnion<[ZodEffects<ZodUnion<[..., ..., ...]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }>
Preparable
You can also prepare the transaction without executing it by calling mintBatch.prepare()
with same arguments.Learn more
function mintBatchTo(receiver: string, metadataWithSupply: Array<{ metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<...>>>; description: ZodNullable<ZodOptional<ZodNullable<...>>>; image: ZodOptional<ZodNullable<ZodUnion<...>>>; name: ZodNullable<ZodOptional<ZodUnion<...>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<...>>>; background_color: ZodNullable<ZodOptional<ZodUnion<...>>>; external_url: ZodOptional<ZodNullable<ZodUnion<...>>>; properties: ZodNullable<ZodOptional<ZodUnion<...>>> }>, ZodUnion<[ZodEffects<ZodUnion<[..., ..., ...]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }>) : Promise<TResult>
let metadataWithSupply: Array<{ metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<...>>>; description: ZodNullable<ZodOptional<ZodNullable<...>>>; image: ZodOptional<ZodNullable<ZodUnion<...>>>; name: ZodNullable<ZodOptional<ZodUnion<...>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<...>>>; background_color: ZodNullable<ZodOptional<ZodUnion<...>>>; external_url: ZodOptional<ZodNullable<ZodUnion<...>>>; properties: ZodNullable<ZodOptional<ZodUnion<...>>> }>, ZodUnion<[ZodEffects<ZodUnion<[..., ..., ...]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }>
Preparable
You can also prepare the transaction without executing it by calling mintBatchTo.prepare()
with same arguments.Learn more
function mintTo(receiver: string, metadataWithSupply: { metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }) : Promise<TResult>
let metadataWithSupply: { metadata: string | (objectInputType<extendShape<{ animation_url: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>>; description: ZodNullable<ZodOptional<ZodNullable<ZodString>>>; image: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; name: ZodNullable<ZodOptional<ZodUnion<[..., ...]>>> }, { attributes: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; background_color: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>>; external_url: ZodOptional<ZodNullable<ZodUnion<[..., ...]>>>; properties: ZodNullable<ZodOptional<ZodUnion<[..., ..., ...]>>> }>, ZodUnion<[ZodEffects<ZodUnion<[ZodBigInt, ZodType<..., ..., ...>, ZodType<..., ..., ...>]>, string, bigint | (BN) | (BigNumber)>, ZodUnknown]>, "strip">); supply: string | number | bigint | (BigNumber) }
Preparable
You can also prepare the transaction without executing it by calling mintTo.prepare()
with same arguments.Learn more
function setApprovalForAll( operator: string, approved: boolean,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling setApprovalForAll.prepare()
with same arguments.Learn more
function transfer( to: string, tokenId: BigNumberish, amount: BigNumberish, data: BytesLike,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling transfer.prepare()
with same arguments.Learn more
function transferBatch( to: string, tokenIds: Array<BigNumberish>, amounts: Array<BigNumberish>, fromAddress: string, data: BytesLike,): Promise<TResult>;