NFT class
Universal NFT model that works across different blockchains
- Annotations
-
- @JsonSerializable.new()
Constructors
-
NFT({required String id, required String tokenId, required String contractAddress, required BlockchainNetwork network, required NFTMetadata metadata, required String owner, required String creator, required DateTime createdAt, required DateTime updatedAt, required String status, double? currentValue, String? valueCurrency, required List<
String> transactionHistory, Map<String, dynamic> additionalProperties = const {}}) -
const
-
NFT.fromJson(Map<
String, dynamic> json) -
Create NFT from JSON
factory
Properties
-
additionalProperties
→ Map<
String, dynamic> -
Additional properties specific to the blockchain
final
- contractAddress → String
-
Contract address or canister ID
final
- createdAt → DateTime
-
When the NFT was created
final
- creator → String
-
Creator address
final
- currentValue → double?
-
Current market value (if available)
final
- formattedContractAddress → String
-
Get formatted address for display
no setter
- formattedCreator → String
-
Get formatted creator address for display
no setter
- formattedOwner → String
-
Get formatted owner address for display
no setter
- formattedValue → String
-
Get formatted current value
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Unique identifier of the NFT
final
- isBurnable → bool
-
Check if NFT is burnable
no setter
- isPausable → bool
-
Check if NFT is pausable
no setter
- isTransferable → bool
-
Check if NFT is transferable
no setter
- metadata → NFTMetadata
-
NFT metadata
final
- network → BlockchainNetwork
-
Blockchain network this NFT belongs to
final
- networkDisplayName → String
-
Get network display name
no setter
- owner → String
-
Current owner address
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- rarity → NFTRarity
-
Get the rarity of the NFT based on metadata
no setter
- royaltyPercentage → double
-
Get royalty percentage
no setter
- royaltyRecipient → String?
-
Get royalty recipient
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → String
-
Current status of the NFT
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - tokenId → String
-
Token ID on the blockchain
final
-
transactionHistory
→ List<
String> -
Transaction history
final
- updatedAt → DateTime
-
When the NFT was last updated
final
- valueCurrency → String?
-
Currency of the current value
final
Methods
-
copyWith(
{String? id, String? tokenId, String? contractAddress, BlockchainNetwork? network, NFTMetadata? metadata, String? owner, String? creator, DateTime? createdAt, DateTime? updatedAt, String? status, double? currentValue, String? valueCurrency, List< String> ? transactionHistory, Map<String, dynamic> ? additionalProperties}) → NFT - Create a copy of the NFT with updated fields
-
isCreatedBy(
String address) → bool - Check if NFT is created by the given address
-
isOwnedBy(
String address) → bool - Check if NFT is owned by the given address
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Convert NFT to JSON
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited