ERC721Contract class
ERC-721 NFT contract implementation.
Constructors
- ERC721Contract({required String address, required PublicClient publicClient, WalletClient? walletClient})
Properties
- address → String
-
The contract address.
finalinherited
-
errors
→ List<
AbiError> -
The contract errors.
finalinherited
-
events
→ List<
AbiEvent> -
The contract events.
finalinherited
-
functions
→ List<
AbiFunction> -
The contract functions.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- publicClient → PublicClient
-
The public client for read operations.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- walletClient → WalletClient?
-
The wallet client for write operations (optional).
finalinherited
Methods
-
approvalFilter(
{String? owner, String? approved, BigInt? tokenId}) → EventFilter - Creates a filter for Approval events.
-
approvalForAllFilter(
{String? owner, String? operator}) → EventFilter - Creates a filter for ApprovalForAll events.
-
approve(
String to, BigInt tokenId) → Future< String> - Approves an address to transfer a specific token.
-
balanceOf(
String owner) → Future< BigInt> - Gets the balance (number of tokens) of an owner.
-
createEventFilter(
String eventName, {Map< String, dynamic> ? indexedArgs, String? fromBlock, String? toBlock}) → EventFilter -
Creates an event filter for the specified event.
inherited
-
decodeError(
Uint8List data) → String? -
Decodes an error from revert data.
inherited
-
decodeEventLog(
Log log) → Map< String, dynamic> ? -
Decodes an event log.
inherited
-
estimateGas(
String functionName, List args, {String? from, BigInt? value}) → Future< BigInt> -
Estimates gas for a contract function call.
inherited
-
getApproved(
BigInt tokenId) → Future< String> - Gets the approved address for a token.
-
isApprovedForAll(
String owner, String operator) → Future< bool> - Checks if an operator is approved for all tokens of an owner.
-
name(
) → Future< String> - Gets the collection name.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
ownerOf(
BigInt tokenId) → Future< String> - Gets the owner of a token.
-
read(
String functionName, List args, [String block = 'latest']) → Future< List> -
Executes a read-only contract function call.
inherited
-
safeTransferFrom(
String from, String to, BigInt tokenId, [String? data]) → Future< String> - Safely transfers a token (checks if recipient can receive NFTs).
-
setApprovalForAll(
String operator, bool approved) → Future< String> - Sets approval for all tokens.
-
simulate(
String functionName, List args, {String? from, BigInt? value, String block = 'latest'}) → Future< SimulateResult> -
Simulates a contract function call.
inherited
-
symbol(
) → Future< String> - Gets the collection symbol.
-
tokenURI(
BigInt tokenId) → Future< String> - Gets the token URI for metadata.
-
toString(
) → String -
A string representation of this object.
inherited
-
transferFilter(
{String? from, String? to, BigInt? tokenId}) → EventFilter - Creates a filter for Transfer events.
-
transferFrom(
String from, String to, BigInt tokenId) → Future< String> - Transfers a token from one address to another.
-
write(
String functionName, List args, {BigInt? value, BigInt? gasLimit, BigInt? gasPrice, BigInt? maxFeePerGas, BigInt? maxPriorityFeePerGas}) → Future< String> -
Executes a state-changing contract function.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited