TokenEvent class

Represents different types of token events.

This class provides a way to handle different token events such as native token events, ERC-20 token transfers, and ERC-721 token transfers.

Implementers
Annotations
  • @Freezed(unionKey: 'type')

Constructors

TokenEvent.erc20Transfer({required String symbol, @JsonKey(fromJson: nameFromJson) required String name, required int decimals, @JsonKey(fromJson: addressFromJson) required String address, required BigInt value, String? to, String? from})
Represents an ERC-20 token transfer event.
const
factory
TokenEvent.erc721Transfer({required String symbol, @JsonKey(fromJson: nameFromJson) required String name, @JsonKey(fromJson: addressFromJson) required String address, required BigInt value, BigInt? tokenId, String? to, String? from})
Represents an ERC-721 token transfer event.
const
factory
TokenEvent.fromJson(Map<String, dynamic> json)
Constructs a new TokenEvent instance from the provided JSON object.
factory
TokenEvent.nativeToken({@Default('FUSE') String symbol, @Default('Fuse Token') String name, @Default(18) int decimals, @Default(Variables.NATIVE_TOKEN_ADDRESS) String address, @JsonKey(fromJson: amountFromJson) required BigInt value, String? to, String? from})
Represents a native token event.
const
factory

Properties

address String
no setterinherited
copyWith → $TokenEventCopyWith<TokenEvent>
no setterinherited
from String?
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
name String
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
symbol String
no setterinherited
to String?
no setterinherited
value BigInt
no setterinherited

Methods

map<TResult extends Object?>({required TResult nativeToken(NativeToken value), required TResult erc20Transfer(ERC20Transfer value), required TResult erc721Transfer(ERC721Transfer value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult? nativeToken(NativeToken value)?, TResult? erc20Transfer(ERC20Transfer value)?, TResult? erc721Transfer(ERC721Transfer value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult nativeToken(NativeToken value)?, TResult erc20Transfer(ERC20Transfer value)?, TResult erc721Transfer(ERC721Transfer value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult nativeToken(String symbol, String name, int decimals, String address, BigInt value, String? to, String? from)?, TResult erc20Transfer(String symbol, String name, int decimals, String address, BigInt value, String? to, String? from)?, TResult erc721Transfer(String symbol, String name, String address, BigInt value, BigInt? tokenId, String? to, String? from)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult nativeToken(String symbol, String name, int decimals, String address, BigInt value, String? to, String? from), required TResult erc20Transfer(String symbol, String name, int decimals, String address, BigInt value, String? to, String? from), required TResult erc721Transfer(String symbol, String name, String address, BigInt value, BigInt? tokenId, String? to, String? from)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult? nativeToken(String symbol, String name, int decimals, String address, BigInt value, String? to, String? from)?, TResult? erc20Transfer(String symbol, String name, int decimals, String address, BigInt value, String? to, String? from)?, TResult? erc721Transfer(String symbol, String name, String address, BigInt value, BigInt? tokenId, String? to, String? from)?}) → TResult?
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited