Skip to main content

class Pack

class Pack
: public Thirdweb.Routable

Interact with a Pack contract.

Summary

MembersTypeDescriptions
chainvariable
addressvariable
PackfunctionInteract with a Marketplace contract.
GetfunctionREAD FUNCTIONS.
GetAllfunctionGet a all NFTs in this contract
GetOwnedfunctionGet a all NFTs owned by the connected wallet
BalancefunctionGet the balance of the given NFT for the connected wallet
BalanceOffunctionGet the balance of the given NFT for the given wallet address
IsApprovedForAllfunctionCheck whether the given contract address has been approved to transfer NFTs on behalf of the given wallet address
TotalCountfunction
TotalSupplyfunctionGet the total suppply in circulation for thge given NFT
GetPackContentsfunctionGet all the possible contents of a given pack
SetApprovalForAllfunctionWRITE FUNCTIONS.
TransferfunctionTransfer NFTs to the given address
CreatefunctionCreate a new Pack with all the possible rewards (requires approval to transfer tokens/NFTs defined as rewards)
CreateTofunctionCreate a new Pack with all the possible rewards and mints it to the given address (requires approval to transfer tokens/NFTs defined as rewards)
AddPackContentsfunctionAdd new contents to an existing pack
OpenfunctionOpen a pack and transfer the rewards to the connected wallet

Members

public string chain


public string address


public inline Pack(string chain,string address)

Interact with a Marketplace contract.


public inline async Task< NFT>Get(string tokenId)

READ FUNCTIONS.

Get a NFT in this contract by its ID


public inline async Task< List< NFT> >GetAll(QueryAllParams queryParams)

Get a all NFTs in this contract


public inline async Task< List< NFT> >GetOwned(string address)

Get a all NFTs owned by the connected wallet

Parameters

  • address Optional wallet address to query NFTs of

public inline async Task< string > Balance(string tokenId)

Get the balance of the given NFT for the connected wallet


public inline async Task< string > BalanceOf(string address,string tokenId)

Get the balance of the given NFT for the given wallet address


public inline async Task< string > IsApprovedForAll(string address,string approvedContract)

Check whether the given contract address has been approved to transfer NFTs on behalf of the given wallet address

Parameters

  • address The wallet address

  • contractAddress The contract address to check approval for


public inline async Task< int > TotalCount()


public inline async Task< int > TotalSupply(string tokenId)

Get the total suppply in circulation for thge given NFT


public inline async Task< PackContents>GetPackContents(string packId)

Get all the possible contents of a given pack


public inline async Task< TransactionResult>SetApprovalForAll(string contractToApprove,bool approved)

WRITE FUNCTIONS.

Set approval to the given contract to transfer NFTs on behalf of the connected wallet


public inline async Task< TransactionResult>Transfer(string to,string tokenId,int amount)

Transfer NFTs to the given address


public inline async Task< TransactionResult>Create(NewPackInput pack)

Create a new Pack with all the possible rewards (requires approval to transfer tokens/NFTs defined as rewards)


public inline async Task< TransactionResult>CreateTo(string receiverAddress,NewPackInput pack)

Create a new Pack with all the possible rewards and mints it to the given address (requires approval to transfer tokens/NFTs defined as rewards)


public inline async Task< TransactionResult>AddPackContents(string packId,PackRewards newContents)

Add new contents to an existing pack


public inline async Task< PackRewards>Open(string packId,string amount)

Open a pack and transfer the rewards to the connected wallet