Class ThirdwebExtensions
- Namespace
- Thirdweb
- Assembly
- Thirdweb.dll
public static class ThirdwebExtensions
- Inheritance
-
ThirdwebExtensions
- Inherited Members
Methods
Authenticate<T>(IThirdwebWallet, string, BigInteger, string, string, string, string, bool, IThirdwebHttpClient)
Authenticates the wallet.
public static Task<T> Authenticate<T>(this IThirdwebWallet wallet, string domain, BigInteger chainId, string authPayloadPath = "/auth/payload", string authLoginPath = "/auth/login", string authPayloadMethod = "GET", string authLoginMethod = "POST", bool separatePayloadAndSignatureInBody = false, IThirdwebHttpClient httpClientOverride = null)
Parameters
wallet
IThirdwebWalletThe wallet that will sign the SIWE payload.
domain
stringThe authentication domain.
chainId
BigIntegerThe chain ID.
authPayloadPath
stringThe authentication payload path.
authLoginPath
stringThe authentication login path.
authPayloadMethod
stringThe authentication payload method.
authLoginMethod
stringThe authentication login method.
separatePayloadAndSignatureInBody
boolWhether to separate the payload and signature in the body.
httpClientOverride
IThirdwebHttpClientThe HTTP client override.
Returns
- Task<T>
The authentication result.
Type Parameters
T
CreateCallData(ThirdwebContract, string, params object[])
Encodes the function call for the specified method and parameters.
public static string CreateCallData(this ThirdwebContract contract, string method, params object[] parameters)
Parameters
contract
ThirdwebContractThe contract instance.
method
stringThe method to call.
parameters
object[]The parameters for the method.
Returns
- string
The generated calldata.
DropERC1155_Claim(ThirdwebContract, IThirdwebWallet, string, BigInteger, BigInteger)
Claim a specific quantity of ERC1155 tokens for a receiver.
public static Task<ThirdwebTransactionReceipt> DropERC1155_Claim(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, BigInteger tokenId, BigInteger quantity)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
receiverAddress
stringThe address of the receiver.
tokenId
BigIntegerThe ID of the token.
quantity
BigIntegerThe quantity of tokens to claim.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the receiver address is null or empty.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0 or the quantity is less than or equal to 0.
DropERC1155_GetActiveClaimCondition(ThirdwebContract, BigInteger)
Get the details of the active claim condition for a specific ERC1155 token.
public static Task<Drop_ClaimCondition> DropERC1155_GetActiveClaimCondition(this ThirdwebContract contract, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<Drop_ClaimCondition>
A task representing the asynchronous operation, with a Drop_ClaimCondition result containing the active claim condition details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
DropERC1155_GetActiveClaimConditionId(ThirdwebContract, BigInteger)
Get the active claim condition ID for a specific ERC1155 token.
public static Task<BigInteger> DropERC1155_GetActiveClaimConditionId(this ThirdwebContract contract, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the active claim condition ID.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
DropERC1155_GetClaimConditionById(ThirdwebContract, BigInteger, BigInteger)
Get the claim condition details for a specific claim condition ID of a specific ERC1155 token.
public static Task<Drop_ClaimCondition> DropERC1155_GetClaimConditionById(this ThirdwebContract contract, BigInteger tokenId, BigInteger claimConditionId)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
claimConditionId
BigIntegerThe ID of the claim condition.
Returns
- Task<Drop_ClaimCondition>
A task representing the asynchronous operation, with a Drop_ClaimCondition result containing the claim condition details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the token ID or claim condition ID is less than 0.
DropERC20_Claim(ThirdwebContract, IThirdwebWallet, string, string)
Claim a specific amount of ERC20 tokens for a receiver.
public static Task<ThirdwebTransactionReceipt> DropERC20_Claim(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, string amount)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
receiverAddress
stringThe address of the receiver.
amount
stringThe amount of tokens to claim.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the receiver address or amount is null or empty.
DropERC20_GetActiveClaimCondition(ThirdwebContract)
Get the details of the active claim condition for the ERC20 drop.
public static Task<Drop_ClaimCondition> DropERC20_GetActiveClaimCondition(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<Drop_ClaimCondition>
A task representing the asynchronous operation, with a Drop_ClaimCondition result containing the active claim condition details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
DropERC20_GetActiveClaimConditionId(ThirdwebContract)
Get the active claim condition ID for the ERC20 drop.
public static Task<BigInteger> DropERC20_GetActiveClaimConditionId(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the active claim condition ID.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
DropERC20_GetClaimConditionById(ThirdwebContract, BigInteger)
Get the claim condition details for a specific claim condition ID.
public static Task<Drop_ClaimCondition> DropERC20_GetClaimConditionById(this ThirdwebContract contract, BigInteger claimConditionId)
Parameters
contract
ThirdwebContractThe contract to interact with.
claimConditionId
BigIntegerThe ID of the claim condition.
Returns
- Task<Drop_ClaimCondition>
A task representing the asynchronous operation, with a Drop_ClaimCondition result containing the claim condition details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the claim condition ID is less than 0.
DropERC721_Claim(ThirdwebContract, IThirdwebWallet, string, BigInteger)
Claim a specific quantity of ERC721 tokens for a receiver.
public static Task<ThirdwebTransactionReceipt> DropERC721_Claim(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, BigInteger quantity)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
receiverAddress
stringThe address of the receiver.
quantity
BigIntegerThe quantity of tokens to claim.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the receiver address is null or empty.
- ArgumentOutOfRangeException
Thrown when the quantity is less than or equal to 0.
DropERC721_GetActiveClaimCondition(ThirdwebContract)
Get the details of the active claim condition for the ERC721 drop.
public static Task<Drop_ClaimCondition> DropERC721_GetActiveClaimCondition(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<Drop_ClaimCondition>
A task representing the asynchronous operation, with a Drop_ClaimCondition result containing the active claim condition details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
DropERC721_GetActiveClaimConditionId(ThirdwebContract)
Get the active claim condition ID for the ERC721 drop.
public static Task<BigInteger> DropERC721_GetActiveClaimConditionId(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the active claim condition ID.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
DropERC721_GetClaimConditionById(ThirdwebContract, BigInteger)
Get the claim condition details for a specific claim condition ID.
public static Task<Drop_ClaimCondition> DropERC721_GetClaimConditionById(this ThirdwebContract contract, BigInteger claimConditionId)
Parameters
contract
ThirdwebContractThe contract to interact with.
claimConditionId
BigIntegerThe ID of the claim condition.
Returns
- Task<Drop_ClaimCondition>
A task representing the asynchronous operation, with a Drop_ClaimCondition result containing the claim condition details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the claim condition ID is less than 0.
ERC1155_BalanceOf(ThirdwebContract, string, BigInteger)
Check the balance of a specific token for a specific address.
public static Task<BigInteger> ERC1155_BalanceOf(this ThirdwebContract contract, string ownerAddress, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
ownerAddress
stringThe address of the owner whose balance is to be checked.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the balance.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address is null or empty.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
ERC1155_BalanceOfBatch(ThirdwebContract, string[], BigInteger[])
Check the balance of multiple tokens for multiple addresses.
public static Task<List<BigInteger>> ERC1155_BalanceOfBatch(this ThirdwebContract contract, string[] ownerAddresses, BigInteger[] tokenIds)
Parameters
contract
ThirdwebContractThe contract to interact with.
ownerAddresses
string[]The array of owner addresses.
tokenIds
BigInteger[]The array of token IDs.
Returns
- Task<List<BigInteger>>
A task representing the asynchronous operation, with a list of BigInteger results containing the balances.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner addresses or token IDs are null.
ERC1155_GetAllNFTs(ThirdwebContract, int, int, bool)
Get a list of all ERC1155 tokens within a specified range.
public static Task<List<NFT>> ERC1155_GetAllNFTs(this ThirdwebContract contract, int startTokenId = 0, int count = 100, bool fillSupply = true)
Parameters
contract
ThirdwebContractThe contract to interact with.
startTokenId
intThe starting token ID (inclusive). Defaults to 0 if not specified.
count
intThe number of tokens to retrieve. Defaults to the 100 if not specified.
fillSupply
boolA boolean indicating whether to fill the supply. Defaults to true if not specified.
Returns
- Task<List<NFT>>
A task representing the asynchronous operation, with a list of NFT results containing the token details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC1155_GetNFT(ThirdwebContract, BigInteger, bool)
Get the details of a specific ERC1155 token.
public static Task<NFT> ERC1155_GetNFT(this ThirdwebContract contract, BigInteger tokenId, bool fillSupply = true)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
fillSupply
boolA boolean indicating whether to fill the supply. Defaults to true if not specified.
Returns
- Task<NFT>
A task representing the asynchronous operation, with an NFT result containing the token details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC1155_GetOwnedNFTs(ThirdwebContract, string, int, int)
Get a list of ERC1155 tokens owned by a specific address.
public static Task<List<NFT>> ERC1155_GetOwnedNFTs(this ThirdwebContract contract, string owner, int startTokenId = 0, int count = 100)
Parameters
contract
ThirdwebContractThe contract to interact with.
owner
stringThe address of the owner.
startTokenId
intThe starting token ID (inclusive). Defaults to 0 if not specified.
count
intThe number of tokens to retrieve. Defaults to 100 if not specified.
Returns
- Task<List<NFT>>
A task representing the asynchronous operation, with a list of NFT results containing the token details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address is null or empty.
ERC1155_IsApprovedForAll(ThirdwebContract, string, string)
Check if an address is approved to transfer specific tokens.
public static Task<bool> ERC1155_IsApprovedForAll(this ThirdwebContract contract, string ownerAddress, string operatorAddress)
Parameters
contract
ThirdwebContractThe contract to interact with.
ownerAddress
stringThe address of the owner.
operatorAddress
stringThe address of the operator.
Returns
- Task<bool>
A task representing the asynchronous operation, with a boolean result indicating if the operator is approved for the owner.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address or operator address is null or empty.
ERC1155_SafeBatchTransferFrom(ThirdwebContract, IThirdwebWallet, string, string, BigInteger[], BigInteger[], byte[])
Transfer multiple tokens from one address to another.
public static Task<ThirdwebTransactionReceipt> ERC1155_SafeBatchTransferFrom(this ThirdwebContract contract, IThirdwebWallet wallet, string fromAddress, string toAddress, BigInteger[] tokenIds, BigInteger[] amounts, byte[] data = null)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
fromAddress
stringThe address of the sender.
toAddress
stringThe address of the recipient.
tokenIds
BigInteger[]The array of token IDs to transfer.
amounts
BigInteger[]The array of amounts for each token ID.
data
byte[]Additional data with no specified format.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the sender address, recipient address, token IDs, or amounts are null or empty.
ERC1155_SafeTransferFrom(ThirdwebContract, IThirdwebWallet, string, string, BigInteger, BigInteger, byte[])
Transfer specific tokens from one address to another.
public static Task<ThirdwebTransactionReceipt> ERC1155_SafeTransferFrom(this ThirdwebContract contract, IThirdwebWallet wallet, string fromAddress, string toAddress, BigInteger tokenId, BigInteger amount, byte[] data = null)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
fromAddress
stringThe address of the sender.
toAddress
stringThe address of the recipient.
tokenId
BigIntegerThe ID of the token.
amount
BigIntegerThe amount of tokens to transfer.
data
byte[]Additional data with no specified format.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the sender address or recipient address is null or empty.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
ERC1155_SetApprovalForAll(ThirdwebContract, IThirdwebWallet, string, bool)
Approve a specific address to transfer specific tokens.
public static Task<ThirdwebTransactionReceipt> ERC1155_SetApprovalForAll(this ThirdwebContract contract, IThirdwebWallet wallet, string operatorAddress, bool approved)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
operatorAddress
stringThe address of the operator.
approved
boolA boolean indicating whether to approve or revoke approval.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the operator address is null or empty.
ERC1155_TotalSupply(ThirdwebContract)
Get the total supply of tokens.
public static Task<BigInteger> ERC1155_TotalSupply(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the total supply.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC1155_TotalSupply(ThirdwebContract, BigInteger)
Get the total supply of a specific token.
public static Task<BigInteger> ERC1155_TotalSupply(this ThirdwebContract contract, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the total supply.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
ERC1155_URI(ThirdwebContract, BigInteger)
Get the URI for a specific token.
public static Task<string> ERC1155_URI(this ThirdwebContract contract, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<string>
A task representing the asynchronous operation, with a string result containing the URI.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
ERC20_Allowance(ThirdwebContract, string, string)
Get the allowance of a spender for a specific owner.
public static Task<BigInteger> ERC20_Allowance(this ThirdwebContract contract, string ownerAddress, string spenderAddress)
Parameters
contract
ThirdwebContractThe contract to interact with.
ownerAddress
stringThe address of the owner.
spenderAddress
stringThe address of the spender.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the allowance.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address or spender address is null or empty.
ERC20_Approve(ThirdwebContract, IThirdwebWallet, string, BigInteger)
Approve a spender to spend a specific amount of tokens.
public static Task<ThirdwebTransactionReceipt> ERC20_Approve(this ThirdwebContract contract, IThirdwebWallet wallet, string spenderAddress, BigInteger amount)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
spenderAddress
stringThe address of the spender.
amount
BigIntegerThe amount of tokens to approve.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the spender address is null or empty.
ERC20_BalanceOf(ThirdwebContract, string)
Check the balance of a specific address.
public static Task<BigInteger> ERC20_BalanceOf(this ThirdwebContract contract, string ownerAddress)
Parameters
contract
ThirdwebContractThe contract to interact with.
ownerAddress
stringThe address of the owner whose balance is to be checked.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the balance.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address is null or empty.
ERC20_Decimals(ThirdwebContract)
Get the number of decimals used by the token.
public static Task<int> ERC20_Decimals(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<int>
A task representing the asynchronous operation, with an int result containing the number of decimals.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC20_Name(ThirdwebContract)
Get the name of the token.
public static Task<string> ERC20_Name(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<string>
A task representing the asynchronous operation, with a string result containing the name.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC20_Symbol(ThirdwebContract)
Get the symbol of the token.
public static Task<string> ERC20_Symbol(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<string>
A task representing the asynchronous operation, with a string result containing the symbol.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC20_TotalSupply(ThirdwebContract)
Get the total supply of the token.
public static Task<BigInteger> ERC20_TotalSupply(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the total supply.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC20_Transfer(ThirdwebContract, IThirdwebWallet, string, BigInteger)
Transfer tokens to a specific address.
public static Task<ThirdwebTransactionReceipt> ERC20_Transfer(this ThirdwebContract contract, IThirdwebWallet wallet, string toAddress, BigInteger amount)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
toAddress
stringThe address of the recipient.
amount
BigIntegerThe amount of tokens to transfer.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the recipient address is null or empty.
ERC20_TransferFrom(ThirdwebContract, IThirdwebWallet, string, string, BigInteger)
Transfer tokens from one address to another.
public static Task<ThirdwebTransactionReceipt> ERC20_TransferFrom(this ThirdwebContract contract, IThirdwebWallet wallet, string fromAddress, string toAddress, BigInteger amount)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
fromAddress
stringThe address of the sender.
toAddress
stringThe address of the recipient.
amount
BigIntegerThe amount of tokens to transfer.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the sender address or recipient address is null or empty.
ERC721A_TokensOfOwner(ThirdwebContract, string)
public static Task<List<BigInteger>> ERC721A_TokensOfOwner(this ThirdwebContract contract, string ownerAddress)
Parameters
contract
ThirdwebContractownerAddress
string
Returns
ERC721A_TokensOfOwnerIn(ThirdwebContract, string, BigInteger, BigInteger)
public static Task<List<BigInteger>> ERC721A_TokensOfOwnerIn(this ThirdwebContract contract, string ownerAddress, BigInteger startIndex, BigInteger endIndex)
Parameters
contract
ThirdwebContractownerAddress
stringstartIndex
BigIntegerendIndex
BigInteger
Returns
ERC721_Approve(ThirdwebContract, IThirdwebWallet, string, BigInteger)
Approve a specific address to transfer a specific token.
public static Task<ThirdwebTransactionReceipt> ERC721_Approve(this ThirdwebContract contract, IThirdwebWallet wallet, string toAddress, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
toAddress
stringThe address of the recipient.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the recipient address is null or empty.
ERC721_BalanceOf(ThirdwebContract, string)
Check the balance of a specific address.
public static Task<BigInteger> ERC721_BalanceOf(this ThirdwebContract contract, string ownerAddress)
Parameters
contract
ThirdwebContractThe contract to interact with.
ownerAddress
stringThe address of the owner whose balance is to be checked.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the balance.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address is null or empty.
ERC721_GetAllNFTs(ThirdwebContract, int, int, bool)
Get a list of all ERC721 tokens within a specified range.
public static Task<List<NFT>> ERC721_GetAllNFTs(this ThirdwebContract contract, int startTokenId = 0, int count = 100, bool fillOwner = true)
Parameters
contract
ThirdwebContractThe contract to interact with.
startTokenId
intThe starting token ID (inclusive). Defaults to 0 if not specified.
count
intThe number of tokens to retrieve. Defaults to 100 if not specified.
fillOwner
boolA boolean indicating whether to fill the owner details. Defaults to true.
Returns
- Task<List<NFT>>
A task representing the asynchronous operation, with a list of NFT results containing the token details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC721_GetApproved(ThirdwebContract, BigInteger)
Get the approved address for a specific token.
public static Task<string> ERC721_GetApproved(this ThirdwebContract contract, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<string>
A task representing the asynchronous operation, with a string result containing the approved address.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
ERC721_GetNFT(ThirdwebContract, BigInteger, bool)
Get the details of a specific ERC721 token.
public static Task<NFT> ERC721_GetNFT(this ThirdwebContract contract, BigInteger tokenId, bool fillOwner = true)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
fillOwner
boolA boolean indicating whether to fill the owner details. Defaults to true.
Returns
- Task<NFT>
A task representing the asynchronous operation, with an NFT result containing the token details.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC721_GetOwnedNFTs(ThirdwebContract, string, int, int)
Get a list of ERC721 tokens owned by a specific address.
public static Task<List<NFT>> ERC721_GetOwnedNFTs(this ThirdwebContract contract, string owner, int startTokenId = 0, int count = 100)
Parameters
contract
ThirdwebContractThe contract to interact with.
owner
stringThe address of the owner.
startTokenId
intThe starting token ID (inclusive). Defaults to 0 if not specified.
count
intThe number of tokens to retrieve. Defaults to 100 if not specified.
Returns
- Task<List<NFT>>
A task representing the asynchronous operation, with a list of NFT results containing the token details.
Remarks
ERC721AQueryable and ERC721Enumerable are supported.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address is null or empty.
ERC721_IsApprovedForAll(ThirdwebContract, string, string)
Check if an address is an operator for another address.
public static Task<bool> ERC721_IsApprovedForAll(this ThirdwebContract contract, string ownerAddress, string operatorAddress)
Parameters
contract
ThirdwebContractThe contract to interact with.
ownerAddress
stringThe address of the owner.
operatorAddress
stringThe address of the operator.
Returns
- Task<bool>
A task representing the asynchronous operation, with a boolean result indicating if the operator is approved for the owner.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address or operator address is null or empty.
ERC721_Name(ThirdwebContract)
Get the name of the token.
public static Task<string> ERC721_Name(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<string>
A task representing the asynchronous operation, with a string result containing the name.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC721_OwnerOf(ThirdwebContract, BigInteger)
Get the owner of a specific token.
public static Task<string> ERC721_OwnerOf(this ThirdwebContract contract, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<string>
A task representing the asynchronous operation, with a string result containing the owner's address.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
ERC721_SafeTransferFrom(ThirdwebContract, IThirdwebWallet, string, string, BigInteger)
Safely transfer a specific token from one address to another.
public static Task<ThirdwebTransactionReceipt> ERC721_SafeTransferFrom(this ThirdwebContract contract, IThirdwebWallet wallet, string fromAddress, string toAddress, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
fromAddress
stringThe address of the sender.
toAddress
stringThe address of the recipient.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the sender address or recipient address is null or empty.
ERC721_SetApprovalForAll(ThirdwebContract, IThirdwebWallet, string, bool)
Set or unset an operator for an owner.
public static Task<ThirdwebTransactionReceipt> ERC721_SetApprovalForAll(this ThirdwebContract contract, IThirdwebWallet wallet, string operatorAddress, bool approved)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
operatorAddress
stringThe address of the operator.
approved
boolA boolean indicating whether to set or unset the operator.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the operator address is null or empty.
ERC721_Symbol(ThirdwebContract)
Get the symbol of the token.
public static Task<string> ERC721_Symbol(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<string>
A task representing the asynchronous operation, with a string result containing the symbol.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC721_TokenByIndex(ThirdwebContract, BigInteger)
Get the token ID of a specific token by index.
public static Task<BigInteger> ERC721_TokenByIndex(this ThirdwebContract contract, BigInteger index)
Parameters
contract
ThirdwebContractThe contract to interact with.
index
BigIntegerThe index of the token.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the token ID.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC721_TokenOfOwnerByIndex(ThirdwebContract, string, BigInteger)
Get the token ID of a specific owner by index.
public static Task<BigInteger> ERC721_TokenOfOwnerByIndex(this ThirdwebContract contract, string ownerAddress, BigInteger index)
Parameters
contract
ThirdwebContractThe contract to interact with.
ownerAddress
stringThe address of the owner.
index
BigIntegerThe index of the token.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the token ID.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentException
Thrown when the owner address is null or empty.
ERC721_TokenURI(ThirdwebContract, BigInteger)
Get the URI of a specific token.
public static Task<string> ERC721_TokenURI(this ThirdwebContract contract, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<string>
A task representing the asynchronous operation, with a string result containing the token URI.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
ERC721_TotalSupply(ThirdwebContract)
Get the total supply of the token.
public static Task<BigInteger> ERC721_TotalSupply(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to interact with.
Returns
- Task<BigInteger>
A task representing the asynchronous operation, with a BigInteger result containing the total supply.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
ERC721_TransferFrom(ThirdwebContract, IThirdwebWallet, string, string, BigInteger)
Transfer a specific token from one address to another.
public static Task<ThirdwebTransactionReceipt> ERC721_TransferFrom(this ThirdwebContract contract, IThirdwebWallet wallet, string fromAddress, string toAddress, BigInteger tokenId)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
fromAddress
stringThe address of the sender.
toAddress
stringThe address of the recipient.
tokenId
BigIntegerThe ID of the token.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the sender address or recipient address is null or empty.
GetBalance(IThirdwebWallet, BigInteger, string)
Retrieves the balance of the specified wallet on the specified chain.
public static Task<BigInteger> GetBalance(this IThirdwebWallet wallet, BigInteger chainId, string erc20ContractAddress = null)
Parameters
wallet
IThirdwebWalletThe wallet to retrieve the balance for.
chainId
BigIntegerThe chain ID to retrieve the balance from.
erc20ContractAddress
stringThe optional ERC20 contract address to retrieve the balance from.
Returns
- Task<BigInteger>
A task that represents the asynchronous operation. The task result contains the balance in Wei.
Exceptions
- ArgumentNullException
Thrown when the wallet is null.
- ArgumentOutOfRangeException
Thrown when the chain ID is less than or equal to 0.
GetBalance(ThirdwebContract, string)
Retrieves the balance of the specified contract.
public static Task<BigInteger> GetBalance(this ThirdwebContract contract, string erc20ContractAddress = null)
Parameters
contract
ThirdwebContractThe contract to retrieve the balance for.
erc20ContractAddress
stringThe optional ERC20 contract address to retrieve the balance from.
Returns
- Task<BigInteger>
A task that represents the asynchronous operation. The task result contains the balance in Wei.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
GetBalanceRaw(ThirdwebClient, BigInteger, string, string)
Retrieves the balance of the specified address on the specified chain.
public static Task<BigInteger> GetBalanceRaw(ThirdwebClient client, BigInteger chainId, string address, string erc20ContractAddress = null)
Parameters
client
ThirdwebClientThe client used to retrieve the balance.
chainId
BigIntegerThe chain ID to retrieve the balance from.
address
stringThe address to retrieve the balance for.
erc20ContractAddress
stringThe optional ERC20 contract address to retrieve the balance from.
Returns
- Task<BigInteger>
A task that represents the asynchronous operation. The task result contains the balance in Wei.
Exceptions
- ArgumentNullException
Thrown when the client is null.
- ArgumentOutOfRangeException
Thrown when the chain ID is less than or equal to 0.
- ArgumentException
Thrown when the address is null or empty.
GetDefaultRoyaltyInfo(ThirdwebContract)
Retrieves the default royalty information of the specified contract.
public static Task<RoyaltyInfoResult> GetDefaultRoyaltyInfo(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to retrieve the default royalty information for.
Returns
- Task<RoyaltyInfoResult>
A task that represents the asynchronous operation. The task result contains the royalty information.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
GetMetadata(ThirdwebContract)
Retrieves the metadata of the specified contract.
public static Task<ContractMetadata> GetMetadata(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to retrieve metadata for.
Returns
- Task<ContractMetadata>
A task that represents the asynchronous operation. The task result contains the contract metadata.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
GetNFTImageBytes(NFT, ThirdwebClient)
Retrieves the image bytes of the specified NFT.
public static Task<byte[]> GetNFTImageBytes(this NFT nft, ThirdwebClient client)
Parameters
nft
NFTThe NFT to retrieve the image bytes for.
client
ThirdwebClientThe client used to download the image bytes.
Returns
- Task<byte[]>
A task that represents the asynchronous operation. The task result contains the image bytes.
Exceptions
- ArgumentNullException
Thrown when the client is null.
GetPrimarySaleRecipient(ThirdwebContract)
Retrieves the primary sale recipient address of the specified contract.
public static Task<string> GetPrimarySaleRecipient(this ThirdwebContract contract)
Parameters
contract
ThirdwebContractThe contract to retrieve the primary sale recipient address for.
Returns
- Task<string>
A task that represents the asynchronous operation. The task result contains the primary sale recipient address.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
GetTransactionCount(IThirdwebWallet, BigInteger, string)
Retrieves the transaction count (i.e. nonce) of the specified wallet on the specified chain.
public static Task<BigInteger> GetTransactionCount(this IThirdwebWallet wallet, BigInteger chainId, string blocktag = "pending")
Parameters
wallet
IThirdwebWalletThe wallet to retrieve the transaction count for.
chainId
BigIntegerThe chain ID to retrieve the transaction count from.
blocktag
stringThe block tag to retrieve the transaction count at. Defaults to "pending".
Returns
- Task<BigInteger>
A task that represents the asynchronous operation. The task result contains the transaction count.
Exceptions
- ArgumentNullException
Thrown when the wallet is null.
- ArgumentOutOfRangeException
Thrown when the chain ID is less than or equal to 0.
GetTransactionCount(ThirdwebContract, string)
Retrieves the transaction count (i.e. nonce) of the specified contract.
public static Task<BigInteger> GetTransactionCount(this ThirdwebContract contract, string blocktag = "pending")
Parameters
contract
ThirdwebContractThe contract to retrieve the transaction count for.
blocktag
stringThe block tag to retrieve the transaction count at. Defaults to "pending".
Returns
- Task<BigInteger>
A task that represents the asynchronous operation. The task result contains the transaction count.
Exceptions
- ArgumentNullException
Thrown when the contract is null.
GetTransactionCountRaw(ThirdwebClient, BigInteger, string, string)
Retrieves the transaction count (i.e. nonce) of the specified address on the specified chain.
public static Task<BigInteger> GetTransactionCountRaw(ThirdwebClient client, BigInteger chainId, string address, string blocktag = "pending")
Parameters
client
ThirdwebClientThe client used to retrieve the transaction count.
chainId
BigIntegerThe chain ID to retrieve the transaction count from.
address
stringThe address to retrieve the transaction count for.
blocktag
stringThe block tag to retrieve the transaction count at. Defaults to "pending".
Returns
- Task<BigInteger>
A task that represents the asynchronous operation. The task result contains the transaction count.
Exceptions
- ArgumentNullException
Thrown when the client is null.
- ArgumentOutOfRangeException
Thrown when the chain ID is less than or equal to 0.
- ArgumentException
Thrown when the address is null or empty.
Prepare(ThirdwebContract, IThirdwebWallet, string, BigInteger, params object[])
Prepares a transaction for the specified method and parameters.
public static Task<ThirdwebTransaction> Prepare(this ThirdwebContract contract, IThirdwebWallet wallet, string method, BigInteger weiValue, params object[] parameters)
Parameters
contract
ThirdwebContractThe contract instance.
wallet
IThirdwebWalletThe wallet instance.
method
stringThe method to call.
weiValue
BigIntegerThe value in wei to send.
parameters
object[]The parameters for the method.
Returns
- Task<ThirdwebTransaction>
A prepared transaction.
Read<T>(ThirdwebContract, string, params object[])
Reads data from the contract using the specified method.
public static Task<T> Read<T>(this ThirdwebContract contract, string method, params object[] parameters)
Parameters
contract
ThirdwebContractThe contract instance.
method
stringThe method to call.
parameters
object[]The parameters for the method.
Returns
- Task<T>
The result of the method call.
Type Parameters
T
The type of the return value.
SupportsInterface(ThirdwebContract, string)
Returns whether the contract supports the specified interface.
public static Task<bool> SupportsInterface(this ThirdwebContract contract, string interfaceId)
Parameters
contract
ThirdwebContractThe contract instance.
interfaceId
stringThe interface ID to check.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating whether the contract supports the interface.
Exceptions
TokenERC1155_GenerateMintSignature(ThirdwebContract, IThirdwebWallet, TokenERC1155_MintRequest, NFTMetadata?)
Generate a mint signature for ERC1155 tokens.
public static Task<(TokenERC1155_MintRequest, string)> TokenERC1155_GenerateMintSignature(this ThirdwebContract contract, IThirdwebWallet wallet, TokenERC1155_MintRequest mintRequest, NFTMetadata? metadataOverride = null)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for generating the signature.
mintRequest
TokenERC1155_MintRequestThe mint request containing the minting details.
metadataOverride
NFTMetadata?Optional metadata override for the token.
Returns
- Task<(TokenERC1155_MintRequest, string)>
A task representing the asynchronous operation, with a tuple containing the mint request and the generated signature.
Exceptions
- ArgumentNullException
Thrown when the contract, wallet, or mint request is null.
- ArgumentException
Thrown when the MintRequest URI or NFTMetadata override is not provided.
TokenERC1155_MintTo(ThirdwebContract, IThirdwebWallet, string, BigInteger, BigInteger, string)
Mint a specific quantity of ERC1155 tokens to a receiver address with a given URI.
public static Task<ThirdwebTransactionReceipt> TokenERC1155_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, BigInteger tokenId, BigInteger quantity, string uri)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
receiverAddress
stringThe address of the receiver.
tokenId
BigIntegerThe ID of the token.
quantity
BigIntegerThe quantity of tokens to mint.
uri
stringThe URI of the token metadata.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract, wallet, or URI is null.
- ArgumentException
Thrown when the receiver address is null or empty.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0 or the quantity is less than or equal to 0.
TokenERC1155_MintTo(ThirdwebContract, IThirdwebWallet, string, BigInteger, BigInteger, NFTMetadata)
Mint a specific quantity of ERC1155 tokens to a receiver address with metadata.
public static Task<ThirdwebTransactionReceipt> TokenERC1155_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, BigInteger tokenId, BigInteger quantity, NFTMetadata metadata)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
receiverAddress
stringThe address of the receiver.
tokenId
BigIntegerThe ID of the token.
quantity
BigIntegerThe quantity of tokens to mint.
metadata
NFTMetadataThe metadata of the token.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the receiver address is null or empty.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0 or the quantity is less than or equal to 0.
TokenERC1155_MintWithSignature(ThirdwebContract, IThirdwebWallet, TokenERC1155_MintRequest, string)
Mint ERC1155 tokens with a signature.
public static Task<ThirdwebTransactionReceipt> TokenERC1155_MintWithSignature(this ThirdwebContract contract, IThirdwebWallet wallet, TokenERC1155_MintRequest mintRequest, string signature)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
mintRequest
TokenERC1155_MintRequestThe mint request containing the minting details.
signature
stringThe signature to authorize the minting.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract, wallet, or mint request is null.
- ArgumentException
Thrown when the signature is null or empty.
TokenERC1155_VerifyMintSignature(ThirdwebContract, TokenERC1155_MintRequest, string)
Verify a mint signature for ERC1155 tokens.
public static Task<VerifyResult> TokenERC1155_VerifyMintSignature(this ThirdwebContract contract, TokenERC1155_MintRequest mintRequest, string signature)
Parameters
contract
ThirdwebContractThe contract to interact with.
mintRequest
TokenERC1155_MintRequestThe mint request containing the minting details.
signature
stringThe signature to verify.
Returns
- Task<VerifyResult>
A task representing the asynchronous operation, with a VerifyResult result containing the verification details.
Exceptions
- ArgumentNullException
Thrown when the contract or mint request is null.
- ArgumentException
Thrown when the signature is null or empty.
TokenERC20_GenerateMintSignature(ThirdwebContract, IThirdwebWallet, TokenERC20_MintRequest)
Generate a mint signature for ERC20 tokens.
public static Task<(TokenERC20_MintRequest, string)> TokenERC20_GenerateMintSignature(this ThirdwebContract contract, IThirdwebWallet wallet, TokenERC20_MintRequest mintRequest)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for generating the signature.
mintRequest
TokenERC20_MintRequestThe mint request containing the minting details.
Returns
- Task<(TokenERC20_MintRequest, string)>
A task representing the asynchronous operation, with a tuple containing the mint request and the generated signature.
Exceptions
- ArgumentNullException
Thrown when the contract, wallet, or mint request is null.
TokenERC20_MintTo(ThirdwebContract, IThirdwebWallet, string, string)
Mint a specific amount of ERC20 tokens to a receiver address.
public static Task<ThirdwebTransactionReceipt> TokenERC20_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, string amount)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
receiverAddress
stringThe address of the receiver.
amount
stringThe amount of tokens to mint.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the receiver address or amount is null or empty.
TokenERC20_MintWithSignature(ThirdwebContract, IThirdwebWallet, TokenERC20_MintRequest, string)
Mint ERC20 tokens with a signature.
public static Task<ThirdwebTransactionReceipt> TokenERC20_MintWithSignature(this ThirdwebContract contract, IThirdwebWallet wallet, TokenERC20_MintRequest mintRequest, string signature)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
mintRequest
TokenERC20_MintRequestThe mint request containing the minting details.
signature
stringThe signature to authorize the minting.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract, wallet, or mint request is null.
- ArgumentException
Thrown when the signature is null or empty.
TokenERC20_VerifyMintSignature(ThirdwebContract, TokenERC20_MintRequest, string)
Verify a mint signature for ERC20 tokens.
public static Task<VerifyResult> TokenERC20_VerifyMintSignature(this ThirdwebContract contract, TokenERC20_MintRequest mintRequest, string signature)
Parameters
contract
ThirdwebContractThe contract to interact with.
mintRequest
TokenERC20_MintRequestThe mint request containing the minting details.
signature
stringThe signature to verify.
Returns
- Task<VerifyResult>
A task representing the asynchronous operation, with a VerifyResult result containing the verification details.
Exceptions
- ArgumentNullException
Thrown when the contract or mint request is null.
- ArgumentException
Thrown when the signature is null or empty.
TokenERC721_GenerateMintSignature(ThirdwebContract, IThirdwebWallet, TokenERC721_MintRequest, NFTMetadata?)
Generate a mint signature for ERC721 tokens.
public static Task<(TokenERC721_MintRequest, string)> TokenERC721_GenerateMintSignature(this ThirdwebContract contract, IThirdwebWallet wallet, TokenERC721_MintRequest mintRequest, NFTMetadata? metadataOverride = null)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for generating the signature.
mintRequest
TokenERC721_MintRequestThe mint request containing the minting details.
metadataOverride
NFTMetadata?Optional metadata override for the token.
Returns
- Task<(TokenERC721_MintRequest, string)>
A task representing the asynchronous operation, with a tuple containing the mint request and the generated signature.
Exceptions
- ArgumentNullException
Thrown when the contract, wallet, or mint request is null.
TokenERC721_MintTo(ThirdwebContract, IThirdwebWallet, string, string)
Mint a specific ERC721 token to a receiver address with a given URI.
public static Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, string uri)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
receiverAddress
stringThe address of the receiver.
uri
stringThe URI of the token metadata.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the receiver address or URI is null or empty.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
TokenERC721_MintTo(ThirdwebContract, IThirdwebWallet, string, NFTMetadata)
Mint a specific ERC721 token to a receiver address with metadata.
public static Task<ThirdwebTransactionReceipt> TokenERC721_MintTo(this ThirdwebContract contract, IThirdwebWallet wallet, string receiverAddress, NFTMetadata metadata)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
receiverAddress
stringThe address of the receiver.
metadata
NFTMetadataThe metadata of the token.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract or wallet is null.
- ArgumentException
Thrown when the receiver address is null or empty.
- ArgumentOutOfRangeException
Thrown when the token ID is less than 0.
TokenERC721_MintWithSignature(ThirdwebContract, IThirdwebWallet, TokenERC721_MintRequest, string)
Mint ERC721 tokens with a signature.
public static Task<ThirdwebTransactionReceipt> TokenERC721_MintWithSignature(this ThirdwebContract contract, IThirdwebWallet wallet, TokenERC721_MintRequest mintRequest, string signature)
Parameters
contract
ThirdwebContractThe contract to interact with.
wallet
IThirdwebWalletThe wallet to use for the transaction.
mintRequest
TokenERC721_MintRequestThe mint request containing the minting details.
signature
stringThe signature to authorize the minting.
Returns
- Task<ThirdwebTransactionReceipt>
A task representing the asynchronous operation, with a ThirdwebTransactionReceipt result.
Exceptions
- ArgumentNullException
Thrown when the contract, wallet, or mint request is null.
- ArgumentException
Thrown when the signature is null or empty.
TokenERC721_VerifyMintSignature(ThirdwebContract, TokenERC721_MintRequest, string)
Verify a mint signature for ERC721 tokens.
public static Task<VerifyResult> TokenERC721_VerifyMintSignature(this ThirdwebContract contract, TokenERC721_MintRequest mintRequest, string signature)
Parameters
contract
ThirdwebContractThe contract to interact with.
mintRequest
TokenERC721_MintRequestThe mint request containing the minting details.
signature
stringThe signature to verify.
Returns
- Task<VerifyResult>
A task representing the asynchronous operation, with a VerifyResult result containing the verification details.
Exceptions
- ArgumentNullException
Thrown when the contract or mint request is null.
- ArgumentException
Thrown when the signature is null or empty.
Transfer(IThirdwebWallet, BigInteger, string, BigInteger, string)
Transfers the specified amount of Wei to the specified address. Passing tokenAddress will override this function to transfer ERC20 tokens.
public static Task<ThirdwebTransactionReceipt> Transfer(this IThirdwebWallet wallet, BigInteger chainId, string toAddress, BigInteger weiAmount, string tokenAddress = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE")
Parameters
wallet
IThirdwebWalletThe wallet to transfer from.
chainId
BigIntegerThe chain ID to transfer on.
toAddress
stringThe address to transfer to.
weiAmount
BigIntegerThe amount of Wei to transfer.
tokenAddress
stringThe optional token address to transfer from. Defaults to the native token address (ETH or equivalent).
Returns
- Task<ThirdwebTransactionReceipt>
A task that represents the asynchronous operation. The task result contains the transaction receipt.
Exceptions
- ArgumentNullException
Thrown when the wallet is null.
- ArgumentOutOfRangeException
Thrown when the chain ID is less than or equal to 0.
- ArgumentException
Thrown when the recipient address is null or empty.
Write(ThirdwebContract, IThirdwebWallet, string, BigInteger, params object[])
Writes data to the contract using the specified method and parameters.
public static Task<ThirdwebTransactionReceipt> Write(this ThirdwebContract contract, IThirdwebWallet wallet, string method, BigInteger weiValue, params object[] parameters)
Parameters
contract
ThirdwebContractThe contract instance.
wallet
IThirdwebWalletThe wallet instance.
method
stringThe method to call.
weiValue
BigIntegerThe value in wei to send.
parameters
object[]The parameters for the method.
Returns
- Task<ThirdwebTransactionReceipt>
A transaction receipt.